@venturekit/billing 0.0.0-dev.20260825184900
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 +218 -0
- package/dist/client.d.ts +109 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +139 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +102 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +133 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +170 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +47 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/provider.d.ts +178 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +93 -0
- package/dist/provider.js.map +1 -0
- package/dist/providers/index.d.ts +15 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +15 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/mock.d.ts +79 -0
- package/dist/providers/mock.d.ts.map +1 -0
- package/dist/providers/mock.js +536 -0
- package/dist/providers/mock.js.map +1 -0
- package/dist/providers/zazu/adapter.d.ts +39 -0
- package/dist/providers/zazu/adapter.d.ts.map +1 -0
- package/dist/providers/zazu/adapter.js +233 -0
- package/dist/providers/zazu/adapter.js.map +1 -0
- package/dist/providers/zazu/client.d.ts +76 -0
- package/dist/providers/zazu/client.d.ts.map +1 -0
- package/dist/providers/zazu/client.js +163 -0
- package/dist/providers/zazu/client.js.map +1 -0
- package/dist/providers/zazu/config.d.ts +54 -0
- package/dist/providers/zazu/config.d.ts.map +1 -0
- package/dist/providers/zazu/config.js +55 -0
- package/dist/providers/zazu/config.js.map +1 -0
- package/dist/providers/zazu/correlation.d.ts +65 -0
- package/dist/providers/zazu/correlation.d.ts.map +1 -0
- package/dist/providers/zazu/correlation.js +178 -0
- package/dist/providers/zazu/correlation.js.map +1 -0
- package/dist/providers/zazu/index.d.ts +18 -0
- package/dist/providers/zazu/index.d.ts.map +1 -0
- package/dist/providers/zazu/index.js +21 -0
- package/dist/providers/zazu/index.js.map +1 -0
- package/dist/providers/zazu/maps.d.ts +36 -0
- package/dist/providers/zazu/maps.d.ts.map +1 -0
- package/dist/providers/zazu/maps.js +450 -0
- package/dist/providers/zazu/maps.js.map +1 -0
- package/dist/providers/zazu/types.d.ts +365 -0
- package/dist/providers/zazu/types.d.ts.map +1 -0
- package/dist/providers/zazu/types.js +13 -0
- package/dist/providers/zazu/types.js.map +1 -0
- package/dist/providers/zazu/webhooks.d.ts +73 -0
- package/dist/providers/zazu/webhooks.d.ts.map +1 -0
- package/dist/providers/zazu/webhooks.js +259 -0
- package/dist/providers/zazu/webhooks.js.map +1 -0
- package/dist/types.d.ts +512 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/billing — Zazu raw API types
|
|
3
|
+
*
|
|
4
|
+
* These interfaces mirror the wire format of the Zazu REST API exactly
|
|
5
|
+
* (see https://staging.zazu.ma/docs). They are intentionally separate
|
|
6
|
+
* from the domain types in `../../types.ts`: the `maps.ts` module is the
|
|
7
|
+
* only place that converts between the two, so a change in the Zazu API
|
|
8
|
+
* never leaks into the rest of the application.
|
|
9
|
+
*
|
|
10
|
+
* Amounts are decimal strings (`"1500.000"`); timestamps are ISO 8601.
|
|
11
|
+
*/
|
|
12
|
+
/** Compact account projection embedded in payment links and transactions. */
|
|
13
|
+
export interface ZazuAccountProjection {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
currency_code: string;
|
|
17
|
+
rib?: string;
|
|
18
|
+
}
|
|
19
|
+
export type ZazuAccountStatus = 'open' | 'closed' | 'frozen';
|
|
20
|
+
/** Full account object from `GET /api/accounts`. */
|
|
21
|
+
export interface ZazuAccount {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
status: ZazuAccountStatus;
|
|
25
|
+
currency_code: string;
|
|
26
|
+
balance?: string;
|
|
27
|
+
rib?: string;
|
|
28
|
+
created_at: string;
|
|
29
|
+
updated_at: string;
|
|
30
|
+
}
|
|
31
|
+
/** Ledger entry from `GET /api/accounts/:account_id/transactions`. */
|
|
32
|
+
export interface ZazuAccountTransaction {
|
|
33
|
+
id: string;
|
|
34
|
+
account_id: string;
|
|
35
|
+
operation: 'credit' | 'debit';
|
|
36
|
+
amount: string;
|
|
37
|
+
currency_code: string;
|
|
38
|
+
account_balance_after?: string;
|
|
39
|
+
internal_transfer?: boolean;
|
|
40
|
+
other_name?: string | null;
|
|
41
|
+
source_type?: string;
|
|
42
|
+
source_id?: string;
|
|
43
|
+
transaction_type?: string;
|
|
44
|
+
reference?: string | null;
|
|
45
|
+
transfer_id?: string | null;
|
|
46
|
+
posted_at?: string;
|
|
47
|
+
value_date?: string;
|
|
48
|
+
created_at: string;
|
|
49
|
+
updated_at: string;
|
|
50
|
+
account?: ZazuAccountProjection;
|
|
51
|
+
}
|
|
52
|
+
export type ZazuCheckoutSessionStatus = 'open' | 'processing' | 'complete' | 'expired';
|
|
53
|
+
export interface ZazuCheckoutTransaction {
|
|
54
|
+
id: string;
|
|
55
|
+
status: string;
|
|
56
|
+
amount: string;
|
|
57
|
+
fee_amount?: string;
|
|
58
|
+
net_amount?: string;
|
|
59
|
+
currency_code: string;
|
|
60
|
+
payment_reference?: string | null;
|
|
61
|
+
provider_reference?: string;
|
|
62
|
+
card_brand?: string;
|
|
63
|
+
card_last_four?: string;
|
|
64
|
+
account_transaction_id?: string;
|
|
65
|
+
processed_at?: string;
|
|
66
|
+
created_at: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A checkout session as returned by the REST API **or** as projected into
|
|
70
|
+
* a `checkout_session.completed` webhook. The webhook payload is a subset
|
|
71
|
+
* — it omits `success_url`, `cancel_url`, `url`, and `expires_at`, which
|
|
72
|
+
* are meaningless once the session is complete — so those are optional
|
|
73
|
+
* here even though a `GET /api/checkout_sessions/:id` always returns them.
|
|
74
|
+
* See https://staging.zazu.ma/docs/webhooks.
|
|
75
|
+
*/
|
|
76
|
+
export interface ZazuCheckoutSession {
|
|
77
|
+
id: string;
|
|
78
|
+
status: ZazuCheckoutSessionStatus;
|
|
79
|
+
amount: string;
|
|
80
|
+
currency_code: string;
|
|
81
|
+
/** Absent on webhook payloads. */
|
|
82
|
+
success_url?: string;
|
|
83
|
+
cancel_url?: string;
|
|
84
|
+
customer_email?: string;
|
|
85
|
+
metadata?: Record<string, string>;
|
|
86
|
+
description?: string;
|
|
87
|
+
/** Absent on webhook payloads. */
|
|
88
|
+
url?: string;
|
|
89
|
+
/** Absent on webhook payloads. */
|
|
90
|
+
expires_at?: string;
|
|
91
|
+
completed_at?: string | null;
|
|
92
|
+
transaction?: ZazuCheckoutTransaction | null;
|
|
93
|
+
created_at: string;
|
|
94
|
+
}
|
|
95
|
+
export interface ZazuCreateCheckoutSessionBody {
|
|
96
|
+
account_id: string;
|
|
97
|
+
amount: string;
|
|
98
|
+
success_url: string;
|
|
99
|
+
cancel_url?: string;
|
|
100
|
+
customer_email?: string;
|
|
101
|
+
metadata?: Record<string, string>;
|
|
102
|
+
description?: string;
|
|
103
|
+
expires_at?: string;
|
|
104
|
+
}
|
|
105
|
+
export type ZazuPaymentLinkType = 'single' | 'multi';
|
|
106
|
+
export type ZazuPaymentLinkStatus = 'active' | 'paid' | 'expired' | 'cancelled';
|
|
107
|
+
/**
|
|
108
|
+
* A payment link as returned by the REST API **or** as projected into a
|
|
109
|
+
* `payment_link.paid` webhook. The webhook payload omits `url`,
|
|
110
|
+
* `account`, and `updated_at`, and adds `title`, so those differ in
|
|
111
|
+
* optionality from the REST resource.
|
|
112
|
+
* See https://staging.zazu.ma/docs/webhooks.
|
|
113
|
+
*/
|
|
114
|
+
export interface ZazuPaymentLink {
|
|
115
|
+
id: string;
|
|
116
|
+
slug: string;
|
|
117
|
+
status: ZazuPaymentLinkStatus;
|
|
118
|
+
link_type: ZazuPaymentLinkType;
|
|
119
|
+
amount: string;
|
|
120
|
+
currency_code: string;
|
|
121
|
+
/** Only present on webhook payloads. */
|
|
122
|
+
title?: string;
|
|
123
|
+
description?: string;
|
|
124
|
+
payment_reference?: string;
|
|
125
|
+
payments_count: number;
|
|
126
|
+
max_payments?: number | null;
|
|
127
|
+
expires_at?: string | null;
|
|
128
|
+
paid_at?: string | null;
|
|
129
|
+
redirect_url?: string;
|
|
130
|
+
/** Absent on webhook payloads. */
|
|
131
|
+
url?: string;
|
|
132
|
+
invoice_id?: string | null;
|
|
133
|
+
/** Absent on webhook payloads. */
|
|
134
|
+
account?: ZazuAccountProjection;
|
|
135
|
+
client_reference_id?: string;
|
|
136
|
+
customer_email?: string;
|
|
137
|
+
customer_id?: string;
|
|
138
|
+
customer_name?: string;
|
|
139
|
+
created_at: string;
|
|
140
|
+
/** Absent on webhook payloads. */
|
|
141
|
+
updated_at?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface ZazuCreatePaymentLinkBody {
|
|
144
|
+
account_id: string;
|
|
145
|
+
amount: string;
|
|
146
|
+
description?: string;
|
|
147
|
+
payment_reference?: string;
|
|
148
|
+
link_type?: ZazuPaymentLinkType;
|
|
149
|
+
redirect_url?: string;
|
|
150
|
+
expires_at?: string;
|
|
151
|
+
max_payments?: number;
|
|
152
|
+
}
|
|
153
|
+
export interface ZazuBillingAddress {
|
|
154
|
+
street: string;
|
|
155
|
+
street2?: string;
|
|
156
|
+
city: string;
|
|
157
|
+
postal_code: string;
|
|
158
|
+
country: string;
|
|
159
|
+
country_code: string;
|
|
160
|
+
}
|
|
161
|
+
export interface ZazuCustomer {
|
|
162
|
+
id: string;
|
|
163
|
+
customer_type: 'individual' | 'business';
|
|
164
|
+
person_name?: string;
|
|
165
|
+
company_name?: string;
|
|
166
|
+
name: string;
|
|
167
|
+
email: string;
|
|
168
|
+
phone?: string;
|
|
169
|
+
tax_id?: string;
|
|
170
|
+
ice_number?: string;
|
|
171
|
+
billing_address?: ZazuBillingAddress;
|
|
172
|
+
invoices_count?: number;
|
|
173
|
+
created_at: string;
|
|
174
|
+
updated_at: string;
|
|
175
|
+
}
|
|
176
|
+
export interface ZazuInvoiceItem {
|
|
177
|
+
id?: string;
|
|
178
|
+
description: string;
|
|
179
|
+
quantity: number;
|
|
180
|
+
unit_price: string;
|
|
181
|
+
tax_rate?: string;
|
|
182
|
+
amount: string;
|
|
183
|
+
position?: number;
|
|
184
|
+
}
|
|
185
|
+
export interface ZazuInvoiceDiscount {
|
|
186
|
+
id?: string;
|
|
187
|
+
description?: string;
|
|
188
|
+
discount_type: 'percentage' | 'fixed';
|
|
189
|
+
value: string;
|
|
190
|
+
amount: string;
|
|
191
|
+
position?: number;
|
|
192
|
+
}
|
|
193
|
+
export type ZazuInvoiceStatus = 'draft' | 'pending_approval' | 'approved' | 'sent' | 'paid' | 'overdue' | 'cancelled';
|
|
194
|
+
export interface ZazuInvoice {
|
|
195
|
+
id: string;
|
|
196
|
+
number: string;
|
|
197
|
+
status: ZazuInvoiceStatus;
|
|
198
|
+
currency_code: string;
|
|
199
|
+
subtotal: string;
|
|
200
|
+
discount_total: string;
|
|
201
|
+
tax_total: string;
|
|
202
|
+
total: string;
|
|
203
|
+
issue_date: string;
|
|
204
|
+
due_date: string;
|
|
205
|
+
delivery_date?: string;
|
|
206
|
+
reference?: string;
|
|
207
|
+
notes?: string;
|
|
208
|
+
payment_terms?: string;
|
|
209
|
+
send_to_email?: string;
|
|
210
|
+
credited_invoice_id?: string | null;
|
|
211
|
+
credit_note?: boolean;
|
|
212
|
+
sent_at?: string;
|
|
213
|
+
paid_at?: string;
|
|
214
|
+
customer: ZazuCustomer;
|
|
215
|
+
billing_address?: ZazuBillingAddress;
|
|
216
|
+
items: ZazuInvoiceItem[];
|
|
217
|
+
discounts: ZazuInvoiceDiscount[];
|
|
218
|
+
payment_link_url?: string;
|
|
219
|
+
created_at: string;
|
|
220
|
+
updated_at: string;
|
|
221
|
+
}
|
|
222
|
+
export interface ZazuCreateInvoiceItem {
|
|
223
|
+
description: string;
|
|
224
|
+
quantity: number;
|
|
225
|
+
unit_price: string;
|
|
226
|
+
tax_rate?: string;
|
|
227
|
+
position?: number;
|
|
228
|
+
}
|
|
229
|
+
export interface ZazuCreateInvoiceDiscount {
|
|
230
|
+
description?: string;
|
|
231
|
+
discount_type: 'percentage' | 'fixed';
|
|
232
|
+
value: string;
|
|
233
|
+
position?: number;
|
|
234
|
+
}
|
|
235
|
+
export interface ZazuCreateInvoiceBody {
|
|
236
|
+
customer_id: string;
|
|
237
|
+
issue_date: string;
|
|
238
|
+
due_date: string;
|
|
239
|
+
currency_code?: string;
|
|
240
|
+
items: ZazuCreateInvoiceItem[];
|
|
241
|
+
discounts?: ZazuCreateInvoiceDiscount[];
|
|
242
|
+
delivery_date?: string;
|
|
243
|
+
reference?: string;
|
|
244
|
+
notes?: string;
|
|
245
|
+
payment_terms?: string;
|
|
246
|
+
send_to_email?: string;
|
|
247
|
+
}
|
|
248
|
+
export interface ZazuBillingAddressBody {
|
|
249
|
+
street: string;
|
|
250
|
+
street2?: string;
|
|
251
|
+
city: string;
|
|
252
|
+
postal_code: string;
|
|
253
|
+
country: string;
|
|
254
|
+
country_code: string;
|
|
255
|
+
}
|
|
256
|
+
export interface ZazuCreateCustomerBody {
|
|
257
|
+
customer_type?: 'individual' | 'business';
|
|
258
|
+
person_name?: string;
|
|
259
|
+
company_name?: string;
|
|
260
|
+
email?: string;
|
|
261
|
+
phone?: string;
|
|
262
|
+
tax_id?: string;
|
|
263
|
+
ice_number?: string;
|
|
264
|
+
billing_address?: ZazuBillingAddressBody;
|
|
265
|
+
}
|
|
266
|
+
export type ZazuTransferStatus = 'requested' | 'processing' | 'completed' | 'failed';
|
|
267
|
+
export interface ZazuTransfer {
|
|
268
|
+
id: string;
|
|
269
|
+
status: ZazuTransferStatus;
|
|
270
|
+
amount: string;
|
|
271
|
+
currency_code: string;
|
|
272
|
+
payment_reference?: string;
|
|
273
|
+
account_id: string;
|
|
274
|
+
beneficiary_id?: string;
|
|
275
|
+
external_account_id?: string;
|
|
276
|
+
destination_account_id?: string | null;
|
|
277
|
+
transfer?: {
|
|
278
|
+
id: string;
|
|
279
|
+
status: string;
|
|
280
|
+
} | null;
|
|
281
|
+
created_at: string;
|
|
282
|
+
updated_at: string;
|
|
283
|
+
}
|
|
284
|
+
export interface ZazuCreateTransferBody {
|
|
285
|
+
account_id: string;
|
|
286
|
+
amount: string;
|
|
287
|
+
beneficiary_id?: string;
|
|
288
|
+
destination_account_id?: string;
|
|
289
|
+
external_account_id?: string;
|
|
290
|
+
currency_code?: string;
|
|
291
|
+
payment_reference?: string;
|
|
292
|
+
internal_notes?: string;
|
|
293
|
+
}
|
|
294
|
+
export interface ZazuCursorPage<T> {
|
|
295
|
+
data: T[];
|
|
296
|
+
has_more: boolean;
|
|
297
|
+
next_cursor?: string | null;
|
|
298
|
+
}
|
|
299
|
+
export type ZazuWebhookEndpointStatus = 'active' | 'disabled';
|
|
300
|
+
export interface ZazuWebhookEndpoint {
|
|
301
|
+
id: string;
|
|
302
|
+
url: string;
|
|
303
|
+
description?: string | null;
|
|
304
|
+
events: string[];
|
|
305
|
+
status: ZazuWebhookEndpointStatus;
|
|
306
|
+
disabled_at?: string | null;
|
|
307
|
+
last_succeeded_at?: string | null;
|
|
308
|
+
created_at: string;
|
|
309
|
+
updated_at: string;
|
|
310
|
+
}
|
|
311
|
+
/** Create / regenerate_secret responses include the secret exactly once. */
|
|
312
|
+
export interface ZazuWebhookEndpointWithSecret extends ZazuWebhookEndpoint {
|
|
313
|
+
signing_secret: string;
|
|
314
|
+
}
|
|
315
|
+
export interface ZazuCreateWebhookEndpointBody {
|
|
316
|
+
url: string;
|
|
317
|
+
events: string[];
|
|
318
|
+
description?: string;
|
|
319
|
+
}
|
|
320
|
+
export interface ZazuUpdateWebhookEndpointBody {
|
|
321
|
+
url?: string;
|
|
322
|
+
events?: string[];
|
|
323
|
+
description?: string;
|
|
324
|
+
}
|
|
325
|
+
export interface ZazuTestWebhookEndpointResponse {
|
|
326
|
+
delivery_id: string;
|
|
327
|
+
status: string;
|
|
328
|
+
}
|
|
329
|
+
export interface ZazuWebhookHeaders {
|
|
330
|
+
'content-type'?: string;
|
|
331
|
+
'user-agent'?: string;
|
|
332
|
+
'x-zazu-signature'?: string;
|
|
333
|
+
'x-zazu-timestamp'?: string;
|
|
334
|
+
'x-zazu-event'?: string;
|
|
335
|
+
'x-zazu-event-id'?: string;
|
|
336
|
+
'x-zazu-delivery-id'?: string;
|
|
337
|
+
}
|
|
338
|
+
export interface ZazuWebhookPayload {
|
|
339
|
+
event: string;
|
|
340
|
+
created_at: string;
|
|
341
|
+
data: {
|
|
342
|
+
checkout_session?: ZazuCheckoutSession;
|
|
343
|
+
payment_link?: ZazuPaymentLink;
|
|
344
|
+
transfer?: {
|
|
345
|
+
id: string;
|
|
346
|
+
amount: string;
|
|
347
|
+
currency_code: string;
|
|
348
|
+
operation?: string;
|
|
349
|
+
status: string;
|
|
350
|
+
payment_reference?: string;
|
|
351
|
+
posted_at?: string;
|
|
352
|
+
created_at: string;
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
export interface ZazuErrorBody {
|
|
357
|
+
type?: string;
|
|
358
|
+
message?: string;
|
|
359
|
+
param?: string;
|
|
360
|
+
errors?: Array<{
|
|
361
|
+
field?: string;
|
|
362
|
+
message?: string;
|
|
363
|
+
}>;
|
|
364
|
+
}
|
|
365
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/zazu/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,6EAA6E;AAC7E,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;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E,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE;QACJ,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;QACvC,YAAY,CAAC,EAAE,eAAe,CAAC;QAC/B,QAAQ,CAAC,EAAE;YACT,EAAE,EAAE,MAAM,CAAC;YACX,MAAM,EAAE,MAAM,CAAC;YACf,aAAa,EAAE,MAAM,CAAC;YACtB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,MAAM,EAAE,MAAM,CAAC;YACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;YAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;KACH,CAAC;CACH;AAMD,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/billing — Zazu raw API types
|
|
3
|
+
*
|
|
4
|
+
* These interfaces mirror the wire format of the Zazu REST API exactly
|
|
5
|
+
* (see https://staging.zazu.ma/docs). They are intentionally separate
|
|
6
|
+
* from the domain types in `../../types.ts`: the `maps.ts` module is the
|
|
7
|
+
* only place that converts between the two, so a change in the Zazu API
|
|
8
|
+
* never leaks into the rest of the application.
|
|
9
|
+
*
|
|
10
|
+
* Amounts are decimal strings (`"1500.000"`); timestamps are ISO 8601.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/providers/zazu/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/billing — Zazu webhook signature verification & parsing
|
|
3
|
+
*
|
|
4
|
+
* Zazu signs every webhook with HMAC-SHA256 over
|
|
5
|
+
* `${timestamp}.${rawBody}` and sends the signature in the
|
|
6
|
+
* `X-Zazu-Signature` header. Verification uses a constant-time
|
|
7
|
+
* comparison to prevent timing attacks, and rejects signatures whose
|
|
8
|
+
* timestamp falls outside a tolerance window so a captured request
|
|
9
|
+
* can't be replayed indefinitely.
|
|
10
|
+
*
|
|
11
|
+
* After verification, the raw payload is parsed and normalized into a
|
|
12
|
+
* {@link PaymentEvent} (canonical, provider-agnostic shape) so the
|
|
13
|
+
* application can publish it to its event bus without knowing it came
|
|
14
|
+
* from Zazu.
|
|
15
|
+
*
|
|
16
|
+
* Failures are split by cause: {@link WebhookSignatureError} means the
|
|
17
|
+
* request isn't provably from Zazu (auth failure), while
|
|
18
|
+
* {@link WebhookPayloadError} means it is authentic but unusable.
|
|
19
|
+
* Callers must map them to different HTTP statuses — answering 401 to
|
|
20
|
+
* an authentic-but-unmapped event makes Zazu redeliver it forever.
|
|
21
|
+
*/
|
|
22
|
+
import type { PaymentEvent } from '../../events.js';
|
|
23
|
+
import type { WebhookRequest } from '../../provider.js';
|
|
24
|
+
/**
|
|
25
|
+
* Default replay tolerance: a signature more than five minutes old (or
|
|
26
|
+
* five minutes in the future, allowing for clock skew) is rejected.
|
|
27
|
+
*
|
|
28
|
+
* Zazu's docs describe the HMAC construction but do not mandate a
|
|
29
|
+
* freshness check, so this is our own hardening — five minutes is the
|
|
30
|
+
* de-facto standard (Stripe, Slack, GitHub). Note that Zazu retries a
|
|
31
|
+
* failed delivery for ~28 hours, so the window must stay comfortably
|
|
32
|
+
* wider than a single delivery attempt.
|
|
33
|
+
*/
|
|
34
|
+
export declare const DEFAULT_WEBHOOK_TOLERANCE_SECONDS = 300;
|
|
35
|
+
/**
|
|
36
|
+
* Verify a Zazu webhook signature. Throws {@link WebhookSignatureError}
|
|
37
|
+
* if the signature, timestamp, or secret is missing, the timestamp is
|
|
38
|
+
* outside the tolerance window, or the signature does not match.
|
|
39
|
+
*
|
|
40
|
+
* @param secret - The endpoint's signing secret.
|
|
41
|
+
* @param timestamp - `X-Zazu-Timestamp` header value (Unix seconds).
|
|
42
|
+
* @param rawBody - The raw request body exactly as received.
|
|
43
|
+
* @param signature - `X-Zazu-Signature` header value (hex digest).
|
|
44
|
+
* @param toleranceSeconds - Maximum accepted signature age. Pass `0` to
|
|
45
|
+
* disable the freshness check — only appropriate when replaying
|
|
46
|
+
* captured fixtures in tests.
|
|
47
|
+
*/
|
|
48
|
+
export declare function verifyZazuSignature(secret: string, timestamp: string, rawBody: string, signature: string, toleranceSeconds?: number): void;
|
|
49
|
+
/**
|
|
50
|
+
* Parse and normalize a verified Zazu webhook into a
|
|
51
|
+
* {@link PaymentEvent}. This does NOT verify the signature — call
|
|
52
|
+
* {@link verifyZazuSignature} first (or use {@link handleZazuWebhook}
|
|
53
|
+
* which does both).
|
|
54
|
+
*
|
|
55
|
+
* Throws {@link WebhookPayloadError} if the payload is malformed, the
|
|
56
|
+
* event id is absent, or the event type is unknown.
|
|
57
|
+
*/
|
|
58
|
+
export declare function parseZazuWebhook(rawBody: string, headers: Record<string, string>): PaymentEvent;
|
|
59
|
+
/** Options for {@link handleZazuWebhook}. */
|
|
60
|
+
export interface HandleZazuWebhookOptions {
|
|
61
|
+
/**
|
|
62
|
+
* Maximum accepted signature age in seconds. Defaults to
|
|
63
|
+
* {@link DEFAULT_WEBHOOK_TOLERANCE_SECONDS}; `0` disables the check.
|
|
64
|
+
*/
|
|
65
|
+
toleranceSeconds?: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Verify the Zazu webhook signature and parse the payload into a
|
|
69
|
+
* normalized {@link PaymentEvent}. This is what the adapter's
|
|
70
|
+
* `handleWebhookEvent` calls.
|
|
71
|
+
*/
|
|
72
|
+
export declare function handleZazuWebhook(secret: string | undefined, request: WebhookRequest, options?: HandleZazuWebhookOptions): PaymentEvent;
|
|
73
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/providers/zazu/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAiBxD;;;;;;;;;GASG;AACH,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,gBAAgB,GAAE,MAA0C,GAC3D,IAAI,CAoCN;AAiCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAoI/F;AAMD,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,wBAAwB,GACjC,YAAY,CAad"}
|