modern-treasury 0.0.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/.eslintrc.js +10 -0
- package/.prettierrc +6 -0
- package/LICENSE +7 -0
- package/README.md +198 -0
- package/build +10 -0
- package/core.ts +746 -0
- package/dist/cjs/core.d.ts +215 -0
- package/dist/cjs/core.js +815 -0
- package/dist/cjs/core.js.map +1 -0
- package/dist/cjs/index.d.ts +118 -0
- package/dist/cjs/index.js +128 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/pagination.d.ts +14 -0
- package/dist/cjs/pagination.js +22 -0
- package/dist/cjs/pagination.js.map +1 -0
- package/dist/cjs/resource.d.ts +11 -0
- package/dist/cjs/resource.js +16 -0
- package/dist/cjs/resource.js.map +1 -0
- package/dist/cjs/resources/counterparties.d.ts +500 -0
- package/dist/cjs/resources/counterparties.js +57 -0
- package/dist/cjs/resources/counterparties.js.map +1 -0
- package/dist/cjs/resources/documents.d.ts +66 -0
- package/dist/cjs/resources/documents.js +23 -0
- package/dist/cjs/resources/documents.js.map +1 -0
- package/dist/cjs/resources/events.d.ts +53 -0
- package/dist/cjs/resources/events.js +22 -0
- package/dist/cjs/resources/events.js.map +1 -0
- package/dist/cjs/resources/expected-payments.d.ts +928 -0
- package/dist/cjs/resources/expected-payments.js +31 -0
- package/dist/cjs/resources/expected-payments.js.map +1 -0
- package/dist/cjs/resources/external-accounts.d.ts +597 -0
- package/dist/cjs/resources/external-accounts.js +51 -0
- package/dist/cjs/resources/external-accounts.js.map +1 -0
- package/dist/cjs/resources/incoming-payment-details.d.ts +487 -0
- package/dist/cjs/resources/incoming-payment-details.js +35 -0
- package/dist/cjs/resources/incoming-payment-details.js.map +1 -0
- package/dist/cjs/resources/index.d.ts +15 -0
- package/dist/cjs/resources/index.js +46 -0
- package/dist/cjs/resources/index.js.map +1 -0
- package/dist/cjs/resources/internal-accounts.d.ts +666 -0
- package/dist/cjs/resources/internal-accounts.js +31 -0
- package/dist/cjs/resources/internal-accounts.js.map +1 -0
- package/dist/cjs/resources/line-items.d.ts +90 -0
- package/dist/cjs/resources/line-items.js +38 -0
- package/dist/cjs/resources/line-items.js.map +1 -0
- package/dist/cjs/resources/paper-items.d.ts +279 -0
- package/dist/cjs/resources/paper-items.js +25 -0
- package/dist/cjs/resources/paper-items.js.map +1 -0
- package/dist/cjs/resources/payment-orders/index.d.ts +2 -0
- package/dist/cjs/resources/payment-orders/index.js +33 -0
- package/dist/cjs/resources/payment-orders/index.js.map +1 -0
- package/dist/cjs/resources/payment-orders/payment-orders.d.ts +2180 -0
- package/dist/cjs/resources/payment-orders/payment-orders.js +56 -0
- package/dist/cjs/resources/payment-orders/payment-orders.js.map +1 -0
- package/dist/cjs/resources/payment-orders/reversals.d.ts +46 -0
- package/dist/cjs/resources/payment-orders/reversals.js +23 -0
- package/dist/cjs/resources/payment-orders/reversals.js.map +1 -0
- package/dist/cjs/resources/returns.d.ts +487 -0
- package/dist/cjs/resources/returns.js +31 -0
- package/dist/cjs/resources/returns.js.map +1 -0
- package/dist/cjs/resources/top-level.d.ts +3 -0
- package/dist/cjs/resources/top-level.js +4 -0
- package/dist/cjs/resources/top-level.js.map +1 -0
- package/dist/cjs/resources/transactions.d.ts +377 -0
- package/dist/cjs/resources/transactions.js +31 -0
- package/dist/cjs/resources/transactions.js.map +1 -0
- package/dist/cjs/resources/validations.d.ts +97 -0
- package/dist/cjs/resources/validations.js +16 -0
- package/dist/cjs/resources/validations.js.map +1 -0
- package/dist/cjs/resources/webhooks.d.ts +31 -0
- package/dist/cjs/resources/webhooks.js +44 -0
- package/dist/cjs/resources/webhooks.js.map +1 -0
- package/dist/cjs/tests/api-resources/counterparties.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/counterparties.test.js +275 -0
- package/dist/cjs/tests/api-resources/counterparties.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/documents.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/documents.test.js +78 -0
- package/dist/cjs/tests/api-resources/documents.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/events.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/events.test.js +100 -0
- package/dist/cjs/tests/api-resources/events.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.js +176 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.js +248 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.js +130 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.js +144 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/line-items.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/line-items.test.js +123 -0
- package/dist/cjs/tests/api-resources/line-items.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/paper-items.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/paper-items.test.js +96 -0
- package/dist/cjs/tests/api-resources/paper-items.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js +77 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/returns.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/returns.test.js +116 -0
- package/dist/cjs/tests/api-resources/returns.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.js +59 -0
- package/dist/cjs/tests/api-resources/top-level.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/transactions.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/transactions.test.js +134 -0
- package/dist/cjs/tests/api-resources/transactions.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/validations.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/validations.test.js +62 -0
- package/dist/cjs/tests/api-resources/validations.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/webhooks.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/webhooks.test.js +100 -0
- package/dist/cjs/tests/api-resources/webhooks.test.js.map +1 -0
- package/dist/cjs/tests/form.test.d.ts +1 -0
- package/dist/cjs/tests/form.test.js +61 -0
- package/dist/cjs/tests/form.test.js.map +1 -0
- package/dist/cjs/tests/index.test.d.ts +1 -0
- package/dist/cjs/tests/index.test.js +57 -0
- package/dist/cjs/tests/index.test.js.map +1 -0
- package/dist/cjs/tests/responses.test.d.ts +1 -0
- package/dist/cjs/tests/responses.test.js +60 -0
- package/dist/cjs/tests/responses.test.js.map +1 -0
- package/index.ts +175 -0
- package/jest.config.js +8 -0
- package/package.json +47 -0
- package/pagination.ts +36 -0
- package/resource.ts +22 -0
- package/resources/counterparties.ts +666 -0
- package/resources/documents.ts +97 -0
- package/resources/events.ts +86 -0
- package/resources/expected-payments.ts +1016 -0
- package/resources/external-accounts.ts +762 -0
- package/resources/incoming-payment-details.ts +592 -0
- package/resources/index.ts +16 -0
- package/resources/internal-accounts.ts +774 -0
- package/resources/line-items.ts +138 -0
- package/resources/paper-items.ts +317 -0
- package/resources/payment-orders/index.ts +3 -0
- package/resources/payment-orders/payment-orders.ts +2486 -0
- package/resources/payment-orders/reversals.ts +72 -0
- package/resources/returns.ts +545 -0
- package/resources/top-level.ts +5 -0
- package/resources/transactions.ts +441 -0
- package/resources/validations.ts +115 -0
- package/resources/webhooks.ts +48 -0
- package/tests/api-resources/counterparties.test.ts +237 -0
- package/tests/api-resources/documents.test.ts +40 -0
- package/tests/api-resources/events.test.ts +62 -0
- package/tests/api-resources/expected-payments.test.ts +138 -0
- package/tests/api-resources/external-accounts.test.ts +210 -0
- package/tests/api-resources/incoming-payment-details.test.ts +92 -0
- package/tests/api-resources/internal-accounts.test.ts +103 -0
- package/tests/api-resources/line-items.test.ts +85 -0
- package/tests/api-resources/paper-items.test.ts +58 -0
- package/tests/api-resources/payment-orders/payment-orders.test.ts +39 -0
- package/tests/api-resources/returns.test.ts +78 -0
- package/tests/api-resources/top-level.test.ts +21 -0
- package/tests/api-resources/transactions.test.ts +96 -0
- package/tests/api-resources/validations.test.ts +24 -0
- package/tests/api-resources/webhooks.test.ts +102 -0
- package/tests/form.test.ts +27 -0
- package/tests/index.test.ts +62 -0
- package/tests/responses.test.ts +25 -0
- package/tsconfig.cjs.json +8 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import ModernTreasury from '~/index';
|
|
4
|
+
const modernTreasury = new ModernTreasury({
|
|
5
|
+
apiKey: 'something1234',
|
|
6
|
+
baseURL: 'http://127.0.0.1:4010',
|
|
7
|
+
organizationId: 'c40c0b40-11d3-42ee-8f2e-18ee8b8239aa',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('resource counterparties', () => {
|
|
11
|
+
test('create: only required params', async () => {
|
|
12
|
+
const response = await modernTreasury.counterparties.create({ name: 'string' });
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('create: required and optional params', async () => {
|
|
16
|
+
const response = await modernTreasury.counterparties.create({
|
|
17
|
+
name: 'string',
|
|
18
|
+
accounts: [
|
|
19
|
+
{
|
|
20
|
+
account_type: 'checking',
|
|
21
|
+
party_type: 'business',
|
|
22
|
+
party_address: {
|
|
23
|
+
line1: 'string',
|
|
24
|
+
line2: 'string',
|
|
25
|
+
locality: 'string',
|
|
26
|
+
region: 'string',
|
|
27
|
+
postal_code: 'string',
|
|
28
|
+
country: 'string',
|
|
29
|
+
},
|
|
30
|
+
name: 'string',
|
|
31
|
+
account_details: [
|
|
32
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
33
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
34
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
35
|
+
],
|
|
36
|
+
routing_details: [
|
|
37
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
38
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
39
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
40
|
+
],
|
|
41
|
+
metadata: {},
|
|
42
|
+
party_name: 'string',
|
|
43
|
+
party_identifier: 'string',
|
|
44
|
+
plaid_processor_token: 'string',
|
|
45
|
+
contact_details: [
|
|
46
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
47
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
48
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
account_type: 'checking',
|
|
53
|
+
party_type: 'business',
|
|
54
|
+
party_address: {
|
|
55
|
+
line1: 'string',
|
|
56
|
+
line2: 'string',
|
|
57
|
+
locality: 'string',
|
|
58
|
+
region: 'string',
|
|
59
|
+
postal_code: 'string',
|
|
60
|
+
country: 'string',
|
|
61
|
+
},
|
|
62
|
+
name: 'string',
|
|
63
|
+
account_details: [
|
|
64
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
65
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
66
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
67
|
+
],
|
|
68
|
+
routing_details: [
|
|
69
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
70
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
71
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
72
|
+
],
|
|
73
|
+
metadata: {},
|
|
74
|
+
party_name: 'string',
|
|
75
|
+
party_identifier: 'string',
|
|
76
|
+
plaid_processor_token: 'string',
|
|
77
|
+
contact_details: [
|
|
78
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
79
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
80
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
account_type: 'checking',
|
|
85
|
+
party_type: 'business',
|
|
86
|
+
party_address: {
|
|
87
|
+
line1: 'string',
|
|
88
|
+
line2: 'string',
|
|
89
|
+
locality: 'string',
|
|
90
|
+
region: 'string',
|
|
91
|
+
postal_code: 'string',
|
|
92
|
+
country: 'string',
|
|
93
|
+
},
|
|
94
|
+
name: 'string',
|
|
95
|
+
account_details: [
|
|
96
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
97
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
98
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
99
|
+
],
|
|
100
|
+
routing_details: [
|
|
101
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
102
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
103
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
104
|
+
],
|
|
105
|
+
metadata: {},
|
|
106
|
+
party_name: 'string',
|
|
107
|
+
party_identifier: 'string',
|
|
108
|
+
plaid_processor_token: 'string',
|
|
109
|
+
contact_details: [
|
|
110
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
111
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
112
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
email: 'dev@stainlessapi.com',
|
|
117
|
+
metadata: {},
|
|
118
|
+
send_remittance_advice: true,
|
|
119
|
+
ledger_type: 'customer',
|
|
120
|
+
taxpayer_identifier: 'string',
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test('retrieve', async () => {
|
|
125
|
+
const response = await modernTreasury.counterparties.retrieve('string');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('retrieve: request options instead of params are passed correctly', async () => {
|
|
129
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
130
|
+
await expect(
|
|
131
|
+
modernTreasury.counterparties.retrieve('string', { path: '/_stainless_unknown_path' }),
|
|
132
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test('update: only required params', async () => {
|
|
136
|
+
const response = await modernTreasury.counterparties.update('string');
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test('update: required and optional params', async () => {
|
|
140
|
+
const response = await modernTreasury.counterparties.update('string', {
|
|
141
|
+
name: 'string',
|
|
142
|
+
email: 'dev@stainlessapi.com',
|
|
143
|
+
metadata: {},
|
|
144
|
+
send_remittance_advice: true,
|
|
145
|
+
taxpayer_identifier: 'string',
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
test('update: request options instead of params are passed correctly', async () => {
|
|
150
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
151
|
+
await expect(
|
|
152
|
+
modernTreasury.counterparties.update('string', { path: '/_stainless_unknown_path' }),
|
|
153
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test('update: request options and params are passed correctly', async () => {
|
|
157
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
158
|
+
await expect(
|
|
159
|
+
modernTreasury.counterparties.update(
|
|
160
|
+
'string',
|
|
161
|
+
{
|
|
162
|
+
name: 'string',
|
|
163
|
+
email: 'dev@stainlessapi.com',
|
|
164
|
+
metadata: {},
|
|
165
|
+
send_remittance_advice: true,
|
|
166
|
+
taxpayer_identifier: 'string',
|
|
167
|
+
},
|
|
168
|
+
{ path: '/_stainless_unknown_path' },
|
|
169
|
+
),
|
|
170
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
test('list: only required params', async () => {
|
|
174
|
+
const response = await modernTreasury.counterparties.list();
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
test('list: required and optional params', async () => {
|
|
178
|
+
const response = await modernTreasury.counterparties.list({
|
|
179
|
+
after_cursor: 'string',
|
|
180
|
+
per_page: 0,
|
|
181
|
+
name: 'string',
|
|
182
|
+
email: 'dev@stainlessapi.com',
|
|
183
|
+
metadata: {},
|
|
184
|
+
created_at_lower_bound: '2019-12-27T18:11:19.117Z',
|
|
185
|
+
created_at_upper_bound: '2019-12-27T18:11:19.117Z',
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
190
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
191
|
+
await expect(modernTreasury.counterparties.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
192
|
+
ModernTreasury.NotFoundError,
|
|
193
|
+
);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
test('list: request options and params are passed correctly', async () => {
|
|
197
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
198
|
+
await expect(
|
|
199
|
+
modernTreasury.counterparties.list(
|
|
200
|
+
{
|
|
201
|
+
after_cursor: 'string',
|
|
202
|
+
per_page: 0,
|
|
203
|
+
name: 'string',
|
|
204
|
+
email: 'dev@stainlessapi.com',
|
|
205
|
+
metadata: {},
|
|
206
|
+
created_at_lower_bound: '2019-12-27T18:11:19.117Z',
|
|
207
|
+
created_at_upper_bound: '2019-12-27T18:11:19.117Z',
|
|
208
|
+
},
|
|
209
|
+
{ path: '/_stainless_unknown_path' },
|
|
210
|
+
),
|
|
211
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
test('delete', async () => {
|
|
215
|
+
const response = await modernTreasury.counterparties.del('string');
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
test('delete: request options instead of params are passed correctly', async () => {
|
|
219
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
220
|
+
await expect(
|
|
221
|
+
modernTreasury.counterparties.del('string', { path: '/_stainless_unknown_path' }),
|
|
222
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
test('collect_account: only required params', async () => {
|
|
226
|
+
const response = await modernTreasury.counterparties.collectAccount('string', { direction: 'credit' });
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
test('collect_account: required and optional params', async () => {
|
|
230
|
+
const response = await modernTreasury.counterparties.collectAccount('string', {
|
|
231
|
+
direction: 'credit',
|
|
232
|
+
send_email: true,
|
|
233
|
+
fields: ['name', 'name', 'name'],
|
|
234
|
+
custom_redirect: 'https://example.com',
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import ModernTreasury from '~/index';
|
|
4
|
+
const modernTreasury = new ModernTreasury({
|
|
5
|
+
apiKey: 'something1234',
|
|
6
|
+
baseURL: 'http://127.0.0.1:4010',
|
|
7
|
+
organizationId: 'c40c0b40-11d3-42ee-8f2e-18ee8b8239aa',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('resource documents', () => {
|
|
11
|
+
test('list: only required params', async () => {
|
|
12
|
+
const response = await modernTreasury.documents.list('cases', 'string');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('list: required and optional params', async () => {
|
|
16
|
+
const response = await modernTreasury.documents.list('cases', 'string', {
|
|
17
|
+
after_cursor: 'string',
|
|
18
|
+
per_page: 0,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
23
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
24
|
+
await expect(
|
|
25
|
+
modernTreasury.documents.list('cases', 'string', { path: '/_stainless_unknown_path' }),
|
|
26
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('list: request options and params are passed correctly', async () => {
|
|
30
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
31
|
+
await expect(
|
|
32
|
+
modernTreasury.documents.list(
|
|
33
|
+
'cases',
|
|
34
|
+
'string',
|
|
35
|
+
{ after_cursor: 'string', per_page: 0 },
|
|
36
|
+
{ path: '/_stainless_unknown_path' },
|
|
37
|
+
),
|
|
38
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import ModernTreasury from '~/index';
|
|
4
|
+
const modernTreasury = new ModernTreasury({
|
|
5
|
+
apiKey: 'something1234',
|
|
6
|
+
baseURL: 'http://127.0.0.1:4010',
|
|
7
|
+
organizationId: 'c40c0b40-11d3-42ee-8f2e-18ee8b8239aa',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('resource events', () => {
|
|
11
|
+
test('retrieve', async () => {
|
|
12
|
+
const response = await modernTreasury.events.retrieve('string');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('retrieve: request options instead of params are passed correctly', async () => {
|
|
16
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
17
|
+
await expect(
|
|
18
|
+
modernTreasury.events.retrieve('string', { path: '/_stainless_unknown_path' }),
|
|
19
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('list: only required params', async () => {
|
|
23
|
+
const response = await modernTreasury.events.list();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('list: required and optional params', async () => {
|
|
27
|
+
const response = await modernTreasury.events.list({
|
|
28
|
+
after_cursor: 'string',
|
|
29
|
+
per_page: 0,
|
|
30
|
+
event_time_start: '2019-12-27T18:11:19.117Z',
|
|
31
|
+
event_time_end: '2019-12-27T18:11:19.117Z',
|
|
32
|
+
resource: 'string',
|
|
33
|
+
entity_id: 'string',
|
|
34
|
+
event_name: 'string',
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
39
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
40
|
+
await expect(modernTreasury.events.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
41
|
+
ModernTreasury.NotFoundError,
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('list: request options and params are passed correctly', async () => {
|
|
46
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
47
|
+
await expect(
|
|
48
|
+
modernTreasury.events.list(
|
|
49
|
+
{
|
|
50
|
+
after_cursor: 'string',
|
|
51
|
+
per_page: 0,
|
|
52
|
+
event_time_start: '2019-12-27T18:11:19.117Z',
|
|
53
|
+
event_time_end: '2019-12-27T18:11:19.117Z',
|
|
54
|
+
resource: 'string',
|
|
55
|
+
entity_id: 'string',
|
|
56
|
+
event_name: 'string',
|
|
57
|
+
},
|
|
58
|
+
{ path: '/_stainless_unknown_path' },
|
|
59
|
+
),
|
|
60
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import ModernTreasury from '~/index';
|
|
4
|
+
const modernTreasury = new ModernTreasury({
|
|
5
|
+
apiKey: 'something1234',
|
|
6
|
+
baseURL: 'http://127.0.0.1:4010',
|
|
7
|
+
organizationId: 'c40c0b40-11d3-42ee-8f2e-18ee8b8239aa',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('resource expected_payments', () => {
|
|
11
|
+
test('create: only required params', async () => {
|
|
12
|
+
const response = await modernTreasury.expectedPayments.create({
|
|
13
|
+
amount_upper_bound: 0,
|
|
14
|
+
amount_lower_bound: 0,
|
|
15
|
+
direction: 'credit',
|
|
16
|
+
internal_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('create: required and optional params', async () => {
|
|
21
|
+
const response = await modernTreasury.expectedPayments.create({
|
|
22
|
+
amount_upper_bound: 0,
|
|
23
|
+
amount_lower_bound: 0,
|
|
24
|
+
direction: 'credit',
|
|
25
|
+
internal_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
26
|
+
type: 'ach',
|
|
27
|
+
currency: 'AED',
|
|
28
|
+
date_upper_bound: '2019-12-27',
|
|
29
|
+
date_lower_bound: '2019-12-27',
|
|
30
|
+
description: 'string',
|
|
31
|
+
statement_descriptor: 'string',
|
|
32
|
+
metadata: {},
|
|
33
|
+
counterparty_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
34
|
+
remittance_information: 'string',
|
|
35
|
+
line_items: [
|
|
36
|
+
{ amount: 0, metadata: {}, description: 'string', accounting_category_id: 'string' },
|
|
37
|
+
{ amount: 0, metadata: {}, description: 'string', accounting_category_id: 'string' },
|
|
38
|
+
{ amount: 0, metadata: {}, description: 'string', accounting_category_id: 'string' },
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('retrieve', async () => {
|
|
44
|
+
const response = await modernTreasury.expectedPayments.retrieve('string');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('retrieve: request options instead of params are passed correctly', async () => {
|
|
48
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
49
|
+
await expect(
|
|
50
|
+
modernTreasury.expectedPayments.retrieve('string', { path: '/_stainless_unknown_path' }),
|
|
51
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('update: only required params', async () => {
|
|
55
|
+
const response = await modernTreasury.expectedPayments.update('string', {
|
|
56
|
+
amount_upper_bound: 0,
|
|
57
|
+
amount_lower_bound: 0,
|
|
58
|
+
direction: 'credit',
|
|
59
|
+
internal_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('update: required and optional params', async () => {
|
|
64
|
+
const response = await modernTreasury.expectedPayments.update('string', {
|
|
65
|
+
amount_upper_bound: 0,
|
|
66
|
+
amount_lower_bound: 0,
|
|
67
|
+
direction: 'credit',
|
|
68
|
+
internal_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
69
|
+
type: 'ach',
|
|
70
|
+
currency: 'AED',
|
|
71
|
+
date_upper_bound: '2019-12-27',
|
|
72
|
+
date_lower_bound: '2019-12-27',
|
|
73
|
+
description: 'string',
|
|
74
|
+
statement_descriptor: 'string',
|
|
75
|
+
metadata: {},
|
|
76
|
+
counterparty_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
77
|
+
remittance_information: 'string',
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('list: only required params', async () => {
|
|
82
|
+
const response = await modernTreasury.expectedPayments.list();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('list: required and optional params', async () => {
|
|
86
|
+
const response = await modernTreasury.expectedPayments.list({
|
|
87
|
+
after_cursor: 'string',
|
|
88
|
+
per_page: 0,
|
|
89
|
+
status: 'archived',
|
|
90
|
+
internal_account_id: 'string',
|
|
91
|
+
direction: 'credit',
|
|
92
|
+
type: 'ach',
|
|
93
|
+
counterparty_id: 'string',
|
|
94
|
+
metadata: {},
|
|
95
|
+
created_at_lower_bound: '2019-12-27T18:11:19.117Z',
|
|
96
|
+
created_at_upper_bound: '2019-12-27T18:11:19.117Z',
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
101
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
102
|
+
await expect(modernTreasury.expectedPayments.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
103
|
+
ModernTreasury.NotFoundError,
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('list: request options and params are passed correctly', async () => {
|
|
108
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
109
|
+
await expect(
|
|
110
|
+
modernTreasury.expectedPayments.list(
|
|
111
|
+
{
|
|
112
|
+
after_cursor: 'string',
|
|
113
|
+
per_page: 0,
|
|
114
|
+
status: 'archived',
|
|
115
|
+
internal_account_id: 'string',
|
|
116
|
+
direction: 'credit',
|
|
117
|
+
type: 'ach',
|
|
118
|
+
counterparty_id: 'string',
|
|
119
|
+
metadata: {},
|
|
120
|
+
created_at_lower_bound: '2019-12-27T18:11:19.117Z',
|
|
121
|
+
created_at_upper_bound: '2019-12-27T18:11:19.117Z',
|
|
122
|
+
},
|
|
123
|
+
{ path: '/_stainless_unknown_path' },
|
|
124
|
+
),
|
|
125
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('delete', async () => {
|
|
129
|
+
const response = await modernTreasury.expectedPayments.del('string');
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test('delete: request options instead of params are passed correctly', async () => {
|
|
133
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
134
|
+
await expect(
|
|
135
|
+
modernTreasury.expectedPayments.del('string', { path: '/_stainless_unknown_path' }),
|
|
136
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import ModernTreasury from '~/index';
|
|
4
|
+
const modernTreasury = new ModernTreasury({
|
|
5
|
+
apiKey: 'something1234',
|
|
6
|
+
baseURL: 'http://127.0.0.1:4010',
|
|
7
|
+
organizationId: 'c40c0b40-11d3-42ee-8f2e-18ee8b8239aa',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('resource external_accounts', () => {
|
|
11
|
+
test('create: only required params', async () => {
|
|
12
|
+
const response = await modernTreasury.externalAccounts.create({
|
|
13
|
+
counterparty_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('create: required and optional params', async () => {
|
|
18
|
+
const response = await modernTreasury.externalAccounts.create({
|
|
19
|
+
account_type: 'checking',
|
|
20
|
+
party_type: 'business',
|
|
21
|
+
party_address: {
|
|
22
|
+
line1: 'string',
|
|
23
|
+
line2: 'string',
|
|
24
|
+
locality: 'string',
|
|
25
|
+
region: 'string',
|
|
26
|
+
postal_code: 'string',
|
|
27
|
+
country: 'string',
|
|
28
|
+
},
|
|
29
|
+
name: 'string',
|
|
30
|
+
counterparty_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
31
|
+
account_details: [
|
|
32
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
33
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
34
|
+
{ account_number: 'string', account_number_type: 'iban' },
|
|
35
|
+
],
|
|
36
|
+
routing_details: [
|
|
37
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
38
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
39
|
+
{ routing_number: 'string', routing_number_type: 'aba', payment_type: 'ach' },
|
|
40
|
+
],
|
|
41
|
+
metadata: {},
|
|
42
|
+
party_name: 'string',
|
|
43
|
+
party_identifier: 'string',
|
|
44
|
+
plaid_processor_token: 'string',
|
|
45
|
+
contact_details: [
|
|
46
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
47
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
48
|
+
{ contact_identifier: 'string', contact_identifier_type: 'email' },
|
|
49
|
+
],
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('retrieve', async () => {
|
|
54
|
+
const response = await modernTreasury.externalAccounts.retrieve('string');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('retrieve: request options instead of params are passed correctly', async () => {
|
|
58
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
59
|
+
await expect(
|
|
60
|
+
modernTreasury.externalAccounts.retrieve('string', { path: '/_stainless_unknown_path' }),
|
|
61
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('update: only required params', async () => {
|
|
65
|
+
const response = await modernTreasury.externalAccounts.update('string');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('update: required and optional params', async () => {
|
|
69
|
+
const response = await modernTreasury.externalAccounts.update('string', {
|
|
70
|
+
party_type: 'business',
|
|
71
|
+
account_type: 'checking',
|
|
72
|
+
counterparty_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
73
|
+
name: 'string',
|
|
74
|
+
party_name: 'string',
|
|
75
|
+
party_address: {
|
|
76
|
+
line1: 'string',
|
|
77
|
+
line2: 'string',
|
|
78
|
+
locality: 'string',
|
|
79
|
+
region: 'string',
|
|
80
|
+
postal_code: 'string',
|
|
81
|
+
country: 'string',
|
|
82
|
+
},
|
|
83
|
+
metadata: {},
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('update: request options instead of params are passed correctly', async () => {
|
|
88
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
89
|
+
await expect(
|
|
90
|
+
modernTreasury.externalAccounts.update('string', { path: '/_stainless_unknown_path' }),
|
|
91
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('update: request options and params are passed correctly', async () => {
|
|
95
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
96
|
+
await expect(
|
|
97
|
+
modernTreasury.externalAccounts.update(
|
|
98
|
+
'string',
|
|
99
|
+
{
|
|
100
|
+
party_type: 'business',
|
|
101
|
+
account_type: 'checking',
|
|
102
|
+
counterparty_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
103
|
+
name: 'string',
|
|
104
|
+
party_name: 'string',
|
|
105
|
+
party_address: {
|
|
106
|
+
line1: 'string',
|
|
107
|
+
line2: 'string',
|
|
108
|
+
locality: 'string',
|
|
109
|
+
region: 'string',
|
|
110
|
+
postal_code: 'string',
|
|
111
|
+
country: 'string',
|
|
112
|
+
},
|
|
113
|
+
metadata: {},
|
|
114
|
+
},
|
|
115
|
+
{ path: '/_stainless_unknown_path' },
|
|
116
|
+
),
|
|
117
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('list: only required params', async () => {
|
|
121
|
+
const response = await modernTreasury.externalAccounts.list();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test('list: required and optional params', async () => {
|
|
125
|
+
const response = await modernTreasury.externalAccounts.list({
|
|
126
|
+
after_cursor: 'string',
|
|
127
|
+
per_page: 0,
|
|
128
|
+
party_name: 'string',
|
|
129
|
+
counterparty_id: 'string',
|
|
130
|
+
metadata: {},
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
135
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
136
|
+
await expect(modernTreasury.externalAccounts.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
137
|
+
ModernTreasury.NotFoundError,
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test('list: request options and params are passed correctly', async () => {
|
|
142
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
143
|
+
await expect(
|
|
144
|
+
modernTreasury.externalAccounts.list(
|
|
145
|
+
{
|
|
146
|
+
after_cursor: 'string',
|
|
147
|
+
per_page: 0,
|
|
148
|
+
party_name: 'string',
|
|
149
|
+
counterparty_id: 'string',
|
|
150
|
+
metadata: {},
|
|
151
|
+
},
|
|
152
|
+
{ path: '/_stainless_unknown_path' },
|
|
153
|
+
),
|
|
154
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test('delete', async () => {
|
|
158
|
+
const response = await modernTreasury.externalAccounts.del('string');
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
test('delete: request options instead of params are passed correctly', async () => {
|
|
162
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
163
|
+
await expect(
|
|
164
|
+
modernTreasury.externalAccounts.del('string', { path: '/_stainless_unknown_path' }),
|
|
165
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
test('complete_verification: only required params', async () => {
|
|
169
|
+
const response = await modernTreasury.externalAccounts.completeVerification('string');
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
test('complete_verification: required and optional params', async () => {
|
|
173
|
+
const response = await modernTreasury.externalAccounts.completeVerification('string', {
|
|
174
|
+
amounts: [0, 0],
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
test('complete_verification: request options instead of params are passed correctly', async () => {
|
|
179
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
180
|
+
await expect(
|
|
181
|
+
modernTreasury.externalAccounts.completeVerification('string', { path: '/_stainless_unknown_path' }),
|
|
182
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
test('complete_verification: request options and params are passed correctly', async () => {
|
|
186
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
187
|
+
await expect(
|
|
188
|
+
modernTreasury.externalAccounts.completeVerification(
|
|
189
|
+
'string',
|
|
190
|
+
{ amounts: [0, 0] },
|
|
191
|
+
{ path: '/_stainless_unknown_path' },
|
|
192
|
+
),
|
|
193
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
test('verify: only required params', async () => {
|
|
197
|
+
const response = await modernTreasury.externalAccounts.verify('string', {
|
|
198
|
+
originating_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
199
|
+
payment_type: 'ach',
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
test('verify: required and optional params', async () => {
|
|
204
|
+
const response = await modernTreasury.externalAccounts.verify('string', {
|
|
205
|
+
originating_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
206
|
+
payment_type: 'ach',
|
|
207
|
+
currency: 'AED',
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
});
|