mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 19:25:23 +00:00
Fixed exports and compiled function to ESM
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
"engines": {
|
||||
"node": "16"
|
||||
},
|
||||
"type": "module",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"axios": "^1.2.6",
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import functions from "firebase-functions";
|
||||
import * as functions from "firebase-functions";
|
||||
import admin from "firebase-admin";
|
||||
import { PKPass } from "passkit-generator";
|
||||
import passkit from "passkit-generator";
|
||||
import type { Barcode, TransitType } from "passkit-generator";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import os from "node:os";
|
||||
|
||||
const PKPass = passkit.PKPass;
|
||||
|
||||
// Firebase init
|
||||
admin
|
||||
.initializeApp
|
||||
@@ -57,7 +59,7 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
exports.pass = functions.https.onRequest(async (request, response) => {
|
||||
export const pass = functions.https.onRequest(async (request, response) => {
|
||||
const newPass = await PKPass.from(
|
||||
{
|
||||
// Get relevant pass model from model folder (see passkit-generator/examples/models/)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2016",
|
||||
"target": "ESNext",
|
||||
"module": "NodeNext",
|
||||
"rootDir": "src",
|
||||
"moduleResolution": "NodeNext",
|
||||
|
||||
Reference in New Issue
Block a user