@unchainedshop/ticketing 4.8.21 → 4.8.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import apn from '@parse/node-apn';
|
|
2
1
|
import { Readable } from 'node:stream';
|
|
3
|
-
export declare const pushToApplePushNotificationService: (deviceTokens: any) => Promise<
|
|
2
|
+
export declare const pushToApplePushNotificationService: (deviceTokens: any) => Promise<any>;
|
|
4
3
|
export declare const buildPassBinary: (tokenSerialNumber: string, pass: {
|
|
5
4
|
serialNumber: string;
|
|
6
5
|
asBuffer: () => Promise<Buffer>;
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import apn from '@parse/node-apn';
|
|
2
1
|
import { Readable } from 'node:stream';
|
|
2
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
3
|
+
const logger = createLogger('unchained:apple-wallet-webservice');
|
|
4
|
+
let apn;
|
|
5
|
+
try {
|
|
6
|
+
const module = await import('@parse/node-apn');
|
|
7
|
+
apn = module.default;
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (error?.code === 'ERR_MODULE_NOT_FOUND' &&
|
|
11
|
+
String(error?.message).includes('@parse/node-apn')) {
|
|
12
|
+
logger.warn(`optional peer npm package '@parse/node-apn' not installed, apple wallet pass update notifications will not work`);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
logger.error(`failed to load '@parse/node-apn'`, error);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
3
18
|
export const pushToApplePushNotificationService = async (deviceTokens) => {
|
|
19
|
+
if (!apn) {
|
|
20
|
+
throw new Error("npm dependency '@parse/node-apn' is not installed, please install it to push pass updates");
|
|
21
|
+
}
|
|
4
22
|
const apnProvider = new apn.Provider({
|
|
5
23
|
cert: process.env.PASS_CERTIFICATE_PATH,
|
|
6
24
|
key: process.env.PASS_CERTIFICATE_PATH,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/ticketing",
|
|
3
3
|
"description": "Event ticketing extension for the Unchained Engine with PDF and wallet pass support",
|
|
4
|
-
"version": "4.8.
|
|
4
|
+
"version": "4.8.22",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@parse/node-apn": {
|
|
53
|
-
"optional":
|
|
53
|
+
"optional": true
|
|
54
54
|
},
|
|
55
55
|
"express": {
|
|
56
56
|
"optional": true
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
+
"@parse/node-apn": "^8.1.0",
|
|
63
64
|
"@types/express": "^5.0.3",
|
|
64
65
|
"@types/node": "^26.2.0",
|
|
65
66
|
"express": "^5.1.0",
|