@strimz/shared-types 0.12.3 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/dist/analytics.cjs +26 -2
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.d.cts +136 -136
- package/dist/analytics.d.ts +136 -136
- package/dist/analytics.js +26 -2
- package/dist/analytics.js.map +1 -1
- package/dist/api-keys.d.cts +20 -20
- package/dist/api-keys.d.ts +20 -20
- package/dist/compliance.d.cts +4 -4
- package/dist/compliance.d.ts +4 -4
- package/dist/customers.d.cts +6 -6
- package/dist/customers.d.ts +6 -6
- package/dist/events.cjs +26 -2
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +1435 -1435
- package/dist/events.d.ts +1435 -1435
- package/dist/events.js +26 -2
- package/dist/events.js.map +1 -1
- package/dist/index.cjs +29 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +27 -3
- package/dist/index.js.map +1 -1
- package/dist/invoices.d.cts +10 -10
- package/dist/invoices.d.ts +10 -10
- package/dist/merchants.d.cts +20 -20
- package/dist/merchants.d.ts +20 -20
- package/dist/payment-sessions.cjs +29 -2
- package/dist/payment-sessions.cjs.map +1 -1
- package/dist/payment-sessions.d.cts +60 -19
- package/dist/payment-sessions.d.ts +60 -19
- package/dist/payment-sessions.js +27 -3
- package/dist/payment-sessions.js.map +1 -1
- package/dist/refunds.d.cts +36 -36
- package/dist/refunds.d.ts +36 -36
- package/dist/storefronts.d.cts +27 -27
- package/dist/storefronts.d.ts +27 -27
- package/dist/subscriptions.d.cts +30 -30
- package/dist/subscriptions.d.ts +30 -30
- package/dist/transactions.d.cts +12 -12
- package/dist/transactions.d.ts +12 -12
- package/dist/webhooks.d.cts +22 -22
- package/dist/webhooks.d.ts +22 -22
- package/package.json +2 -2
- package/src/payment-sessions.ts +30 -2
package/dist/subscriptions.d.ts
CHANGED
|
@@ -48,34 +48,34 @@ declare const subscriptionPlanSchema: z.ZodObject<{
|
|
|
48
48
|
updatedAt: z.ZodString;
|
|
49
49
|
}, "strip", z.ZodTypeAny, {
|
|
50
50
|
status: "active" | "archived";
|
|
51
|
-
amount: string;
|
|
52
|
-
currency: "USDC" | "EURC";
|
|
53
|
-
merchantId: string;
|
|
54
|
-
description: string | null;
|
|
55
51
|
id: string;
|
|
52
|
+
merchantId: string;
|
|
53
|
+
name: string;
|
|
56
54
|
createdAt: string;
|
|
55
|
+
description: string | null;
|
|
56
|
+
currency: "USDC" | "EURC";
|
|
57
57
|
updatedAt: string;
|
|
58
58
|
chainMerchantId: string | null;
|
|
59
59
|
tokenAddress: string | null;
|
|
60
|
+
amount: string;
|
|
60
61
|
metadata: Record<string, string | number | boolean | null>;
|
|
61
62
|
intervalSeconds: number;
|
|
62
|
-
name: string;
|
|
63
63
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
64
64
|
intervalCount: number;
|
|
65
65
|
trialPeriodDays: number | null;
|
|
66
66
|
}, {
|
|
67
67
|
status: "active" | "archived";
|
|
68
|
-
amount: string;
|
|
69
|
-
currency: "USDC" | "EURC";
|
|
70
|
-
merchantId: string;
|
|
71
|
-
description: string | null;
|
|
72
68
|
id: string;
|
|
69
|
+
merchantId: string;
|
|
70
|
+
name: string;
|
|
73
71
|
createdAt: string;
|
|
72
|
+
description: string | null;
|
|
73
|
+
currency: "USDC" | "EURC";
|
|
74
74
|
updatedAt: string;
|
|
75
75
|
chainMerchantId: string | null;
|
|
76
76
|
tokenAddress: string | null;
|
|
77
|
+
amount: string;
|
|
77
78
|
intervalSeconds: number;
|
|
78
|
-
name: string;
|
|
79
79
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
80
80
|
intervalCount: number;
|
|
81
81
|
trialPeriodDays: number | null;
|
|
@@ -92,18 +92,18 @@ declare const createSubscriptionPlanInputSchema: z.ZodObject<{
|
|
|
92
92
|
trialPeriodDays: z.ZodOptional<z.ZodNumber>;
|
|
93
93
|
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>>>>;
|
|
94
94
|
}, "strip", z.ZodTypeAny, {
|
|
95
|
-
amount: string;
|
|
96
|
-
currency: "USDC" | "EURC";
|
|
97
95
|
name: string;
|
|
96
|
+
currency: "USDC" | "EURC";
|
|
97
|
+
amount: string;
|
|
98
98
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
99
99
|
intervalCount: number;
|
|
100
100
|
description?: string | undefined;
|
|
101
101
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
102
102
|
trialPeriodDays?: number | undefined;
|
|
103
103
|
}, {
|
|
104
|
-
amount: string;
|
|
105
|
-
currency: "USDC" | "EURC";
|
|
106
104
|
name: string;
|
|
105
|
+
currency: "USDC" | "EURC";
|
|
106
|
+
amount: string;
|
|
107
107
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
108
108
|
description?: string | undefined;
|
|
109
109
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
@@ -136,14 +136,14 @@ declare const subscriptionSchema: z.ZodObject<{
|
|
|
136
136
|
createdAt: z.ZodString;
|
|
137
137
|
updatedAt: z.ZodString;
|
|
138
138
|
}, "strip", z.ZodTypeAny, {
|
|
139
|
-
status: "cancelled" | "
|
|
140
|
-
amount: string;
|
|
141
|
-
currency: "USDC" | "EURC";
|
|
142
|
-
customerId: string;
|
|
143
|
-
merchantId: string;
|
|
139
|
+
status: "cancelled" | "active" | "trialing" | "at_risk" | "paused" | "lapsed";
|
|
144
140
|
id: string;
|
|
141
|
+
merchantId: string;
|
|
145
142
|
createdAt: string;
|
|
143
|
+
currency: "USDC" | "EURC";
|
|
146
144
|
updatedAt: string;
|
|
145
|
+
customerId: string;
|
|
146
|
+
amount: string;
|
|
147
147
|
metadata: Record<string, string | number | boolean | null>;
|
|
148
148
|
payerAddress: string;
|
|
149
149
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
@@ -157,14 +157,14 @@ declare const subscriptionSchema: z.ZodObject<{
|
|
|
157
157
|
gracePeriodHours: number;
|
|
158
158
|
cancelledAt: string | null;
|
|
159
159
|
}, {
|
|
160
|
-
status: "cancelled" | "
|
|
161
|
-
amount: string;
|
|
162
|
-
currency: "USDC" | "EURC";
|
|
163
|
-
customerId: string;
|
|
164
|
-
merchantId: string;
|
|
160
|
+
status: "cancelled" | "active" | "trialing" | "at_risk" | "paused" | "lapsed";
|
|
165
161
|
id: string;
|
|
162
|
+
merchantId: string;
|
|
166
163
|
createdAt: string;
|
|
164
|
+
currency: "USDC" | "EURC";
|
|
167
165
|
updatedAt: string;
|
|
166
|
+
customerId: string;
|
|
167
|
+
amount: string;
|
|
168
168
|
payerAddress: string;
|
|
169
169
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
170
170
|
intervalCount: number;
|
|
@@ -241,12 +241,12 @@ declare const subscriptionChargeSchema: z.ZodObject<{
|
|
|
241
241
|
updatedAt: z.ZodString;
|
|
242
242
|
}, "strip", z.ZodTypeAny, {
|
|
243
243
|
status: "failed" | "pending" | "in_flight" | "succeeded" | "retrying" | "abandoned";
|
|
244
|
-
amount: string;
|
|
245
|
-
currency: "USDC" | "EURC";
|
|
246
|
-
merchantId: string;
|
|
247
244
|
id: string;
|
|
245
|
+
merchantId: string;
|
|
248
246
|
createdAt: string;
|
|
247
|
+
currency: "USDC" | "EURC";
|
|
249
248
|
updatedAt: string;
|
|
249
|
+
amount: string;
|
|
250
250
|
onchainTxHash: string | null;
|
|
251
251
|
failureReason: string | null;
|
|
252
252
|
subscriptionId: string;
|
|
@@ -259,12 +259,12 @@ declare const subscriptionChargeSchema: z.ZodObject<{
|
|
|
259
259
|
executedAt: string | null;
|
|
260
260
|
}, {
|
|
261
261
|
status: "failed" | "pending" | "in_flight" | "succeeded" | "retrying" | "abandoned";
|
|
262
|
-
amount: string;
|
|
263
|
-
currency: "USDC" | "EURC";
|
|
264
|
-
merchantId: string;
|
|
265
262
|
id: string;
|
|
263
|
+
merchantId: string;
|
|
266
264
|
createdAt: string;
|
|
265
|
+
currency: "USDC" | "EURC";
|
|
267
266
|
updatedAt: string;
|
|
267
|
+
amount: string;
|
|
268
268
|
onchainTxHash: string | null;
|
|
269
269
|
failureReason: string | null;
|
|
270
270
|
subscriptionId: string;
|
package/dist/transactions.d.cts
CHANGED
|
@@ -34,19 +34,19 @@ declare const transactionSchema: z.ZodObject<{
|
|
|
34
34
|
createdAt: z.ZodString;
|
|
35
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
36
|
status: "confirmed" | "failed" | "pending";
|
|
37
|
-
amount: string;
|
|
38
|
-
currency: "USDC" | "EURC";
|
|
39
|
-
customerId: string | null;
|
|
40
|
-
merchantId: string;
|
|
41
37
|
id: string;
|
|
42
|
-
|
|
38
|
+
merchantId: string;
|
|
39
|
+
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
43
40
|
createdAt: string;
|
|
41
|
+
currency: "USDC" | "EURC";
|
|
42
|
+
sessionId: string | null;
|
|
43
|
+
customerId: string | null;
|
|
44
|
+
amount: string;
|
|
44
45
|
feeAmount: string;
|
|
45
46
|
netAmount: string;
|
|
46
47
|
onchainTxHash: string;
|
|
47
48
|
payerAddress: string;
|
|
48
49
|
subscriptionId: string | null;
|
|
49
|
-
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
50
50
|
subscriptionChargeId: string | null;
|
|
51
51
|
refundId: string | null;
|
|
52
52
|
merchantAddress: string;
|
|
@@ -54,19 +54,19 @@ declare const transactionSchema: z.ZodObject<{
|
|
|
54
54
|
blockTimestamp: string;
|
|
55
55
|
}, {
|
|
56
56
|
status: "confirmed" | "failed" | "pending";
|
|
57
|
-
amount: string;
|
|
58
|
-
currency: "USDC" | "EURC";
|
|
59
|
-
customerId: string | null;
|
|
60
|
-
merchantId: string;
|
|
61
57
|
id: string;
|
|
62
|
-
|
|
58
|
+
merchantId: string;
|
|
59
|
+
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
63
60
|
createdAt: string;
|
|
61
|
+
currency: "USDC" | "EURC";
|
|
62
|
+
sessionId: string | null;
|
|
63
|
+
customerId: string | null;
|
|
64
|
+
amount: string;
|
|
64
65
|
feeAmount: string;
|
|
65
66
|
netAmount: string;
|
|
66
67
|
onchainTxHash: string;
|
|
67
68
|
payerAddress: string;
|
|
68
69
|
subscriptionId: string | null;
|
|
69
|
-
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
70
70
|
subscriptionChargeId: string | null;
|
|
71
71
|
refundId: string | null;
|
|
72
72
|
merchantAddress: string;
|
package/dist/transactions.d.ts
CHANGED
|
@@ -34,19 +34,19 @@ declare const transactionSchema: z.ZodObject<{
|
|
|
34
34
|
createdAt: z.ZodString;
|
|
35
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
36
|
status: "confirmed" | "failed" | "pending";
|
|
37
|
-
amount: string;
|
|
38
|
-
currency: "USDC" | "EURC";
|
|
39
|
-
customerId: string | null;
|
|
40
|
-
merchantId: string;
|
|
41
37
|
id: string;
|
|
42
|
-
|
|
38
|
+
merchantId: string;
|
|
39
|
+
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
43
40
|
createdAt: string;
|
|
41
|
+
currency: "USDC" | "EURC";
|
|
42
|
+
sessionId: string | null;
|
|
43
|
+
customerId: string | null;
|
|
44
|
+
amount: string;
|
|
44
45
|
feeAmount: string;
|
|
45
46
|
netAmount: string;
|
|
46
47
|
onchainTxHash: string;
|
|
47
48
|
payerAddress: string;
|
|
48
49
|
subscriptionId: string | null;
|
|
49
|
-
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
50
50
|
subscriptionChargeId: string | null;
|
|
51
51
|
refundId: string | null;
|
|
52
52
|
merchantAddress: string;
|
|
@@ -54,19 +54,19 @@ declare const transactionSchema: z.ZodObject<{
|
|
|
54
54
|
blockTimestamp: string;
|
|
55
55
|
}, {
|
|
56
56
|
status: "confirmed" | "failed" | "pending";
|
|
57
|
-
amount: string;
|
|
58
|
-
currency: "USDC" | "EURC";
|
|
59
|
-
customerId: string | null;
|
|
60
|
-
merchantId: string;
|
|
61
57
|
id: string;
|
|
62
|
-
|
|
58
|
+
merchantId: string;
|
|
59
|
+
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
63
60
|
createdAt: string;
|
|
61
|
+
currency: "USDC" | "EURC";
|
|
62
|
+
sessionId: string | null;
|
|
63
|
+
customerId: string | null;
|
|
64
|
+
amount: string;
|
|
64
65
|
feeAmount: string;
|
|
65
66
|
netAmount: string;
|
|
66
67
|
onchainTxHash: string;
|
|
67
68
|
payerAddress: string;
|
|
68
69
|
subscriptionId: string | null;
|
|
69
|
-
kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
|
|
70
70
|
subscriptionChargeId: string | null;
|
|
71
71
|
refundId: string | null;
|
|
72
72
|
merchantAddress: string;
|
package/dist/webhooks.d.cts
CHANGED
|
@@ -30,11 +30,11 @@ declare const webhookEndpointSchema: z.ZodObject<{
|
|
|
30
30
|
updatedAt: z.ZodString;
|
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
32
|
status: "active" | "disabled";
|
|
33
|
-
mode: "test" | "live";
|
|
34
|
-
merchantId: string;
|
|
35
|
-
description: string | null;
|
|
36
33
|
id: string;
|
|
34
|
+
merchantId: string;
|
|
35
|
+
mode: "test" | "live";
|
|
37
36
|
createdAt: string;
|
|
37
|
+
description: string | null;
|
|
38
38
|
updatedAt: string;
|
|
39
39
|
url: string;
|
|
40
40
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -42,11 +42,11 @@ declare const webhookEndpointSchema: z.ZodObject<{
|
|
|
42
42
|
lastDeliveredAt: string | null;
|
|
43
43
|
}, {
|
|
44
44
|
status: "active" | "disabled";
|
|
45
|
-
mode: "test" | "live";
|
|
46
|
-
merchantId: string;
|
|
47
|
-
description: string | null;
|
|
48
45
|
id: string;
|
|
46
|
+
merchantId: string;
|
|
47
|
+
mode: "test" | "live";
|
|
49
48
|
createdAt: string;
|
|
49
|
+
description: string | null;
|
|
50
50
|
updatedAt: string;
|
|
51
51
|
url: string;
|
|
52
52
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -87,11 +87,11 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
87
87
|
updatedAt: z.ZodString;
|
|
88
88
|
}, "strip", z.ZodTypeAny, {
|
|
89
89
|
status: "active" | "disabled";
|
|
90
|
-
mode: "test" | "live";
|
|
91
|
-
merchantId: string;
|
|
92
|
-
description: string | null;
|
|
93
90
|
id: string;
|
|
91
|
+
merchantId: string;
|
|
92
|
+
mode: "test" | "live";
|
|
94
93
|
createdAt: string;
|
|
94
|
+
description: string | null;
|
|
95
95
|
updatedAt: string;
|
|
96
96
|
url: string;
|
|
97
97
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -99,11 +99,11 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
99
99
|
lastDeliveredAt: string | null;
|
|
100
100
|
}, {
|
|
101
101
|
status: "active" | "disabled";
|
|
102
|
-
mode: "test" | "live";
|
|
103
|
-
merchantId: string;
|
|
104
|
-
description: string | null;
|
|
105
102
|
id: string;
|
|
103
|
+
merchantId: string;
|
|
104
|
+
mode: "test" | "live";
|
|
106
105
|
createdAt: string;
|
|
106
|
+
description: string | null;
|
|
107
107
|
updatedAt: string;
|
|
108
108
|
url: string;
|
|
109
109
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -115,11 +115,11 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
115
115
|
}, "strip", z.ZodTypeAny, {
|
|
116
116
|
endpoint: {
|
|
117
117
|
status: "active" | "disabled";
|
|
118
|
-
mode: "test" | "live";
|
|
119
|
-
merchantId: string;
|
|
120
|
-
description: string | null;
|
|
121
118
|
id: string;
|
|
119
|
+
merchantId: string;
|
|
120
|
+
mode: "test" | "live";
|
|
122
121
|
createdAt: string;
|
|
122
|
+
description: string | null;
|
|
123
123
|
updatedAt: string;
|
|
124
124
|
url: string;
|
|
125
125
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -130,11 +130,11 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
130
130
|
}, {
|
|
131
131
|
endpoint: {
|
|
132
132
|
status: "active" | "disabled";
|
|
133
|
-
mode: "test" | "live";
|
|
134
|
-
merchantId: string;
|
|
135
|
-
description: string | null;
|
|
136
133
|
id: string;
|
|
134
|
+
merchantId: string;
|
|
135
|
+
mode: "test" | "live";
|
|
137
136
|
createdAt: string;
|
|
137
|
+
description: string | null;
|
|
138
138
|
updatedAt: string;
|
|
139
139
|
url: string;
|
|
140
140
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -162,8 +162,8 @@ declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
162
162
|
createdAt: z.ZodString;
|
|
163
163
|
}, "strip", z.ZodTypeAny, {
|
|
164
164
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
165
|
-
merchantId: string;
|
|
166
165
|
id: string;
|
|
166
|
+
merchantId: string;
|
|
167
167
|
createdAt: string;
|
|
168
168
|
endpointId: string;
|
|
169
169
|
eventId: string;
|
|
@@ -176,8 +176,8 @@ declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
176
176
|
deliveredAt: string | null;
|
|
177
177
|
}, {
|
|
178
178
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
179
|
-
merchantId: string;
|
|
180
179
|
id: string;
|
|
180
|
+
merchantId: string;
|
|
181
181
|
createdAt: string;
|
|
182
182
|
endpointId: string;
|
|
183
183
|
eventId: string;
|
|
@@ -215,8 +215,8 @@ 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
|
-
merchantId: string;
|
|
219
218
|
id: string;
|
|
219
|
+
merchantId: string;
|
|
220
220
|
createdAt: string;
|
|
221
221
|
endpointId: string;
|
|
222
222
|
eventId: string;
|
|
@@ -232,8 +232,8 @@ declare const webhookDeliveryDetailSchema: z.ZodObject<{
|
|
|
232
232
|
requestPayload: Record<string, unknown>;
|
|
233
233
|
}, {
|
|
234
234
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
235
|
-
merchantId: string;
|
|
236
235
|
id: string;
|
|
236
|
+
merchantId: string;
|
|
237
237
|
createdAt: string;
|
|
238
238
|
endpointId: string;
|
|
239
239
|
eventId: string;
|
package/dist/webhooks.d.ts
CHANGED
|
@@ -30,11 +30,11 @@ declare const webhookEndpointSchema: z.ZodObject<{
|
|
|
30
30
|
updatedAt: z.ZodString;
|
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
32
|
status: "active" | "disabled";
|
|
33
|
-
mode: "test" | "live";
|
|
34
|
-
merchantId: string;
|
|
35
|
-
description: string | null;
|
|
36
33
|
id: string;
|
|
34
|
+
merchantId: string;
|
|
35
|
+
mode: "test" | "live";
|
|
37
36
|
createdAt: string;
|
|
37
|
+
description: string | null;
|
|
38
38
|
updatedAt: string;
|
|
39
39
|
url: string;
|
|
40
40
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -42,11 +42,11 @@ declare const webhookEndpointSchema: z.ZodObject<{
|
|
|
42
42
|
lastDeliveredAt: string | null;
|
|
43
43
|
}, {
|
|
44
44
|
status: "active" | "disabled";
|
|
45
|
-
mode: "test" | "live";
|
|
46
|
-
merchantId: string;
|
|
47
|
-
description: string | null;
|
|
48
45
|
id: string;
|
|
46
|
+
merchantId: string;
|
|
47
|
+
mode: "test" | "live";
|
|
49
48
|
createdAt: string;
|
|
49
|
+
description: string | null;
|
|
50
50
|
updatedAt: string;
|
|
51
51
|
url: string;
|
|
52
52
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -87,11 +87,11 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
87
87
|
updatedAt: z.ZodString;
|
|
88
88
|
}, "strip", z.ZodTypeAny, {
|
|
89
89
|
status: "active" | "disabled";
|
|
90
|
-
mode: "test" | "live";
|
|
91
|
-
merchantId: string;
|
|
92
|
-
description: string | null;
|
|
93
90
|
id: string;
|
|
91
|
+
merchantId: string;
|
|
92
|
+
mode: "test" | "live";
|
|
94
93
|
createdAt: string;
|
|
94
|
+
description: string | null;
|
|
95
95
|
updatedAt: string;
|
|
96
96
|
url: string;
|
|
97
97
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -99,11 +99,11 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
99
99
|
lastDeliveredAt: string | null;
|
|
100
100
|
}, {
|
|
101
101
|
status: "active" | "disabled";
|
|
102
|
-
mode: "test" | "live";
|
|
103
|
-
merchantId: string;
|
|
104
|
-
description: string | null;
|
|
105
102
|
id: string;
|
|
103
|
+
merchantId: string;
|
|
104
|
+
mode: "test" | "live";
|
|
106
105
|
createdAt: string;
|
|
106
|
+
description: string | null;
|
|
107
107
|
updatedAt: string;
|
|
108
108
|
url: string;
|
|
109
109
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -115,11 +115,11 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
115
115
|
}, "strip", z.ZodTypeAny, {
|
|
116
116
|
endpoint: {
|
|
117
117
|
status: "active" | "disabled";
|
|
118
|
-
mode: "test" | "live";
|
|
119
|
-
merchantId: string;
|
|
120
|
-
description: string | null;
|
|
121
118
|
id: string;
|
|
119
|
+
merchantId: string;
|
|
120
|
+
mode: "test" | "live";
|
|
122
121
|
createdAt: string;
|
|
122
|
+
description: string | null;
|
|
123
123
|
updatedAt: string;
|
|
124
124
|
url: string;
|
|
125
125
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -130,11 +130,11 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
|
|
|
130
130
|
}, {
|
|
131
131
|
endpoint: {
|
|
132
132
|
status: "active" | "disabled";
|
|
133
|
-
mode: "test" | "live";
|
|
134
|
-
merchantId: string;
|
|
135
|
-
description: string | null;
|
|
136
133
|
id: string;
|
|
134
|
+
merchantId: string;
|
|
135
|
+
mode: "test" | "live";
|
|
137
136
|
createdAt: string;
|
|
137
|
+
description: string | null;
|
|
138
138
|
updatedAt: string;
|
|
139
139
|
url: string;
|
|
140
140
|
events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "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.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
|
|
@@ -162,8 +162,8 @@ declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
162
162
|
createdAt: z.ZodString;
|
|
163
163
|
}, "strip", z.ZodTypeAny, {
|
|
164
164
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
165
|
-
merchantId: string;
|
|
166
165
|
id: string;
|
|
166
|
+
merchantId: string;
|
|
167
167
|
createdAt: string;
|
|
168
168
|
endpointId: string;
|
|
169
169
|
eventId: string;
|
|
@@ -176,8 +176,8 @@ declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
176
176
|
deliveredAt: string | null;
|
|
177
177
|
}, {
|
|
178
178
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
179
|
-
merchantId: string;
|
|
180
179
|
id: string;
|
|
180
|
+
merchantId: string;
|
|
181
181
|
createdAt: string;
|
|
182
182
|
endpointId: string;
|
|
183
183
|
eventId: string;
|
|
@@ -215,8 +215,8 @@ 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
|
-
merchantId: string;
|
|
219
218
|
id: string;
|
|
219
|
+
merchantId: string;
|
|
220
220
|
createdAt: string;
|
|
221
221
|
endpointId: string;
|
|
222
222
|
eventId: string;
|
|
@@ -232,8 +232,8 @@ declare const webhookDeliveryDetailSchema: z.ZodObject<{
|
|
|
232
232
|
requestPayload: Record<string, unknown>;
|
|
233
233
|
}, {
|
|
234
234
|
status: "pending" | "retrying" | "delivered" | "permanently_failed";
|
|
235
|
-
merchantId: string;
|
|
236
235
|
id: string;
|
|
236
|
+
merchantId: string;
|
|
237
237
|
createdAt: string;
|
|
238
238
|
endpointId: string;
|
|
239
239
|
eventId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strimz/shared-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Zod schemas and inferred TypeScript types for every Strimz platform entity, API input, and webhook event.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Strimz <hello@strimz.finance>",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
],
|
|
119
119
|
"dependencies": {
|
|
120
120
|
"zod": "^3.24.1",
|
|
121
|
-
"@strimz/shared-config": "0.7.
|
|
121
|
+
"@strimz/shared-config": "0.7.1"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"eslint": "^9.18.0",
|
package/src/payment-sessions.ts
CHANGED
|
@@ -113,8 +113,8 @@ export const createPaymentSessionInputSchema = z.object({
|
|
|
113
113
|
externalRef: z.string().max(120).optional(),
|
|
114
114
|
})
|
|
115
115
|
.optional(),
|
|
116
|
-
successUrl:
|
|
117
|
-
cancelUrl:
|
|
116
|
+
successUrl: callbackUrlSchema.optional(),
|
|
117
|
+
cancelUrl: callbackUrlSchema.optional(),
|
|
118
118
|
/** Minutes until the session expires. Default 30, max 60*24 (one day). */
|
|
119
119
|
expiresInMinutes: z
|
|
120
120
|
.number()
|
|
@@ -153,3 +153,31 @@ export const submitPaymentSessionInputSchema = z.object({
|
|
|
153
153
|
})
|
|
154
154
|
export type SubmitPaymentSessionInput = z.input<typeof submitPaymentSessionInputSchema>
|
|
155
155
|
export type SubmitPaymentSessionParsed = z.output<typeof submitPaymentSessionInputSchema>
|
|
156
|
+
|
|
157
|
+
export const checkoutResultErrorCodes = [
|
|
158
|
+
'load_failed',
|
|
159
|
+
'merchant_not_ready',
|
|
160
|
+
'payment_reverted',
|
|
161
|
+
'unsupported_wallet',
|
|
162
|
+
] as const
|
|
163
|
+
export const checkoutResultErrorCodeSchema = z.enum(checkoutResultErrorCodes)
|
|
164
|
+
export type CheckoutResultErrorCode = z.infer<typeof checkoutResultErrorCodeSchema>
|
|
165
|
+
|
|
166
|
+
export const checkoutResultMessageSchema = z.discriminatedUnion('type', [
|
|
167
|
+
z.object({
|
|
168
|
+
type: z.literal('strimz:checkout:success'),
|
|
169
|
+
sessionId: idSchema,
|
|
170
|
+
txHash: evmTxHashSchema,
|
|
171
|
+
}),
|
|
172
|
+
z.object({
|
|
173
|
+
type: z.literal('strimz:checkout:cancel'),
|
|
174
|
+
sessionId: idSchema,
|
|
175
|
+
}),
|
|
176
|
+
z.object({
|
|
177
|
+
type: z.literal('strimz:checkout:error'),
|
|
178
|
+
sessionId: idSchema,
|
|
179
|
+
code: checkoutResultErrorCodeSchema,
|
|
180
|
+
message: z.string().min(1).max(500),
|
|
181
|
+
}),
|
|
182
|
+
])
|
|
183
|
+
export type CheckoutResultMessage = z.infer<typeof checkoutResultMessageSchema>
|