@stripe/extensibility-sdk 0.25.0 → 0.27.1

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 (43) hide show
  1. package/README.md +7 -9
  2. package/dist/config-values/generate.cjs +1 -1
  3. package/dist/config-values/generate.js +1 -1
  4. package/dist/extensibility-sdk-alpha.d.ts +85 -119
  5. package/dist/extensibility-sdk-beta.d.ts +85 -119
  6. package/dist/extensibility-sdk-extensions-alpha.d.ts +82 -54
  7. package/dist/extensibility-sdk-extensions-beta.d.ts +82 -54
  8. package/dist/extensibility-sdk-extensions-internal.d.ts +83 -55
  9. package/dist/extensibility-sdk-extensions-public.d.ts +82 -54
  10. package/dist/extensibility-sdk-internal.d.ts +89 -101
  11. package/dist/extensibility-sdk-public.d.ts +85 -119
  12. package/dist/extensions/billing/index.d.ts +1 -1
  13. package/dist/extensions/billing/invoice_collection_options.d.ts +111 -0
  14. package/dist/extensions/billing/invoice_collection_options.d.ts.map +1 -0
  15. package/dist/extensions/billing/recurring_billing_item_handling.d.ts +43 -0
  16. package/dist/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -1
  17. package/dist/extensions/index.cjs +111 -52
  18. package/dist/extensions/index.js +111 -52
  19. package/dist/index.cjs +128 -97
  20. package/dist/index.js +126 -91
  21. package/dist/internal.cjs +7 -7
  22. package/dist/internal.js +7 -7
  23. package/dist/stdlib/decimal.d.ts +2 -2
  24. package/dist/stdlib/index.d.ts +4 -8
  25. package/dist/stdlib/index.d.ts.map +1 -1
  26. package/dist/stdlib/refs.d.ts +1 -31
  27. package/dist/stdlib/refs.d.ts.map +1 -1
  28. package/dist/stdlib/scalars.d.ts +0 -22
  29. package/dist/stdlib/scalars.d.ts.map +1 -1
  30. package/dist/stdlib/to-const.d.ts +1 -1
  31. package/dist/stdlib/transforms.d.ts +1 -1
  32. package/dist/stdlib/types.d.ts +5 -5
  33. package/dist/stdlib/types.d.ts.map +1 -1
  34. package/dist/tsconfig.build.tsbuildinfo +1 -1
  35. package/package.json +2 -10
  36. package/dist/extensibility-sdk-stdlib-alpha.d.ts +0 -638
  37. package/dist/extensibility-sdk-stdlib-beta.d.ts +0 -638
  38. package/dist/extensibility-sdk-stdlib-internal.d.ts +0 -1008
  39. package/dist/extensibility-sdk-stdlib-public.d.ts +0 -638
  40. package/dist/extensions/billing/invoice_collection_setting.d.ts +0 -117
  41. package/dist/extensions/billing/invoice_collection_setting.d.ts.map +0 -1
  42. package/dist/stdlib/index.cjs +0 -1770
  43. package/dist/stdlib/index.js +0 -1710
