@peable.to/contracts 1.1.0 → 2.0.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/cjs/resources/catalog/billing.js +21 -23
- package/dist/cjs/resources/tax/calculations.js +33 -30
- package/dist/cjs/resources/tax/reports.js +4 -4
- package/dist/cjs/resources/tax/shared.js +7 -11
- package/dist/cjs/resources/tax/transactions.js +7 -10
- package/dist/cjs/vocabulary/money.js +1 -1
- package/dist/cjs/vocabulary/paymentMethodConfigurations.js +17 -1
- package/dist/esm/resources/catalog/billing.js +21 -23
- package/dist/esm/resources/tax/calculations.js +29 -26
- package/dist/esm/resources/tax/reports.js +6 -6
- package/dist/esm/resources/tax/shared.js +6 -10
- package/dist/esm/resources/tax/transactions.js +8 -11
- package/dist/esm/vocabulary/money.js +1 -1
- package/dist/esm/vocabulary/paymentMethodConfigurations.js +16 -0
- package/dist/types/resources/catalog/billing.d.ts +64 -64
- package/dist/types/resources/catalog/index.d.ts +29 -29
- package/dist/types/resources/checkout/checkoutSessions.d.ts +4 -4
- package/dist/types/resources/checkout/index.d.ts +3 -3
- package/dist/types/resources/tax/calculations.d.ts +37 -37
- package/dist/types/resources/tax/index.d.ts +56 -56
- package/dist/types/resources/tax/reports.d.ts +6 -6
- package/dist/types/resources/tax/shared.d.ts +6 -7
- package/dist/types/resources/tax/transactions.d.ts +61 -61
- package/dist/types/vocabulary/money.d.ts +1 -1
- package/dist/types/vocabulary/paymentMethodConfigurations.d.ts +7 -0
- package/package.json +16 -1
|
@@ -14,9 +14,9 @@ import { type Expand } from '../../common/objects';
|
|
|
14
14
|
* reversal, e.g. a refund the bank later failed).
|
|
15
15
|
*/
|
|
16
16
|
export declare const taxTransactionReversalSchema: z.ZodObject<{
|
|
17
|
-
amount_total: z.
|
|
18
|
-
amount_net: z.
|
|
19
|
-
tax_amount: z.
|
|
17
|
+
amount_total: z.ZodString;
|
|
18
|
+
amount_net: z.ZodString;
|
|
19
|
+
tax_amount: z.ZodString;
|
|
20
20
|
line_items: z.ZodArray<z.ZodObject<{
|
|
21
21
|
reference: z.ZodString;
|
|
22
22
|
quantity: z.ZodNumber;
|
|
@@ -25,9 +25,9 @@ export declare const taxTransactionReversalSchema: z.ZodObject<{
|
|
|
25
25
|
inclusive: "inclusive";
|
|
26
26
|
exclusive: "exclusive";
|
|
27
27
|
}>;
|
|
28
|
-
amount: z.
|
|
29
|
-
amount_tax: z.
|
|
30
|
-
amount_net: z.
|
|
28
|
+
amount: z.ZodString;
|
|
29
|
+
amount_tax: z.ZodString;
|
|
30
|
+
amount_net: z.ZodString;
|
|
31
31
|
breakdown: z.ZodArray<z.ZodObject<{
|
|
32
32
|
country: z.ZodString;
|
|
33
33
|
state: z.ZodNullable<z.ZodString>;
|
|
@@ -35,8 +35,8 @@ export declare const taxTransactionReversalSchema: z.ZodObject<{
|
|
|
35
35
|
display_name: z.ZodNullable<z.ZodString>;
|
|
36
36
|
tax_type: z.ZodNullable<z.ZodString>;
|
|
37
37
|
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
38
|
-
taxable_amount: z.
|
|
39
|
-
amount: z.
|
|
38
|
+
taxable_amount: z.ZodString;
|
|
39
|
+
amount: z.ZodString;
|
|
40
40
|
inclusive: z.ZodBoolean;
|
|
41
41
|
taxability_reason: z.ZodString;
|
|
42
42
|
}, z.core.$strict>>;
|
|
@@ -56,9 +56,9 @@ export declare const taxTransactionSchema: z.ZodObject<{
|
|
|
56
56
|
committed_at: z.ZodNumber;
|
|
57
57
|
reversal_of: z.ZodNullable<z.ZodString>;
|
|
58
58
|
reversal: z.ZodNullable<z.ZodObject<{
|
|
59
|
-
amount_total: z.
|
|
60
|
-
amount_net: z.
|
|
61
|
-
tax_amount: z.
|
|
59
|
+
amount_total: z.ZodString;
|
|
60
|
+
amount_net: z.ZodString;
|
|
61
|
+
tax_amount: z.ZodString;
|
|
62
62
|
line_items: z.ZodArray<z.ZodObject<{
|
|
63
63
|
reference: z.ZodString;
|
|
64
64
|
quantity: z.ZodNumber;
|
|
@@ -67,9 +67,9 @@ export declare const taxTransactionSchema: z.ZodObject<{
|
|
|
67
67
|
inclusive: "inclusive";
|
|
68
68
|
exclusive: "exclusive";
|
|
69
69
|
}>;
|
|
70
|
-
amount: z.
|
|
71
|
-
amount_tax: z.
|
|
72
|
-
amount_net: z.
|
|
70
|
+
amount: z.ZodString;
|
|
71
|
+
amount_tax: z.ZodString;
|
|
72
|
+
amount_net: z.ZodString;
|
|
73
73
|
breakdown: z.ZodArray<z.ZodObject<{
|
|
74
74
|
country: z.ZodString;
|
|
75
75
|
state: z.ZodNullable<z.ZodString>;
|
|
@@ -77,8 +77,8 @@ export declare const taxTransactionSchema: z.ZodObject<{
|
|
|
77
77
|
display_name: z.ZodNullable<z.ZodString>;
|
|
78
78
|
tax_type: z.ZodNullable<z.ZodString>;
|
|
79
79
|
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
80
|
-
taxable_amount: z.
|
|
81
|
-
amount: z.
|
|
80
|
+
taxable_amount: z.ZodString;
|
|
81
|
+
amount: z.ZodString;
|
|
82
82
|
inclusive: z.ZodBoolean;
|
|
83
83
|
taxability_reason: z.ZodString;
|
|
84
84
|
}, z.core.$strict>>;
|
|
@@ -99,10 +99,10 @@ export declare const taxTransactionSchema: z.ZodObject<{
|
|
|
99
99
|
customer_location_evidence_id: z.ZodString;
|
|
100
100
|
country: z.ZodString;
|
|
101
101
|
state: z.ZodNullable<z.ZodString>;
|
|
102
|
-
amount_total: z.
|
|
103
|
-
amount_net: z.
|
|
104
|
-
tax_amount_exclusive: z.
|
|
105
|
-
tax_amount_inclusive: z.
|
|
102
|
+
amount_total: z.ZodString;
|
|
103
|
+
amount_net: z.ZodString;
|
|
104
|
+
tax_amount_exclusive: z.ZodString;
|
|
105
|
+
tax_amount_inclusive: z.ZodString;
|
|
106
106
|
line_items: z.ZodArray<z.ZodObject<{
|
|
107
107
|
reference: z.ZodString;
|
|
108
108
|
quantity: z.ZodNumber;
|
|
@@ -111,9 +111,9 @@ export declare const taxTransactionSchema: z.ZodObject<{
|
|
|
111
111
|
inclusive: "inclusive";
|
|
112
112
|
exclusive: "exclusive";
|
|
113
113
|
}>;
|
|
114
|
-
amount: z.
|
|
115
|
-
amount_tax: z.
|
|
116
|
-
amount_net: z.
|
|
114
|
+
amount: z.ZodString;
|
|
115
|
+
amount_tax: z.ZodString;
|
|
116
|
+
amount_net: z.ZodString;
|
|
117
117
|
breakdown: z.ZodArray<z.ZodObject<{
|
|
118
118
|
country: z.ZodString;
|
|
119
119
|
state: z.ZodNullable<z.ZodString>;
|
|
@@ -121,8 +121,8 @@ export declare const taxTransactionSchema: z.ZodObject<{
|
|
|
121
121
|
display_name: z.ZodNullable<z.ZodString>;
|
|
122
122
|
tax_type: z.ZodNullable<z.ZodString>;
|
|
123
123
|
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
124
|
-
taxable_amount: z.
|
|
125
|
-
amount: z.
|
|
124
|
+
taxable_amount: z.ZodString;
|
|
125
|
+
amount: z.ZodString;
|
|
126
126
|
inclusive: z.ZodBoolean;
|
|
127
127
|
taxability_reason: z.ZodString;
|
|
128
128
|
}, z.core.$strict>>;
|
|
@@ -166,7 +166,7 @@ export type ListTaxTransactionsParams = z.input<typeof listTaxTransactionsQuery>
|
|
|
166
166
|
*/
|
|
167
167
|
export declare const createTaxReversalParams: z.ZodObject<{
|
|
168
168
|
reference: z.ZodString;
|
|
169
|
-
amount: z.ZodOptional<z.
|
|
169
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
170
170
|
}, z.core.$strict>;
|
|
171
171
|
export type CreateTaxReversalParams = z.input<typeof createTaxReversalParams>;
|
|
172
172
|
export declare const taxTransactionRoutes: readonly [{
|
|
@@ -210,9 +210,9 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
210
210
|
committed_at: z.ZodNumber;
|
|
211
211
|
reversal_of: z.ZodNullable<z.ZodString>;
|
|
212
212
|
reversal: z.ZodNullable<z.ZodObject<{
|
|
213
|
-
amount_total: z.
|
|
214
|
-
amount_net: z.
|
|
215
|
-
tax_amount: z.
|
|
213
|
+
amount_total: z.ZodString;
|
|
214
|
+
amount_net: z.ZodString;
|
|
215
|
+
tax_amount: z.ZodString;
|
|
216
216
|
line_items: z.ZodArray<z.ZodObject<{
|
|
217
217
|
reference: z.ZodString;
|
|
218
218
|
quantity: z.ZodNumber;
|
|
@@ -221,9 +221,9 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
221
221
|
inclusive: "inclusive";
|
|
222
222
|
exclusive: "exclusive";
|
|
223
223
|
}>;
|
|
224
|
-
amount: z.
|
|
225
|
-
amount_tax: z.
|
|
226
|
-
amount_net: z.
|
|
224
|
+
amount: z.ZodString;
|
|
225
|
+
amount_tax: z.ZodString;
|
|
226
|
+
amount_net: z.ZodString;
|
|
227
227
|
breakdown: z.ZodArray<z.ZodObject<{
|
|
228
228
|
country: z.ZodString;
|
|
229
229
|
state: z.ZodNullable<z.ZodString>;
|
|
@@ -231,8 +231,8 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
231
231
|
display_name: z.ZodNullable<z.ZodString>;
|
|
232
232
|
tax_type: z.ZodNullable<z.ZodString>;
|
|
233
233
|
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
234
|
-
taxable_amount: z.
|
|
235
|
-
amount: z.
|
|
234
|
+
taxable_amount: z.ZodString;
|
|
235
|
+
amount: z.ZodString;
|
|
236
236
|
inclusive: z.ZodBoolean;
|
|
237
237
|
taxability_reason: z.ZodString;
|
|
238
238
|
}, z.core.$strict>>;
|
|
@@ -253,10 +253,10 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
253
253
|
customer_location_evidence_id: z.ZodString;
|
|
254
254
|
country: z.ZodString;
|
|
255
255
|
state: z.ZodNullable<z.ZodString>;
|
|
256
|
-
amount_total: z.
|
|
257
|
-
amount_net: z.
|
|
258
|
-
tax_amount_exclusive: z.
|
|
259
|
-
tax_amount_inclusive: z.
|
|
256
|
+
amount_total: z.ZodString;
|
|
257
|
+
amount_net: z.ZodString;
|
|
258
|
+
tax_amount_exclusive: z.ZodString;
|
|
259
|
+
tax_amount_inclusive: z.ZodString;
|
|
260
260
|
line_items: z.ZodArray<z.ZodObject<{
|
|
261
261
|
reference: z.ZodString;
|
|
262
262
|
quantity: z.ZodNumber;
|
|
@@ -265,9 +265,9 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
265
265
|
inclusive: "inclusive";
|
|
266
266
|
exclusive: "exclusive";
|
|
267
267
|
}>;
|
|
268
|
-
amount: z.
|
|
269
|
-
amount_tax: z.
|
|
270
|
-
amount_net: z.
|
|
268
|
+
amount: z.ZodString;
|
|
269
|
+
amount_tax: z.ZodString;
|
|
270
|
+
amount_net: z.ZodString;
|
|
271
271
|
breakdown: z.ZodArray<z.ZodObject<{
|
|
272
272
|
country: z.ZodString;
|
|
273
273
|
state: z.ZodNullable<z.ZodString>;
|
|
@@ -275,8 +275,8 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
275
275
|
display_name: z.ZodNullable<z.ZodString>;
|
|
276
276
|
tax_type: z.ZodNullable<z.ZodString>;
|
|
277
277
|
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
278
|
-
taxable_amount: z.
|
|
279
|
-
amount: z.
|
|
278
|
+
taxable_amount: z.ZodString;
|
|
279
|
+
amount: z.ZodString;
|
|
280
280
|
inclusive: z.ZodBoolean;
|
|
281
281
|
taxability_reason: z.ZodString;
|
|
282
282
|
}, z.core.$strict>>;
|
|
@@ -307,7 +307,7 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
307
307
|
};
|
|
308
308
|
readonly body: z.ZodObject<{
|
|
309
309
|
reference: z.ZodString;
|
|
310
|
-
amount: z.ZodOptional<z.
|
|
310
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
311
311
|
}, z.core.$strict>;
|
|
312
312
|
readonly response: z.ZodObject<{
|
|
313
313
|
object: z.ZodLiteral<"tax.transaction">;
|
|
@@ -322,9 +322,9 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
322
322
|
committed_at: z.ZodNumber;
|
|
323
323
|
reversal_of: z.ZodNullable<z.ZodString>;
|
|
324
324
|
reversal: z.ZodNullable<z.ZodObject<{
|
|
325
|
-
amount_total: z.
|
|
326
|
-
amount_net: z.
|
|
327
|
-
tax_amount: z.
|
|
325
|
+
amount_total: z.ZodString;
|
|
326
|
+
amount_net: z.ZodString;
|
|
327
|
+
tax_amount: z.ZodString;
|
|
328
328
|
line_items: z.ZodArray<z.ZodObject<{
|
|
329
329
|
reference: z.ZodString;
|
|
330
330
|
quantity: z.ZodNumber;
|
|
@@ -333,9 +333,9 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
333
333
|
inclusive: "inclusive";
|
|
334
334
|
exclusive: "exclusive";
|
|
335
335
|
}>;
|
|
336
|
-
amount: z.
|
|
337
|
-
amount_tax: z.
|
|
338
|
-
amount_net: z.
|
|
336
|
+
amount: z.ZodString;
|
|
337
|
+
amount_tax: z.ZodString;
|
|
338
|
+
amount_net: z.ZodString;
|
|
339
339
|
breakdown: z.ZodArray<z.ZodObject<{
|
|
340
340
|
country: z.ZodString;
|
|
341
341
|
state: z.ZodNullable<z.ZodString>;
|
|
@@ -343,8 +343,8 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
343
343
|
display_name: z.ZodNullable<z.ZodString>;
|
|
344
344
|
tax_type: z.ZodNullable<z.ZodString>;
|
|
345
345
|
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
346
|
-
taxable_amount: z.
|
|
347
|
-
amount: z.
|
|
346
|
+
taxable_amount: z.ZodString;
|
|
347
|
+
amount: z.ZodString;
|
|
348
348
|
inclusive: z.ZodBoolean;
|
|
349
349
|
taxability_reason: z.ZodString;
|
|
350
350
|
}, z.core.$strict>>;
|
|
@@ -365,10 +365,10 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
365
365
|
customer_location_evidence_id: z.ZodString;
|
|
366
366
|
country: z.ZodString;
|
|
367
367
|
state: z.ZodNullable<z.ZodString>;
|
|
368
|
-
amount_total: z.
|
|
369
|
-
amount_net: z.
|
|
370
|
-
tax_amount_exclusive: z.
|
|
371
|
-
tax_amount_inclusive: z.
|
|
368
|
+
amount_total: z.ZodString;
|
|
369
|
+
amount_net: z.ZodString;
|
|
370
|
+
tax_amount_exclusive: z.ZodString;
|
|
371
|
+
tax_amount_inclusive: z.ZodString;
|
|
372
372
|
line_items: z.ZodArray<z.ZodObject<{
|
|
373
373
|
reference: z.ZodString;
|
|
374
374
|
quantity: z.ZodNumber;
|
|
@@ -377,9 +377,9 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
377
377
|
inclusive: "inclusive";
|
|
378
378
|
exclusive: "exclusive";
|
|
379
379
|
}>;
|
|
380
|
-
amount: z.
|
|
381
|
-
amount_tax: z.
|
|
382
|
-
amount_net: z.
|
|
380
|
+
amount: z.ZodString;
|
|
381
|
+
amount_tax: z.ZodString;
|
|
382
|
+
amount_net: z.ZodString;
|
|
383
383
|
breakdown: z.ZodArray<z.ZodObject<{
|
|
384
384
|
country: z.ZodString;
|
|
385
385
|
state: z.ZodNullable<z.ZodString>;
|
|
@@ -387,8 +387,8 @@ export declare const taxTransactionRoutes: readonly [{
|
|
|
387
387
|
display_name: z.ZodNullable<z.ZodString>;
|
|
388
388
|
tax_type: z.ZodNullable<z.ZodString>;
|
|
389
389
|
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
390
|
-
taxable_amount: z.
|
|
391
|
-
amount: z.
|
|
390
|
+
taxable_amount: z.ZodString;
|
|
391
|
+
amount: z.ZodString;
|
|
392
392
|
inclusive: z.ZodBoolean;
|
|
393
393
|
taxability_reason: z.ZodString;
|
|
394
394
|
}, z.core.$strict>>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* chain rail, and on the card rail the fiat set the provider settles for the
|
|
4
4
|
* payment methods Orbit offers (cards, wallets, SEPA Debit, iDEAL, Bancontact,
|
|
5
5
|
* EPS). A local method narrows it further per payment
|
|
6
|
-
* (`PAYMENT_METHOD_CURRENCIES` in `
|
|
6
|
+
* (`PAYMENT_METHOD_CURRENCIES` in `paymentMethodConfigurations.ts`).
|
|
7
7
|
*
|
|
8
8
|
* A closed set, and the database mirrors it as a CHECK
|
|
9
9
|
* (`db/schema/valueSets.ts`). ADR 0001 D4: the scale of an amount is a property
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type FiatCurrencyCode } from './money';
|
|
1
2
|
/**
|
|
2
3
|
* The methods a configuration can turn on.
|
|
3
4
|
*
|
|
@@ -20,3 +21,9 @@ export type PaymentMethodConfigurationType = (typeof PAYMENT_METHOD_CONFIGURATIO
|
|
|
20
21
|
*/
|
|
21
22
|
export declare const PAYMENT_METHOD_UNAVAILABLE_REASONS: readonly ["provider_unsupported", "requires_card"];
|
|
22
23
|
export type PaymentMethodUnavailableReason = (typeof PAYMENT_METHOD_UNAVAILABLE_REASONS)[number];
|
|
24
|
+
/**
|
|
25
|
+
* The currencies each method can take a payment in. A method is offered on a
|
|
26
|
+
* payment only when its currency is listed — so iDEAL never appears on a USD
|
|
27
|
+
* payment, and a payer is never shown a method that would fail.
|
|
28
|
+
*/
|
|
29
|
+
export declare const PAYMENT_METHOD_CURRENCIES: Readonly<Record<PaymentMethodConfigurationType, readonly FiatCurrencyCode[]>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peable.to/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "The Peable wire, declared once: Zod contracts of every public route, the OpenAPI 3.1 generator and the closed value sets (ADR 0014 D5).",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -36,6 +36,18 @@
|
|
|
36
36
|
},
|
|
37
37
|
"default": "./dist/esm/vocabulary/index.js"
|
|
38
38
|
},
|
|
39
|
+
"./vocabulary/*": {
|
|
40
|
+
"react-native": "./dist/esm/vocabulary/*.js",
|
|
41
|
+
"import": {
|
|
42
|
+
"types": "./dist/types/vocabulary/*.d.ts",
|
|
43
|
+
"default": "./dist/esm/vocabulary/*.js"
|
|
44
|
+
},
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/types/vocabulary/*.d.ts",
|
|
47
|
+
"default": "./dist/cjs/vocabulary/*.js"
|
|
48
|
+
},
|
|
49
|
+
"default": "./dist/esm/vocabulary/*.js"
|
|
50
|
+
},
|
|
39
51
|
"./contributions": {
|
|
40
52
|
"react-native": "./dist/esm/contributions.js",
|
|
41
53
|
"import": {
|
|
@@ -106,6 +118,9 @@
|
|
|
106
118
|
"vocabulary": [
|
|
107
119
|
"./dist/types/vocabulary/index.d.ts"
|
|
108
120
|
],
|
|
121
|
+
"vocabulary/*": [
|
|
122
|
+
"./dist/types/vocabulary/*.d.ts"
|
|
123
|
+
],
|
|
109
124
|
"contributions": [
|
|
110
125
|
"./dist/types/contributions.d.ts"
|
|
111
126
|
],
|