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.
Files changed (169) hide show
  1. package/.eslintrc.js +10 -0
  2. package/.prettierrc +6 -0
  3. package/LICENSE +7 -0
  4. package/README.md +198 -0
  5. package/build +10 -0
  6. package/core.ts +746 -0
  7. package/dist/cjs/core.d.ts +215 -0
  8. package/dist/cjs/core.js +815 -0
  9. package/dist/cjs/core.js.map +1 -0
  10. package/dist/cjs/index.d.ts +118 -0
  11. package/dist/cjs/index.js +128 -0
  12. package/dist/cjs/index.js.map +1 -0
  13. package/dist/cjs/pagination.d.ts +14 -0
  14. package/dist/cjs/pagination.js +22 -0
  15. package/dist/cjs/pagination.js.map +1 -0
  16. package/dist/cjs/resource.d.ts +11 -0
  17. package/dist/cjs/resource.js +16 -0
  18. package/dist/cjs/resource.js.map +1 -0
  19. package/dist/cjs/resources/counterparties.d.ts +500 -0
  20. package/dist/cjs/resources/counterparties.js +57 -0
  21. package/dist/cjs/resources/counterparties.js.map +1 -0
  22. package/dist/cjs/resources/documents.d.ts +66 -0
  23. package/dist/cjs/resources/documents.js +23 -0
  24. package/dist/cjs/resources/documents.js.map +1 -0
  25. package/dist/cjs/resources/events.d.ts +53 -0
  26. package/dist/cjs/resources/events.js +22 -0
  27. package/dist/cjs/resources/events.js.map +1 -0
  28. package/dist/cjs/resources/expected-payments.d.ts +928 -0
  29. package/dist/cjs/resources/expected-payments.js +31 -0
  30. package/dist/cjs/resources/expected-payments.js.map +1 -0
  31. package/dist/cjs/resources/external-accounts.d.ts +597 -0
  32. package/dist/cjs/resources/external-accounts.js +51 -0
  33. package/dist/cjs/resources/external-accounts.js.map +1 -0
  34. package/dist/cjs/resources/incoming-payment-details.d.ts +487 -0
  35. package/dist/cjs/resources/incoming-payment-details.js +35 -0
  36. package/dist/cjs/resources/incoming-payment-details.js.map +1 -0
  37. package/dist/cjs/resources/index.d.ts +15 -0
  38. package/dist/cjs/resources/index.js +46 -0
  39. package/dist/cjs/resources/index.js.map +1 -0
  40. package/dist/cjs/resources/internal-accounts.d.ts +666 -0
  41. package/dist/cjs/resources/internal-accounts.js +31 -0
  42. package/dist/cjs/resources/internal-accounts.js.map +1 -0
  43. package/dist/cjs/resources/line-items.d.ts +90 -0
  44. package/dist/cjs/resources/line-items.js +38 -0
  45. package/dist/cjs/resources/line-items.js.map +1 -0
  46. package/dist/cjs/resources/paper-items.d.ts +279 -0
  47. package/dist/cjs/resources/paper-items.js +25 -0
  48. package/dist/cjs/resources/paper-items.js.map +1 -0
  49. package/dist/cjs/resources/payment-orders/index.d.ts +2 -0
  50. package/dist/cjs/resources/payment-orders/index.js +33 -0
  51. package/dist/cjs/resources/payment-orders/index.js.map +1 -0
  52. package/dist/cjs/resources/payment-orders/payment-orders.d.ts +2180 -0
  53. package/dist/cjs/resources/payment-orders/payment-orders.js +56 -0
  54. package/dist/cjs/resources/payment-orders/payment-orders.js.map +1 -0
  55. package/dist/cjs/resources/payment-orders/reversals.d.ts +46 -0
  56. package/dist/cjs/resources/payment-orders/reversals.js +23 -0
  57. package/dist/cjs/resources/payment-orders/reversals.js.map +1 -0
  58. package/dist/cjs/resources/returns.d.ts +487 -0
  59. package/dist/cjs/resources/returns.js +31 -0
  60. package/dist/cjs/resources/returns.js.map +1 -0
  61. package/dist/cjs/resources/top-level.d.ts +3 -0
  62. package/dist/cjs/resources/top-level.js +4 -0
  63. package/dist/cjs/resources/top-level.js.map +1 -0
  64. package/dist/cjs/resources/transactions.d.ts +377 -0
  65. package/dist/cjs/resources/transactions.js +31 -0
  66. package/dist/cjs/resources/transactions.js.map +1 -0
  67. package/dist/cjs/resources/validations.d.ts +97 -0
  68. package/dist/cjs/resources/validations.js +16 -0
  69. package/dist/cjs/resources/validations.js.map +1 -0
  70. package/dist/cjs/resources/webhooks.d.ts +31 -0
  71. package/dist/cjs/resources/webhooks.js +44 -0
  72. package/dist/cjs/resources/webhooks.js.map +1 -0
  73. package/dist/cjs/tests/api-resources/counterparties.test.d.ts +1 -0
  74. package/dist/cjs/tests/api-resources/counterparties.test.js +275 -0
  75. package/dist/cjs/tests/api-resources/counterparties.test.js.map +1 -0
  76. package/dist/cjs/tests/api-resources/documents.test.d.ts +1 -0
  77. package/dist/cjs/tests/api-resources/documents.test.js +78 -0
  78. package/dist/cjs/tests/api-resources/documents.test.js.map +1 -0
  79. package/dist/cjs/tests/api-resources/events.test.d.ts +1 -0
  80. package/dist/cjs/tests/api-resources/events.test.js +100 -0
  81. package/dist/cjs/tests/api-resources/events.test.js.map +1 -0
  82. package/dist/cjs/tests/api-resources/expected-payments.test.d.ts +1 -0
  83. package/dist/cjs/tests/api-resources/expected-payments.test.js +176 -0
  84. package/dist/cjs/tests/api-resources/expected-payments.test.js.map +1 -0
  85. package/dist/cjs/tests/api-resources/external-accounts.test.d.ts +1 -0
  86. package/dist/cjs/tests/api-resources/external-accounts.test.js +248 -0
  87. package/dist/cjs/tests/api-resources/external-accounts.test.js.map +1 -0
  88. package/dist/cjs/tests/api-resources/incoming-payment-details.test.d.ts +1 -0
  89. package/dist/cjs/tests/api-resources/incoming-payment-details.test.js +130 -0
  90. package/dist/cjs/tests/api-resources/incoming-payment-details.test.js.map +1 -0
  91. package/dist/cjs/tests/api-resources/internal-accounts.test.d.ts +1 -0
  92. package/dist/cjs/tests/api-resources/internal-accounts.test.js +144 -0
  93. package/dist/cjs/tests/api-resources/internal-accounts.test.js.map +1 -0
  94. package/dist/cjs/tests/api-resources/line-items.test.d.ts +1 -0
  95. package/dist/cjs/tests/api-resources/line-items.test.js +123 -0
  96. package/dist/cjs/tests/api-resources/line-items.test.js.map +1 -0
  97. package/dist/cjs/tests/api-resources/paper-items.test.d.ts +1 -0
  98. package/dist/cjs/tests/api-resources/paper-items.test.js +96 -0
  99. package/dist/cjs/tests/api-resources/paper-items.test.js.map +1 -0
  100. package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.d.ts +1 -0
  101. package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js +77 -0
  102. package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js.map +1 -0
  103. package/dist/cjs/tests/api-resources/returns.test.d.ts +1 -0
  104. package/dist/cjs/tests/api-resources/returns.test.js +116 -0
  105. package/dist/cjs/tests/api-resources/returns.test.js.map +1 -0
  106. package/dist/cjs/tests/api-resources/top-level.test.d.ts +1 -0
  107. package/dist/cjs/tests/api-resources/top-level.test.js +59 -0
  108. package/dist/cjs/tests/api-resources/top-level.test.js.map +1 -0
  109. package/dist/cjs/tests/api-resources/transactions.test.d.ts +1 -0
  110. package/dist/cjs/tests/api-resources/transactions.test.js +134 -0
  111. package/dist/cjs/tests/api-resources/transactions.test.js.map +1 -0
  112. package/dist/cjs/tests/api-resources/validations.test.d.ts +1 -0
  113. package/dist/cjs/tests/api-resources/validations.test.js +62 -0
  114. package/dist/cjs/tests/api-resources/validations.test.js.map +1 -0
  115. package/dist/cjs/tests/api-resources/webhooks.test.d.ts +1 -0
  116. package/dist/cjs/tests/api-resources/webhooks.test.js +100 -0
  117. package/dist/cjs/tests/api-resources/webhooks.test.js.map +1 -0
  118. package/dist/cjs/tests/form.test.d.ts +1 -0
  119. package/dist/cjs/tests/form.test.js +61 -0
  120. package/dist/cjs/tests/form.test.js.map +1 -0
  121. package/dist/cjs/tests/index.test.d.ts +1 -0
  122. package/dist/cjs/tests/index.test.js +57 -0
  123. package/dist/cjs/tests/index.test.js.map +1 -0
  124. package/dist/cjs/tests/responses.test.d.ts +1 -0
  125. package/dist/cjs/tests/responses.test.js +60 -0
  126. package/dist/cjs/tests/responses.test.js.map +1 -0
  127. package/index.ts +175 -0
  128. package/jest.config.js +8 -0
  129. package/package.json +47 -0
  130. package/pagination.ts +36 -0
  131. package/resource.ts +22 -0
  132. package/resources/counterparties.ts +666 -0
  133. package/resources/documents.ts +97 -0
  134. package/resources/events.ts +86 -0
  135. package/resources/expected-payments.ts +1016 -0
  136. package/resources/external-accounts.ts +762 -0
  137. package/resources/incoming-payment-details.ts +592 -0
  138. package/resources/index.ts +16 -0
  139. package/resources/internal-accounts.ts +774 -0
  140. package/resources/line-items.ts +138 -0
  141. package/resources/paper-items.ts +317 -0
  142. package/resources/payment-orders/index.ts +3 -0
  143. package/resources/payment-orders/payment-orders.ts +2486 -0
  144. package/resources/payment-orders/reversals.ts +72 -0
  145. package/resources/returns.ts +545 -0
  146. package/resources/top-level.ts +5 -0
  147. package/resources/transactions.ts +441 -0
  148. package/resources/validations.ts +115 -0
  149. package/resources/webhooks.ts +48 -0
  150. package/tests/api-resources/counterparties.test.ts +237 -0
  151. package/tests/api-resources/documents.test.ts +40 -0
  152. package/tests/api-resources/events.test.ts +62 -0
  153. package/tests/api-resources/expected-payments.test.ts +138 -0
  154. package/tests/api-resources/external-accounts.test.ts +210 -0
  155. package/tests/api-resources/incoming-payment-details.test.ts +92 -0
  156. package/tests/api-resources/internal-accounts.test.ts +103 -0
  157. package/tests/api-resources/line-items.test.ts +85 -0
  158. package/tests/api-resources/paper-items.test.ts +58 -0
  159. package/tests/api-resources/payment-orders/payment-orders.test.ts +39 -0
  160. package/tests/api-resources/returns.test.ts +78 -0
  161. package/tests/api-resources/top-level.test.ts +21 -0
  162. package/tests/api-resources/transactions.test.ts +96 -0
  163. package/tests/api-resources/validations.test.ts +24 -0
  164. package/tests/api-resources/webhooks.test.ts +102 -0
  165. package/tests/form.test.ts +27 -0
  166. package/tests/index.test.ts +62 -0
  167. package/tests/responses.test.ts +25 -0
  168. package/tsconfig.cjs.json +8 -0
  169. 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
+ });