increase 0.238.0 → 0.240.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 (49) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/core.d.ts +2 -2
  3. package/core.d.ts.map +1 -1
  4. package/core.js +4 -2
  5. package/core.js.map +1 -1
  6. package/core.mjs +4 -2
  7. package/core.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/inbound-wire-transfers.d.ts +5 -0
  10. package/resources/inbound-wire-transfers.d.ts.map +1 -1
  11. package/resources/inbound-wire-transfers.js.map +1 -1
  12. package/resources/inbound-wire-transfers.mjs.map +1 -1
  13. package/resources/simulations/inbound-wire-transfers.d.ts +5 -0
  14. package/resources/simulations/inbound-wire-transfers.d.ts.map +1 -1
  15. package/resources/simulations/index.d.ts +1 -0
  16. package/resources/simulations/index.d.ts.map +1 -1
  17. package/resources/simulations/index.js +3 -1
  18. package/resources/simulations/index.js.map +1 -1
  19. package/resources/simulations/index.mjs +1 -0
  20. package/resources/simulations/index.mjs.map +1 -1
  21. package/resources/simulations/simulations.d.ts +4 -0
  22. package/resources/simulations/simulations.d.ts.map +1 -1
  23. package/resources/simulations/simulations.js +4 -0
  24. package/resources/simulations/simulations.js.map +1 -1
  25. package/resources/simulations/simulations.mjs +4 -0
  26. package/resources/simulations/simulations.mjs.map +1 -1
  27. package/resources/simulations/wire-drawdown-requests.d.ts +18 -0
  28. package/resources/simulations/wire-drawdown-requests.d.ts.map +1 -0
  29. package/resources/simulations/wire-drawdown-requests.js +23 -0
  30. package/resources/simulations/wire-drawdown-requests.js.map +1 -0
  31. package/resources/simulations/wire-drawdown-requests.mjs +19 -0
  32. package/resources/simulations/wire-drawdown-requests.mjs.map +1 -0
  33. package/resources/wire-drawdown-requests.d.ts +181 -84
  34. package/resources/wire-drawdown-requests.d.ts.map +1 -1
  35. package/resources/wire-drawdown-requests.js +15 -4
  36. package/resources/wire-drawdown-requests.js.map +1 -1
  37. package/resources/wire-drawdown-requests.mjs +15 -4
  38. package/resources/wire-drawdown-requests.mjs.map +1 -1
  39. package/src/core.ts +5 -3
  40. package/src/resources/inbound-wire-transfers.ts +6 -0
  41. package/src/resources/simulations/inbound-wire-transfers.ts +6 -0
  42. package/src/resources/simulations/index.ts +1 -0
  43. package/src/resources/simulations/simulations.ts +7 -0
  44. package/src/resources/simulations/wire-drawdown-requests.ts +25 -0
  45. package/src/resources/wire-drawdown-requests.ts +202 -89
  46. package/src/version.ts +1 -1
  47. package/version.d.ts +1 -1
  48. package/version.js +1 -1
  49. package/version.mjs +1 -1
package/src/core.ts CHANGED
@@ -299,10 +299,10 @@ export abstract class APIClient {
299
299
  return null;
300
300
  }
301
301
 
