@stripe/extensibility-sdk 0.22.4 → 0.24.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.
- package/dist/api-surface.d.ts.map +1 -0
- package/dist/config-values/generate.cjs +1 -1
- package/dist/config-values/generate.d.ts +2 -2
- package/dist/config-values/generate.d.ts.map +1 -1
- package/dist/config-values/generate.js +1 -1
- package/dist/extensibility-sdk-alpha.d.ts +1290 -1
- package/dist/extensibility-sdk-beta.d.ts +1290 -1
- package/dist/extensibility-sdk-config-values-internal.d.ts +2 -2
- package/dist/extensibility-sdk-extensions-alpha.d.ts +95 -114
- package/dist/extensibility-sdk-extensions-beta.d.ts +95 -114
- package/dist/extensibility-sdk-extensions-internal.d.ts +106 -147
- package/dist/extensibility-sdk-extensions-public.d.ts +95 -114
- package/dist/extensibility-sdk-internal.d.ts +1301 -1
- package/dist/extensibility-sdk-public.d.ts +1290 -1
- package/dist/extensions/billing/bill/discount_calculation.d.ts +7 -10
- package/dist/extensions/billing/bill/discount_calculation.d.ts.map +1 -1
- package/dist/extensions/billing/customer_balance_application.d.ts +7 -9
- package/dist/extensions/billing/customer_balance_application.d.ts.map +1 -1
- package/dist/extensions/billing/invoice_collection_setting.d.ts +15 -19
- package/dist/extensions/billing/invoice_collection_setting.d.ts.map +1 -1
- package/dist/extensions/billing/prorations.d.ts +25 -34
- package/dist/extensions/billing/prorations.d.ts.map +1 -1
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts +29 -47
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -1
- package/dist/extensions/billing/types.d.ts +4 -4
- package/dist/extensions/core/workflows/custom_action.d.ts +7 -12
- package/dist/extensions/core/workflows/custom_action.d.ts.map +1 -1
- package/dist/extensions/extend/workflows/custom_action.d.ts +7 -12
- package/dist/extensions/extend/workflows/custom_action.d.ts.map +1 -1
- package/dist/extensions/index.cjs +0 -2
- package/dist/extensions/index.d.ts +6 -2
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +1 -2
- package/dist/index.cjs +2317 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2320 -0
- package/dist/stdlib/decimal.d.ts +4 -40
- package/dist/stdlib/refs.d.ts +7 -21
- package/dist/stdlib/scalars.d.ts +16 -71
- package/dist/stdlib/type-utils.d.ts +1 -3
- package/dist/stdlib/types.d.ts +6 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -11
- package/dist/extensibility-sdk-jsonschema-alpha.d.ts +0 -3
- package/dist/extensibility-sdk-jsonschema-beta.d.ts +0 -3
- package/dist/extensibility-sdk-jsonschema-internal.d.ts +0 -15
- package/dist/extensibility-sdk-jsonschema-public.d.ts +0 -3
- package/dist/jsonschema.cjs +0 -18
- package/dist/jsonschema.d.ts +0 -2
- package/dist/jsonschema.d.ts.map +0 -1
- package/dist/jsonschema.js +0 -0
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import from `@stripe/extensibility-sdk` instead.
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Opaque brand symbol used as a property key in SDK branded types.
|
|
3
8
|
*
|
|
@@ -35,15 +40,15 @@ declare const __stripeType: unique symbol;
|
|
|
35
40
|
|
|
36
41
|
/** @public */
|
|
37
42
|
declare type AnyTimeRange = {
|
|
38
|
-
value: 'oneTime';
|
|
39
43
|
at: Date;
|
|
44
|
+
value: 'oneTime';
|
|
40
45
|
} | {
|
|
41
|
-
value: 'timeRange';
|
|
42
|
-
startDate: Date;
|
|
43
46
|
endDate: Date;
|
|
47
|
+
startDate: Date;
|
|
48
|
+
value: 'timeRange';
|
|
44
49
|
} | {
|
|
45
|
-
value: 'other';
|
|
46
50
|
otherValue: string;
|
|
51
|
+
value: 'other';
|
|
47
52
|
};
|
|
48
53
|
|
|
49
54
|
declare namespace Bill {
|
|
@@ -170,9 +175,7 @@ declare namespace CustomAction {
|
|
|
170
175
|
*/
|
|
171
176
|
function prepareResultExecute(result: ExecuteCustomActionResponse): ExecuteCustomActionResponse;
|
|
172
177
|
/** @internal */
|
|
173
|
-
function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
174
|
-
execute(...a: unknown[]): unknown;
|
|
175
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
178
|
+
function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { execute(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
176
179
|
/**
|
|
177
180
|
* @public
|
|
178
181
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -184,29 +187,26 @@ declare namespace CustomAction {
|
|
|
184
187
|
*/
|
|
185
188
|
function prepareResultGetFormState(result: GetFormStateResponse): GetFormStateResponse;
|
|
186
189
|
/** @internal */
|
|
187
|
-
function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
188
|
-
getFormState(...a: unknown[]): unknown;
|
|
189
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
190
|
+
function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { getFormState(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
190
191
|
/**
|
|
191
192
|
* Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
|
|
192
193
|
* @public
|
|
193
194
|
*/
|
|
194
|
-
type ExecuteFunction<Config
|
|
195
|
+
type ExecuteFunction<Config> = (request: ExecuteCustomActionRequest, config: Config, context: Context) => ExecuteCustomActionResponse | PromiseLike<ExecuteCustomActionResponse>;
|
|
195
196
|
/**
|
|
196
197
|
* Returns the current form state for the action's configuration UI. Called at configuration time (not runtime) to power dynamic form behavior, including dropdown options, dynamic JSON schemas, field visibility, and validation.
|
|
197
198
|
* @public
|
|
198
199
|
*/
|
|
199
|
-
type GetFormStateFunction<Config
|
|
200
|
+
type GetFormStateFunction<Config> = (request: GetFormStateRequest, config: Config, context: Context) => GetFormStateResponse | PromiseLike<GetFormStateResponse>;
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
/**
|
|
203
204
|
* @example
|
|
204
205
|
* ```ts
|
|
205
|
-
* import type { Core } from '@stripe/extensibility-sdk
|
|
206
|
-
* import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
206
|
+
* import type { Core, Context } from '@stripe/extensibility-sdk';
|
|
207
207
|
*
|
|
208
208
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
209
|
-
* interface MyCustomActionConfig
|
|
209
|
+
* interface MyCustomActionConfig {}
|
|
210
210
|
*
|
|
211
211
|
* export default class MyCustomAction implements Core.Workflows
|
|
212
212
|
* .CustomAction<MyCustomActionConfig> {
|
|
@@ -237,7 +237,7 @@ declare namespace CustomAction {
|
|
|
237
237
|
* ```
|
|
238
238
|
* @public
|
|
239
239
|
*/
|
|
240
|
-
declare interface CustomAction<Config
|
|
240
|
+
declare interface CustomAction<Config> {
|
|
241
241
|
execute: CustomAction.ExecuteFunction<Config>;
|
|
242
242
|
getFormState?: CustomAction.GetFormStateFunction<Config>;
|
|
243
243
|
}
|
|
@@ -311,9 +311,7 @@ declare namespace CustomAction_2 {
|
|
|
311
311
|
*/
|
|
312
312
|
function prepareResultExecute(result: ExecuteCustomActionResponse): ExecuteCustomActionResponse;
|
|
313
313
|
/** @internal */
|
|
314
|
-
function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
315
|
-
execute(...a: unknown[]): unknown;
|
|
316
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
314
|
+
function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { execute(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
317
315
|
/**
|
|
318
316
|
* @public
|
|
319
317
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -325,29 +323,26 @@ declare namespace CustomAction_2 {
|
|
|
325
323
|
*/
|
|
326
324
|
function prepareResultGetFormState(result: GetFormStateResponse): GetFormStateResponse;
|
|
327
325
|
/** @internal */
|
|
328
|
-
function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
329
|
-
getFormState(...a: unknown[]): unknown;
|
|
330
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
326
|
+
function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { getFormState(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
331
327
|
/**
|
|
332
328
|
* Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
|
|
333
329
|
* @public
|
|
334
330
|
*/
|
|
335
|
-
type ExecuteFunction<Config
|
|
331
|
+
type ExecuteFunction<Config> = (request: ExecuteCustomActionRequest, config: Config, context: Context) => ExecuteCustomActionResponse | PromiseLike<ExecuteCustomActionResponse>;
|
|
336
332
|
/**
|
|
337
333
|
* Returns the current form state for the action's configuration UI. Called at configuration time (not runtime) to power dynamic form behavior, including dropdown options, dynamic JSON schemas, field visibility, and validation.
|
|
338
334
|
* @public
|
|
339
335
|
*/
|
|
340
|
-
type GetFormStateFunction<Config
|
|
336
|
+
type GetFormStateFunction<Config> = (request: GetFormStateRequest, config: Config, context: Context) => GetFormStateResponse | PromiseLike<GetFormStateResponse>;
|
|
341
337
|
}
|
|
342
338
|
|
|
343
339
|
/**
|
|
344
340
|
* @example
|
|
345
341
|
* ```ts
|
|
346
|
-
* import type { Extend } from '@stripe/extensibility-sdk
|
|
347
|
-
* import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
342
|
+
* import type { Extend, Context } from '@stripe/extensibility-sdk';
|
|
348
343
|
*
|
|
349
344
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
350
|
-
* interface MyCustomActionConfig
|
|
345
|
+
* interface MyCustomActionConfig {}
|
|
351
346
|
*
|
|
352
347
|
* export default class MyCustomAction implements Extend.Workflows
|
|
353
348
|
* .CustomAction<MyCustomActionConfig> {
|
|
@@ -378,7 +373,7 @@ declare namespace CustomAction_2 {
|
|
|
378
373
|
* ```
|
|
379
374
|
* @public
|
|
380
375
|
*/
|
|
381
|
-
declare interface CustomAction_2<Config
|
|
376
|
+
declare interface CustomAction_2<Config> {
|
|
382
377
|
execute: CustomAction_2.ExecuteFunction<Config>;
|
|
383
378
|
getFormState?: CustomAction_2.GetFormStateFunction<Config>;
|
|
384
379
|
}
|
|
@@ -414,9 +409,7 @@ declare namespace CustomerBalanceApplication {
|
|
|
414
409
|
*/
|
|
415
410
|
function prepareResultComputeAppliedCustomerBalance(result: CustomerBalanceApplicationResult): CustomerBalanceApplicationResult;
|
|
416
411
|
/** @internal */
|
|
417
|
-
function $platformWrapComputeAppliedCustomerBalance(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
418
|
-
computeAppliedCustomerBalance(...a: unknown[]): unknown;
|
|
419
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
412
|
+
function $platformWrapComputeAppliedCustomerBalance(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { computeAppliedCustomerBalance(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
420
413
|
/**
|
|
421
414
|
* @public
|
|
422
415
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -431,21 +424,21 @@ declare namespace CustomerBalanceApplication {
|
|
|
431
424
|
* Determines how much of the customer's balance to apply toward a bill total. The script receives the invoice total and current customer balance, then returns how much of that balance to apply.
|
|
432
425
|
* @public
|
|
433
426
|
*/
|
|
434
|
-
type ComputeAppliedCustomerBalanceFunction<Config
|
|
427
|
+
type ComputeAppliedCustomerBalanceFunction<Config> = (request: CustomerBalanceApplicationInput, config: Config, context: Context) => CustomerBalanceApplicationResult;
|
|
435
428
|
}
|
|
436
429
|
|
|
437
430
|
/**
|
|
438
431
|
* @example
|
|
439
432
|
* ```ts
|
|
440
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
433
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
441
434
|
*
|
|
442
435
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
443
|
-
* interface
|
|
436
|
+
* interface MyBalanceAppConfig {}
|
|
444
437
|
*
|
|
445
|
-
* export default class
|
|
438
|
+
* export default class MyBalanceApp implements Billing.CustomerBalanceApplication<MyBalanceAppConfig> {
|
|
446
439
|
* computeAppliedCustomerBalance(
|
|
447
440
|
* request: Billing.CustomerBalanceApplication.CustomerBalanceApplicationInput,
|
|
448
|
-
* _config:
|
|
441
|
+
* _config: MyBalanceAppConfig,
|
|
449
442
|
* _context: Context
|
|
450
443
|
* ) {
|
|
451
444
|
* // TODO: implement your customer balance logic here
|
|
@@ -459,7 +452,7 @@ declare namespace CustomerBalanceApplication {
|
|
|
459
452
|
* ```
|
|
460
453
|
* @public
|
|
461
454
|
*/
|
|
462
|
-
declare interface CustomerBalanceApplication<Config
|
|
455
|
+
declare interface CustomerBalanceApplication<Config> {
|
|
463
456
|
computeAppliedCustomerBalance: CustomerBalanceApplication.ComputeAppliedCustomerBalanceFunction<Config>;
|
|
464
457
|
}
|
|
465
458
|
|
|
@@ -688,7 +681,7 @@ export declare const DecimalRoundingPresets: Readonly<{
|
|
|
688
681
|
/** @public */
|
|
689
682
|
declare namespace DiscountCalculation {
|
|
690
683
|
/** @public */
|
|
691
|
-
type BillingReason = 'automatic_pending_invoice_item_invoice' | 'manual' | '
|
|
684
|
+
type BillingReason = 'automatic_pending_invoice_item_invoice' | 'manual' | 'quote_accept' | 'subscription_cancel' | 'subscription_create' | 'subscription_cycle' | 'subscription_threshold' | 'subscription_trial_ended' | 'subscription_update' | 'subscription' | 'upcoming';
|
|
692
685
|
/** @public */
|
|
693
686
|
type PricingTierMode = 'graduated' | 'volume';
|
|
694
687
|
/** @public */
|
|
@@ -698,7 +691,7 @@ declare namespace DiscountCalculation {
|
|
|
698
691
|
/** @public */
|
|
699
692
|
type UsageType = 'licensed' | 'metered';
|
|
700
693
|
/** @public */
|
|
701
|
-
type RecurringPriceInterval = 'day' | '
|
|
694
|
+
type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
|
|
702
695
|
/**
|
|
703
696
|
* The result of a discount calculation.
|
|
704
697
|
* @public
|
|
@@ -858,9 +851,7 @@ declare namespace DiscountCalculation {
|
|
|
858
851
|
*/
|
|
859
852
|
function prepareResultComputeDiscounts(result: DiscountResult): DiscountResult;
|
|
860
853
|
/** @internal */
|
|
861
|
-
function $platformWrapComputeDiscounts(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
862
|
-
computeDiscounts(...a: unknown[]): unknown;
|
|
863
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
854
|
+
function $platformWrapComputeDiscounts(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { computeDiscounts(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
864
855
|
/**
|
|
865
856
|
* @public
|
|
866
857
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -875,17 +866,16 @@ declare namespace DiscountCalculation {
|
|
|
875
866
|
* Computes discount amounts for a discountable item and returns a discount result.
|
|
876
867
|
* @public
|
|
877
868
|
*/
|
|
878
|
-
type ComputeDiscountsFunction<Config
|
|
869
|
+
type ComputeDiscountsFunction<Config> = (request: DiscountableItem, config: Config, context: Context) => DiscountResult;
|
|
879
870
|
}
|
|
880
871
|
|
|
881
872
|
/**
|
|
882
873
|
* @example
|
|
883
874
|
* ```ts
|
|
884
|
-
* import type { Billing } from '@stripe/extensibility-sdk
|
|
885
|
-
* import type { Context } from '@stripe/extensibility-sdk/extensions';
|
|
875
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
886
876
|
*
|
|
887
877
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
888
|
-
* interface MyDiscountCalculationConfig
|
|
878
|
+
* interface MyDiscountCalculationConfig {}
|
|
889
879
|
*
|
|
890
880
|
* export default class MyDiscountCalculation implements Billing.Bill
|
|
891
881
|
* .DiscountCalculation<MyDiscountCalculationConfig> {
|
|
@@ -905,7 +895,7 @@ declare namespace DiscountCalculation {
|
|
|
905
895
|
* ```
|
|
906
896
|
* @public
|
|
907
897
|
*/
|
|
908
|
-
declare interface DiscountCalculation<Config
|
|
898
|
+
declare interface DiscountCalculation<Config> {
|
|
909
899
|
computeDiscounts: DiscountCalculation.ComputeDiscountsFunction<Config>;
|
|
910
900
|
}
|
|
911
901
|
|
|
@@ -919,11 +909,11 @@ export { Extend }
|
|
|
919
909
|
/** @public */
|
|
920
910
|
declare namespace InvoiceCollectionSetting {
|
|
921
911
|
/** @public */
|
|
922
|
-
type ParentType = '
|
|
912
|
+
type ParentType = 'billing_cadence' | 'contract' | 'quote' | 'standalone' | 'subscription_schedule' | 'subscription';
|
|
923
913
|
/** @public */
|
|
924
|
-
type PaymentMethodType = '
|
|
914
|
+
type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'boleto' | 'card' | 'cashapp' | 'eps' | 'fpx' | 'giropay' | 'grabpay' | 'ideal' | 'klarna' | 'konbini' | 'link' | 'multibanco' | 'oxxo' | 'p24' | 'paynow' | 'paypal' | 'promptpay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' | 'us_bank_account' | 'wechat_pay';
|
|
925
915
|
/** @public */
|
|
926
|
-
type CollectionMethod = '
|
|
916
|
+
type CollectionMethod = 'charge_automatically' | 'send_invoice';
|
|
927
917
|
/**
|
|
928
918
|
* The result of the invoice collection settings override extension.
|
|
929
919
|
* @public
|
|
@@ -933,18 +923,16 @@ declare namespace InvoiceCollectionSetting {
|
|
|
933
923
|
autoAdvance?: boolean;
|
|
934
924
|
}
|
|
935
925
|
/** @public */
|
|
936
|
-
type InvoiceCollectionRequest = {
|
|
937
|
-
/** The current collection settings that would be applied to the invoice. */
|
|
938
|
-
collectionSettings: CollectionSettings;
|
|
939
|
-
/** The billing resource that triggered invoice creation. */
|
|
940
|
-
parent: Parent;
|
|
941
|
-
} & ({
|
|
942
|
-
payer: 'customer';
|
|
926
|
+
type InvoiceCollectionRequest = ({
|
|
943
927
|
customer: Customer;
|
|
928
|
+
payer: 'customer';
|
|
944
929
|
} | {
|
|
945
|
-
payer: 'other';
|
|
946
930
|
otherPayer: string;
|
|
947
|
-
|
|
931
|
+
payer: 'other';
|
|
932
|
+
}) & {
|
|
933
|
+
collectionSettings: CollectionSettings;
|
|
934
|
+
parent: Parent;
|
|
935
|
+
};
|
|
948
936
|
/** @public */
|
|
949
937
|
interface Customer {
|
|
950
938
|
id: string;
|
|
@@ -985,9 +973,7 @@ declare namespace InvoiceCollectionSetting {
|
|
|
985
973
|
*/
|
|
986
974
|
function prepareResultCollectionOverride(result: InvoiceCollectionResponse): InvoiceCollectionResponse;
|
|
987
975
|
/** @internal */
|
|
988
|
-
function $platformWrapCollectionOverride(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
989
|
-
collectionOverride(...a: unknown[]): unknown;
|
|
990
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
976
|
+
function $platformWrapCollectionOverride(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { collectionOverride(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
991
977
|
/**
|
|
992
978
|
* @public
|
|
993
979
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -1002,16 +988,16 @@ declare namespace InvoiceCollectionSetting {
|
|
|
1002
988
|
* Overrides invoice collection settings before a draft invoice is created.
|
|
1003
989
|
* @public
|
|
1004
990
|
*/
|
|
1005
|
-
type CollectionOverrideFunction<Config
|
|
991
|
+
type CollectionOverrideFunction<Config> = (request: InvoiceCollectionRequest, config: Config, context: Context) => InvoiceCollectionResponse;
|
|
1006
992
|
}
|
|
1007
993
|
|
|
1008
994
|
/**
|
|
1009
995
|
* @example
|
|
1010
996
|
* ```ts
|
|
1011
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
997
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1012
998
|
*
|
|
1013
999
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1014
|
-
* interface MyInvoiceCollectionSettingConfig
|
|
1000
|
+
* interface MyInvoiceCollectionSettingConfig {}
|
|
1015
1001
|
*
|
|
1016
1002
|
* export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
|
|
1017
1003
|
* collectionOverride(
|
|
@@ -1028,7 +1014,7 @@ declare namespace InvoiceCollectionSetting {
|
|
|
1028
1014
|
* ```
|
|
1029
1015
|
* @public
|
|
1030
1016
|
*/
|
|
1031
|
-
declare interface InvoiceCollectionSetting<Config
|
|
1017
|
+
declare interface InvoiceCollectionSetting<Config> {
|
|
1032
1018
|
collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
|
|
1033
1019
|
}
|
|
1034
1020
|
|
|
@@ -1068,7 +1054,7 @@ declare namespace Prorations {
|
|
|
1068
1054
|
/** @public */
|
|
1069
1055
|
type PricingTierMode = 'graduated' | 'volume';
|
|
1070
1056
|
/** @public */
|
|
1071
|
-
type RecurringPriceInterval = 'day' | '
|
|
1057
|
+
type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
|
|
1072
1058
|
/** @public */
|
|
1073
1059
|
type PriceType = 'one_time' | 'recurring';
|
|
1074
1060
|
/** @public */
|
|
@@ -1106,37 +1092,30 @@ declare namespace Prorations {
|
|
|
1106
1092
|
items: ProratableItem[];
|
|
1107
1093
|
}
|
|
1108
1094
|
/** @public */
|
|
1109
|
-
type ProratableItem = {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
/** Either CREDIT or DEBIT based on whether the item is a credit or debit. */
|
|
1113
|
-
type: ItemType;
|
|
1114
|
-
/** Whether the item was generated from a proration event. */
|
|
1115
|
-
isProration: boolean;
|
|
1116
|
-
/** The time period this item covers. */
|
|
1117
|
-
servicePeriod: TimeRange;
|
|
1118
|
-
/** The default proration factor calculated by Stripe. */
|
|
1119
|
-
currentProrationFactor: Decimal;
|
|
1120
|
-
/** The duration of the price interval in seconds. */
|
|
1121
|
-
priceIntervalDuration: number;
|
|
1122
|
-
/** Information about the corresponding debit that a CREDIT item credits against. */
|
|
1123
|
-
correspondingDebit?: PreviousDebit;
|
|
1124
|
-
} & ({
|
|
1125
|
-
priceKind: 'price';
|
|
1126
|
-
price: Price;
|
|
1095
|
+
type ProratableItem = ({
|
|
1096
|
+
customPricingUnitOverageRate: CustomPricingUnitOverageRate;
|
|
1097
|
+
priceKind: 'customPricingUnitOverageRate';
|
|
1127
1098
|
} | {
|
|
1128
|
-
priceKind: 'licenseFee';
|
|
1129
1099
|
licenseFee: LicenseFee;
|
|
1100
|
+
priceKind: 'licenseFee';
|
|
1130
1101
|
} | {
|
|
1131
|
-
|
|
1132
|
-
|
|
1102
|
+
otherPriceKind: string;
|
|
1103
|
+
priceKind: 'other';
|
|
1133
1104
|
} | {
|
|
1134
|
-
|
|
1135
|
-
|
|
1105
|
+
price: Price;
|
|
1106
|
+
priceKind: 'price';
|
|
1136
1107
|
} | {
|
|
1137
|
-
priceKind: '
|
|
1138
|
-
|
|
1139
|
-
})
|
|
1108
|
+
priceKind: 'rateCardRate';
|
|
1109
|
+
rateCardRate: RateCardRate;
|
|
1110
|
+
}) & {
|
|
1111
|
+
correspondingDebit?: PreviousDebit;
|
|
1112
|
+
currentProrationFactor: Decimal;
|
|
1113
|
+
isProration: boolean;
|
|
1114
|
+
key: string;
|
|
1115
|
+
priceIntervalDuration: number;
|
|
1116
|
+
servicePeriod: TimeRange;
|
|
1117
|
+
type: ItemType;
|
|
1118
|
+
};
|
|
1140
1119
|
/**
|
|
1141
1120
|
* Information about a previous debit that a credit item offsets.
|
|
1142
1121
|
* @public
|
|
@@ -1234,9 +1213,7 @@ declare namespace Prorations {
|
|
|
1234
1213
|
*/
|
|
1235
1214
|
function prepareResultProrateItems(result: ProrateItemsResult): ProrateItemsResult;
|
|
1236
1215
|
/** @internal */
|
|
1237
|
-
function $platformWrapProrateItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
1238
|
-
prorateItems(...a: unknown[]): unknown;
|
|
1239
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
1216
|
+
function $platformWrapProrateItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { prorateItems(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
1240
1217
|
/**
|
|
1241
1218
|
* @public
|
|
1242
1219
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -1251,16 +1228,16 @@ declare namespace Prorations {
|
|
|
1251
1228
|
* Calculates prorated amounts for subscription items when changes occur mid-billing period. The script receives the invoice items, then returns computed proration factors for each item.
|
|
1252
1229
|
* @public
|
|
1253
1230
|
*/
|
|
1254
|
-
type ProrateItemsFunction<Config
|
|
1231
|
+
type ProrateItemsFunction<Config> = (request: ProrateItemsInput, config: Config, context: Context) => ProrateItemsResult;
|
|
1255
1232
|
}
|
|
1256
1233
|
|
|
1257
1234
|
/**
|
|
1258
1235
|
* @example
|
|
1259
1236
|
* ```ts
|
|
1260
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1237
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1261
1238
|
*
|
|
1262
1239
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1263
|
-
* interface MyProrationsConfig
|
|
1240
|
+
* interface MyProrationsConfig {}
|
|
1264
1241
|
*
|
|
1265
1242
|
* export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
1266
1243
|
* prorateItems(
|
|
@@ -1279,7 +1256,7 @@ declare namespace Prorations {
|
|
|
1279
1256
|
* ```
|
|
1280
1257
|
* @public
|
|
1281
1258
|
*/
|
|
1282
|
-
declare interface Prorations<Config
|
|
1259
|
+
declare interface Prorations<Config> {
|
|
1283
1260
|
prorateItems: Prorations.ProrateItemsFunction<Config>;
|
|
1284
1261
|
}
|
|
1285
1262
|
|
|
@@ -1288,7 +1265,7 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1288
1265
|
/** @public */
|
|
1289
1266
|
type PricingTierMode = 'graduated' | 'volume';
|
|
1290
1267
|
/** @public */
|
|
1291
|
-
type RecurringPriceInterval = 'day' | '
|
|
1268
|
+
type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
|
|
1292
1269
|
/** @public */
|
|
1293
1270
|
type PriceType = 'one_time' | 'recurring';
|
|
1294
1271
|
/** @public */
|
|
@@ -1332,33 +1309,28 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1332
1309
|
items: Item[];
|
|
1333
1310
|
}
|
|
1334
1311
|
/** @public */
|
|
1335
|
-
type Item = {
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
/** Either CREDIT or DEBIT based on whether the item is a credit or debit. */
|
|
1339
|
-
type: ItemType;
|
|
1340
|
-
/** Whether the item was generated from a proration event. */
|
|
1341
|
-
isProration: boolean;
|
|
1342
|
-
/** The time period this item covers. */
|
|
1343
|
-
servicePeriod: AnyTimeRange;
|
|
1344
|
-
/** The proration factor for this item. */
|
|
1345
|
-
prorationFactor: Decimal;
|
|
1346
|
-
} & ({
|
|
1347
|
-
priceKind: 'price';
|
|
1348
|
-
price: Price;
|
|
1312
|
+
type Item = ({
|
|
1313
|
+
customPricingUnitOverageRate: CustomPricingUnitOverageRate;
|
|
1314
|
+
priceKind: 'customPricingUnitOverageRate';
|
|
1349
1315
|
} | {
|
|
1350
|
-
priceKind: 'licenseFee';
|
|
1351
1316
|
licenseFee: LicenseFee;
|
|
1317
|
+
priceKind: 'licenseFee';
|
|
1352
1318
|
} | {
|
|
1353
|
-
|
|
1354
|
-
|
|
1319
|
+
otherPriceKind: string;
|
|
1320
|
+
priceKind: 'other';
|
|
1355
1321
|
} | {
|
|
1356
|
-
|
|
1357
|
-
|
|
1322
|
+
price: Price;
|
|
1323
|
+
priceKind: 'price';
|
|
1358
1324
|
} | {
|
|
1359
|
-
priceKind: '
|
|
1360
|
-
|
|
1361
|
-
})
|
|
1325
|
+
priceKind: 'rateCardRate';
|
|
1326
|
+
rateCardRate: RateCardRate;
|
|
1327
|
+
}) & {
|
|
1328
|
+
isProration: boolean;
|
|
1329
|
+
key: string;
|
|
1330
|
+
prorationFactor: Decimal;
|
|
1331
|
+
servicePeriod: AnyTimeRange;
|
|
1332
|
+
type: ItemType;
|
|
1333
|
+
};
|
|
1362
1334
|
/** @public */
|
|
1363
1335
|
interface CustomPricingUnitOverageRate {
|
|
1364
1336
|
id: string;
|
|
@@ -1470,17 +1442,10 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1470
1442
|
items: ItemWithCreationStrategy[];
|
|
1471
1443
|
}
|
|
1472
1444
|
/** @public */
|
|
1473
|
-
type ItemWithCreationStrategy = {
|
|
1474
|
-
/** The unique identifier of the item, matching a key from the input. */
|
|
1475
|
-
key: string;
|
|
1476
|
-
} & ({
|
|
1477
|
-
creationStrategy: 'doNotCreate';
|
|
1478
|
-
} | {
|
|
1479
|
-
creationStrategy: 'invoice';
|
|
1480
|
-
} | {
|
|
1445
|
+
type ItemWithCreationStrategy = ({
|
|
1481
1446
|
creationStrategy: 'other';
|
|
1482
1447
|
otherCreationStrategy: string;
|
|
1483
|
-
});
|
|
1448
|
+
} | { creationStrategy: 'doNotCreate' } | { creationStrategy: 'invoice' }) & { key: string };
|
|
1484
1449
|
/** @public */
|
|
1485
1450
|
type Invoice = Record<string, never>;
|
|
1486
1451
|
/** @public */
|
|
@@ -1504,9 +1469,7 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1504
1469
|
*/
|
|
1505
1470
|
function prepareResultBeforeItemCreation(result: BeforeItemCreationResult): BeforeItemCreationResult;
|
|
1506
1471
|
/** @internal */
|
|
1507
|
-
function $platformWrapBeforeItemCreation(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
1508
|
-
beforeItemCreation(...a: unknown[]): unknown;
|
|
1509
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
1472
|
+
function $platformWrapBeforeItemCreation(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { beforeItemCreation(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
1510
1473
|
/**
|
|
1511
1474
|
* @public
|
|
1512
1475
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -1518,9 +1481,7 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1518
1481
|
*/
|
|
1519
1482
|
function prepareResultFilterItems(result: FilterItemsResult): FilterItemsResult;
|
|
1520
1483
|
/** @internal */
|
|
1521
|
-
function $platformWrapFilterItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
1522
|
-
filterItems(...a: unknown[]): unknown;
|
|
1523
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
1484
|
+
function $platformWrapFilterItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { filterItems(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
1524
1485
|
/**
|
|
1525
1486
|
* @public
|
|
1526
1487
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -1532,33 +1493,31 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1532
1493
|
*/
|
|
1533
1494
|
function prepareResultGroupItems(result: GroupItemsResult): GroupItemsResult;
|
|
1534
1495
|
/** @internal */
|
|
1535
|
-
function $platformWrapGroupItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
1536
|
-
groupItems(...a: unknown[]): unknown;
|
|
1537
|
-
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
1496
|
+
function $platformWrapGroupItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { groupItems(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
1538
1497
|
/**
|
|
1539
1498
|
* Runs before invoice items are created. Decides whether each item should be created or skipped.
|
|
1540
1499
|
* @public
|
|
1541
1500
|
*/
|
|
1542
|
-
type BeforeItemCreationFunction<Config
|
|
1501
|
+
type BeforeItemCreationFunction<Config> = (request: BeforeItemCreationInput, config: Config, context: Context) => BeforeItemCreationResult;
|
|
1543
1502
|
/**
|
|
1544
1503
|
* Runs before invoices are created. Decides which items to include on the invoice. Items not included are deferred as pending invoice items.
|
|
1545
1504
|
* @public
|
|
1546
1505
|
*/
|
|
1547
|
-
type FilterItemsFunction<Config
|
|
1506
|
+
type FilterItemsFunction<Config> = (request: FilterItemsInput, config: Config, context: Context) => FilterItemsResult;
|
|
1548
1507
|
/**
|
|
1549
1508
|
* Runs before invoices are created. Decides how items are grouped across one or more invoices.
|
|
1550
1509
|
* @public
|
|
1551
1510
|
*/
|
|
1552
|
-
type GroupItemsFunction<Config
|
|
1511
|
+
type GroupItemsFunction<Config> = (request: GroupItemsInput, config: Config, context: Context) => GroupItemsResult;
|
|
1553
1512
|
}
|
|
1554
1513
|
|
|
1555
1514
|
/**
|
|
1556
1515
|
* @example
|
|
1557
1516
|
* ```ts
|
|
1558
|
-
* import type { Billing, Context } from '@stripe/extensibility-sdk
|
|
1517
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk';
|
|
1559
1518
|
*
|
|
1560
1519
|
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
1561
|
-
* interface MyRecurringBillingItemHandlingConfig
|
|
1520
|
+
* interface MyRecurringBillingItemHandlingConfig {}
|
|
1562
1521
|
*
|
|
1563
1522
|
* export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
1564
1523
|
* beforeItemCreation(
|
|
@@ -1601,7 +1560,7 @@ declare namespace RecurringBillingItemHandling {
|
|
|
1601
1560
|
* ```
|
|
1602
1561
|
* @public
|
|
1603
1562
|
*/
|
|
1604
|
-
declare interface RecurringBillingItemHandling<Config
|
|
1563
|
+
declare interface RecurringBillingItemHandling<Config> {
|
|
1605
1564
|
beforeItemCreation: RecurringBillingItemHandling.BeforeItemCreationFunction<Config>;
|
|
1606
1565
|
filterItems: RecurringBillingItemHandling.FilterItemsFunction<Config>;
|
|
1607
1566
|
groupItems: RecurringBillingItemHandling.GroupItemsFunction<Config>;
|