modern-treasury 2.7.2 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +5 -8
  3. package/_shims/auto/types.d.ts +3 -1
  4. package/_shims/index.d.ts +2 -0
  5. package/_shims/node-runtime.d.ts.map +1 -1
  6. package/_shims/node-runtime.js +3 -0
  7. package/_shims/node-runtime.js.map +1 -1
  8. package/_shims/node-runtime.mjs +2 -0
  9. package/_shims/node-runtime.mjs.map +1 -1
  10. package/_shims/node-types.d.ts +1 -1
  11. package/_shims/registry.d.ts +2 -0
  12. package/_shims/registry.d.ts.map +1 -1
  13. package/_shims/registry.js +3 -1
  14. package/_shims/registry.js.map +1 -1
  15. package/_shims/registry.mjs +2 -0
  16. package/_shims/registry.mjs.map +1 -1
  17. package/_shims/web-runtime.d.ts.map +1 -1
  18. package/_shims/web-runtime.js +8 -0
  19. package/_shims/web-runtime.js.map +1 -1
  20. package/_shims/web-runtime.mjs +8 -0
  21. package/_shims/web-runtime.mjs.map +1 -1
  22. package/_shims/web-types.d.ts +2 -1
  23. package/core.d.ts +1 -1
  24. package/core.d.ts.map +1 -1
  25. package/core.js +38 -23
  26. package/core.js.map +1 -1
  27. package/core.mjs +36 -21
  28. package/core.mjs.map +1 -1
  29. package/error.d.ts.map +1 -1
  30. package/error.js +14 -4
  31. package/error.js.map +1 -1
  32. package/error.mjs +14 -4
  33. package/error.mjs.map +1 -1
  34. package/index.d.mts +20 -14
  35. package/index.d.ts +20 -14
  36. package/index.d.ts.map +1 -1
  37. package/index.js +6 -6
  38. package/index.js.map +1 -1
  39. package/index.mjs +6 -6
  40. package/index.mjs.map +1 -1
  41. package/package.json +3 -2
  42. package/resources/account-collection-flows.d.ts +9 -11
  43. package/resources/account-collection-flows.d.ts.map +1 -1
  44. package/resources/account-collection-flows.js +25 -0
  45. package/resources/account-collection-flows.js.map +1 -1
  46. package/resources/account-collection-flows.mjs +2 -0
  47. package/resources/account-collection-flows.mjs.map +1 -1
  48. package/resources/account-details.d.ts +6 -8
  49. package/resources/account-details.d.ts.map +1 -1
  50. package/resources/account-details.js +25 -0
  51. package/resources/account-details.js.map +1 -1
  52. package/resources/account-details.mjs +2 -0
  53. package/resources/account-details.mjs.map +1 -1
  54. package/resources/connections.d.ts +5 -7
  55. package/resources/connections.d.ts.map +1 -1
  56. package/resources/connections.js +25 -0
  57. package/resources/connections.js.map +1 -1
  58. package/resources/connections.mjs +2 -0
  59. package/resources/connections.mjs.map +1 -1
  60. package/resources/counterparties.d.ts +22 -23
  61. package/resources/counterparties.d.ts.map +1 -1
  62. package/resources/counterparties.js +25 -0
  63. package/resources/counterparties.js.map +1 -1
  64. package/resources/counterparties.mjs +2 -0
  65. package/resources/counterparties.mjs.map +1 -1
  66. package/resources/documents.d.ts +9 -11
  67. package/resources/documents.d.ts.map +1 -1
  68. package/resources/documents.js +25 -0
  69. package/resources/documents.js.map +1 -1
  70. package/resources/documents.mjs +2 -0
  71. package/resources/documents.mjs.map +1 -1
  72. package/resources/events.d.ts +5 -7
  73. package/resources/events.d.ts.map +1 -1
  74. package/resources/events.js +25 -0
  75. package/resources/events.js.map +1 -1
  76. package/resources/events.mjs +2 -0
  77. package/resources/events.mjs.map +1 -1
  78. package/resources/expected-payments.d.ts +26 -16
  79. package/resources/expected-payments.d.ts.map +1 -1
  80. package/resources/expected-payments.js +25 -0
  81. package/resources/expected-payments.js.map +1 -1
  82. package/resources/expected-payments.mjs +2 -0
  83. package/resources/expected-payments.mjs.map +1 -1
  84. package/resources/external-accounts.d.ts +18 -20
  85. package/resources/external-accounts.d.ts.map +1 -1
  86. package/resources/external-accounts.js +25 -0
  87. package/resources/external-accounts.js.map +1 -1
  88. package/resources/external-accounts.mjs +2 -0
  89. package/resources/external-accounts.mjs.map +1 -1
  90. package/resources/incoming-payment-details.d.ts +12 -14
  91. package/resources/incoming-payment-details.d.ts.map +1 -1
  92. package/resources/incoming-payment-details.js +25 -0
  93. package/resources/incoming-payment-details.js.map +1 -1
  94. package/resources/incoming-payment-details.mjs +2 -0
  95. package/resources/incoming-payment-details.mjs.map +1 -1
  96. package/resources/index.d.ts +1 -1
  97. package/resources/index.d.ts.map +1 -1
  98. package/resources/index.js +2 -2
  99. package/resources/index.js.map +1 -1
  100. package/resources/index.mjs +1 -1
  101. package/resources/index.mjs.map +1 -1
  102. package/resources/internal-accounts/balance-reports.d.ts +5 -7
  103. package/resources/internal-accounts/balance-reports.d.ts.map +1 -1
  104. package/resources/internal-accounts/balance-reports.js +25 -0
  105. package/resources/internal-accounts/balance-reports.js.map +1 -1
  106. package/resources/internal-accounts/balance-reports.mjs +2 -0
  107. package/resources/internal-accounts/balance-reports.mjs.map +1 -1
  108. package/resources/internal-accounts/internal-accounts.d.ts +25 -23
  109. package/resources/internal-accounts/internal-accounts.d.ts.map +1 -1
  110. package/resources/internal-accounts/internal-accounts.js +6 -5
  111. package/resources/internal-accounts/internal-accounts.js.map +1 -1
  112. package/resources/internal-accounts/internal-accounts.mjs +6 -5
  113. package/resources/internal-accounts/internal-accounts.mjs.map +1 -1
  114. package/resources/invoices/invoices.d.ts +39 -26
  115. package/resources/invoices/invoices.d.ts.map +1 -1
  116. package/resources/invoices/invoices.js +6 -5
  117. package/resources/invoices/invoices.js.map +1 -1
  118. package/resources/invoices/invoices.mjs +6 -5
  119. package/resources/invoices/invoices.mjs.map +1 -1
  120. package/resources/invoices/line-items.d.ts +7 -9
  121. package/resources/invoices/line-items.d.ts.map +1 -1
  122. package/resources/invoices/line-items.js +25 -0
  123. package/resources/invoices/line-items.js.map +1 -1
  124. package/resources/invoices/line-items.mjs +2 -0
  125. package/resources/invoices/line-items.mjs.map +1 -1
  126. package/resources/ledger-account-balance-monitors.d.ts +7 -9
  127. package/resources/ledger-account-balance-monitors.d.ts.map +1 -1
  128. package/resources/ledger-account-balance-monitors.js +25 -0
  129. package/resources/ledger-account-balance-monitors.js.map +1 -1
  130. package/resources/ledger-account-balance-monitors.mjs +2 -0
  131. package/resources/ledger-account-balance-monitors.mjs.map +1 -1
  132. package/resources/ledger-account-categories.d.ts +11 -12
  133. package/resources/ledger-account-categories.d.ts.map +1 -1
  134. package/resources/ledger-account-categories.js +25 -0
  135. package/resources/ledger-account-categories.js.map +1 -1
  136. package/resources/ledger-account-categories.mjs +2 -0
  137. package/resources/ledger-account-categories.mjs.map +1 -1
  138. package/resources/ledger-account-payouts.d.ts +17 -9
  139. package/resources/ledger-account-payouts.d.ts.map +1 -1
  140. package/resources/ledger-account-payouts.js +25 -0
  141. package/resources/ledger-account-payouts.js.map +1 -1
  142. package/resources/ledger-account-payouts.mjs +2 -0
  143. package/resources/ledger-account-payouts.mjs.map +1 -1
  144. package/resources/ledger-account-statements.d.ts +7 -6
  145. package/resources/ledger-account-statements.d.ts.map +1 -1
  146. package/resources/ledger-account-statements.js.map +1 -1
  147. package/resources/ledger-account-statements.mjs.map +1 -1
  148. package/resources/ledger-accounts.d.ts +11 -12
  149. package/resources/ledger-accounts.d.ts.map +1 -1
  150. package/resources/ledger-accounts.js +25 -0
  151. package/resources/ledger-accounts.js.map +1 -1
  152. package/resources/ledger-accounts.mjs +2 -0
  153. package/resources/ledger-accounts.mjs.map +1 -1
  154. package/resources/ledger-entries.d.ts +9 -10
  155. package/resources/ledger-entries.d.ts.map +1 -1
  156. package/resources/ledger-entries.js +25 -0
  157. package/resources/ledger-entries.js.map +1 -1
  158. package/resources/ledger-entries.mjs +2 -0
  159. package/resources/ledger-entries.mjs.map +1 -1
  160. package/resources/ledger-event-handlers.d.ts +47 -270
  161. package/resources/ledger-event-handlers.d.ts.map +1 -1
  162. package/resources/ledger-event-handlers.js +29 -7
  163. package/resources/ledger-event-handlers.js.map +1 -1
  164. package/resources/ledger-event-handlers.mjs +4 -5
  165. package/resources/ledger-event-handlers.mjs.map +1 -1
  166. package/resources/ledger-transactions/ledger-transactions.d.ts +19 -20
  167. package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
  168. package/resources/ledger-transactions/ledger-transactions.js +6 -5
  169. package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
  170. package/resources/ledger-transactions/ledger-transactions.mjs +6 -5
  171. package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
  172. package/resources/ledger-transactions/versions.d.ts +7 -8
  173. package/resources/ledger-transactions/versions.d.ts.map +1 -1
  174. package/resources/ledger-transactions/versions.js +25 -0
  175. package/resources/ledger-transactions/versions.js.map +1 -1
  176. package/resources/ledger-transactions/versions.mjs +2 -0
  177. package/resources/ledger-transactions/versions.mjs.map +1 -1
  178. package/resources/ledgerable-events.d.ts +4 -41
  179. package/resources/ledgerable-events.d.ts.map +1 -1
  180. package/resources/ledgerable-events.js +1 -2
  181. package/resources/ledgerable-events.js.map +1 -1
  182. package/resources/ledgerable-events.mjs +1 -2
  183. package/resources/ledgerable-events.mjs.map +1 -1
  184. package/resources/ledgers.d.ts +7 -9
  185. package/resources/ledgers.d.ts.map +1 -1
  186. package/resources/ledgers.js +25 -0
  187. package/resources/ledgers.js.map +1 -1
  188. package/resources/ledgers.mjs +2 -0
  189. package/resources/ledgers.mjs.map +1 -1
  190. package/resources/line-items.d.ts +6 -8
  191. package/resources/line-items.d.ts.map +1 -1
  192. package/resources/line-items.js +25 -0
  193. package/resources/line-items.js.map +1 -1
  194. package/resources/line-items.mjs +2 -0
  195. package/resources/line-items.mjs.map +1 -1
  196. package/resources/paper-items.d.ts +5 -7
  197. package/resources/paper-items.d.ts.map +1 -1
  198. package/resources/paper-items.js +25 -0
  199. package/resources/paper-items.js.map +1 -1
  200. package/resources/paper-items.mjs +2 -0
  201. package/resources/paper-items.mjs.map +1 -1
  202. package/resources/payment-flows.d.ts +7 -9
  203. package/resources/payment-flows.d.ts.map +1 -1
  204. package/resources/payment-flows.js +25 -0
  205. package/resources/payment-flows.js.map +1 -1
  206. package/resources/payment-flows.mjs +2 -0
  207. package/resources/payment-flows.mjs.map +1 -1
  208. package/resources/payment-orders/payment-orders.d.ts +75 -50
  209. package/resources/payment-orders/payment-orders.d.ts.map +1 -1
  210. package/resources/payment-orders/payment-orders.js +6 -5
  211. package/resources/payment-orders/payment-orders.js.map +1 -1
  212. package/resources/payment-orders/payment-orders.mjs +6 -5
  213. package/resources/payment-orders/payment-orders.mjs.map +1 -1
  214. package/resources/payment-orders/reversals.d.ts +8 -9
  215. package/resources/payment-orders/reversals.d.ts.map +1 -1
  216. package/resources/payment-orders/reversals.js +25 -0
  217. package/resources/payment-orders/reversals.js.map +1 -1
  218. package/resources/payment-orders/reversals.mjs +2 -0
  219. package/resources/payment-orders/reversals.mjs.map +1 -1
  220. package/resources/payment-references.d.ts +5 -7
  221. package/resources/payment-references.d.ts.map +1 -1
  222. package/resources/payment-references.js +25 -0
  223. package/resources/payment-references.js.map +1 -1
  224. package/resources/payment-references.mjs +2 -0
  225. package/resources/payment-references.mjs.map +1 -1
  226. package/resources/returns.d.ts +11 -13
  227. package/resources/returns.d.ts.map +1 -1
  228. package/resources/returns.js +25 -0
  229. package/resources/returns.js.map +1 -1
  230. package/resources/returns.mjs +2 -0
  231. package/resources/returns.mjs.map +1 -1
  232. package/resources/routing-details.d.ts +16 -14
  233. package/resources/routing-details.d.ts.map +1 -1
  234. package/resources/routing-details.js +25 -0
  235. package/resources/routing-details.js.map +1 -1
  236. package/resources/routing-details.mjs +2 -0
  237. package/resources/routing-details.mjs.map +1 -1
  238. package/resources/shared.d.ts +1 -0
  239. package/resources/shared.d.ts.map +1 -1
  240. package/resources/top-level.d.ts +2 -2
  241. package/resources/top-level.d.ts.map +1 -1
  242. package/resources/transactions/line-items.d.ts +10 -7
  243. package/resources/transactions/line-items.d.ts.map +1 -1
  244. package/resources/transactions/line-items.js +25 -0
  245. package/resources/transactions/line-items.js.map +1 -1
  246. package/resources/transactions/line-items.mjs +2 -0
  247. package/resources/transactions/line-items.mjs.map +1 -1
  248. package/resources/transactions/transactions.d.ts +28 -30
  249. package/resources/transactions/transactions.d.ts.map +1 -1
  250. package/resources/transactions/transactions.js +6 -5
  251. package/resources/transactions/transactions.js.map +1 -1
  252. package/resources/transactions/transactions.mjs +6 -5
  253. package/resources/transactions/transactions.mjs.map +1 -1
  254. package/resources/validations.d.ts +14 -14
  255. package/resources/validations.d.ts.map +1 -1
  256. package/resources/validations.js.map +1 -1
  257. package/resources/validations.mjs.map +1 -1
  258. package/resources/virtual-accounts.d.ts +16 -16
  259. package/resources/virtual-accounts.d.ts.map +1 -1
  260. package/resources/virtual-accounts.js +25 -0
  261. package/resources/virtual-accounts.js.map +1 -1
  262. package/resources/virtual-accounts.mjs +2 -0
  263. package/resources/virtual-accounts.mjs.map +1 -1
  264. package/resources/webhooks.d.ts.map +1 -1
  265. package/resources/webhooks.js +2 -2
  266. package/resources/webhooks.js.map +1 -1
  267. package/resources/webhooks.mjs +3 -3
  268. package/resources/webhooks.mjs.map +1 -1
  269. package/shims/node.d.ts +1 -1
  270. package/shims/node.d.ts.map +1 -1
  271. package/shims/web.d.ts +1 -1
  272. package/shims/web.d.ts.map +1 -1
  273. package/src/_shims/auto/types.d.ts +3 -1
  274. package/src/_shims/index.d.ts +3 -1
  275. package/src/_shims/index.mjs +1 -1
  276. package/src/_shims/node-runtime.ts +4 -0
  277. package/src/_shims/node-types.d.ts +1 -1
  278. package/src/_shims/registry.ts +3 -0
  279. package/src/_shims/web-runtime.ts +12 -0
  280. package/src/_shims/web-types.d.ts +2 -1
  281. package/src/core.ts +39 -21
  282. package/src/error.ts +15 -5
  283. package/src/index.ts +23 -17
  284. package/src/resources/account-collection-flows.ts +12 -12
  285. package/src/resources/account-details.ts +10 -12
  286. package/src/resources/connections.ts +8 -10
  287. package/src/resources/counterparties.ts +32 -26
  288. package/src/resources/documents.ts +13 -12
  289. package/src/resources/events.ts +8 -10
  290. package/src/resources/expected-payments.ts +37 -18
  291. package/src/resources/external-accounts.ts +30 -24
  292. package/src/resources/incoming-payment-details.ts +17 -17
  293. package/src/resources/index.ts +3 -5
  294. package/src/resources/internal-accounts/balance-reports.ts +9 -11
  295. package/src/resources/internal-accounts/internal-accounts.ts +32 -27
  296. package/src/resources/invoices/invoices.ts +56 -35
  297. package/src/resources/invoices/line-items.ts +10 -12
  298. package/src/resources/ledger-account-balance-monitors.ts +10 -12
  299. package/src/resources/ledger-account-categories.ts +14 -15
  300. package/src/resources/ledger-account-payouts.ts +23 -12
  301. package/src/resources/ledger-account-statements.ts +9 -8
  302. package/src/resources/ledger-accounts.ts +14 -15
  303. package/src/resources/ledger-entries.ts +12 -13
  304. package/src/resources/ledger-event-handlers.ts +53 -336
  305. package/src/resources/ledger-transactions/ledger-transactions.ts +22 -24
  306. package/src/resources/ledger-transactions/versions.ts +10 -11
  307. package/src/resources/ledgerable-events.ts +6 -51
  308. package/src/resources/ledgers.ts +10 -12
  309. package/src/resources/line-items.ts +9 -11
  310. package/src/resources/paper-items.ts +9 -11
  311. package/src/resources/payment-flows.ts +10 -12
  312. package/src/resources/payment-orders/payment-orders.ts +110 -56
  313. package/src/resources/payment-orders/reversals.ts +11 -12
  314. package/src/resources/payment-references.ts +8 -10
  315. package/src/resources/returns.ts +16 -18
  316. package/src/resources/routing-details.ts +26 -14
  317. package/src/resources/shared.ts +2 -0
  318. package/src/resources/top-level.ts +2 -2
  319. package/src/resources/transactions/line-items.ts +14 -10
  320. package/src/resources/transactions/transactions.ts +35 -35
  321. package/src/resources/validations.ts +19 -13
  322. package/src/resources/virtual-accounts.ts +22 -17
  323. package/src/resources/webhooks.ts +6 -5
  324. package/src/shims/node.ts +1 -1
  325. package/src/shims/web.ts +1 -1
  326. package/src/version.ts +1 -1
  327. package/version.d.ts +1 -1
  328. package/version.js +1 -1
  329. package/version.mjs +1 -1
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../treasury/core";
4
- import { APIResource } from "../treasury/resource";
5
- import { isRequestOptions } from "../treasury/core";
6
- import * as Shared from "../treasury/resources/shared";
7
- import * as API from './index';
8
- import { Page, PageParams } from "../treasury/pagination";
3
+ import * as Core from "../core";
4
+ import { APIResource } from "../resource";
5
+ import { isRequestOptions } from "../core";
6
+ import * as RoutingDetailsAPI from "./routing-details";
7
+ import * as Shared from "./shared";
8
+ import { Page, type PageParams } from "../pagination";
9
9
 
