@stripe/extensibility-sdk 0.24.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +355 -0
- package/dist/config-values/generate.d.ts +2 -0
- package/dist/config-values/generate.d.ts.map +1 -1
- package/dist/extensibility-sdk-alpha.d.ts +140 -38
- package/dist/extensibility-sdk-beta.d.ts +140 -38
- package/dist/extensibility-sdk-extensions-alpha.d.ts +155 -25
- package/dist/extensibility-sdk-extensions-beta.d.ts +155 -25
- package/dist/extensibility-sdk-extensions-internal.d.ts +159 -25
- package/dist/extensibility-sdk-extensions-public.d.ts +155 -25
- package/dist/extensibility-sdk-internal-alpha.d.ts +5 -0
- package/dist/extensibility-sdk-internal-beta.d.ts +5 -0
- package/dist/extensibility-sdk-internal-internal.d.ts +5 -0
- package/dist/extensibility-sdk-internal-public.d.ts +5 -0
- package/dist/extensibility-sdk-internal.d.ts +139 -40
- package/dist/extensibility-sdk-public.d.ts +140 -38
- package/dist/extensibility-sdk-stdlib-alpha.d.ts +145 -38
- package/dist/extensibility-sdk-stdlib-beta.d.ts +145 -38
- package/dist/extensibility-sdk-stdlib-internal.d.ts +144 -40
- package/dist/extensibility-sdk-stdlib-public.d.ts +145 -38
- package/dist/extensions/billing/bill/discount_calculation.d.ts +5 -3
- package/dist/extensions/billing/customer_balance_application.d.ts +3 -1
- package/dist/extensions/billing/invoice_collection_setting.d.ts +15 -11
- package/dist/extensions/billing/prorations.d.ts +30 -21
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts +41 -23
- package/dist/extensions/billing/types.d.ts +4 -4
- package/dist/extensions/core/workflows/custom_action.d.ts +6 -2
- package/dist/extensions/extend/workflows/custom_action.d.ts +6 -2
- package/dist/index.cjs +385 -134
- package/dist/index.js +383 -133
- package/dist/internal.d.ts +4 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/stdlib/brand.d.ts +16 -10
- package/dist/stdlib/brand.d.ts.map +1 -1
- package/dist/stdlib/decimal.d.ts +49 -21
- package/dist/stdlib/decimal.d.ts.map +1 -1
- package/dist/stdlib/index.cjs +385 -134
- package/dist/stdlib/index.d.ts +10 -4
- package/dist/stdlib/index.d.ts.map +1 -1
- package/dist/stdlib/index.js +383 -133
- package/dist/stdlib/refs.d.ts +21 -7
- package/dist/stdlib/scalars.d.ts +61 -28
- package/dist/stdlib/scalars.d.ts.map +1 -1
- package/dist/stdlib/to-const.d.ts +35 -0
- package/dist/stdlib/to-const.d.ts.map +1 -0
- package/dist/stdlib/type-utils.d.ts +3 -1
- package/dist/stdlib/types.d.ts +6 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/dist/api-surface.d.ts.map +0 -1
|
@@ -1,32 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import from `@stripe/extensibility-sdk` instead.
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import { __integerBrand } from '@formspec/core';
|
|
2
7
|
|
|
3
8
|
/**
|
|
4
|
-
* Opaque brand
|
|
9
|
+
* Opaque brand key used as a property key in SDK branded types.
|
|
5
10
|
*
|
|
6
11
|
* @remarks
|
|
7
12
|
* You do not need to use this directly — it is already embedded in
|
|
8
|
-
* branded values returned by factory functions like {@link (Integer:type)}.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
13
|
+
* branded values returned by factory functions like {@link (Integer:type)}.from().
|
|
14
|
+
*
|
|
15
|
+
* String-literal const (not `unique symbol`) so that independent
|
|
16
|
+
* declaration rollups (root vs subpath) produce structurally compatible
|
|
17
|
+
* branded types.
|
|
11
18
|
*
|
|
12
19
|
* @public
|
|
13
20
|
*/
|
|
14
|
-
export declare const __brand:
|
|
21
|
+
export declare const __brand: '__brand';
|
|
15
22
|
|
|
16
23
|
/* Excluded from this release type: __decimalBrand */
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Distinct brand key for PositiveInteger so an Integer is not assignable to
|
|
27
|
+
* PositiveInteger without going through the guard. PositiveInteger is a
|
|
28
|
+
* subtype of Integer (it carries both brands), so it can be used wherever
|
|
29
|
+
* Integer is expected.
|
|
30
|
+
*
|
|
31
|
+
* String-literal const (not `unique symbol`) so that independent
|
|
32
|
+
* declaration rollups (root vs subpath) produce structurally compatible
|
|
33
|
+
* branded types.
|
|
34
|
+
*
|
|
35
|
+
* For internal use only — may be removed in a future release.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export declare const __positiveIntegerBrand: '__positiveIntegerBrand';
|
|
19
40
|
|
|
20
41
|
/**
|
|
21
|
-
* Opaque type-tag
|
|
42
|
+
* Opaque type-tag key used by SDK scalar types to carry Stripe type metadata.
|
|
22
43
|
*
|
|
23
44
|
* @remarks
|
|
24
45
|
* You do not need to use this directly — it is already embedded in
|
|
25
|
-
* branded values returned by factory functions like {@link (Integer:type)}.
|
|
46
|
+
* branded values returned by factory functions like {@link (Integer:type)}.from().
|
|
47
|
+
*
|
|
48
|
+
* String-literal const (not `unique symbol`) so that independent
|
|
49
|
+
* declaration rollups (root vs subpath) produce structurally compatible
|
|
50
|
+
* branded types.
|
|
26
51
|
*
|
|
27
52
|
* @public
|
|
28
53
|
*/
|
|
29
|
-
export declare const __stripeType:
|
|
54
|
+
export declare const __stripeType: '__stripeType';
|
|
30
55
|
|
|
31
56
|
/* Excluded from this release type: _apply */
|
|
32
57
|
|
|
@@ -38,7 +63,7 @@ export declare const __stripeType: unique symbol;
|
|
|
38
63
|
|
|
39
64
|
/* Excluded from this release type: _ApplyStrategy */
|
|
40
65
|
|
|
41
|
-
/** The type of the opaque brand
|
|
66
|
+
/** The type of the opaque brand key used as a property key in SDK branded types. @public */
|
|
42
67
|
export declare type BrandSymbol = typeof __brand;
|
|
43
68
|
|
|
44
69
|
/* Excluded from this release type: _configAppContextFromContext */
|
|
@@ -82,59 +107,59 @@ export declare type Currency = 'aed' | 'afn' | 'all' | 'amd' | 'ang' | 'aoa' | '
|
|
|
82
107
|
* @public
|
|
83
108
|
*/
|
|
84
109
|
export declare interface Decimal {
|
|
85
|
-
/* Excluded from this release type:
|
|
86
|
-
/* Excluded from this release type:
|
|
87
|
-
/* Excluded from this release type:
|
|
110
|
+
/* Excluded from this release type: __brand */
|
|
111
|
+
/* Excluded from this release type: __decimalBrand */
|
|
112
|
+
/* Excluded from this release type: __stripeType */
|
|
88
113
|
/**
|
|
89
114
|
* Return the sum of this value and `other`.
|
|
90
115
|
* @public
|
|
91
116
|
*/
|
|
92
|
-
add(other:
|
|
117
|
+
add(other: DecimalLike): Decimal;
|
|
93
118
|
/**
|
|
94
119
|
* Return the difference of this value and `other`.
|
|
95
120
|
* @public
|
|
96
121
|
*/
|
|
97
|
-
sub(other:
|
|
122
|
+
sub(other: DecimalLike): Decimal;
|
|
98
123
|
/**
|
|
99
124
|
* Return the product of this value and `other`.
|
|
100
125
|
* @public
|
|
101
126
|
*/
|
|
102
|
-
mul(other:
|
|
127
|
+
mul(other: DecimalLike): Decimal;
|
|
103
128
|
/**
|
|
104
129
|
* Return the quotient of this value divided by `other`.
|
|
105
130
|
* @public
|
|
106
131
|
*/
|
|
107
|
-
div(other:
|
|
132
|
+
div(other: DecimalLike, precision: number, direction: RoundDirection): Decimal;
|
|
108
133
|
/**
|
|
109
134
|
* Three-way comparison: returns `-1`, `0`, or `1`.
|
|
110
135
|
* @public
|
|
111
136
|
*/
|
|
112
|
-
cmp(other:
|
|
137
|
+
cmp(other: DecimalLike): -1 | 0 | 1;
|
|
113
138
|
/**
|
|
114
139
|
* Return `true` if this value is numerically equal to `other`.
|
|
115
140
|
* @public
|
|
116
141
|
*/
|
|
117
|
-
eq(other:
|
|
142
|
+
eq(other: DecimalLike): boolean;
|
|
118
143
|
/**
|
|
119
144
|
* Return `true` if this value is strictly less than `other`.
|
|
120
145
|
* @public
|
|
121
146
|
*/
|
|
122
|
-
lt(other:
|
|
147
|
+
lt(other: DecimalLike): boolean;
|
|
123
148
|
/**
|
|
124
149
|
* Return `true` if this value is less than or equal to `other`.
|
|
125
150
|
* @public
|
|
126
151
|
*/
|
|
127
|
-
lte(other:
|
|
152
|
+
lte(other: DecimalLike): boolean;
|
|
128
153
|
/**
|
|
129
154
|
* Return `true` if this value is strictly greater than `other`.
|
|
130
155
|
* @public
|
|
131
156
|
*/
|
|
132
|
-
gt(other:
|
|
157
|
+
gt(other: DecimalLike): boolean;
|
|
133
158
|
/**
|
|
134
159
|
* Return `true` if this value is greater than or equal to `other`.
|
|
135
160
|
* @public
|
|
136
161
|
*/
|
|
137
|
-
gte(other:
|
|
162
|
+
gte(other: DecimalLike): boolean;
|
|
138
163
|
/**
|
|
139
164
|
* Return `true` if this value is exactly zero.
|
|
140
165
|
* @public
|
|
@@ -185,6 +210,11 @@ export declare interface Decimal {
|
|
|
185
210
|
* @public
|
|
186
211
|
*/
|
|
187
212
|
toFixed(decimalPlaces: number, direction: RoundDirection): string;
|
|
213
|
+
/**
|
|
214
|
+
* Convert to an {@link (Integer:type)} by rounding.
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
toInteger(direction: RoundDirection): Integer;
|
|
188
218
|
/**
|
|
189
219
|
* Rejects implicit coercion; explicit `String(d)` and template literals still work.
|
|
190
220
|
* @public
|
|
@@ -202,10 +232,31 @@ export declare interface Decimal {
|
|
|
202
232
|
*
|
|
203
233
|
* @public
|
|
204
234
|
*/
|
|
205
|
-
export declare const Decimal:
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
235
|
+
export declare const Decimal: DecimalCompanion;
|
|
236
|
+
|
|
237
|
+
/** @public */
|
|
238
|
+
export declare interface DecimalCompanion {
|
|
239
|
+
/** Type guard: narrows `unknown` to `Decimal`. @public */
|
|
240
|
+
is(value: unknown): value is Decimal;
|
|
241
|
+
/** Assertion guard: throws if not a `Decimal`. @public */
|
|
242
|
+
assert(value: unknown): asserts value is Decimal;
|
|
243
|
+
/** Create a Decimal from a {@link DecimalLike} value. @public */
|
|
244
|
+
from(value: DecimalLike): Decimal;
|
|
245
|
+
/** The Decimal value `0`. @public */
|
|
246
|
+
readonly zero: Decimal;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Values that can be coerced to a `Decimal` via `Decimal.from()`.
|
|
251
|
+
*
|
|
252
|
+
* @remarks
|
|
253
|
+
* This union is accepted by `Decimal.from()` and by all arithmetic and
|
|
254
|
+
* comparison methods on `Decimal` instances. Non-Decimal values are
|
|
255
|
+
* coerced via `Decimal.from()` before the operation.
|
|
256
|
+
*
|
|
257
|
+
* @public
|
|
258
|
+
*/
|
|
259
|
+
export declare type DecimalLike = bigint | Decimal | Integer | number | string;
|
|
209
260
|
|
|
210
261
|
/**
|
|
211
262
|
* Precision specification for `Decimal.round()`.
|
|
@@ -263,6 +314,18 @@ export declare const DecimalRoundingPresets: Readonly<{
|
|
|
263
314
|
}>;
|
|
264
315
|
}>;
|
|
265
316
|
|
|
317
|
+
/**
|
|
318
|
+
* Recursively converts a type to a deeply-readonly version.
|
|
319
|
+
*
|
|
320
|
+
* Primitive types (`string`, `number`, `boolean`, `bigint`, `symbol`,
|
|
321
|
+
* `undefined`, `null`) are returned as-is. Arrays become `readonly` arrays
|
|
322
|
+
* of deeply-readonly elements. Object types have each property marked
|
|
323
|
+
* `readonly`, and the type of each property is recursively transformed.
|
|
324
|
+
*
|
|
325
|
+
* @public
|
|
326
|
+
*/
|
|
327
|
+
export declare type DeepReadonly<T> = T extends bigint | boolean | null | number | string | symbol | undefined ? T : T extends readonly (infer Item)[] ? readonly DeepReadonly<Item>[] : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T;
|
|
328
|
+
|
|
266
329
|
/**
|
|
267
330
|
* The IEEE 754 decimal128 coefficient size (34 digits) — the recommended
|
|
268
331
|
* precision for `Decimal.div()` when full precision is desired.
|
|
@@ -303,11 +366,26 @@ export declare type Integer = {
|
|
|
303
366
|
readonly [__stripeType]: 'int';
|
|
304
367
|
} & number;
|
|
305
368
|
|
|
306
|
-
/** Factory
|
|
307
|
-
export declare const Integer:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
369
|
+
/** Factory, type guard, and utilities for {@link (Integer:type)} branded values. @public */
|
|
370
|
+
export declare const Integer: IntegerCompanion;
|
|
371
|
+
|
|
372
|
+
/** @public */
|
|
373
|
+
export declare interface IntegerCompanion {
|
|
374
|
+
/** The Integer value `0`. @public */
|
|
375
|
+
readonly zero: Integer;
|
|
376
|
+
/** Type guard: narrows `unknown` to {@link (Integer:type)}. @public */
|
|
377
|
+
is(value: unknown): value is Integer;
|
|
378
|
+
/** Assertion guard: throws if not an {@link (Integer:type)}. @public */
|
|
379
|
+
assert(value: unknown): asserts value is Integer;
|
|
380
|
+
/** Coerce a value to {@link (Integer:type)} by rounding. @public */
|
|
381
|
+
from(value: Decimal | Integer | number | string, rounding: IntegerRoundDirection): Integer;
|
|
382
|
+
/** Lossless conversion to `Decimal`. @public */
|
|
383
|
+
toDecimal(value: Integer): Decimal;
|
|
384
|
+
/** Type guard: narrows {@link (Integer:type)} to {@link (PositiveInteger:type)}. @public */
|
|
385
|
+
isPositive(value: Integer): value is PositiveInteger;
|
|
386
|
+
/** Assertion guard: throws if the Integer is negative. @public */
|
|
387
|
+
assertIsPositive(value: Integer): asserts value is PositiveInteger;
|
|
388
|
+
}
|
|
311
389
|
|
|
312
390
|
/**
|
|
313
391
|
* Rounding directions for coercing a number to an integer.
|
|
@@ -390,11 +468,18 @@ export declare type PositiveInteger = {
|
|
|
390
468
|
readonly [__stripeType]: 'int';
|
|
391
469
|
} & number;
|
|
392
470
|
|
|
393
|
-
/** Factory
|
|
394
|
-
export declare const PositiveInteger:
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
471
|
+
/** Factory, type guard, and utilities for {@link (PositiveInteger:type)} branded values. @public */
|
|
472
|
+
export declare const PositiveInteger: PositiveIntegerCompanion;
|
|
473
|
+
|
|
474
|
+
/** @public */
|
|
475
|
+
export declare interface PositiveIntegerCompanion {
|
|
476
|
+
/** Type guard: narrows `unknown` to {@link (PositiveInteger:type)}. @public */
|
|
477
|
+
is(value: unknown): value is PositiveInteger;
|
|
478
|
+
/** Assertion guard: throws if not a {@link (PositiveInteger:type)}. @public */
|
|
479
|
+
assert(value: unknown): asserts value is PositiveInteger;
|
|
480
|
+
/** Coerce a value to {@link (PositiveInteger:type)} by rounding. Throws if negative. @public */
|
|
481
|
+
from(value: Decimal | Integer | number | string, rounding: IntegerRoundDirection): PositiveInteger;
|
|
482
|
+
}
|
|
398
483
|
|
|
399
484
|
/* Excluded from this release type: _ProtoEnum */
|
|
400
485
|
|
|
@@ -468,7 +553,7 @@ export declare type StreetAddress = {
|
|
|
468
553
|
/** Factory for creating {@link (StreetAddress:type)} branded values. @public */
|
|
469
554
|
export declare const StreetAddress: { create: (address: string) => StreetAddress };
|
|
470
555
|
|
|
471
|
-
/** The type of the opaque Stripe type-tag
|
|
556
|
+
/** The type of the opaque Stripe type-tag key used in SDK scalar types. @public */
|
|
472
557
|
export declare type StripeTypeSymbol = typeof __stripeType;
|
|
473
558
|
|
|
474
559
|
/** A branded string representing an ISO 8601 datetime. @public */
|
|
@@ -480,6 +565,28 @@ export declare type Timestamp = {
|
|
|
480
565
|
/** Factory for creating {@link (Timestamp:type)} branded values. @public */
|
|
481
566
|
export declare const Timestamp: { create: (value: string) => Timestamp };
|
|
482
567
|
|
|
568
|
+
/**
|
|
569
|
+
* Deep-freezes `value` and returns it typed as {@link DeepReadonly}`<T>`.
|
|
570
|
+
*
|
|
571
|
+
* Use this helper for module-scoped constant objects and arrays to satisfy
|
|
572
|
+
* the `dsl/no-module-scoped-mutable-const` lint rule. Unlike `Object.freeze`,
|
|
573
|
+
* which is shallow, `toConst` recursively freezes all nested objects and arrays.
|
|
574
|
+
*
|
|
575
|
+
* @example
|
|
576
|
+
* ```typescript
|
|
577
|
+
* import { toConst } from '@stripe/extensibility-sdk/stdlib';
|
|
578
|
+
*
|
|
579
|
+
* const DEFAULTS = toConst({ timeout: 30, retries: 3 });
|
|
580
|
+
* // Type: { readonly timeout: 30; readonly retries: 3 }
|
|
581
|
+
*
|
|
582
|
+
* const STATUSES = toConst(['active', 'pending', 'cancelled']);
|
|
583
|
+
* // Type: readonly ["active", "pending", "cancelled"]
|
|
584
|
+
* ```
|
|
585
|
+
*
|
|
586
|
+
* @public
|
|
587
|
+
*/
|
|
588
|
+
export declare function toConst<T>(value: T): DeepReadonly<T>;
|
|
589
|
+
|
|
483
590
|
/* Excluded from this release type: _translateArray */
|
|
484
591
|
|
|
485
592
|
/* Excluded from this release type: _translateDateTime */
|
|
@@ -4,7 +4,7 @@ import type { Decimal, _ConfigApplicationContext } from '../../../stdlib/index.j
|
|
|
4
4
|
/** @public */
|
|
5
5
|
export declare namespace DiscountCalculation {
|
|
6
6
|
/** @public */
|
|
7
|
-
type BillingReason = 'automatic_pending_invoice_item_invoice' | 'manual' | '
|
|
7
|
+
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';
|
|
8
8
|
/** @public */
|
|
9
9
|
type PricingTierMode = 'graduated' | 'volume';
|
|
10
10
|
/** @public */
|
|
@@ -14,7 +14,7 @@ export declare namespace DiscountCalculation {
|
|
|
14
14
|
/** @public */
|
|
15
15
|
type UsageType = 'licensed' | 'metered';
|
|
16
16
|
/** @public */
|
|
17
|
-
type RecurringPriceInterval = 'day' | '
|
|
17
|
+
type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
|
|
18
18
|
/**
|
|
19
19
|
* The result of a discount calculation.
|
|
20
20
|
* @public
|
|
@@ -174,7 +174,9 @@ export declare namespace DiscountCalculation {
|
|
|
174
174
|
*/
|
|
175
175
|
function prepareResultComputeDiscounts(result: DiscountResult): DiscountResult;
|
|
176
176
|
/** @internal */
|
|
177
|
-
function $platformWrapComputeDiscounts(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
177
|
+
function $platformWrapComputeDiscounts(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
178
|
+
computeDiscounts(...a: unknown[]): unknown;
|
|
179
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
178
180
|
/**
|
|
179
181
|
* @public
|
|
180
182
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -32,7 +32,9 @@ export declare namespace CustomerBalanceApplication {
|
|
|
32
32
|
*/
|
|
33
33
|
function prepareResultComputeAppliedCustomerBalance(result: CustomerBalanceApplicationResult): CustomerBalanceApplicationResult;
|
|
34
34
|
/** @internal */
|
|
35
|
-
function $platformWrapComputeAppliedCustomerBalance(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
35
|
+
function $platformWrapComputeAppliedCustomerBalance(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
36
|
+
computeAppliedCustomerBalance(...a: unknown[]): unknown;
|
|
37
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
36
38
|
/**
|
|
37
39
|
* @public
|
|
38
40
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -3,11 +3,11 @@ import type { _ConfigApplicationContext } from '../../stdlib/index.js';
|
|
|
3
3
|
/** @public */
|
|
4
4
|
export declare namespace InvoiceCollectionSetting {
|
|
5
5
|
/** @public */
|
|
6
|
-
type ParentType = '
|
|
6
|
+
type ParentType = 'subscription' | 'contract' | 'quote' | 'billing_cadence' | 'subscription_schedule' | 'standalone';
|
|
7
7
|
/** @public */
|
|
8
|
-
type PaymentMethodType = '
|
|
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
9
|
/** @public */
|
|
10
|
-
type CollectionMethod = '
|
|
10
|
+
type CollectionMethod = 'send_invoice' | 'charge_automatically';
|
|
11
11
|
/**
|
|
12
12
|
* The result of the invoice collection settings override extension.
|
|
13
13
|
* @public
|
|
@@ -17,16 +17,18 @@ export declare namespace InvoiceCollectionSetting {
|
|
|
17
17
|
autoAdvance?: boolean;
|
|
18
18
|
}
|
|
19
19
|
/** @public */
|
|
20
|
-
type InvoiceCollectionRequest =
|
|
21
|
-
|
|
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
|
+
} & ({
|
|
22
26
|
payer: 'customer';
|
|
27
|
+
customer: Customer;
|
|
23
28
|
} | {
|
|
24
|
-
otherPayer: string;
|
|
25
29
|
payer: 'other';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
parent: Parent;
|
|
29
|
-
};
|
|
30
|
+
otherPayer: string;
|
|
31
|
+
});
|
|
30
32
|
/** @public */
|
|
31
33
|
interface Customer {
|
|
32
34
|
id: string;
|
|
@@ -67,7 +69,9 @@ export declare namespace InvoiceCollectionSetting {
|
|
|
67
69
|
*/
|
|
68
70
|
function prepareResultCollectionOverride(result: InvoiceCollectionResponse): InvoiceCollectionResponse;
|
|
69
71
|
/** @internal */
|
|
70
|
-
function $platformWrapCollectionOverride(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
72
|
+
function $platformWrapCollectionOverride(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
73
|
+
collectionOverride(...a: unknown[]): unknown;
|
|
74
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
71
75
|
/**
|
|
72
76
|
* @public
|
|
73
77
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -6,7 +6,7 @@ export declare namespace Prorations {
|
|
|
6
6
|
/** @public */
|
|
7
7
|
type PricingTierMode = 'graduated' | 'volume';
|
|
8
8
|
/** @public */
|
|
9
|
-
type RecurringPriceInterval = 'day' | '
|
|
9
|
+
type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
|
|
10
10
|
/** @public */
|
|
11
11
|
type PriceType = 'one_time' | 'recurring';
|
|
12
12
|
/** @public */
|
|
@@ -44,30 +44,37 @@ export declare namespace Prorations {
|
|
|
44
44
|
items: ProratableItem[];
|
|
45
45
|
}
|
|
46
46
|
/** @public */
|
|
47
|
-
type ProratableItem =
|
|
48
|
-
|
|
49
|
-
|
|
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;
|
|
50
65
|
} | {
|
|
51
|
-
licenseFee: LicenseFee;
|
|
52
66
|
priceKind: 'licenseFee';
|
|
53
|
-
|
|
54
|
-
otherPriceKind: string;
|
|
55
|
-
priceKind: 'other';
|
|
56
|
-
} | {
|
|
57
|
-
price: Price;
|
|
58
|
-
priceKind: 'price';
|
|
67
|
+
licenseFee: LicenseFee;
|
|
59
68
|
} | {
|
|
60
69
|
priceKind: 'rateCardRate';
|
|
61
70
|
rateCardRate: RateCardRate;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
type: ItemType;
|
|
70
|
-
};
|
|
71
|
+
} | {
|
|
72
|
+
priceKind: 'customPricingUnitOverageRate';
|
|
73
|
+
customPricingUnitOverageRate: CustomPricingUnitOverageRate;
|
|
74
|
+
} | {
|
|
75
|
+
priceKind: 'other';
|
|
76
|
+
otherPriceKind: string;
|
|
77
|
+
});
|
|
71
78
|
/**
|
|
72
79
|
* Information about a previous debit that a credit item offsets.
|
|
73
80
|
* @public
|
|
@@ -165,7 +172,9 @@ export declare namespace Prorations {
|
|
|
165
172
|
*/
|
|
166
173
|
function prepareResultProrateItems(result: ProrateItemsResult): ProrateItemsResult;
|
|
167
174
|
/** @internal */
|
|
168
|
-
function $platformWrapProrateItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
175
|
+
function $platformWrapProrateItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
176
|
+
prorateItems(...a: unknown[]): unknown;
|
|
177
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
169
178
|
/**
|
|
170
179
|
* @public
|
|
171
180
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -6,7 +6,7 @@ export declare namespace RecurringBillingItemHandling {
|
|
|
6
6
|
/** @public */
|
|
7
7
|
type PricingTierMode = 'graduated' | 'volume';
|
|
8
8
|
/** @public */
|
|
9
|
-
type RecurringPriceInterval = 'day' | '
|
|
9
|
+
type RecurringPriceInterval = 'day' | 'week' | 'month' | 'year';
|
|
10
10
|
/** @public */
|
|
11
11
|
type PriceType = 'one_time' | 'recurring';
|
|
12
12
|
/** @public */
|
|
@@ -50,28 +50,33 @@ export declare namespace RecurringBillingItemHandling {
|
|
|
50
50
|
items: Item[];
|
|
51
51
|
}
|
|
52
52
|
/** @public */
|
|
53
|
-
type Item =
|
|
54
|
-
|
|
55
|
-
|
|
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;
|
|
56
67
|
} | {
|
|
57
|
-
licenseFee: LicenseFee;
|
|
58
68
|
priceKind: 'licenseFee';
|
|
59
|
-
|
|
60
|
-
otherPriceKind: string;
|
|
61
|
-
priceKind: 'other';
|
|
62
|
-
} | {
|
|
63
|
-
price: Price;
|
|
64
|
-
priceKind: 'price';
|
|
69
|
+
licenseFee: LicenseFee;
|
|
65
70
|
} | {
|
|
66
71
|
priceKind: 'rateCardRate';
|
|
67
72
|
rateCardRate: RateCardRate;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
};
|
|
73
|
+
} | {
|
|
74
|
+
priceKind: 'customPricingUnitOverageRate';
|
|
75
|
+
customPricingUnitOverageRate: CustomPricingUnitOverageRate;
|
|
76
|
+
} | {
|
|
77
|
+
priceKind: 'other';
|
|
78
|
+
otherPriceKind: string;
|
|
79
|
+
});
|
|
75
80
|
/** @public */
|
|
76
81
|
interface CustomPricingUnitOverageRate {
|
|
77
82
|
id: string;
|
|
@@ -183,10 +188,17 @@ export declare namespace RecurringBillingItemHandling {
|
|
|
183
188
|
items: ItemWithCreationStrategy[];
|
|
184
189
|
}
|
|
185
190
|
/** @public */
|
|
186
|
-
type ItemWithCreationStrategy =
|
|
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
|
+
} | {
|
|
187
199
|
creationStrategy: 'other';
|
|
188
200
|
otherCreationStrategy: string;
|
|
189
|
-
}
|
|
201
|
+
});
|
|
190
202
|
/** @public */
|
|
191
203
|
type Invoice = Record<string, never>;
|
|
192
204
|
/** @public */
|
|
@@ -210,7 +222,9 @@ export declare namespace RecurringBillingItemHandling {
|
|
|
210
222
|
*/
|
|
211
223
|
function prepareResultBeforeItemCreation(result: BeforeItemCreationResult): BeforeItemCreationResult;
|
|
212
224
|
/** @internal */
|
|
213
|
-
function $platformWrapBeforeItemCreation(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
225
|
+
function $platformWrapBeforeItemCreation(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
226
|
+
beforeItemCreation(...a: unknown[]): unknown;
|
|
227
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
214
228
|
/**
|
|
215
229
|
* @public
|
|
216
230
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -222,7 +236,9 @@ export declare namespace RecurringBillingItemHandling {
|
|
|
222
236
|
*/
|
|
223
237
|
function prepareResultFilterItems(result: FilterItemsResult): FilterItemsResult;
|
|
224
238
|
/** @internal */
|
|
225
|
-
function $platformWrapFilterItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
239
|
+
function $platformWrapFilterItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
240
|
+
filterItems(...a: unknown[]): unknown;
|
|
241
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
226
242
|
/**
|
|
227
243
|
* @public
|
|
228
244
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -234,7 +250,9 @@ export declare namespace RecurringBillingItemHandling {
|
|
|
234
250
|
*/
|
|
235
251
|
function prepareResultGroupItems(result: GroupItemsResult): GroupItemsResult;
|
|
236
252
|
/** @internal */
|
|
237
|
-
function $platformWrapGroupItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
253
|
+
function $platformWrapGroupItems(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
254
|
+
groupItems(...a: unknown[]): unknown;
|
|
255
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
238
256
|
/**
|
|
239
257
|
* Runs before invoice items are created. Decides whether each item should be created or skipped.
|
|
240
258
|
* @public
|
|
@@ -18,15 +18,15 @@ export interface TimeRange {
|
|
|
18
18
|
}
|
|
19
19
|
/** @public */
|
|
20
20
|
export type AnyTimeRange = {
|
|
21
|
-
at: Date;
|
|
22
21
|
value: 'oneTime';
|
|
22
|
+
at: Date;
|
|
23
23
|
} | {
|
|
24
|
-
endDate: Date;
|
|
25
|
-
startDate: Date;
|
|
26
24
|
value: 'timeRange';
|
|
25
|
+
startDate: Date;
|
|
26
|
+
endDate: Date;
|
|
27
27
|
} | {
|
|
28
|
-
otherValue: string;
|
|
29
28
|
value: 'other';
|
|
29
|
+
otherValue: string;
|
|
30
30
|
};
|
|
31
31
|
/** @internal */
|
|
32
32
|
export type { Currency, MonetaryAmount } from '../../stdlib/generated.js';
|
|
@@ -69,7 +69,9 @@ export declare namespace CustomAction {
|
|
|
69
69
|
*/
|
|
70
70
|
function prepareResultExecute(result: ExecuteCustomActionResponse): ExecuteCustomActionResponse;
|
|
71
71
|
/** @internal */
|
|
72
|
-
function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
72
|
+
function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
73
|
+
execute(...a: unknown[]): unknown;
|
|
74
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
73
75
|
/**
|
|
74
76
|
* @public
|
|
75
77
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -81,7 +83,9 @@ export declare namespace CustomAction {
|
|
|
81
83
|
*/
|
|
82
84
|
function prepareResultGetFormState(result: GetFormStateResponse): GetFormStateResponse;
|
|
83
85
|
/** @internal */
|
|
84
|
-
function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
86
|
+
function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
87
|
+
getFormState(...a: unknown[]): unknown;
|
|
88
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
85
89
|
/**
|
|
86
90
|
* Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
|
|
87
91
|
* @public
|
|
@@ -69,7 +69,9 @@ export declare namespace CustomAction {
|
|
|
69
69
|
*/
|
|
70
70
|
function prepareResultExecute(result: ExecuteCustomActionResponse): ExecuteCustomActionResponse;
|
|
71
71
|
/** @internal */
|
|
72
|
-
function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
72
|
+
function $platformWrapExecute(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
73
|
+
execute(...a: unknown[]): unknown;
|
|
74
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
73
75
|
/**
|
|
74
76
|
* @public
|
|
75
77
|
* @deprecated Platform dispatch handles wire/SDK conversion.
|
|
@@ -81,7 +83,9 @@ export declare namespace CustomAction {
|
|
|
81
83
|
*/
|
|
82
84
|
function prepareResultGetFormState(result: GetFormStateResponse): GetFormStateResponse;
|
|
83
85
|
/** @internal */
|
|
84
|
-
function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
86
|
+
function $platformWrapGetFormState(configTransformer?: (wireConfig: unknown, appCtx: _ConfigApplicationContext) => unknown): (cls: new () => {
|
|
87
|
+
getFormState(...a: unknown[]): unknown;
|
|
88
|
+
}, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown;
|
|
85
89
|
/**
|
|
86
90
|
* Executes the custom action at workflow runtime. Called when a workflow triggers this action, with the configured input values.
|
|
87
91
|
* @public
|