mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 11:25:17 +00:00
Updated firebase function example
This commit is contained in:
@@ -10,23 +10,24 @@
|
||||
"build": "rm -rf lib && pnpm tsc"
|
||||
},
|
||||
"engines": {
|
||||
"node": "16"
|
||||
"node": "20"
|
||||
},
|
||||
"type": "module",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"firebase-admin": "^11.11.1",
|
||||
"firebase-functions": "^4.9.0",
|
||||
"tslib": "^2.7.0",
|
||||
"firebase-admin": "^13.0.2",
|
||||
"firebase-functions": "^6.2.0",
|
||||
"tslib": "^2.8.1",
|
||||
"passkit-generator": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"passkit-generator": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"firebase-functions-test": "^0.2.3",
|
||||
"firebase-tools": "^12.9.1",
|
||||
"typescript": "^5.7.3"
|
||||
"firebase-functions-test": "^3.4.0",
|
||||
"firebase-tools": "^13.29.1",
|
||||
"typescript": "^5.7.3",
|
||||
"@types/node": "^20"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as functions from "firebase-functions";
|
||||
import * as functions from "firebase-functions/https";
|
||||
import { initializeApp } from "firebase-admin/app";
|
||||
import { getStorage } from "firebase-admin/storage";
|
||||
import passkit from "passkit-generator";
|
||||
import { PKPass } from "passkit-generator";
|
||||
import type { Barcode, TransitType } from "passkit-generator";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
@@ -12,8 +12,6 @@ import os from "node:os";
|
||||
// Should probably not be used in production
|
||||
import startData from "./startData.json" assert { type: "json" };
|
||||
|
||||
const PKPass = passkit.PKPass;
|
||||
|
||||
interface RequestWithBody extends functions.Request {
|
||||
body: {
|
||||
passModel: string;
|
||||
@@ -68,7 +66,7 @@ initializeApp({
|
||||
|
||||
const storageRef = getStorage().bucket();
|
||||
|
||||
export const pass = functions.https.onRequest(
|
||||
export const pass = functions.onRequest(
|
||||
async (request: RequestWithBody, response) => {
|
||||
let modelBasePath: string;
|
||||
|
||||
|
||||
2042
pnpm-lock.yaml
generated
2042
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user