increase 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/CHANGELOG.md +275 -0
  2. package/LICENSE +201 -0
  3. package/README.md +243 -0
  4. package/_shims/formdata.node.d.ts +1 -0
  5. package/core.d.ts +9 -1
  6. package/core.d.ts.map +1 -1
  7. package/core.js +61 -18
  8. package/core.js.map +1 -1
  9. package/core.mjs +59 -18
  10. package/core.mjs.map +1 -1
  11. package/error.d.ts +17 -0
  12. package/error.d.ts.map +1 -1
  13. package/error.js +24 -0
  14. package/error.js.map +1 -1
  15. package/error.mjs +20 -0
  16. package/error.mjs.map +1 -1
  17. package/index.d.mts +13 -1
  18. package/index.d.ts +13 -1
  19. package/index.d.ts.map +1 -1
  20. package/index.js +11 -1
  21. package/index.js.map +1 -1
  22. package/index.mjs +8 -0
  23. package/index.mjs.map +1 -1
  24. package/package.json +2 -2
  25. package/resources/account-transfers.d.ts +14 -0
  26. package/resources/account-transfers.d.ts.map +1 -1
  27. package/resources/account-transfers.js.map +1 -1
  28. package/resources/account-transfers.mjs.map +1 -1
  29. package/resources/ach-transfers.d.ts +42 -1
  30. package/resources/ach-transfers.d.ts.map +1 -1
  31. package/resources/ach-transfers.js.map +1 -1
  32. package/resources/ach-transfers.mjs.map +1 -1
  33. package/resources/bookkeeping-entry-sets.d.ts +2 -2
  34. package/resources/card-profiles.d.ts +46 -0
  35. package/resources/card-profiles.d.ts.map +1 -1
  36. package/resources/card-profiles.js.map +1 -1
  37. package/resources/card-profiles.mjs.map +1 -1
  38. package/resources/check-transfers.d.ts +14 -0
  39. package/resources/check-transfers.d.ts.map +1 -1
  40. package/resources/check-transfers.js.map +1 -1
  41. package/resources/check-transfers.mjs.map +1 -1
  42. package/resources/declined-transactions.d.ts +5 -0
  43. package/resources/declined-transactions.d.ts.map +1 -1
  44. package/resources/declined-transactions.js.map +1 -1
  45. package/resources/declined-transactions.mjs.map +1 -1
  46. package/resources/entities/entities.d.ts +55 -10
  47. package/resources/entities/entities.d.ts.map +1 -1
  48. package/resources/entities/entities.js.map +1 -1
  49. package/resources/entities/entities.mjs.map +1 -1
  50. package/resources/files.d.ts +10 -9
  51. package/resources/files.d.ts.map +1 -1
  52. package/resources/files.js.map +1 -1
  53. package/resources/files.mjs.map +1 -1
  54. package/resources/pending-transactions.d.ts +10 -0
  55. package/resources/pending-transactions.d.ts.map +1 -1
  56. package/resources/pending-transactions.js.map +1 -1
  57. package/resources/pending-transactions.mjs.map +1 -1
  58. package/resources/real-time-decisions.d.ts +5 -0
  59. package/resources/real-time-decisions.d.ts.map +1 -1
  60. package/resources/real-time-decisions.js.map +1 -1
  61. package/resources/real-time-decisions.mjs.map +1 -1
  62. package/resources/real-time-payments-transfers.d.ts +14 -0
  63. package/resources/real-time-payments-transfers.d.ts.map +1 -1
  64. package/resources/real-time-payments-transfers.js.map +1 -1
  65. package/resources/real-time-payments-transfers.mjs.map +1 -1
  66. package/resources/simulations/ach-transfers.d.ts +5 -0
  67. package/resources/simulations/ach-transfers.d.ts.map +1 -1
  68. package/resources/simulations/ach-transfers.js.map +1 -1
  69. package/resources/simulations/ach-transfers.mjs.map +1 -1
  70. package/resources/simulations/cards.d.ts +19 -0
  71. package/resources/simulations/cards.d.ts.map +1 -1
  72. package/resources/simulations/cards.js.map +1 -1
  73. package/resources/simulations/cards.mjs.map +1 -1
  74. package/resources/simulations/inbound-funds-holds.d.ts +74 -0
  75. package/resources/simulations/inbound-funds-holds.d.ts.map +1 -0
  76. package/resources/simulations/inbound-funds-holds.js +19 -0
  77. package/resources/simulations/inbound-funds-holds.js.map +1 -0
  78. package/resources/simulations/inbound-funds-holds.mjs +13 -0
  79. package/resources/simulations/inbound-funds-holds.mjs.map +1 -0
  80. package/resources/simulations/index.d.ts +1 -0
  81. package/resources/simulations/index.d.ts.map +1 -1
  82. package/resources/simulations/index.js +8 -0
  83. package/resources/simulations/index.js.map +1 -1
  84. package/resources/simulations/index.mjs +1 -0
  85. package/resources/simulations/index.mjs.map +1 -1
  86. package/resources/simulations/real-time-payments-transfers.d.ts +5 -0
  87. package/resources/simulations/real-time-payments-transfers.d.ts.map +1 -1
  88. package/resources/simulations/real-time-payments-transfers.js.map +1 -1
  89. package/resources/simulations/real-time-payments-transfers.mjs.map +1 -1
  90. package/resources/simulations/simulations.d.ts +4 -0
  91. package/resources/simulations/simulations.d.ts.map +1 -1
  92. package/resources/simulations/simulations.js +3 -0
  93. package/resources/simulations/simulations.js.map +1 -1
  94. package/resources/simulations/simulations.mjs +3 -0
  95. package/resources/simulations/simulations.mjs.map +1 -1
  96. package/resources/wire-transfers.d.ts +14 -0
  97. package/resources/wire-transfers.d.ts.map +1 -1
  98. package/resources/wire-transfers.js.map +1 -1
  99. package/resources/wire-transfers.mjs.map +1 -1
  100. package/src/_shims/fileFromPath.node.ts +1 -1
  101. package/src/_shims/fileFromPath.ts +1 -1
  102. package/src/_shims/formdata.node.d.ts +1 -0
  103. package/src/_shims/getMultipartRequestOptions.node.ts +1 -1
  104. package/src/_shims/getMultipartRequestOptions.ts +1 -1
  105. package/src/core.ts +63 -18
  106. package/src/error.ts +40 -0
  107. package/src/index.ts +16 -1
  108. package/src/resources/account-numbers.ts +5 -5
  109. package/src/resources/account-statements.ts +5 -5
  110. package/src/resources/account-transfers.ts +22 -5
  111. package/src/resources/accounts.ts +5 -5
  112. package/src/resources/ach-prenotifications.ts +5 -5
  113. package/src/resources/ach-transfers.ts +50 -6
  114. package/src/resources/balance-lookups.ts +3 -3
  115. package/src/resources/bookkeeping-accounts.ts +5 -5
  116. package/src/resources/bookkeeping-entries.ts +5 -5
  117. package/src/resources/bookkeeping-entry-sets.ts +5 -5
  118. package/src/resources/card-disputes.ts +5 -5
  119. package/src/resources/card-profiles.ts +60 -5
  120. package/src/resources/cards.ts +5 -5
  121. package/src/resources/check-deposits.ts +5 -5
  122. package/src/resources/check-transfers.ts +22 -5
  123. package/src/resources/declined-transactions.ts +12 -6
  124. package/src/resources/digital-wallet-tokens.ts +5 -5
  125. package/src/resources/documents.ts +5 -5
  126. package/src/resources/entities/entities.ts +70 -15
  127. package/src/resources/entities/supplemental-documents.ts +5 -5
  128. package/src/resources/event-subscriptions.ts +5 -5
  129. package/src/resources/events.ts +5 -5
  130. package/src/resources/exports.ts +5 -5
  131. package/src/resources/external-accounts.ts +5 -5
  132. package/src/resources/files.ts +16 -15
  133. package/src/resources/groups.ts +3 -3
  134. package/src/resources/inbound-ach-transfer-returns.ts +5 -5
  135. package/src/resources/inbound-wire-drawdown-requests.ts +5 -5
  136. package/src/resources/limits.ts +5 -5
  137. package/src/resources/oauth-connections.ts +5 -5
  138. package/src/resources/pending-transactions.ts +18 -6
  139. package/src/resources/programs.ts +5 -5
  140. package/src/resources/real-time-decisions.ts +10 -4
  141. package/src/resources/real-time-payments-transfers.ts +22 -5
  142. package/src/resources/routing-numbers.ts +4 -4
  143. package/src/resources/simulations/account-statements.ts +4 -4
  144. package/src/resources/simulations/account-transfers.ts +3 -3
  145. package/src/resources/simulations/ach-transfers.ts +11 -5
  146. package/src/resources/simulations/card-disputes.ts +4 -4
  147. package/src/resources/simulations/card-profiles.ts +3 -3
  148. package/src/resources/simulations/card-refunds.ts +4 -4
  149. package/src/resources/simulations/cards.ts +28 -5
  150. package/src/resources/simulations/check-deposits.ts +3 -3
  151. package/src/resources/simulations/check-transfers.ts +3 -3
  152. package/src/resources/simulations/digital-wallet-token-requests.ts +3 -3
  153. package/src/resources/simulations/documents.ts +4 -4
  154. package/src/resources/simulations/inbound-funds-holds.ts +88 -0
  155. package/src/resources/simulations/inbound-wire-drawdown-requests.ts +4 -4
  156. package/src/resources/simulations/index.ts +1 -0
  157. package/src/resources/simulations/interest-payments.ts +3 -3
  158. package/src/resources/simulations/programs.ts +4 -4
  159. package/src/resources/simulations/real-time-payments-transfers.ts +11 -5
  160. package/src/resources/simulations/simulations.ts +7 -2
  161. package/src/resources/simulations/wire-transfers.ts +3 -3
  162. package/src/resources/transactions.ts +5 -5
  163. package/src/resources/wire-drawdown-requests.ts +5 -5
  164. package/src/resources/wire-transfers.ts +22 -5
  165. package/src/uploads.ts +11 -10
  166. package/src/version.ts +1 -1
  167. package/uploads.d.ts +2 -2
  168. package/uploads.d.ts.map +1 -1
  169. package/uploads.js +3 -2
  170. package/uploads.js.map +1 -1
  171. package/uploads.mjs +3 -2
  172. package/uploads.mjs.map +1 -1
  173. package/version.d.ts +1 -1
  174. package/version.js +1 -1
  175. package/version.mjs +1 -1
  176. package/src/streaming.ts +0 -204
  177. package/streaming.d.ts +0 -14
  178. package/streaming.d.ts.map +0 -1
  179. package/streaming.js +0 -155
  180. package/streaming.js.map +0 -1
  181. package/streaming.mjs +0 -151
  182. package/streaming.mjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as CardDisputes_ from 'increase/resources/card-disputes';
