@infuro/cms-core 1.0.60 → 1.0.62
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/dist/admin.cjs +4179 -2665
- package/dist/admin.js +2990 -1476
- package/dist/api.cjs +41 -37
- package/dist/api.js +9 -5
- package/dist/{chunk-URN7GS23.js → chunk-6LV36PCL.js} +199 -1059
- package/dist/{chunk-O2642WVS.js → chunk-6XAVZE4I.js} +17 -3
- package/dist/{chunk-BXYZDMTZ.cjs → chunk-AXMP2U43.cjs} +3 -94
- package/dist/{chunk-T3HPSF7K.js → chunk-AYWDQFJZ.js} +3 -0
- package/dist/chunk-CTIEAHQL.cjs +96 -0
- package/dist/chunk-GWDI752Q.js +83 -0
- package/dist/chunk-GZGFNVTK.js +886 -0
- package/dist/chunk-H3IVLIPR.cjs +86 -0
- package/dist/{chunk-2KUCQVAQ.js → chunk-HMLVPIJR.js} +2 -91
- package/dist/{chunk-V25RDUOU.cjs → chunk-LRD4CGOG.cjs} +38 -4
- package/dist/{chunk-73WVHINE.cjs → chunk-LVQSG25Y.cjs} +18 -4
- package/dist/chunk-NMYGQWHV.js +93 -0
- package/dist/chunk-OVTOP42W.js +199 -0
- package/dist/{chunk-BSLNXKV2.cjs → chunk-QA5C477U.cjs} +927 -351
- package/dist/{chunk-JAEUYYGA.js → chunk-R6Q67HAS.js} +876 -291
- package/dist/{chunk-YSYX4GUD.cjs → chunk-TWTISTZB.cjs} +210 -1080
- package/dist/{chunk-77I3KS7V.cjs → chunk-UEE4PTTB.cjs} +3 -0
- package/dist/chunk-WFMVD567.cjs +209 -0
- package/dist/{chunk-L3525VXI.js → chunk-YW7EF7K7.js} +36 -2
- package/dist/chunk-ZPAPCGCR.cjs +899 -0
- package/dist/{email-queue-OI2HSCGE.js → email-queue-65PQAG4C.js} +3 -2
- package/dist/{email-queue-6NJY6HNM.cjs → email-queue-J7DXYNCE.cjs} +7 -6
- package/dist/email-service-F7HA4X63.js +3 -0
- package/dist/email-service-RDOTY3CO.cjs +28 -0
- package/dist/{emit-order-notification-trigger-TNEZOYEE.cjs → emit-order-notification-trigger-K7URAZHJ.cjs} +4 -4
- package/dist/{emit-order-notification-trigger-CZU3V2WE.js → emit-order-notification-trigger-MD7EBODC.js} +2 -2
- package/dist/{erp-order-invoice-EYYNR526.cjs → erp-order-invoice-C5GZCOBM.cjs} +6 -5
- package/dist/{erp-order-invoice-3GXDE443.js → erp-order-invoice-MYFCXOCY.js} +2 -1
- package/dist/index.cjs +638 -346
- package/dist/index.d.cts +53 -19
- package/dist/index.d.ts +53 -19
- package/dist/index.js +350 -58
- package/dist/migrations/1783000000000-AddOrderPendingProcessingCompletedTriggers.ts +56 -0
- package/dist/migrations/1783100000000-AddSmsToOrderNotificationBindingsChannelEnum.ts +17 -0
- package/dist/migrations/1783200000000-AddOrderAssigneeColumns.ts +30 -0
- package/dist/order-assignees-handlers-LKMAGLG6.js +150 -0
- package/dist/order-assignees-handlers-NPKD64P6.cjs +152 -0
- package/dist/order-completion-otp-handlers-3NTOGEA5.js +361 -0
- package/dist/order-completion-otp-handlers-4EOLYLAP.cjs +363 -0
- package/dist/order-notification-dispatcher-IYMOS4VY.js +10 -0
- package/dist/order-notification-dispatcher-X2XM5VUY.cjs +35 -0
- package/dist/sms-notification-templates-handlers-SJLO7JGZ.js +47 -0
- package/dist/sms-notification-templates-handlers-YSB3L2PK.cjs +49 -0
- package/package.json +1 -1
- package/dist/order-notification-dispatcher-KJVGLK5E.cjs +0 -24
- package/dist/order-notification-dispatcher-ZSFKEYMP.js +0 -7
package/dist/index.d.cts
CHANGED
|
@@ -1900,7 +1900,7 @@ declare function serializeEmailRecipients(emails: string[]): string;
|
|
|
1900
1900
|
/** Join for SMTP `to` header (multiple recipients). */
|
|
1901
1901
|
declare function joinRecipientsForSend(emails: string[]): string | null;
|
|
1902
1902
|
|
|
1903
|
-
type OtpPurpose = 'login' | 'verify_email' | 'verify_phone';
|
|
1903
|
+
type OtpPurpose = 'login' | 'verify_email' | 'verify_phone' | 'order_completion';
|
|
1904
1904
|
type OtpChannel = 'email' | 'sms';
|
|
1905
1905
|
declare function hashOtpCode(code: string, purpose: string, identifier: string, pepper?: string): string;
|
|
1906
1906
|
declare function verifyOtpCodeHash(code: string, storedHash: string, purpose: string, identifier: string, pepper?: string): boolean;
|
|
@@ -2566,6 +2566,9 @@ declare class Order {
|
|
|
2566
2566
|
customerContact: Customer_Contacts | null;
|
|
2567
2567
|
billingAddress: OrderAddresses | null;
|
|
2568
2568
|
shippingAddress: OrderAddresses | null;
|
|
2569
|
+
assignedUserId: number | null;
|
|
2570
|
+
assignedAt: Date | null;
|
|
2571
|
+
assignedUser: User | null;
|
|
2569
2572
|
items: OrderItem[];
|
|
2570
2573
|
payments: Payment[];
|
|
2571
2574
|
}
|
|
@@ -2819,19 +2822,10 @@ declare function fireOrderNotificationTrigger(triggerKey: string, orderId: numbe
|
|
|
2819
2822
|
extraVariables?: Record<string, string>;
|
|
2820
2823
|
}): void;
|
|
2821
2824
|
|
|
2822
|
-
interface OrderNotificationDispatcherDeps {
|
|
2823
|
-
dataSource: any;
|
|
2824
|
-
entityMap: EntityMap$2;
|
|
2825
|
-
getCms: () => Promise<CmsAppLike$1>;
|
|
2826
|
-
}
|
|
2827
|
-
declare function initWhatsappTriggerDispatcher(deps: OrderNotificationDispatcherDeps): void;
|
|
2828
|
-
/** Manually re-fire a trigger for an existing order (admin testing / resend). */
|
|
2829
|
-
declare function resendOrderNotification(triggerKey: string, orderId: number, deps: OrderNotificationDispatcherDeps): Promise<{
|
|
2830
|
-
ok: boolean;
|
|
2831
|
-
error?: string;
|
|
2832
|
-
}>;
|
|
2833
|
-
|
|
2834
2825
|
declare const KNOWN_NOTIFICATION_TRIGGERS: {
|
|
2826
|
+
readonly ORDER_PENDING: "order_pending";
|
|
2827
|
+
readonly ORDER_PROCESSING: "order_processing";
|
|
2828
|
+
readonly ORDER_COMPLETED: "order_completed";
|
|
2835
2829
|
readonly ORDER_PLACED: "order_placed";
|
|
2836
2830
|
readonly ORDER_CANCELLED: "order_cancelled";
|
|
2837
2831
|
readonly PAYMENT_SUCCESS: "payment_success";
|
|
@@ -2855,41 +2849,80 @@ declare class NotificationTriggerEmitter extends EventEmitter {
|
|
|
2855
2849
|
}
|
|
2856
2850
|
declare const notificationTriggerEmitter: NotificationTriggerEmitter;
|
|
2857
2851
|
|
|
2852
|
+
interface OrderNotificationDispatcherDeps {
|
|
2853
|
+
dataSource: any;
|
|
2854
|
+
entityMap: EntityMap$2;
|
|
2855
|
+
getCms: () => Promise<CmsAppLike$1>;
|
|
2856
|
+
}
|
|
2857
|
+
declare function initWhatsappTriggerDispatcher(deps: OrderNotificationDispatcherDeps): void;
|
|
2858
|
+
/** Manually re-fire a trigger for an existing order (admin testing / resend). */
|
|
2859
|
+
declare function resendOrderNotification(triggerKey: string, orderId: number, deps: OrderNotificationDispatcherDeps): Promise<{
|
|
2860
|
+
ok: boolean;
|
|
2861
|
+
error?: string;
|
|
2862
|
+
}>;
|
|
2863
|
+
|
|
2858
2864
|
/** Default order lifecycle triggers — seeded by migration, not tied to the `events` table. */
|
|
2859
2865
|
declare const DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS: readonly [{
|
|
2866
|
+
readonly triggerKey: "order_pending";
|
|
2867
|
+
readonly label: "Order pending";
|
|
2868
|
+
readonly description: "Fires when an order is created and pending confirmation or payment.";
|
|
2869
|
+
readonly category: "order";
|
|
2870
|
+
readonly sortOrder: 1;
|
|
2871
|
+
}, {
|
|
2872
|
+
readonly triggerKey: "order_processing";
|
|
2873
|
+
readonly label: "Order processing";
|
|
2874
|
+
readonly description: "Fires when an order moves to processing after being assigned.";
|
|
2875
|
+
readonly category: "order";
|
|
2876
|
+
readonly sortOrder: 2;
|
|
2877
|
+
}, {
|
|
2878
|
+
readonly triggerKey: "order_completed";
|
|
2879
|
+
readonly label: "Order completed";
|
|
2880
|
+
readonly description: "Fires when an order is completed after customer OTP validation.";
|
|
2881
|
+
readonly category: "order";
|
|
2882
|
+
readonly sortOrder: 3;
|
|
2883
|
+
}, {
|
|
2860
2884
|
readonly triggerKey: "order_placed";
|
|
2861
2885
|
readonly label: "Order placed";
|
|
2862
2886
|
readonly description: "Fires when a new order is created (storefront checkout or admin).";
|
|
2863
2887
|
readonly category: "order";
|
|
2864
|
-
readonly sortOrder:
|
|
2888
|
+
readonly sortOrder: 4;
|
|
2865
2889
|
}, {
|
|
2866
2890
|
readonly triggerKey: "order_cancelled";
|
|
2867
2891
|
readonly label: "Order cancelled";
|
|
2868
2892
|
readonly description: "Fires when an order is cancelled (includes refund amount when applicable).";
|
|
2869
2893
|
readonly category: "order";
|
|
2870
|
-
readonly sortOrder:
|
|
2894
|
+
readonly sortOrder: 5;
|
|
2871
2895
|
}, {
|
|
2872
2896
|
readonly triggerKey: "payment_success";
|
|
2873
2897
|
readonly label: "Payment success";
|
|
2874
2898
|
readonly description: "Fires when order is placed and payment status is paid.";
|
|
2875
2899
|
readonly category: "order";
|
|
2876
|
-
readonly sortOrder:
|
|
2900
|
+
readonly sortOrder: 6;
|
|
2877
2901
|
}, {
|
|
2878
2902
|
readonly triggerKey: "payment_failed";
|
|
2879
2903
|
readonly label: "Payment failed";
|
|
2880
2904
|
readonly description: "Fires when payment status is pending, unpaid, or failed, or when order is cancelled without payment.";
|
|
2881
2905
|
readonly category: "order";
|
|
2882
|
-
readonly sortOrder:
|
|
2906
|
+
readonly sortOrder: 7;
|
|
2883
2907
|
}, {
|
|
2884
2908
|
readonly triggerKey: "payment_refund_initiated";
|
|
2885
2909
|
readonly label: "Payment refund initiated";
|
|
2886
2910
|
readonly description: "Fires when order is cancelled and its payment status is paid (refund initiated).";
|
|
2887
2911
|
readonly category: "order";
|
|
2888
|
-
readonly sortOrder:
|
|
2912
|
+
readonly sortOrder: 8;
|
|
2889
2913
|
}];
|
|
2890
2914
|
|
|
2891
2915
|
/** @deprecated Use DB catalog `order_notification_triggers`; kept for type hints. */
|
|
2892
2916
|
declare const ORDER_NOTIFICATION_TRIGGERS: readonly [{
|
|
2917
|
+
readonly key: "order_pending";
|
|
2918
|
+
readonly label: "Order pending";
|
|
2919
|
+
}, {
|
|
2920
|
+
readonly key: "order_processing";
|
|
2921
|
+
readonly label: "Order processing";
|
|
2922
|
+
}, {
|
|
2923
|
+
readonly key: "order_completed";
|
|
2924
|
+
readonly label: "Order completed";
|
|
2925
|
+
}, {
|
|
2893
2926
|
readonly key: "order_placed";
|
|
2894
2927
|
readonly label: "Order placed";
|
|
2895
2928
|
}, {
|
|
@@ -4065,7 +4098,8 @@ declare class Attendee {
|
|
|
4065
4098
|
declare enum NotificationChannel {
|
|
4066
4099
|
WHATSAPP = "whatsapp",
|
|
4067
4100
|
EMAIL = "email",
|
|
4068
|
-
MOBILE = "mobile"
|
|
4101
|
+
MOBILE = "mobile",
|
|
4102
|
+
SMS = "sms"
|
|
4069
4103
|
}
|
|
4070
4104
|
declare enum NotificationAudienceType {
|
|
4071
4105
|
CUSTOMERS = "customers",
|
package/dist/index.d.ts
CHANGED
|
@@ -1900,7 +1900,7 @@ declare function serializeEmailRecipients(emails: string[]): string;
|
|
|
1900
1900
|
/** Join for SMTP `to` header (multiple recipients). */
|
|
1901
1901
|
declare function joinRecipientsForSend(emails: string[]): string | null;
|
|
1902
1902
|
|
|
1903
|
-
type OtpPurpose = 'login' | 'verify_email' | 'verify_phone';
|
|
1903
|
+
type OtpPurpose = 'login' | 'verify_email' | 'verify_phone' | 'order_completion';
|
|
1904
1904
|
type OtpChannel = 'email' | 'sms';
|
|
1905
1905
|
declare function hashOtpCode(code: string, purpose: string, identifier: string, pepper?: string): string;
|
|
1906
1906
|
declare function verifyOtpCodeHash(code: string, storedHash: string, purpose: string, identifier: string, pepper?: string): boolean;
|
|
@@ -2566,6 +2566,9 @@ declare class Order {
|
|
|
2566
2566
|
customerContact: Customer_Contacts | null;
|
|
2567
2567
|
billingAddress: OrderAddresses | null;
|
|
2568
2568
|
shippingAddress: OrderAddresses | null;
|
|
2569
|
+
assignedUserId: number | null;
|
|
2570
|
+
assignedAt: Date | null;
|
|
2571
|
+
assignedUser: User | null;
|
|
2569
2572
|
items: OrderItem[];
|
|
2570
2573
|
payments: Payment[];
|
|
2571
2574
|
}
|
|
@@ -2819,19 +2822,10 @@ declare function fireOrderNotificationTrigger(triggerKey: string, orderId: numbe
|
|
|
2819
2822
|
extraVariables?: Record<string, string>;
|
|
2820
2823
|
}): void;
|
|
2821
2824
|
|
|
2822
|
-
interface OrderNotificationDispatcherDeps {
|
|
2823
|
-
dataSource: any;
|
|
2824
|
-
entityMap: EntityMap$2;
|
|
2825
|
-
getCms: () => Promise<CmsAppLike$1>;
|
|
2826
|
-
}
|
|
2827
|
-
declare function initWhatsappTriggerDispatcher(deps: OrderNotificationDispatcherDeps): void;
|
|
2828
|
-
/** Manually re-fire a trigger for an existing order (admin testing / resend). */
|
|
2829
|
-
declare function resendOrderNotification(triggerKey: string, orderId: number, deps: OrderNotificationDispatcherDeps): Promise<{
|
|
2830
|
-
ok: boolean;
|
|
2831
|
-
error?: string;
|
|
2832
|
-
}>;
|
|
2833
|
-
|
|
2834
2825
|
declare const KNOWN_NOTIFICATION_TRIGGERS: {
|
|
2826
|
+
readonly ORDER_PENDING: "order_pending";
|
|
2827
|
+
readonly ORDER_PROCESSING: "order_processing";
|
|
2828
|
+
readonly ORDER_COMPLETED: "order_completed";
|
|
2835
2829
|
readonly ORDER_PLACED: "order_placed";
|
|
2836
2830
|
readonly ORDER_CANCELLED: "order_cancelled";
|
|
2837
2831
|
readonly PAYMENT_SUCCESS: "payment_success";
|
|
@@ -2855,41 +2849,80 @@ declare class NotificationTriggerEmitter extends EventEmitter {
|
|
|
2855
2849
|
}
|
|
2856
2850
|
declare const notificationTriggerEmitter: NotificationTriggerEmitter;
|
|
2857
2851
|
|
|
2852
|
+
interface OrderNotificationDispatcherDeps {
|
|
2853
|
+
dataSource: any;
|
|
2854
|
+
entityMap: EntityMap$2;
|
|
2855
|
+
getCms: () => Promise<CmsAppLike$1>;
|
|
2856
|
+
}
|
|
2857
|
+
declare function initWhatsappTriggerDispatcher(deps: OrderNotificationDispatcherDeps): void;
|
|
2858
|
+
/** Manually re-fire a trigger for an existing order (admin testing / resend). */
|
|
2859
|
+
declare function resendOrderNotification(triggerKey: string, orderId: number, deps: OrderNotificationDispatcherDeps): Promise<{
|
|
2860
|
+
ok: boolean;
|
|
2861
|
+
error?: string;
|
|
2862
|
+
}>;
|
|
2863
|
+
|
|
2858
2864
|
/** Default order lifecycle triggers — seeded by migration, not tied to the `events` table. */
|
|
2859
2865
|
declare const DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS: readonly [{
|
|
2866
|
+
readonly triggerKey: "order_pending";
|
|
2867
|
+
readonly label: "Order pending";
|
|
2868
|
+
readonly description: "Fires when an order is created and pending confirmation or payment.";
|
|
2869
|
+
readonly category: "order";
|
|
2870
|
+
readonly sortOrder: 1;
|
|
2871
|
+
}, {
|
|
2872
|
+
readonly triggerKey: "order_processing";
|
|
2873
|
+
readonly label: "Order processing";
|
|
2874
|
+
readonly description: "Fires when an order moves to processing after being assigned.";
|
|
2875
|
+
readonly category: "order";
|
|
2876
|
+
readonly sortOrder: 2;
|
|
2877
|
+
}, {
|
|
2878
|
+
readonly triggerKey: "order_completed";
|
|
2879
|
+
readonly label: "Order completed";
|
|
2880
|
+
readonly description: "Fires when an order is completed after customer OTP validation.";
|
|
2881
|
+
readonly category: "order";
|
|
2882
|
+
readonly sortOrder: 3;
|
|
2883
|
+
}, {
|
|
2860
2884
|
readonly triggerKey: "order_placed";
|
|
2861
2885
|
readonly label: "Order placed";
|
|
2862
2886
|
readonly description: "Fires when a new order is created (storefront checkout or admin).";
|
|
2863
2887
|
readonly category: "order";
|
|
2864
|
-
readonly sortOrder:
|
|
2888
|
+
readonly sortOrder: 4;
|
|
2865
2889
|
}, {
|
|
2866
2890
|
readonly triggerKey: "order_cancelled";
|
|
2867
2891
|
readonly label: "Order cancelled";
|
|
2868
2892
|
readonly description: "Fires when an order is cancelled (includes refund amount when applicable).";
|
|
2869
2893
|
readonly category: "order";
|
|
2870
|
-
readonly sortOrder:
|
|
2894
|
+
readonly sortOrder: 5;
|
|
2871
2895
|
}, {
|
|
2872
2896
|
readonly triggerKey: "payment_success";
|
|
2873
2897
|
readonly label: "Payment success";
|
|
2874
2898
|
readonly description: "Fires when order is placed and payment status is paid.";
|
|
2875
2899
|
readonly category: "order";
|
|
2876
|
-
readonly sortOrder:
|
|
2900
|
+
readonly sortOrder: 6;
|
|
2877
2901
|
}, {
|
|
2878
2902
|
readonly triggerKey: "payment_failed";
|
|
2879
2903
|
readonly label: "Payment failed";
|
|
2880
2904
|
readonly description: "Fires when payment status is pending, unpaid, or failed, or when order is cancelled without payment.";
|
|
2881
2905
|
readonly category: "order";
|
|
2882
|
-
readonly sortOrder:
|
|
2906
|
+
readonly sortOrder: 7;
|
|
2883
2907
|
}, {
|
|
2884
2908
|
readonly triggerKey: "payment_refund_initiated";
|
|
2885
2909
|
readonly label: "Payment refund initiated";
|
|
2886
2910
|
readonly description: "Fires when order is cancelled and its payment status is paid (refund initiated).";
|
|
2887
2911
|
readonly category: "order";
|
|
2888
|
-
readonly sortOrder:
|
|
2912
|
+
readonly sortOrder: 8;
|
|
2889
2913
|
}];
|
|
2890
2914
|
|
|
2891
2915
|
/** @deprecated Use DB catalog `order_notification_triggers`; kept for type hints. */
|
|
2892
2916
|
declare const ORDER_NOTIFICATION_TRIGGERS: readonly [{
|
|
2917
|
+
readonly key: "order_pending";
|
|
2918
|
+
readonly label: "Order pending";
|
|
2919
|
+
}, {
|
|
2920
|
+
readonly key: "order_processing";
|
|
2921
|
+
readonly label: "Order processing";
|
|
2922
|
+
}, {
|
|
2923
|
+
readonly key: "order_completed";
|
|
2924
|
+
readonly label: "Order completed";
|
|
2925
|
+
}, {
|
|
2893
2926
|
readonly key: "order_placed";
|
|
2894
2927
|
readonly label: "Order placed";
|
|
2895
2928
|
}, {
|
|
@@ -4065,7 +4098,8 @@ declare class Attendee {
|
|
|
4065
4098
|
declare enum NotificationChannel {
|
|
4066
4099
|
WHATSAPP = "whatsapp",
|
|
4067
4100
|
EMAIL = "email",
|
|
4068
|
-
MOBILE = "mobile"
|
|
4101
|
+
MOBILE = "mobile",
|
|
4102
|
+
SMS = "sms"
|
|
4069
4103
|
}
|
|
4070
4104
|
declare enum NotificationAudienceType {
|
|
4071
4105
|
CUSTOMERS = "customers",
|