mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 16:25:21 +00:00
Fixed exports and compiled function to ESM
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": "16"
|
"node": "16"
|
||||||
},
|
},
|
||||||
|
"type": "module",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.2.6",
|
"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 admin from "firebase-admin";
|
||||||
import { PKPass } from "passkit-generator";
|
import passkit from "passkit-generator";
|
||||||
import type { Barcode, TransitType } from "passkit-generator";
|
import type { Barcode, TransitType } from "passkit-generator";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import os from "node:os";
|
import os from "node:os";
|
||||||
|
|
||||||
|
const PKPass = passkit.PKPass;
|
||||||
|
|
||||||
// Firebase init
|
// Firebase init
|
||||||
admin
|
admin
|
||||||
.initializeApp
|
.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(
|
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/)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2016",
|
"target": "ESNext",
|
||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
|
|||||||
Reference in New Issue
Block a user