Skip to content

Commit f84af01

Browse files
Merge pull request #2317 from stripe/latest-codegen-beta
Update generated code for beta
2 parents 5ac6906 + 7833dd4 commit f84af01

20 files changed

+45
-89
lines changed

examples/snippets/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Setup
22

3-
1. From the stripe-node root folder, run `yarn build` to build the modules.
3+
1. From the stripe-node root folder, run `just build` or `just build-dev` to build the modules. `just build-dev` produces source maps for each of the SDK .ts files. This is optional but very useful when troubleshooting SDK behavior.
44
2. Then, from this snippets folder, run `yarn` to install node dependencies for the example snippets. This will reference the local Stripe SDK modules created in step 1.
55

66
If on step 2 you see an error `Error: unsure how to copy this: /Users/jar/stripe/sdks/node/.git/fsmonitor--daemon.ipc`:

justfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,23 @@ integrations-test: build
2727
# run the full test suite; you probably want `test`
2828
ci-test: install test types-test integrations-test
2929

30-
_build mode packageType: install
30+
_build mode packageType tscArgs: install
3131
mkdir -p {{ mode }}
32-
tsc -p tsconfig.{{ mode }}.json
32+
tsc -p tsconfig.{{ mode }}.json {{ tscArgs }}
3333
echo '{"type":"{{ packageType }}"}' > {{ mode }}/package.json
3434

3535
[private]
36-
build-esm: (_build "esm" "module")
36+
build-esm *args="": (_build "esm" "module" args)
3737

3838
[private]
39-
build-cjs: (_build "cjs" "commonjs")
39+
build-cjs *args="": (_build "cjs" "commonjs" args)
4040

4141
# generate CJS and ESM versions of the package; mostly used as a pre-req for other steps
4242
build: build-esm build-cjs
4343

44+
# generate CJS and ESM versions of the package including sourceMaps for each build
45+
build-dev: (build-esm "--sourceMap" "true") (build-cjs "--sourceMap" "true")
46+
4447
# ⭐ run style checks, fixing issues if possible
4548
lint: (lint-check "--fix")
4649

