@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
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/billing — domain types
|
|
3
|
+
*
|
|
4
|
+
* Provider-agnostic business entities. Every adapter (Zazu, Stripe,
|
|
5
|
+
* PayPal, …) maps its raw API shapes to and from these types so the
|
|
6
|
+
* rest of the application never depends on a specific provider's wire
|
|
7
|
+
* format.
|
|
8
|
+
*
|
|
9
|
+
* Money is represented as a decimal string (e.g. `"1500.000"`) to
|
|
10
|
+
* preserve the precision the provider sends — Zazu serializes amounts
|
|
11
|
+
* this way, and converting to integer cents too early loses fidelity
|
|
12
|
+
* for currencies without a 1/100 minor unit. Adapters that use integer
|
|
13
|
+
* minor units internally (Stripe) convert at the boundary.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A monetary amount. `amount` is a decimal string in the major currency
|
|
17
|
+
* unit (e.g. `"1500.000"` for 1500 MAD). `currency` is the ISO 4217
|
|
18
|
+
* code (`"MAD"`, `"USD"`, `"EUR"`).
|
|
19
|
+
*/
|
|
20
|
+
export interface Money {
|
|
21
|
+
amount: string;
|
|
22
|
+
currency: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The consuming application's own identifiers, handed to the provider on
|
|
26
|
+
* create and returned on the resulting webhook. This is the package's
|
|
27
|
+
* primary reconciliation mechanism: rather than reconstructing a full
|
|
28
|
+
* provider object from a partial webhook payload, an event hands back
|
|
29
|
+
* the reference you supplied so you can look up your own record.
|
|
30
|
+
*
|
|
31
|
+
* `reference` is the only field guaranteed to round-trip on **every**
|
|
32
|
+
* flow and provider. `metadata` is not universally supported — see
|
|
33
|
+
* {@link CorrelationSupport} and query it via
|
|
34
|
+
* `provider.correlationSupport(flow)` before relying on it. Passing
|
|
35
|
+
* metadata to a flow that cannot carry it throws
|
|
36
|
+
* {@link UnsupportedCorrelationError} rather than silently dropping it.
|
|
37
|
+
*/
|
|
38
|
+
export interface CorrelationRef {
|
|
39
|
+
/**
|
|
40
|
+
* Your identifier — an order id, invoice number, or opaque token. The
|
|
41
|
+
* package treats it as opaque and never parses it.
|
|
42
|
+
*
|
|
43
|
+
* On Zazu transfers this maps to `payment_reference`, which appears on
|
|
44
|
+
* bank statements, so prefer a human-meaningful value there.
|
|
45
|
+
*/
|
|
46
|
+
reference: string;
|
|
47
|
+
/**
|
|
48
|
+
* Additional key/value pairs echoed back on the webhook.
|
|
49
|
+
*
|
|
50
|
+
* Zazu limits (checkout sessions only): at most 50 keys, keys matching
|
|
51
|
+
* `[A-Za-z0-9_]+`, values at most 500 characters. Validated locally so
|
|
52
|
+
* a violation fails before the request rather than as a provider 422.
|
|
53
|
+
*/
|
|
54
|
+
metadata?: Record<string, string>;
|
|
55
|
+
}
|
|
56
|
+
/** The flows that can carry a {@link CorrelationRef}. */
|
|
57
|
+
export type CorrelationFlow = 'checkoutSession' | 'paymentLink' | 'transfer';
|
|
58
|
+
/**
|
|
59
|
+
* What a provider can round-trip for a given flow. Exposed because the
|
|
60
|
+
* transports genuinely differ — Zazu carries checkout correlation in a
|
|
61
|
+
* request-body `metadata` map, payment-link correlation in a URL query
|
|
62
|
+
* parameter, and transfer correlation in `payment_reference`.
|
|
63
|
+
*/
|
|
64
|
+
export interface CorrelationSupport {
|
|
65
|
+
/** Whether `reference` round-trips. False means no correlation at all. */
|
|
66
|
+
reference: boolean;
|
|
67
|
+
/** Whether `metadata` round-trips. */
|
|
68
|
+
metadata: boolean;
|
|
69
|
+
/** How the reference travels — useful in diagnostics and docs. */
|
|
70
|
+
channel: 'metadata' | 'urlQuery' | 'paymentReference' | 'none';
|
|
71
|
+
}
|
|
72
|
+
export type CustomerType = 'individual' | 'business';
|
|
73
|
+
export interface BillingAddress {
|
|
74
|
+
street: string;
|
|
75
|
+
street2?: string;
|
|
76
|
+
city: string;
|
|
77
|
+
postalCode: string;
|
|
78
|
+
country: string;
|
|
79
|
+
countryCode: string;
|
|
80
|
+
}
|
|
81
|
+
export interface Customer {
|
|
82
|
+
id: string;
|
|
83
|
+
type: CustomerType;
|
|
84
|
+
personName?: string;
|
|
85
|
+
companyName?: string;
|
|
86
|
+
/** Computed display name (company if present, else person). */
|
|
87
|
+
name: string;
|
|
88
|
+
email: string;
|
|
89
|
+
phone?: string;
|
|
90
|
+
taxId?: string;
|
|
91
|
+
iceNumber?: string;
|
|
92
|
+
billingAddress?: BillingAddress;
|
|
93
|
+
createdAt: string;
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
}
|
|
96
|
+
export interface CreateCustomerInput {
|
|
97
|
+
type?: CustomerType;
|
|
98
|
+
personName?: string;
|
|
99
|
+
companyName?: string;
|
|
100
|
+
email: string;
|
|
101
|
+
phone?: string;
|
|
102
|
+
taxId?: string;
|
|
103
|
+
iceNumber?: string;
|
|
104
|
+
billingAddress?: BillingAddress;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Lightweight order reference handed to `createCheckoutSession`. The
|
|
108
|
+
* provider attaches `id` and `metadata` to the checkout session so the
|
|
109
|
+
* `checkout_session.completed` webhook can reconcile the payment back
|
|
110
|
+
* to this order.
|
|
111
|
+
*/
|
|
112
|
+
export interface Order {
|
|
113
|
+
/** Internal order id (your system). */
|
|
114
|
+
id: string;
|
|
115
|
+
amount: Money;
|
|
116
|
+
/**
|
|
117
|
+
* Provider destination account id (e.g. Zazu `account_id`). Optional —
|
|
118
|
+
* providers that don't route to a destination account (Stripe) ignore it;
|
|
119
|
+
* providers that require one (Zazu) validate its presence in the adapter.
|
|
120
|
+
*/
|
|
121
|
+
accountId?: string;
|
|
122
|
+
customerEmail?: string;
|
|
123
|
+
description?: string;
|
|
124
|
+
/** Free-form metadata round-tripped through the webhook (≤50 keys). */
|
|
125
|
+
metadata?: Record<string, string>;
|
|
126
|
+
successUrl: string;
|
|
127
|
+
cancelUrl?: string;
|
|
128
|
+
/** Override the default session expiry. */
|
|
129
|
+
expiresAt?: string;
|
|
130
|
+
}
|
|
131
|
+
export type CheckoutSessionStatus = 'open' | 'processing' | 'complete' | 'expired';
|
|
132
|
+
/**
|
|
133
|
+
* Card transaction nested in a completed checkout session. Present once
|
|
134
|
+
* the session reaches `complete` status.
|
|
135
|
+
*/
|
|
136
|
+
export interface CheckoutTransaction {
|
|
137
|
+
id: string;
|
|
138
|
+
status: string;
|
|
139
|
+
amount: Money;
|
|
140
|
+
feeAmount?: Money;
|
|
141
|
+
netAmount?: Money;
|
|
142
|
+
paymentReference?: string;
|
|
143
|
+
providerReference?: string;
|
|
144
|
+
cardBrand?: string;
|
|
145
|
+
cardLastFour?: string;
|
|
146
|
+
accountTransactionId?: string;
|
|
147
|
+
processedAt?: string;
|
|
148
|
+
createdAt: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* A checkout session. Sessions obtained from `createCheckoutSession` or
|
|
152
|
+
* `getCheckoutSession` are complete; those carried on a
|
|
153
|
+
* `checkout_session.completed` event are a projection that omits the
|
|
154
|
+
* redirect URLs and expiry, which no longer apply once the session is
|
|
155
|
+
* finished. The optional fields below mark exactly that difference.
|
|
156
|
+
*/
|
|
157
|
+
export interface CheckoutSession {
|
|
158
|
+
id: string;
|
|
159
|
+
status: CheckoutSessionStatus;
|
|
160
|
+
amount: Money;
|
|
161
|
+
/** Absent on sessions carried by a `checkout_session.completed` event. */
|
|
162
|
+
successUrl?: string;
|
|
163
|
+
cancelUrl?: string;
|
|
164
|
+
customerEmail?: string;
|
|
165
|
+
metadata?: Record<string, string>;
|
|
166
|
+
description?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Hosted checkout URL the customer is redirected to. Always present on
|
|
169
|
+
* a session returned by `createCheckoutSession`; absent on sessions
|
|
170
|
+
* carried by a `checkout_session.completed` event.
|
|
171
|
+
*/
|
|
172
|
+
url?: string;
|
|
173
|
+
/** Absent on sessions carried by a `checkout_session.completed` event. */
|
|
174
|
+
expiresAt?: string;
|
|
175
|
+
completedAt?: string;
|
|
176
|
+
transaction?: CheckoutTransaction;
|
|
177
|
+
createdAt: string;
|
|
178
|
+
}
|
|
179
|
+
export interface CreateCheckoutSessionInput {
|
|
180
|
+
/**
|
|
181
|
+
* Provider funding/destination account. Optional here because it is a
|
|
182
|
+
* deployment property, not a per-payment one: the Zazu adapter falls
|
|
183
|
+
* back to its configured `accountId` (`ZAZU_ACCOUNT_ID`). Supply it
|
|
184
|
+
* only to override, e.g. in a multi-account tenant.
|
|
185
|
+
*/
|
|
186
|
+
accountId?: string;
|
|
187
|
+
amount: Money;
|
|
188
|
+
successUrl: string;
|
|
189
|
+
cancelUrl?: string;
|
|
190
|
+
customerEmail?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Your identifiers, returned on the `checkout_session.completed`
|
|
193
|
+
* event. Zazu carries both `reference` and `metadata` for this flow.
|
|
194
|
+
*/
|
|
195
|
+
correlation?: CorrelationRef;
|
|
196
|
+
description?: string;
|
|
197
|
+
expiresAt?: string;
|
|
198
|
+
}
|
|
199
|
+
export type PaymentLinkType = 'single' | 'multi';
|
|
200
|
+
export type PaymentLinkStatus = 'active' | 'paid' | 'expired' | 'cancelled';
|
|
201
|
+
export interface PaymentLinkAccount {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
currency: string;
|
|
205
|
+
rib?: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* A payment link. Links obtained from the payment-link operations are
|
|
209
|
+
* complete; those carried on a `payment_link.paid` event are a projection
|
|
210
|
+
* that omits the hosted URL, the funding account, and `updatedAt`. The
|
|
211
|
+
* optional fields below mark exactly that difference.
|
|
212
|
+
*/
|
|
213
|
+
export interface PaymentLink {
|
|
214
|
+
id: string;
|
|
215
|
+
slug: string;
|
|
216
|
+
status: PaymentLinkStatus;
|
|
217
|
+
linkType: PaymentLinkType;
|
|
218
|
+
amount: Money;
|
|
219
|
+
/** Only present on links carried by a `payment_link.paid` event. */
|
|
220
|
+
title?: string;
|
|
221
|
+
description?: string;
|
|
222
|
+
paymentReference?: string;
|
|
223
|
+
paymentsCount: number;
|
|
224
|
+
maxPayments?: number;
|
|
225
|
+
expiresAt?: string;
|
|
226
|
+
paidAt?: string;
|
|
227
|
+
redirectUrl?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Hosted payment URL (shareable via email / WhatsApp / SMS / QR).
|
|
230
|
+
* Absent on links carried by a `payment_link.paid` event.
|
|
231
|
+
*/
|
|
232
|
+
url?: string;
|
|
233
|
+
invoiceId?: string;
|
|
234
|
+
/** Absent on links carried by a `payment_link.paid` event. */
|
|
235
|
+
account?: PaymentLinkAccount;
|
|
236
|
+
clientReferenceId?: string;
|
|
237
|
+
customerEmail?: string;
|
|
238
|
+
customerId?: string;
|
|
239
|
+
customerName?: string;
|
|
240
|
+
createdAt: string;
|
|
241
|
+
/** Absent on links carried by a `payment_link.paid` event. */
|
|
242
|
+
updatedAt?: string;
|
|
243
|
+
}
|
|
244
|
+
export interface CreatePaymentLinkInput {
|
|
245
|
+
/**
|
|
246
|
+
* Provider funding/destination account. Defaults to the adapter's
|
|
247
|
+
* configured account — see {@link CreateCheckoutSessionInput.accountId}.
|
|
248
|
+
*/
|
|
249
|
+
accountId?: string;
|
|
250
|
+
amount: Money;
|
|
251
|
+
description?: string;
|
|
252
|
+
/**
|
|
253
|
+
* Provider-visible payment reference (appears on statements and in the
|
|
254
|
+
* hosted page). Distinct from {@link CreatePaymentLinkInput.correlation}
|
|
255
|
+
* — this is a business reference, not a reconciliation token.
|
|
256
|
+
*/
|
|
257
|
+
paymentReference?: string;
|
|
258
|
+
/**
|
|
259
|
+
* Your identifiers, returned on the `payment_link.paid` event.
|
|
260
|
+
*
|
|
261
|
+
* Zazu carries this as a `client_reference_id` query parameter on the
|
|
262
|
+
* returned {@link PaymentLink.url}, so **the customer must be sent to
|
|
263
|
+
* that exact URL** — a hand-built link loses the correlation. Metadata
|
|
264
|
+
* is NOT supported for this flow (Zazu accepts only four whitelisted
|
|
265
|
+
* query parameters and silently ignores the rest), so supplying it
|
|
266
|
+
* throws {@link UnsupportedCorrelationError}.
|
|
267
|
+
*/
|
|
268
|
+
correlation?: CorrelationRef;
|
|
269
|
+
linkType?: PaymentLinkType;
|
|
270
|
+
redirectUrl?: string;
|
|
271
|
+
expiresAt?: string;
|
|
272
|
+
maxPayments?: number;
|
|
273
|
+
}
|
|
274
|
+
export type InvoiceStatus = 'draft' | 'pending_approval' | 'approved' | 'sent' | 'paid' | 'overdue' | 'cancelled';
|
|
275
|
+
export interface InvoiceLineItem {
|
|
276
|
+
id?: string;
|
|
277
|
+
description: string;
|
|
278
|
+
quantity: number;
|
|
279
|
+
unitPrice: Money;
|
|
280
|
+
taxRate?: string;
|
|
281
|
+
amount: Money;
|
|
282
|
+
position?: number;
|
|
283
|
+
}
|
|
284
|
+
export interface InvoiceDiscount {
|
|
285
|
+
id?: string;
|
|
286
|
+
description?: string;
|
|
287
|
+
discountType: 'percentage' | 'fixed';
|
|
288
|
+
value: string;
|
|
289
|
+
amount: Money;
|
|
290
|
+
position?: number;
|
|
291
|
+
}
|
|
292
|
+
export interface Invoice {
|
|
293
|
+
id: string;
|
|
294
|
+
number: string;
|
|
295
|
+
status: InvoiceStatus;
|
|
296
|
+
currency: string;
|
|
297
|
+
subtotal: Money;
|
|
298
|
+
discountTotal: Money;
|
|
299
|
+
taxTotal: Money;
|
|
300
|
+
total: Money;
|
|
301
|
+
issueDate: string;
|
|
302
|
+
dueDate: string;
|
|
303
|
+
deliveryDate?: string;
|
|
304
|
+
reference?: string;
|
|
305
|
+
notes?: string;
|
|
306
|
+
paymentTerms?: string;
|
|
307
|
+
sendToEmail?: string;
|
|
308
|
+
creditedInvoiceId?: string;
|
|
309
|
+
creditNote?: boolean;
|
|
310
|
+
sentAt?: string;
|
|
311
|
+
paidAt?: string;
|
|
312
|
+
customer: Customer;
|
|
313
|
+
billingAddress?: BillingAddress;
|
|
314
|
+
items: InvoiceLineItem[];
|
|
315
|
+
discounts: InvoiceDiscount[];
|
|
316
|
+
paymentLinkUrl?: string;
|
|
317
|
+
createdAt: string;
|
|
318
|
+
updatedAt: string;
|
|
319
|
+
}
|
|
320
|
+
export interface CreateInvoiceInput {
|
|
321
|
+
customerId: string;
|
|
322
|
+
issueDate: string;
|
|
323
|
+
dueDate: string;
|
|
324
|
+
currency?: string;
|
|
325
|
+
items: Array<Omit<InvoiceLineItem, 'id' | 'amount'> & {
|
|
326
|
+
amount?: Money;
|
|
327
|
+
}>;
|
|
328
|
+
discounts?: Array<Omit<InvoiceDiscount, 'id' | 'amount'> & {
|
|
329
|
+
amount?: Money;
|
|
330
|
+
}>;
|
|
331
|
+
deliveryDate?: string;
|
|
332
|
+
reference?: string;
|
|
333
|
+
notes?: string;
|
|
334
|
+
paymentTerms?: string;
|
|
335
|
+
sendToEmail?: string;
|
|
336
|
+
}
|
|
337
|
+
export interface ListInvoicesParams {
|
|
338
|
+
status?: InvoiceStatus;
|
|
339
|
+
customerId?: string;
|
|
340
|
+
cursor?: string;
|
|
341
|
+
limit?: number;
|
|
342
|
+
}
|
|
343
|
+
export type UpdateCustomerInput = Partial<CreateCustomerInput>;
|
|
344
|
+
export interface ListCustomersParams {
|
|
345
|
+
/** Free-text search across name, company, and email. */
|
|
346
|
+
query?: string;
|
|
347
|
+
cursor?: string;
|
|
348
|
+
limit?: number;
|
|
349
|
+
}
|
|
350
|
+
export type TransferStatus = 'requested' | 'processing' | 'completed' | 'failed';
|
|
351
|
+
export interface Transfer {
|
|
352
|
+
id: string;
|
|
353
|
+
status: TransferStatus;
|
|
354
|
+
amount: Money;
|
|
355
|
+
paymentReference?: string;
|
|
356
|
+
accountId: string;
|
|
357
|
+
beneficiaryId?: string;
|
|
358
|
+
externalAccountId?: string;
|
|
359
|
+
destinationAccountId?: string;
|
|
360
|
+
/** Populated once the draft is approved and executed. */
|
|
361
|
+
transfer?: {
|
|
362
|
+
id: string;
|
|
363
|
+
status: string;
|
|
364
|
+
};
|
|
365
|
+
createdAt: string;
|
|
366
|
+
updatedAt: string;
|
|
367
|
+
}
|
|
368
|
+
export interface CreateTransferInput {
|
|
369
|
+
/**
|
|
370
|
+
* Source account the money leaves. Defaults to the adapter's
|
|
371
|
+
* configured account — see {@link CreateCheckoutSessionInput.accountId}.
|
|
372
|
+
*/
|
|
373
|
+
accountId?: string;
|
|
374
|
+
amount: Money;
|
|
375
|
+
beneficiaryId?: string;
|
|
376
|
+
destinationAccountId?: string;
|
|
377
|
+
externalAccountId?: string;
|
|
378
|
+
/**
|
|
379
|
+
* Provider-visible reference. Mutually exclusive with
|
|
380
|
+
* {@link CreateTransferInput.correlation}: Zazu echoes only
|
|
381
|
+
* `payment_reference` on `transfer.executed`, so correlation has to
|
|
382
|
+
* ride on the same field. Setting both throws
|
|
383
|
+
* {@link UnsupportedCorrelationError}.
|
|
384
|
+
*/
|
|
385
|
+
paymentReference?: string;
|
|
386
|
+
/**
|
|
387
|
+
* Your identifier, returned on the `transfer.executed` event. Travels
|
|
388
|
+
* as `payment_reference`, which is **bank-statement visible** — use a
|
|
389
|
+
* human-meaningful value, not an opaque UUID. Metadata is not
|
|
390
|
+
* supported for this flow.
|
|
391
|
+
*/
|
|
392
|
+
correlation?: CorrelationRef;
|
|
393
|
+
internalNotes?: string;
|
|
394
|
+
}
|
|
395
|
+
export interface ListTransfersParams {
|
|
396
|
+
status?: TransferStatus;
|
|
397
|
+
cursor?: string;
|
|
398
|
+
limit?: number;
|
|
399
|
+
}
|
|
400
|
+
export interface ListPaymentLinksParams {
|
|
401
|
+
status?: PaymentLinkStatus;
|
|
402
|
+
linkType?: PaymentLinkType;
|
|
403
|
+
cursor?: string;
|
|
404
|
+
limit?: number;
|
|
405
|
+
}
|
|
406
|
+
export type AccountStatus = 'open' | 'closed' | 'frozen';
|
|
407
|
+
/**
|
|
408
|
+
* A provider-held account that funds or receives payments. Providers that
|
|
409
|
+
* model accounts as bank accounts (Zazu) expose `balance` and a local
|
|
410
|
+
* bank identifier (`bankIdentifier`, e.g. a Moroccan RIB). Providers
|
|
411
|
+
* without this concept simply don't implement {@link AccountCapable}.
|
|
412
|
+
*/
|
|
413
|
+
export interface Account {
|
|
414
|
+
id: string;
|
|
415
|
+
name: string;
|
|
416
|
+
status: AccountStatus;
|
|
417
|
+
currency: string;
|
|
418
|
+
balance?: Money;
|
|
419
|
+
/** Local bank account identifier (Zazu: RIB). */
|
|
420
|
+
bankIdentifier?: string;
|
|
421
|
+
createdAt: string;
|
|
422
|
+
updatedAt: string;
|
|
423
|
+
}
|
|
424
|
+
export interface ListAccountsParams {
|
|
425
|
+
status?: AccountStatus;
|
|
426
|
+
currency?: string;
|
|
427
|
+
cursor?: string;
|
|
428
|
+
limit?: number;
|
|
429
|
+
}
|
|
430
|
+
/** Direction of money movement on an account ledger entry. */
|
|
431
|
+
export type AccountTransactionOperation = 'credit' | 'debit';
|
|
432
|
+
/**
|
|
433
|
+
* A ledger entry on an {@link Account}. Distinct from
|
|
434
|
+
* {@link CheckoutTransaction}, which is the card transaction attached to
|
|
435
|
+
* a completed checkout session.
|
|
436
|
+
*/
|
|
437
|
+
export interface AccountTransaction {
|
|
438
|
+
id: string;
|
|
439
|
+
accountId: string;
|
|
440
|
+
operation: AccountTransactionOperation;
|
|
441
|
+
amount: Money;
|
|
442
|
+
/** Account balance after this entry was applied. */
|
|
443
|
+
balanceAfter?: Money;
|
|
444
|
+
internalTransfer?: boolean;
|
|
445
|
+
/** Counterparty name, when known. */
|
|
446
|
+
otherName?: string;
|
|
447
|
+
sourceType?: string;
|
|
448
|
+
sourceId?: string;
|
|
449
|
+
transactionType?: string;
|
|
450
|
+
reference?: string;
|
|
451
|
+
transferId?: string;
|
|
452
|
+
postedAt?: string;
|
|
453
|
+
valueDate?: string;
|
|
454
|
+
createdAt: string;
|
|
455
|
+
updatedAt: string;
|
|
456
|
+
}
|
|
457
|
+
export interface ListAccountTransactionsParams {
|
|
458
|
+
cursor?: string;
|
|
459
|
+
limit?: number;
|
|
460
|
+
}
|
|
461
|
+
export type WebhookEndpointStatus = 'active' | 'disabled';
|
|
462
|
+
/**
|
|
463
|
+
* A registered webhook destination. Note the signing secret is NOT part
|
|
464
|
+
* of this type: providers return it only on creation and rotation (see
|
|
465
|
+
* {@link WebhookEndpointWithSecret}).
|
|
466
|
+
*/
|
|
467
|
+
export interface WebhookEndpoint {
|
|
468
|
+
id: string;
|
|
469
|
+
url: string;
|
|
470
|
+
description?: string;
|
|
471
|
+
/** Event types this endpoint subscribes to. */
|
|
472
|
+
events: string[];
|
|
473
|
+
status: WebhookEndpointStatus;
|
|
474
|
+
disabledAt?: string;
|
|
475
|
+
lastSucceededAt?: string;
|
|
476
|
+
createdAt: string;
|
|
477
|
+
updatedAt: string;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* A webhook endpoint including its signing secret. Providers return this
|
|
481
|
+
* shape ONLY from create and regenerate-secret operations — store the
|
|
482
|
+
* secret immediately, it is never returned again.
|
|
483
|
+
*/
|
|
484
|
+
export interface WebhookEndpointWithSecret extends WebhookEndpoint {
|
|
485
|
+
signingSecret: string;
|
|
486
|
+
}
|
|
487
|
+
export interface CreateWebhookEndpointInput {
|
|
488
|
+
/** Must be HTTPS; private / loopback / link-local addresses are rejected. */
|
|
489
|
+
url: string;
|
|
490
|
+
events: string[];
|
|
491
|
+
description?: string;
|
|
492
|
+
}
|
|
493
|
+
export interface UpdateWebhookEndpointInput {
|
|
494
|
+
url?: string;
|
|
495
|
+
events?: string[];
|
|
496
|
+
description?: string;
|
|
497
|
+
}
|
|
498
|
+
export interface ListWebhookEndpointsParams {
|
|
499
|
+
cursor?: string;
|
|
500
|
+
limit?: number;
|
|
501
|
+
}
|
|
502
|
+
/** Result of asking a provider to send a test event to an endpoint. */
|
|
503
|
+
export interface TestWebhookEndpointResult {
|
|
504
|
+
deliveryId: string;
|
|
505
|
+
status: string;
|
|
506
|
+
}
|
|
507
|
+
export interface CursorPage<T> {
|
|
508
|
+
data: T[];
|
|
509
|
+
hasMore: boolean;
|
|
510
|
+
nextCursor?: string;
|
|
511
|
+
}
|
|
512
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH;;;;GAIG;AACH,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,aAAa,GAAG,UAAU,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;IACnB,sCAAsC;IACtC,QAAQ,EAAE,OAAO,CAAC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WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAA0B,SAAQ,eAAe;IAChE,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,uEAAuE;AACvE,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/billing — domain types
|
|
3
|
+
*
|
|
4
|
+
* Provider-agnostic business entities. Every adapter (Zazu, Stripe,
|
|
5
|
+
* PayPal, …) maps its raw API shapes to and from these types so the
|
|
6
|
+
* rest of the application never depends on a specific provider's wire
|
|
7
|
+
* format.
|
|
8
|
+
*
|
|
9
|
+
* Money is represented as a decimal string (e.g. `"1500.000"`) to
|
|
10
|
+
* preserve the precision the provider sends — Zazu serializes amounts
|
|
11
|
+
* this way, and converting to integer cents too early loses fidelity
|
|
12
|
+
* for currencies without a 1/100 minor unit. Adapters that use integer
|
|
13
|
+
* minor units internally (Stripe) convert at the boundary.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@venturekit/billing",
|
|
3
|
+
"version": "0.0.0-dev.20260825184900",
|
|
4
|
+
"description": "VentureKit multi-provider billing — payment provider abstraction (Zazu, Stripe, PayPal) with checkout sessions, payment links, invoices, transfers, and normalized webhook events.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/venturekit-dev/venturekit.git",
|
|
14
|
+
"directory": "packages/billing"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://venturekit.dev",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/venturekit-dev/venturekit/issues"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"registry": "https://registry.npmjs.org",
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./providers/mock": {
|
|
30
|
+
"types": "./dist/providers/mock.d.ts",
|
|
31
|
+
"import": "./dist/providers/mock.js"
|
|
32
|
+
},
|
|
33
|
+
"./providers/zazu": {
|
|
34
|
+
"types": "./dist/providers/zazu/index.d.ts",
|
|
35
|
+
"import": "./dist/providers/zazu/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"venturekit",
|
|
40
|
+
"saas",
|
|
41
|
+
"billing",
|
|
42
|
+
"payments",
|
|
43
|
+
"zazu",
|
|
44
|
+
"stripe",
|
|
45
|
+
"paypal",
|
|
46
|
+
"checkout",
|
|
47
|
+
"webhooks"
|
|
48
|
+
],
|
|
49
|
+
"license": "Apache-2.0",
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@venturekit/core": "0.0.0-dev.20260825184900",
|
|
52
|
+
"@venturekit/integrations": "0.0.0-dev.20260825184900"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/node": "^26.1.2",
|
|
56
|
+
"typescript": "^5.3.0",
|
|
57
|
+
"vitest": "^4.1.10"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsc",
|
|
61
|
+
"dev": "tsc --watch",
|
|
62
|
+
"clean": "rm -rf dist",
|
|
63
|
+
"test": "vitest run",
|
|
64
|
+
"test:watch": "vitest"
|
|
65
|
+
}
|
|
66
|
+
}
|