@@ -75,7 +75,7 @@ declare namespace Bill {
75
75
  declare namespace Billing {
76
76
  export {
77
77
  CustomerBalanceApplication,
78
- InvoiceCollectionSetting,
78
+ InvoiceCollectionOptions,
79
79
  Prorations,
80
80
  RecurringBillingItemHandling,
81
81
  Bill,
@@ -472,7 +472,7 @@ declare interface CustomerBalanceApplication<Config> {
472
472
  *
473
473
  * @example
474
474
  * ```ts
475
- * import { Decimal, RoundDirection } from '@stripe/extensibility-sdk/stdlib';
475
+ * import { Decimal, RoundDirection } from '@stripe/extensibility-sdk';
476
476
  *
477
477
  * const price = Decimal.from('19.99');
478
478
  * const tax = price.mul(Decimal.from('0.0825'));
@@ -965,58 +965,65 @@ declare interface IntegerCompanion {
965
965
  declare type IntegerRoundDirection = 'ceil' | 'floor' | 'half-up' | 'round-down' | 'round-up';
966
966
 
967
967
  /** @public */
968
- declare namespace InvoiceCollectionSetting {
968
+ declare namespace InvoiceCollectionOptions {
969
969
  /** @public */
970
- type ParentType = 'billing_cadence' | 'contract' | 'quote' | 'standalone' | 'subscription_schedule' | 'subscription';
971
- /** @public */
972
- 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';
970
+ type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'blik' | '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';
973
971
  /** @public */
974
972
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
975
973
  /**
976
- * The result of the invoice collection settings override extension.
974
+ * The result of the invoice collection options override extension.
977
975
  * @public
978
976
  */
979
- interface InvoiceCollectionResponse {
977
+ interface InvoiceCollectionOptionsResult {
980
978
  /** Override the auto-advancement setting. Set to false to keep the invoice in draft. Return null to use the default. */
981
979
  autoAdvance?: boolean;
982
980
  }
983
981
  /** @public */
984
- type InvoiceCollectionRequest = ({
982
+ type InvoiceCollectionOptionsInput = ({
985
983
  customer: Customer;
986
984
  payer: 'customer';
987
985
  } | {
988
986
  otherPayer: string;
989
987
  payer: 'other';
990
- }) & {
991
- collectionSettings: CollectionSettings;
992
- parent: Parent;
993
- };
988
+ }) & ({
989
+ invoiceParentType: 'other';
990
+ otherInvoiceParentType: string;
991
+ } | {
992
+ invoiceParentType: 'subscription';
993
+ subscription: SubscriptionParent;
994
+ } | { invoiceParentType: 'cadence' } | { invoiceParentType: 'contract' } | { invoiceParentType: 'quote' } | { invoiceParentType: 'schedule' }) & { collectionOptions: CollectionOptions };
994
995
  /** @public */
995
996
  interface Customer {
996
997
  id: string;
997
998
  metadata: Record<string, string>;
998
999
  }
1000
+ /** @public */
1001
+ type ContractParent = Record<string, never>;
999
1002
  /**
1000
- * The parent resource that triggered the invoice creation.
1003
+ * The Subscription that triggered the invoice creation.
1001
1004
  * @public
1002
1005
  */
1003
- interface Parent {
1004
- /** The type of parent resource (for example, subscription or contract). */
1005
- type: ParentType;
1006
- /** Custom key-value pairs attached to the parent resource. */
1006
+ interface SubscriptionParent {
1007
+ /** The unique identifier for the subscription. */
1008
+ id: string;
1009
+ /** The metadata of the subscription. */
1007
1010
  metadata: Record<string, string>;
1008
1011
  }
1012
+ /** @public */
1013
+ type ScheduleParent = Record<string, never>;
1014
+ /** @public */
1015
+ type QuoteParent = Record<string, never>;
1016
+ /** @public */
1017
+ type CadenceParent = Record<string, never>;
1009
1018
  /**
1010
- * The collection settings for an invoice.
1019
+ * The collection options for an invoice.
1011
1020
  * @public
1012
1021
  */
1013
- interface CollectionSettings {
1022
+ interface CollectionOptions {
1014
1023
  /** Whether the invoice automatically advances through its lifecycle. */
1015
1024
  autoAdvance: boolean;
1016
1025
  /** The payment collection method: charge_automatically or send_invoice. */
1017
1026
  collectionMethod: CollectionMethod;
1018
- /** The delay before the invoice is finalized, in hours. */
1019
- finalizationGracePeriod: number;
1020
1027
  /** The payment methods configured for this invoice. */
1021
1028
  paymentMethods: PaymentMethodType[];
1022
1029
  }
@@ -1024,55 +1031,33 @@ declare namespace InvoiceCollectionSetting {
1024
1031
  * @public
1025
1032
  * @deprecated Platform dispatch handles wire/SDK conversion.
1026
1033
  */
1027
- function prepareArgsCollectionOverride(proto: unknown): InvoiceCollectionRequest;
1034
+ function prepareArgsOverrideOptions(proto: unknown): InvoiceCollectionOptionsInput;
1028
1035
  /**
1029
1036
  * @public
1030
1037
  * @deprecated Platform dispatch handles wire/SDK conversion.
1031
1038
  */
1032
- function prepareResultCollectionOverride(result: InvoiceCollectionResponse): InvoiceCollectionResponse;
1033
- /* Excluded from this release type: $platformWrapCollectionOverride */
1039
+ function prepareResultOverrideOptions(result: InvoiceCollectionOptionsResult): InvoiceCollectionOptionsResult;
1040
+ /* Excluded from this release type: $platformWrapOverrideOptions */
1034
1041
  /**
1035
1042
  * @public
1036
1043
  * @deprecated Platform dispatch handles wire/SDK conversion.
1037
1044
  */
1038
- const prepareArgs: typeof prepareArgsCollectionOverride;
1045
+ const prepareArgs: typeof prepareArgsOverrideOptions;
1039
1046
  /**
1040
1047
  * @public
1041
1048
  * @deprecated Platform dispatch handles wire/SDK conversion.
1042
1049
  */
1043
- const prepareResult: typeof prepareResultCollectionOverride;
1050
+ const prepareResult: typeof prepareResultOverrideOptions;
1044
1051
  /**
1045
- * Overrides invoice collection settings before a draft invoice is created.
1052
+ * Overrides invoice collection options before a draft invoice is created.
1046
1053
  * @public
1047
1054
  */
1048
- type CollectionOverrideFunction<Config> = (request: InvoiceCollectionRequest, config: Config, context: Context) => InvoiceCollectionResponse;
1055
+ type OverrideOptionsFunction<Config> = (request: InvoiceCollectionOptionsInput, config: Config, context: Context) => InvoiceCollectionOptionsResult;
1049
1056
  }
1050
1057
 
1051
- /**
1052
- * @example
1053
- * ```ts
1054
- * import type { Billing, Context } from '@stripe/extensibility-sdk';
1055
- *
1056
- * // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1057
- * interface MyInvoiceCollectionSettingConfig {}
1058
- *
1059
- * export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
1060
- * collectionOverride(
1061
- * _request: Billing.InvoiceCollectionSetting.InvoiceCollectionRequest,
1062
- * _config: MyInvoiceCollectionSettingConfig,
1063
- * _context: Context
1064
- * ) {
1065
- * // TODO: implement your collection setting logic here
1066
- *
1067
- * return {};
1068
- * }
1069
- * }
1070
- *
1071
- * ```
1072
- * @public
1073
- */
1074
- declare interface InvoiceCollectionSetting<Config> {
1075
- collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
1058
+ /** @public */
1059
+ declare interface InvoiceCollectionOptions<Config> {
1060
+ overrideOptions: InvoiceCollectionOptions.OverrideOptionsFunction<Config>;
1076
1061
  }
1077
1062
 
1078
1063
  /**
@@ -1402,6 +1387,15 @@ declare namespace RecurringBillingItemHandling {
1402
1387
  }
1403
1388
  /** @public */
1404
1389
  type Item = ({
1390
+ creditedItems: 'invoiceItem';
1391
+ invoiceItem: CreditedInvoiceItem;
1392
+ } | {
1393
+ creditedItems: 'invoiceLineItems';
1394
+ invoiceLineItems: InvoiceLineItems;
1395
+ } | {
1396
+ creditedItems: 'other';
1397
+ otherCreditedItems: string;
1398
+ }) & ({
1405
1399
  customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1406
1400
  priceKind: 'customPricingUnitOverageRate';
1407
1401
  } | {
@@ -1423,6 +1417,40 @@ declare namespace RecurringBillingItemHandling {
1423
1417
  servicePeriod: AnyTimeRange;
1424
1418
  type: ItemType;
1425
1419
  };
1420
+ /**
1421
+ * The invoice item corresponding to a credit item.
1422
+ * @public
1423
+ */
1424
+ interface CreditedInvoiceItem {
1425
+ /** The id of the invoice item. */
1426
+ id: string;
1427
+ }
1428
+ /**
1429
+ * Information about debit line items corresponding to a credit item.
1430
+ * @public
1431
+ */
1432
+ interface InvoiceLineItems {
1433
+ /** The invoice containing the line items. */
1434
+ invoice: CreditedInvoice;
1435
+ /** The line items corresponding to the credit. */
1436
+ invoiceLineItems: CreditedInvoiceLineItem[];
1437
+ }
1438
+ /**
1439
+ * The invoice line item corresponding to a credit item.
1440
+ * @public
1441
+ */
1442
+ interface CreditedInvoiceLineItem {
1443
+ /** The id of the invoice line item. */
1444
+ id: string;
1445
+ }
1446
+ /**
1447
+ * The invoice corresponding to a credit item.
1448
+ * @public
1449
+ */
1450
+ interface CreditedInvoice {
1451
+ /** The id of the invoice. */
1452
+ id: string;
1453
+ }
1426
1454
  /** @public */
1427
1455
  interface CustomPricingUnitOverageRate {
1428
1456
  id: string;
@@ -31,7 +31,7 @@ export declare const __brand: '__brand';
31
31
  *
32
32
  * Using a dedicated key (rather than the shared `__brand`) lets formspec's
33
33
  * structural brand-detection distinguish `Decimal` from other SDK branded
34
- * types (e.g., `Ref`, `StreetAddress`) that also carry `[__brand]`.
34
+ * types (e.g., `Ref`) that also carry `[__brand]`.
35
35
  *
36
36
  * String-literal const (not `unique symbol`) so that independent
37
37
  * declaration rollups (root vs subpath) produce structurally compatible
@@ -163,7 +163,7 @@ declare namespace Bill {
163
163
  declare namespace Billing {
164
164
  export {
165
165
  CustomerBalanceApplication,
166
- InvoiceCollectionSetting,
166
+ InvoiceCollectionOptions,
167
167
  Prorations,
168
168
  RecurringBillingItemHandling,
169
169
  Bill,
@@ -612,7 +612,7 @@ declare interface CustomerBalanceApplication<Config> {
612
612
  *
613
613
  * @example
614
614
  * ```ts
615
- * import { Decimal, RoundDirection } from '@stripe/extensibility-sdk/stdlib';
615
+ * import { Decimal, RoundDirection } from '@stripe/extensibility-sdk';
616
616
  *
617
617
  * const price = Decimal.from('19.99');
618
618
  * const tax = price.mul(Decimal.from('0.0825'));
@@ -1203,58 +1203,65 @@ export declare interface IntegerCompanion {
1203
1203
  export declare type IntegerRoundDirection = 'ceil' | 'floor' | 'half-up' | 'round-down' | 'round-up';
1204
1204
 
1205
1205
  /** @public */
1206
- declare namespace InvoiceCollectionSetting {
1206
+ declare namespace InvoiceCollectionOptions {
1207
1207
  /** @public */
1208
- type ParentType = 'billing_cadence' | 'contract' | 'quote' | 'standalone' | 'subscription_schedule' | 'subscription';
1209
- /** @public */
1210
- 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';
1208
+ type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'blik' | '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';
1211
1209
  /** @public */
1212
1210
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
1213
1211
  /**
1214
- * The result of the invoice collection settings override extension.
1212
+ * The result of the invoice collection options override extension.
1215
1213
  * @public
1216
1214
  */
1217
- interface InvoiceCollectionResponse {
1215
+ interface InvoiceCollectionOptionsResult {
1218
1216
  /** Override the auto-advancement setting. Set to false to keep the invoice in draft. Return null to use the default. */
1219
1217
  autoAdvance?: boolean;
1220
1218
  }
1221
1219
  /** @public */
1222
- type InvoiceCollectionRequest = ({
1220
+ type InvoiceCollectionOptionsInput = ({
1223
1221
  customer: Customer;
1224
1222
  payer: 'customer';
1225
1223
  } | {
1226
1224
  otherPayer: string;
1227
1225
  payer: 'other';
1228
- }) & {
1229
- collectionSettings: CollectionSettings;
1230
- parent: Parent;
1231
- };
1226
+ }) & ({
1227
+ invoiceParentType: 'other';
1228
+ otherInvoiceParentType: string;
1229
+ } | {
1230
+ invoiceParentType: 'subscription';
1231
+ subscription: SubscriptionParent;
1232
+ } | { invoiceParentType: 'cadence' } | { invoiceParentType: 'contract' } | { invoiceParentType: 'quote' } | { invoiceParentType: 'schedule' }) & { collectionOptions: CollectionOptions };
1232
1233
  /** @public */
1233
1234
  interface Customer {
1234
1235
  id: string;
1235
1236
  metadata: Record<string, string>;
1236
1237
  }
1238
+ /** @public */
1239
+ type ContractParent = Record<string, never>;
1237
1240
  /**
1238
- * The parent resource that triggered the invoice creation.
1241
+ * The Subscription that triggered the invoice creation.
1239
1242
  * @public
1240
1243
  */
1241
- interface Parent {
1242
- /** The type of parent resource (for example, subscription or contract). */
1243
- type: ParentType;
1244
- /** Custom key-value pairs attached to the parent resource. */
1244
+ interface SubscriptionParent {
1245
+ /** The unique identifier for the subscription. */
1246
+ id: string;
1247
+ /** The metadata of the subscription. */
1245
1248
  metadata: Record<string, string>;
1246
1249
  }
1250
+ /** @public */
1251
+ type ScheduleParent = Record<string, never>;
1252
+ /** @public */
1253
+ type QuoteParent = Record<string, never>;
1254
+ /** @public */
1255
+ type CadenceParent = Record<string, never>;
1247
1256
  /**
1248
- * The collection settings for an invoice.
1257
+ * The collection options for an invoice.
1249
1258
  * @public
1250
1259
  */
1251
- interface CollectionSettings {
1260
+ interface CollectionOptions {
1252
1261
  /** Whether the invoice automatically advances through its lifecycle. */
1253
1262
  autoAdvance: boolean;
1254
1263
  /** The payment collection method: charge_automatically or send_invoice. */
1255
1264
  collectionMethod: CollectionMethod;
1256
- /** The delay before the invoice is finalized, in hours. */
1257
- finalizationGracePeriod: number;
1258
1265
  /** The payment methods configured for this invoice. */
1259
1266
  paymentMethods: PaymentMethodType[];
1260
1267
  }
@@ -1262,77 +1269,36 @@ declare namespace InvoiceCollectionSetting {
1262
1269
  * @public
1263
1270
  * @deprecated Platform dispatch handles wire/SDK conversion.
1264
1271
  */
1265
- function prepareArgsCollectionOverride(proto: unknown): InvoiceCollectionRequest;
1272
+ function prepareArgsOverrideOptions(proto: unknown): InvoiceCollectionOptionsInput;
1266
1273
  /**
1267
1274
  * @public
1268
1275
  * @deprecated Platform dispatch handles wire/SDK conversion.
1269
1276
  */
1270
- function prepareResultCollectionOverride(result: InvoiceCollectionResponse): InvoiceCollectionResponse;
1277
+ function prepareResultOverrideOptions(result: InvoiceCollectionOptionsResult): InvoiceCollectionOptionsResult;
1271
1278
  /** @internal */
1272
- function $platformWrapCollectionOverride(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { collectionOverride(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
1279
+ function $platformWrapOverrideOptions(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => { overrideOptions(...a: unknown[]): unknown }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
1273
1280
  /**
1274
1281
  * @public
1275
1282
  * @deprecated Platform dispatch handles wire/SDK conversion.
1276
1283
  */
1277
- const prepareArgs: typeof prepareArgsCollectionOverride;
1284
+ const prepareArgs: typeof prepareArgsOverrideOptions;
1278
1285
  /**
1279
1286
  * @public
1280
1287
  * @deprecated Platform dispatch handles wire/SDK conversion.
1281
1288
  */
1282
- const prepareResult: typeof prepareResultCollectionOverride;
1289
+ const prepareResult: typeof prepareResultOverrideOptions;
1283
1290
  /**
1284
- * Overrides invoice collection settings before a draft invoice is created.
1291
+ * Overrides invoice collection options before a draft invoice is created.
1285
1292
  * @public
1286
1293
  */
1287
- type CollectionOverrideFunction<Config> = (request: InvoiceCollectionRequest, config: Config, context: Context) => InvoiceCollectionResponse;
1294
+ type OverrideOptionsFunction<Config> = (request: InvoiceCollectionOptionsInput, config: Config, context: Context) => InvoiceCollectionOptionsResult;
1288
1295
  }
1289
1296
 
1290
- /**
1291
- * @example
1292
- * ```ts
1293
- * import type { Billing, Context } from '@stripe/extensibility-sdk';
1294
- *
1295
- * // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1296
- * interface MyInvoiceCollectionSettingConfig {}
1297
- *
1298
- * export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
1299
- * collectionOverride(
1300
- * _request: Billing.InvoiceCollectionSetting.InvoiceCollectionRequest,
1301
- * _config: MyInvoiceCollectionSettingConfig,
1302
- * _context: Context
1303
- * ) {
1304
- * // TODO: implement your collection setting logic here
1305
- *
1306
- * return {};
1307
- * }
1308
- * }
1309
- *
1310
- * ```
1311
- * @public
1312
- */
1313
- declare interface InvoiceCollectionSetting<Config> {
1314
- collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
1297
+ /** @public */
1298
+ declare interface InvoiceCollectionOptions<Config> {
1299
+ overrideOptions: InvoiceCollectionOptions.OverrideOptionsFunction<Config>;
1315
1300
  }
1316
1301
 
1317
- /**
1318
- * Check whether a value is a `Decimal` instance.
1319
- *
1320
- * @remarks
1321
- * Use this instead of `instanceof` — the underlying class is not
1322
- * publicly exported, so `instanceof` checks are not available to
1323
- * consumers.
1324
- *
1325
- * @example
1326
- * ```ts
1327
- * if (isDecimal(value)) {
1328
- * value.add(Decimal.from('1')); // value is Decimal
1329
- * }
1330
- * ```
1331
- *
1332
- * @public
1333
- */
1334
- export declare function isDecimal(value: unknown): value is Decimal;
1335
-
1336
1302
  /**
1337
1303
  * Returns `true` if `value` conforms to the `PromiseLike` contract:
1338
1304
  * a non-null object or function with a callable `then` method.
@@ -1761,6 +1727,15 @@ declare namespace RecurringBillingItemHandling {
1761
1727
  }
1762
1728
  /** @public */
1763
1729
  type Item = ({
1730
+ creditedItems: 'invoiceItem';
1731
+ invoiceItem: CreditedInvoiceItem;
1732
+ } | {
1733
+ creditedItems: 'invoiceLineItems';
1734
+ invoiceLineItems: InvoiceLineItems;
1735
+ } | {
1736
+ creditedItems: 'other';
1737
+ otherCreditedItems: string;
1738
+ }) & ({
1764
1739
  customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1765
1740
  priceKind: 'customPricingUnitOverageRate';
1766
1741
  } | {
@@ -1782,6 +1757,40 @@ declare namespace RecurringBillingItemHandling {
1782
1757
  servicePeriod: AnyTimeRange;
1783
1758
  type: ItemType;
1784
1759
  };
1760
+ /**
1761
+ * The invoice item corresponding to a credit item.
1762
+ * @public
1763
+ */
1764
+ interface CreditedInvoiceItem {
1765
+ /** The id of the invoice item. */
1766
+ id: string;
1767
+ }
1768
+ /**
1769
+ * Information about debit line items corresponding to a credit item.
1770
+ * @public
1771
+ */
1772
+ interface InvoiceLineItems {
1773
+ /** The invoice containing the line items. */
1774
+ invoice: CreditedInvoice;
1775
+ /** The line items corresponding to the credit. */
1776
+ invoiceLineItems: CreditedInvoiceLineItem[];
1777
+ }
1778
+ /**
1779
+ * The invoice line item corresponding to a credit item.
1780
+ * @public
1781
+ */
1782
+ interface CreditedInvoiceLineItem {
1783
+ /** The id of the invoice line item. */
1784
+ id: string;
1785
+ }
1786
+ /**
1787
+ * The invoice corresponding to a credit item.
1788
+ * @public
1789
+ */
1790
+ interface CreditedInvoice {
1791
+ /** The id of the invoice. */
1792
+ id: string;
1793
+ }
1785
1794
  /** @public */
1786
1795
  interface CustomPricingUnitOverageRate {
1787
1796
  id: string;
@@ -2045,13 +2054,10 @@ export declare type Ref<T extends {
2045
2054
  readonly [__stripeType]: 'string';
2046
2055
  };
2047
2056
 
2048
- /** Factory for creating {@link (Ref:type)} values from an object with `object` and `id` fields. @public */
2049
- export declare const Ref: { create: <T extends { readonly object: string }>(step: { readonly id: string } & T) => Ref<T> };
2050
-
2051
2057
  /**
2052
2058
  * Wraps a transformer so that a `null` / `undefined` result throws
2053
2059
  * `WireParseError('Required field is missing')`, which `strategy.applyField`
2054
- * will catch and re-throw as WireReadError / WireWriteError with field context.
2060
+ * will catch and re-throw as _WireReadError / _WireWriteError with field context.
2055
2061
  *
2056
2062
  * The inner transformer runs first, so strategies that backfill absent values
2057
2063
  * (e.g. clock-aware `translateDateTime`) can satisfy the requirement.
@@ -2098,15 +2104,6 @@ export declare class _ShapeDescriptor<_S extends _ApplyStrategy = _ApplyStrategy
2098
2104
  constructor(typeName: string, fields: _FieldDescriptor[], oneofFields?: _OneofFieldDescriptor[]);
2099
2105
  }
2100
2106
 
2101
- /** A branded string representing a street address. @public */
2102
- export declare type StreetAddress = {
2103
- readonly [__brand]: 'StreetAddress';
2104
- readonly [__stripeType]: 'string';
2105
- } & string;
2106
-
2107
- /** Factory for creating {@link (StreetAddress:type)} branded values. @public */
2108
- export declare const StreetAddress: { create: (address: string) => StreetAddress };
2109
-
2110
2107
  /** The type of the opaque Stripe type-tag key used in SDK scalar types. @public */
2111
2108
  export declare type StripeTypeSymbol = typeof __stripeType;
2112
2109
 
@@ -2121,15 +2118,6 @@ declare interface TimeRange {
2121
2118
  endDate: Date;
2122
2119
  }
2123
2120
 
2124
- /** A branded string representing an ISO 8601 datetime. @public */
2125
- export declare type Timestamp = {
2126
- readonly [__brand]: 'Timestamp';
2127
- readonly [__stripeType]: 'string';
2128
- } & string;
2129
-
2130
- /** Factory for creating {@link (Timestamp:type)} branded values. @public */
2131
- export declare const Timestamp: { create: (value: string) => Timestamp };
2132
-
2133
2121
  /**
2134
2122
  * Deep-freezes `value` and returns it typed as {@link DeepReadonly}`<T>`.
2135
2123
  *
@@ -2139,7 +2127,7 @@ export declare const Timestamp: { create: (value: string) => Timestamp };
2139
2127
  *
2140
2128
  * @example
2141
2129
  * ```typescript
2142
- * import { toConst } from '@stripe/extensibility-sdk/stdlib';
2130
+ * import { toConst } from '@stripe/extensibility-sdk';
2143
2131
  *
2144
2132
  * const DEFAULTS = toConst({ timeout: 30, retries: 3 });
2145
2133
  * // Type: { readonly timeout: 30; readonly retries: 3 }
@@ -2274,9 +2262,9 @@ export declare class _UnionDescriptor<_S extends _ApplyStrategy = _ApplyStrategy
2274
2262
  * Indicates malformed or unexpected data from the proto infrastructure —
2275
2263
  * not a bug in the user's code.
2276
2264
  *
2277
- * @public
2265
+ * @internal
2278
2266
  */
2279
- export declare class WireReadError extends Error {
2267
+ export declare class _WireReadError extends Error {
2280
2268
  /**
2281
2269
  * Error class name for `instanceof`-free identification.
2282
2270
  * @internal
@@ -2289,9 +2277,9 @@ export declare class WireReadError extends Error {
2289
2277
  * Indicates that the user's code returned a value that cannot be translated
2290
2278
  * back to wire format.
2291
2279
  *
2292
- * @public
2280
+ * @internal
2293
2281
  */
2294
- export declare class WireWriteError extends Error {
2282
+ export declare class _WireWriteError extends Error {
2295
2283
  /**
2296
2284
  * Error class name for `instanceof`-free identification.
2297
2285
  * @internal