@stripe/extensibility-sdk 0.24.0 → 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
package/dist/stdlib/brand.d.ts
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Opaque brand
|
|
2
|
+
* Opaque brand key used as a property key in SDK branded types.
|
|
3
3
|
*
|
|
4
4
|
* @remarks
|
|
5
5
|
* You do not need to use this directly — it is already embedded in
|
|
6
|
-
* branded values returned by factory functions like {@link (Integer:type)}.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* branded values returned by factory functions like {@link (Integer:type)}.from().
|
|
7
|
+
*
|
|
8
|
+
* String-literal const (not `unique symbol`) so that independent
|
|
9
|
+
* declaration rollups (root vs subpath) produce structurally compatible
|
|
10
|
+
* branded types.
|
|
9
11
|
*
|
|
10
12
|
* @public
|
|
11
13
|
*/
|
|
12
|
-
export declare const __brand:
|
|
14
|
+
export declare const __brand: '__brand';
|
|
13
15
|
/**
|
|
14
|
-
* Opaque type-tag
|
|
16
|
+
* Opaque type-tag key used by SDK scalar types to carry Stripe type metadata.
|
|
15
17
|
*
|
|
16
18
|
* @remarks
|
|
17
19
|
* You do not need to use this directly — it is already embedded in
|
|
18
|
-
* branded values returned by factory functions like {@link (Integer:type)}.
|
|
20
|
+
* branded values returned by factory functions like {@link (Integer:type)}.from().
|
|
21
|
+
*
|
|
22
|
+
* String-literal const (not `unique symbol`) so that independent
|
|
23
|
+
* declaration rollups (root vs subpath) produce structurally compatible
|
|
24
|
+
* branded types.
|
|
19
25
|
*
|
|
20
26
|
* @public
|
|
21
27
|
*/
|
|
22
|
-
export declare const __stripeType:
|
|
23
|
-
/** The type of the opaque brand
|
|
28
|
+
export declare const __stripeType: '__stripeType';
|
|
29
|
+
/** The type of the opaque brand key used as a property key in SDK branded types. @public */
|
|
24
30
|
export type BrandSymbol = typeof __brand;
|
|
25
|
-
/** The type of the opaque Stripe type-tag
|
|
31
|
+
/** The type of the opaque Stripe type-tag key used in SDK scalar types. @public */
|
|
26
32
|
export type StripeTypeSymbol = typeof __stripeType;
|
|
27
33
|
//# sourceMappingURL=brand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../src/stdlib/brand.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../src/stdlib/brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,SAAS,CAAC;AAExC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,CAAC,MAAM,YAAY,EAAE,cAAc,CAAC;AAElD,4FAA4F;AAC5F,MAAM,MAAM,WAAW,GAAG,OAAO,OAAO,CAAC;AAEzC,mFAAmF;AACnF,MAAM,MAAM,gBAAgB,GAAG,OAAO,YAAY,CAAC"}
|
package/dist/stdlib/decimal.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { type __brand, type __stripeType } from './brand.js';
|
|
2
|
+
import type { Integer } from './scalars.js';
|
|
2
3
|
/**
|
|
3
|
-
* Unique brand
|
|
4
|
+
* Unique brand key for the `Decimal` type.
|
|
4
5
|
*
|
|
5
|
-
* Using a dedicated
|
|
6
|
+
* Using a dedicated key (rather than the shared `__brand`) lets formspec's
|
|
6
7
|
* structural brand-detection distinguish `Decimal` from other SDK branded
|
|
7
8
|
* types (e.g., `Ref`, `StreetAddress`) that also carry `[__brand]`.
|
|
8
9
|
*
|
|
10
|
+
* String-literal const (not `unique symbol`) so that independent
|
|
11
|
+
* declaration rollups (root vs subpath) produce structurally compatible
|
|
12
|
+
* branded types.
|
|
13
|
+
*
|
|
9
14
|
* @internal
|
|
10
15
|
*/
|
|
11
|
-
declare const __decimalBrand:
|
|
16
|
+
export declare const __decimalBrand: '__decimalBrand';
|
|
12
17
|
/**
|
|
13
18
|
* Rounding direction for Decimal operations.
|
|
14
19
|
*
|
|
@@ -29,7 +34,7 @@ declare const __decimalBrand: unique symbol;
|
|
|
29
34
|
*
|
|
30
35
|
* @public
|
|
31
36
|
*/
|
|
32
|
-
export type RoundDirection = 'ceil' | 'floor' | '
|
|
37
|
+
export type RoundDirection = 'ceil' | 'floor' | 'round-down' | 'round-up' | 'half-up' | 'half-down' | 'half-even';
|
|
33
38
|
/**
|
|
34
39
|
* Precision specification for `Decimal.round()`.
|
|
35
40
|
*
|
|
@@ -150,52 +155,52 @@ export interface Decimal {
|
|
|
150
155
|
* Return the sum of this value and `other`.
|
|
151
156
|
* @public
|
|
152
157
|
*/
|
|
153
|
-
add(other:
|
|
158
|
+
add(other: DecimalLike): Decimal;
|
|
154
159
|
/**
|
|
155
160
|
* Return the difference of this value and `other`.
|
|
156
161
|
* @public
|
|
157
162
|
*/
|
|
158
|
-
sub(other:
|
|
163
|
+
sub(other: DecimalLike): Decimal;
|
|
159
164
|
/**
|
|
160
165
|
* Return the product of this value and `other`.
|
|
161
166
|
* @public
|
|
162
167
|
*/
|
|
163
|
-
mul(other:
|
|
168
|
+
mul(other: DecimalLike): Decimal;
|
|
164
169
|
/**
|
|
165
170
|
* Return the quotient of this value divided by `other`.
|
|
166
171
|
* @public
|
|
167
172
|
*/
|
|
168
|
-
div(other:
|
|
173
|
+
div(other: DecimalLike, precision: number, direction: RoundDirection): Decimal;
|
|
169
174
|
/**
|
|
170
175
|
* Three-way comparison: returns `-1`, `0`, or `1`.
|
|
171
176
|
* @public
|
|
172
177
|
*/
|
|
173
|
-
cmp(other:
|
|
178
|
+
cmp(other: DecimalLike): -1 | 0 | 1;
|
|
174
179
|
/**
|
|
175
180
|
* Return `true` if this value is numerically equal to `other`.
|
|
176
181
|
* @public
|
|
177
182
|
*/
|
|
178
|
-
eq(other:
|
|
183
|
+
eq(other: DecimalLike): boolean;
|
|
179
184
|
/**
|
|
180
185
|
* Return `true` if this value is strictly less than `other`.
|
|
181
186
|
* @public
|
|
182
187
|
*/
|
|
183
|
-
lt(other:
|
|
188
|
+
lt(other: DecimalLike): boolean;
|
|
184
189
|
/**
|
|
185
190
|
* Return `true` if this value is less than or equal to `other`.
|
|
186
191
|
* @public
|
|
187
192
|
*/
|
|
188
|
-
lte(other:
|
|
193
|
+
lte(other: DecimalLike): boolean;
|
|
189
194
|
/**
|
|
190
195
|
* Return `true` if this value is strictly greater than `other`.
|
|
191
196
|
* @public
|
|
192
197
|
*/
|
|
193
|
-
gt(other:
|
|
198
|
+
gt(other: DecimalLike): boolean;
|
|
194
199
|
/**
|
|
195
200
|
* Return `true` if this value is greater than or equal to `other`.
|
|
196
201
|
* @public
|
|
197
202
|
*/
|
|
198
|
-
gte(other:
|
|
203
|
+
gte(other: DecimalLike): boolean;
|
|
199
204
|
/**
|
|
200
205
|
* Return `true` if this value is exactly zero.
|
|
201
206
|
* @public
|
|
@@ -225,7 +230,7 @@ export interface Decimal {
|
|
|
225
230
|
* Round this value to the specified precision.
|
|
226
231
|
* @public
|
|
227
232
|
*/
|
|
228
|
-
round(direction: RoundDirection, options:
|
|
233
|
+
round(direction: RoundDirection, options: keyof typeof DecimalRoundingPresets | DecimalRoundingOptions): Decimal;
|
|
229
234
|
/**
|
|
230
235
|
* Return the canonical string representation.
|
|
231
236
|
* @public
|
|
@@ -246,17 +251,33 @@ export interface Decimal {
|
|
|
246
251
|
* @public
|
|
247
252
|
*/
|
|
248
253
|
toFixed(decimalPlaces: number, direction: RoundDirection): string;
|
|
254
|
+
/**
|
|
255
|
+
* Convert to an {@link (Integer:type)} by rounding.
|
|
256
|
+
* @public
|
|
257
|
+
*/
|
|
258
|
+
toInteger(direction: RoundDirection): Integer;
|
|
249
259
|
/**
|
|
250
260
|
* Rejects implicit coercion; explicit `String(d)` and template literals still work.
|
|
251
261
|
* @public
|
|
252
262
|
*/
|
|
253
|
-
[Symbol.toPrimitive](hint: '
|
|
263
|
+
[Symbol.toPrimitive](hint: 'string' | 'number' | 'default'): string;
|
|
254
264
|
/**
|
|
255
265
|
* Returns the string representation; invoked by the JavaScript engine as a fallback coercion path.
|
|
256
266
|
* @public
|
|
257
267
|
*/
|
|
258
268
|
valueOf(): string;
|
|
259
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Values that can be coerced to a `Decimal` via `Decimal.from()`.
|
|
272
|
+
*
|
|
273
|
+
* @remarks
|
|
274
|
+
* This union is accepted by `Decimal.from()` and by all arithmetic and
|
|
275
|
+
* comparison methods on `Decimal` instances. Non-Decimal values are
|
|
276
|
+
* coerced via `Decimal.from()` before the operation.
|
|
277
|
+
*
|
|
278
|
+
* @public
|
|
279
|
+
*/
|
|
280
|
+
export type DecimalLike = string | number | bigint | Decimal | Integer;
|
|
260
281
|
/**
|
|
261
282
|
* Check whether a value is a `Decimal` instance.
|
|
262
283
|
*
|
|
@@ -275,14 +296,21 @@ export interface Decimal {
|
|
|
275
296
|
* @public
|
|
276
297
|
*/
|
|
277
298
|
export declare function isDecimal(value: unknown): value is Decimal;
|
|
299
|
+
/** @public */
|
|
300
|
+
export interface DecimalCompanion {
|
|
301
|
+
/** Type guard: narrows `unknown` to `Decimal`. @public */
|
|
302
|
+
is(value: unknown): value is Decimal;
|
|
303
|
+
/** Assertion guard: throws if not a `Decimal`. @public */
|
|
304
|
+
assert(value: unknown): asserts value is Decimal;
|
|
305
|
+
/** Create a Decimal from a {@link DecimalLike} value. @public */
|
|
306
|
+
from(value: DecimalLike): Decimal;
|
|
307
|
+
/** The Decimal value `0`. @public */
|
|
308
|
+
readonly zero: Decimal;
|
|
309
|
+
}
|
|
278
310
|
/**
|
|
279
311
|
* Companion object for creating `Decimal` instances.
|
|
280
312
|
*
|
|
281
313
|
* @public
|
|
282
314
|
*/
|
|
283
|
-
export declare const Decimal:
|
|
284
|
-
from(value: bigint | number | string): Decimal;
|
|
285
|
-
zero: Decimal;
|
|
286
|
-
};
|
|
287
|
-
export {};
|
|
315
|
+
export declare const Decimal: DecimalCompanion;
|
|
288
316
|
//# sourceMappingURL=decimal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../src/stdlib/decimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../src/stdlib/decimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,CAAC,MAAM,cAAc,EAAE,gBAAgB,CAAC;AAMtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,OAAO,GACP,YAAY,GACZ,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,CAAC;AAEhB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,sBAAsB;IACrC,wIAAwI;IACxI,IAAI,EAAE,gBAAgB,GAAG,qBAAqB,CAAC;IAC/C;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAWD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBA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