302
- buildRequest<Req>(
302
+ async buildRequest<Req>(
303
303
  inputOptions: FinalRequestOptions<Req>,
304
304
  { retryCount = 0 }: { retryCount?: number } = {},
305
- ): { req: RequestInit; url: string; timeout: number } {
305
+ ): Promise<{ req: RequestInit; url: string; timeout: number }> {
306
306
  const options = { ...inputOptions };
307
307
  const { method, path, query, defaultBaseURL, headers: headers = {} } = options;
308
308
 
@@ -450,7 +450,9 @@ export abstract class APIClient {
450
450
 
451
451
  await this.prepareOptions(options);
452
452
 
453
- const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });
453
+ const { req, url, timeout } = await this.buildRequest(options, {
454
+ retryCount: maxRetries - retriesRemaining,
455
+ });
454
456
 
455
457
  await this.prepareRequest(req, { url, options });
456
458
 
@@ -264,6 +264,12 @@ export interface InboundWireTransferListParams extends PageParams {
264
264
  created_at?: InboundWireTransferListParams.CreatedAt;
265
265
 
266
266
  status?: InboundWireTransferListParams.Status;
267
+
268
+ /**
269
+ * Filter Inbound Wire Transfers to ones belonging to the specified Wire Drawdown
270
+ * Request.
271
+ */
272
+ wire_drawdown_request_id?: string;
267
273
  }
268
274
 
269
275
  export namespace InboundWireTransferListParams {
@@ -126,6 +126,12 @@ export interface InboundWireTransferCreateParams {
126
126
  * value here.
127
127
  */
128
128
  sender_reference?: string;
129
+
130
+ /**
131
+ * The identifier of a Wire Drawdown Request the inbound Wire Transfer is
132
+ * fulfilling.
133
+ */
134
+ wire_drawdown_request_id?: string;
129
135
  }
130
136
 
131
137
  export declare namespace InboundWireTransfers {
@@ -55,4 +55,5 @@ export {
55
55
  type RealTimePaymentsTransferCompleteParams,
56
56
  } from './real-time-payments-transfers';
57
57
  export { Simulations } from './simulations';
58
+ export { WireDrawdownRequests } from './wire-drawdown-requests';
58
59
  export { WireTransfers } from './wire-transfers';
@@ -81,6 +81,8 @@ import {
81
81
  RealTimePaymentsTransferCompleteParams,
82
82
  RealTimePaymentsTransfers,
83
83
  } from './real-time-payments-transfers';
84
+ import * as WireDrawdownRequestsAPI from './wire-drawdown-requests';
85
+ import { WireDrawdownRequests } from './wire-drawdown-requests';
84
86
  import * as WireTransfersAPI from './wire-transfers';
85
87
  import { WireTransfers } from './wire-transfers';
86
88
 
@@ -115,6 +117,8 @@ export class Simulations extends APIResource {
115
117
  wireTransfers: WireTransfersAPI.WireTransfers = new WireTransfersAPI.WireTransfers(this._client);
116
118
  inboundWireTransfers: InboundWireTransfersAPI.InboundWireTransfers =
117
119
  new InboundWireTransfersAPI.InboundWireTransfers(this._client);
120
+ wireDrawdownRequests: WireDrawdownRequestsAPI.WireDrawdownRequests =
121
+ new WireDrawdownRequestsAPI.WireDrawdownRequests(this._client);
118
122
  inboundWireDrawdownRequests: InboundWireDrawdownRequestsAPI.InboundWireDrawdownRequests =
119
123
  new InboundWireDrawdownRequestsAPI.InboundWireDrawdownRequests(this._client);
120
124
  checkTransfers: CheckTransfersAPI.CheckTransfers = new CheckTransfersAPI.CheckTransfers(this._client);
@@ -152,6 +156,7 @@ Simulations.ACHTransfers = ACHTransfers;
152
156
  Simulations.InboundACHTransfers = InboundACHTransfers;
153
157
  Simulations.WireTransfers = WireTransfers;
154
158
  Simulations.InboundWireTransfers = InboundWireTransfers;
159
+ Simulations.WireDrawdownRequests = WireDrawdownRequests;
155
160
  Simulations.InboundWireDrawdownRequests = InboundWireDrawdownRequests;
156
161
  Simulations.CheckTransfers = CheckTransfers;
157
162
  Simulations.InboundCheckDeposits = InboundCheckDeposits;
@@ -235,6 +240,8 @@ export declare namespace Simulations {
235
240
  type InboundWireTransferCreateParams as InboundWireTransferCreateParams,
236
241
  };
237
242
 
243
+ export { WireDrawdownRequests as WireDrawdownRequests };
244
+
238
245
  export {
239
246
  InboundWireDrawdownRequests as InboundWireDrawdownRequests,
240
247
  type InboundWireDrawdownRequestCreateParams as InboundWireDrawdownRequestCreateParams,
@@ -0,0 +1,25 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as WireDrawdownRequestsAPI from '../wire-drawdown-requests';
6
+
7
+ export class WireDrawdownRequests extends APIResource {
8
+ /**
9
+ * Simulates a Wire Drawdown Request being refused by the debtor.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const wireDrawdownRequest =
14
+ * await client.simulations.wireDrawdownRequests.refuse(
15
+ * 'wire_drawdown_request_q6lmocus3glo0lr2bfv3',
16
+ * );
17
+ * ```
18
+ */
19
+ refuse(
20
+ wireDrawdownRequestId: string,
21
+ options?: Core.RequestOptions,
22
+ ): Core.APIPromise<WireDrawdownRequestsAPI.WireDrawdownRequest> {
23
+ return this._client.post(`/simulations/wire_drawdown_requests/${wireDrawdownRequestId}/refuse`, options);
24
+ }
25
+ }
@@ -16,10 +16,21 @@ export class WireDrawdownRequests extends APIResource {
16
16
  * account_number_id:
17
17
  * 'account_number_v18nkfqm6afpsrvy82b2',
18
18
  * amount: 10000,
19
- * message_to_recipient: 'Invoice 29582',
20
- * recipient_account_number: '987654321',
21
- * recipient_name: 'Ian Crease',
22
- * recipient_routing_number: '101050001',
19
+ * creditor_address: {
20
+ * city: 'New York',
21
+ * country: 'US',
22
+ * line1: '33 Liberty Street',
23
+ * },
24
+ * creditor_name: 'National Phonograph Company',
25
+ * debtor_account_number: '987654321',
26
+ * debtor_address: {
27
+ * city: 'New York',
28
+ * country: 'US',
29
+ * line1: '33 Liberty Street',
30
+ * },
31
+ * debtor_name: 'Ian Crease',
32
+ * debtor_routing_number: '101050001',
33
+ * unstructured_remittance_information: 'Invoice 29582',
23
34
  * });
24
35
  * ```
25
36
  */
@@ -95,8 +106,8 @@ export interface WireDrawdownRequest {
95
106
  id: string;
96
107
 
97
108
  /**
98
- * The Account Number to which the recipient of this request is being requested to
99
- * send funds.
109
+ * The Account Number to which the debtor—the recipient of this requestis being
110
+ * requested to send funds.
100
111
  */
101
112
  account_number_id: string;
102
113
 
@@ -112,78 +123,53 @@ export interface WireDrawdownRequest {
112
123
  created_at: string;
113
124
 
114
125
  /**
115
- * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the amount being
116
- * requested. Will always be "USD".
117
- */
118
- currency: string;
119
-
120
- /**
121
- * If the recipient fulfills the drawdown request by sending funds, then this will
122
- * be the identifier of the corresponding Transaction.
123
- */
124
- fulfillment_inbound_wire_transfer_id: string | null;
125
-
126
- /**
127
- * The idempotency key you chose for this object. This value is unique across
128
- * Increase and is used to ensure that a request is only processed once. Learn more
129
- * about [idempotency](https://increase.com/documentation/idempotency-keys).
126
+ * The creditor's address.
130
127
  */
131
- idempotency_key: string | null;
132
-
133
- /**
134
- * The message the recipient will see as part of the drawdown request.
135
- */
136
- message_to_recipient: string;
128
+ creditor_address: WireDrawdownRequest.CreditorAddress;
137
129
 
138
130
  /**
139
- * The originator's address line 1.
131
+ * The creditor's name.
140
132
  */
141
- originator_address_line1: string | null;
133
+ creditor_name: string;
142
134
 
143
135
  /**
144
- * The originator's address line 2.
145
- */
146
- originator_address_line2: string | null;
147
-
148
- /**
149
- * The originator's address line 3.
150
- */
151
- originator_address_line3: string | null;
152
-
153
- /**
154
- * The originator's name.
136
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the amount being
137
+ * requested. Will always be "USD".
155
138
  */
156
- originator_name: string | null;
139
+ currency: string;
157
140
 
158
141
  /**
159
- * The drawdown request's recipient's account number.
142
+ * The debtor's account number.
160
143
  */
161
- recipient_account_number: string;
144
+ debtor_account_number: string;
162
145
 
163
146
  /**
164
- * Line 1 of the drawdown request's recipient's address.
147
+ * The debtor's address.
165
148
  */
166
- recipient_address_line1: string | null;
149
+ debtor_address: WireDrawdownRequest.DebtorAddress;
167
150
 
168
151
  /**
169
- * Line 2 of the drawdown request's recipient's address.
152
+ * The debtor's name.
170
153
  */
171
- recipient_address_line2: string | null;
154
+ debtor_name: string;
172
155
 
173
156
  /**
174
- * Line 3 of the drawdown request's recipient's address.
157
+ * The debtor's routing number.
175
158
  */
176
- recipient_address_line3: string | null;
159
+ debtor_routing_number: string;
177
160
 
178
161
  /**
179
- * The drawdown request's recipient's name.
162
+ * If the recipient fulfills the drawdown request by sending funds, then this will
163
+ * be the identifier of the corresponding Transaction.
180
164
  */
181
- recipient_name: string | null;
165
+ fulfillment_inbound_wire_transfer_id: string | null;
182
166
 
183
167
  /**
184
- * The drawdown request's recipient's routing number.
168
+ * The idempotency key you chose for this object. This value is unique across
169
+ * Increase and is used to ensure that a request is only processed once. Learn more
170
+ * about [idempotency](https://increase.com/documentation/idempotency-keys).
185
171
  */
186
- recipient_routing_number: string;
172
+ idempotency_key: string | null;
187
173
 
188
174
  /**
189
175
  * The lifecycle status of the drawdown request.
@@ -208,9 +194,88 @@ export interface WireDrawdownRequest {
208
194
  * `wire_drawdown_request`.
209
195
  */
210
196
  type: 'wire_drawdown_request';
197
+
198
+ /**
199
+ * Remittance information the debtor will see as part of the drawdown request.
200
+ */
201
+ unstructured_remittance_information: string;
211
202
  }
212
203
 
213
204
  export namespace WireDrawdownRequest {
205
+ /**
206
+ * The creditor's address.
207
+ */
208
+ export interface CreditorAddress {
209
+ /**
210
+ * The city, district, town, or village of the address.
211
+ */
212
+ city: string;
213
+
214
+ /**
215
+ * The two-letter
216
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for
217
+ * the country of the address.
218
+ */
219
+ country: string;
220
+
221
+ /**
222
+ * The first line of the address.
223
+ */
224
+ line1: string;
225
+
226
+ /**
227
+ * The second line of the address.
228
+ */
229
+ line2: string | null;
230
+
231
+ /**
232
+ * The ZIP code of the address.
233
+ */
234
+ postal_code: string | null;
235
+
236
+ /**
237
+ * The address state.
238
+ */
239
+ state: string | null;
240
+ }
241
+
242
+ /**
243
+ * The debtor's address.
244
+ */
245
+ export interface DebtorAddress {
246
+ /**
247
+ * The city, district, town, or village of the address.
248
+ */
249
+ city: string;
250
+
251
+ /**
252
+ * The two-letter
253
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for
254
+ * the country of the address.
255
+ */
256
+ country: string;
257
+
258
+ /**
259
+ * The first line of the address.
260
+ */
261
+ line1: string;
262
+
263
+ /**
264
+ * The second line of the address.
265
+ */
266
+ line2: string | null;
267
+
268
+ /**
269
+ * The ZIP code of the address.
270
+ */
271
+ postal_code: string | null;
272
+
273
+ /**
274
+ * The address state.
275
+ */
276
+ state: string | null;
277
+ }
278
+
214
279
  /**
215
280
  * After the drawdown request is submitted to Fedwire, this will contain
216
281
  * supplemental details.
@@ -226,77 +291,125 @@ export namespace WireDrawdownRequest {
226
291
 
227
292
  export interface WireDrawdownRequestCreateParams {
228
293
  /**
229
- * The Account Number to which the recipient should send funds.
294
+ * The Account Number to which the debtor should send funds.
230
295
  */
231
296
  account_number_id: string;
232
297
 
233
298
  /**
234
- * The amount requested from the recipient, in USD cents.
299
+ * The amount requested from the debtor, in USD cents.
235
300
  */
236
301
  amount: number;
237
302
 
238
303
  /**
239
- * A message the recipient will see as part of the request.
304
+ * The creditor's address.
240
305
  */
241
- message_to_recipient: string;
306
+ creditor_address: WireDrawdownRequestCreateParams.CreditorAddress;
242
307
 
243
308
  /**
244
- * The drawdown request's recipient's account number.
309
+ * The creditor's name.
245
310
  */
246
- recipient_account_number: string;
311
+ creditor_name: string;
247
312
 
248
313
  /**
249
- * The drawdown request's recipient's name.
314
+ * The debtor's account number.
250
315
  */
251
- recipient_name: string;
316
+ debtor_account_number: string;
252
317
 
253
318
  /**
254
- * The drawdown request's recipient's routing number.
319
+ * The debtor's address.
255
320
  */
256
- recipient_routing_number: string;
321
+ debtor_address: WireDrawdownRequestCreateParams.DebtorAddress;
257
322
 
258
323
  /**
259
- * The drawdown request originator's address line 1. This is only necessary if
260
- * you're requesting a payment to a commingled account. Otherwise, we'll use the
261
- * associated entity's details.
324
+ * The debtor's name.
262
325
  */
263
- originator_address_line1?: string;
326
+ debtor_name: string;
264
327
 
265
328
  /**
266
- * The drawdown request originator's address line 2. This is only necessary if
267
- * you're requesting a payment to a commingled account. Otherwise, we'll use the
268
- * associated entity's details.
329
+ * The debtor's routing number.
269
330
  */
270
- originator_address_line2?: string;
331
+ debtor_routing_number: string;
271
332
 
272
333
  /**
273
- * The drawdown request originator's address line 3. This is only necessary if
274
- * you're requesting a payment to a commingled account. Otherwise, we'll use the
275
- * associated entity's details.
334
+ * Remittance information the debtor will see as part of the request.
276
335
  */
277
- originator_address_line3?: string;
336
+ unstructured_remittance_information: string;
337
+ }
278
338
 
339
+ export namespace WireDrawdownRequestCreateParams {
279
340
  /**
280
- * The drawdown request originator's name. This is only necessary if you're
281
- * requesting a payment to a commingled account. Otherwise, we'll use the
282
- * associated entity's details.
341
+ * The creditor's address.
283
342
  */
284
- originator_name?: string;
343
+ export interface CreditorAddress {
344
+ /**
345
+ * The city, district, town, or village of the address.
346
+ */
347
+ city: string;
285
348
 
286
- /**
287
- * Line 1 of the drawdown request's recipient's address.
288
- */
289
- recipient_address_line1?: string;
349
+ /**
350
+ * The two-letter
351
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for
352
+ * the country of the address.
353
+ */
354
+ country: string;
290
355
 
291
- /**
292
- * Line 2 of the drawdown request's recipient's address.
293
- */
294
- recipient_address_line2?: string;
356
+ /**
357
+ * The first line of the address. This is usually the street number and street.
358
+ */
359
+ line1: string;
360
+
361
+ /**
362
+ * The second line of the address. This might be the floor or room number.
363
+ */
364
+ line2?: string;
365
+
366
+ /**
367
+ * The ZIP code of the address.
368
+ */
369
+ postal_code?: string;
370
+
371
+ /**
372
+ * The address state.
373
+ */
374
+ state?: string;
375
+ }
295
376
 
296
377
  /**
297
- * Line 3 of the drawdown request's recipient's address.
378
+ * The debtor's address.
298
379
  */
299
- recipient_address_line3?: string;
380
+ export interface DebtorAddress {
381
+ /**
382
+ * The city, district, town, or village of the address.
383
+ */
384
+ city: string;
385
+
386
+ /**
387
+ * The two-letter
388
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for
389
+ * the country of the address.
390
+ */
391
+ country: string;
392
+
393
+ /**
394
+ * The first line of the address. This is usually the street number and street.
395
+ */
396
+ line1: string;
397
+
398
+ /**
399
+ * The second line of the address. This might be the floor or room number.
400
+ */
401
+ line2?: string;
402
+
403
+ /**
404
+ * The ZIP code of the address.
405
+ */
406
+ postal_code?: string;
407
+
408
+ /**
409
+ * The address state.
410
+ */
411
+ state?: string;
412
+ }
300
413
  }
301
414
 
302
415
  export interface WireDrawdownRequestListParams extends PageParams {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.238.0'; // x-release-please-version
1
+ export const VERSION = '0.240.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.238.0";
1
+ export declare const VERSION = "0.240.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 = '0.238.0'; // x-release-please-version
4
+ exports.VERSION = '0.240.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.238.0'; // x-release-please-version
1
+ export const VERSION = '0.240.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map