10
10
  export class RoutingDetails extends APIResource {
11
11
  /**
@@ -89,8 +89,6 @@ export class RoutingDetails extends APIResource {
89
89
  }
90
90
 
91
91
  export class RoutingDetailsPage extends Page<RoutingDetail> {}
92
- // alias so we can export it in the namespace
93
- type _RoutingDetailsPage = RoutingDetailsPage;
94
92
 
95
93
  export interface RoutingDetail {
96
94
  id: string;
@@ -124,6 +122,7 @@ export interface RoutingDetail {
124
122
  | 'bacs'
125
123
  | 'book'
126
124
  | 'card'
125
+ | 'chats'
127
126
  | 'check'
128
127
  | 'cross_border'
129
128
  | 'eft'
@@ -131,11 +130,13 @@ export interface RoutingDetail {
131
130
  | 'masav'
132
131
  | 'neft'
133
132
  | 'nics'
133
+ | 'nz_becs'
134
134
  | 'provxchange'
135
135
  | 'rtp'
136
136
  | 'se_bankgirot'
137
137
  | 'sen'
138
138
  | 'sepa'
139
+ | 'sg_giro'
139
140
  | 'sic'
140
141
  | 'signet'
141
142
  | 'wire'
@@ -148,7 +149,9 @@ export interface RoutingDetail {
148
149
  routing_number: string;
149
150
 
150
151
  /**
151
- * One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`.
152
+ * The type of routing number. See
153
+ * https://docs.moderntreasury.com/platform/reference/routing-detail-object for
154
+ * more details.
152
155
  */
153
156
  routing_number_type:
154
157
  | 'aba'
@@ -158,9 +161,11 @@ export interface RoutingDetail {
158
161
  | 'chips'
159
162
  | 'cnaps'
160
163
  | 'gb_sort_code'
164
+ | 'hk_interbank_clearing_code'
161
165
  | 'in_ifsc'
162
166
  | 'jp_zengin_code'
163
167
  | 'my_branch_code'
168
+ | 'nz_national_clearing_code'
164
169
  | 'se_bankgiro_clearing_code'
165
170
  | 'swift';
166
171
 
@@ -216,7 +221,9 @@ export interface RoutingDetailCreateParams {
216
221
  routing_number: string;
217
222
 
218
223
  /**
219
- * One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`.
224
+ * The type of routing number. See
225
+ * https://docs.moderntreasury.com/platform/reference/routing-detail-object for
226
+ * more details.
220
227
  */
221
228
  routing_number_type:
222
229
  | 'aba'
@@ -226,9 +233,11 @@ export interface RoutingDetailCreateParams {
226
233
  | 'chips'
227
234
  | 'cnaps'
228
235
  | 'gb_sort_code'
236
+ | 'hk_interbank_clearing_code'
229
237
  | 'in_ifsc'
230
238
  | 'jp_zengin_code'
231
239
  | 'my_branch_code'
240
+ | 'nz_national_clearing_code'
232
241
  | 'se_bankgiro_clearing_code'
233
242
  | 'swift';
234
243
 
@@ -242,6 +251,7 @@ export interface RoutingDetailCreateParams {
242
251
  | 'bacs'
243
252
  | 'book'
244
253
  | 'card'
254
+ | 'chats'
245
255
  | 'check'
246
256
  | 'cross_border'
247
257
  | 'eft'
@@ -249,11 +259,13 @@ export interface RoutingDetailCreateParams {
249
259
  | 'masav'
250
260
  | 'neft'
251
261
  | 'nics'
262
+ | 'nz_becs'
252
263
  | 'provxchange'
253
264
  | 'rtp'
254
265
  | 'se_bankgirot'
255
266
  | 'sen'
256
267
  | 'sepa'
268
+ | 'sg_giro'
257
269
  | 'sic'
258
270
  | 'signet'
259
271
  | 'wire'
@@ -264,8 +276,8 @@ export interface RoutingDetailCreateParams {
264
276
  export interface RoutingDetailListParams extends PageParams {}
265
277
 
266
278
  export namespace RoutingDetails {
267
- export import RoutingDetail = API.RoutingDetail;
268
- export type RoutingDetailsPage = _RoutingDetailsPage;
269
- export import RoutingDetailCreateParams = API.RoutingDetailCreateParams;
270
- export import RoutingDetailListParams = API.RoutingDetailListParams;
279
+ export import RoutingDetail = RoutingDetailsAPI.RoutingDetail;
280
+ export import RoutingDetailsPage = RoutingDetailsAPI.RoutingDetailsPage;
281
+ export import RoutingDetailCreateParams = RoutingDetailsAPI.RoutingDetailCreateParams;
282
+ export import RoutingDetailListParams = RoutingDetailsAPI.RoutingDetailListParams;
271
283
  }
@@ -202,3 +202,5 @@ export type Currency =
202
202
  | 'ZWN'
203
203
  | 'ZWR'
204
204
  | null;
205
+
206
+ export type TransactionDirection = 'credit' | 'debit';
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as API from './index';
3
+ import * as TopLevelAPI from "./top-level";
4
4
 
5
5
  export interface PingResponse {
6
6
  ping: string;
7
7
  }
8
8
 
9
9
  export namespace TopLevel {
10
- export import PingResponse = API.PingResponse;
10
+ export import PingResponse = TopLevelAPI.PingResponse;
11
11
  }
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../../treasury/core";
4
- import { APIResource } from "../../treasury/resource";
5
- import { isRequestOptions } from "../../treasury/core";
6
- import * as API from './index';
7
- import { Page, PageParams } from "../../treasury/pagination";
3
+ import * as Core from "../../core";
4
+ import { APIResource } from "../../resource";
5
+ import { isRequestOptions } from "../../core";
6
+ import * as LineItemsAPI from "./line-items";
7
+ import { Page, type PageParams } from "../../pagination";
8
8
 
9
9
  export class LineItems extends APIResource {
10
10
  /**
@@ -34,8 +34,6 @@ export class LineItems extends APIResource {
34
34
  }
35
35
 
36
36
  export class TransactionLineItemsPage extends Page<TransactionLineItem> {}
37
- // alias so we can export it in the namespace
38
- type _TransactionLineItemsPage = TransactionLineItemsPage;
39
37
 
40
38
  export interface TransactionLineItem {
41
39
  id: string;
@@ -77,6 +75,12 @@ export interface TransactionLineItem {
77
75
 
78
76
  object: string;
79
77
 
78
+ /**
79
+ * Describes whether this line item should be counted towards the corresponding
80
+ * transaction’s reconciliation.
81
+ */
82
+ reconcilable: boolean;
83
+
80
84
  /**
81
85
  * If a matching object exists in Modern Treasury, the ID will be populated here,
82
86
  * otherwise `null`.
@@ -119,7 +123,7 @@ export interface LineItemListParams extends PageParams {
119
123
  }
120
124
 
121
125
  export namespace LineItems {
122
- export import TransactionLineItem = API.TransactionLineItem;
123
- export type TransactionLineItemsPage = _TransactionLineItemsPage;
124
- export import LineItemListParams = API.LineItemListParams;
126
+ export import TransactionLineItem = LineItemsAPI.TransactionLineItem;
127
+ export import TransactionLineItemsPage = LineItemsAPI.TransactionLineItemsPage;
128
+ export import LineItemListParams = LineItemsAPI.LineItemListParams;
125
129
  }
@@ -1,15 +1,15 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../../treasury/core";
4
- import { APIResource } from "../../treasury/resource";
5
- import { isRequestOptions } from "../../treasury/core";
6
- import * as Shared from "../../treasury/resources/shared";
7
- import { LineItems } from './line-items';
8
- import * as API from './index';
9
- import { Page, PageParams } from "../../treasury/pagination";
3
+ import * as Core from "../../core";
4
+ import { APIResource } from "../../resource";
5
+ import { isRequestOptions } from "../../core";
6
+ import * as TransactionsAPI from "./transactions";
7
+ import * as Shared from "../shared";
8
+ import * as LineItemsAPI from "./line-items";
9
+ import { Page, type PageParams } from "../../pagination";
10
10
 
11
11
  export class Transactions extends APIResource {
12
- lineItems: LineItems = new LineItems(this.client);
12
+ lineItems: LineItemsAPI.LineItems = new LineItemsAPI.LineItems(this.client);
13
13
 
14
14
  /**
15
15
  * Get details on a single transaction.
@@ -58,8 +58,6 @@ export class Transactions extends APIResource {
58
58
  }
59
59
 
60
60
  export class TransactionsPage extends Page<Transaction> {}
61
- // alias so we can export it in the namespace
62
- type _TransactionsPage = TransactionsPage;
63
61
 
64
62
  export interface Transaction {
65
63
  id: string;
@@ -88,17 +86,6 @@ export interface Transaction {
88
86
  */
89
87
  currency: Shared.Currency | null;
90
88
 
91
- /**
92
- * This field contains additional information that the bank provided about the
93
- * transaction. This is structured data. Some of the data in here might overlap
94
- * with what is in the `vendor_description`. For example, the OBI could be a part
95
- * of the vendor description, and it would also be included in here. The attributes
96
- * that are passed through the details field will vary based on your banking
97
- * partner. Currently, the following keys may be in the details object:
98
- * `originator_name`, `originator_to_beneficiary_information`.
99
- */
100
- details: Record<string, string>;
101
-
102
89
  /**
103
90
  * Either `credit` or `debit`.
104
91
  */
@@ -147,6 +134,7 @@ export interface Transaction {
147
134
  | 'bacs'
148
135
  | 'book'
149
136
  | 'card'
137
+ | 'chats'
150
138
  | 'check'
151
139
  | 'cross_border'
152
140
  | 'eft'
@@ -154,11 +142,13 @@ export interface Transaction {
154
142
  | 'masav'
155
143
  | 'neft'
156
144
  | 'nics'
145
+ | 'nz_becs'
157
146
  | 'provxchange'
158
147
  | 'rtp'
159
148
  | 'se_bankgirot'
160
149
  | 'sen'
161
150
  | 'sepa'
151
+ | 'sg_giro'
162
152
  | 'sic'
163
153
  | 'signet'
164
154
  | 'wire'
@@ -207,15 +197,26 @@ export interface Transaction {
207
197
  vendor_customer_id: string | null;
208
198
 
209
199
  /**
210
- * The transaction detail text that often appears in on your bank statement and in
211
- * your banking portal.
200
+ * An identifier given to this transaction by the bank.
201
+ */
202
+ vendor_id: string | null;
203
+
204
+ /**
205
+ * This field contains additional information that the bank provided about the
206
+ * transaction. This is structured data. Some of the data in here might overlap
207
+ * with what is in the `vendor_description`. For example, the OBI could be a part
208
+ * of the vendor description, and it would also be included in here. The attributes
209
+ * that are passed through the details field will vary based on your banking
210
+ * partner. Currently, the following keys may be in the details object:
211
+ * `originator_name`, `originator_to_beneficiary_information`.
212
212
  */
213
- vendor_description: string | null;
213
+ details?: Record<string, string>;
214
214
 
215
215
  /**
216
- * An identifier given to this transaction by the bank.
216
+ * The transaction detail text that often appears in on your bank statement and in
217
+ * your banking portal.
217
218
  */
218
- vendor_id: string | null;
219
+ vendor_description?: string | null;
219
220
  }
220
221
 
221
222
  export interface TransactionUpdateParams {
@@ -280,13 +281,12 @@ export interface TransactionListParams extends PageParams {
280
281
  }
281
282
 
282
283
  export namespace Transactions {
283
- export import Transaction = API.Transaction;
284
- export type TransactionsPage = _TransactionsPage;
285
- export import TransactionUpdateParams = API.TransactionUpdateParams;
286
- export import TransactionListParams = API.TransactionListParams;
287
-
288
- export import LineItems = API.LineItems;
289
- export import TransactionLineItem = API.TransactionLineItem;
290
- export import TransactionLineItemsPage = API.TransactionLineItemsPage;
291
- export import LineItemListParams = API.LineItemListParams;
284
+ export import Transaction = TransactionsAPI.Transaction;
285
+ export import TransactionsPage = TransactionsAPI.TransactionsPage;
286
+ export import TransactionUpdateParams = TransactionsAPI.TransactionUpdateParams;
287
+ export import TransactionListParams = TransactionsAPI.TransactionListParams;
288
+ export import LineItems = LineItemsAPI.LineItems;
289
+ export import TransactionLineItem = LineItemsAPI.TransactionLineItem;
290
+ export import TransactionLineItemsPage = LineItemsAPI.TransactionLineItemsPage;
291
+ export import LineItemListParams = LineItemsAPI.LineItemListParams;
292
292
  }
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../treasury/core";
4
- import { APIResource } from "../treasury/resource";
5
- import * as API from './index';
3
+ import * as Core from "../core";
4
+ import { APIResource } from "../resource";
5
+ import * as ValidationsAPI from "./validations";
6
6
 
7
7
  export class Validations extends APIResource {
8
8
  /**
@@ -34,10 +34,10 @@ export interface RoutingNumberLookupRequest {
34
34
  routing_number?: string;
35
35
 
36
36
  /**
37
- * One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`,
38
- * `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox
39
- * mode we currently only support `aba` and `swift` with routing numbers
40
- * '123456789' and 'GRINUST0XXX' respectively.
37
+ * The type of routing number. See
38
+ * https://docs.moderntreasury.com/platform/reference/routing-detail-object for
39
+ * more details. In sandbox mode we currently only support `aba` and `swift` with
40
+ * routing numbers '123456789' and 'GRINUST0XXX' respectively.
41
41
  */
42
42
  routing_number_type?:
43
43
  | 'aba'
@@ -45,6 +45,7 @@ export interface RoutingNumberLookupRequest {
45
45
  | 'ca_cpa'
46
46
  | 'gb_sort_code'
47
47
  | 'in_ifsc'
48
+ | 'nz_national_clearing_code'
48
49
  | 'se_bankgiro_clearing_code'
49
50
  | 'swift';
50
51
 
@@ -65,6 +66,7 @@ export interface RoutingNumberLookupRequest {
65
66
  | 'bacs'
66
67
  | 'book'
67
68
  | 'card'
69
+ | 'chats'
68
70
  | 'check'
69
71
  | 'cross_border'
70
72
  | 'eft'
@@ -72,11 +74,13 @@ export interface RoutingNumberLookupRequest {
72
74
  | 'masav'
73
75
  | 'neft'
74
76
  | 'nics'
77
+ | 'nz_becs'
75
78
  | 'provxchange'
76
79
  | 'rtp'
77
80
  | 'se_bankgirot'
78
81
  | 'sen'
79
82
  | 'sepa'
83
+ | 'sg_giro'
80
84
  | 'sic'
81
85
  | 'signet'
82
86
  | 'wire'
@@ -122,10 +126,10 @@ export interface ValidationValidateRoutingNumberParams {
122
126
  routing_number: string;
123
127
 
124
128
  /**
125
- * One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`,
126
- * `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox
127
- * mode we currently only support `aba` and `swift` with routing numbers
128
- * '123456789' and 'GRINUST0XXX' respectively.
129
+ * The type of routing number. See
130
+ * https://docs.moderntreasury.com/platform/reference/routing-detail-object for
131
+ * more details. In sandbox mode we currently only support `aba` and `swift` with
132
+ * routing numbers '123456789' and 'GRINUST0XXX' respectively.
129
133
  */
130
134
  routing_number_type:
131
135
  | 'aba'
@@ -135,14 +139,16 @@ export interface ValidationValidateRoutingNumberParams {
135
139
  | 'chips'
136
140
  | 'cnaps'
137
141
  | 'gb_sort_code'
142
+ | 'hk_interbank_clearing_code'
138
143
  | 'in_ifsc'
139
144
  | 'jp_zengin_code'
140
145
  | 'my_branch_code'
146
+ | 'nz_national_clearing_code'
141
147
  | 'se_bankgiro_clearing_code'
142
148
  | 'swift';
143
149
  }
144
150
 
145
151
  export namespace Validations {
146
- export import RoutingNumberLookupRequest = API.RoutingNumberLookupRequest;
147
- export import ValidationValidateRoutingNumberParams = API.ValidationValidateRoutingNumberParams;
152
+ export import RoutingNumberLookupRequest = ValidationsAPI.RoutingNumberLookupRequest;
153
+ export import ValidationValidateRoutingNumberParams = ValidationsAPI.ValidationValidateRoutingNumberParams;
148
154
  }
@@ -1,12 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../treasury/core";
4
- import { APIResource } from "../treasury/resource";
5
- import { isRequestOptions } from "../treasury/core";
6
- import * as AccountDetails from "../treasury/resources/account-details";
7
- import * as RoutingDetails from "../treasury/resources/routing-details";
8
- import * as API from './index';
9
- import { Page, PageParams } from "../treasury/pagination";
3
+ import * as Core from "../core";
4
+ import { APIResource } from "../resource";
5
+ import { isRequestOptions } from "../core";
6
+ import * as VirtualAccountsAPI from "./virtual-accounts";
7
+ import * as AccountDetailsAPI from "./account-details";
8
+ import * as RoutingDetailsAPI from "./routing-details";
9
+ import { Page, type PageParams } from "../pagination";
10
10
 
11
11
  export class VirtualAccounts extends APIResource {
12
12
  /**
@@ -81,8 +81,6 @@ export class VirtualAccounts extends APIResource {
81
81
  }
82
82
 
83
83
  export class VirtualAccountsPage extends Page<VirtualAccount> {}
84
- // alias so we can export it in the namespace
85
- type _VirtualAccountsPage = VirtualAccountsPage;
86
84
 
87
85
  export interface VirtualAccount {
88
86
  id: string;
@@ -90,7 +88,7 @@ export interface VirtualAccount {
90
88
  /**
91
89
  * An array of account detail objects.
92
90
  */
93
- account_details: Array<AccountDetails.AccountDetail>;
91
+ account_details: Array<AccountDetailsAPI.AccountDetail>;
94
92
 
95
93
  /**
96
94
  * The ID of a counterparty that the virtual account belongs to. Optional.
@@ -148,7 +146,7 @@ export interface VirtualAccount {
148
146
  * An array of routing detail objects. These will be the routing details of the
149
147
  * internal account.
150
148
  */
151
- routing_details: Array<RoutingDetails.RoutingDetail>;
149
+ routing_details: Array<RoutingDetailsAPI.RoutingDetail>;
152
150
 
153
151
  updated_at: string;
154
152
  }
@@ -226,7 +224,9 @@ export namespace VirtualAccountCreateParams {
226
224
  routing_number: string;
227
225
 
228
226
  /**
229
- * One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`.
227
+ * The type of routing number. See
228
+ * https://docs.moderntreasury.com/platform/reference/routing-detail-object for
229
+ * more details.
230
230
  */
231
231
  routing_number_type:
232
232
  | 'aba'
@@ -236,9 +236,11 @@ export namespace VirtualAccountCreateParams {
236
236
  | 'chips'
237
237
  | 'cnaps'
238
238
  | 'gb_sort_code'
239
+ | 'hk_interbank_clearing_code'
239
240
  | 'in_ifsc'
240
241
  | 'jp_zengin_code'
241
242
  | 'my_branch_code'
243
+ | 'nz_national_clearing_code'
242
244
  | 'se_bankgiro_clearing_code'
243
245
  | 'swift';
244
246
 
@@ -252,6 +254,7 @@ export namespace VirtualAccountCreateParams {
252
254
  | 'bacs'
253
255
  | 'book'
254
256
  | 'card'
257
+ | 'chats'
255
258
  | 'check'
256
259
  | 'cross_border'
257
260
  | 'eft'
@@ -259,11 +262,13 @@ export namespace VirtualAccountCreateParams {
259
262
  | 'masav'
260
263
  | 'neft'
261
264
  | 'nics'
265
+ | 'nz_becs'
262
266
  | 'provxchange'
263
267
  | 'rtp'
264
268
  | 'se_bankgirot'
265
269
  | 'sen'
266
270
  | 'sepa'
271
+ | 'sg_giro'
267
272
  | 'sic'
268
273
  | 'signet'
269
274
  | 'wire'
@@ -294,9 +299,9 @@ export interface VirtualAccountListParams extends PageParams {
294
299
  }
295
300
 
296
301
  export namespace VirtualAccounts {
297
- export import VirtualAccount = API.VirtualAccount;
298
- export type VirtualAccountsPage = _VirtualAccountsPage;
299
- export import VirtualAccountCreateParams = API.VirtualAccountCreateParams;
300
- export import VirtualAccountUpdateParams = API.VirtualAccountUpdateParams;
301
- export import VirtualAccountListParams = API.VirtualAccountListParams;
302
+ export import VirtualAccount = VirtualAccountsAPI.VirtualAccount;
303
+ export import VirtualAccountsPage = VirtualAccountsAPI.VirtualAccountsPage;
304
+ export import VirtualAccountCreateParams = VirtualAccountsAPI.VirtualAccountCreateParams;
305
+ export import VirtualAccountUpdateParams = VirtualAccountsAPI.VirtualAccountUpdateParams;
306
+ export import VirtualAccountListParams = VirtualAccountsAPI.VirtualAccountListParams;
302
307
  }
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import { APIResource } from "../treasury/resource";
3
+ import { APIResource } from "../resource";
4
4
  import { createHmac } from 'crypto';
5
- import type { HeadersLike } from "../treasury/core";
6
- import { getHeader } from "../treasury/core";
5
+ import type { HeadersLike } from "../core";
6
+ import { getRequiredHeader } from "../core";
7
7
 
8
8
  export class Webhooks extends APIResource {
9
9
  /**
@@ -40,8 +40,9 @@ export class Webhooks extends APIResource {
40
40
  opts?: { key?: string | null | undefined },
41
41
  ): boolean {
42
42
  const signature = this.getSignature(payload, opts);
43
- const expectedSignature = typeof headers === 'string' ? headers : getHeader(headers, 'X-Signature');
44
- if (!expectedSignature) throw new Error('Could not find an X-Signature header');
43
+ const expectedSignature =
44
+ typeof headers === 'string' ? headers : getRequiredHeader(headers, 'X-Signature');
45
+ if (!expectedSignature) throw new Error('Could not find X-Signature header');
45
46
  return signature === expectedSignature;
46
47
  }
47
48
  }
package/src/shims/node.ts CHANGED
@@ -45,6 +45,6 @@ declare module '../_shims/manual-types' {
45
45
  // @ts-ignore
46
46
  export type FsReadStream = types.FsReadStream;
47
47
  // @ts-ignore
48
- export type ReadableStream = types.ReadableStream;
48
+ export import ReadableStream = types.ReadableStream;
49
49
  }
50
50
  }
package/src/shims/web.ts CHANGED
@@ -45,6 +45,6 @@ declare module '../_shims/manual-types' {
45
45
  // @ts-ignore
46
46
  export type FsReadStream = types.FsReadStream;
47
47
  // @ts-ignore
48
- export type ReadableStream = types.ReadableStream;
48
+ export import ReadableStream = types.ReadableStream;
49
49
  }
50
50
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.7.2'; // x-release-please-version
1
+ export const VERSION = '2.9.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.7.2";
1
+ export declare const VERSION = "2.9.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.7.2'; // x-release-please-version
4
+ exports.VERSION = '2.9.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.7.2'; // x-release-please-version
1
+ export const VERSION = '2.9.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map