Changed how body params are defined to prevent build issues with internals

This commit is contained in:
Alexander Cerutti
2023-07-30 00:07:13 +02:00
parent fb6e6739b5
commit 2a4e21ac12

View File

@@ -19,9 +19,7 @@ admin
const storageRef = admin.storage().bucket(); const storageRef = admin.storage().bucket();
// Declaring our request protocol interface RequestWithBody extends functions.Request {
declare module "firebase-functions" {
interface HttpRequest {
body: { body: {
passModel: string; passModel: string;
serialNumber: string; serialNumber: string;
@@ -44,7 +42,6 @@ declare module "firebase-functions" {
thumbnailFile: string; thumbnailFile: string;
logoFile: string; logoFile: string;
}; };
}
} }
// Declaring our .env contents // Declaring our .env contents
@@ -59,7 +56,8 @@ declare global {
} }
} }
export const pass = functions.https.onRequest(async (request, response) => { export const pass = functions.https.onRequest(
async (request: RequestWithBody, response) => {
const newPass = await PKPass.from( const newPass = await PKPass.from(
{ {
// Get relevant pass model from model folder (see passkit-generator/examples/models/) // Get relevant pass model from model folder (see passkit-generator/examples/models/)
@@ -270,4 +268,5 @@ export const pass = functions.https.onRequest(async (request, response) => {
result: "FAILED", result: "FAILED",
}); });
} }
}); },
);