@stripe/extensibility-sdk 0.22.4
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/LICENSE.md +19 -0
- package/dist/config-values/generate.cjs +262 -0
- package/dist/config-values/generate.d.ts +38 -0
- package/dist/config-values/generate.d.ts.map +1 -0
- package/dist/config-values/generate.js +232 -0
- package/dist/config-values/parse.d.ts +87 -0
- package/dist/config-values/parse.d.ts.map +1 -0
- package/dist/extensibility-sdk-alpha.d.ts +542 -0
- package/dist/extensibility-sdk-beta.d.ts +542 -0
- package/dist/extensibility-sdk-config-values-alpha.d.ts +27 -0
- package/dist/extensibility-sdk-config-values-beta.d.ts +27 -0
- package/dist/extensibility-sdk-config-values-internal.d.ts +118 -0
- package/dist/extensibility-sdk-config-values-public.d.ts +27 -0
- package/dist/extensibility-sdk-extensions-alpha.d.ts +1592 -0
- package/dist/extensibility-sdk-extensions-beta.d.ts +1592 -0
- package/dist/extensibility-sdk-extensions-internal.d.ts +1655 -0
- package/dist/extensibility-sdk-extensions-public.d.ts +1592 -0
- package/dist/extensibility-sdk-internal-alpha.d.ts +9 -0
- package/dist/extensibility-sdk-internal-beta.d.ts +9 -0
- package/dist/extensibility-sdk-internal-internal.d.ts +23 -0
- package/dist/extensibility-sdk-internal-public.d.ts +9 -0
- package/dist/extensibility-sdk-internal.d.ts +915 -0
- package/dist/extensibility-sdk-jsonschema-alpha.d.ts +3 -0
- package/dist/extensibility-sdk-jsonschema-beta.d.ts +3 -0
- package/dist/extensibility-sdk-jsonschema-internal.d.ts +15 -0
- package/dist/extensibility-sdk-jsonschema-public.d.ts +3 -0
- package/dist/extensibility-sdk-public.d.ts +542 -0
- package/dist/extensibility-sdk-stdlib-alpha.d.ts +531 -0
- package/dist/extensibility-sdk-stdlib-beta.d.ts +531 -0
- package/dist/extensibility-sdk-stdlib-internal.d.ts +904 -0
- package/dist/extensibility-sdk-stdlib-public.d.ts +531 -0
- package/dist/extensions/billing/bill/discount_calculation.d.ts +226 -0
- package/dist/extensions/billing/bill/discount_calculation.d.ts.map +1 -0
- package/dist/extensions/billing/bill/index.d.ts +2 -0
- package/dist/extensions/billing/bill/index.d.ts.map +1 -0
- package/dist/extensions/billing/customer_balance_application.d.ts +82 -0
- package/dist/extensions/billing/customer_balance_application.d.ts.map +1 -0
- package/dist/extensions/billing/index.d.ts +8 -0
- package/dist/extensions/billing/index.d.ts.map +1 -0
- package/dist/extensions/billing/invoice_collection_setting.d.ts +117 -0
- package/dist/extensions/billing/invoice_collection_setting.d.ts.map +1 -0
- package/dist/extensions/billing/prorations.d.ts +222 -0
- package/dist/extensions/billing/prorations.d.ts.map +1 -0
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts +326 -0
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -0
- package/dist/extensions/billing/types.d.ts +33 -0
- package/dist/extensions/billing/types.d.ts.map +1 -0
- package/dist/extensions/context.d.ts +9 -0
- package/dist/extensions/context.d.ts.map +1 -0
- package/dist/extensions/core/index.d.ts +3 -0
- package/dist/extensions/core/index.d.ts.map +1 -0
- package/dist/extensions/core/workflows/custom_action.d.ts +142 -0
- package/dist/extensions/core/workflows/custom_action.d.ts.map +1 -0
- package/dist/extensions/core/workflows/index.d.ts +2 -0
- package/dist/extensions/core/workflows/index.d.ts.map +1 -0
- package/dist/extensions/extend/index.d.ts +3 -0
- package/dist/extensions/extend/index.d.ts.map +1 -0
- package/dist/extensions/extend/workflows/custom_action.d.ts +142 -0
- package/dist/extensions/extend/workflows/custom_action.d.ts.map +1 -0
- package/dist/extensions/extend/workflows/index.d.ts +2 -0
- package/dist/extensions/extend/workflows/index.d.ts.map +1 -0
- package/dist/extensions/index.cjs +2356 -0
- package/dist/extensions/index.d.ts +9 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +2435 -0
- package/dist/extensions/registry.d.ts +19 -0
- package/dist/extensions/registry.d.ts.map +1 -0
- package/dist/extensions/types.d.ts +10 -0
- package/dist/extensions/types.d.ts.map +1 -0
- package/dist/index.cjs +1519 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1460 -0
- package/dist/internal.cjs +156 -0
- package/dist/internal.d.ts +3 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +128 -0
- package/dist/jsonschema.cjs +18 -0
- package/dist/jsonschema.d.ts +2 -0
- package/dist/jsonschema.d.ts.map +1 -0
- package/dist/jsonschema.js +0 -0
- package/dist/stdlib/brand.d.ts +27 -0
- package/dist/stdlib/brand.d.ts.map +1 -0
- package/dist/stdlib/decimal.d.ts +324 -0
- package/dist/stdlib/decimal.d.ts.map +1 -0
- package/dist/stdlib/extension-method.d.ts +27 -0
- package/dist/stdlib/extension-method.d.ts.map +1 -0
- package/dist/stdlib/generated.d.ts +15 -0
- package/dist/stdlib/generated.d.ts.map +1 -0
- package/dist/stdlib/index.cjs +1519 -0
- package/dist/stdlib/index.d.ts +18 -0
- package/dist/stdlib/index.d.ts.map +1 -0
- package/dist/stdlib/index.js +1460 -0
- package/dist/stdlib/refs.d.ts +62 -0
- package/dist/stdlib/refs.d.ts.map +1 -0
- package/dist/stdlib/scalars.d.ts +141 -0
- package/dist/stdlib/scalars.d.ts.map +1 -0
- package/dist/stdlib/transform-strategies.d.ts +74 -0
- package/dist/stdlib/transform-strategies.d.ts.map +1 -0
- package/dist/stdlib/transforms.d.ts +97 -0
- package/dist/stdlib/transforms.d.ts.map +1 -0
- package/dist/stdlib/type-utils.d.ts +9 -0
- package/dist/stdlib/type-utils.d.ts.map +1 -0
- package/dist/stdlib/types.d.ts +281 -0
- package/dist/stdlib/types.d.ts.map +1 -0
- package/dist/stdlib/utils.d.ts +7 -0
- package/dist/stdlib/utils.d.ts.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +111 -0
- package/tslibs/5.9.3/lib.es2022.egress.d.ts +4328 -0
- package/tslibs/5.9.3/lib.es2022.restricted.d.ts +4067 -0
- package/tslibs/lib.egress.globals.d.ts +112 -0
- package/tslibs/lib.restricted.globals.d.ts +1 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import type { Context } from '../context.js';
|
|
2
|
+
import type { Currency, TimeRange } from './types.js';
|
|
3
|
+
import type { Decimal, _ConfigApplicationContext } from '../../stdlib/index.js';
|
|
4
|
+
/** @public */
|
|
5
|
+
export declare namespace Prorations {
|
|
6
|
+
/** @public */
|
|
7
|
+
type PricingTierMode = 'graduated' | 'volume';
|
|
8
|
+
/** @public */
|
|
9
|
+
type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
|
|
10
|
+
/** @public */
|
|
11
|
+
type PriceType = 'one_time' | 'recurring';
|
|
12
|
+
/** @public */
|
|
13
|
+
type PricingScheme = 'per_unit' | 'tiered';
|
|
14
|
+
/** @public */
|
|
15
|
+
type UsageType = 'licensed' | 'metered';
|
|
16
|
+
/** @public */
|
|
17
|
+
type ItemType = 'credit' | 'debit';
|
|
18
|
+
/**
|
|
19
|
+
* The result of the prorations extension.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
interface ProrateItemsResult {
|
|
23
|
+
/** The items with computed proration factors. */
|
|
24
|
+
items: ItemWithProration[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* An item with a computed proration factor.
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
interface ItemWithProration {
|
|
31
|
+
/** The unique identifier of the item, matching a key from the input. */
|
|
32
|
+
key: string;
|
|
33
|
+
/** The computed proration factor. Positive for charges, negative for credits. */
|
|
34
|
+
prorationFactor: Decimal;
|
|
35
|
+
/** The displayed period for the invoice line item. */
|
|
36
|
+
lineItemPeriod: TimeRange;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The input to the prorations extension.
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
interface ProrateItemsInput {
|
|
43
|
+
/** The list of items that can have their proration factor and line item period modified. */
|
|
44
|
+
items: ProratableItem[];
|
|
45
|
+
}
|
|
46
|
+
/** @public */
|
|
47
|
+
type ProratableItem = {
|
|
48
|
+
/** Unique identifier for the item. */
|
|
49
|
+
key: string;
|
|
50
|
+
/** Either CREDIT or DEBIT based on whether the item is a credit or debit. */
|
|
51
|
+
type: ItemType;
|
|
52
|
+
/** Whether the item was generated from a proration event. */
|
|
53
|
+
isProration: boolean;
|
|
54
|
+
/** The time period this item covers. */
|
|
55
|
+
servicePeriod: TimeRange;
|
|
56
|
+
/** The default proration factor calculated by Stripe. */
|
|
57
|
+
currentProrationFactor: Decimal;
|
|
58
|
+
/** The duration of the price interval in seconds. */
|
|
59
|
+
priceIntervalDuration: number;
|
|
60
|
+
/** Information about the corresponding debit that a CREDIT item credits against. */
|
|
61
|
+
correspondingDebit?: PreviousDebit;
|
|
62
|
+
} & ({
|
|
63
|
+
priceKind: 'price';
|
|
64
|
+
price: Price;
|
|
65
|
+
} | {
|
|
66
|
+
priceKind: 'licenseFee';
|
|
67
|
+
licenseFee: LicenseFee;
|
|
68
|
+
} | {
|
|
69
|
+
priceKind: 'rateCardRate';
|
|
70
|
+
rateCardRate: RateCardRate;
|
|
71
|
+
} | {
|
|
72
|
+
priceKind: 'customPricingUnitOverageRate';
|
|
73
|
+
customPricingUnitOverageRate: CustomPricingUnitOverageRate;
|
|
74
|
+
} | {
|
|
75
|
+
priceKind: 'other';
|
|
76
|
+
otherPriceKind: string;
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* Information about a previous debit that a credit item offsets.
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
interface PreviousDebit {
|
|
83
|
+
/** The service period of the corresponding debit. */
|
|
84
|
+
servicePeriod: TimeRange;
|
|
85
|
+
}
|
|
86
|
+
/** @public */
|
|
87
|
+
interface CustomPricingUnitOverageRate {
|
|
88
|
+
id: string;
|
|
89
|
+
metadata: Record<string, string>;
|
|
90
|
+
rateCard: RateCard;
|
|
91
|
+
customPricingUnit: string;
|
|
92
|
+
unitAmount: Decimal;
|
|
93
|
+
}
|
|
94
|
+
/** @public */
|
|
95
|
+
interface RateCard {
|
|
96
|
+
id: string;
|
|
97
|
+
currency: Currency;
|
|
98
|
+
}
|
|
99
|
+
/** @public */
|
|
100
|
+
interface RateCardRate {
|
|
101
|
+
id: string;
|
|
102
|
+
metadata: Record<string, string>;
|
|
103
|
+
rateCard: RateCard;
|
|
104
|
+
tieringMode?: PricingTierMode;
|
|
105
|
+
tiers: RateCardRateTier[];
|
|
106
|
+
unitAmount?: Decimal;
|
|
107
|
+
}
|
|
108
|
+
/** @public */
|
|
109
|
+
interface RateCardRateTier {
|
|
110
|
+
flatAmount?: Decimal;
|
|
111
|
+
unitAmount?: Decimal;
|
|
112
|
+
upTo?: Decimal;
|
|
113
|
+
}
|
|
114
|
+
/** @public */
|
|
115
|
+
interface LicenseFee {
|
|
116
|
+
id: string;
|
|
117
|
+
lookupKey?: string;
|
|
118
|
+
metadata: Record<string, string>;
|
|
119
|
+
serviceInterval: RecurringPriceInterval;
|
|
120
|
+
serviceIntervalCount: number;
|
|
121
|
+
tieringMode?: PricingTierMode;
|
|
122
|
+
tiers: LicenseFeeTier[];
|
|
123
|
+
currency: Currency;
|
|
124
|
+
unitAmount?: Decimal;
|
|
125
|
+
}
|
|
126
|
+
/** @public */
|
|
127
|
+
interface LicenseFeeTier {
|
|
128
|
+
flatAmount?: Decimal;
|
|
129
|
+
unitAmount?: Decimal;
|
|
130
|
+
upTo?: Decimal;
|
|
131
|
+
}
|
|
132
|
+
/** @public */
|
|
133
|
+
interface Price {
|
|
134
|
+
id: string;
|
|
135
|
+
product: Product;
|
|
136
|
+
recurring?: RecurringPrice;
|
|
137
|
+
billingScheme: PricingScheme;
|
|
138
|
+
tiers: PriceTier[];
|
|
139
|
+
type: PriceType;
|
|
140
|
+
tiersMode?: PricingTierMode;
|
|
141
|
+
metadata: Record<string, string>;
|
|
142
|
+
currency: Currency;
|
|
143
|
+
unitAmount?: Decimal;
|
|
144
|
+
}
|
|
145
|
+
/** @public */
|
|
146
|
+
interface PriceTier {
|
|
147
|
+
flatAmount?: Decimal;
|
|
148
|
+
unitAmount?: Decimal;
|
|
149
|
+
upTo?: number;
|
|
150
|
+
}
|
|
151
|
+
/** @public */
|
|
152
|
+
interface RecurringPrice {
|
|
153
|
+
interval: RecurringPriceInterval;
|
|
154
|
+
intervalCount: number;
|
|
155
|
+
usageType?: UsageType;
|
|
156
|
+
meter?: string;
|
|
157
|
+
}
|
|
158
|
+
/** @public */
|
|
159
|
+
interface Product {
|
|
160
|
+
id: string;
|
|
161
|
+
name: string;
|
|
162
|
+
metadata: Record<string, string>;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* @public
|
|
166
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
167
|
+
*/
|
|
168
|
+
function prepareArgsProrateItems(proto: unknown): ProrateItemsInput;
|
|
169
|
+
/**
|
|
170
|
+
* @public
|
|
171
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
172
|
+
*/
|
|
173
|
+
function prepareResultProrateItems(result: ProrateItemsResult): ProrateItemsResult;
|
|
174
|
+
/** @internal */
|
|
175
|
+
function $platformWrapProrateItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
176
|
+
prorateItems(...a: unknown[]): unknown;
|
|
177
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
178
|
+
/**
|
|
179
|
+
* @public
|
|
180
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
181
|
+
*/
|
|
182
|
+
const prepareArgs: typeof prepareArgsProrateItems;
|
|
183
|
+
/**
|
|
184
|
+
* @public
|
|
185
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
186
|
+
*/
|
|
187
|
+
const prepareResult: typeof prepareResultProrateItems;
|
|
188
|
+
/**
|
|
189
|
+
* 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.
|
|
190
|
+
* @public
|
|
191
|
+
*/
|
|
192
|
+
type ProrateItemsFunction<Config extends Record<string, unknown>> = (request: ProrateItemsInput, config: Config, context: Context) => ProrateItemsResult;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* @example
|
|
196
|
+
* ```ts
|
|
197
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk/extensions';
|
|
198
|
+
*
|
|
199
|
+
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
200
|
+
* interface MyProrationsConfig extends Record<string, unknown> {}
|
|
201
|
+
*
|
|
202
|
+
* export default class MyProrations implements Billing.Prorations<MyProrationsConfig> {
|
|
203
|
+
* prorateItems(
|
|
204
|
+
* _request: Billing.Prorations.ProrateItemsInput,
|
|
205
|
+
* _config: MyProrationsConfig,
|
|
206
|
+
* _context: Context
|
|
207
|
+
* ) {
|
|
208
|
+
* // TODO: implement your proration logic here
|
|
209
|
+
*
|
|
210
|
+
* return {
|
|
211
|
+
* items: [],
|
|
212
|
+
* };
|
|
213
|
+
* }
|
|
214
|
+
* }
|
|
215
|
+
*
|
|
216
|
+
* ```
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
219
|
+
export interface Prorations<Config extends Record<string, unknown>> {
|
|
220
|
+
prorateItems: Prorations.ProrateItemsFunction<Config>;
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=prorations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prorations.d.ts","sourceRoot":"","sources":["../../../src/extensions/billing/prorations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,KAAK,EACV,OAAO,EACP,yBAAyB,EAI1B,MAAM,uBAAuB,CAAC;AAwB/B,cAAc;AACd,yBAAi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AAE,MAAM,CAAC,CAAC;KAClC;IAoeD;;;OAGG;IACH,SAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CAWzE;IAED;;;OAGG;IACH,SAAgB,yBAAyB,CACvC,MAAM,EAAE,kBAAkB,GACzB,kBAAkB,CAQpB;IAED,gBAAgB;IAChB,SAAgB,yBAAyB,CACvC,iBAAiB,CAAC,EAAE,CAClB,UAAU,EAAE,OAAO,EACnB,MAAM,EAAE,yBAAyB,KAC9B,OAAO,GACX,CACD,GAAG,EAAE,UAAU;QAAE,YAAY,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;KAAE,EACzD,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,OAAO,EACnB,GAAG,EAAE,OAAO,KACT,OAAO,CA0BX;IAID;;;OAGG;IACI,MAAM,WAAW,gCAAoB,CAAC;IAG7C;;;OAGG;IACI,MAAM,aAAa,kCAAsB,CAAC;IAEjD;;;OAGG;IACH,KAAY,oBAAoB,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CACzE,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,KACb,kBAAkB,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,UAAU,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAChE,YAAY,EAAE,UAAU,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;CACvD"}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import type { Context } from '../context.js';
|
|
2
|
+
import type { AnyTimeRange, Currency } from './types.js';
|
|
3
|
+
import type { Decimal, _ConfigApplicationContext } from '../../stdlib/index.js';
|
|
4
|
+
/** @public */
|
|
5
|
+
export declare namespace RecurringBillingItemHandling {
|
|
6
|
+
/** @public */
|
|
7
|
+
type PricingTierMode = 'graduated' | 'volume';
|
|
8
|
+
/** @public */
|
|
9
|
+
type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
|
|
10
|
+
/** @public */
|
|
11
|
+
type PriceType = 'one_time' | 'recurring';
|
|
12
|
+
/** @public */
|
|
13
|
+
type PricingScheme = 'per_unit' | 'tiered';
|
|
14
|
+
/** @public */
|
|
15
|
+
type UsageType = 'licensed' | 'metered';
|
|
16
|
+
/** @public */
|
|
17
|
+
type ItemType = 'credit' | 'debit';
|
|
18
|
+
/**
|
|
19
|
+
* The result of the group items extension.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
interface GroupItemsResult {
|
|
23
|
+
/** The groups of items, each corresponding to a separate invoice. */
|
|
24
|
+
groups: ItemGroup[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A group of items to place on a single invoice.
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
interface ItemGroup {
|
|
31
|
+
/** The items in this group. */
|
|
32
|
+
items: GroupedItem[];
|
|
33
|
+
/** Whether this group sets the latest invoice reference on the subscription. */
|
|
34
|
+
setsLatestInvoice: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* An item assigned to a group.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
interface GroupedItem {
|
|
41
|
+
/** The unique identifier of the item, matching a key from the input. */
|
|
42
|
+
key: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The input to the group items extension.
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
interface GroupItemsInput {
|
|
49
|
+
/** The list of items to group across invoices. */
|
|
50
|
+
items: Item[];
|
|
51
|
+
}
|
|
52
|
+
/** @public */
|
|
53
|
+
type Item = {
|
|
54
|
+
/** Unique identifier for the item. */
|
|
55
|
+
key: string;
|
|
56
|
+
/** Either CREDIT or DEBIT based on whether the item is a credit or debit. */
|
|
57
|
+
type: ItemType;
|
|
58
|
+
/** Whether the item was generated from a proration event. */
|
|
59
|
+
isProration: boolean;
|
|
60
|
+
/** The time period this item covers. */
|
|
61
|
+
servicePeriod: AnyTimeRange;
|
|
62
|
+
/** The proration factor for this item. */
|
|
63
|
+
prorationFactor: Decimal;
|
|
64
|
+
} & ({
|
|
65
|
+
priceKind: 'price';
|
|
66
|
+
price: Price;
|
|
67
|
+
} | {
|
|
68
|
+
priceKind: 'licenseFee';
|
|
69
|
+
licenseFee: LicenseFee;
|
|
70
|
+
} | {
|
|
71
|
+
priceKind: 'rateCardRate';
|
|
72
|
+
rateCardRate: RateCardRate;
|
|
73
|
+
} | {
|
|
74
|
+
priceKind: 'customPricingUnitOverageRate';
|
|
75
|
+
customPricingUnitOverageRate: CustomPricingUnitOverageRate;
|
|
76
|
+
} | {
|
|
77
|
+
priceKind: 'other';
|
|
78
|
+
otherPriceKind: string;
|
|
79
|
+
});
|
|
80
|
+
/** @public */
|
|
81
|
+
interface CustomPricingUnitOverageRate {
|
|
82
|
+
id: string;
|
|
83
|
+
metadata: Record<string, string>;
|
|
84
|
+
rateCard: RateCard;
|
|
85
|
+
customPricingUnit: string;
|
|
86
|
+
unitAmount: Decimal;
|
|
87
|
+
}
|
|
88
|
+
/** @public */
|
|
89
|
+
interface RateCard {
|
|
90
|
+
id: string;
|
|
91
|
+
currency: Currency;
|
|
92
|
+
}
|
|
93
|
+
/** @public */
|
|
94
|
+
interface RateCardRate {
|
|
95
|
+
id: string;
|
|
96
|
+
metadata: Record<string, string>;
|
|
97
|
+
rateCard: RateCard;
|
|
98
|
+
tieringMode?: PricingTierMode;
|
|
99
|
+
tiers: RateCardRateTier[];
|
|
100
|
+
unitAmount?: Decimal;
|
|
101
|
+
}
|
|
102
|
+
/** @public */
|
|
103
|
+
interface RateCardRateTier {
|
|
104
|
+
flatAmount?: Decimal;
|
|
105
|
+
unitAmount?: Decimal;
|
|
106
|
+
upTo?: Decimal;
|
|
107
|
+
}
|
|
108
|
+
/** @public */
|
|
109
|
+
interface LicenseFee {
|
|
110
|
+
id: string;
|
|
111
|
+
lookupKey?: string;
|
|
112
|
+
metadata: Record<string, string>;
|
|
113
|
+
serviceInterval: RecurringPriceInterval;
|
|
114
|
+
serviceIntervalCount: number;
|
|
115
|
+
tieringMode?: PricingTierMode;
|
|
116
|
+
tiers: LicenseFeeTier[];
|
|
117
|
+
currency: Currency;
|
|
118
|
+
unitAmount?: Decimal;
|
|
119
|
+
}
|
|
120
|
+
/** @public */
|
|
121
|
+
interface LicenseFeeTier {
|
|
122
|
+
flatAmount?: Decimal;
|
|
123
|
+
unitAmount?: Decimal;
|
|
124
|
+
upTo?: Decimal;
|
|
125
|
+
}
|
|
126
|
+
/** @public */
|
|
127
|
+
interface Price {
|
|
128
|
+
id: string;
|
|
129
|
+
product: Product;
|
|
130
|
+
recurring?: RecurringPrice;
|
|
131
|
+
billingScheme: PricingScheme;
|
|
132
|
+
tiers: PriceTier[];
|
|
133
|
+
type: PriceType;
|
|
134
|
+
tiersMode?: PricingTierMode;
|
|
135
|
+
metadata: Record<string, string>;
|
|
136
|
+
currency: Currency;
|
|
137
|
+
unitAmount?: Decimal;
|
|
138
|
+
}
|
|
139
|
+
/** @public */
|
|
140
|
+
interface PriceTier {
|
|
141
|
+
flatAmount?: Decimal;
|
|
142
|
+
unitAmount?: Decimal;
|
|
143
|
+
upTo?: number;
|
|
144
|
+
}
|
|
145
|
+
/** @public */
|
|
146
|
+
interface RecurringPrice {
|
|
147
|
+
interval: RecurringPriceInterval;
|
|
148
|
+
intervalCount: number;
|
|
149
|
+
usageType?: UsageType;
|
|
150
|
+
meter?: string;
|
|
151
|
+
}
|
|
152
|
+
/** @public */
|
|
153
|
+
interface Product {
|
|
154
|
+
id: string;
|
|
155
|
+
name: string;
|
|
156
|
+
metadata: Record<string, string>;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The result of the filter items extension.
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
interface FilterItemsResult {
|
|
163
|
+
/** The items to include on the invoice. */
|
|
164
|
+
items: ItemToInvoice[];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* An item selected for inclusion on the invoice.
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
interface ItemToInvoice {
|
|
171
|
+
/** The unique identifier of the item, matching a key from the input. */
|
|
172
|
+
key: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* The input to the filter items extension.
|
|
176
|
+
* @public
|
|
177
|
+
*/
|
|
178
|
+
interface FilterItemsInput {
|
|
179
|
+
/** The list of items to evaluate for inclusion on the invoice. */
|
|
180
|
+
items: Item[];
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The result of the before item creation extension.
|
|
184
|
+
* @public
|
|
185
|
+
*/
|
|
186
|
+
interface BeforeItemCreationResult {
|
|
187
|
+
/** The items with their creation strategies. */
|
|
188
|
+
items: ItemWithCreationStrategy[];
|
|
189
|
+
}
|
|
190
|
+
/** @public */
|
|
191
|
+
type ItemWithCreationStrategy = {
|
|
192
|
+
/** The unique identifier of the item, matching a key from the input. */
|
|
193
|
+
key: string;
|
|
194
|
+
} & ({
|
|
195
|
+
creationStrategy: 'doNotCreate';
|
|
196
|
+
} | {
|
|
197
|
+
creationStrategy: 'invoice';
|
|
198
|
+
} | {
|
|
199
|
+
creationStrategy: 'other';
|
|
200
|
+
otherCreationStrategy: string;
|
|
201
|
+
});
|
|
202
|
+
/** @public */
|
|
203
|
+
type Invoice = Record<string, never>;
|
|
204
|
+
/** @public */
|
|
205
|
+
type DoNotCreate = Record<string, never>;
|
|
206
|
+
/**
|
|
207
|
+
* The input to the before item creation extension.
|
|
208
|
+
* @public
|
|
209
|
+
*/
|
|
210
|
+
interface BeforeItemCreationInput {
|
|
211
|
+
/** The list of items to evaluate for creation. */
|
|
212
|
+
items: Item[];
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* @public
|
|
216
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
217
|
+
*/
|
|
218
|
+
function prepareArgsBeforeItemCreation(proto: unknown): BeforeItemCreationInput;
|
|
219
|
+
/**
|
|
220
|
+
* @public
|
|
221
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
222
|
+
*/
|
|
223
|
+
function prepareResultBeforeItemCreation(result: BeforeItemCreationResult): BeforeItemCreationResult;
|
|
224
|
+
/** @internal */
|
|
225
|
+
function $platformWrapBeforeItemCreation(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
226
|
+
beforeItemCreation(...a: unknown[]): unknown;
|
|
227
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
228
|
+
/**
|
|
229
|
+
* @public
|
|
230
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
231
|
+
*/
|
|
232
|
+
function prepareArgsFilterItems(proto: unknown): FilterItemsInput;
|
|
233
|
+
/**
|
|
234
|
+
* @public
|
|
235
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
236
|
+
*/
|
|
237
|
+
function prepareResultFilterItems(result: FilterItemsResult): FilterItemsResult;
|
|
238
|
+
/** @internal */
|
|
239
|
+
function $platformWrapFilterItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
240
|
+
filterItems(...a: unknown[]): unknown;
|
|
241
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
242
|
+
/**
|
|
243
|
+
* @public
|
|
244
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
245
|
+
*/
|
|
246
|
+
function prepareArgsGroupItems(proto: unknown): GroupItemsInput;
|
|
247
|
+
/**
|
|
248
|
+
* @public
|
|
249
|
+
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
250
|
+
*/
|
|
251
|
+
function prepareResultGroupItems(result: GroupItemsResult): GroupItemsResult;
|
|
252
|
+
/** @internal */
|
|
253
|
+
function $platformWrapGroupItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
254
|
+
groupItems(...a: unknown[]): unknown;
|
|
255
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
256
|
+
/**
|
|
257
|
+
* Runs before invoice items are created. Decides whether each item should be created or skipped.
|
|
258
|
+
* @public
|
|
259
|
+
*/
|
|
260
|
+
type BeforeItemCreationFunction<Config extends Record<string, unknown>> = (request: BeforeItemCreationInput, config: Config, context: Context) => BeforeItemCreationResult;
|
|
261
|
+
/**
|
|
262
|
+
* Runs before invoices are created. Decides which items to include on the invoice. Items not included are deferred as pending invoice items.
|
|
263
|
+
* @public
|
|
264
|
+
*/
|
|
265
|
+
type FilterItemsFunction<Config extends Record<string, unknown>> = (request: FilterItemsInput, config: Config, context: Context) => FilterItemsResult;
|
|
266
|
+
/**
|
|
267
|
+
* Runs before invoices are created. Decides how items are grouped across one or more invoices.
|
|
268
|
+
* @public
|
|
269
|
+
*/
|
|
270
|
+
type GroupItemsFunction<Config extends Record<string, unknown>> = (request: GroupItemsInput, config: Config, context: Context) => GroupItemsResult;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* @example
|
|
274
|
+
* ```ts
|
|
275
|
+
* import type { Billing, Context } from '@stripe/extensibility-sdk/extensions';
|
|
276
|
+
*
|
|
277
|
+
* // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
278
|
+
* interface MyRecurringBillingItemHandlingConfig extends Record<string, unknown> {}
|
|
279
|
+
*
|
|
280
|
+
* export default class MyRecurringBillingItemHandling implements Billing.RecurringBillingItemHandling<MyRecurringBillingItemHandlingConfig> {
|
|
281
|
+
* beforeItemCreation(
|
|
282
|
+
* _request: Billing.RecurringBillingItemHandling.BeforeItemCreationInput,
|
|
283
|
+
* _config: MyRecurringBillingItemHandlingConfig,
|
|
284
|
+
* _context: Context
|
|
285
|
+
* ) {
|
|
286
|
+
* // TODO: implement your before-item-creation logic here
|
|
287
|
+
*
|
|
288
|
+
* return {
|
|
289
|
+
* items: [],
|
|
290
|
+
* };
|
|
291
|
+
* }
|
|
292
|
+
*
|
|
293
|
+
* filterItems(
|
|
294
|
+
* _request: Billing.RecurringBillingItemHandling.FilterItemsInput,
|
|
295
|
+
* _config: MyRecurringBillingItemHandlingConfig,
|
|
296
|
+
* _context: Context
|
|
297
|
+
* ) {
|
|
298
|
+
* // TODO: implement your filter-items logic here
|
|
299
|
+
*
|
|
300
|
+
* return {
|
|
301
|
+
* items: [],
|
|
302
|
+
* };
|
|
303
|
+
* }
|
|
304
|
+
*
|
|
305
|
+
* groupItems(
|
|
306
|
+
* _request: Billing.RecurringBillingItemHandling.GroupItemsInput,
|
|
307
|
+
* _config: MyRecurringBillingItemHandlingConfig,
|
|
308
|
+
* _context: Context
|
|
309
|
+
* ) {
|
|
310
|
+
* // TODO: implement your group-items logic here
|
|
311
|
+
*
|
|
312
|
+
* return {
|
|
313
|
+
* groups: [],
|
|
314
|
+
* };
|
|
315
|
+
* }
|
|
316
|
+
* }
|
|
317
|
+
*
|
|
318
|
+
* ```
|
|
319
|
+
* @public
|
|
320
|
+
*/
|
|
321
|
+
export interface RecurringBillingItemHandling<Config extends Record<string, unknown>> {
|
|
322
|
+
beforeItemCreation: RecurringBillingItemHandling.BeforeItemCreationFunction<Config>;
|
|
323
|
+
filterItems: RecurringBillingItemHandling.FilterItemsFunction<Config>;
|
|
324
|
+
groupItems: RecurringBillingItemHandling.GroupItemsFunction<Config>;
|
|
325
|
+
}
|
|
326
|
+
//# sourceMappingURL=recurring_billing_item_handling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurring_billing_item_handling.d.ts","sourceRoot":"","sources":["../../../src/extensions/billing/recurring_billing_item_handling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,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,EACd,OAAO,EAAE,OAAO,KACb,wBAAwB,CAAC;IAE9B;;;OAGG;IACH,KAAY,mBAAmB,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CACxE,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,KACb,iBAAiB,CAAC;IAEvB;;;OAGG;IACH,KAAY,kBAAkB,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CACvE,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,KACb,gBAAgB,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,WAAW,4BAA4B,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAClF,kBAAkB,EAAE,4BAA4B,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACpF,WAAW,EAAE,4BAA4B,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACtE,UAAU,EAAE,4BAA4B,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;CACrE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a one-time event occurring at a specific date.
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export interface OneTime {
|
|
6
|
+
/** The date and time of the event. */
|
|
7
|
+
at: Date;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Represents a time period with start and end dates.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface TimeRange {
|
|
14
|
+
/** The beginning date of the range. */
|
|
15
|
+
startDate: Date;
|
|
16
|
+
/** The ending date of the range. */
|
|
17
|
+
endDate: Date;
|
|
18
|
+
}
|
|
19
|
+
/** @public */
|
|
20
|
+
export type AnyTimeRange = {
|
|
21
|
+
value: 'oneTime';
|
|
22
|
+
at: Date;
|
|
23
|
+
} | {
|
|
24
|
+
value: 'timeRange';
|
|
25
|
+
startDate: Date;
|
|
26
|
+
endDate: Date;
|
|
27
|
+
} | {
|
|
28
|
+
value: 'other';
|
|
29
|
+
otherValue: string;
|
|
30
|
+
};
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type { Currency, MonetaryAmount } from '../../stdlib/generated.js';
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/extensions/billing/types.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,sCAAsC;IACtC,EAAE,EAAE,IAAI,CAAC;CACV;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,uCAAuC;IACvC,SAAS,EAAE,IAAI,CAAC;IAChB,oCAAoC;IACpC,OAAO,EAAE,IAAI,CAAC;CACf;AAED,cAAc;AACd,MAAM,MAAM,YAAY,GACpB;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,IAAI,CAAA;CAAE,GAC9B;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,GACtD;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,gBAAgB;AAChB,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/extensions/context.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,WAAW,OAAO;IAEtB,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAElB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,CAAC"}
|