modern-treasury 2.7.2 → 2.8.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 (328) hide show
  1. package/CHANGELOG.md +38 -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 +21 -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 +61 -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 +2 -0
  275. package/src/_shims/node-runtime.ts +4 -0
  276. package/src/_shims/node-types.d.ts +1 -1
  277. package/src/_shims/registry.ts +3 -0
  278. package/src/_shims/web-runtime.ts +12 -0
  279. package/src/_shims/web-types.d.ts +2 -1
  280. package/src/core.ts +39 -21
  281. package/src/error.ts +15 -5
  282. package/src/index.ts +23 -17
  283. package/src/resources/account-collection-flows.ts +9 -9
  284. package/src/resources/account-details.ts +6 -8
  285. package/src/resources/connections.ts +5 -7
  286. package/src/resources/counterparties.ts +28 -23
  287. package/src/resources/documents.ts +9 -8
  288. package/src/resources/events.ts +5 -7
  289. package/src/resources/expected-payments.ts +31 -14
  290. package/src/resources/external-accounts.ts +24 -20
  291. package/src/resources/incoming-payment-details.ts +13 -13
  292. package/src/resources/index.ts +3 -5
  293. package/src/resources/internal-accounts/balance-reports.ts +5 -7
  294. package/src/resources/internal-accounts/internal-accounts.ts +22 -23
  295. package/src/resources/invoices/invoices.ts +44 -71
  296. package/src/resources/invoices/line-items.ts +7 -9
  297. package/src/resources/ledger-account-balance-monitors.ts +7 -9
  298. package/src/resources/ledger-account-categories.ts +11 -12
  299. package/src/resources/ledger-account-payouts.ts +20 -9
  300. package/src/resources/ledger-account-statements.ts +7 -6
  301. package/src/resources/ledger-accounts.ts +11 -12
  302. package/src/resources/ledger-entries.ts +9 -10
  303. package/src/resources/ledger-event-handlers.ts +50 -333
  304. package/src/resources/ledger-transactions/ledger-transactions.ts +19 -21
  305. package/src/resources/ledger-transactions/versions.ts +7 -8
  306. package/src/resources/ledgerable-events.ts +4 -49
  307. package/src/resources/ledgers.ts +7 -9
  308. package/src/resources/line-items.ts +6 -8
  309. package/src/resources/paper-items.ts +5 -7
  310. package/src/resources/payment-flows.ts +7 -9
  311. package/src/resources/payment-orders/payment-orders.ts +84 -51
  312. package/src/resources/payment-orders/reversals.ts +8 -9
  313. package/src/resources/payment-references.ts +5 -7
  314. package/src/resources/returns.ts +12 -14
  315. package/src/resources/routing-details.ts +20 -10
  316. package/src/resources/shared.ts +2 -0
  317. package/src/resources/top-level.ts +2 -2
  318. package/src/resources/transactions/line-items.ts +11 -7
  319. package/src/resources/transactions/transactions.ts +30 -31
  320. package/src/resources/validations.ts +16 -11
  321. package/src/resources/virtual-accounts.ts +18 -14
  322. package/src/resources/webhooks.ts +4 -3
  323. package/src/shims/node.ts +1 -1
  324. package/src/shims/web.ts +1 -1
  325. package/src/version.ts +1 -1
  326. package/version.d.ts +1 -1
  327. package/version.js +1 -1
  328. package/version.mjs +1 -1
@@ -3,8 +3,8 @@
3
3
  import * as Core from "../treasury/core";
4
4
  import { APIResource } from "../treasury/resource";
5
5
  import { isRequestOptions } from "../treasury/core";
6
- import * as API from './index';
7
- import { Page, PageParams } from "../treasury/pagination";
6
+ import * as PaymentReferencesAPI from "../treasury/resources/payment-references";
7
+ import { Page, type PageParams } from "../treasury/pagination";
8
8
 
