@strimz/shared-types 0.17.0 → 0.19.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/dist/analytics.d.cts +141 -141
- package/dist/analytics.d.ts +141 -141
- package/dist/api-keys.d.cts +14 -14
- package/dist/api-keys.d.ts +14 -14
- package/dist/compliance.d.cts +8 -8
- package/dist/compliance.d.ts +8 -8
- package/dist/customers.d.cts +7 -7
- package/dist/customers.d.ts +7 -7
- package/dist/events.cjs +4 -0
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +1681 -1486
- package/dist/events.d.ts +1681 -1486
- package/dist/events.js +4 -1
- package/dist/events.js.map +1 -1
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/invoices.d.cts +12 -12
- package/dist/invoices.d.ts +12 -12
- package/dist/merchants.d.cts +26 -26
- package/dist/merchants.d.ts +26 -26
- package/dist/payment-sessions.d.cts +16 -16
- package/dist/payment-sessions.d.ts +16 -16
- package/dist/refunds.d.cts +36 -36
- package/dist/refunds.d.ts +36 -36
- package/dist/storefronts.d.cts +13 -13
- package/dist/storefronts.d.ts +13 -13
- package/dist/subscriptions.d.cts +32 -32
- package/dist/subscriptions.d.ts +32 -32
- package/dist/transactions.d.cts +10 -10
- package/dist/transactions.d.ts +10 -10
- package/dist/webhooks.cjs +1 -0
- package/dist/webhooks.cjs.map +1 -1
- package/dist/webhooks.d.cts +46 -46
- package/dist/webhooks.d.ts +46 -46
- package/dist/webhooks.js +1 -0
- package/dist/webhooks.js.map +1 -1
- package/package.json +2 -2
- package/src/events.ts +4 -0
- package/src/notifications.ts +2 -0
- package/src/webhooks.ts +1 -0
package/dist/subscriptions.d.ts
CHANGED
|
@@ -51,15 +51,15 @@ declare const subscriptionPlanSchema: z.ZodObject<{
|
|
|
51
51
|
updatedAt: z.ZodString;
|
|
52
52
|
}, "strip", z.ZodTypeAny, {
|
|
53
53
|
status: "active" | "archived";
|
|
54
|
-
|
|
54
|
+
amount: string;
|
|
55
|
+
currency: "USDC" | "EURC";
|
|
55
56
|
merchantId: string;
|
|
56
|
-
createdAt: string;
|
|
57
57
|
description: string | null;
|
|
58
|
-
|
|
58
|
+
id: string;
|
|
59
|
+
createdAt: string;
|
|
59
60
|
updatedAt: string;
|
|
60
61
|
chainMerchantId: string | null;
|
|
61
62
|
tokenAddress: string | null;
|
|
62
|
-
amount: string;
|
|
63
63
|
successUrl: string | null;
|
|
64
64
|
cancelUrl: string | null;
|
|
65
65
|
metadata: Record<string, string | number | boolean | null>;
|
|
@@ -70,15 +70,15 @@ declare const subscriptionPlanSchema: z.ZodObject<{
|
|
|
70
70
|
trialPeriodDays: number | null;
|
|
71
71
|
}, {
|
|
72
72
|
status: "active" | "archived";
|
|
73
|
-
|
|
73
|
+
amount: string;
|
|
74
|
+
currency: "USDC" | "EURC";
|
|
74
75
|
merchantId: string;
|
|
75
|
-
createdAt: string;
|
|
76
76
|
description: string | null;
|
|
77
|
-
|
|
77
|
+
id: string;
|
|
78
|
+
createdAt: string;
|
|
78
79
|
updatedAt: string;
|
|
79
80
|
chainMerchantId: string | null;
|
|
80
81
|
tokenAddress: string | null;
|
|
81
|
-
amount: string;
|
|
82
82
|
successUrl: string | null;
|
|
83
83
|
cancelUrl: string | null;
|
|
84
84
|
intervalSeconds: number;
|
|
@@ -101,8 +101,8 @@ declare const createSubscriptionPlanInputSchema: z.ZodObject<{
|
|
|
101
101
|
cancelUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
102
102
|
metadata: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>>;
|
|
103
103
|
}, "strip", z.ZodTypeAny, {
|
|
104
|
-
currency: "USDC" | "EURC";
|
|
105
104
|
amount: string;
|
|
105
|
+
currency: "USDC" | "EURC";
|
|
106
106
|
name: string;
|
|
107
107
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
108
108
|
intervalCount: number;
|
|
@@ -112,8 +112,8 @@ declare const createSubscriptionPlanInputSchema: z.ZodObject<{
|
|
|
112
112
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
113
113
|
trialPeriodDays?: number | undefined;
|
|
114
114
|
}, {
|
|
115
|
-
currency: "USDC" | "EURC";
|
|
116
115
|
amount: string;
|
|
116
|
+
currency: "USDC" | "EURC";
|
|
117
117
|
name: string;
|
|
118
118
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
119
119
|
description?: string | undefined;
|
|
@@ -155,14 +155,14 @@ declare const subscriptionResultMessageSchema: z.ZodDiscriminatedUnion<"type", [
|
|
|
155
155
|
txHash: z.ZodString;
|
|
156
156
|
}, "strip", z.ZodTypeAny, {
|
|
157
157
|
type: "strimz:subscription:success";
|
|
158
|
-
subscriptionId: string | null;
|
|
159
158
|
txHash: string;
|
|
160
159
|
planId: string;
|
|
160
|
+
subscriptionId: string | null;
|
|
161
161
|
}, {
|
|
162
162
|
type: "strimz:subscription:success";
|
|
163
|
-
subscriptionId: string | null;
|
|
164
163
|
txHash: string;
|
|
165
164
|
planId: string;
|
|
165
|
+
subscriptionId: string | null;
|
|
166
166
|
}>, z.ZodObject<{
|
|
167
167
|
type: z.ZodLiteral<"strimz:subscription:cancel">;
|
|
168
168
|
planId: z.ZodString;
|
|
@@ -213,14 +213,14 @@ declare const subscriptionSchema: z.ZodObject<{
|
|
|
213
213
|
createdAt: z.ZodString;
|
|
214
214
|
updatedAt: z.ZodString;
|
|
215
215
|
}, "strip", z.ZodTypeAny, {
|
|
216
|
-
status: "cancelled" | "
|
|
217
|
-
|
|
216
|
+
status: "cancelled" | "trialing" | "active" | "at_risk" | "paused" | "lapsed";
|
|
217
|
+
amount: string;
|
|
218
|
+
currency: "USDC" | "EURC";
|
|
219
|
+
customerId: string;
|
|
218
220
|
merchantId: string;
|
|
221
|
+
id: string;
|
|
219
222
|
createdAt: string;
|
|
220
|
-
currency: "USDC" | "EURC";
|
|
221
223
|
updatedAt: string;
|
|
222
|
-
customerId: string;
|
|
223
|
-
amount: string;
|
|
224
224
|
metadata: Record<string, string | number | boolean | null>;
|
|
225
225
|
payerAddress: string;
|
|
226
226
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
@@ -234,14 +234,14 @@ declare const subscriptionSchema: z.ZodObject<{
|
|
|
234
234
|
gracePeriodHours: number;
|
|
235
235
|
cancelledAt: string | null;
|
|
236
236
|
}, {
|
|
237
|
-
status: "cancelled" | "
|
|
238
|
-
|
|
237
|
+
status: "cancelled" | "trialing" | "active" | "at_risk" | "paused" | "lapsed";
|
|
238
|
+
amount: string;
|
|
239
|
+
currency: "USDC" | "EURC";
|
|
240
|
+
customerId: string;
|
|
239
241
|
merchantId: string;
|
|
242
|
+
id: string;
|
|
240
243
|
createdAt: string;
|
|
241
|
-
currency: "USDC" | "EURC";
|
|
242
244
|
updatedAt: string;
|
|
243
|
-
customerId: string;
|
|
244
|
-
amount: string;
|
|
245
245
|
payerAddress: string;
|
|
246
246
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
247
247
|
intervalCount: number;
|
|
@@ -261,11 +261,11 @@ declare const subscriptionStatusResultSchema: z.ZodObject<{
|
|
|
261
261
|
active: z.ZodBoolean;
|
|
262
262
|
subscriptionId: z.ZodNullable<z.ZodString>;
|
|
263
263
|
}, "strip", z.ZodTypeAny, {
|
|
264
|
-
subscriptionId: string | null;
|
|
265
264
|
active: boolean;
|
|
266
|
-
}, {
|
|
267
265
|
subscriptionId: string | null;
|
|
266
|
+
}, {
|
|
268
267
|
active: boolean;
|
|
268
|
+
subscriptionId: string | null;
|
|
269
269
|
}>;
|
|
270
270
|
type SubscriptionStatusResult = z.infer<typeof subscriptionStatusResultSchema>;
|
|
271
271
|
declare const subscriptionEnrolmentTermsSchema: z.ZodObject<{
|
|
@@ -318,15 +318,15 @@ declare const subscriptionChargeSchema: z.ZodObject<{
|
|
|
318
318
|
updatedAt: z.ZodString;
|
|
319
319
|
}, "strip", z.ZodTypeAny, {
|
|
320
320
|
status: "failed" | "pending" | "in_flight" | "succeeded" | "retrying" | "abandoned";
|
|
321
|
-
|
|
321
|
+
amount: string;
|
|
322
|
+
currency: "USDC" | "EURC";
|
|
322
323
|
merchantId: string;
|
|
323
|
-
|
|
324
|
+
id: string;
|
|
324
325
|
createdAt: string;
|
|
325
|
-
currency: "USDC" | "EURC";
|
|
326
326
|
updatedAt: string;
|
|
327
|
-
amount: string;
|
|
328
327
|
onchainTxHash: string | null;
|
|
329
328
|
failureReason: string | null;
|
|
329
|
+
subscriptionId: string;
|
|
330
330
|
chargeAttemptId: string;
|
|
331
331
|
periodStartAt: string;
|
|
332
332
|
periodEndAt: string;
|
|
@@ -336,15 +336,15 @@ declare const subscriptionChargeSchema: z.ZodObject<{
|
|
|
336
336
|
executedAt: string | null;
|
|
337
337
|
}, {
|
|
338
338
|
status: "failed" | "pending" | "in_flight" | "succeeded" | "retrying" | "abandoned";
|
|
339
|
-
|
|
339
|
+
amount: string;
|
|
340
|
+
currency: "USDC" | "EURC";
|
|
340
341
|
merchantId: string;
|
|
341
|
-
|
|
342
|
+
id: string;
|
|
342
343
|
createdAt: string;
|
|
343
|
-
currency: "USDC" | "EURC";
|
|
344
344
|
updatedAt: string;
|
|
345
|
-
amount: string;
|
|
346
345
|
onchainTxHash: string | null;
|
|
347
346
|
failureReason: string | null;
|
|
347
|
+
subscriptionId: string;
|
|
348
348
|
chargeAttemptId: string;
|
|
349
349
|
periodStartAt: string;
|
|
350
350
|
periodEndAt: string;
|
package/dist/transactions.d.cts
CHANGED
|
@@ -34,18 +34,18 @@ declare const transactionSchema: z.ZodObject<{
|
|
|
34
34
|
createdAt: z.ZodString;
|
|
35
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
36
|
status: "confirmed" | "failed" | "pending";
|
|
37
|
-
|
|
37
|
+
amount: string;
|
|
38
|
+
currency: "USDC" | "EURC";
|
|
39
|
+
customerId: string | null;
|
|
38
40
|
merchantId: string;
|
|
41
|
+
id: string;
|
|
39
42
|
sessionId: string | null;
|
|
40
|
-
subscriptionId: string | null;
|
|
41
43
|
createdAt: string;
|
|
42
|
-
currency: "USDC" | "EURC";
|
|
43
|
-
customerId: string | null;
|
|
44
|
-
amount: string;
|
|
45
44
|
feeAmount: string;
|
|
46
45
|
netAmount: string;
|
|
47
46
|
onchainTxHash: string;
|
|
48
47
|
payerAddress: string;
|
|
48
|
+
subscriptionId: string | null;
|
|
49
49
|
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
50
50
|
subscriptionChargeId: string | null;
|
|
51
51
|
refundId: string | null;
|
|
@@ -54,18 +54,18 @@ declare const transactionSchema: z.ZodObject<{
|
|
|
54
54
|
blockTimestamp: string;
|
|
55
55
|
}, {
|
|
56
56
|
status: "confirmed" | "failed" | "pending";
|
|
57
|
-
|
|
57
|
+
amount: string;
|
|
58
|
+
currency: "USDC" | "EURC";
|
|
59
|
+
customerId: string | null;
|
|
58
60
|
merchantId: string;
|
|
61
|
+
id: string;
|
|
59
62
|
sessionId: string | null;
|
|
60
|
-
subscriptionId: string | null;
|
|
61
63
|
createdAt: string;
|
|
62
|
-
currency: "USDC" | "EURC";
|
|
63
|
-
customerId: string | null;
|
|
64
|
-
amount: string;
|
|
65
64
|
feeAmount: string;
|
|
66
65
|
netAmount: string;
|
|
67
66
|
onchainTxHash: string;
|
|
68
67
|
payerAddress: string;
|
|
68
|
+
subscriptionId: string | null;
|
|
69
69
|
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
70
70
|
subscriptionChargeId: string | null;
|
|
71
71
|
refundId: string | null;
|
package/dist/transactions.d.ts
CHANGED
|
@@ -34,18 +34,18 @@ declare const transactionSchema: z.ZodObject<{
|
|
|
34
34
|
createdAt: z.ZodString;
|
|
35
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
36
|
status: "confirmed" | "failed" | "pending";
|
|
37
|
-
|
|
37
|
+
amount: string;
|
|
38
|
+
currency: "USDC" | "EURC";
|
|
39
|
+
customerId: string | null;
|
|
38
40
|
merchantId: string;
|
|
41
|
+
id: string;
|
|
39
42
|
sessionId: string | null;
|
|
40
|
-
subscriptionId: string | null;
|
|
41
43
|
createdAt: string;
|
|
42
|
-
currency: "USDC" | "EURC";
|
|
43
|
-
customerId: string | null;
|
|
44
|
-
amount: string;
|
|
45
44
|
feeAmount: string;
|
|
46
45
|
netAmount: string;
|
|
47
46
|
onchainTxHash: string;
|
|
48
47
|
payerAddress: string;
|
|
48
|
+
subscriptionId: string | null;
|
|
49
49
|
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
50
50
|
subscriptionChargeId: string | null;
|
|
51
51
|
refundId: string | null;
|
|
@@ -54,18 +54,18 @@ declare const transactionSchema: z.ZodObject<{
|
|
|
54
54
|
blockTimestamp: string;
|
|
55
55
|
}, {
|
|
56
56
|
status: "confirmed" | "failed" | "pending";
|
|
57
|
-
|
|
57
|
+
amount: string;
|
|
58
|
+
currency: "USDC" | "EURC";
|
|
59
|
+
customerId: string | null;
|
|
58
60
|
merchantId: string;
|
|
61
|
+
id: string;
|
|
59
62
|
sessionId: string | null;
|
|
60
|
-
subscriptionId: string | null;
|
|
61
63
|
createdAt: string;
|
|
62
|
-
currency: "USDC" | "EURC";
|
|
63
|
-
customerId: string | null;
|
|
64
|
-
amount: string;
|
|
65
64
|
feeAmount: string;
|
|
66
65
|
netAmount: string;
|
|
67
66
|
onchainTxHash: string;
|
|
68
67
|
payerAddress: string;
|
|
68
|
+
subscriptionId: string | null;
|
|
69
69
|
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
70
70
|
subscriptionChargeId: string | null;
|
|
71
71
|
refundId: string | null;
|
package/dist/webhooks.cjs
CHANGED
package/dist/webhooks.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common.ts","../src/webhooks.ts"],"names":["z"],"mappings":";;;;;AAQO,IAAM,QAAA,GAAWA,KAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAGlBA,KAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAGJA,KAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D;AAGlEA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG;AAGnE,IAAM,cAAA,GAAiBA,KAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC,CAAA;AAG0BA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AAOPA,KAAA,CAC9B,MAAA,EAAO,CACP,KAAA,CAAM,YAAY,iDAAiD;AAG5CA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,MAAA,CAAO,gBAAgB;AAGtE,IAAM,kBAAA,GAAqBA,KAAA,CAC/B,MAAA,EAAO,CACP,QAAA,CAAS,EAAE,MAAA,EAAQ,IAAA,EAAM,OAAA,EAAS,+BAAA,EAAiC,CAAA;AAGrCA,MAC9B,MAAA,EAAO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EAAS;AAAA,EAClC,cAAA,EAAgBA,MAAE,MAAA,CAAOA,KAAAA,CAAE,QAAO,EAAGA,KAAAA,CAAE,SAAS;AAClD,CAAC;AAGM,IAAM,yBAAA,GAA4BA,MAAE,MAAA,CAAO;AAAA,EAChD,EAAA,EAAI;AACN,CAAC","file":"webhooks.cjs","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.input<typeof paginationInputSchema>\nexport type PaginationParsed = z.output<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'starter', 'growth', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Webhook endpoints and deliveries.\n *\n * Endpoint = the URL the merchant registered.\n * Event = the thing that happened.\n * Delivery = one attempt to POST a specific event to a specific endpoint.\n */\n\nimport { z } from 'zod'\nimport { httpsUrlSchema, idSchema, isoTimestampSchema, modeSchema } from './common.js'\n\n// ---------- Event name ----------\n\n/**\n * Every webhook event name in the system. Listed inline so Zod can\n * produce a concrete string union.\n */\nexport const webhookEventNameSchema = z.enum([\n 'payment.created',\n 'payment.completed',\n 'payment.failed',\n 'subscription.created',\n 'subscription.charged',\n 'subscription.charge_failed',\n 'subscription.recovery_attempt',\n 'subscription.cancelled',\n 'subscription.lapsed',\n 'subscription.reactivated',\n 'refund.created',\n 'refund.completed',\n 'invoice.created',\n 'invoice.paid',\n 'invoice.overdue',\n 'agent.job_proposed',\n 'agent.job_completed',\n 'agent.job_disputed',\n 'compliance.wallet_flagged',\n 'compliance.wallet_blocked',\n])\nexport type WebhookEventName = z.infer<typeof webhookEventNameSchema>\n\n// ---------- Endpoints ----------\n\nexport const webhookEndpointStatusSchema = z.enum(['active', 'disabled'])\nexport type WebhookEndpointStatus = z.infer<typeof webhookEndpointStatusSchema>\n\nexport const webhookEndpointSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n mode: modeSchema,\n url: httpsUrlSchema,\n description: z.string().max(200).nullable(),\n events: z.array(webhookEventNameSchema).nonempty(),\n status: webhookEndpointStatusSchema,\n signingSecretPrefix: z.string().min(4).max(12),\n lastDeliveredAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type WebhookEndpoint = z.infer<typeof webhookEndpointSchema>\n\nexport const createWebhookEndpointInputSchema = z.object({\n url: httpsUrlSchema,\n events: z.array(webhookEventNameSchema).nonempty(),\n description: z.string().max(200).optional(),\n mode: modeSchema,\n})\nexport type CreateWebhookEndpointInput = z.input<typeof createWebhookEndpointInputSchema>\nexport type CreateWebhookEndpointParsed = z.output<typeof createWebhookEndpointInputSchema>\n\nexport const createWebhookEndpointOutputSchema = z.object({\n endpoint: webhookEndpointSchema,\n /** Full signing secret. Shown exactly once. */\n signingSecret: z.string(),\n})\nexport type CreateWebhookEndpointOutput = z.infer<typeof createWebhookEndpointOutputSchema>\n\n// ---------- Deliveries ----------\n\nexport const webhookDeliveryStatusSchema = z.enum([\n 'pending',\n 'delivered',\n 'retrying',\n 'permanently_failed',\n])\nexport type WebhookDeliveryStatus = z.infer<typeof webhookDeliveryStatusSchema>\n\nexport const webhookDeliverySchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n endpointId: idSchema,\n eventId: idSchema,\n eventName: webhookEventNameSchema,\n status: webhookDeliveryStatusSchema,\n attempt: z.number().int().min(1).max(6),\n responseCode: z.number().int().min(100).max(599).nullable(),\n responseMs: z.number().int().min(0).nullable(),\n lastError: z.string().max(1000).nullable(),\n nextAttemptAt: isoTimestampSchema.nullable(),\n deliveredAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n})\nexport type WebhookDelivery = z.infer<typeof webhookDeliverySchema>\n\n/**\n * Detail projection returned by GET /v1/webhook-deliveries/:id.\n * Carries the payload envelope, response body, and the deliveryId\n * header the receiver saw. Kept separate so list responses stay slim.\n */\nexport const webhookDeliveryDetailSchema = webhookDeliverySchema.extend({\n deliveryId: z.string(),\n responseBody: z.string().nullable(),\n requestPayload: z.record(z.string(), z.unknown()),\n})\nexport type WebhookDeliveryDetail = z.infer<typeof webhookDeliveryDetailSchema>\n\nexport const replayDeliveryInputSchema = z.object({\n id: idSchema,\n})\nexport type ReplayDeliveryInput = z.input<typeof replayDeliveryInputSchema>\nexport type ReplayDeliveryParsed = z.output<typeof replayDeliveryInputSchema>\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/common.ts","../src/webhooks.ts"],"names":["z"],"mappings":";;;;;AAQO,IAAM,QA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","file":"webhooks.cjs","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.input<typeof paginationInputSchema>\nexport type PaginationParsed = z.output<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'starter', 'growth', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Webhook endpoints and deliveries.\n *\n * Endpoint = the URL the merchant registered.\n * Event = the thing that happened.\n * Delivery = one attempt to POST a specific event to a specific endpoint.\n */\n\nimport { z } from 'zod'\nimport { httpsUrlSchema, idSchema, isoTimestampSchema, modeSchema } from './common.js'\n\n// ---------- Event name ----------\n\n/**\n * Every webhook event name in the system. Listed inline so Zod can\n * produce a concrete string union.\n */\nexport const webhookEventNameSchema = z.enum([\n 'payment.created',\n 'payment.completed',\n 'payment.failed',\n 'subscription.created',\n 'subscription.charged',\n 'subscription.charge_failed',\n 'subscription.recovery_attempt',\n 'subscription.cancelled',\n 'subscription.lapsed',\n 'subscription.reactivated',\n 'refund.created',\n 'refund.completed',\n 'refund.failed',\n 'invoice.created',\n 'invoice.paid',\n 'invoice.overdue',\n 'agent.job_proposed',\n 'agent.job_completed',\n 'agent.job_disputed',\n 'compliance.wallet_flagged',\n 'compliance.wallet_blocked',\n])\nexport type WebhookEventName = z.infer<typeof webhookEventNameSchema>\n\n// ---------- Endpoints ----------\n\nexport const webhookEndpointStatusSchema = z.enum(['active', 'disabled'])\nexport type WebhookEndpointStatus = z.infer<typeof webhookEndpointStatusSchema>\n\nexport const webhookEndpointSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n mode: modeSchema,\n url: httpsUrlSchema,\n description: z.string().max(200).nullable(),\n events: z.array(webhookEventNameSchema).nonempty(),\n status: webhookEndpointStatusSchema,\n signingSecretPrefix: z.string().min(4).max(12),\n lastDeliveredAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type WebhookEndpoint = z.infer<typeof webhookEndpointSchema>\n\nexport const createWebhookEndpointInputSchema = z.object({\n url: httpsUrlSchema,\n events: z.array(webhookEventNameSchema).nonempty(),\n description: z.string().max(200).optional(),\n mode: modeSchema,\n})\nexport type CreateWebhookEndpointInput = z.input<typeof createWebhookEndpointInputSchema>\nexport type CreateWebhookEndpointParsed = z.output<typeof createWebhookEndpointInputSchema>\n\nexport const createWebhookEndpointOutputSchema = z.object({\n endpoint: webhookEndpointSchema,\n /** Full signing secret. Shown exactly once. */\n signingSecret: z.string(),\n})\nexport type CreateWebhookEndpointOutput = z.infer<typeof createWebhookEndpointOutputSchema>\n\n// ---------- Deliveries ----------\n\nexport const webhookDeliveryStatusSchema = z.enum([\n 'pending',\n 'delivered',\n 'retrying',\n 'permanently_failed',\n])\nexport type WebhookDeliveryStatus = z.infer<typeof webhookDeliveryStatusSchema>\n\nexport const webhookDeliverySchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n endpointId: idSchema,\n eventId: idSchema,\n eventName: webhookEventNameSchema,\n status: webhookDeliveryStatusSchema,\n attempt: z.number().int().min(1).max(6),\n responseCode: z.number().int().min(100).max(599).nullable(),\n responseMs: z.number().int().min(0).nullable(),\n lastError: z.string().max(1000).nullable(),\n nextAttemptAt: isoTimestampSchema.nullable(),\n deliveredAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n})\nexport type WebhookDelivery = z.infer<typeof webhookDeliverySchema>\n\n/**\n * Detail projection returned by GET /v1/webhook-deliveries/:id.\n * Carries the payload envelope, response body, and the deliveryId\n * header the receiver saw. Kept separate so list responses stay slim.\n */\nexport const webhookDeliveryDetailSchema = webhookDeliverySchema.extend({\n deliveryId: z.string(),\n responseBody: z.string().nullable(),\n requestPayload: z.record(z.string(), z.unknown()),\n})\nexport type WebhookDeliveryDetail = z.infer<typeof webhookDeliveryDetailSchema>\n\nexport const replayDeliveryInputSchema = z.object({\n id: idSchema,\n})\nexport type ReplayDeliveryInput = z.input<typeof replayDeliveryInputSchema>\nexport type ReplayDeliveryParsed = z.output<typeof replayDeliveryInputSchema>\n"]}
|
package/dist/webhooks.d.cts
CHANGED
|
@@ -12,7 +12,7 @@ import { z } from 'zod';
|
|
|
12
12
|
* Every webhook event name in the system. Listed inline so Zod can
|
|
13
13
|
* produce a concrete string union.
|
|
14
14
|
*/
|
|
15
|
-
declare const webhookEventNameSchema: z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>;
|
|
15
|
+
declare const webhookEventNameSchema: z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "refund.failed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>;
|
|
16
16
|
type WebhookEventName = z.infer<typeof webhookEventNameSchema>;
|
|
17
17
|
declare const webhookEndpointStatusSchema: z.ZodEnum<["active", "disabled"]>;
|
|
18
18
|
type WebhookEndpointStatus = z.infer<typeof webhookEndpointStatusSchema>;
|
|
@@ -22,52 +22,52 @@ declare const webhookEndpointSchema: z.ZodObject<{
|
|
|
22
22
|
mode: z.ZodEnum<["test", "live"]>;
|
|
23
23
|
url: z.ZodEffects<z.ZodString, string, string>;
|
|
24
24
|
description: z.ZodNullable<z.ZodString>;
|
|
25
|
-
events: z.ZodArray<z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>, "atleastone">;
|
|
25
|
+
events: z.ZodArray<z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "refund.failed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>, "atleastone">;
|
|
26
26
|
status: z.ZodEnum<["active", "disabled"]>;
|
|
27
27
|
signingSecretPrefix: z.ZodString;
|
|
28
28
|
lastDeliveredAt: z.ZodNullable<z.ZodString>;
|
|
29
29
|
createdAt: z.ZodString;
|
|
30
30
|
updatedAt: z.ZodString;
|
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
status: "
|
|
33
|
-
|
|
32
|
+
status: "active" | "disabled";
|
|
33
|
+
mode: "test" | "live";
|
|
34
34
|
merchantId: string;
|
|
35
|
-
createdAt: string;
|
|
36
35
|
description: string | null;
|
|
36
|
+
id: string;
|
|
37
|
+
createdAt: string;
|
|
37
38
|
updatedAt: string;
|
|
38
|
-
mode: "test" | "live";
|
|
39
39
|
url: string;
|
|
40
|
-
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
40
|
+
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
41
41
|
signingSecretPrefix: string;
|
|
42
42
|
lastDeliveredAt: string | null;
|
|
43
43
|
}, {
|
|
44
|
-
status: "
|
|
45
|
-
|
|
44
|
+
status: "active" | "disabled";
|
|
45
|
+
mode: "test" | "live";
|
|
46
46
|
merchantId: string;
|
|
47
|
-
createdAt: string;
|
|
48
47
|
description: string | null;
|
|
48
|
+
id: string;
|
|
49
|
+
createdAt: string;
|
|
49
50
|
updatedAt: string;
|
|
50
|
-
mode: "test" | "live";
|
|
51
51
|
url: string;
|
|
52
|
-
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
52
|
+
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
53
53
|
signingSecretPrefix: string;
|
|
54
54
|
lastDeliveredAt: string | null;
|
|
55
55
|
}>;
|
|
56
56
|
type WebhookEndpoint = z.infer<typeof webhookEndpointSchema>;
|
|
57
57
|
declare const createWebhookEndpointInputSchema: z.ZodObject<{
|
|
58
58
|
url: z.ZodEffects<z.ZodString, string, string>;
|
|
59
|
-
events: z.ZodArray<z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>, "atleastone">;
|
|
59
|
+
events: z.ZodArray<z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "refund.failed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>, "atleastone">;
|
|
60
60
|
description: z.ZodOptional<z.ZodString>;
|
|
61
61
|
mode: z.ZodEnum<["test", "live"]>;
|
|
62
62
|
}, "strip", z.ZodTypeAny, {
|
|
63
63
|
mode: "test" | "live";
|
|
64
64
|
url: string;
|
|
65
|
-
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
65
|
+
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
66
66
|
description?: string | undefined;
|
|
67
67
|
}, {
|
|
68
68
|
mode: "test" | "live";
|
|
69
69
|
url: string;
|
|
70
|
-
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
70
|
+
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
71
71
|
description?: string | undefined;
|
|
72
72
|
}>;
|
|
73
73
|
type CreateWebhookEndpointInput = z.input<typeof createWebhookEndpointInputSchema>;
|
|
@@ -79,34 +79,34 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
79
79
|
mode: z.ZodEnum<["test", "live"]>;
|
|
80
80
|
url: z.ZodEffects<z.ZodString, string, string>;
|
|
81
81
|
description: z.ZodNullable<z.ZodString>;
|
|
82
|
-
events: z.ZodArray<z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>, "atleastone">;
|
|
82
|
+
events: z.ZodArray<z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "refund.failed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>, "atleastone">;
|
|
83
83
|
status: z.ZodEnum<["active", "disabled"]>;
|
|
84
84
|
signingSecretPrefix: z.ZodString;
|
|
85
85
|
lastDeliveredAt: z.ZodNullable<z.ZodString>;
|
|
86
86
|
createdAt: z.ZodString;
|
|
87
87
|
updatedAt: z.ZodString;
|
|
88
88
|
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
status: "
|
|
90
|
-
|
|
89
|
+
status: "active" | "disabled";
|
|
90
|
+
mode: "test" | "live";
|
|
91
91
|
merchantId: string;
|
|
92
|
-
createdAt: string;
|
|
93
92
|
description: string | null;
|
|
93
|
+
id: string;
|
|
94
|
+
createdAt: string;
|
|
94
95
|
updatedAt: string;
|
|
95
|
-
mode: "test" | "live";
|
|
96
96
|
url: string;
|
|
97
|
-
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
97
|
+
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
98
98
|
signingSecretPrefix: string;
|
|
99
99
|
lastDeliveredAt: string | null;
|
|
100
100
|
}, {
|
|
101
|
-
status: "
|
|
102
|
-
|
|
101
|
+
status: "active" | "disabled";
|
|
102
|
+
mode: "test" | "live";
|
|
103
103
|
merchantId: string;
|
|
104
|
-
createdAt: string;
|
|
105
104
|
description: string | null;
|
|
105
|
+
id: string;
|
|
106
|
+
createdAt: string;
|
|
106
107
|
updatedAt: string;
|
|
107
|
-
mode: "test" | "live";
|
|
108
108
|
url: string;
|
|
109
|
-
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
109
|
+
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
110
110
|
signingSecretPrefix: string;
|
|
111
111
|
lastDeliveredAt: string | null;
|
|
112
112
|
}>;
|
|
@@ -114,30 +114,30 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
114
114
|
signingSecret: z.ZodString;
|
|
115
115
|
}, "strip", z.ZodTypeAny, {
|
|
116
116
|
endpoint: {
|
|
117
|
-
status: "
|
|
118
|
-
|
|
117
|
+
status: "active" | "disabled";
|
|
118
|
+
mode: "test" | "live";
|
|
119
119
|
merchantId: string;
|
|
120
|
-
createdAt: string;
|
|
121
120
|
description: string | null;
|
|
121
|
+
id: string;
|
|
122
|
+
createdAt: string;
|
|
122
123
|
updatedAt: string;
|
|
123
|
-
mode: "test" | "live";
|
|
124
124
|
url: string;
|
|
125
|
-
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
125
|
+
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
126
126
|
signingSecretPrefix: string;
|
|
127
127
|
lastDeliveredAt: string | null;
|
|
128
128
|
};
|
|
129
129
|
signingSecret: string;
|
|
130
130
|
}, {
|
|
131
131
|
endpoint: {
|
|
132
|
-
status: "
|
|
133
|
-
|
|
132
|
+
status: "active" | "disabled";
|
|
133
|
+
mode: "test" | "live";
|
|
134
134
|
merchantId: string;
|
|
135
|
-
createdAt: string;
|
|
136
135
|
description: string | null;
|
|
136
|
+
id: string;
|
|
137
|
+
createdAt: string;
|
|
137
138
|
updatedAt: string;
|
|
138
|
-
mode: "test" | "live";
|
|
139
139
|
url: string;
|
|
140
|
-
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
140
|
+
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
141
141
|
signingSecretPrefix: string;
|
|
142
142
|
lastDeliveredAt: string | null;
|
|
143
143
|
};
|
|
@@ -151,7 +151,7 @@ declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
151
151
|
merchantId: z.ZodString;
|
|
152
152
|
endpointId: z.ZodString;
|
|
153
153
|
eventId: z.ZodString;
|
|
154
|
-
eventName: z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>;
|
|
154
|
+
eventName: z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "refund.failed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>;
|
|
155
155
|
status: z.ZodEnum<["pending", "delivered", "retrying", "permanently_failed"]>;
|
|
156
156
|
attempt: z.ZodNumber;
|
|
157
157
|
responseCode: z.ZodNullable<z.ZodNumber>;
|
|
@@ -162,12 +162,12 @@ declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
162
162
|
createdAt: z.ZodString;
|
|
163
163
|
}, "strip", z.ZodTypeAny, {
|
|
164
164
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
165
|
-
id: string;
|
|
166
165
|
merchantId: string;
|
|
166
|
+
id: string;
|
|
167
167
|
createdAt: string;
|
|
168
168
|
endpointId: string;
|
|
169
169
|
eventId: string;
|
|
170
|
-
eventName: "payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked";
|
|
170
|
+
eventName: "payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked";
|
|
171
171
|
attempt: number;
|
|
172
172
|
responseCode: number | null;
|
|
173
173
|
responseMs: number | null;
|
|
@@ -176,12 +176,12 @@ declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
176
176
|
deliveredAt: string | null;
|
|
177
177
|
}, {
|
|
178
178
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
179
|
-
id: string;
|
|
180
179
|
merchantId: string;
|
|
180
|
+
id: string;
|
|
181
181
|
createdAt: string;
|
|
182
182
|
endpointId: string;
|
|
183
183
|
eventId: string;
|
|
184
|
-
eventName: "payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked";
|
|
184
|
+
eventName: "payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked";
|
|
185
185
|
attempt: number;
|
|
186
186
|
responseCode: number | null;
|
|
187
187
|
responseMs: number | null;
|
|
@@ -200,7 +200,7 @@ declare const webhookDeliveryDetailSchema: z.ZodObject<{
|
|
|
200
200
|
merchantId: z.ZodString;
|
|
201
201
|
endpointId: z.ZodString;
|
|
202
202
|
eventId: z.ZodString;
|
|
203
|
-
eventName: z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>;
|
|
203
|
+
eventName: z.ZodEnum<["payment.created", "payment.completed", "payment.failed", "subscription.created", "subscription.charged", "subscription.charge_failed", "subscription.recovery_attempt", "subscription.cancelled", "subscription.lapsed", "subscription.reactivated", "refund.created", "refund.completed", "refund.failed", "invoice.created", "invoice.paid", "invoice.overdue", "agent.job_proposed", "agent.job_completed", "agent.job_disputed", "compliance.wallet_flagged", "compliance.wallet_blocked"]>;
|
|
204
204
|
status: z.ZodEnum<["pending", "delivered", "retrying", "permanently_failed"]>;
|
|
205
205
|
attempt: z.ZodNumber;
|
|
206
206
|
responseCode: z.ZodNullable<z.ZodNumber>;
|
|
@@ -215,12 +215,12 @@ declare const webhookDeliveryDetailSchema: z.ZodObject<{
|
|
|
215
215
|
requestPayload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
216
216
|
}, "strip", z.ZodTypeAny, {
|
|
217
217
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
218
|
-
id: string;
|
|
219
218
|
merchantId: string;
|
|
219
|
+
id: string;
|
|
220
220
|
createdAt: string;
|
|
221
221
|
endpointId: string;
|
|
222
222
|
eventId: string;
|
|
223
|
-
eventName: "payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked";
|
|
223
|
+
eventName: "payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked";
|
|
224
224
|
attempt: number;
|
|
225
225
|
responseCode: number | null;
|
|
226
226
|
responseMs: number | null;
|
|
@@ -232,12 +232,12 @@ declare const webhookDeliveryDetailSchema: z.ZodObject<{
|
|
|
232
232
|
requestPayload: Record<string, unknown>;
|
|
233
233
|
}, {
|
|
234
234
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
235
|
-
id: string;
|
|
236
235
|
merchantId: string;
|
|
236
|
+
id: string;
|
|
237
237
|
createdAt: string;
|
|
238
238
|
endpointId: string;
|
|
239
239
|
eventId: string;
|
|
240
|
-
eventName: "payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked";
|
|
240
|
+
eventName: "payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.cancelled" | "subscription.lapsed" | "subscription.reactivated" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked";
|
|
241
241
|
attempt: number;
|
|
242
242
|
responseCode: number | null;
|
|
243
243
|
responseMs: number | null;
|