modern-treasury 2.3.0 → 2.4.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 +31 -0
  2. package/README.md +2 -0
  3. package/_shims/{ReadableStream.node.d.ts → ReadableStream-node.d.ts} +1 -1
  4. package/_shims/ReadableStream-node.d.ts.map +1 -0
  5. package/_shims/{ReadableStream.node.js → ReadableStream-node.js} +1 -1
  6. package/_shims/ReadableStream-node.js.map +1 -0
  7. package/_shims/{ReadableStream.node.mjs → ReadableStream-node.mjs} +1 -1
  8. package/_shims/ReadableStream-node.mjs.map +1 -0
  9. package/_shims/{agent.node.d.ts → agent-node.d.ts} +1 -1
  10. package/_shims/agent-node.d.ts.map +1 -0
  11. package/_shims/{agent.node.js → agent-node.js} +1 -1
  12. package/_shims/{agent.node.js.map → agent-node.js.map} +1 -1
  13. package/_shims/{agent.node.mjs → agent-node.mjs} +1 -1
  14. package/_shims/{agent.node.mjs.map → agent-node.mjs.map} +1 -1
  15. package/_shims/agent.d.ts +1 -1
  16. package/_shims/agent.js +1 -1
  17. package/_shims/agent.mjs +1 -1
  18. package/{src/_shims/fetch.node.d.ts → _shims/fetch-node.d.ts} +1 -0
  19. package/_shims/fetch.d.ts +1 -0
  20. package/_shims/{fileFromPath.node.d.ts → fileFromPath-node.d.ts} +2 -2
  21. package/_shims/{fileFromPath.node.d.ts.map → fileFromPath-node.d.ts.map} +1 -1
  22. package/_shims/{fileFromPath.node.js → fileFromPath-node.js} +1 -1
  23. package/_shims/{fileFromPath.node.js.map → fileFromPath-node.js.map} +1 -1
  24. package/_shims/{fileFromPath.node.mjs → fileFromPath-node.mjs} +1 -1
  25. package/_shims/{fileFromPath.node.mjs.map → fileFromPath-node.mjs.map} +1 -1
  26. package/_shims/fileFromPath.d.ts +2 -2
  27. package/_shims/fileFromPath.d.ts.map +1 -1
  28. package/_shims/fileFromPath.js +1 -1
  29. package/_shims/fileFromPath.mjs +1 -1
  30. package/_shims/form-data.js +17 -0
  31. package/_shims/form-data.mjs +20 -0
  32. package/_shims/{getMultipartRequestOptions.node.d.ts → getMultipartRequestOptions-node.d.ts} +2 -2
  33. package/_shims/getMultipartRequestOptions-node.d.ts.map +1 -0
  34. package/_shims/{getMultipartRequestOptions.node.js → getMultipartRequestOptions-node.js} +1 -1
  35. package/_shims/{getMultipartRequestOptions.node.js.map → getMultipartRequestOptions-node.js.map} +1 -1
  36. package/_shims/{getMultipartRequestOptions.node.mjs → getMultipartRequestOptions-node.mjs} +1 -1
  37. package/_shims/{getMultipartRequestOptions.node.mjs.map → getMultipartRequestOptions-node.mjs.map} +1 -1
  38. package/_shims/getMultipartRequestOptions.d.ts +1 -1
  39. package/_shims/getMultipartRequestOptions.d.ts.map +1 -1
  40. package/_shims/{node-readable.node.d.ts → node-readable-node.d.ts} +1 -1
  41. package/_shims/{node-readable.node.d.ts.map → node-readable-node.d.ts.map} +1 -1
  42. package/_shims/{node-readable.node.js → node-readable-node.js} +1 -1
  43. package/_shims/node-readable-node.js.map +1 -0
  44. package/_shims/{node-readable.node.mjs → node-readable-node.mjs} +1 -1
  45. package/_shims/node-readable-node.mjs.map +1 -0
  46. package/core.d.ts +13 -5
  47. package/core.d.ts.map +1 -1
  48. package/core.js +17 -10
  49. package/core.js.map +1 -1
  50. package/core.mjs +17 -10
  51. package/core.mjs.map +1 -1
  52. package/index.d.mts +18 -5
  53. package/index.d.ts +18 -5
  54. package/index.d.ts.map +1 -1
  55. package/index.js +21 -7
  56. package/index.js.map +1 -1
  57. package/index.mjs +21 -7
  58. package/index.mjs.map +1 -1
  59. package/package.json +32 -9
  60. package/resources/account-collection-flows.d.ts +3 -28
  61. package/resources/account-collection-flows.d.ts.map +1 -1
  62. package/resources/account-collection-flows.js +22 -17
  63. package/resources/account-collection-flows.js.map +1 -1
  64. package/resources/account-collection-flows.mjs +22 -17
  65. package/resources/account-collection-flows.mjs.map +1 -1
  66. package/resources/account-details.d.ts +3 -8
  67. package/resources/account-details.d.ts.map +1 -1
  68. package/resources/account-details.js +10 -4
  69. package/resources/account-details.js.map +1 -1
  70. package/resources/account-details.mjs +10 -4
  71. package/resources/account-details.mjs.map +1 -1
  72. package/resources/connections.js +3 -3
  73. package/resources/connections.mjs +3 -3
  74. package/resources/counterparties.d.ts +26 -40
  75. package/resources/counterparties.d.ts.map +1 -1
  76. package/resources/counterparties.js +17 -5
  77. package/resources/counterparties.js.map +1 -1
  78. package/resources/counterparties.mjs +17 -5
  79. package/resources/counterparties.mjs.map +1 -1
  80. package/resources/documents.d.ts +2 -13
  81. package/resources/documents.d.ts.map +1 -1
  82. package/resources/documents.js +11 -5
  83. package/resources/documents.js.map +1 -1
  84. package/resources/documents.mjs +11 -5
  85. package/resources/documents.mjs.map +1 -1
  86. package/resources/events.js +3 -3
  87. package/resources/events.mjs +3 -3
  88. package/resources/expected-payments.d.ts +23 -32
  89. package/resources/expected-payments.d.ts.map +1 -1
  90. package/resources/expected-payments.js +10 -4
  91. package/resources/expected-payments.js.map +1 -1
  92. package/resources/expected-payments.mjs +10 -4
  93. package/resources/expected-payments.mjs.map +1 -1
  94. package/resources/external-accounts.d.ts +17 -51
  95. package/resources/external-accounts.d.ts.map +1 -1
  96. package/resources/external-accounts.js +24 -6
  97. package/resources/external-accounts.js.map +1 -1
  98. package/resources/external-accounts.mjs +24 -6
  99. package/resources/external-accounts.mjs.map +1 -1
  100. package/resources/incoming-payment-details.d.ts +10 -15
  101. package/resources/incoming-payment-details.d.ts.map +1 -1
  102. package/resources/incoming-payment-details.js +10 -4
  103. package/resources/incoming-payment-details.js.map +1 -1
  104. package/resources/incoming-payment-details.mjs +10 -4
  105. package/resources/incoming-payment-details.mjs.map +1 -1
  106. package/resources/index.d.ts +0 -2
  107. package/resources/index.d.ts.map +1 -1
  108. package/resources/index.js.map +1 -1
  109. package/resources/index.mjs.map +1 -1
  110. package/resources/internal-accounts/balance-reports.js +3 -3
  111. package/resources/internal-accounts/balance-reports.mjs +3 -3
  112. package/resources/internal-accounts/internal-accounts.d.ts +10 -15
  113. package/resources/internal-accounts/internal-accounts.d.ts.map +1 -1
  114. package/resources/internal-accounts/internal-accounts.js +10 -4
  115. package/resources/internal-accounts/internal-accounts.js.map +1 -1
  116. package/resources/internal-accounts/internal-accounts.mjs +10 -4
  117. package/resources/internal-accounts/internal-accounts.mjs.map +1 -1
  118. package/resources/invoices/invoices.d.ts +24 -32
  119. package/resources/invoices/invoices.d.ts.map +1 -1
  120. package/resources/invoices/invoices.js +10 -4
  121. package/resources/invoices/invoices.js.map +1 -1
  122. package/resources/invoices/invoices.mjs +10 -4
  123. package/resources/invoices/invoices.mjs.map +1 -1
  124. package/resources/invoices/line-items.d.ts +9 -14
  125. package/resources/invoices/line-items.d.ts.map +1 -1
  126. package/resources/invoices/line-items.js +10 -4
  127. package/resources/invoices/line-items.js.map +1 -1
  128. package/resources/invoices/line-items.mjs +10 -4
  129. package/resources/invoices/line-items.mjs.map +1 -1
  130. package/resources/ledger-account-categories.d.ts +8 -13
  131. package/resources/ledger-account-categories.d.ts.map +1 -1
  132. package/resources/ledger-account-categories.js +10 -4
  133. package/resources/ledger-account-categories.js.map +1 -1
  134. package/resources/ledger-account-categories.mjs +10 -4
  135. package/resources/ledger-account-categories.mjs.map +1 -1
  136. package/resources/ledger-account-payouts.d.ts +14 -19
  137. package/resources/ledger-account-payouts.d.ts.map +1 -1
  138. package/resources/ledger-account-payouts.js +10 -4
  139. package/resources/ledger-account-payouts.js.map +1 -1
  140. package/resources/ledger-account-payouts.mjs +10 -4
  141. package/resources/ledger-account-payouts.mjs.map +1 -1
  142. package/resources/ledger-account-statements.d.ts +9 -14
  143. package/resources/ledger-account-statements.d.ts.map +1 -1
  144. package/resources/ledger-account-statements.js +8 -2
  145. package/resources/ledger-account-statements.js.map +1 -1
  146. package/resources/ledger-account-statements.mjs +8 -2
  147. package/resources/ledger-account-statements.mjs.map +1 -1
  148. package/resources/ledger-accounts.d.ts +13 -18
  149. package/resources/ledger-accounts.d.ts.map +1 -1
  150. package/resources/ledger-accounts.js +10 -4
  151. package/resources/ledger-accounts.js.map +1 -1
  152. package/resources/ledger-accounts.mjs +10 -4
  153. package/resources/ledger-accounts.mjs.map +1 -1
  154. package/resources/ledger-entries.js +3 -3
  155. package/resources/ledger-entries.mjs +3 -3
  156. package/resources/ledger-event-handlers.d.ts +5 -16
  157. package/resources/ledger-event-handlers.d.ts.map +1 -1
  158. package/resources/ledger-event-handlers.js +10 -4
  159. package/resources/ledger-event-handlers.js.map +1 -1
  160. package/resources/ledger-event-handlers.mjs +10 -4
  161. package/resources/ledger-event-handlers.mjs.map +1 -1
  162. package/resources/ledger-transactions/ledger-transactions.d.ts +16 -22
  163. package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
  164. package/resources/ledger-transactions/ledger-transactions.js +10 -4
  165. package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
  166. package/resources/ledger-transactions/ledger-transactions.mjs +10 -4
  167. package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
  168. package/resources/ledger-transactions/versions.js +3 -3
  169. package/resources/ledger-transactions/versions.mjs +3 -3
  170. package/resources/ledgerable-events.d.ts +11 -16
  171. package/resources/ledgerable-events.d.ts.map +1 -1
  172. package/resources/ledgerable-events.js +8 -2
  173. package/resources/ledgerable-events.js.map +1 -1
  174. package/resources/ledgerable-events.mjs +8 -2
  175. package/resources/ledgerable-events.mjs.map +1 -1
  176. package/resources/ledgers.d.ts +4 -9
  177. package/resources/ledgers.d.ts.map +1 -1
  178. package/resources/ledgers.js +10 -4
  179. package/resources/ledgers.js.map +1 -1
  180. package/resources/ledgers.mjs +10 -4
  181. package/resources/ledgers.mjs.map +1 -1
  182. package/resources/line-items.js +3 -3
  183. package/resources/line-items.mjs +3 -3
  184. package/resources/paper-items.js +3 -3
  185. package/resources/paper-items.mjs +3 -3
  186. package/resources/payment-flows.d.ts +10 -34
  187. package/resources/payment-flows.d.ts.map +1 -1
  188. package/resources/payment-flows.js +22 -17
  189. package/resources/payment-flows.js.map +1 -1
  190. package/resources/payment-flows.mjs +22 -17
  191. package/resources/payment-flows.mjs.map +1 -1
  192. package/resources/payment-orders/payment-orders.d.ts +142 -167
  193. package/resources/payment-orders/payment-orders.d.ts.map +1 -1
  194. package/resources/payment-orders/payment-orders.js +18 -6
  195. package/resources/payment-orders/payment-orders.js.map +1 -1
  196. package/resources/payment-orders/payment-orders.mjs +18 -6
  197. package/resources/payment-orders/payment-orders.mjs.map +1 -1
  198. package/resources/payment-orders/reversals.d.ts +7 -13
  199. package/resources/payment-orders/reversals.d.ts.map +1 -1
  200. package/resources/payment-orders/reversals.js +10 -4
  201. package/resources/payment-orders/reversals.js.map +1 -1
  202. package/resources/payment-orders/reversals.mjs +10 -4
  203. package/resources/payment-orders/reversals.mjs.map +1 -1
  204. package/resources/payment-references.js +3 -3
  205. package/resources/payment-references.mjs +3 -3
  206. package/resources/returns.d.ts +9 -15
  207. package/resources/returns.d.ts.map +1 -1
  208. package/resources/returns.js +10 -4
  209. package/resources/returns.js.map +1 -1
  210. package/resources/returns.mjs +10 -4
  211. package/resources/returns.mjs.map +1 -1
  212. package/resources/routing-details.d.ts +4 -10
  213. package/resources/routing-details.d.ts.map +1 -1
  214. package/resources/routing-details.js +10 -4
  215. package/resources/routing-details.js.map +1 -1
  216. package/resources/routing-details.mjs +10 -4
  217. package/resources/routing-details.mjs.map +1 -1
  218. package/resources/transactions/line-items.js +3 -3
  219. package/resources/transactions/line-items.mjs +3 -3
  220. package/resources/transactions/transactions.js +3 -3
  221. package/resources/transactions/transactions.mjs +3 -3
  222. package/resources/validations.js +1 -1
  223. package/resources/validations.mjs +1 -1
  224. package/resources/virtual-accounts.d.ts +12 -18
  225. package/resources/virtual-accounts.d.ts.map +1 -1
  226. package/resources/virtual-accounts.js +10 -4
  227. package/resources/virtual-accounts.js.map +1 -1
  228. package/resources/virtual-accounts.mjs +10 -4
  229. package/resources/virtual-accounts.mjs.map +1 -1
  230. package/resources/webhooks.js +2 -2
  231. package/resources/webhooks.mjs +2 -2
  232. package/src/_shims/ReadableStream.d.ts +5 -5
  233. package/src/_shims/agent.ts +1 -1
  234. package/{_shims/fetch.node.d.ts → src/_shims/fetch-node.d.ts} +9 -8
  235. package/src/_shims/fetch.d.ts +11 -10
  236. package/src/_shims/{fileFromPath.node.ts → fileFromPath-node.ts} +1 -1
  237. package/src/_shims/fileFromPath.ts +2 -2
  238. package/src/_shims/{formdata.node.d.ts → form-data-node.d.ts} +4 -4
  239. package/src/_shims/{formdata.d.ts → form-data.d.ts} +4 -4
  240. package/src/_shims/form-data.js +17 -0
  241. package/src/_shims/form-data.mjs +20 -0
  242. package/src/_shims/{getMultipartRequestOptions.node.ts → getMultipartRequestOptions-node.ts} +3 -3
  243. package/src/_shims/getMultipartRequestOptions.ts +3 -3
  244. package/src/core.ts +35 -22
  245. package/src/error.ts +1 -1
  246. package/src/index.ts +27 -13
  247. package/src/pagination.ts +1 -1
  248. package/src/resource.ts +1 -1
  249. package/src/resources/account-collection-flows.ts +24 -52
  250. package/src/resources/account-details.ts +16 -16
  251. package/src/resources/connections.ts +5 -5
  252. package/src/resources/counterparties.ts +48 -52
  253. package/src/resources/documents.ts +15 -21
  254. package/src/resources/events.ts +5 -5
  255. package/src/resources/expected-payments.ts +36 -40
  256. package/src/resources/external-accounts.ts +46 -65
  257. package/src/resources/incoming-payment-details.ts +24 -24
  258. package/src/resources/index.ts +39 -35
  259. package/src/resources/internal-accounts/balance-reports.ts +6 -6
  260. package/src/resources/internal-accounts/index.ts +2 -2
  261. package/src/resources/internal-accounts/internal-accounts.ts +27 -27
  262. package/src/resources/invoices/index.ts +2 -2
  263. package/src/resources/invoices/invoices.ts +39 -42
  264. package/src/resources/invoices/line-items.ts +21 -21
  265. package/src/resources/ledger-account-categories.ts +20 -20
  266. package/src/resources/ledger-account-payouts.ts +26 -26
  267. package/src/resources/ledger-account-statements.ts +19 -19
  268. package/src/resources/ledger-accounts.ts +25 -25
  269. package/src/resources/ledger-entries.ts +5 -5
  270. package/src/resources/ledger-event-handlers.ts +17 -23
  271. package/src/resources/ledger-transactions/index.ts +2 -2
  272. package/src/resources/ledger-transactions/ledger-transactions.ts +30 -31
  273. package/src/resources/ledger-transactions/versions.ts +5 -5
  274. package/src/resources/ledgerable-events.ts +21 -21
  275. package/src/resources/ledgers.ts +16 -16
  276. package/src/resources/line-items.ts +5 -5
  277. package/src/resources/paper-items.ts +6 -6
  278. package/src/resources/payment-flows.ts +31 -58
  279. package/src/resources/payment-orders/index.ts +2 -2
  280. package/src/resources/payment-orders/payment-orders.ts +166 -181
  281. package/src/resources/payment-orders/reversals.ts +19 -20
  282. package/src/resources/payment-references.ts +5 -5
  283. package/src/resources/returns.ts +22 -23
  284. package/src/resources/routing-details.ts +17 -18
  285. package/src/resources/top-level.ts +1 -1
  286. package/src/resources/transactions/index.ts +7 -2
  287. package/src/resources/transactions/line-items.ts +5 -5
  288. package/src/resources/transactions/transactions.ts +7 -7
  289. package/src/resources/validations.ts +3 -3
  290. package/src/resources/virtual-accounts.ts +26 -27
  291. package/src/resources/webhooks.ts +3 -3
  292. package/src/tsconfig.json +11 -0
  293. package/src/uploads.ts +6 -6
  294. package/src/version.ts +1 -1
  295. package/uploads.d.ts +1 -1
  296. package/uploads.d.ts.map +1 -1
  297. package/uploads.js +7 -7
  298. package/uploads.js.map +1 -1
  299. package/uploads.mjs +4 -4
  300. package/uploads.mjs.map +1 -1
  301. package/version.d.ts +1 -1
  302. package/version.js +1 -1
  303. package/version.mjs +1 -1
  304. package/_shims/ReadableStream.node.d.ts.map +0 -1
  305. package/_shims/ReadableStream.node.js.map +0 -1
  306. package/_shims/ReadableStream.node.mjs.map +0 -1
  307. package/_shims/agent.node.d.ts.map +0 -1
  308. package/_shims/formdata.js +0 -9
  309. package/_shims/formdata.mjs +0 -11
  310. package/_shims/getMultipartRequestOptions.node.d.ts.map +0 -1
  311. package/_shims/node-readable.node.js.map +0 -1
  312. package/_shims/node-readable.node.mjs.map +0 -1
  313. package/src/_shims/fetch.deno.ts +0 -23
  314. package/src/_shims/formdata.deno.ts +0 -16
  315. package/src/_shims/formdata.js +0 -9
  316. package/src/_shims/formdata.mjs +0 -11
  317. /package/_shims/{fetch.node.js → fetch-node.js} +0 -0
  318. /package/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
  319. /package/_shims/{formdata.node.d.ts → form-data-node.d.ts} +0 -0
  320. /package/_shims/{formdata.node.js → form-data-node.js} +0 -0
  321. /package/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
  322. /package/_shims/{formdata.d.ts → form-data.d.ts} +0 -0
  323. /package/src/_shims/{ReadableStream.node.ts → ReadableStream-node.ts} +0 -0
  324. /package/src/_shims/{agent.node.ts → agent-node.ts} +0 -0
  325. /package/src/_shims/{fetch.node.js → fetch-node.js} +0 -0
  326. /package/src/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
  327. /package/src/_shims/{formdata.node.js → form-data-node.js} +0 -0
  328. /package/src/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
  329. /package/src/_shims/{node-readable.node.ts → node-readable-node.ts} +0 -0
