Skip to content

Commit 0ea236c

Browse files
authored
Merge pull request stripe#1053 from stripe/remi/codegen-e215279
Multiple API changes
2 parents a4c2a54 + fd30406 commit 0ea236c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+344
-271
lines changed

lib/resources/Accounts.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ const stripeMethod = StripeResource.method;
99
module.exports = StripeResource.extend({
1010
path: '',
1111

12-
reject: stripeMethod({
13-
method: 'POST',
14-
path: 'accounts/{account}/reject',
15-
}),
16-
1712
create: stripeMethod({
1813
method: 'POST',
1914
path: 'accounts',
@@ -30,6 +25,11 @@ module.exports = StripeResource.extend({
3025
methodType: 'list',
3126
}),
3227

28+
reject: stripeMethod({
29+
method: 'POST',
30+
path: 'accounts/{account}/reject',
31+
}),
32+
3333
retrieve(id) {
3434
// No longer allow an api key to be passed as the first string to this function due to ambiguity between
3535
// old account ids and api keys. To request the account for an api key, send null as the id

lib/resources/Customers.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ module.exports = StripeResource.extend({
4141
path: '/{customer}/sources',
4242
}),
4343

44+
deleteSource: stripeMethod({
45+
method: 'DELETE',
46+
path: '/{customer}/sources/{id}',
47+
}),
48+
4449
listSources: stripeMethod({
4550
method: 'GET',
4651
path: '/{customer}/sources',
@@ -57,11 +62,6 @@ module.exports = StripeResource.extend({
5762
path: '/{customer}/sources/{id}',
5863
}),
5964

60-
deleteSource: stripeMethod({
61-
method: 'DELETE',
62-
path: '/{customer}/sources/{id}',
63-
}),
64-
6565
verifySource: stripeMethod({
6666
method: 'POST',
6767
path: '/{customer}/sources/{id}/verify',

lib/resources/Invoices.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ module.exports = StripeResource.extend({
2525
path: '/{invoice}/pay',
2626
}),
2727

28-
sendInvoice: stripeMethod({
29-
method: 'POST',
30-
path: '/{invoice}/send',
31-
}),
32-
3328
retrieveUpcoming: stripeMethod({
3429
method: 'GET',
3530
path: '/upcoming',
3631
}),
3732

33+
sendInvoice: stripeMethod({
34+
method: 'POST',
35+
path: '/{invoice}/send',
36+
}),
37+
3838
voidInvoice: stripeMethod({
3939
method: 'POST',
4040
path: '/{invoice}/void',

lib/resources/Subscriptions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const stripeMethod = StripeResource.method;
88
module.exports = StripeResource.extend({
99
path: 'subscriptions',
1010

11-
includeBasic: ['create', 'list', 'retrieve', 'update', 'del'],
11+
includeBasic: ['create', 'del', 'list', 'retrieve', 'update'],
1212

1313
deleteDiscount: stripeMethod({
1414
method: 'DELETE',

types/2020-08-27/Accounts.d.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ declare module 'stripe' {
831831
/**
832832
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
833833
*/
834-
metadata?: MetadataParam | null;
834+
metadata?: Stripe.Emptyable<MetadataParam>;
835835

836836
/**
837837
* Options for customizing how the account functions within Stripe.
@@ -1218,7 +1218,7 @@ declare module 'stripe' {
12181218
/**
12191219
* The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
12201220
*/
1221-
structure?: Company.Structure | null;
1221+
structure?: Stripe.Emptyable<Company.Structure>;
12221222

12231223
/**
12241224
* The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)
@@ -1332,7 +1332,7 @@ declare module 'stripe' {
13321332
/**
13331333
* The individual's date of birth.
13341334
*/
1335-
dob?: Individual.Dob | null;
1335+
dob?: Stripe.Emptyable<Individual.Dob>;
13361336

13371337
/**
13381338
* The individual's email address.
@@ -1387,7 +1387,7 @@ declare module 'stripe' {
13871387
/**
13881388
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
13891389
*/
1390-
metadata?: MetadataParam | null;
1390+
metadata?: Stripe.Emptyable<MetadataParam>;
13911391

13921392
/**
13931393
* The individual's phone number.
@@ -1739,7 +1739,7 @@ declare module 'stripe' {
17391739
/**
17401740
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
17411741
*/
1742-
metadata?: MetadataParam | null;
1742+
metadata?: Stripe.Emptyable<MetadataParam>;
17431743

17441744
/**
17451745
* Options for customizing how the account functions within Stripe.
@@ -2121,7 +2121,7 @@ declare module 'stripe' {
21212121
/**
21222122
* The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
21232123
*/
2124-
structure?: Company.Structure | null;
2124+
structure?: Stripe.Emptyable<Company.Structure>;
21252125

21262126
/**
21272127
* The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)
@@ -2235,7 +2235,7 @@ declare module 'stripe' {
22352235
/**
22362236
* The individual's date of birth.
22372237
*/
2238-
dob?: Individual.Dob | null;
2238+
dob?: Stripe.Emptyable<Individual.Dob>;
22392239

22402240
/**
22412241
* The individual's email address.
@@ -2290,7 +2290,7 @@ declare module 'stripe' {
22902290
/**
22912291
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
22922292
*/
2293-
metadata?: MetadataParam | null;
2293+
metadata?: Stripe.Emptyable<MetadataParam>;
22942294

22952295
/**
22962296
* The individual's phone number.

types/2020-08-27/Charges.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ declare module 'stripe' {
15441544
/**
15451545
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
15461546
*/
1547-
metadata?: MetadataParam | null;
1547+
metadata?: Stripe.Emptyable<MetadataParam>;
15481548

15491549
/**
15501550
* The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers#on-behalf-of).
@@ -1671,7 +1671,7 @@ declare module 'stripe' {
16711671
/**
16721672
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
16731673
*/
1674-
metadata?: MetadataParam | null;
1674+
metadata?: Stripe.Emptyable<MetadataParam>;
16751675

16761676
/**
16771677
* This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address.
@@ -1694,7 +1694,7 @@ declare module 'stripe' {
16941694
/**
16951695
* Either `safe` or `fraudulent`.
16961696
*/
1697-
user_report: FraudDetails.UserReport | null;
1697+
user_report: Stripe.Emptyable<FraudDetails.UserReport>;
16981698
}
16991699

17001700
namespace FraudDetails {

types/2020-08-27/Coupons.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ declare module 'stripe' {
160160
/**
161161
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
162162
*/
163-
metadata?: MetadataParam | null;
163+
metadata?: Stripe.Emptyable<MetadataParam>;
164164

165165
/**
166166
* Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set.
@@ -205,7 +205,7 @@ declare module 'stripe' {
205205
/**
206206
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
207207
*/
208-
metadata?: MetadataParam | null;
208+
metadata?: Stripe.Emptyable<MetadataParam>;
209209

210210
/**
211211
* Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set.

types/2020-08-27/CreditNoteLineItems.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ declare module 'stripe' {
198198
/**
199199
* The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`.
200200
*/
201-
tax_rates?: Array<string> | null;
201+
tax_rates?: Stripe.Emptyable<Array<string>>;
202202

203203
/**
204204
* Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`

types/2020-08-27/CreditNotes.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ declare module 'stripe' {
257257
/**
258258
* The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`.
259259
*/
260-
tax_rates?: Array<string> | null;
260+
tax_rates?: Stripe.Emptyable<Array<string>>;
261261

262262
/**
263263
* Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`
@@ -409,7 +409,7 @@ declare module 'stripe' {
409409
/**
410410
* The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`.
411411
*/
412-
tax_rates?: Array<string> | null;
412+
tax_rates?: Stripe.Emptyable<Array<string>>;
413413

414414
/**
415415
* Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`

types/2020-08-27/CustomerBalanceTransactions.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ declare module 'stripe' {
108108
/**
109109
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
110110
*/
111-
metadata?: MetadataParam | null;
111+
metadata?: Stripe.Emptyable<MetadataParam>;
112112
}
113113

114114
interface CustomerBalanceTransactionRetrieveParams {
@@ -132,7 +132,7 @@ declare module 'stripe' {
132132
/**
133133
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
134134
*/
135-
metadata?: MetadataParam | null;
135+
metadata?: Stripe.Emptyable<MetadataParam>;
136136
}
137137

138138
interface CustomerBalanceTransactionListParams extends PaginationParams {

types/2020-08-27/CustomerSources.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ declare module 'stripe' {
8484
/**
8585
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
8686
*/
87-
metadata?: MetadataParam | null;
87+
metadata?: Stripe.Emptyable<MetadataParam>;
8888

8989
/**
9090
* Cardholder name.

types/2020-08-27/Customers.d.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ declare module 'stripe' {
210210
/**
211211
* The customer's address.
212212
*/
213-
address?: AddressParam | null;
213+
address?: Stripe.Emptyable<AddressParam>;
214214

215215
/**
216216
* An integer amount in %s that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
@@ -247,7 +247,7 @@ declare module 'stripe' {
247247
/**
248248
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
249249
*/
250-
metadata?: MetadataParam | null;
250+
metadata?: Stripe.Emptyable<MetadataParam>;
251251

252252
/**
253253
* The customer's full name or business name.
@@ -279,14 +279,14 @@ declare module 'stripe' {
279279
/**
280280
* The customer's shipping information. Appears on invoices emailed to this customer.
281281
*/
282-
shipping?: CustomerCreateParams.Shipping | null;
282+
shipping?: Stripe.Emptyable<CustomerCreateParams.Shipping>;
283283

284284
source?: string;
285285

286286
/**
287287
* The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
288288
*/
289-
tax_exempt?: CustomerCreateParams.TaxExempt | null;
289+
tax_exempt?: Stripe.Emptyable<CustomerCreateParams.TaxExempt>;
290290

291291
/**
292292
* The customer's tax IDs.
@@ -299,7 +299,7 @@ declare module 'stripe' {
299299
/**
300300
* Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields.
301301
*/
302-
custom_fields?: Array<InvoiceSettings.CustomField> | null;
302+
custom_fields?: Stripe.Emptyable<Array<InvoiceSettings.CustomField>>;
303303

304304
/**
305305
* ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices.
@@ -405,7 +405,7 @@ declare module 'stripe' {
405405
/**
406406
* The customer's address.
407407
*/
408-
address?: AddressParam | null;
408+
address?: Stripe.Emptyable<AddressParam>;
409409

410410
/**
411411
* An integer amount in %s that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
@@ -451,7 +451,7 @@ declare module 'stripe' {
451451
/**
452452
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
453453
*/
454-
metadata?: MetadataParam | null;
454+
metadata?: Stripe.Emptyable<MetadataParam>;
455455

456456
/**
457457
* The customer's full name or business name.
@@ -481,14 +481,14 @@ declare module 'stripe' {
481481
/**
482482
* The customer's shipping information. Appears on invoices emailed to this customer.
483483
*/
484-
shipping?: CustomerUpdateParams.Shipping | null;
484+
shipping?: Stripe.Emptyable<CustomerUpdateParams.Shipping>;
485485

486486
source?: string;
487487

488488
/**
489489
* The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
490490
*/
491-
tax_exempt?: CustomerUpdateParams.TaxExempt | null;
491+
tax_exempt?: Stripe.Emptyable<CustomerUpdateParams.TaxExempt>;
492492

493493
/**
494494
* Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`.
@@ -501,7 +501,7 @@ declare module 'stripe' {
501501
/**
502502
* Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields.
503503
*/
504-
custom_fields?: Array<InvoiceSettings.CustomField> | null;
504+
custom_fields?: Stripe.Emptyable<Array<InvoiceSettings.CustomField>>;
505505

506506
/**
507507
* ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices.

types/2020-08-27/Disputes.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ declare module 'stripe' {
272272
/**
273273
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
274274
*/
275-
metadata?: MetadataParam | null;
275+
metadata?: Stripe.Emptyable<MetadataParam>;
276276

277277
/**
278278
* Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default).

types/2020-08-27/ExternalAccounts.d.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ declare module 'stripe' {
3939
/**
4040
* The type of entity that holds the account. This can be either `individual` or `company`.
4141
*/
42-
account_holder_type?: ExternalAccountUpdateParams.AccountHolderType | null;
42+
account_holder_type?: Stripe.Emptyable<
43+
ExternalAccountUpdateParams.AccountHolderType
44+
>;
4345

4446
/**
4547
* City/District/Suburb/Town/Village.
@@ -94,7 +96,7 @@ declare module 'stripe' {
9496
/**
9597
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
9698
*/
97-
metadata?: MetadataParam | null;
99+
metadata?: Stripe.Emptyable<MetadataParam>;
98100

99101
/**
100102
* Cardholder name.

types/2020-08-27/FeeRefunds.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ declare module 'stripe' {
7979
/**
8080
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
8181
*/
82-
metadata?: MetadataParam | null;
82+
metadata?: Stripe.Emptyable<MetadataParam>;
8383
}
8484

8585
interface FeeRefundListParams extends PaginationParams {

types/2020-08-27/FileLinks.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ declare module 'stripe' {
7070
/**
7171
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
7272
*/
73-
metadata?: MetadataParam | null;
73+
metadata?: Stripe.Emptyable<MetadataParam>;
7474
}
7575

7676
interface FileLinkRetrieveParams {
@@ -89,12 +89,12 @@ declare module 'stripe' {
8989
/**
9090
* A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately.
9191
*/
92-
expires_at?: 'now' | number | null;
92+
expires_at?: Stripe.Emptyable<'now' | number>;
9393

9494
/**
9595
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
9696
*/
97-
metadata?: MetadataParam | null;
97+
metadata?: Stripe.Emptyable<MetadataParam>;
9898
}
9999

100100
interface FileLinkListParams extends PaginationParams {

0 commit comments

Comments
 (0)