6
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as CardDisputes_ from '../card-disputes';
6
+ import * as API from '.';
7
7
 
8
8
  export class CardDisputes extends APIResource {
9
9
  /**
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as CardProfiles_ from 'increase/resources/card-profiles';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as CardProfiles_ from '../card-profiles';
6
6
 
7
7
  export class CardProfiles extends APIResource {
8
8
  /**
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as Transactions from 'increase/resources/transactions';
6
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as Transactions from '../transactions';
6
+ import * as API from '.';
7
7
 
8
8
  export class CardRefunds extends APIResource {
9
9
  /**
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as Transactions from 'increase/resources/transactions';
6
- import * as Shared from 'increase/resources/shared';
7
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as Transactions from '../transactions';
6
+ import * as Shared from '../shared';
7
+ import * as API from '.';
8
8
 
9
9
  export class Cards extends APIResource {
10
10
  /**
@@ -351,6 +351,12 @@ export namespace CardAuthorizationSimulation {
351
351
  */
352
352
  network_details: CardDecline.NetworkDetails;
353
353
 
354
+ /**
355
+ * If the authorization was made in-person with a physical card, the Physical Card
356
+ * that was used.
357
+ */
358
+ physical_card_id: string | null;
359
+
354
360
  /**
355
361
  * The identifier of the Real-Time Decision sent to approve or decline this
356
362
  * transaction.
@@ -1063,6 +1069,12 @@ export namespace CardAuthorizationSimulation {
1063
1069
  */
1064
1070
  pending_transaction_id: string | null;
1065
1071
 
1072
+ /**
1073
+ * If the authorization was made in-person with a physical card, the Physical Card
1074
+ * that was used.
1075
+ */
1076
+ physical_card_id: string | null;
1077
+
1066
1078
  /**
1067
1079
  * The identifier of the Real-Time Decision sent to approve or decline this
1068
1080
  * transaction.
@@ -1277,6 +1289,12 @@ export namespace CardAuthorizationSimulation {
1277
1289
  * - `complete` - Funds have been released.
1278
1290
  */
1279
1291
  status: 'held' | 'complete';
1292
+
1293
+ /**
1294
+ * A constant representing the object's type. For this resource it will always be
1295
+ * `inbound_funds_hold`.
1296
+ */
1297
+ type: 'inbound_funds_hold';
1280
1298
  }
