@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
@@ -1,117 +0,0 @@
1
- import type { Context } from '../context.js';
2
- import type { _ConfigApplicationContext } from '../../stdlib/index.js';
3
- /** @public */
4
- export declare namespace InvoiceCollectionSetting {
5
- /** @public */
6
- type ParentType = 'subscription' | 'contract' | 'quote' | 'billing_cadence' | 'subscription_schedule' | 'standalone';
7
- /** @public */
8
- 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';
9
- /** @public */
10
- type CollectionMethod = 'send_invoice' | 'charge_automatically';
11
- /**
12
- * The result of the invoice collection settings override extension.
13
- * @public
14
- */
15
- interface InvoiceCollectionResponse {
16
- /** Override the auto-advancement setting. Set to false to keep the invoice in draft. Return null to use the default. */
17
- autoAdvance?: boolean;
18
- }
19
- /** @public */
20
- type InvoiceCollectionRequest = {
21
- /** The current collection settings that would be applied to the invoice. */
22
- collectionSettings: CollectionSettings;
23
- /** The billing resource that triggered invoice creation. */
24
- parent: Parent;
25
- } & ({
26
- payer: 'customer';
27
- customer: Customer;
28
- } | {
29
- payer: 'other';
30
- otherPayer: string;
31
- });
32
- /** @public */
33
- interface Customer {
34
- id: string;
35
- metadata: Record<string, string>;
36
- }
37
- /**
38
- * The parent resource that triggered the invoice creation.
39
- * @public
40
- */
41
- interface Parent {
42
- /** The type of parent resource (for example, subscription or contract). */
43
- type: ParentType;
44
- /** Custom key-value pairs attached to the parent resource. */
45
- metadata: Record<string, string>;
46
- }
47
- /**
48
- * The collection settings for an invoice.
49
- * @public
50
- */
51
- interface CollectionSettings {
52
- /** Whether the invoice automatically advances through its lifecycle. */
53
- autoAdvance: boolean;
54
- /** The payment collection method: charge_automatically or send_invoice. */
55
- collectionMethod: CollectionMethod;
56
- /** The delay before the invoice is finalized, in hours. */
57
- finalizationGracePeriod: number;
58
- /** The payment methods configured for this invoice. */
59
- paymentMethods: PaymentMethodType[];
60
- }
61
- /**
62
- * @public
63
- * @deprecated Platform dispatch handles wire/SDK conversion.
64
- */
65
- function prepareArgsCollectionOverride(proto: unknown): InvoiceCollectionRequest;
66
- /**
67
- * @public
68
- * @deprecated Platform dispatch handles wire/SDK conversion.
69
- */
70
- function prepareResultCollectionOverride(result: InvoiceCollectionResponse): InvoiceCollectionResponse;
71
- /** @internal */
72
- function $platformWrapCollectionOverride(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
73
- collectionOverride(...a: unknown[]): unknown;
74
- }, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
75
- /**
76
- * @public
77
- * @deprecated Platform dispatch handles wire/SDK conversion.
78
- */
79
- const prepareArgs: typeof prepareArgsCollectionOverride;
80
- /**
81
- * @public
82
- * @deprecated Platform dispatch handles wire/SDK conversion.
83
- */
84
- const prepareResult: typeof prepareResultCollectionOverride;
85
- /**
86
- * Overrides invoice collection settings before a draft invoice is created.
87
- * @public
88
- */
89
- type CollectionOverrideFunction<Config> = (request: InvoiceCollectionRequest, config: Config, context: Context) => InvoiceCollectionResponse;
90
- }
91
- /**
92
- * @example
93
- * ```ts
94
- * import type { Billing, Context } from '@stripe/extensibility-sdk';
95
- *
96
- * // eslint-disable-next-line @typescript-eslint/no-empty-object-type
97
- * interface MyInvoiceCollectionSettingConfig {}
98
- *
99
- * export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
100
- * collectionOverride(
101
- * _request: Billing.InvoiceCollectionSetting.InvoiceCollectionRequest,
102
- * _config: MyInvoiceCollectionSettingConfig,
103
- * _context: Context
104
- * ) {
105
- * // TODO: implement your collection setting logic here
106
- *
107
- * return {};
108
- * }
109
- * }
110
- *
111
- * ```
112
- * @public
113
- */
114
- export interface InvoiceCollectionSetting<Config> {
115
- collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
116
- }
117
- //# sourceMappingURL=invoice_collection_setting.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice_collection_setting.d.ts","sourceRoot":"","sources":["../../../src/extensions/billing/invoice_collection_setting.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAEV,yBAAyB,EAI1B,MAAM,uBAAuB,CAAC;AAwB/B,cAAc;AACd,yBAAiB,wBAAwB,CAAC;IACxC,cAAc;IACd,KAAY,UAAU,GAClB,cAAc,GACd,UAAU,GACV,OAAO,GACP,iBAAiB,GACjB,uBAAuB,GACvB,YAAY,CAAC;IAEjB,cAAc;IACd,KAAY,iBAAiB,GACzB,MAAM,GACN,WAAW,GACX,qBAAqB,GACrB,YAAY,GACZ,sBAAsB,GACtB,YAAY,GACZ,eAAe,GACf,iBAAiB,GACjB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,YAAY,GACZ,SAAS,GACT,KAAK,GACL,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,mBAAmB,GACnB,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,S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