9
9
  export class PaymentReferences extends APIResource {
10
10
  /**
@@ -39,8 +39,6 @@ export class PaymentReferences extends APIResource {
39
39
  }
40
40
 
41
41
  export class PaymentReferencesPage extends Page<PaymentReference> {}
42
- // alias so we can export it in the namespace
43
- type _PaymentReferencesPage = PaymentReferencesPage;
44
42
 
45
43
  export interface PaymentReference {
46
44
  id: string;
@@ -155,7 +153,7 @@ export interface PaymentReferenceListParams extends PageParams {
155
153
  }
156
154
 
157
155
  export namespace PaymentReferences {
158
- export import PaymentReference = API.PaymentReference;
159
- export type PaymentReferencesPage = _PaymentReferencesPage;
160
- export import PaymentReferenceListParams = API.PaymentReferenceListParams;
156
+ export import PaymentReference = PaymentReferencesAPI.PaymentReference;
157
+ export import PaymentReferencesPage = PaymentReferencesAPI.PaymentReferencesPage;
158
+ export import PaymentReferenceListParams = PaymentReferencesAPI.PaymentReferenceListParams;
161
159
  }
@@ -3,9 +3,9 @@
3
3
  import * as Core from "../treasury/core";
4
4
  import { APIResource } from "../treasury/resource";
5
5
  import { isRequestOptions } from "../treasury/core";
6
+ import * as ReturnsAPI from "../treasury/resources/returns";
6
7
  import * as Shared from "../treasury/resources/shared";
7
- import * as API from './index';
8
- import { Page, PageParams } from "../treasury/pagination";
8
+ import { Page, type PageParams } from "../treasury/pagination";
9
9
 
10
10
  export class Returns extends APIResource {
11
11
  /**
@@ -53,18 +53,10 @@ export class Returns extends APIResource {
53
53
  }
54
54
 
55
55
  export class ReturnObjectsPage extends Page<ReturnObject> {}
56
- // alias so we can export it in the namespace
57
- type _ReturnObjectsPage = ReturnObjectsPage;
58
56
 
59
57
  export interface ReturnObject {
60
58
  id: string;
61
59
 
62
- /**
63
- * Some returns may include additional information from the bank. In these cases,
64
- * this string will be present.
65
- */
66
- additional_information: string | null;
67
-
68
60
  /**
69
61
  * Value in specified currency's smallest unit. e.g. $10 would be represented
70
62
  * as 1000.
@@ -223,6 +215,12 @@ export interface ReturnObject {
223
215
  | 'wire';
224
216
 
225
217
  updated_at: string;
218
+
219
+ /**
220
+ * Some returns may include additional information from the bank. In these cases,
221
+ * this string will be present.
222
+ */
223
+ additional_information?: string | null;
226
224
  }
227
225
 
