@stripe/extensibility-sdk 0.22.4 → 0.23.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 (41) hide show
  1. package/dist/api-surface.d.ts.map +1 -0
  2. package/dist/config-values/generate.cjs +1 -1
  3. package/dist/config-values/generate.d.ts +2 -2
  4. package/dist/config-values/generate.d.ts.map +1 -1
  5. package/dist/config-values/generate.js +1 -1
  6. package/dist/extensibility-sdk-alpha.d.ts +1293 -1
  7. package/dist/extensibility-sdk-beta.d.ts +1293 -1
  8. package/dist/extensibility-sdk-config-values-internal.d.ts +2 -2
  9. package/dist/extensibility-sdk-extensions-alpha.d.ts +56 -77
  10. package/dist/extensibility-sdk-extensions-beta.d.ts +56 -77
  11. package/dist/extensibility-sdk-extensions-internal.d.ts +67 -110
  12. package/dist/extensibility-sdk-extensions-public.d.ts +56 -77
  13. package/dist/extensibility-sdk-internal.d.ts +1304 -1
  14. package/dist/extensibility-sdk-public.d.ts +1293 -1
  15. package/dist/extensions/billing/bill/discount_calculation.d.ts +3 -5
  16. package/dist/extensions/billing/customer_balance_application.d.ts +1 -3
  17. package/dist/extensions/billing/invoice_collection_setting.d.ts +11 -15
  18. package/dist/extensions/billing/prorations.d.ts +21 -30
  19. package/dist/extensions/billing/recurring_billing_item_handling.d.ts +23 -41
  20. package/dist/extensions/billing/types.d.ts +4 -4
  21. package/dist/extensions/core/workflows/custom_action.d.ts +2 -6
  22. package/dist/extensions/extend/workflows/custom_action.d.ts +2 -6
  23. package/dist/index.cjs +2317 -0
  24. package/dist/index.d.ts +2 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +2320 -0
  27. package/dist/stdlib/decimal.d.ts +4 -40
  28. package/dist/stdlib/refs.d.ts +7 -21
  29. package/dist/stdlib/scalars.d.ts +16 -71
  30. package/dist/stdlib/type-utils.d.ts +1 -3
  31. package/dist/stdlib/types.d.ts +6 -6
  32. package/dist/tsconfig.build.tsbuildinfo +1 -1
  33. package/package.json +2 -10
  34. package/dist/extensibility-sdk-jsonschema-alpha.d.ts +0 -3
  35. package/dist/extensibility-sdk-jsonschema-beta.d.ts +0 -3
  36. package/dist/extensibility-sdk-jsonschema-internal.d.ts +0 -15
  37. package/dist/extensibility-sdk-jsonschema-public.d.ts +0 -3
  38. package/dist/jsonschema.cjs +0 -18
  39. package/dist/jsonschema.d.ts +0 -2
  40. package/dist/jsonschema.d.ts.map +0 -1
  41. package/dist/jsonschema.js +0 -0
@@ -35,15 +35,15 @@ declare const __stripeType: unique symbol;
35
35
 
36
36
  /** @public */
37
37
  declare type AnyTimeRange = {
38
- value: 'oneTime';
39
38
  at: Date;
39
+ value: 'oneTime';
40
40
  } | {
41
- value: 'timeRange';
42
- startDate: Date;
43
41
  endDate: Date;
42
+ startDate: Date;
43
+ value: 'timeRange';
44
44
  } | {
45
- value: 'other';
46
45
  otherValue: string;
46
+ value: 'other';
47
47
  };
48
48
 