1281
1299
 
1282
1300
  /**
@@ -1344,6 +1362,11 @@ export interface CardAuthorizeParams {
1344
1362
  * specified event subscription for testing purposes.
1345
1363
  */
1346
1364
  event_subscription_id?: string;
1365
+
1366
+ /**
1367
+ * The identifier of the Physical Card to be authorized.
1368
+ */
1369
+ physical_card_id?: string;
1347
1370
  }
1348
1371
 
1349
1372
  export interface CardSettlementParams {
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as CheckDeposits_ from 'increase/resources/check-deposits';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as CheckDeposits_ from '../check-deposits';
6
6
 
7
7
  export class CheckDeposits extends APIResource {
8
8
  /**
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as CheckTransfers_ from 'increase/resources/check-transfers';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as CheckTransfers_ from '../check-transfers';
6
6
 
7
7
  export class CheckTransfers extends APIResource {
8
8
  /**
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as API from '.';
6
6
 
7
7
  export class DigitalWalletTokenRequests extends APIResource {
8
8
  /**
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as Documents_ from 'increase/resources/documents';
6
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as Documents_ from '../documents';
6
+ import * as API from '.';
7
7
 
8
8
  export class Documents extends APIResource {
9
9
  /**
@@ -0,0 +1,88 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as API from '.';
6
+
7
+ export class InboundFundsHolds extends APIResource {
8
+ /**
9
+ * This endpoint simulates immediately releasing an inbound funds hold, which might
10
+ * be created as a result of e.g., an ACH debit.
11
+ */
12
+ release(
13
+ inboundFundsHoldId: string,
14
+ options?: Core.RequestOptions,
15
+ ): Promise<Core.APIResponse<InboundFundsHoldReleaseResponse>> {
16
+ return this.post(`/simulations/inbound_funds_holds/${inboundFundsHoldId}/release`, options);
17
+ }
18
+ }
19
+
20
+ /**
21
+ * We hold funds for certain transaction types to account for return windows where
22
+ * funds might still be clawed back by the sending institution.
23
+ */
24
+ export interface InboundFundsHoldReleaseResponse {
25
+ /**
26
+ * The held amount in the minor unit of the account's currency. For dollars, for
27
+ * example, this is cents.
28
+ */
29
+ amount: number;
30
+
31
+ /**
32
+ * When the hold will be released automatically. Certain conditions may cause it to
33
+ * be released before this time.
34
+ */
35
+ automatically_releases_at: string;
36
+
37
+ /**
38
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the hold
39
+ * was created.
40
+ */
41
+ created_at: string;
42
+
43
+ /**
44
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the hold's
45
+ * currency.
46
+ *
47
+ * - `CAD` - Canadian Dollar (CAD)
48
+ * - `CHF` - Swiss Franc (CHF)
49
+ * - `EUR` - Euro (EUR)
50
+ * - `GBP` - British Pound (GBP)
51
+ * - `JPY` - Japanese Yen (JPY)
52
+ * - `USD` - US Dollar (USD)
53
+ */
54
+ currency: 'CAD' | 'CHF' | 'EUR' | 'GBP' | 'JPY' | 'USD';
55
+
56
+ /**
57
+ * The ID of the Transaction for which funds were held.
58
+ */
59
+ held_transaction_id: string | null;
60
+
61
+ /**
62
+ * The ID of the Pending Transaction representing the held funds.
63
+ */
64
+ pending_transaction_id: string | null;
65
+
66
+ /**
67
+ * When the hold was released (if it has been released).
68
+ */
69
+ released_at: string | null;
70
+
71
+ /**
72
+ * The status of the hold.
73
+ *
74
+ * - `held` - Funds are still being held.
75
+ * - `complete` - Funds have been released.
76
+ */
77
+ status: 'held' | 'complete';
78
+
79
+ /**
80
+ * A constant representing the object's type. For this resource it will always be
81
+ * `inbound_funds_hold`.
82
+ */
83
+ type: 'inbound_funds_hold';
84
+ }
85
+
86
+ export namespace InboundFundsHolds {
87
+ export import InboundFundsHoldReleaseResponse = API.InboundFundsHoldReleaseResponse;
88
+ }
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as InboundWireDrawdownRequests_ from 'increase/resources/inbound-wire-drawdown-requests';
6
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as InboundWireDrawdownRequests_ from '../inbound-wire-drawdown-requests';
6
+ import * as API from '.';
7
7
 
8
8
  export class InboundWireDrawdownRequests extends APIResource {
9
9
  /**
@@ -20,6 +20,7 @@ export {
20
20
  DigitalWalletTokenRequests,
21
21
  } from './digital-wallet-token-requests';
22
22
  export { DocumentCreateParams, Documents } from './documents';
23
+ export { InboundFundsHoldReleaseResponse, InboundFundsHolds } from './inbound-funds-holds';
23
24
  export {
24
25
  InboundRealTimePaymentsTransferSimulationResult,
25
26
  RealTimePaymentsTransferCompleteParams,
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as API from '.';
6
6
 
7
7
  export class InterestPayments extends APIResource {
8
8
  /**
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as Programs_ from 'increase/resources/programs';
6
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as Programs_ from '../programs';
6
+ import * as API from '.';
7
7
 
8
8
  export class Programs extends APIResource {
9
9
  /**
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as RealTimePaymentsTransfers_ from 'increase/resources/real-time-payments-transfers';
6
- import * as Shared from 'increase/resources/shared';
7
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as RealTimePaymentsTransfers_ from '../real-time-payments-transfers';
6
+ import * as Shared from '../shared';
7
+ import * as API from '.';
8
8
 
9
9
  export class RealTimePaymentsTransfers extends APIResource {
10
10
  /**
@@ -350,6 +350,12 @@ export namespace InboundRealTimePaymentsTransferSimulationResult {
350
350
  */
351
351
  network_details: CardDecline.NetworkDetails;
352
352
 
353
+ /**
354
+ * If the authorization was made in-person with a physical card, the Physical Card
355
+ * that was used.
356
+ */
357
+ physical_card_id: string | null;
358
+
353
359
  /**
354
360
  * The identifier of the Real-Time Decision sent to approve or decline this
355
361
  * transaction.
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import { APIResource } from 'increase/resource';
3
+ import { APIResource } from '../../resource';
4
4
  import { AccountTransfers } from './account-transfers';
5
5
  import { AccountStatements } from './account-statements';
6
6
  import { ACHTransfers } from './ach-transfers';
@@ -13,11 +13,12 @@ import { DigitalWalletTokenRequests } from './digital-wallet-token-requests';
13
13
  import { CheckDeposits } from './check-deposits';
14
14
  import { Programs } from './programs';
15
15
  import { InboundWireDrawdownRequests } from './inbound-wire-drawdown-requests';
16
+ import { InboundFundsHolds } from './inbound-funds-holds';
16
17
  import { InterestPayments } from './interest-payments';
17
18
  import { WireTransfers } from './wire-transfers';
18
19
  import { Cards } from './cards';
19
20
  import { RealTimePaymentsTransfers } from './real-time-payments-transfers';
20
- import * as API from './';
21
+ import * as API from '.';
21
22
 
22
23
  export class Simulations extends APIResource {
23
24
  accountTransfers: AccountTransfers = new AccountTransfers(this.client);
@@ -32,6 +33,7 @@ export class Simulations extends APIResource {
32
33
  checkDeposits: CheckDeposits = new CheckDeposits(this.client);
33
34
  programs: Programs = new Programs(this.client);
34
35
  inboundWireDrawdownRequests: InboundWireDrawdownRequests = new InboundWireDrawdownRequests(this.client);
36
+ inboundFundsHolds: InboundFundsHolds = new InboundFundsHolds(this.client);
35
37
  interestPayments: InterestPayments = new InterestPayments(this.client);
36
38
  wireTransfers: WireTransfers = new WireTransfers(this.client);
37
39
  cards: Cards = new Cards(this.client);
@@ -74,6 +76,9 @@ export namespace Simulations {
74
76
  export import InboundWireDrawdownRequests = API.InboundWireDrawdownRequests;
75
77
  export import InboundWireDrawdownRequestCreateParams = API.InboundWireDrawdownRequestCreateParams;
76
78
 
79
+ export import InboundFundsHolds = API.InboundFundsHolds;
80
+ export import InboundFundsHoldReleaseResponse = API.InboundFundsHoldReleaseResponse;
81
+
77
82
  export import InterestPayments = API.InterestPayments;
78
83
  export import InterestPaymentSimulationResult = API.InterestPaymentSimulationResult;
79
84
  export import InterestPaymentCreateParams = API.InterestPaymentCreateParams;
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import * as API from './';
3
+ import * as Core from '../../core';
4
+ import { APIResource } from '../../resource';
5
+ import * as API from '.';
6
6
 
7
7
  export class WireTransfers extends APIResource {
8
8
  /**
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import { isRequestOptions } from 'increase/core';
6
- import * as API from './';
7
- import { Page, PageParams } from 'increase/pagination';
3
+ import * as Core from '../core';
4
+ import { APIResource } from '../resource';
5
+ import { isRequestOptions } from '../core';
6
+ import * as API from '.';
7
+ import { Page, PageParams } from '../pagination';
8
8
 
9
9
  export class Transactions extends APIResource {
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import { isRequestOptions } from 'increase/core';
6
- import * as API from './';
7
- import { Page, PageParams } from 'increase/pagination';
3
+ import * as Core from '../core';
4
+ import { APIResource } from '../resource';
5
+ import { isRequestOptions } from '../core';
6
+ import * as API from '.';
7
+ import { Page, PageParams } from '../pagination';
8
8
 
9
9
  export class WireDrawdownRequests extends APIResource {
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from 'increase/core';
4
- import { APIResource } from 'increase/resource';
5
- import { isRequestOptions } from 'increase/core';
6
- import * as API from './';
7
- import { Page, PageParams } from 'increase/pagination';
3
+ import * as Core from '../core';
4
+ import { APIResource } from '../resource';
5
+ import { isRequestOptions } from '../core';
6
+ import * as API from '.';
7
+ import { Page, PageParams } from '../pagination';
8
8
 
9
9
  export class WireTransfers extends APIResource {
10
10
  /**
@@ -215,6 +215,11 @@ export interface WireTransfer {
215
215
  * `wire_transfer`.
216
216
  */
217
217
  type: 'wire_transfer';
218
+
219
+ /**
220
+ * The unique identifier you chose for this transfer.
221
+ */
222
+ unique_identifier: string | null;
218
223
  }
219
224
 
220
225
  export namespace WireTransfer {
@@ -410,6 +415,13 @@ export interface WireTransferCreateParams {
410
415
  * destination account.
411
416
  */
412
417
  routing_number?: string;
418
+
419
+ /**
420
+ * A unique identifier you choose for the transfer. Reusing this identifer for
421
+ * another transfer will result in an error. You can query for the transfer
422
+ * associated with this identifier using the List endpoint.
423
+ */
424
+ unique_identifier?: string;
413
425
  }
414
426
 
415
427
  export interface WireTransferListParams extends PageParams {
@@ -424,6 +436,11 @@ export interface WireTransferListParams extends PageParams {
424
436
  * Filter Wire Transfers to those made to the specified External Account.
425
437
  */
426
438
  external_account_id?: string;
439
+
440
+ /**
441
+ * Filter Wire Transfers to the one with the specified unique identifier.
442
+ */
443
+ unique_identifier?: string;
427
444
  }
428
445
 
429
446
  export namespace WireTransferListParams {
package/src/uploads.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { type RequestOptions } from './core';
2
- import { type Readable } from 'increase/_shims/node-readable';
3
- import { type BodyInit } from 'increase/_shims/fetch';
4
- import { FormData, File, type FilePropertyBag } from 'increase/_shims/formdata';
5
- import { getMultipartRequestOptions } from 'increase/_shims/getMultipartRequestOptions';
6
- import { fileFromPath } from 'increase/_shims/fileFromPath';
7
- import { type FsReadStream, isFsReadStream } from 'increase/_shims/node-readable';
2
+ import { type Readable } from './_shims/node-readable';
3
+ import { type BodyInit } from './_shims/fetch.js';
4
+ import { FormData, File, type FilePropertyBag } from './_shims/formdata.js';
5
+ import { getMultipartRequestOptions } from './_shims/getMultipartRequestOptions';
6
+ import { fileFromPath } from './_shims/fileFromPath';
7
+ import { type FsReadStream, isFsReadStream } from './_shims/node-readable';
8
8
 
9
9
  export { fileFromPath };
10
10
 
@@ -88,7 +88,7 @@ export type ToFileInput = Uploadable | Exclude<BlobPart, string> | AsyncIterable
88
88
 
89
89
  /**
90
90
  * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
91
- * @param bits the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
91
+ * @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
92
92
  * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
93
93
  * @param {Object=} options additional properties
94
94
  * @param {string=} options.type the MIME type of the content
@@ -96,10 +96,13 @@ export type ToFileInput = Uploadable | Exclude<BlobPart, string> | AsyncIterable
96
96
  * @returns a {@link File} with the given properties
97
97
  */
98
98
  export async function toFile(
99
- value: ToFileInput,
99
+ value: ToFileInput | PromiseLike<ToFileInput>,
100
100
  name?: string | null | undefined,
101
101
  options: FilePropertyBag | undefined = {},
102
102
  ): Promise<FileLike> {
103
+ // If it's a promise, resolve it.
104
+ value = await value;
105
+
103
106
  if (isResponseLike(value)) {
104
107
  const blob = await value.blob();
105
108
  name ||= new URL(value.url).pathname.split(/[\\/]/).pop() ?? 'unknown_file';
@@ -122,8 +125,6 @@ export async function toFile(
122
125
  }
123
126
 
124
127
  async function getBytes(value: ToFileInput): Promise<Array<BlobPart>> {
125
- if (value instanceof Promise) return getBytes(await (value as any));
126
-
127
128
  let parts: Array<BlobPart> = [];
128
129
  if (
129
130
  typeof value === 'string' ||
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.6.0'; // x-release-please-version
1
+ export const VERSION = '0.7.1'; // x-release-please-version
package/uploads.d.ts CHANGED
@@ -58,7 +58,7 @@ export declare const isUploadable: (value: any) => value is Uploadable;
58
58
  export type ToFileInput = Uploadable | Exclude<BlobPart, string> | AsyncIterable<BlobPart>;
59
59
  /**
60
60
  * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
61
- * @param bits the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
61
+ * @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
62
62
  * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
63
63
  * @param {Object=} options additional properties
64
64
  * @param {string=} options.type the MIME type of the content
@@ -66,7 +66,7 @@ export type ToFileInput = Uploadable | Exclude<BlobPart, string> | AsyncIterable
66
66
  * @returns a {@link File} with the given properties
67
67
  */
68
68
  export declare function toFile(
69
- value: ToFileInput,
69
+ value: ToFileInput | PromiseLike<ToFileInput>,
70
70
  name?: string | null | undefined,
71
71
  options?: FilePropertyBag | undefined,
72
72
  ): Promise<FileLike>;
package/uploads.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EA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M,CAC1B,KAAK,EAAE,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,EAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,GAAE,eAAe,GAAG,SAAc,GACxC,OAAO,CAAC,QAAQ,CAAC,CAuBnB;AAoDD,qBAAa,aAAa;IACL,IAAI,EAAE,QAAQ,GAAG,QAAQ;gBAAzB,IAAI,EAAE,QAAQ,GAAG,QAAQ;IAC5C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACF;AAED,eAAO,MAAM,eAAe,SAAU,GAAG,0BACsD,CAAC;AAEhG;;;GAGG;AACH,eAAO,MAAM,gCAAgC,iHAO5C,CAAC;AAEF,eAAO,MAAM,2BAA2B,iHAKvC,CAAC;AAEF,eAAO,MAAM,UAAU,wDAA6D,QAAQ,QAAQ,CAInG,CAAC"}
package/uploads.js CHANGED
@@ -58,7 +58,7 @@ const isUploadable = (value) => {
58
58
  exports.isUploadable = isUploadable;
59
59
  /**
60
60
  * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
61
- * @param bits the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
61
+ * @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
62
62
  * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
63
63
  * @param {Object=} options additional properties
64
64
  * @param {string=} options.type the MIME type of the content
@@ -67,6 +67,8 @@ exports.isUploadable = isUploadable;
67
67
  */
68
68
  async function toFile(value, name, options = {}) {
69
69
  var _a, _b, _c;
70
+ // If it's a promise, resolve it.
71
+ value = await value;
70
72
  if ((0, exports.isResponseLike)(value)) {
71
73
  const blob = await value.blob();
72
74
  name ||
@@ -89,7 +91,6 @@ async function toFile(value, name, options = {}) {
89
91
  exports.toFile = toFile;
90
92
  async function getBytes(value) {
91
93
  var _a;
92
- if (value instanceof Promise) return getBytes(await value);
93
94
  let parts = [];
94
95
  if (
95
96
  typeof value === 'string' ||
package/uploads.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.js","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":";;;AAGA,uDAAgF;AAChF,2FAAwF;AACxF,+DAA4D;AAGnD,6FAHA,2BAAY,OAGA;AAFrB,iEAAkF;AAkD3E,MAAM,cAAc,GAAG,CAAC,KAAU,EAAyB,EAAE,CAClE,KAAK,IAAI,IAAI;IACb,OAAO,KAAK,KAAK,QAAQ;IACzB,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ;IAC7B,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AAJtB,QAAA,cAAc,kBAIQ;AAE5B,MAAM,UAAU,GAAG,CAAC,KAAU,EAAqB,EAAE,CAC1D,KAAK,IAAI,IAAI;IACb,OAAO,KAAK,KAAK,QAAQ;IACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;IACtC,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC;AALP,QAAA,UAAU,cAKH;AAEpB;;;GAGG;AACI,MAAM,UAAU,GAAG,CAAC,KAAU,EAA+D,EAAE,CACpG,KAAK,IAAI,IAAI;IACb,OAAO,KAAK,KAAK,QAAQ;IACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;IAChC,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU;IACjC,OAAO,KAAK,CAAC,WAAW,KAAK,UAAU,CAAC;AAP7B,QAAA,UAAU,cAOmB;AAEnC,MAAM,YAAY,GAAG,CAAC,KAAU,EAAuB,EAAE;IAC9D,OAAO,IAAA,kBAAU,EAAC,KAAK,CAAC,IAAI,IAAA,sBAAc,EAAC,KAAK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CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;KAChF;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACpC,MAAM,OAAO,CAAC,GAAG,CACf,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,CACzF,CAAC;KACH;SAAM;QACL,MAAM,IAAI,SAAS,CACjB,wGAAwG,KAAK,UAAU,CACxH,CAAC;KACH;AACH,CAAC,CAAC"}
package/uploads.mjs CHANGED
@@ -31,7 +31,7 @@ export const isUploadable = (value) => {
31
31
  };
32
32
  /**
33
33
  * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
34
- * @param bits the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
34
+ * @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
35
35
  * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
36
36
  * @param {Object=} options additional properties
37
37
  * @param {string=} options.type the MIME type of the content
@@ -40,6 +40,8 @@ export const isUploadable = (value) => {
40
40
  */
41
41
  export async function toFile(value, name, options = {}) {
42
42
  var _a, _b, _c;
43
+ // If it's a promise, resolve it.
44
+ value = await value;
43
45
  if (isResponseLike(value)) {
44
46
  const blob = await value.blob();
45
47
  name ||
@@ -61,7 +63,6 @@ export async function toFile(value, name, options = {}) {
61
63
  }
62
64
  async function getBytes(value) {
63
65
  var _a;
64
- if (value instanceof Promise) return getBytes(await value);
65
66
  let parts = [];
66
67
  if (
67
68
  typeof value === 'string' ||