228
226
  export namespace ReturnObject {
@@ -414,8 +412,8 @@ export interface ReturnListParams extends PageParams {
414
412
  }
415
413
 
416
414
  export namespace Returns {
417
- export import ReturnObject = API.ReturnObject;
418
- export type ReturnObjectsPage = _ReturnObjectsPage;
419
- export import ReturnCreateParams = API.ReturnCreateParams;
420
- export import ReturnListParams = API.ReturnListParams;
415
+ export import ReturnObject = ReturnsAPI.ReturnObject;
416
+ export import ReturnObjectsPage = ReturnsAPI.ReturnObjectsPage;
417
+ export import ReturnCreateParams = ReturnsAPI.ReturnCreateParams;
418
+ export import ReturnListParams = ReturnsAPI.ReturnListParams;
421
419
  }
@@ -3,9 +3,9 @@
3
3
  import * as Core from "../treasury/core";
4
4
  import { APIResource } from "../treasury/resource";
5
5
  import { isRequestOptions } from "../treasury/core";
6
+ import * as RoutingDetailsAPI from "../treasury/resources/routing-details";
6
7
  import * as Shared from "../treasury/resources/shared";
7
- import * as API from './index';
8
- import { Page, PageParams } from "../treasury/pagination";
8
+ import { Page, type PageParams } from "../treasury/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,6 +130,7 @@ 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'
@@ -148,7 +148,9 @@ export interface RoutingDetail {
148
148
  routing_number: string;
149
149
 
150
150
  /**
151
- * One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`.
151
+ * The type of routing number. See
152
+ * https://docs.moderntreasury.com/platform/reference/routing-detail-object for
153
+ * more details.
152
154
  */
153
155
  routing_number_type:
154
156
  | 'aba'
@@ -158,9 +160,11 @@ export interface RoutingDetail {
158
160
  | 'chips'
159
161
  | 'cnaps'
160
162
  | 'gb_sort_code'
163
+ | 'hk_interbank_clearing_code'
161
164
  | 'in_ifsc'
162
165
  | 'jp_zengin_code'
163
166
  | 'my_branch_code'
167
+ | 'nz_national_clearing_code'
164
168
  | 'se_bankgiro_clearing_code'
165
169
  | 'swift';
166
170
 
@@ -216,7 +220,9 @@ export interface RoutingDetailCreateParams {
216
220
  routing_number: string;
217
221
 
218
222
  /**
219
- * One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`.
223
+ * The type of routing number. See
224
+ * https://docs.moderntreasury.com/platform/reference/routing-detail-object for
225
+ * more details.
220
226
  */
221
227
  routing_number_type:
222
228
  | 'aba'
@@ -226,9 +232,11 @@ export interface RoutingDetailCreateParams {
226
232
  | 'chips'
227
233
  | 'cnaps'
228
234
  | 'gb_sort_code'
235
+ | 'hk_interbank_clearing_code'
229
236
  | 'in_ifsc'
230
237
  | 'jp_zengin_code'
231
238
  | 'my_branch_code'
239
+ | 'nz_national_clearing_code'
232
240
  | 'se_bankgiro_clearing_code'
233
241
  | 'swift';
234
242
 
@@ -242,6 +250,7 @@ export interface RoutingDetailCreateParams {
242
250
  | 'bacs'
243
251
  | 'book'
244
252
  | 'card'
253
+ | 'chats'
245
254
  | 'check'
246
255
  | 'cross_border'
247
256
  | 'eft'
@@ -249,6 +258,7 @@ export interface RoutingDetailCreateParams {
249
258
  | 'masav'
250
259
  | 'neft'
251
260
  | 'nics'
261
+ | 'nz_becs'
252
262
  | 'provxchange'
253
263
  | 'rtp'
254
264
  | 'se_bankgirot'
@@ -264,8 +274,8 @@ export interface RoutingDetailCreateParams {
264
274
  export interface RoutingDetailListParams extends PageParams {}
265
275
 
266
276
  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;
277
+ export import RoutingDetail = RoutingDetailsAPI.RoutingDetail;
278
+ export import RoutingDetailsPage = RoutingDetailsAPI.RoutingDetailsPage;
279
+ export import RoutingDetailCreateParams = RoutingDetailsAPI.RoutingDetailCreateParams;
280
+ export import RoutingDetailListParams = RoutingDetailsAPI.RoutingDetailListParams;
271
281
  }
@@ -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 "../treasury/resources/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
  }
@@ -3,8 +3,8 @@
3
3
  import * as Core from "../../treasury/core";
4
4
  import { APIResource } from "../../treasury/resource";
5
5
  import { isRequestOptions } from "../../treasury/core";
6
- import * as API from './index';
7
- import { Page, PageParams } from "../../treasury/pagination";
6
+ import * as LineItemsAPI from "../../treasury/resources/transactions/line-items";
7
+ import { Page, type PageParams } from "../../treasury/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
  }
@@ -3,13 +3,13 @@
3
3
  import * as Core from "../../treasury/core";
4
4
  import { APIResource } from "../../treasury/resource";
5
5
  import { isRequestOptions } from "../../treasury/core";
6
+ import * as TransactionsAPI from "../../treasury/resources/transactions/transactions";
6
7
  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";
8
+ import * as LineItemsAPI from "../../treasury/resources/transactions/line-items";
9
+ import { Page, type PageParams } from "../../treasury/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,6 +142,7 @@ 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'
@@ -207,15 +196,26 @@ export interface Transaction {
207
196
  vendor_customer_id: string | null;
208
197
 
209
198
  /**
210
- * The transaction detail text that often appears in on your bank statement and in
211
- * your banking portal.
199
+ * An identifier given to this transaction by the bank.
200
+ */
201
+ vendor_id: string | null;
202
+
203
+ /**
204
+ * This field contains additional information that the bank provided about the
205
+ * transaction. This is structured data. Some of the data in here might overlap
206
+ * with what is in the `vendor_description`. For example, the OBI could be a part
207
+ * of the vendor description, and it would also be included in here. The attributes
208
+ * that are passed through the details field will vary based on your banking
209
+ * partner. Currently, the following keys may be in the details object:
210
+ * `originator_name`, `originator_to_beneficiary_information`.
212
211
  */
213
- vendor_description: string | null;
212
+ details?: Record<string, string>;
214
213
 
215
214
  /**
216
- * An identifier given to this transaction by the bank.
215
+ * The transaction detail text that often appears in on your bank statement and in
216
+ * your banking portal.
217
217
  */
218
- vendor_id: string | null;
218
+ vendor_description?: string | null;
219
219
  }
220
220
 
221
221
  export interface TransactionUpdateParams {
@@ -280,13 +280,12 @@ export interface TransactionListParams extends PageParams {
280
280
  }
281
281
 
282
282
  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;
283
+ export import Transaction = TransactionsAPI.Transaction;
284
+ export import TransactionsPage = TransactionsAPI.TransactionsPage;
285
+ export import TransactionUpdateParams = TransactionsAPI.TransactionUpdateParams;
286
+ export import TransactionListParams = TransactionsAPI.TransactionListParams;
287
+ export import LineItems = LineItemsAPI.LineItems;
288
+ export import TransactionLineItem = LineItemsAPI.TransactionLineItem;
289
+ export import TransactionLineItemsPage = LineItemsAPI.TransactionLineItemsPage;
290
+ export import LineItemListParams = LineItemsAPI.LineItemListParams;
292
291
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as Core from "../treasury/core";
4
4
  import { APIResource } from "../treasury/resource";
5
- import * as API from './index';
5
+ import * as ValidationsAPI from "../treasury/resources/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,6 +74,7 @@ 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'
@@ -122,10 +125,10 @@ export interface ValidationValidateRoutingNumberParams {
122
125
  routing_number: string;
123
126
 
124
127
  /**
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.
128
+ * The type of routing number. See
129
+ * https://docs.moderntreasury.com/platform/reference/routing-detail-object for
130
+ * more details. In sandbox mode we currently only support `aba` and `swift` with
131
+ * routing numbers '123456789' and 'GRINUST0XXX' respectively.
129
132
  */
130
133
  routing_number_type:
131
134
  | 'aba'
@@ -135,14 +138,16 @@ export interface ValidationValidateRoutingNumberParams {
135
138
  | 'chips'
136
139
  | 'cnaps'
137
140
  | 'gb_sort_code'
141
+ | 'hk_interbank_clearing_code'
138
142
  | 'in_ifsc'
139
143
  | 'jp_zengin_code'
140
144
  | 'my_branch_code'
145
+ | 'nz_national_clearing_code'
141
146
  | 'se_bankgiro_clearing_code'
142
147
  | 'swift';
143
148
  }
144
149
 
145
150
  export namespace Validations {
146
- export import RoutingNumberLookupRequest = API.RoutingNumberLookupRequest;
147
- export import ValidationValidateRoutingNumberParams = API.ValidationValidateRoutingNumberParams;
151
+ export import RoutingNumberLookupRequest = ValidationsAPI.RoutingNumberLookupRequest;
152
+ export import ValidationValidateRoutingNumberParams = ValidationsAPI.ValidationValidateRoutingNumberParams;
148
153
  }
@@ -3,10 +3,10 @@
3
3
  import * as Core from "../treasury/core";
4
4
  import { APIResource } from "../treasury/resource";
5
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";
6
+ import * as VirtualAccountsAPI from "../treasury/resources/virtual-accounts";
7
+ import * as AccountDetailsAPI from "../treasury/resources/account-details";
8
+ import * as RoutingDetailsAPI from "../treasury/resources/routing-details";
9
+ import { Page, type PageParams } from "../treasury/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,6 +262,7 @@ 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'
@@ -294,9 +298,9 @@ export interface VirtualAccountListParams extends PageParams {
294
298
  }
295
299
 
296
300
  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;
301
+ export import VirtualAccount = VirtualAccountsAPI.VirtualAccount;
302
+ export import VirtualAccountsPage = VirtualAccountsAPI.VirtualAccountsPage;
303
+ export import VirtualAccountCreateParams = VirtualAccountsAPI.VirtualAccountCreateParams;
304
+ export import VirtualAccountUpdateParams = VirtualAccountsAPI.VirtualAccountUpdateParams;
305
+ export import VirtualAccountListParams = VirtualAccountsAPI.VirtualAccountListParams;
302
306
  }
@@ -3,7 +3,7 @@
3
3
  import { APIResource } from "../treasury/resource";
4
4
  import { createHmac } from 'crypto';
5
5
  import type { HeadersLike } from "../treasury/core";
6
- import { getHeader } from "../treasury/core";
6
+ import { getRequiredHeader } from "../treasury/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.8.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.8.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.8.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.8.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map