@01.software/sdk 0.49.0 → 0.51.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/CHANGELOG.md +130 -1
- package/MIGRATION.md +56 -0
- package/README.md +215 -45
- package/dist/client.cjs +188 -137
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.js +188 -137
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-XfGLPuTf.d.cts → collection-client-CWAeuzV4.d.cts} +6 -4
- package/dist/{collection-client-DnDt6EQz.d.ts → collection-client-hYvVfHIm.d.ts} +6 -4
- package/dist/{const-DCNV5Kq7.d.ts → const-D8LixhAJ.d.cts} +5 -5
- package/dist/{const-CBba4lDo.d.cts → const-JD8obaKg.d.ts} +5 -5
- package/dist/embedded-admin/server.cjs +306 -0
- package/dist/embedded-admin/server.cjs.map +1 -0
- package/dist/embedded-admin/server.d.cts +33 -0
- package/dist/embedded-admin/server.d.ts +33 -0
- package/dist/embedded-admin/server.js +288 -0
- package/dist/embedded-admin/server.js.map +1 -0
- package/dist/embedded-admin.cjs +400 -0
- package/dist/embedded-admin.cjs.map +1 -0
- package/dist/embedded-admin.d.cts +61 -0
- package/dist/embedded-admin.d.ts +61 -0
- package/dist/embedded-admin.js +377 -0
- package/dist/embedded-admin.js.map +1 -0
- package/dist/errors.cjs +1 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +3 -3
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +1 -0
- package/dist/errors.js.map +1 -1
- package/dist/{index-CbKyoEzy.d.cts → index-B0Hjh3Ey.d.ts} +72 -10
- package/dist/{index-DUuIqUS8.d.ts → index-Bu0kCc6o.d.cts} +72 -10
- package/dist/index.cjs +320 -383
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -66
- package/dist/index.d.ts +8 -66
- package/dist/index.js +320 -383
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-MKbx5MuJ.d.cts → payload-types-BOsckg8B.d.cts} +263 -54
- package/dist/{payload-types-MKbx5MuJ.d.ts → payload-types-BOsckg8B.d.ts} +263 -54
- package/dist/query.cjs +94 -70
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/query.js +94 -70
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +404 -162
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.js +404 -162
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +1 -0
- package/dist/storefront-cache.cjs.map +1 -1
- package/dist/storefront-cache.js +1 -0
- package/dist/storefront-cache.js.map +1 -1
- package/dist/{types-L_nh-ED7.d.ts → types-5ZlcAFuU.d.ts} +2 -2
- package/dist/{types-BKr_2avj.d.cts → types-B14sEt1z.d.cts} +2 -2
- package/dist/{types-1UeOk1Uy.d.cts → types-Bj8j7VHU.d.ts} +79 -23
- package/dist/{types-Du4s5anw.d.ts → types-CM5qiR2k.d.cts} +79 -23
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.cjs +124 -80
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +21 -5
- package/dist/webhook.d.ts +21 -5
- package/dist/webhook.js +124 -80
- package/dist/webhook.js.map +1 -1
- package/package.json +23 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as Collection } from './const-
|
|
2
|
-
import { C as CollectionType } from './types-
|
|
3
|
-
import './payload-types-
|
|
1
|
+
import { C as Collection } from './const-JD8obaKg.js';
|
|
2
|
+
import { C as CollectionType } from './types-5ZlcAFuU.js';
|
|
3
|
+
import './payload-types-BOsckg8B.js';
|
|
4
4
|
|
|
5
5
|
type WebhookOperation = string;
|
|
6
6
|
/**
|
|
@@ -61,8 +61,10 @@ interface WebhookEvent<T extends Collection | string = Collection, TData = T ext
|
|
|
61
61
|
deliveryId?: string;
|
|
62
62
|
}
|
|
63
63
|
type WebhookHandler<T extends Collection | string = Collection, TData = T extends Collection ? CollectionType<T> : Record<string, unknown>> = (event: WebhookEvent<T, TData>) => Promise<void> | void;
|
|
64
|
+
/** @deprecated Use the signed receiver options from `@01.software/sdk/webhook`. */
|
|
64
65
|
interface WebhookOptions {
|
|
65
|
-
secret
|
|
66
|
+
/** Nonblank HMAC-SHA256 signing secret for this receiver. */
|
|
67
|
+
secret: string;
|
|
66
68
|
/** Max accepted skew for signed webhook delivery timestamps. Default: 300s. */
|
|
67
69
|
toleranceSeconds?: number;
|
|
68
70
|
}
|
|
@@ -74,13 +76,57 @@ type OrderChangedWebhookEvent<T extends Collection | string = Collection, TData
|
|
|
74
76
|
change: WebhookOrderChange;
|
|
75
77
|
};
|
|
76
78
|
declare const COMMERCE_NOTIFICATION_OPERATION: "notification";
|
|
77
|
-
declare const COMMERCE_NOTIFICATION_EVENTS: readonly ["orderPaid", "orderCanceled", "fulfillmentShipped", "orderDelivered", "returnRequested", "returnApproved", "returnRejected", "returnCanceled", "returnCompleted"];
|
|
79
|
+
declare const COMMERCE_NOTIFICATION_EVENTS: readonly ["orderPaid", "orderCanceled", "fulfillmentShipped", "orderDelivered", "returnRequested", "returnApproved", "returnRejected", "returnCanceled", "returnCompleted", "paymentReconciliationRequired", "paymentRefundRequiresAttention"];
|
|
78
80
|
type CommerceNotificationEventName = (typeof COMMERCE_NOTIFICATION_EVENTS)[number];
|
|
79
|
-
type
|
|
81
|
+
type CustomerCommerceNotificationEventName = Exclude<CommerceNotificationEventName, PaymentIncidentNotificationEventName>;
|
|
82
|
+
type CommerceNotificationSourceCollection = 'orders' | 'fulfillments' | 'returns' | 'payment-sessions' | 'payment-refund-attempts';
|
|
80
83
|
type CommerceNotificationSource = {
|
|
81
84
|
collection: CommerceNotificationSourceCollection;
|
|
82
85
|
id: string | number;
|
|
83
86
|
};
|
|
87
|
+
type PaymentIncidentNotificationEventName = 'paymentReconciliationRequired' | 'paymentRefundRequiresAttention';
|
|
88
|
+
type PaymentIncidentNotificationSourceCollection = 'payment-sessions' | 'payment-refund-attempts';
|
|
89
|
+
type PaymentIncidentNotificationReason = 'orderless_capture' | 'local_commit_ambiguous';
|
|
90
|
+
type PaymentIncidentNotificationStatus = 'reconciliation_required' | 'requires_attention';
|
|
91
|
+
type PaymentIncidentProviderObject = {
|
|
92
|
+
provider: string;
|
|
93
|
+
kind: 'payment' | 'refund';
|
|
94
|
+
id: string;
|
|
95
|
+
};
|
|
96
|
+
type PaymentIncidentMoney = {
|
|
97
|
+
amountMinor: number;
|
|
98
|
+
currency: string;
|
|
99
|
+
};
|
|
100
|
+
type PaymentIncidentNotificationBase = {
|
|
101
|
+
paymentSessionId: string;
|
|
102
|
+
checkoutId?: string;
|
|
103
|
+
orderId?: string;
|
|
104
|
+
providerObject: PaymentIncidentProviderObject;
|
|
105
|
+
money: PaymentIncidentMoney;
|
|
106
|
+
observedAt: string;
|
|
107
|
+
};
|
|
108
|
+
type PaymentReconciliationRequiredNotificationData = PaymentIncidentNotificationBase & {
|
|
109
|
+
source: {
|
|
110
|
+
collection: 'payment-sessions';
|
|
111
|
+
id: string;
|
|
112
|
+
};
|
|
113
|
+
providerObject: PaymentIncidentProviderObject & {
|
|
114
|
+
kind: 'payment';
|
|
115
|
+
};
|
|
116
|
+
status: 'reconciliation_required';
|
|
117
|
+
reason: 'orderless_capture';
|
|
118
|
+
refundAttemptId?: never;
|
|
119
|
+
};
|
|
120
|
+
type PaymentRefundRequiresAttentionNotificationData = PaymentIncidentNotificationBase & {
|
|
121
|
+
source: {
|
|
122
|
+
collection: 'payment-refund-attempts';
|
|
123
|
+
id: string;
|
|
124
|
+
};
|
|
125
|
+
refundAttemptId: string;
|
|
126
|
+
status: 'requires_attention';
|
|
127
|
+
reason: 'local_commit_ambiguous';
|
|
128
|
+
};
|
|
129
|
+
type PaymentIncidentNotificationData = PaymentReconciliationRequiredNotificationData | PaymentRefundRequiresAttentionNotificationData;
|
|
84
130
|
type CommerceNotificationData = {
|
|
85
131
|
source?: CommerceNotificationSource;
|
|
86
132
|
orderId?: string | number;
|
|
@@ -95,6 +141,13 @@ type CommerceNotificationData = {
|
|
|
95
141
|
returnStatus?: string;
|
|
96
142
|
refundAmount?: number;
|
|
97
143
|
completedAt?: string;
|
|
144
|
+
paymentSessionId?: string;
|
|
145
|
+
checkoutId?: string;
|
|
146
|
+
refundAttemptId?: string;
|
|
147
|
+
providerObject?: PaymentIncidentProviderObject;
|
|
148
|
+
money?: PaymentIncidentMoney;
|
|
149
|
+
reason?: PaymentIncidentNotificationReason;
|
|
150
|
+
observedAt?: string;
|
|
98
151
|
};
|
|
99
152
|
type CommerceNotification = {
|
|
100
153
|
event: CommerceNotificationEventName;
|
|
@@ -103,6 +156,8 @@ type CommerceNotification = {
|
|
|
103
156
|
orderId?: string;
|
|
104
157
|
fulfillmentId?: string;
|
|
105
158
|
returnId?: string;
|
|
159
|
+
paymentSessionId?: string;
|
|
160
|
+
refundAttemptId?: string;
|
|
106
161
|
};
|
|
107
162
|
type WebhookCommerceNotificationChange = {
|
|
108
163
|
type: 'notification';
|
|
@@ -126,7 +181,7 @@ type CommerceEmailEventConfig = {
|
|
|
126
181
|
};
|
|
127
182
|
type CommerceEmailConfig = {
|
|
128
183
|
version: 1;
|
|
129
|
-
commerceNotifications: Partial<Record<
|
|
184
|
+
commerceNotifications: Partial<Record<CustomerCommerceNotificationEventName, CommerceEmailEventConfig>>;
|
|
130
185
|
};
|
|
131
186
|
type CommerceNotificationHandlerContext = {
|
|
132
187
|
event: CommerceNotificationWebhookEvent;
|
|
@@ -137,7 +192,9 @@ type CommerceNotificationEventHandlers = Partial<Record<CommerceNotificationEven
|
|
|
137
192
|
unhandled?: (event: WebhookEvent<string, unknown>) => MaybePromise<void>;
|
|
138
193
|
};
|
|
139
194
|
type CommerceEmailHandlerContext = CommerceNotificationHandlerContext;
|
|
140
|
-
type CommerceEmailEventHandlers =
|
|
195
|
+
type CommerceEmailEventHandlers = Partial<Record<CustomerCommerceNotificationEventName, (context: CommerceEmailHandlerContext) => MaybePromise<void>>> & {
|
|
196
|
+
unhandled?: (event: WebhookEvent<string, unknown>) => MaybePromise<void>;
|
|
197
|
+
};
|
|
141
198
|
/**
|
|
142
199
|
* Returns true for semantic order-change webhooks emitted as update events.
|
|
143
200
|
*
|
|
@@ -183,7 +240,12 @@ interface CustomerAuthWebhookHandlers {
|
|
|
183
240
|
}
|
|
184
241
|
declare function isCustomerPasswordResetWebhookEvent(event: WebhookEvent<string, unknown>): event is CustomerPasswordResetWebhookEvent;
|
|
185
242
|
declare function createCustomerAuthWebhookHandler(handlers: CustomerAuthWebhookHandlers): WebhookHandler<string, unknown>;
|
|
186
|
-
|
|
243
|
+
/**
|
|
244
|
+
* @deprecated Import `handleSignedWebhook()` from `@01.software/sdk/webhook`.
|
|
245
|
+
* This compatibility alias is signed and fails closed when its required secret
|
|
246
|
+
* is missing or blank.
|
|
247
|
+
*/
|
|
248
|
+
declare function handleWebhook<T extends Collection | string = Collection, TData = T extends Collection ? CollectionType<T> : Record<string, unknown>>(request: Request, handler: WebhookHandler<T, TData>, options: WebhookOptions): Promise<Response>;
|
|
187
249
|
declare function createTypedWebhookHandler<T extends Collection>(collection: T, handler: (event: WebhookEvent<T>) => Promise<void> | void): WebhookHandler<T>;
|
|
188
250
|
|
|
189
|
-
export { type
|
|
251
|
+
export { isWebhookOperation as $, type PaymentIncidentNotificationStatus as A, type PaymentIncidentProviderObject as B, COMMERCE_NOTIFICATION_EVENTS as C, type WebhookChange as D, type WebhookCommerceNotificationChange as E, type WebhookEvent as F, type WebhookKnownOperation as G, type WebhookOperation as H, type WebhookOptions as I, type WebhookOrderChange as J, type WebhookOrderMoved as K, type WebhookOrderScope as L, createCommerceEmailWebhookHandler as M, createCommerceNotificationWebhookHandler as N, ORDER_CHANGED_EVENT_TYPE as O, type PaymentIncidentMoney as P, createCustomerAuthWebhookHandler as Q, createTypedWebhookHandler as R, defineCommerceEmailConfig as S, getCommerceNotificationIdempotencyKey as T, handleWebhook as U, isCommerceNotificationWebhookEvent as V, type WebhookHandler as W, isCustomerPasswordResetWebhookEvent as X, isOrderChangedWebhookEvent as Y, isValidWebhookEvent as Z, isWebhookCollection as _, COMMERCE_NOTIFICATION_EVENT_TYPE as a, type CustomerCommerceNotificationEventName as a0, type PaymentReconciliationRequiredNotificationData as a1, type PaymentRefundRequiresAttentionNotificationData as a2, COMMERCE_NOTIFICATION_OPERATION as b, CUSTOMER_PASSWORD_RESET_OPERATION as c, type CollectionWebhookOperation as d, type CommerceEmailChannel as e, type CommerceEmailConfig as f, type CommerceEmailEventConfig as g, type CommerceEmailEventHandlers as h, type CommerceEmailHandlerContext as i, type CommerceNotification as j, type CommerceNotificationData as k, type CommerceNotificationEventHandlers as l, type CommerceNotificationEventName as m, type CommerceNotificationHandlerContext as n, type CommerceNotificationSource as o, type CommerceNotificationSourceCollection as p, type CommerceNotificationWebhookEvent as q, type CustomerAuthWebhookEvent as r, type CustomerAuthWebhookHandlers as s, type CustomerPasswordResetWebhookData as t, type CustomerPasswordResetWebhookEvent as u, type OrderChangedWebhookEvent as v, type PaymentIncidentNotificationData as w, type PaymentIncidentNotificationEventName as x, type PaymentIncidentNotificationReason as y, type PaymentIncidentNotificationSourceCollection as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as Collection } from './const-
|
|
2
|
-
import { C as CollectionType } from './types-
|
|
3
|
-
import './payload-types-
|
|
1
|
+
import { C as Collection } from './const-D8LixhAJ.cjs';
|
|
2
|
+
import { C as CollectionType } from './types-B14sEt1z.cjs';
|
|
3
|
+
import './payload-types-BOsckg8B.cjs';
|
|
4
4
|
|
|
5
5
|
type WebhookOperation = string;
|
|
6
6
|
/**
|
|
@@ -61,8 +61,10 @@ interface WebhookEvent<T extends Collection | string = Collection, TData = T ext
|
|
|
61
61
|
deliveryId?: string;
|
|
62
62
|
}
|
|
63
63
|
type WebhookHandler<T extends Collection | string = Collection, TData = T extends Collection ? CollectionType<T> : Record<string, unknown>> = (event: WebhookEvent<T, TData>) => Promise<void> | void;
|
|
64
|
+
/** @deprecated Use the signed receiver options from `@01.software/sdk/webhook`. */
|
|
64
65
|
interface WebhookOptions {
|
|
65
|
-
secret
|
|
66
|
+
/** Nonblank HMAC-SHA256 signing secret for this receiver. */
|
|
67
|
+
secret: string;
|
|
66
68
|
/** Max accepted skew for signed webhook delivery timestamps. Default: 300s. */
|
|
67
69
|
toleranceSeconds?: number;
|
|
68
70
|
}
|
|
@@ -74,13 +76,57 @@ type OrderChangedWebhookEvent<T extends Collection | string = Collection, TData
|
|
|
74
76
|
change: WebhookOrderChange;
|
|
75
77
|
};
|
|
76
78
|
declare const COMMERCE_NOTIFICATION_OPERATION: "notification";
|
|
77
|
-
declare const COMMERCE_NOTIFICATION_EVENTS: readonly ["orderPaid", "orderCanceled", "fulfillmentShipped", "orderDelivered", "returnRequested", "returnApproved", "returnRejected", "returnCanceled", "returnCompleted"];
|
|
79
|
+
declare const COMMERCE_NOTIFICATION_EVENTS: readonly ["orderPaid", "orderCanceled", "fulfillmentShipped", "orderDelivered", "returnRequested", "returnApproved", "returnRejected", "returnCanceled", "returnCompleted", "paymentReconciliationRequired", "paymentRefundRequiresAttention"];
|
|
78
80
|
type CommerceNotificationEventName = (typeof COMMERCE_NOTIFICATION_EVENTS)[number];
|
|
79
|
-
type
|
|
81
|
+
type CustomerCommerceNotificationEventName = Exclude<CommerceNotificationEventName, PaymentIncidentNotificationEventName>;
|
|
82
|
+
type CommerceNotificationSourceCollection = 'orders' | 'fulfillments' | 'returns' | 'payment-sessions' | 'payment-refund-attempts';
|
|
80
83
|
type CommerceNotificationSource = {
|
|
81
84
|
collection: CommerceNotificationSourceCollection;
|
|
82
85
|
id: string | number;
|
|
83
86
|
};
|
|
87
|
+
type PaymentIncidentNotificationEventName = 'paymentReconciliationRequired' | 'paymentRefundRequiresAttention';
|
|
88
|
+
type PaymentIncidentNotificationSourceCollection = 'payment-sessions' | 'payment-refund-attempts';
|
|
89
|
+
type PaymentIncidentNotificationReason = 'orderless_capture' | 'local_commit_ambiguous';
|
|
90
|
+
type PaymentIncidentNotificationStatus = 'reconciliation_required' | 'requires_attention';
|
|
91
|
+
type PaymentIncidentProviderObject = {
|
|
92
|
+
provider: string;
|
|
93
|
+
kind: 'payment' | 'refund';
|
|
94
|
+
id: string;
|
|
95
|
+
};
|
|
96
|
+
type PaymentIncidentMoney = {
|
|
97
|
+
amountMinor: number;
|
|
98
|
+
currency: string;
|
|
99
|
+
};
|
|
100
|
+
type PaymentIncidentNotificationBase = {
|
|
101
|
+
paymentSessionId: string;
|
|
102
|
+
checkoutId?: string;
|
|
103
|
+
orderId?: string;
|
|
104
|
+
providerObject: PaymentIncidentProviderObject;
|
|
105
|
+
money: PaymentIncidentMoney;
|
|
106
|
+
observedAt: string;
|
|
107
|
+
};
|
|
108
|
+
type PaymentReconciliationRequiredNotificationData = PaymentIncidentNotificationBase & {
|
|
109
|
+
source: {
|
|
110
|
+
collection: 'payment-sessions';
|
|
111
|
+
id: string;
|
|
112
|
+
};
|
|
113
|
+
providerObject: PaymentIncidentProviderObject & {
|
|
114
|
+
kind: 'payment';
|
|
115
|
+
};
|
|
116
|
+
status: 'reconciliation_required';
|
|
117
|
+
reason: 'orderless_capture';
|
|
118
|
+
refundAttemptId?: never;
|
|
119
|
+
};
|
|
120
|
+
type PaymentRefundRequiresAttentionNotificationData = PaymentIncidentNotificationBase & {
|
|
121
|
+
source: {
|
|
122
|
+
collection: 'payment-refund-attempts';
|
|
123
|
+
id: string;
|
|
124
|
+
};
|
|
125
|
+
refundAttemptId: string;
|
|
126
|
+
status: 'requires_attention';
|
|
127
|
+
reason: 'local_commit_ambiguous';
|
|
128
|
+
};
|
|
129
|
+
type PaymentIncidentNotificationData = PaymentReconciliationRequiredNotificationData | PaymentRefundRequiresAttentionNotificationData;
|
|
84
130
|
type CommerceNotificationData = {
|
|
85
131
|
source?: CommerceNotificationSource;
|
|
86
132
|
orderId?: string | number;
|
|
@@ -95,6 +141,13 @@ type CommerceNotificationData = {
|
|
|
95
141
|
returnStatus?: string;
|
|
96
142
|
refundAmount?: number;
|
|
97
143
|
completedAt?: string;
|
|
144
|
+
paymentSessionId?: string;
|
|
145
|
+
checkoutId?: string;
|
|
146
|
+
refundAttemptId?: string;
|
|
147
|
+
providerObject?: PaymentIncidentProviderObject;
|
|
148
|
+
money?: PaymentIncidentMoney;
|
|
149
|
+
reason?: PaymentIncidentNotificationReason;
|
|
150
|
+
observedAt?: string;
|
|
98
151
|
};
|
|
99
152
|
type CommerceNotification = {
|
|
100
153
|
event: CommerceNotificationEventName;
|
|
@@ -103,6 +156,8 @@ type CommerceNotification = {
|
|
|
103
156
|
orderId?: string;
|
|
104
157
|
fulfillmentId?: string;
|
|
105
158
|
returnId?: string;
|
|
159
|
+
paymentSessionId?: string;
|
|
160
|
+
refundAttemptId?: string;
|
|
106
161
|
};
|
|
107
162
|
type WebhookCommerceNotificationChange = {
|
|
108
163
|
type: 'notification';
|
|
@@ -126,7 +181,7 @@ type CommerceEmailEventConfig = {
|
|
|
126
181
|
};
|
|
127
182
|
type CommerceEmailConfig = {
|
|
128
183
|
version: 1;
|
|
129
|
-
commerceNotifications: Partial<Record<
|
|
184
|
+
commerceNotifications: Partial<Record<CustomerCommerceNotificationEventName, CommerceEmailEventConfig>>;
|
|
130
185
|
};
|
|
131
186
|
type CommerceNotificationHandlerContext = {
|
|
132
187
|
event: CommerceNotificationWebhookEvent;
|
|
@@ -137,7 +192,9 @@ type CommerceNotificationEventHandlers = Partial<Record<CommerceNotificationEven
|
|
|
137
192
|
unhandled?: (event: WebhookEvent<string, unknown>) => MaybePromise<void>;
|
|
138
193
|
};
|
|
139
194
|
type CommerceEmailHandlerContext = CommerceNotificationHandlerContext;
|
|
140
|
-
type CommerceEmailEventHandlers =
|
|
195
|
+
type CommerceEmailEventHandlers = Partial<Record<CustomerCommerceNotificationEventName, (context: CommerceEmailHandlerContext) => MaybePromise<void>>> & {
|
|
196
|
+
unhandled?: (event: WebhookEvent<string, unknown>) => MaybePromise<void>;
|
|
197
|
+
};
|
|
141
198
|
/**
|
|
142
199
|
* Returns true for semantic order-change webhooks emitted as update events.
|
|
143
200
|
*
|
|
@@ -183,7 +240,12 @@ interface CustomerAuthWebhookHandlers {
|
|
|
183
240
|
}
|
|
184
241
|
declare function isCustomerPasswordResetWebhookEvent(event: WebhookEvent<string, unknown>): event is CustomerPasswordResetWebhookEvent;
|
|
185
242
|
declare function createCustomerAuthWebhookHandler(handlers: CustomerAuthWebhookHandlers): WebhookHandler<string, unknown>;
|
|
186
|
-
|
|
243
|
+
/**
|
|
244
|
+
* @deprecated Import `handleSignedWebhook()` from `@01.software/sdk/webhook`.
|
|
245
|
+
* This compatibility alias is signed and fails closed when its required secret
|
|
246
|
+
* is missing or blank.
|
|
247
|
+
*/
|
|
248
|
+
declare function handleWebhook<T extends Collection | string = Collection, TData = T extends Collection ? CollectionType<T> : Record<string, unknown>>(request: Request, handler: WebhookHandler<T, TData>, options: WebhookOptions): Promise<Response>;
|
|
187
249
|
declare function createTypedWebhookHandler<T extends Collection>(collection: T, handler: (event: WebhookEvent<T>) => Promise<void> | void): WebhookHandler<T>;
|
|
188
250
|
|
|
189
|
-
export { type
|
|
251
|
+
export { isWebhookOperation as $, type PaymentIncidentNotificationStatus as A, type PaymentIncidentProviderObject as B, COMMERCE_NOTIFICATION_EVENTS as C, type WebhookChange as D, type WebhookCommerceNotificationChange as E, type WebhookEvent as F, type WebhookKnownOperation as G, type WebhookOperation as H, type WebhookOptions as I, type WebhookOrderChange as J, type WebhookOrderMoved as K, type WebhookOrderScope as L, createCommerceEmailWebhookHandler as M, createCommerceNotificationWebhookHandler as N, ORDER_CHANGED_EVENT_TYPE as O, type PaymentIncidentMoney as P, createCustomerAuthWebhookHandler as Q, createTypedWebhookHandler as R, defineCommerceEmailConfig as S, getCommerceNotificationIdempotencyKey as T, handleWebhook as U, isCommerceNotificationWebhookEvent as V, type WebhookHandler as W, isCustomerPasswordResetWebhookEvent as X, isOrderChangedWebhookEvent as Y, isValidWebhookEvent as Z, isWebhookCollection as _, COMMERCE_NOTIFICATION_EVENT_TYPE as a, type CustomerCommerceNotificationEventName as a0, type PaymentReconciliationRequiredNotificationData as a1, type PaymentRefundRequiresAttentionNotificationData as a2, COMMERCE_NOTIFICATION_OPERATION as b, CUSTOMER_PASSWORD_RESET_OPERATION as c, type CollectionWebhookOperation as d, type CommerceEmailChannel as e, type CommerceEmailConfig as f, type CommerceEmailEventConfig as g, type CommerceEmailEventHandlers as h, type CommerceEmailHandlerContext as i, type CommerceNotification as j, type CommerceNotificationData as k, type CommerceNotificationEventHandlers as l, type CommerceNotificationEventName as m, type CommerceNotificationHandlerContext as n, type CommerceNotificationSource as o, type CommerceNotificationSourceCollection as p, type CommerceNotificationWebhookEvent as q, type CustomerAuthWebhookEvent as r, type CustomerAuthWebhookHandlers as s, type CustomerPasswordResetWebhookData as t, type CustomerPasswordResetWebhookEvent as u, type OrderChangedWebhookEvent as v, type PaymentIncidentNotificationData as w, type PaymentIncidentNotificationEventName as x, type PaymentIncidentNotificationReason as y, type PaymentIncidentNotificationSourceCollection as z };
|