@modainteract/moda-interact-shared 0.1.0 → 0.3.0
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.
- package/README.md +709 -58
- package/dist/chunk-T6DNWLWW.js +303 -0
- package/dist/chunk-T6DNWLWW.js.map +1 -0
- package/dist/chunk-XU4XX7SD.js +27 -0
- package/dist/chunk-XU4XX7SD.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +43 -7
- package/dist/logging/index.d.ts +45 -0
- package/dist/logging/index.js +241 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/node.d.ts +103 -0
- package/dist/logging/node.js +373 -0
- package/dist/logging/node.js.map +1 -0
- package/dist/shopify/index.d.ts +266 -10
- package/dist/shopify/index.js +43 -7
- package/dist/shopify/node.d.ts +6 -3
- package/dist/shopify/node.js +22 -7
- package/dist/shopify/node.js.map +1 -1
- package/package.json +17 -2
- package/dist/chunk-NE5RMNXU.js +0 -142
- package/dist/chunk-NE5RMNXU.js.map +0 -1
package/dist/shopify/index.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
declare const SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V1: 1;
|
|
4
|
+
declare const SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V2: 2;
|
|
3
5
|
declare const SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION: 1;
|
|
4
|
-
declare const SHOPIFY_COMMERCE_QUEUE: "commerce-events";
|
|
5
|
-
declare const SHOPIFY_COMMERCE_JOB: "shopify-commerce-event";
|
|
6
6
|
declare const SHOPIFY_COMMERCE_EVENT_TYPES: {
|
|
7
7
|
readonly CHECKOUT_OBSERVED: "checkout.observed";
|
|
8
8
|
readonly ORDER_COMPLETED: "order.completed";
|
|
9
9
|
};
|
|
10
|
+
declare const SHOPIFY_RECOVERY_EVENT_TYPES_V2: {
|
|
11
|
+
readonly CHECKOUT_CREATED: "checkout.created";
|
|
12
|
+
readonly CHECKOUT_UPDATED: "checkout.updated";
|
|
13
|
+
readonly ORDER_COMPLETED: "order.completed";
|
|
14
|
+
};
|
|
15
|
+
declare const SHOPIFY_WEBHOOK_OUTBOX_DESTINATIONS: {
|
|
16
|
+
readonly CHECKOUT_EVENTS: "CHECKOUT_EVENTS";
|
|
17
|
+
readonly ORDER_EVENTS: "ORDER_EVENTS";
|
|
18
|
+
};
|
|
10
19
|
|
|
11
20
|
declare const MAX_URL_LENGTH = 2048;
|
|
12
21
|
declare const MAX_LINE_ITEMS = 250;
|
|
@@ -87,7 +96,7 @@ type CheckoutObservedPayload = z.infer<typeof CheckoutObservedPayloadSchema>;
|
|
|
87
96
|
|
|
88
97
|
declare const OrderCompletedPayloadSchema: z.ZodObject<{
|
|
89
98
|
orderId: z.ZodString;
|
|
90
|
-
checkoutToken: z.ZodString
|
|
99
|
+
checkoutToken: z.ZodNullable<z.ZodString>;
|
|
91
100
|
shopifyCustomerId: z.ZodNullable<z.ZodString>;
|
|
92
101
|
total: z.ZodNullable<z.ZodObject<{
|
|
93
102
|
amount: z.ZodString;
|
|
@@ -162,7 +171,7 @@ declare const ShopifyOrderCompletedEventSchema: z.ZodObject<{
|
|
|
162
171
|
eventType: z.ZodLiteral<"order.completed">;
|
|
163
172
|
payload: z.ZodObject<{
|
|
164
173
|
orderId: z.ZodString;
|
|
165
|
-
checkoutToken: z.ZodString
|
|
174
|
+
checkoutToken: z.ZodNullable<z.ZodString>;
|
|
166
175
|
shopifyCustomerId: z.ZodNullable<z.ZodString>;
|
|
167
176
|
total: z.ZodNullable<z.ZodObject<{
|
|
168
177
|
amount: z.ZodString;
|
|
@@ -235,7 +244,7 @@ declare const ShopifyCommerceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
235
244
|
eventType: z.ZodLiteral<"order.completed">;
|
|
236
245
|
payload: z.ZodObject<{
|
|
237
246
|
orderId: z.ZodString;
|
|
238
|
-
checkoutToken: z.ZodString
|
|
247
|
+
checkoutToken: z.ZodNullable<z.ZodString>;
|
|
239
248
|
shopifyCustomerId: z.ZodNullable<z.ZodString>;
|
|
240
249
|
total: z.ZodNullable<z.ZodObject<{
|
|
241
250
|
amount: z.ZodString;
|
|
@@ -310,7 +319,7 @@ declare function safeParseShopifyCommerceEvent(input: unknown): z.ZodSafeParseRe
|
|
|
310
319
|
eventType: "order.completed";
|
|
311
320
|
payload: {
|
|
312
321
|
orderId: string;
|
|
313
|
-
checkoutToken: string;
|
|
322
|
+
checkoutToken: string | null;
|
|
314
323
|
shopifyCustomerId: string | null;
|
|
315
324
|
total: {
|
|
316
325
|
amount: string;
|
|
@@ -322,10 +331,257 @@ declare function safeParseShopifyCommerceEvent(input: unknown): z.ZodSafeParseRe
|
|
|
322
331
|
declare function isCheckoutObservedEvent(event: ShopifyCommerceEvent): event is ShopifyCheckoutObservedEvent;
|
|
323
332
|
declare function isOrderCompletedEvent(event: ShopifyCommerceEvent): event is ShopifyOrderCompletedEvent;
|
|
324
333
|
/**
|
|
325
|
-
* Stable ordering key for a shop/checkout pair.
|
|
326
|
-
* same checkout must share this key, so
|
|
327
|
-
*
|
|
334
|
+
* Stable ordering key for a shop/checkout pair.
|
|
335
|
+
* Checkout and order events for the same checkout must share this key, so
|
|
336
|
+
* deliveryId is intentionally excluded.
|
|
328
337
|
*/
|
|
329
338
|
declare function createShopifyCommerceOrderingKey(shopId: string, checkoutToken: string): string;
|
|
339
|
+
declare function createShopifyOrderOrderingKey(shopId: string, orderId: string): string;
|
|
340
|
+
|
|
341
|
+
declare const CheckoutCreatedPayloadV2Schema: z.ZodObject<{
|
|
342
|
+
checkoutToken: z.ZodString;
|
|
343
|
+
cartToken: z.ZodNullable<z.ZodString>;
|
|
344
|
+
abandonedCheckoutUrl: z.ZodNullable<z.ZodURL>;
|
|
345
|
+
checkoutCreatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
346
|
+
}, z.core.$strict>;
|
|
347
|
+
type CheckoutCreatedPayloadV2 = z.infer<typeof CheckoutCreatedPayloadV2Schema>;
|
|
348
|
+
|
|
349
|
+
declare const CheckoutUpdatedPayloadV2Schema: z.ZodObject<{
|
|
350
|
+
checkoutToken: z.ZodString;
|
|
351
|
+
}, z.core.$strict>;
|
|
352
|
+
type CheckoutUpdatedPayloadV2 = z.infer<typeof CheckoutUpdatedPayloadV2Schema>;
|
|
353
|
+
|
|
354
|
+
declare const OrderCompletedPayloadV2Schema: z.ZodObject<{
|
|
355
|
+
orderId: z.ZodString;
|
|
356
|
+
checkoutToken: z.ZodNullable<z.ZodString>;
|
|
357
|
+
cartToken: z.ZodNullable<z.ZodString>;
|
|
358
|
+
completedAt: z.ZodISODateTime;
|
|
359
|
+
}, z.core.$strict>;
|
|
360
|
+
type OrderCompletedPayloadV2 = z.infer<typeof OrderCompletedPayloadV2Schema>;
|
|
361
|
+
|
|
362
|
+
declare const ShopifyCheckoutCreatedEventV2Schema: z.ZodObject<{
|
|
363
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
364
|
+
receiptId: z.ZodString;
|
|
365
|
+
deliveryId: z.ZodString;
|
|
366
|
+
eventId: z.ZodNullable<z.ZodString>;
|
|
367
|
+
source: z.ZodLiteral<"shopify">;
|
|
368
|
+
providerTopic: z.ZodString;
|
|
369
|
+
tenant: z.ZodObject<{
|
|
370
|
+
shopId: z.ZodString;
|
|
371
|
+
shopDomain: z.ZodString;
|
|
372
|
+
}, z.core.$strict>;
|
|
373
|
+
occurredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
374
|
+
receivedAt: z.ZodISODateTime;
|
|
375
|
+
traceId: z.ZodString;
|
|
376
|
+
orderingKey: z.ZodString;
|
|
377
|
+
eventType: z.ZodLiteral<"checkout.created">;
|
|
378
|
+
payload: z.ZodObject<{
|
|
379
|
+
checkoutToken: z.ZodString;
|
|
380
|
+
cartToken: z.ZodNullable<z.ZodString>;
|
|
381
|
+
abandonedCheckoutUrl: z.ZodNullable<z.ZodURL>;
|
|
382
|
+
checkoutCreatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
383
|
+
}, z.core.$strict>;
|
|
384
|
+
}, z.core.$strict>;
|
|
385
|
+
type ShopifyCheckoutCreatedEventV2 = z.infer<typeof ShopifyCheckoutCreatedEventV2Schema>;
|
|
386
|
+
declare const ShopifyCheckoutUpdatedEventV2Schema: z.ZodObject<{
|
|
387
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
388
|
+
receiptId: z.ZodString;
|
|
389
|
+
deliveryId: z.ZodString;
|
|
390
|
+
eventId: z.ZodNullable<z.ZodString>;
|
|
391
|
+
source: z.ZodLiteral<"shopify">;
|
|
392
|
+
providerTopic: z.ZodString;
|
|
393
|
+
tenant: z.ZodObject<{
|
|
394
|
+
shopId: z.ZodString;
|
|
395
|
+
shopDomain: z.ZodString;
|
|
396
|
+
}, z.core.$strict>;
|
|
397
|
+
occurredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
398
|
+
receivedAt: z.ZodISODateTime;
|
|
399
|
+
traceId: z.ZodString;
|
|
400
|
+
orderingKey: z.ZodString;
|
|
401
|
+
eventType: z.ZodLiteral<"checkout.updated">;
|
|
402
|
+
payload: z.ZodObject<{
|
|
403
|
+
checkoutToken: z.ZodString;
|
|
404
|
+
}, z.core.$strict>;
|
|
405
|
+
}, z.core.$strict>;
|
|
406
|
+
type ShopifyCheckoutUpdatedEventV2 = z.infer<typeof ShopifyCheckoutUpdatedEventV2Schema>;
|
|
407
|
+
declare const ShopifyOrderCompletedEventV2Schema: z.ZodObject<{
|
|
408
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
409
|
+
receiptId: z.ZodString;
|
|
410
|
+
deliveryId: z.ZodString;
|
|
411
|
+
eventId: z.ZodNullable<z.ZodString>;
|
|
412
|
+
source: z.ZodLiteral<"shopify">;
|
|
413
|
+
providerTopic: z.ZodString;
|
|
414
|
+
tenant: z.ZodObject<{
|
|
415
|
+
shopId: z.ZodString;
|
|
416
|
+
shopDomain: z.ZodString;
|
|
417
|
+
}, z.core.$strict>;
|
|
418
|
+
occurredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
419
|
+
receivedAt: z.ZodISODateTime;
|
|
420
|
+
traceId: z.ZodString;
|
|
421
|
+
orderingKey: z.ZodString;
|
|
422
|
+
eventType: z.ZodLiteral<"order.completed">;
|
|
423
|
+
payload: z.ZodObject<{
|
|
424
|
+
orderId: z.ZodString;
|
|
425
|
+
checkoutToken: z.ZodNullable<z.ZodString>;
|
|
426
|
+
cartToken: z.ZodNullable<z.ZodString>;
|
|
427
|
+
completedAt: z.ZodISODateTime;
|
|
428
|
+
}, z.core.$strict>;
|
|
429
|
+
}, z.core.$strict>;
|
|
430
|
+
type ShopifyOrderCompletedEventV2 = z.infer<typeof ShopifyOrderCompletedEventV2Schema>;
|
|
431
|
+
declare const ShopifyRecoveryEventV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
432
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
433
|
+
receiptId: z.ZodString;
|
|
434
|
+
deliveryId: z.ZodString;
|
|
435
|
+
eventId: z.ZodNullable<z.ZodString>;
|
|
436
|
+
source: z.ZodLiteral<"shopify">;
|
|
437
|
+
providerTopic: z.ZodString;
|
|
438
|
+
tenant: z.ZodObject<{
|
|
439
|
+
shopId: z.ZodString;
|
|
440
|
+
shopDomain: z.ZodString;
|
|
441
|
+
}, z.core.$strict>;
|
|
442
|
+
occurredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
443
|
+
receivedAt: z.ZodISODateTime;
|
|
444
|
+
traceId: z.ZodString;
|
|
445
|
+
orderingKey: z.ZodString;
|
|
446
|
+
eventType: z.ZodLiteral<"checkout.created">;
|
|
447
|
+
payload: z.ZodObject<{
|
|
448
|
+
checkoutToken: z.ZodString;
|
|
449
|
+
cartToken: z.ZodNullable<z.ZodString>;
|
|
450
|
+
abandonedCheckoutUrl: z.ZodNullable<z.ZodURL>;
|
|
451
|
+
checkoutCreatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
452
|
+
}, z.core.$strict>;
|
|
453
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
454
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
455
|
+
receiptId: z.ZodString;
|
|
456
|
+
deliveryId: z.ZodString;
|
|
457
|
+
eventId: z.ZodNullable<z.ZodString>;
|
|
458
|
+
source: z.ZodLiteral<"shopify">;
|
|
459
|
+
providerTopic: z.ZodString;
|
|
460
|
+
tenant: z.ZodObject<{
|
|
461
|
+
shopId: z.ZodString;
|
|
462
|
+
shopDomain: z.ZodString;
|
|
463
|
+
}, z.core.$strict>;
|
|
464
|
+
occurredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
465
|
+
receivedAt: z.ZodISODateTime;
|
|
466
|
+
traceId: z.ZodString;
|
|
467
|
+
orderingKey: z.ZodString;
|
|
468
|
+
eventType: z.ZodLiteral<"checkout.updated">;
|
|
469
|
+
payload: z.ZodObject<{
|
|
470
|
+
checkoutToken: z.ZodString;
|
|
471
|
+
}, z.core.$strict>;
|
|
472
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
473
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
474
|
+
receiptId: z.ZodString;
|
|
475
|
+
deliveryId: z.ZodString;
|
|
476
|
+
eventId: z.ZodNullable<z.ZodString>;
|
|
477
|
+
source: z.ZodLiteral<"shopify">;
|
|
478
|
+
providerTopic: z.ZodString;
|
|
479
|
+
tenant: z.ZodObject<{
|
|
480
|
+
shopId: z.ZodString;
|
|
481
|
+
shopDomain: z.ZodString;
|
|
482
|
+
}, z.core.$strict>;
|
|
483
|
+
occurredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
484
|
+
receivedAt: z.ZodISODateTime;
|
|
485
|
+
traceId: z.ZodString;
|
|
486
|
+
orderingKey: z.ZodString;
|
|
487
|
+
eventType: z.ZodLiteral<"order.completed">;
|
|
488
|
+
payload: z.ZodObject<{
|
|
489
|
+
orderId: z.ZodString;
|
|
490
|
+
checkoutToken: z.ZodNullable<z.ZodString>;
|
|
491
|
+
cartToken: z.ZodNullable<z.ZodString>;
|
|
492
|
+
completedAt: z.ZodISODateTime;
|
|
493
|
+
}, z.core.$strict>;
|
|
494
|
+
}, z.core.$strict>], "eventType">;
|
|
495
|
+
type ShopifyRecoveryEventV2 = z.infer<typeof ShopifyRecoveryEventV2Schema>;
|
|
496
|
+
type ShopifyRecoveryEventTypeV2 = ShopifyRecoveryEventV2["eventType"];
|
|
497
|
+
declare function parseShopifyRecoveryEventV2(input: unknown): ShopifyRecoveryEventV2;
|
|
498
|
+
declare function safeParseShopifyRecoveryEventV2(input: unknown): z.ZodSafeParseResult<{
|
|
499
|
+
schemaVersion: 2;
|
|
500
|
+
receiptId: string;
|
|
501
|
+
deliveryId: string;
|
|
502
|
+
eventId: string | null;
|
|
503
|
+
source: "shopify";
|
|
504
|
+
providerTopic: string;
|
|
505
|
+
tenant: {
|
|
506
|
+
shopId: string;
|
|
507
|
+
shopDomain: string;
|
|
508
|
+
};
|
|
509
|
+
occurredAt: string | null;
|
|
510
|
+
receivedAt: string;
|
|
511
|
+
traceId: string;
|
|
512
|
+
orderingKey: string;
|
|
513
|
+
eventType: "checkout.created";
|
|
514
|
+
payload: {
|
|
515
|
+
checkoutToken: string;
|
|
516
|
+
cartToken: string | null;
|
|
517
|
+
abandonedCheckoutUrl: string | null;
|
|
518
|
+
checkoutCreatedAt: string | null;
|
|
519
|
+
};
|
|
520
|
+
} | {
|
|
521
|
+
schemaVersion: 2;
|
|
522
|
+
receiptId: string;
|
|
523
|
+
deliveryId: string;
|
|
524
|
+
eventId: string | null;
|
|
525
|
+
source: "shopify";
|
|
526
|
+
providerTopic: string;
|
|
527
|
+
tenant: {
|
|
528
|
+
shopId: string;
|
|
529
|
+
shopDomain: string;
|
|
530
|
+
};
|
|
531
|
+
occurredAt: string | null;
|
|
532
|
+
receivedAt: string;
|
|
533
|
+
traceId: string;
|
|
534
|
+
orderingKey: string;
|
|
535
|
+
eventType: "checkout.updated";
|
|
536
|
+
payload: {
|
|
537
|
+
checkoutToken: string;
|
|
538
|
+
};
|
|
539
|
+
} | {
|
|
540
|
+
schemaVersion: 2;
|
|
541
|
+
receiptId: string;
|
|
542
|
+
deliveryId: string;
|
|
543
|
+
eventId: string | null;
|
|
544
|
+
source: "shopify";
|
|
545
|
+
providerTopic: string;
|
|
546
|
+
tenant: {
|
|
547
|
+
shopId: string;
|
|
548
|
+
shopDomain: string;
|
|
549
|
+
};
|
|
550
|
+
occurredAt: string | null;
|
|
551
|
+
receivedAt: string;
|
|
552
|
+
traceId: string;
|
|
553
|
+
orderingKey: string;
|
|
554
|
+
eventType: "order.completed";
|
|
555
|
+
payload: {
|
|
556
|
+
orderId: string;
|
|
557
|
+
checkoutToken: string | null;
|
|
558
|
+
cartToken: string | null;
|
|
559
|
+
completedAt: string;
|
|
560
|
+
};
|
|
561
|
+
}>;
|
|
562
|
+
declare function isCheckoutCreatedEventV2(event: ShopifyRecoveryEventV2): event is ShopifyCheckoutCreatedEventV2;
|
|
563
|
+
declare function isCheckoutUpdatedEventV2(event: ShopifyRecoveryEventV2): event is ShopifyCheckoutUpdatedEventV2;
|
|
564
|
+
declare function isOrderCompletedEventV2(event: ShopifyRecoveryEventV2): event is ShopifyOrderCompletedEventV2;
|
|
565
|
+
declare function createShopifyPendingRecoveryOrderingKey(shopId: string, checkoutToken: string): string;
|
|
566
|
+
declare function createShopifyOrderCorrelationOrderingKey(input: {
|
|
567
|
+
shopId: string;
|
|
568
|
+
orderId: string;
|
|
569
|
+
checkoutToken: string | null;
|
|
570
|
+
}): string;
|
|
571
|
+
|
|
572
|
+
declare const SHOPIFY_WEBHOOK_QUEUE_CONTRACTS: {
|
|
573
|
+
readonly CHECKOUT_EVENTS: {
|
|
574
|
+
readonly queueName: "checkout-events";
|
|
575
|
+
readonly jobName: "checkout-created";
|
|
576
|
+
};
|
|
577
|
+
readonly CHECKOUT_UPDATED_EVENTS: {
|
|
578
|
+
readonly queueName: "checkout-events";
|
|
579
|
+
readonly jobName: "checkout-updated";
|
|
580
|
+
};
|
|
581
|
+
readonly ORDER_EVENTS: {
|
|
582
|
+
readonly queueName: "order-events";
|
|
583
|
+
readonly jobName: "order-completed";
|
|
584
|
+
};
|
|
585
|
+
};
|
|
330
586
|
|
|
331
|
-
export { type CheckoutObservedPayload, CheckoutObservedPayloadSchema, MAX_LINE_ITEMS, MAX_URL_LENGTH, type OrderCompletedPayload, OrderCompletedPayloadSchema, SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION, SHOPIFY_COMMERCE_EVENT_TYPES,
|
|
587
|
+
export { type CheckoutCreatedPayloadV2, CheckoutCreatedPayloadV2Schema, type CheckoutObservedPayload, CheckoutObservedPayloadSchema, type CheckoutUpdatedPayloadV2, CheckoutUpdatedPayloadV2Schema, MAX_LINE_ITEMS, MAX_URL_LENGTH, type OrderCompletedPayload, OrderCompletedPayloadSchema, type OrderCompletedPayloadV2, OrderCompletedPayloadV2Schema, SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION, SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V1, SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V2, SHOPIFY_COMMERCE_EVENT_TYPES, SHOPIFY_RECOVERY_EVENT_TYPES_V2, SHOPIFY_WEBHOOK_OUTBOX_DESTINATIONS, SHOPIFY_WEBHOOK_QUEUE_CONTRACTS, type ShopifyCheckoutCreatedEventV2, ShopifyCheckoutCreatedEventV2Schema, type ShopifyCheckoutLineItem, ShopifyCheckoutLineItemSchema, ShopifyCheckoutLineItemsSchema, type ShopifyCheckoutObservedEvent, ShopifyCheckoutObservedEventSchema, type ShopifyCheckoutUpdatedEventV2, ShopifyCheckoutUpdatedEventV2Schema, type ShopifyCommerceEvent, ShopifyCommerceEventSchema, type ShopifyCommerceEventType, type ShopifyCustomerReference, ShopifyCustomerReferenceSchema, type ShopifyMoney, ShopifyMoneySchema, type ShopifyOrderCompletedEvent, ShopifyOrderCompletedEventSchema, type ShopifyOrderCompletedEventV2, ShopifyOrderCompletedEventV2Schema, type ShopifyRecoveryEventTypeV2, type ShopifyRecoveryEventV2, ShopifyRecoveryEventV2Schema, type ShopifyTenant, ShopifyTenantSchema, createShopifyCommerceOrderingKey, createShopifyOrderCorrelationOrderingKey, createShopifyOrderOrderingKey, createShopifyPendingRecoveryOrderingKey, isCheckoutCreatedEventV2, isCheckoutObservedEvent, isCheckoutUpdatedEventV2, isOrderCompletedEvent, isOrderCompletedEventV2, parseShopifyCommerceEvent, parseShopifyRecoveryEventV2, safeParseShopifyCommerceEvent, safeParseShopifyRecoveryEventV2 };
|
package/dist/shopify/index.js
CHANGED
|
@@ -1,47 +1,83 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CheckoutCreatedPayloadV2Schema,
|
|
2
3
|
CheckoutObservedPayloadSchema,
|
|
4
|
+
CheckoutUpdatedPayloadV2Schema,
|
|
3
5
|
MAX_LINE_ITEMS,
|
|
4
6
|
MAX_URL_LENGTH,
|
|
5
7
|
OrderCompletedPayloadSchema,
|
|
8
|
+
OrderCompletedPayloadV2Schema,
|
|
6
9
|
SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION,
|
|
10
|
+
SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V1,
|
|
11
|
+
SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V2,
|
|
7
12
|
SHOPIFY_COMMERCE_EVENT_TYPES,
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
SHOPIFY_RECOVERY_EVENT_TYPES_V2,
|
|
14
|
+
SHOPIFY_WEBHOOK_OUTBOX_DESTINATIONS,
|
|
15
|
+
SHOPIFY_WEBHOOK_QUEUE_CONTRACTS,
|
|
16
|
+
ShopifyCheckoutCreatedEventV2Schema,
|
|
10
17
|
ShopifyCheckoutLineItemSchema,
|
|
11
18
|
ShopifyCheckoutLineItemsSchema,
|
|
12
19
|
ShopifyCheckoutObservedEventSchema,
|
|
20
|
+
ShopifyCheckoutUpdatedEventV2Schema,
|
|
13
21
|
ShopifyCommerceEventSchema,
|
|
14
22
|
ShopifyCustomerReferenceSchema,
|
|
15
23
|
ShopifyMoneySchema,
|
|
16
24
|
ShopifyOrderCompletedEventSchema,
|
|
25
|
+
ShopifyOrderCompletedEventV2Schema,
|
|
26
|
+
ShopifyRecoveryEventV2Schema,
|
|
17
27
|
ShopifyTenantSchema,
|
|
18
28
|
createShopifyCommerceOrderingKey,
|
|
29
|
+
createShopifyOrderCorrelationOrderingKey,
|
|
30
|
+
createShopifyOrderOrderingKey,
|
|
31
|
+
createShopifyPendingRecoveryOrderingKey,
|
|
32
|
+
isCheckoutCreatedEventV2,
|
|
19
33
|
isCheckoutObservedEvent,
|
|
34
|
+
isCheckoutUpdatedEventV2,
|
|
20
35
|
isOrderCompletedEvent,
|
|
36
|
+
isOrderCompletedEventV2,
|
|
21
37
|
parseShopifyCommerceEvent,
|
|
22
|
-
|
|
23
|
-
|
|
38
|
+
parseShopifyRecoveryEventV2,
|
|
39
|
+
safeParseShopifyCommerceEvent,
|
|
40
|
+
safeParseShopifyRecoveryEventV2
|
|
41
|
+
} from "../chunk-T6DNWLWW.js";
|
|
24
42
|
export {
|
|
43
|
+
CheckoutCreatedPayloadV2Schema,
|
|
25
44
|
CheckoutObservedPayloadSchema,
|
|
45
|
+
CheckoutUpdatedPayloadV2Schema,
|
|
26
46
|
MAX_LINE_ITEMS,
|
|
27
47
|
MAX_URL_LENGTH,
|
|
28
48
|
OrderCompletedPayloadSchema,
|
|
49
|
+
OrderCompletedPayloadV2Schema,
|
|
29
50
|
SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION,
|
|
51
|
+
SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V1,
|
|
52
|
+
SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V2,
|
|
30
53
|
SHOPIFY_COMMERCE_EVENT_TYPES,
|
|
31
|
-
|
|
32
|
-
|
|
54
|
+
SHOPIFY_RECOVERY_EVENT_TYPES_V2,
|
|
55
|
+
SHOPIFY_WEBHOOK_OUTBOX_DESTINATIONS,
|
|
56
|
+
SHOPIFY_WEBHOOK_QUEUE_CONTRACTS,
|
|
57
|
+
ShopifyCheckoutCreatedEventV2Schema,
|
|
33
58
|
ShopifyCheckoutLineItemSchema,
|
|
34
59
|
ShopifyCheckoutLineItemsSchema,
|
|
35
60
|
ShopifyCheckoutObservedEventSchema,
|
|
61
|
+
ShopifyCheckoutUpdatedEventV2Schema,
|
|
36
62
|
ShopifyCommerceEventSchema,
|
|
37
63
|
ShopifyCustomerReferenceSchema,
|
|
38
64
|
ShopifyMoneySchema,
|
|
39
65
|
ShopifyOrderCompletedEventSchema,
|
|
66
|
+
ShopifyOrderCompletedEventV2Schema,
|
|
67
|
+
ShopifyRecoveryEventV2Schema,
|
|
40
68
|
ShopifyTenantSchema,
|
|
41
69
|
createShopifyCommerceOrderingKey,
|
|
70
|
+
createShopifyOrderCorrelationOrderingKey,
|
|
71
|
+
createShopifyOrderOrderingKey,
|
|
72
|
+
createShopifyPendingRecoveryOrderingKey,
|
|
73
|
+
isCheckoutCreatedEventV2,
|
|
42
74
|
isCheckoutObservedEvent,
|
|
75
|
+
isCheckoutUpdatedEventV2,
|
|
43
76
|
isOrderCompletedEvent,
|
|
77
|
+
isOrderCompletedEventV2,
|
|
44
78
|
parseShopifyCommerceEvent,
|
|
45
|
-
|
|
79
|
+
parseShopifyRecoveryEventV2,
|
|
80
|
+
safeParseShopifyCommerceEvent,
|
|
81
|
+
safeParseShopifyRecoveryEventV2
|
|
46
82
|
};
|
|
47
83
|
//# sourceMappingURL=index.js.map
|
package/dist/shopify/node.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Legacy webhook delivery job id used by earlier receipt/outbox flows.
|
|
3
|
+
* Prefer the resource-scoped helpers below for current queue publication.
|
|
4
4
|
*/
|
|
5
5
|
declare function createShopifyWebhookJobId(appKey: string, deliveryId: string): string;
|
|
6
|
+
declare function createShopifyCheckoutJobId(shopId: string, checkoutToken: string): string;
|
|
7
|
+
declare function createShopifyOrderJobId(shopId: string, orderGid: string): string;
|
|
8
|
+
declare function createPendingRecoveryCandidateJobId(shopId: string, checkoutToken: string): string;
|
|
6
9
|
|
|
7
|
-
export { createShopifyWebhookJobId };
|
|
10
|
+
export { createPendingRecoveryCandidateJobId, createShopifyCheckoutJobId, createShopifyOrderJobId, createShopifyWebhookJobId };
|
package/dist/shopify/node.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
// src/shopify/node.ts
|
|
2
2
|
import { createHash } from "crypto";
|
|
3
|
-
function
|
|
4
|
-
if (typeof
|
|
5
|
-
throw new Error(
|
|
3
|
+
function createShopifyWebhookJobDigest(prefix, first, second) {
|
|
4
|
+
if (typeof first !== "string" || first.length === 0) {
|
|
5
|
+
throw new Error(`${prefix}: first input must be a non-empty string`);
|
|
6
6
|
}
|
|
7
|
-
if (typeof
|
|
8
|
-
throw new Error(
|
|
7
|
+
if (typeof second !== "string" || second.length === 0) {
|
|
8
|
+
throw new Error(`${prefix}: second input must be a non-empty string`);
|
|
9
9
|
}
|
|
10
|
-
const digest = createHash("sha256").update(`${
|
|
11
|
-
return
|
|
10
|
+
const digest = createHash("sha256").update(`${first}:${second}`).digest("hex");
|
|
11
|
+
return `${prefix}-${digest}`;
|
|
12
|
+
}
|
|
13
|
+
function createShopifyWebhookJobId(appKey, deliveryId) {
|
|
14
|
+
return createShopifyWebhookJobDigest("shopify", appKey, deliveryId);
|
|
15
|
+
}
|
|
16
|
+
function createShopifyCheckoutJobId(shopId, checkoutToken) {
|
|
17
|
+
return createShopifyWebhookJobDigest("checkout", shopId, checkoutToken);
|
|
18
|
+
}
|
|
19
|
+
function createShopifyOrderJobId(shopId, orderGid) {
|
|
20
|
+
return createShopifyWebhookJobDigest("order-created", shopId, orderGid);
|
|
21
|
+
}
|
|
22
|
+
function createPendingRecoveryCandidateJobId(shopId, checkoutToken) {
|
|
23
|
+
return createShopifyWebhookJobDigest("pending-recovery", shopId, checkoutToken);
|
|
12
24
|
}
|
|
13
25
|
export {
|
|
26
|
+
createPendingRecoveryCandidateJobId,
|
|
27
|
+
createShopifyCheckoutJobId,
|
|
28
|
+
createShopifyOrderJobId,
|
|
14
29
|
createShopifyWebhookJobId
|
|
15
30
|
};
|
|
16
31
|
//# sourceMappingURL=node.js.map
|
package/dist/shopify/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shopify/node.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\n\
|
|
1
|
+
{"version":3,"sources":["../../src/shopify/node.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\n\nfunction createShopifyWebhookJobDigest(prefix: string, first: string, second: string): string {\n if (typeof first !== \"string\" || first.length === 0) {\n throw new Error(`${prefix}: first input must be a non-empty string`);\n }\n\n if (typeof second !== \"string\" || second.length === 0) {\n throw new Error(`${prefix}: second input must be a non-empty string`);\n }\n\n const digest = createHash(\"sha256\").update(`${first}:${second}`).digest(\"hex\");\n return `${prefix}-${digest}`;\n}\n\n/**\n * Legacy webhook delivery job id used by earlier receipt/outbox flows.\n * Prefer the resource-scoped helpers below for current queue publication.\n */\nexport function createShopifyWebhookJobId(appKey: string, deliveryId: string): string {\n return createShopifyWebhookJobDigest(\"shopify\", appKey, deliveryId);\n}\n\nexport function createShopifyCheckoutJobId(shopId: string, checkoutToken: string): string {\n return createShopifyWebhookJobDigest(\"checkout\", shopId, checkoutToken);\n}\n\nexport function createShopifyOrderJobId(shopId: string, orderGid: string): string {\n return createShopifyWebhookJobDigest(\"order-created\", shopId, orderGid);\n}\n\nexport function createPendingRecoveryCandidateJobId(\n shopId: string,\n checkoutToken: string,\n): string {\n return createShopifyWebhookJobDigest(\"pending-recovery\", shopId, checkoutToken);\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,SAAS,8BAA8B,QAAgB,OAAe,QAAwB;AAC5F,MAAI,OAAO,UAAU,YAAY,MAAM,WAAW,GAAG;AACnD,UAAM,IAAI,MAAM,GAAG,MAAM,0CAA0C;AAAA,EACrE;AAEA,MAAI,OAAO,WAAW,YAAY,OAAO,WAAW,GAAG;AACrD,UAAM,IAAI,MAAM,GAAG,MAAM,2CAA2C;AAAA,EACtE;AAEA,QAAM,SAAS,WAAW,QAAQ,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,EAAE,EAAE,OAAO,KAAK;AAC7E,SAAO,GAAG,MAAM,IAAI,MAAM;AAC5B;AAMO,SAAS,0BAA0B,QAAgB,YAA4B;AACpF,SAAO,8BAA8B,WAAW,QAAQ,UAAU;AACpE;AAEO,SAAS,2BAA2B,QAAgB,eAA+B;AACxF,SAAO,8BAA8B,YAAY,QAAQ,aAAa;AACxE;AAEO,SAAS,wBAAwB,QAAgB,UAA0B;AAChF,SAAO,8BAA8B,iBAAiB,QAAQ,QAAQ;AACxE;AAEO,SAAS,oCACd,QACA,eACQ;AACR,SAAO,8BAA8B,oBAAoB,QAAQ,aAAa;AAChF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modainteract/moda-interact-shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -19,6 +19,14 @@
|
|
|
19
19
|
"./shopify/node": {
|
|
20
20
|
"types": "./dist/shopify/node.d.ts",
|
|
21
21
|
"import": "./dist/shopify/node.js"
|
|
22
|
+
},
|
|
23
|
+
"./logging": {
|
|
24
|
+
"types": "./dist/logging/index.d.ts",
|
|
25
|
+
"import": "./dist/logging/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./logging/node": {
|
|
28
|
+
"types": "./dist/logging/node.d.ts",
|
|
29
|
+
"import": "./dist/logging/node.js"
|
|
22
30
|
}
|
|
23
31
|
},
|
|
24
32
|
"files": [
|
|
@@ -27,10 +35,17 @@
|
|
|
27
35
|
"scripts": {
|
|
28
36
|
"build": "tsup",
|
|
29
37
|
"typecheck": "tsc --noEmit",
|
|
30
|
-
"test": "tsx --test src/**/*.test.ts",
|
|
38
|
+
"test": "tsx --test \"src/**/*.test.ts\"",
|
|
31
39
|
"prepack": "npm run build"
|
|
32
40
|
},
|
|
33
41
|
"dependencies": {
|
|
42
|
+
"@opentelemetry/api": "^1.9.0",
|
|
43
|
+
"@opentelemetry/api-logs": "0.221.0",
|
|
44
|
+
"@opentelemetry/exporter-logs-otlp-http": "0.221.0",
|
|
45
|
+
"@opentelemetry/resources": "^2.10.0",
|
|
46
|
+
"@opentelemetry/sdk-logs": "0.221.0",
|
|
47
|
+
"winston": "3.19.0",
|
|
48
|
+
"winston-loki": "6.1.7",
|
|
34
49
|
"zod": "^4.0.0"
|
|
35
50
|
},
|
|
36
51
|
"devDependencies": {
|
package/dist/chunk-NE5RMNXU.js
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
// src/shopify/constants.ts
|
|
2
|
-
var SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION = 1;
|
|
3
|
-
var SHOPIFY_COMMERCE_QUEUE = "commerce-events";
|
|
4
|
-
var SHOPIFY_COMMERCE_JOB = "shopify-commerce-event";
|
|
5
|
-
var SHOPIFY_COMMERCE_EVENT_TYPES = {
|
|
6
|
-
CHECKOUT_OBSERVED: "checkout.observed",
|
|
7
|
-
ORDER_COMPLETED: "order.completed"
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// src/shopify/common.schema.ts
|
|
11
|
-
import { z } from "zod";
|
|
12
|
-
var MAX_ID_LENGTH = 100;
|
|
13
|
-
var MAX_SHORT_TEXT_LENGTH = 320;
|
|
14
|
-
var MAX_TITLE_LENGTH = 500;
|
|
15
|
-
var MAX_URL_LENGTH = 2048;
|
|
16
|
-
var MAX_LINE_ITEMS = 250;
|
|
17
|
-
var decimalStringPattern = /^-?\d+(\.\d+)?$/;
|
|
18
|
-
var DecimalStringSchema = z.string().min(1).max(32).regex(decimalStringPattern, 'must be a decimal string, e.g. "12.34"');
|
|
19
|
-
var ShopifyTenantSchema = z.object({
|
|
20
|
-
shopId: z.string().min(1).max(MAX_ID_LENGTH),
|
|
21
|
-
shopDomain: z.string().min(1).max(MAX_SHORT_TEXT_LENGTH).toLowerCase().trim()
|
|
22
|
-
}).strict();
|
|
23
|
-
var ShopifyCustomerReferenceSchema = z.object({
|
|
24
|
-
shopifyCustomerId: z.string().min(1).max(MAX_ID_LENGTH).nullable(),
|
|
25
|
-
email: z.string().email().max(MAX_SHORT_TEXT_LENGTH).nullable(),
|
|
26
|
-
phone: z.string().min(1).max(64).nullable(),
|
|
27
|
-
firstName: z.string().min(1).max(MAX_TITLE_LENGTH).nullable(),
|
|
28
|
-
lastName: z.string().min(1).max(MAX_TITLE_LENGTH).nullable()
|
|
29
|
-
}).strict();
|
|
30
|
-
var ShopifyMoneySchema = z.object({
|
|
31
|
-
amount: DecimalStringSchema,
|
|
32
|
-
currencyCode: z.string().regex(/^[A-Z]{3}$/, "must be an uppercase three-letter currency code")
|
|
33
|
-
}).strict();
|
|
34
|
-
var ShopifyCheckoutLineItemSchema = z.object({
|
|
35
|
-
lineItemId: z.string().min(1).max(MAX_ID_LENGTH).nullable(),
|
|
36
|
-
variantId: z.string().min(1).max(MAX_ID_LENGTH).nullable(),
|
|
37
|
-
productId: z.string().min(1).max(MAX_ID_LENGTH).nullable(),
|
|
38
|
-
title: z.string().min(1).max(MAX_TITLE_LENGTH),
|
|
39
|
-
variantTitle: z.string().min(1).max(MAX_TITLE_LENGTH).nullable(),
|
|
40
|
-
quantity: z.number().int().positive(),
|
|
41
|
-
unitPrice: DecimalStringSchema.nullable(),
|
|
42
|
-
sku: z.string().min(1).max(MAX_ID_LENGTH).nullable()
|
|
43
|
-
}).strict();
|
|
44
|
-
var ShopifyCheckoutLineItemsSchema = z.array(ShopifyCheckoutLineItemSchema).max(MAX_LINE_ITEMS);
|
|
45
|
-
|
|
46
|
-
// src/shopify/checkout-observed.schema.ts
|
|
47
|
-
import { z as z2 } from "zod";
|
|
48
|
-
var CheckoutObservedPayloadSchema = z2.object({
|
|
49
|
-
checkoutToken: z2.string().min(1),
|
|
50
|
-
cartToken: z2.string().min(1).nullable(),
|
|
51
|
-
checkoutUrl: z2.url().max(MAX_URL_LENGTH).nullable(),
|
|
52
|
-
customer: ShopifyCustomerReferenceSchema.nullable(),
|
|
53
|
-
total: ShopifyMoneySchema.nullable(),
|
|
54
|
-
lineItems: ShopifyCheckoutLineItemsSchema,
|
|
55
|
-
checkoutCreatedAt: z2.iso.datetime().nullable(),
|
|
56
|
-
checkoutUpdatedAt: z2.iso.datetime().nullable(),
|
|
57
|
-
completedAt: z2.iso.datetime().nullable()
|
|
58
|
-
}).strict();
|
|
59
|
-
|
|
60
|
-
// src/shopify/order-completed.schema.ts
|
|
61
|
-
import { z as z3 } from "zod";
|
|
62
|
-
var OrderCompletedPayloadSchema = z3.object({
|
|
63
|
-
orderId: z3.string().min(1),
|
|
64
|
-
checkoutToken: z3.string().min(1),
|
|
65
|
-
shopifyCustomerId: z3.string().min(1).nullable(),
|
|
66
|
-
total: ShopifyMoneySchema.nullable(),
|
|
67
|
-
completedAt: z3.iso.datetime()
|
|
68
|
-
}).strict();
|
|
69
|
-
|
|
70
|
-
// src/shopify/commerce-event.schema.ts
|
|
71
|
-
import { z as z4 } from "zod";
|
|
72
|
-
var ShopifyCommerceEventBaseSchema = z4.object({
|
|
73
|
-
schemaVersion: z4.literal(SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION),
|
|
74
|
-
receiptId: z4.string().min(1),
|
|
75
|
-
deliveryId: z4.string().min(1),
|
|
76
|
-
eventId: z4.string().min(1).nullable(),
|
|
77
|
-
source: z4.literal("shopify"),
|
|
78
|
-
providerTopic: z4.string().min(1),
|
|
79
|
-
tenant: ShopifyTenantSchema,
|
|
80
|
-
occurredAt: z4.iso.datetime().nullable(),
|
|
81
|
-
receivedAt: z4.iso.datetime(),
|
|
82
|
-
traceId: z4.string().min(1),
|
|
83
|
-
orderingKey: z4.string().min(1)
|
|
84
|
-
});
|
|
85
|
-
var ShopifyCheckoutObservedEventSchema = ShopifyCommerceEventBaseSchema.extend({
|
|
86
|
-
eventType: z4.literal(SHOPIFY_COMMERCE_EVENT_TYPES.CHECKOUT_OBSERVED),
|
|
87
|
-
payload: CheckoutObservedPayloadSchema
|
|
88
|
-
}).strict();
|
|
89
|
-
var ShopifyOrderCompletedEventSchema = ShopifyCommerceEventBaseSchema.extend({
|
|
90
|
-
eventType: z4.literal(SHOPIFY_COMMERCE_EVENT_TYPES.ORDER_COMPLETED),
|
|
91
|
-
payload: OrderCompletedPayloadSchema
|
|
92
|
-
}).strict();
|
|
93
|
-
var ShopifyCommerceEventSchema = z4.discriminatedUnion("eventType", [
|
|
94
|
-
ShopifyCheckoutObservedEventSchema,
|
|
95
|
-
ShopifyOrderCompletedEventSchema
|
|
96
|
-
]);
|
|
97
|
-
function parseShopifyCommerceEvent(input) {
|
|
98
|
-
return ShopifyCommerceEventSchema.parse(input);
|
|
99
|
-
}
|
|
100
|
-
function safeParseShopifyCommerceEvent(input) {
|
|
101
|
-
return ShopifyCommerceEventSchema.safeParse(input);
|
|
102
|
-
}
|
|
103
|
-
function isCheckoutObservedEvent(event) {
|
|
104
|
-
return event.eventType === SHOPIFY_COMMERCE_EVENT_TYPES.CHECKOUT_OBSERVED;
|
|
105
|
-
}
|
|
106
|
-
function isOrderCompletedEvent(event) {
|
|
107
|
-
return event.eventType === SHOPIFY_COMMERCE_EVENT_TYPES.ORDER_COMPLETED;
|
|
108
|
-
}
|
|
109
|
-
function createShopifyCommerceOrderingKey(shopId, checkoutToken) {
|
|
110
|
-
if (typeof shopId !== "string" || shopId.length === 0) {
|
|
111
|
-
throw new Error("createShopifyCommerceOrderingKey: shopId must be a non-empty string");
|
|
112
|
-
}
|
|
113
|
-
if (typeof checkoutToken !== "string" || checkoutToken.length === 0) {
|
|
114
|
-
throw new Error("createShopifyCommerceOrderingKey: checkoutToken must be a non-empty string");
|
|
115
|
-
}
|
|
116
|
-
return `shopify:${shopId.length}:${shopId}:${checkoutToken.length}:${checkoutToken}`;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export {
|
|
120
|
-
SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION,
|
|
121
|
-
SHOPIFY_COMMERCE_QUEUE,
|
|
122
|
-
SHOPIFY_COMMERCE_JOB,
|
|
123
|
-
SHOPIFY_COMMERCE_EVENT_TYPES,
|
|
124
|
-
MAX_URL_LENGTH,
|
|
125
|
-
MAX_LINE_ITEMS,
|
|
126
|
-
ShopifyTenantSchema,
|
|
127
|
-
ShopifyCustomerReferenceSchema,
|
|
128
|
-
ShopifyMoneySchema,
|
|
129
|
-
ShopifyCheckoutLineItemSchema,
|
|
130
|
-
ShopifyCheckoutLineItemsSchema,
|
|
131
|
-
CheckoutObservedPayloadSchema,
|
|
132
|
-
OrderCompletedPayloadSchema,
|
|
133
|
-
ShopifyCheckoutObservedEventSchema,
|
|
134
|
-
ShopifyOrderCompletedEventSchema,
|
|
135
|
-
ShopifyCommerceEventSchema,
|
|
136
|
-
parseShopifyCommerceEvent,
|
|
137
|
-
safeParseShopifyCommerceEvent,
|
|
138
|
-
isCheckoutObservedEvent,
|
|
139
|
-
isOrderCompletedEvent,
|
|
140
|
-
createShopifyCommerceOrderingKey
|
|
141
|
-
};
|
|
142
|
-
//# sourceMappingURL=chunk-NE5RMNXU.js.map
|