@@ -1,12 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../../core';
4
- import { APIResource } from '../../resource';
5
- import { isRequestOptions } from '../../core';
6
- import * as LedgerEntries from '../ledger-entries';
7
- import { Versions } from './versions';
8
- import * as API from './index';
9
- import { Page, PageParams } from '../../pagination';
3
+ import * as Core from '../../core.js';
4
+ import { APIResource } from '../../resource.js';
5
+ import { isRequestOptions } from '../../core.js';
6
+ import * as LedgerEntries from '../ledger-entries.js';
7
+ import { Versions } from './versions.js';
8
+ import * as API from './index.js';
9
+ import { Page, PageParams } from '../../pagination.js';
10
10
 
11
11
  export class LedgerTransactions extends APIResource {
12
12
  versions: Versions = new Versions(this.client);
@@ -18,11 +18,17 @@ export class LedgerTransactions extends APIResource {
18
18
  params: LedgerTransactionCreateParams,
19
19
  options?: Core.RequestOptions,
20
20
  ): Core.APIPromise<LedgerTransaction> {
21
+ // @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
21
22
  const { 'Idempotency-Key': idempotencyKey, ...body } = params;
23
+ if (idempotencyKey) {
24
+ console.warn(
25
+ "The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
26
+ );
27
+ }
22
28
  return this.post('/api/ledger_transactions', {
23
29
  body,
24
30
  ...options,
25
- headers: { 'Idempotency-Key': idempotencyKey || '', ...options?.headers },
31
+ headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
26
32
  });
27
33
  }
28
34
 
@@ -193,44 +199,43 @@ export interface LedgerTransaction {
193
199
 
194
200
  export interface LedgerTransactionCreateParams {
195
201
  /**
196
- * Body param: An array of ledger entry objects.
202
+ * An array of ledger entry objects.
197
203
  */
198
204
  ledger_entries: Array<LedgerTransactionCreateParams.LedgerEntry>;
199
205
 
200
206
  /**
201
- * Body param: An optional description for internal use.
207
+ * An optional description for internal use.
202
208
  */
203
209
  description?: string | null;
204
210
 
205
211
  /**
206
- * Body param: The timestamp (ISO8601 format) at which the ledger transaction
207
- * happened for reporting purposes.
212
+ * The timestamp (ISO8601 format) at which the ledger transaction happened for
213
+ * reporting purposes.
208
214
  */
209
215
  effective_at?: string;
210
216
 
211
217
  /**
212
- * Body param: The date (YYYY-MM-DD) on which the ledger transaction happened for
213
- * reporting purposes.
218
+ * The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
219
+ * purposes.
214
220
  */
215
221
  effective_date?: string;
216
222
 
217
223
  /**
218
- * Body param: A unique string to represent the ledger transaction. Only one
219
- * pending or posted ledger transaction may have this ID in the ledger.
224
+ * A unique string to represent the ledger transaction. Only one pending or posted
225
+ * ledger transaction may have this ID in the ledger.
220
226
  */
221
227
  external_id?: string;
222
228
 
223
229
  /**
224
- * Body param: If the ledger transaction can be reconciled to another object in
225
- * Modern Treasury, the id will be populated here, otherwise null.
230
+ * If the ledger transaction can be reconciled to another object in Modern
231
+ * Treasury, the id will be populated here, otherwise null.
226
232
  */
227
233
  ledgerable_id?: string;
228
234
 
229
235
  /**
230
- * Body param: If the ledger transaction can be reconciled to another object in
231
- * Modern Treasury, the type will be populated here, otherwise null. This can be
232
- * one of payment_order, incoming_payment_detail, expected_payment, return, or
233
- * reversal.
236
+ * If the ledger transaction can be reconciled to another object in Modern
237
+ * Treasury, the type will be populated here, otherwise null. This can be one of
238
+ * payment_order, incoming_payment_detail, expected_payment, return, or reversal.
234
239
  */
235
240
  ledgerable_type?:
236
241
  | 'counterparty'
@@ -245,21 +250,15 @@ export interface LedgerTransactionCreateParams {
245
250
  | 'reversal';
246
251
 
247
252
  /**
248
- * Body param: Additional data represented as key-value pairs. Both the key and
249
- * value must be strings.
253
+ * Additional data represented as key-value pairs. Both the key and value must be
254
+ * strings.
250
255
  */
251
256
  metadata?: Record<string, string>;
252
257
 
253
258
  /**
254
- * Body param: To post a ledger transaction at creation, use `posted`.
259
+ * To post a ledger transaction at creation, use `posted`.
255
260
  */
256
261
  status?: 'archived' | 'pending' | 'posted';
257
-
258
- /**
259
- * Header param: This key should be something unique, preferably something like an
260
- * UUID.
261
- */
262
- 'Idempotency-Key'?: string;
263
262
  }
264
263
 
265
264
  export namespace LedgerTransactionCreateParams {
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../../core';
4
- import { APIResource } from '../../resource';
5
- import { isRequestOptions } from '../../core';
6
- import * as API from './index';
7
- import { Page, PageParams } from '../../pagination';
3
+ import * as Core from '../../core.js';
4
+ import { APIResource } from '../../resource.js';
5
+ import { isRequestOptions } from '../../core.js';
6
+ import * as API from './index.js';
7
+ import { Page, PageParams } from '../../pagination.js';
8
8
 
9
9
  export class Versions extends APIResource {
10
10
  /**
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../core';
4
- import { APIResource } from '../resource';
5
- import * as API from './index';
3
+ import * as Core from '../core.js';
4
+ import { APIResource } from '../resource.js';
5
+ import * as API from './index.js';
6
6
 
7
7
  export class LedgerableEvents extends APIResource {
8
8
  /**
@@ -13,11 +13,17 @@ export class LedgerableEvents extends APIResource {
13
13
  params: LedgerableEventCreateParams,
14
14
  options?: Core.RequestOptions,
15
15
  ): Core.APIPromise<LedgerableEvent> {
16
+ // @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
16
17
  const { 'Idempotency-Key': idempotencyKey, ...body } = params;
18
+ if (idempotencyKey) {
19
+ console.warn(
20
+ "The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
21
+ );
22
+ }
17
23
  return this.post('/api/ledgerable_events', {
18
24
  body,
19
25
  ...options,
20
- headers: { 'Idempotency-Key': idempotencyKey || '', ...options?.headers },
26
+ headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
21
27
  });
22
28
  }
23
29
 
@@ -95,53 +101,47 @@ export interface LedgerableEvent {
95
101
 
96
102
  export interface LedgerableEventCreateParams {
97
103
  /**
98
- * Body param: Value in specified currency's smallest unit. e.g. $10 would be
99
- * represented as 1000.
104
+ * Value in specified currency's smallest unit. e.g. $10 would be represented
105
+ * as 1000.
100
106
  */
101
107
  amount: number;
102
108
 
103
109
  /**
104
- * Body param: Name of the ledgerable event.
110
+ * Name of the ledgerable event.
105
111
  */
106
112
  name: string;
107
113
 
108
114
  /**
109
- * Body param: An ISO 4217 conformed currency or a custom currency.
115
+ * An ISO 4217 conformed currency or a custom currency.
110
116
  */
111
117
  currency?: string | null;
112
118
 
113
119
  /**
114
- * Body param: Must be included if currency is a custom currency. The
115
- * currency_exponent cannot exceed 30.
120
+ * Must be included if currency is a custom currency. The currency_exponent cannot
121
+ * exceed 30.
116
122
  */
117
123
  currency_exponent?: number | null;
118
124
 
119
125
  /**
120
- * Body param: Additionally data to be used by the Ledger Event Handler.
126
+ * Additionally data to be used by the Ledger Event Handler.
121
127
  */
122
128
  custom_data?: unknown | null;
123
129
 
124
130
  /**
125
- * Body param: Description of the ledgerable event.
131
+ * Description of the ledgerable event.
126
132
  */
127
133
  description?: string | null;
128
134
 
129
135
  /**
130
- * Body param: One of `credit`, `debit`.
136
+ * One of `credit`, `debit`.
131
137
  */
132
138
  direction?: string | null;
133
139
 
134
140
  /**
135
- * Body param: Additional data represented as key-value pairs. Both the key and
136
- * value must be strings.
141
+ * Additional data represented as key-value pairs. Both the key and value must be
142
+ * strings.
137
143
  */
138
144
  metadata?: Record<string, string>;
139
-
140
- /**
141
- * Header param: This key should be something unique, preferably something like an
142
- * UUID.
143
- */
144
- 'Idempotency-Key'?: string;
145
145
  }
146
146
 
147
147
  export namespace LedgerableEvents {
@@ -1,21 +1,27 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../core';
4
- import { APIResource } from '../resource';
5
- import { isRequestOptions } from '../core';
6
- import * as API from './index';
7
- import { Page, PageParams } from '../pagination';
3
+ import * as Core from '../core.js';
4
+ import { APIResource } from '../resource.js';
5
+ import { isRequestOptions } from '../core.js';
6
+ import * as API from './index.js';
7
+ import { Page, PageParams } from '../pagination.js';
8
8
 
9
9
  export class Ledgers extends APIResource {
10
10
  /**
11
11
  * Create a ledger.
12
12
  */
13
13
  create(params: LedgerCreateParams, options?: Core.RequestOptions): Core.APIPromise<Ledger> {
14
+ // @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
14
15
  const { 'Idempotency-Key': idempotencyKey, ...body } = params;
16
+ if (idempotencyKey) {
17
+ console.warn(
18
+ "The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
19
+ );
20
+ }
15
21
  return this.post('/api/ledgers', {
16
22
  body,
17
23
  ...options,
18
- headers: { 'Idempotency-Key': idempotencyKey || '', ...options?.headers },
24
+ headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
19
25
  });
20
26
  }
21
27
 
@@ -106,26 +112,20 @@ export interface Ledger {
106
112
 
107
113
  export interface LedgerCreateParams {
108
114
  /**
109
- * Body param: The name of the ledger.
115
+ * The name of the ledger.
110
116
  */
111
117
  name: string;
112
118
 
113
119
  /**
114
- * Body param: An optional free-form description for internal use.
120
+ * An optional free-form description for internal use.
115
121
  */
116
122
  description?: string | null;
117
123
 
118
124
  /**
119
- * Body param: Additional data represented as key-value pairs. Both the key and
120
- * value must be strings.
125
+ * Additional data represented as key-value pairs. Both the key and value must be
126
+ * strings.
121
127
  */
122
128
  metadata?: Record<string, string>;
123
-
124
- /**
125
- * Header param: This key should be something unique, preferably something like an
126
- * UUID.
127
- */
128
- 'Idempotency-Key'?: string;
129
129
  }
130
130
 
131
131
  export interface LedgerUpdateParams {
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../core';
4
- import { APIResource } from '../resource';
5
- import { isRequestOptions } from '../core';
6
- import * as API from './index';
7
- import { Page, PageParams } from '../pagination';
3
+ import * as Core from '../core.js';
4
+ import { APIResource } from '../resource.js';
5
+ import { isRequestOptions } from '../core.js';
6
+ import * as API from './index.js';
7
+ import { Page, PageParams } from '../pagination.js';
8
8
 
9
9
  export class LineItems extends APIResource {
10
10
  /**
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../core';
4
- import { APIResource } from '../resource';
5
- import { isRequestOptions } from '../core';
6
- import * as Shared from './shared';
7
- import * as API from './index';
8
- import { Page, PageParams } from '../pagination';
3
+ import * as Core from '../core.js';
4
+ import { APIResource } from '../resource.js';
5
+ import { isRequestOptions } from '../core.js';
6
+ import * as Shared from './shared.js';
7
+ import * as API from './index.js';
8
+ import { Page, PageParams } from '../pagination.js';
9
9
 
10
10
  export class PaperItems extends APIResource {
11
11
  /**
@@ -1,46 +1,35 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../core';
4
- import { APIResource } from '../resource';
5
- import { isRequestOptions } from '../core';
6
- import * as API from './index';
7
- import { Page, PageParams } from '../pagination';
3
+ import * as Core from '../core.js';
4
+ import { APIResource } from '../resource.js';
5
+ import { isRequestOptions } from '../core.js';
6
+ import * as API from './index.js';
7
+ import { Page, PageParams } from '../pagination.js';
8
8
 
9
9
  export class PaymentFlows extends APIResource {
10
10
  /**
11
11
  * create payment_flow
12
12
  */
13
13
  create(params: PaymentFlowCreateParams, options?: Core.RequestOptions): Core.APIPromise<PaymentFlow> {
14
+ // @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
14
15
  const { 'Idempotency-Key': idempotencyKey, ...body } = params;
16
+ if (idempotencyKey) {
17
+ console.warn(
18
+ "The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
19
+ );
20
+ }
15
21
  return this.post('/api/payment_flows', {
16
22
  body,
17
23
  ...options,
18
- headers: { 'Idempotency-Key': idempotencyKey || '', ...options?.headers },
24
+ headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
19
25
  });
20
26
  }
21
27
 
22
28
  /**
23
29
  * get payment_flow
24
30
  */
25
- retrieve(
26
- id: string,
27
- query?: PaymentFlowRetrieveParams,
28
- options?: Core.RequestOptions,
29
- ): Core.APIPromise<PaymentFlow>;
30
- retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<PaymentFlow>;
31
- retrieve(
32
- id: string,
33
- query: PaymentFlowRetrieveParams | Core.RequestOptions = {},
34
- options?: Core.RequestOptions,
35
- ): Core.APIPromise<PaymentFlow> {
36
- if (isRequestOptions(query)) {
37
- return this.retrieve(id, {}, query);
38
- }
39
- const { 'Idempotency-Key': idempotencyKey } = query;
40
- return this.get(`/api/payment_flows/${id}`, {
41
- ...options,
42
- headers: { 'Idempotency-Key': idempotencyKey || '', ...options?.headers },
43
- });
31
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<PaymentFlow> {
32
+ return this.get(`/api/payment_flows/${id}`, options);
44
33
  }
45
34
 
46
35
  /**
@@ -51,11 +40,17 @@ export class PaymentFlows extends APIResource {
51
40
  params: PaymentFlowUpdateParams,
52
41
  options?: Core.RequestOptions,
53
42
  ): Core.APIPromise<PaymentFlow> {
43
+ // @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
54
44
  const { 'Idempotency-Key': idempotencyKey, ...body } = params;
45
+ if (idempotencyKey) {
46
+ console.warn(
47
+ "The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
48
+ );
49
+ }
55
50
  return this.patch(`/api/payment_flows/${id}`, {
56
51
  body,
57
52
  ...options,
58
- headers: { 'Idempotency-Key': idempotencyKey || '', ...options?.headers },
53
+ headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
59
54
  });
60
55
  }
61
56
 
@@ -150,61 +145,40 @@ export interface PaymentFlow {
150
145
 
151
146
  export interface PaymentFlowCreateParams {
152
147
  /**
153
- * Body param: Required. Value in specified currency's smallest unit. e.g. $10
154
- * would be represented as 1000. Can be any integer up to 36 digits.
148
+ * Required. Value in specified currency's smallest unit. e.g. $10 would be
149
+ * represented as 1000. Can be any integer up to 36 digits.
155
150
  */
156
151
  amount: number;
157
152
 
158
153
  /**
159
- * Body param: Required. The ID of a counterparty associated with the payment. As
160
- * part of the payment workflow an external account will be associated with this
161
- * model.
154
+ * Required. The ID of a counterparty associated with the payment. As part of the
155
+ * payment workflow an external account will be associated with this model.
162
156
  */
163
157
  counterparty_id: string;
164
158
 
165
159
  /**
166
- * Body param: Required. The currency of the payment.
160
+ * Required. The currency of the payment.
167
161
  */
168
162
  currency: string;
169
163
 
170
164
  /**
171
- * Body param: Required. Describes the direction money is flowing in the
172
- * transaction. Can only be `debit`. A `debit` pulls money from someone else's
173
- * account to your own.
165
+ * Required. Describes the direction money is flowing in the transaction. Can only
166
+ * be `debit`. A `debit` pulls money from someone else's account to your own.
174
167
  */
175
168
  direction: 'credit' | 'debit';
176
169
 
177
170
  /**
178
- * Body param: Required. The ID of one of your organization's internal accounts.
171
+ * Required. The ID of one of your organization's internal accounts.
179
172
  */
180
173
  originating_account_id: string;
181
-
182
- /**
183
- * Header param: This key should be something unique, preferably something like an
184
- * UUID.
185
- */
186
- 'Idempotency-Key'?: string;
187
- }
188
-
189
- export interface PaymentFlowRetrieveParams {
190
- /**
191
- * This key should be something unique, preferably something like an UUID.
192
- */
193
- 'Idempotency-Key'?: string;
194
174
  }
195
175
 
196
176
  export interface PaymentFlowUpdateParams {
197
177
  /**
198
- * Body param: Required. The updated status of the payment flow. Can only be used
199
- * to mark a flow as `cancelled`.
178
+ * Required. The updated status of the payment flow. Can only be used to mark a
179
+ * flow as `cancelled`.
200
180
  */
201
181
  status: 'cancelled';
202
-
203
- /**
204
- * Header param: This key should be something unique, preferably something like an
205
- * UUID.
206
- */
207
- 'Idempotency-Key'?: string;
208
182
  }
209
183
 
210
184
  export interface PaymentFlowListParams extends PageParams {
@@ -225,7 +199,6 @@ export namespace PaymentFlows {
225
199
  export import PaymentFlow = API.PaymentFlow;
226
200
  export type PaymentFlowsPage = _PaymentFlowsPage;
227
201
  export import PaymentFlowCreateParams = API.PaymentFlowCreateParams;
228
- export import PaymentFlowRetrieveParams = API.PaymentFlowRetrieveParams;
229
202
  export import PaymentFlowUpdateParams = API.PaymentFlowUpdateParams;
230
203
  export import PaymentFlowListParams = API.PaymentFlowListParams;
231
204
  }
@@ -10,5 +10,5 @@ export {
10
10
  PaymentOrderCreateAsyncParams,
11
11
  PaymentOrdersPage,
12
12
  PaymentOrders,
13
- } from './payment-orders';
14
- export { Reversal, ReversalCreateParams, ReversalListParams, ReversalsPage, Reversals } from './reversals';
13
+ } from './payment-orders.js';
14
+ export { Reversal, ReversalCreateParams, ReversalListParams, ReversalsPage, Reversals } from './reversals.js';