src/resources/Privacy/RedactionJobs.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ export const RedactionJobs = StripeResource.extend({
2929
fullPath: '/v1/privacy/redaction_jobs/{job}/validation_errors',
3030
methodType: 'list',
3131
}),
32-
retrieveValidationError: stripeMethod({
33-
method: 'GET',
34-
fullPath: '/v1/privacy/redaction_jobs/{job}/validation_errors/{error}',
35-
}),
3632
run: stripeMethod({
3733
method: 'POST',
3834
fullPath: '/v1/privacy/redaction_jobs/{job}/run',

test/resources/generated_examples_test.spec.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

types/AccountsResource.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,7 @@ declare module 'stripe' {
22122212
currency?: string;
22132213

22142214
/**
2215-
* The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required.
2215+
* The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for `account_number`, this field is not required.
22162216
*/
22172217
routing_number?: string;
22182218
}
@@ -4173,7 +4173,7 @@ declare module 'stripe' {
41734173
currency?: string;
41744174

41754175
/**
4176-
* The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required.
4176+
* The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for `account_number`, this field is not required.
41774177
*/
41784178
routing_number?: string;
41794179
}

types/Checkout/SessionsResource.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2898,9 +2898,7 @@ declare module 'stripe' {
28982898
}
28992899

29002900
namespace SubscriptionData {
2901-
type BillingMode =
2902-
| 'credits_attributed_to_debits'
2903-
| 'legacy_prorations';
2901+
type BillingMode = 'classic' | 'flexible';
29042902

29052903
interface InvoiceSettings {
29062904
/**

types/ExternalAccountsResource.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ declare module 'stripe' {
5858
currency?: string;
5959

6060
/**
61-
* The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required.
61+
* The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for `account_number`, this field is not required.
6262
*/
6363
routing_number?: string;
6464
}

types/InvoicesResource.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3313,7 +3313,7 @@ declare module 'stripe' {
33133313

33143314
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
33153315

3316-
type BillingMode = 'credits_attributed_to_debits' | 'legacy_prorations';
3316+
type BillingMode = 'classic' | 'flexible';
33173317

33183318
type EndBehavior = 'cancel' | 'release';
33193319

@@ -4058,7 +4058,7 @@ declare module 'stripe' {
40584058
namespace SubscriptionDetails {
40594059
type BillingCycleAnchor = 'now' | 'unchanged';
40604060

4061-
type BillingMode = 'credits_attributed_to_debits' | 'legacy_prorations';
4061+
type BillingMode = 'classic' | 'flexible';
40624062

40634063
interface Item {
40644064
/**

types/Privacy/RedactionJobRootObjects.d.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

types/Privacy/RedactionJobs.d.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ declare module 'stripe' {
2626
/**
2727
* The objects at the root level that are subject to redaction.
2828
*/
29-
objects?: Stripe.Privacy.RedactionJobRootObjects | null;
29+
objects?: RedactionJob.Objects | null;
3030

3131
/**
3232
* The status field represents the current state of the redaction job. It can take on any of the following values: VALIDATING, READY, REDACTING, SUCCEEDED, CANCELED, FAILED.
@@ -38,6 +38,28 @@ declare module 'stripe' {
3838
*/
3939
validation_behavior: string | null;
4040
}
41+
42+
namespace RedactionJob {
43+
interface Objects {
44+
charges: Array<string> | null;
45+
46+
checkout_sessions: Array<string> | null;
47+
48+
customers: Array<string> | null;
49+
50+
identity_verification_sessions: Array<string> | null;
51+
52+
invoices: Array<string> | null;
53+
54+
issuing_cardholders: Array<string> | null;
55+
56+
payment_intents: Array<string> | null;
57+
58+
radar_value_list_items: Array<string> | null;
59+
60+
setup_intents: Array<string> | null;
61+
}
62+
}
4163
}
4264
}
4365
}

types/Privacy/RedactionJobsResource.d.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,6 @@ declare module 'stripe' {
105105
expand?: Array<string>;
106106
}
107107

108-
interface RedactionJobRetrieveValidationErrorParams {
109-
/**
110-
* Specifies which fields in the response should be expanded.
111-
*/
112-
expand?: Array<string>;
113-
}
114-
115108
interface RedactionJobRunParams {
116109
/**
117110
* Specifies which fields in the response should be expanded.
@@ -194,21 +187,6 @@ declare module 'stripe' {
194187
options?: RequestOptions
195188
): ApiListPromise<Stripe.Privacy.RedactionJobValidationError>;
196189

197-
/**
198-
* Retrieve validation error method
199-
*/
200-
retrieveValidationError(
201-
jobId: string,
202-
id: string,
203-
params?: RedactionJobRetrieveValidationErrorParams,
204-
options?: RequestOptions
205-
): Promise<Stripe.Response<Stripe.Privacy.RedactionJobValidationError>>;
206-
retrieveValidationError(
207-
jobId: string,
208-
id: string,
209-
options?: RequestOptions
210-
): Promise<Stripe.Response<Stripe.Privacy.RedactionJobValidationError>>;
211-
212190
/**
213191
* Run redaction job method
214192
*/

types/QuotePreviewSubscriptionSchedules.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ declare module 'stripe' {
149149

150150
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
151151

152-
type BillingMode = 'credits_attributed_to_debits' | 'legacy_prorations';
152+
type BillingMode = 'classic' | 'flexible';
153153

154154
interface CurrentPhase {
155155
/**

types/Quotes.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ declare module 'stripe' {
808808
namespace SubscriptionData {
809809
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
810810

811-
type BillingMode = 'credits_attributed_to_debits' | 'legacy_prorations';
811+
type BillingMode = 'classic' | 'flexible';
812812

813813
interface BillOnAcceptance {
814814
/**

types/QuotesResource.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ declare module 'stripe' {
10961096
namespace SubscriptionData {
10971097
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
10981098

1099-
type BillingMode = 'credits_attributed_to_debits' | 'legacy_prorations';
1099+
type BillingMode = 'classic' | 'flexible';
11001100

11011101
interface BillOnAcceptance {
11021102
/**

types/SubscriptionSchedules.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ declare module 'stripe' {
128128
namespace SubscriptionSchedule {
129129
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
130130

131-
type BillingMode = 'credits_attributed_to_debits' | 'legacy_prorations';
131+
type BillingMode = 'classic' | 'flexible';
132132

133133
interface CurrentPhase {
134134
/**

types/SubscriptionSchedulesResource.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ declare module 'stripe' {
6767
namespace SubscriptionScheduleCreateParams {
6868
type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
6969

70-
type BillingMode = 'credits_attributed_to_debits' | 'legacy_prorations';
70+
type BillingMode = 'classic' | 'flexible';
7171

7272
interface DefaultSettings {
7373
/**

types/Subscriptions.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ declare module 'stripe' {
310310
second: number | null;
311311
}
312312

313-
type BillingMode = 'credits_attributed_to_debits' | 'legacy_prorations';
313+
type BillingMode = 'classic' | 'flexible';
314314

315315
interface CancellationDetails {
316316
/**

types/SubscriptionsResource.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ declare module 'stripe' {
370370
second?: number;
371371
}
372372

373-
type BillingMode = 'credits_attributed_to_debits' | 'legacy_prorations';
373+
type BillingMode = 'classic' | 'flexible';
374374

375375
type CollectionMethod = 'charge_automatically' | 'send_invoice';
376376

types/Treasury/OutboundPaymentsResource.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ declare module 'stripe' {
114114
* Billing phone number (including extension).
115115
*/
116116
phone?: Stripe.Emptyable<string>;
117-
118-
/**
119-
* Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.
120-
*/
121-
tax_id?: string;
122117
}
123118

124119
type Type = 'financial_account' | 'us_bank_account';

types/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@
283283
///<reference path='./Persons.d.ts' />
284284
///<reference path='./Plans.d.ts' />
285285
///<reference path='./Prices.d.ts' />
286-
///<reference path='./Privacy/RedactionJobRootObjects.d.ts' />
287286
///<reference path='./Privacy/RedactionJobValidationErrors.d.ts' />
288287
///<reference path='./Privacy/RedactionJobs.d.ts' />
289288
///<reference path='./ProductFeatures.d.ts' />

0 commit comments

Comments
 (0)