49
49
  declare namespace Bill {
@@ -170,9 +170,7 @@ declare namespace CustomAction {
170
170
  */
171
171
  function prepareResultExecute(result: ExecuteCustomActionResponse): ExecuteCustomActionResponse;
172
172
  /** @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;
173
+ function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { execute(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
176
174
  /**
177
175
  * @public
178
176
  * @deprecated Platform dispatch handles wire/SDK conversion.
@@ -184,9 +182,7 @@ declare namespace CustomAction {
184
182
  */
185
183
  function prepareResultGetFormState(result: GetFormStateResponse): GetFormStateResponse;
186
184
  /** @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;
185
+ function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { getFormState(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
190
186
  /**
191
187
  * Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
192
188
  * @public
@@ -311,9 +307,7 @@ declare namespace CustomAction_2 {
311
307
  */
312
308
  function prepareResultExecute(result: ExecuteCustomActionResponse): ExecuteCustomActionResponse;
313
309
  /** @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;
310
+ function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { execute(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
317
311
  /**
318
312
  * @public
319
313
  * @deprecated Platform dispatch handles wire/SDK conversion.
@@ -325,9 +319,7 @@ declare namespace CustomAction_2 {
325
319
  */
326
320
  function prepareResultGetFormState(result: GetFormStateResponse): GetFormStateResponse;
327
321
  /** @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;
322
+ function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { getFormState(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
331
323
  /**
332
324
  * Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
333
325
  * @public
@@ -414,9 +406,7 @@ declare namespace CustomerBalanceApplication {
414
406
  */
415
407
  function prepareResultComputeAppliedCustomerBalance(result: CustomerBalanceApplicationResult): CustomerBalanceApplicationResult;
416
408
  /** @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;
409
+ function $platformWrapComputeAppliedCustomerBalance(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { computeAppliedCustomerBalance(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
420
410
  /**
421
411
  * @public
422
412
  * @deprecated Platform dispatch handles wire/SDK conversion.
@@ -688,7 +678,7 @@ export declare const DecimalRoundingPresets: Readonly<{
688
678
  /** @public */
689
679
  declare namespace DiscountCalculation {
690
680
  /** @public */
691
- type BillingReason = 'automatic_pending_invoice_item_invoice' | 'manual' | 'subscription' | 'subscription_create' | 'subscription_cycle' | 'subscription_cancel' | 'subscription_threshold' | 'subscription_trial_ended' | 'subscription_update' | 'upcoming' | 'quote_accept';
681
+ 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
682
  /** @public */
693
683
  type PricingTierMode = 'graduated' | 'volume';
694
684
  /** @public */
@@ -698,7 +688,7 @@ declare namespace DiscountCalculation {
698
688
  /** @public */
699
689
  type UsageType = 'licensed' | 'metered';
700
690
  /** @public */
701
- type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
691
+ type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
702
692
  /**
703
693
  * The result of a discount calculation.
704
694
  * @public
@@ -858,9 +848,7 @@ declare namespace DiscountCalculation {
858
848
  */
859
849
  function prepareResultComputeDiscounts(result: DiscountResult): DiscountResult;
860
850
  /** @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;
851
+ function $platformWrapComputeDiscounts(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { computeDiscounts(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
864
852
  /**
865
853
  * @public
866
854
  * @deprecated Platform dispatch handles wire/SDK conversion.
@@ -919,11 +907,11 @@ export { Extend }
919
907
  /** @public */
920
908
  declare namespace InvoiceCollectionSetting {
921
909
  /** @public */
922
- type ParentType = 'subscription' | 'contract' | 'quote' | 'billing_cadence' | 'subscription_schedule' | 'standalone';
910
+ type ParentType = 'billing_cadence' | 'contract' | 'quote' | 'standalone' | 'subscription_schedule' | 'subscription';
923
911
  /** @public */
924
- type PaymentMethodType = 'card' | 'ach_debit' | 'ach_credit_transfer' | 'sepa_debit' | 'sepa_credit_transfer' | 'bacs_debit' | 'au_becs_debit' | 'us_bank_account' | 'link' | 'boleto' | 'oxxo' | 'ideal' | 'bancontact' | 'giropay' | 'eps' | 'p24' | 'sofort' | 'alipay' | 'wechat_pay' | 'klarna' | 'affirm' | 'afterpay_clearpay' | 'cashapp' | 'paypal' | 'multibanco' | 'konbini' | 'promptpay' | 'paynow' | 'grabpay' | 'fpx';
912
+ 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
913
  /** @public */
926
- type CollectionMethod = 'send_invoice' | 'charge_automatically';
914
+ type CollectionMethod = 'charge_automatically' | 'send_invoice';
927
915
  /**
928
916
  * The result of the invoice collection settings override extension.
929
917
  * @public
@@ -933,18 +921,16 @@ declare namespace InvoiceCollectionSetting {
933
921
  autoAdvance?: boolean;
934
922
  }
935
923
  /** @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';
924
+ type InvoiceCollectionRequest = ({
943
925
  customer: Customer;
926
+ payer: 'customer';
944
927
  } | {
945
- payer: 'other';
946
928
  otherPayer: string;
947
- });
929
+ payer: 'other';
930
+ }) & {
931
+ collectionSettings: CollectionSettings;
932
+ parent: Parent;
933
+ };
948
934
  /** @public */
949
935
  interface Customer {
950
936
  id: string;
@@ -985,9 +971,7 @@ declare namespace InvoiceCollectionSetting {
985
971
  */
986
972
  function prepareResultCollectionOverride(result: InvoiceCollectionResponse): InvoiceCollectionResponse;
987
973
  /** @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;
974
+ function $platformWrapCollectionOverride(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { collectionOverride(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
991
975
  /**
992
976
  * @public
993
977
  * @deprecated Platform dispatch handles wire/SDK conversion.
@@ -1068,7 +1052,7 @@ declare namespace Prorations {
1068
1052
  /** @public */
1069
1053
  type PricingTierMode = 'graduated' | 'volume';
1070
1054
  /** @public */
1071
- type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
1055
+ type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
1072
1056
  /** @public */
1073
1057
  type PriceType = 'one_time' | 'recurring';
1074
1058
  /** @public */
@@ -1106,37 +1090,30 @@ declare namespace Prorations {
1106
1090
  items: ProratableItem[];
1107
1091
  }
1108
1092
  /** @public */
1109
- type ProratableItem = {
1110
- /** Unique identifier for the item. */
1111
- key: string;
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;
1093
+ type ProratableItem = ({
1094
+ customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1095
+ priceKind: 'customPricingUnitOverageRate';
1127
1096
  } | {
1128
- priceKind: 'licenseFee';
1129
1097
  licenseFee: LicenseFee;
1098
+ priceKind: 'licenseFee';
1130
1099
  } | {
1131
- priceKind: 'rateCardRate';
1132
- rateCardRate: RateCardRate;
1100
+ otherPriceKind: string;
1101
+ priceKind: 'other';
1133
1102
  } | {
1134
- priceKind: 'customPricingUnitOverageRate';
1135
- customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1103
+ price: Price;
1104
+ priceKind: 'price';
1136
1105
  } | {
1137
- priceKind: 'other';
1138
- otherPriceKind: string;
1139
- });
1106
+ priceKind: 'rateCardRate';
1107
+ rateCardRate: RateCardRate;
1108
+ }) & {
1109
+ correspondingDebit?: PreviousDebit;
1110
+ currentProrationFactor: Decimal;
1111
+ isProration: boolean;
1112
+ key: string;
1113
+ priceIntervalDuration: number;
1114
+ servicePeriod: TimeRange;
1115
+ type: ItemType;
1116
+ };
1140
1117
  /**
1141
1118
  * Information about a previous debit that a credit item offsets.
1142
1119
  * @public
@@ -1234,9 +1211,7 @@ declare namespace Prorations {
1234
1211
  */
1235
1212
  function prepareResultProrateItems(result: ProrateItemsResult): ProrateItemsResult;
1236
1213
  /** @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;
1214
+ function $platformWrapProrateItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { prorateItems(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
1240
1215
  /**
1241
1216
  * @public
1242
1217
  * @deprecated Platform dispatch handles wire/SDK conversion.
@@ -1288,7 +1263,7 @@ declare namespace RecurringBillingItemHandling {
1288
1263
  /** @public */
1289
1264
  type PricingTierMode = 'graduated' | 'volume';
1290
1265
  /** @public */
1291
- type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
1266
+ type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
1292
1267
  /** @public */
1293
1268
  type PriceType = 'one_time' | 'recurring';
1294
1269
  /** @public */
@@ -1332,33 +1307,28 @@ declare namespace RecurringBillingItemHandling {
1332
1307
  items: Item[];
1333
1308
  }
1334
1309
  /** @public */
1335
- type Item = {
1336
- /** Unique identifier for the item. */
1337
- key: string;
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;
1310
+ type Item = ({
1311
+ customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1312
+ priceKind: 'customPricingUnitOverageRate';
1349
1313
  } | {
1350
- priceKind: 'licenseFee';
1351
1314
  licenseFee: LicenseFee;
1315
+ priceKind: 'licenseFee';
1352
1316
  } | {
1353
- priceKind: 'rateCardRate';
1354
- rateCardRate: RateCardRate;
1317
+ otherPriceKind: string;
1318
+ priceKind: 'other';
1355
1319
  } | {
1356
- priceKind: 'customPricingUnitOverageRate';
1357
- customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1320
+ price: Price;
1321
+ priceKind: 'price';
1358
1322
  } | {
1359
- priceKind: 'other';
1360
- otherPriceKind: string;
1361
- });
1323
+ priceKind: 'rateCardRate';
1324
+ rateCardRate: RateCardRate;
1325
+ }) & {
1326
+ isProration: boolean;
1327
+ key: string;
1328
+ prorationFactor: Decimal;
1329
+ servicePeriod: AnyTimeRange;
1330
+ type: ItemType;
1331
+ };
1362
1332
  /** @public */
1363
1333
  interface CustomPricingUnitOverageRate {
1364
1334
  id: string;
@@ -1470,17 +1440,10 @@ declare namespace RecurringBillingItemHandling {
1470
1440
  items: ItemWithCreationStrategy[];
1471
1441
  }
1472
1442
  /** @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
- } | {
1443
+ type ItemWithCreationStrategy = ({
1481
1444
  creationStrategy: 'other';
1482
1445
  otherCreationStrategy: string;
1483
- });
1446
+ } | { creationStrategy: 'doNotCreate' } | { creationStrategy: 'invoice' }) & { key: string };
1484
1447
  /** @public */
1485
1448
  type Invoice = Record<string, never>;
1486
1449
  /** @public */
@@ -1504,9 +1467,7 @@ declare namespace RecurringBillingItemHandling {
1504
1467
  */
1505
1468
  function prepareResultBeforeItemCreation(result: BeforeItemCreationResult): BeforeItemCreationResult;
1506
1469
  /** @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;
1470
+ function $platformWrapBeforeItemCreation(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { beforeItemCreation(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
1510
1471
  /**
1511
1472
  * @public
1512
1473
  * @deprecated Platform dispatch handles wire/SDK conversion.
@@ -1518,9 +1479,7 @@ declare namespace RecurringBillingItemHandling {
1518
1479
  */
1519
1480
  function prepareResultFilterItems(result: FilterItemsResult): FilterItemsResult;
1520
1481
  /** @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;
1482
+ function $platformWrapFilterItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { filterItems(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
1524
1483
  /**
1525
1484
  * @public
1526
1485
  * @deprecated Platform dispatch handles wire/SDK conversion.
@@ -1532,9 +1491,7 @@ declare namespace RecurringBillingItemHandling {
1532
1491
  */
1533
1492
  function prepareResultGroupItems(result: GroupItemsResult): GroupItemsResult;
1534
1493
  /** @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;
1494
+ function $platformWrapGroupItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { groupItems(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
1538
1495
  /**
1539
1496
  * Runs before invoice items are created. Decides whether each item should be created or skipped.
1540
1497
  * @public
@@ -26,15 +26,15 @@ declare const __stripeType: unique symbol;
26
26
 
27
27
  /** @public */
28
28
  declare type AnyTimeRange = {
29
- value: 'oneTime';
30
29
  at: Date;
30
+ value: 'oneTime';
31
31
  } | {
32
- value: 'timeRange';
33
- startDate: Date;
34
32
  endDate: Date;
33
+ startDate: Date;
34
+ value: 'timeRange';
35
35
  } | {
36
- value: 'other';
37
36
  otherValue: string;
37
+ value: 'other';
38
38
  };
39
39
 
40
40
  declare namespace Bill {
@@ -643,7 +643,7 @@ export declare const DecimalRoundingPresets: Readonly<{
643
643
  /** @public */
644
644
  declare namespace DiscountCalculation {
645
645
  /** @public */
646
- type BillingReason = 'automatic_pending_invoice_item_invoice' | 'manual' | 'subscription' | 'subscription_create' | 'subscription_cycle' | 'subscription_cancel' | 'subscription_threshold' | 'subscription_trial_ended' | 'subscription_update' | 'upcoming' | 'quote_accept';
646
+ 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';
647
647
  /** @public */
648
648
  type PricingTierMode = 'graduated' | 'volume';
649
649
  /** @public */
@@ -653,7 +653,7 @@ declare namespace DiscountCalculation {
653
653
  /** @public */
654
654
  type UsageType = 'licensed' | 'metered';
655
655
  /** @public */
656
- type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
656
+ type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
657
657
  /**
658
658
  * The result of a discount calculation.
659
659
  * @public
@@ -871,11 +871,11 @@ export { Extend }
871
871
  /** @public */
872
872
  declare namespace InvoiceCollectionSetting {
873
873
  /** @public */
874
- type ParentType = 'subscription' | 'contract' | 'quote' | 'billing_cadence' | 'subscription_schedule' | 'standalone';
874
+ type ParentType = 'billing_cadence' | 'contract' | 'quote' | 'standalone' | 'subscription_schedule' | 'subscription';
875
875
  /** @public */
876
- type PaymentMethodType = 'card' | 'ach_debit' | 'ach_credit_transfer' | 'sepa_debit' | 'sepa_credit_transfer' | 'bacs_debit' | 'au_becs_debit' | 'us_bank_account' | 'link' | 'boleto' | 'oxxo' | 'ideal' | 'bancontact' | 'giropay' | 'eps' | 'p24' | 'sofort' | 'alipay' | 'wechat_pay' | 'klarna' | 'affirm' | 'afterpay_clearpay' | 'cashapp' | 'paypal' | 'multibanco' | 'konbini' | 'promptpay' | 'paynow' | 'grabpay' | 'fpx';
876
+ 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';
877
877
  /** @public */
878
- type CollectionMethod = 'send_invoice' | 'charge_automatically';
878
+ type CollectionMethod = 'charge_automatically' | 'send_invoice';
879
879
  /**
880
880
  * The result of the invoice collection settings override extension.
881
881
  * @public
@@ -885,18 +885,16 @@ declare namespace InvoiceCollectionSetting {
885
885
  autoAdvance?: boolean;
886
886
  }
887
887
  /** @public */
888
- type InvoiceCollectionRequest = {
889
- /** The current collection settings that would be applied to the invoice. */
890
- collectionSettings: CollectionSettings;
891
- /** The billing resource that triggered invoice creation. */
892
- parent: Parent;
893
- } & ({
894
- payer: 'customer';
888
+ type InvoiceCollectionRequest = ({
895
889
  customer: Customer;
890
+ payer: 'customer';
896
891
  } | {
897
- payer: 'other';
898
892
  otherPayer: string;
899
- });
893
+ payer: 'other';
894
+ }) & {
895
+ collectionSettings: CollectionSettings;
896
+ parent: Parent;
897
+ };
900
898
  /** @public */
901
899
  interface Customer {
902
900
  id: string;
@@ -1017,7 +1015,7 @@ declare namespace Prorations {
1017
1015
  /** @public */
1018
1016
  type PricingTierMode = 'graduated' | 'volume';
1019
1017
  /** @public */
1020
- type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
1018
+ type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
1021
1019
  /** @public */
1022
1020
  type PriceType = 'one_time' | 'recurring';
1023
1021
  /** @public */
@@ -1055,37 +1053,30 @@ declare namespace Prorations {
1055
1053
  items: ProratableItem[];
1056
1054
  }
1057
1055
  /** @public */
1058
- type ProratableItem = {
1059
- /** Unique identifier for the item. */
1060
- key: string;
1061
- /** Either CREDIT or DEBIT based on whether the item is a credit or debit. */
1062
- type: ItemType;
1063
- /** Whether the item was generated from a proration event. */
1064
- isProration: boolean;
1065
- /** The time period this item covers. */
1066
- servicePeriod: TimeRange;
1067
- /** The default proration factor calculated by Stripe. */
1068
- currentProrationFactor: Decimal;
1069
- /** The duration of the price interval in seconds. */
1070
- priceIntervalDuration: number;
1071
- /** Information about the corresponding debit that a CREDIT item credits against. */
1072
- correspondingDebit?: PreviousDebit;
1073
- } & ({
1074
- priceKind: 'price';
1075
- price: Price;
1056
+ type ProratableItem = ({
1057
+ customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1058
+ priceKind: 'customPricingUnitOverageRate';
1076
1059
  } | {
1077
- priceKind: 'licenseFee';
1078
1060
  licenseFee: LicenseFee;
1061
+ priceKind: 'licenseFee';
1079
1062
  } | {
1080
- priceKind: 'rateCardRate';
1081
- rateCardRate: RateCardRate;
1063
+ otherPriceKind: string;
1064
+ priceKind: 'other';
1082
1065
  } | {
1083
- priceKind: 'customPricingUnitOverageRate';
1084
- customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1066
+ price: Price;
1067
+ priceKind: 'price';
1085
1068
  } | {
1086
- priceKind: 'other';
1087
- otherPriceKind: string;
1088
- });
1069
+ priceKind: 'rateCardRate';
1070
+ rateCardRate: RateCardRate;
1071
+ }) & {
1072
+ correspondingDebit?: PreviousDebit;
1073
+ currentProrationFactor: Decimal;
1074
+ isProration: boolean;
1075
+ key: string;
1076
+ priceIntervalDuration: number;
1077
+ servicePeriod: TimeRange;
1078
+ type: ItemType;
1079
+ };
1089
1080
  /**
1090
1081
  * Information about a previous debit that a credit item offsets.
1091
1082
  * @public
@@ -1234,7 +1225,7 @@ declare namespace RecurringBillingItemHandling {
1234
1225
  /** @public */
1235
1226
  type PricingTierMode = 'graduated' | 'volume';
1236
1227
  /** @public */
1237
- type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
1228
+ type RecurringPriceInterval = 'day' | 'month' | 'week' | 'year';
1238
1229
  /** @public */
1239
1230
  type PriceType = 'one_time' | 'recurring';
1240
1231
  /** @public */
@@ -1278,33 +1269,28 @@ declare namespace RecurringBillingItemHandling {
1278
1269
  items: Item[];
1279
1270
  }
1280
1271
  /** @public */
1281
- type Item = {
1282
- /** Unique identifier for the item. */
1283
- key: string;
1284
- /** Either CREDIT or DEBIT based on whether the item is a credit or debit. */
1285
- type: ItemType;
1286
- /** Whether the item was generated from a proration event. */
1287
- isProration: boolean;
1288
- /** The time period this item covers. */
1289
- servicePeriod: AnyTimeRange;
1290
- /** The proration factor for this item. */
1291
- prorationFactor: Decimal;
1292
- } & ({
1293
- priceKind: 'price';
1294
- price: Price;
1272
+ type Item = ({
1273
+ customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1274
+ priceKind: 'customPricingUnitOverageRate';
1295
1275
  } | {
1296
- priceKind: 'licenseFee';
1297
1276
  licenseFee: LicenseFee;
1277
+ priceKind: 'licenseFee';
1298
1278
  } | {
1299
- priceKind: 'rateCardRate';
1300
- rateCardRate: RateCardRate;
1279
+ otherPriceKind: string;
1280
+ priceKind: 'other';
1301
1281
  } | {
1302
- priceKind: 'customPricingUnitOverageRate';
1303
- customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1282
+ price: Price;
1283
+ priceKind: 'price';
1304
1284
  } | {
1305
- priceKind: 'other';
1306
- otherPriceKind: string;
1307
- });
1285
+ priceKind: 'rateCardRate';
1286
+ rateCardRate: RateCardRate;
1287
+ }) & {
1288
+ isProration: boolean;
1289
+ key: string;
1290
+ prorationFactor: Decimal;
1291
+ servicePeriod: AnyTimeRange;
1292
+ type: ItemType;
1293
+ };
1308
1294
  /** @public */
1309
1295
  interface CustomPricingUnitOverageRate {
1310
1296
  id: string;
@@ -1416,17 +1402,10 @@ declare namespace RecurringBillingItemHandling {
1416
1402
  items: ItemWithCreationStrategy[];
1417
1403
  }
1418
1404
  /** @public */
1419
- type ItemWithCreationStrategy = {
1420
- /** The unique identifier of the item, matching a key from the input. */
1421
- key: string;
1422
- } & ({
1423
- creationStrategy: 'doNotCreate';
1424
- } | {
1425
- creationStrategy: 'invoice';
1426
- } | {
1405
+ type ItemWithCreationStrategy = ({
1427
1406
  creationStrategy: 'other';
1428
1407
  otherCreationStrategy: string;
1429
- });
1408
+ } | { creationStrategy: 'doNotCreate' } | { creationStrategy: 'invoice' }) & { key: string };
1430
1409
  /** @public */
1431
1410
  type Invoice = Record<string, never>;
1432
1411
  /** @public */