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,92 @@
|
|
|
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 incoming_payment_details', () => {
|
|
11
|
+
test('retrieve', async () => {
|
|
12
|
+
const response = await modernTreasury.incomingPaymentDetails.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.incomingPaymentDetails.retrieve('string', { path: '/_stainless_unknown_path' }),
|
|
19
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('update: only required params', async () => {
|
|
23
|
+
const response = await modernTreasury.incomingPaymentDetails.update('string');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('update: required and optional params', async () => {
|
|
27
|
+
const response = await modernTreasury.incomingPaymentDetails.update('string', { metadata: {} });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('update: request options instead of params are passed correctly', async () => {
|
|
31
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
32
|
+
await expect(
|
|
33
|
+
modernTreasury.incomingPaymentDetails.update('string', { path: '/_stainless_unknown_path' }),
|
|
34
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('update: request options and params are passed correctly', async () => {
|
|
38
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
39
|
+
await expect(
|
|
40
|
+
modernTreasury.incomingPaymentDetails.update(
|
|
41
|
+
'string',
|
|
42
|
+
{ metadata: {} },
|
|
43
|
+
{ path: '/_stainless_unknown_path' },
|
|
44
|
+
),
|
|
45
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('list: only required params', async () => {
|
|
49
|
+
const response = await modernTreasury.incomingPaymentDetails.list();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('list: required and optional params', async () => {
|
|
53
|
+
const response = await modernTreasury.incomingPaymentDetails.list({
|
|
54
|
+
after_cursor: 'string',
|
|
55
|
+
per_page: 0,
|
|
56
|
+
direction: 'credit',
|
|
57
|
+
status: 'completed',
|
|
58
|
+
type: 'ach',
|
|
59
|
+
as_of_date_start: '2019-12-27',
|
|
60
|
+
as_of_date_end: '2019-12-27',
|
|
61
|
+
metadata: {},
|
|
62
|
+
virtual_account_id: 'string',
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
67
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
68
|
+
await expect(
|
|
69
|
+
modernTreasury.incomingPaymentDetails.list({ path: '/_stainless_unknown_path' }),
|
|
70
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('list: request options and params are passed correctly', async () => {
|
|
74
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
75
|
+
await expect(
|
|
76
|
+
modernTreasury.incomingPaymentDetails.list(
|
|
77
|
+
{
|
|
78
|
+
after_cursor: 'string',
|
|
79
|
+
per_page: 0,
|
|
80
|
+
direction: 'credit',
|
|
81
|
+
status: 'completed',
|
|
82
|
+
type: 'ach',
|
|
83
|
+
as_of_date_start: '2019-12-27',
|
|
84
|
+
as_of_date_end: '2019-12-27',
|
|
85
|
+
metadata: {},
|
|
86
|
+
virtual_account_id: 'string',
|
|
87
|
+
},
|
|
88
|
+
{ path: '/_stainless_unknown_path' },
|
|
89
|
+
),
|
|
90
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
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 internal_accounts', () => {
|
|
11
|
+
test('create: only required params', async () => {
|
|
12
|
+
const response = await modernTreasury.internalAccounts.create({
|
|
13
|
+
connection_id: 'string',
|
|
14
|
+
name: 'string',
|
|
15
|
+
party_name: 'string',
|
|
16
|
+
currency: 'USD',
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('create: required and optional params', async () => {
|
|
21
|
+
const response = await modernTreasury.internalAccounts.create({
|
|
22
|
+
connection_id: 'string',
|
|
23
|
+
name: 'string',
|
|
24
|
+
party_name: 'string',
|
|
25
|
+
currency: 'USD',
|
|
26
|
+
entity_id: 'string',
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('retrieve', async () => {
|
|
31
|
+
const response = await modernTreasury.internalAccounts.retrieve('string');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('retrieve: request options instead of params are passed correctly', async () => {
|
|
35
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
36
|
+
await expect(
|
|
37
|
+
modernTreasury.internalAccounts.retrieve('string', { path: '/_stainless_unknown_path' }),
|
|
38
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('update: only required params', async () => {
|
|
42
|
+
const response = await modernTreasury.internalAccounts.update('string');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('update: required and optional params', async () => {
|
|
46
|
+
const response = await modernTreasury.internalAccounts.update('string', { name: 'string', metadata: {} });
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('update: request options instead of params are passed correctly', async () => {
|
|
50
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
51
|
+
await expect(
|
|
52
|
+
modernTreasury.internalAccounts.update('string', { path: '/_stainless_unknown_path' }),
|
|
53
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('update: request options and params are passed correctly', async () => {
|
|
57
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
58
|
+
await expect(
|
|
59
|
+
modernTreasury.internalAccounts.update(
|
|
60
|
+
'string',
|
|
61
|
+
{ name: 'string', metadata: {} },
|
|
62
|
+
{ path: '/_stainless_unknown_path' },
|
|
63
|
+
),
|
|
64
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('list: only required params', async () => {
|
|
68
|
+
const response = await modernTreasury.internalAccounts.list();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('list: required and optional params', async () => {
|
|
72
|
+
const response = await modernTreasury.internalAccounts.list({
|
|
73
|
+
after_cursor: 'string',
|
|
74
|
+
per_page: 0,
|
|
75
|
+
currency: 'AED',
|
|
76
|
+
payment_type: 'ach',
|
|
77
|
+
payment_direction: 'credit',
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
82
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
83
|
+
await expect(modernTreasury.internalAccounts.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
84
|
+
ModernTreasury.NotFoundError,
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test('list: request options and params are passed correctly', async () => {
|
|
89
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
90
|
+
await expect(
|
|
91
|
+
modernTreasury.internalAccounts.list(
|
|
92
|
+
{
|
|
93
|
+
after_cursor: 'string',
|
|
94
|
+
per_page: 0,
|
|
95
|
+
currency: 'AED',
|
|
96
|
+
payment_type: 'ach',
|
|
97
|
+
payment_direction: 'credit',
|
|
98
|
+
},
|
|
99
|
+
{ path: '/_stainless_unknown_path' },
|
|
100
|
+
),
|
|
101
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
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 line_items', () => {
|
|
11
|
+
test('retrieve', async () => {
|
|
12
|
+
const response = await modernTreasury.lineItems.retrieve('expected_payments', 'string', '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.lineItems.retrieve('expected_payments', 'string', 'string', {
|
|
19
|
+
path: '/_stainless_unknown_path',
|
|
20
|
+
}),
|
|
21
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('update: only required params', async () => {
|
|
25
|
+
const response = await modernTreasury.lineItems.update('expected_payments', 'string', 'string');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('update: required and optional params', async () => {
|
|
29
|
+
const response = await modernTreasury.lineItems.update('expected_payments', 'string', 'string', {
|
|
30
|
+
metadata: {},
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('update: request options instead of params are passed correctly', async () => {
|
|
35
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
36
|
+
await expect(
|
|
37
|
+
modernTreasury.lineItems.update('expected_payments', 'string', 'string', {
|
|
38
|
+
path: '/_stainless_unknown_path',
|
|
39
|
+
}),
|
|
40
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('update: request options and params are passed correctly', async () => {
|
|
44
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
45
|
+
await expect(
|
|
46
|
+
modernTreasury.lineItems.update(
|
|
47
|
+
'expected_payments',
|
|
48
|
+
'string',
|
|
49
|
+
'string',
|
|
50
|
+
{ metadata: {} },
|
|
51
|
+
{ path: '/_stainless_unknown_path' },
|
|
52
|
+
),
|
|
53
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('list: only required params', async () => {
|
|
57
|
+
const response = await modernTreasury.lineItems.list('expected_payments', 'string');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('list: required and optional params', async () => {
|
|
61
|
+
const response = await modernTreasury.lineItems.list('expected_payments', 'string', {
|
|
62
|
+
after_cursor: 'string',
|
|
63
|
+
per_page: 0,
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
68
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
69
|
+
await expect(
|
|
70
|
+
modernTreasury.lineItems.list('expected_payments', 'string', { path: '/_stainless_unknown_path' }),
|
|
71
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test('list: request options and params are passed correctly', async () => {
|
|
75
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
76
|
+
await expect(
|
|
77
|
+
modernTreasury.lineItems.list(
|
|
78
|
+
'expected_payments',
|
|
79
|
+
'string',
|
|
80
|
+
{ after_cursor: 'string', per_page: 0 },
|
|
81
|
+
{ path: '/_stainless_unknown_path' },
|
|
82
|
+
),
|
|
83
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
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 paper_items', () => {
|
|
11
|
+
test('retrieve', async () => {
|
|
12
|
+
const response = await modernTreasury.paperItems.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.paperItems.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.paperItems.list();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('list: required and optional params', async () => {
|
|
27
|
+
const response = await modernTreasury.paperItems.list({
|
|
28
|
+
lockbox_number: 'string',
|
|
29
|
+
deposit_date_start: '2019-12-27',
|
|
30
|
+
deposit_date_end: '2019-12-27',
|
|
31
|
+
after_cursor: 'string',
|
|
32
|
+
per_page: 0,
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
37
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
38
|
+
await expect(modernTreasury.paperItems.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
39
|
+
ModernTreasury.NotFoundError,
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('list: request options and params are passed correctly', async () => {
|
|
44
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
45
|
+
await expect(
|
|
46
|
+
modernTreasury.paperItems.list(
|
|
47
|
+
{
|
|
48
|
+
lockbox_number: 'string',
|
|
49
|
+
deposit_date_start: '2019-12-27',
|
|
50
|
+
deposit_date_end: '2019-12-27',
|
|
51
|
+
after_cursor: 'string',
|
|
52
|
+
per_page: 0,
|
|
53
|
+
},
|
|
54
|
+
{ path: '/_stainless_unknown_path' },
|
|
55
|
+
),
|
|
56
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
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 reversals', () => {
|
|
11
|
+
test('list: only required params', async () => {
|
|
12
|
+
const response = await modernTreasury.paymentOrders.reversals.list('string');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('list: required and optional params', async () => {
|
|
16
|
+
const response = await modernTreasury.paymentOrders.reversals.list('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.paymentOrders.reversals.list('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.paymentOrders.reversals.list(
|
|
33
|
+
'string',
|
|
34
|
+
{ after_cursor: 'string', per_page: 0 },
|
|
35
|
+
{ path: '/_stainless_unknown_path' },
|
|
36
|
+
),
|
|
37
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
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 returns', () => {
|
|
11
|
+
test('create: only required params', async () => {
|
|
12
|
+
const response = await modernTreasury.returns.create({
|
|
13
|
+
returnable_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
14
|
+
returnable_type: 'incoming_payment_detail',
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('create: required and optional params', async () => {
|
|
19
|
+
const response = await modernTreasury.returns.create({
|
|
20
|
+
returnable_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
21
|
+
code: '901',
|
|
22
|
+
reason: 'string',
|
|
23
|
+
date_of_death: '2019-12-27',
|
|
24
|
+
additional_information: 'string',
|
|
25
|
+
returnable_type: 'incoming_payment_detail',
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('retrieve', async () => {
|
|
30
|
+
const response = await modernTreasury.returns.retrieve('string');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('retrieve: request options instead of params are passed correctly', async () => {
|
|
34
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
35
|
+
await expect(
|
|
36
|
+
modernTreasury.returns.retrieve('string', { path: '/_stainless_unknown_path' }),
|
|
37
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('list: only required params', async () => {
|
|
41
|
+
const response = await modernTreasury.returns.list();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('list: required and optional params', async () => {
|
|
45
|
+
const response = await modernTreasury.returns.list({
|
|
46
|
+
after_cursor: 'string',
|
|
47
|
+
per_page: 0,
|
|
48
|
+
internal_account_id: 'string',
|
|
49
|
+
counterparty_id: 'string',
|
|
50
|
+
returnable_id: 'string',
|
|
51
|
+
returnable_type: 'incoming_payment_detail',
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
56
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
57
|
+
await expect(modernTreasury.returns.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
58
|
+
ModernTreasury.NotFoundError,
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('list: request options and params are passed correctly', async () => {
|
|
63
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
64
|
+
await expect(
|
|
65
|
+
modernTreasury.returns.list(
|
|
66
|
+
{
|
|
67
|
+
after_cursor: 'string',
|
|
68
|
+
per_page: 0,
|
|
69
|
+
internal_account_id: 'string',
|
|
70
|
+
counterparty_id: 'string',
|
|
71
|
+
returnable_id: 'string',
|
|
72
|
+
returnable_type: 'incoming_payment_detail',
|
|
73
|
+
},
|
|
74
|
+
{ path: '/_stainless_unknown_path' },
|
|
75
|
+
),
|
|
76
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
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 top_level', () => {
|
|
11
|
+
test('ping', async () => {
|
|
12
|
+
const response = await modernTreasury.ping();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('ping: 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(modernTreasury.ping({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
18
|
+
ModernTreasury.NotFoundError,
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
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 transactions', () => {
|
|
11
|
+
test('retrieve', async () => {
|
|
12
|
+
const response = await modernTreasury.transactions.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.transactions.retrieve('string', { path: '/_stainless_unknown_path' }),
|
|
19
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('update: only required params', async () => {
|
|
23
|
+
const response = await modernTreasury.transactions.update('string');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('update: required and optional params', async () => {
|
|
27
|
+
const response = await modernTreasury.transactions.update('string', { metadata: {} });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('update: request options instead of params are passed correctly', async () => {
|
|
31
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
32
|
+
await expect(
|
|
33
|
+
modernTreasury.transactions.update('string', { path: '/_stainless_unknown_path' }),
|
|
34
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('update: request options and params are passed correctly', async () => {
|
|
38
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
39
|
+
await expect(
|
|
40
|
+
modernTreasury.transactions.update('string', { metadata: {} }, { path: '/_stainless_unknown_path' }),
|
|
41
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('list: only required params', async () => {
|
|
45
|
+
const response = await modernTreasury.transactions.list();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('list: required and optional params', async () => {
|
|
49
|
+
const response = await modernTreasury.transactions.list({
|
|
50
|
+
after_cursor: 'string',
|
|
51
|
+
per_page: 0,
|
|
52
|
+
internal_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
53
|
+
virtual_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
54
|
+
posted: true,
|
|
55
|
+
as_of_date_start: '2019-12-27',
|
|
56
|
+
as_of_date_end: '2019-12-27',
|
|
57
|
+
direction: 'string',
|
|
58
|
+
counterparty_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
59
|
+
payment_type: 'string',
|
|
60
|
+
transactable_type: 'string',
|
|
61
|
+
description: 'string',
|
|
62
|
+
metadata: {},
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
67
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
68
|
+
await expect(modernTreasury.transactions.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
69
|
+
ModernTreasury.NotFoundError,
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('list: request options and params are passed correctly', async () => {
|
|
74
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
75
|
+
await expect(
|
|
76
|
+
modernTreasury.transactions.list(
|
|
77
|
+
{
|
|
78
|
+
after_cursor: 'string',
|
|
79
|
+
per_page: 0,
|
|
80
|
+
internal_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
81
|
+
virtual_account_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
82
|
+
posted: true,
|
|
83
|
+
as_of_date_start: '2019-12-27',
|
|
84
|
+
as_of_date_end: '2019-12-27',
|
|
85
|
+
direction: 'string',
|
|
86
|
+
counterparty_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
87
|
+
payment_type: 'string',
|
|
88
|
+
transactable_type: 'string',
|
|
89
|
+
description: 'string',
|
|
90
|
+
metadata: {},
|
|
91
|
+
},
|
|
92
|
+
{ path: '/_stainless_unknown_path' },
|
|
93
|
+
),
|
|
94
|
+
).rejects.toThrow(ModernTreasury.NotFoundError);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
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 validations', () => {
|
|
11
|
+
test('validate_routing_number: only required params', async () => {
|
|
12
|
+
const response = await modernTreasury.validations.validateRoutingNumber({
|
|
13
|
+
routing_number: 'string',
|
|
14
|
+
routing_number_type: 'aba',
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('validate_routing_number: required and optional params', async () => {
|
|
19
|
+
const response = await modernTreasury.validations.validateRoutingNumber({
|
|
20
|
+
routing_number: 'string',
|
|
21
|
+
routing_number_type: 'aba',
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|