Updated serverless example to run on ESM

This commit is contained in:
Alexander Cerutti
2025-01-11 15:43:32 +01:00
parent 4044125e6a
commit 8c8763f8cd
11 changed files with 156 additions and 141 deletions

View File

@@ -1,9 +1,9 @@
import { ALBEvent, ALBResult } from "aws-lambda";
import { PKPass } from "../../../../lib";
import { PKPass } from "passkit-generator";
import {
throwClientErrorWithoutModelName,
createPassGenerator,
} from "../shared";
} from "../shared.js";
/**
* Lambda for barcodes example

View File

@@ -3,7 +3,7 @@ import { PKPass } from "passkit-generator";
import {
throwClientErrorWithoutModelName,
createPassGenerator,
} from "../shared";
} from "../shared.js";
/**
* Lambda for expirationDate example

View File

@@ -1,6 +1,6 @@
import { ALBEvent, ALBResult } from "aws-lambda";
import { PKPass } from "passkit-generator";
import { createPassGenerator } from "../shared";
import { createPassGenerator } from "../shared.js";
/**
* Lambda for fields example

View File

@@ -1,6 +1,6 @@
export * from "./barcodes";
export * from "./expirationDate";
export * from "./fields";
export * from "./localize";
export * from "./pkpasses";
export * from "./scratch";
export * from "./barcodes.js";
export * from "./expirationDate.js";
export * from "./fields.js";
export * from "./localize.js";
export * from "./pkpasses.js";
export * from "./scratch.js";

View File

@@ -1,7 +1,7 @@
import {
throwClientErrorWithoutModelName,
createPassGenerator,
} from "../shared";
} from "../shared.js";
import type { ALBEvent, ALBResult } from "aws-lambda";
import type { PKPass } from "passkit-generator";

View File

@@ -37,7 +37,7 @@ import {
getS3Instance,
getRandomColorPart,
throwClientErrorWithoutModelName,
} from "../shared";
} from "../shared.js";
import config from "../../config.json";
/**

View File

@@ -4,7 +4,7 @@ import {
createPassGenerator,
getRandomColorPart,
getSpecificFileInModel,
} from "../shared";
} from "../shared.js";
/**
* Lambda for scratch example

View File

@@ -1 +1 @@
export * from "./functions";
export * from "./functions/index.js";