@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,118 @@
|
|
|
1
|
+
import type { Project } from 'ts-morph';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Analyzes a named config type in a source file, producing a descriptor
|
|
5
|
+
* for runtime transformation.
|
|
6
|
+
*
|
|
7
|
+
* Creates a ts-morph Project from the file system. For testing with
|
|
8
|
+
* in-memory files, use `analyzeConfigTypeInProject` directly.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function analyzeConfigType(options: {
|
|
12
|
+
filePath: string;
|
|
13
|
+
typeName: string;
|
|
14
|
+
}): ConfigAnalysisResult;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Analyzes a named config type using a caller-supplied ts-morph Project.
|
|
18
|
+
* Use this in tests to pass an in-memory project.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function analyzeConfigTypeInProject(project: Project, filePath: string, typeName: string): ConfigAnalysisResult;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The result of analyzing a config type.
|
|
25
|
+
*
|
|
26
|
+
* `interfaces` is in DFS post-order: inner types appear before the types that
|
|
27
|
+
* reference them, so the root type is always last.
|
|
28
|
+
* `enums` is in discovery order, deduplicated by name.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare interface ConfigAnalysisResult {
|
|
32
|
+
rootTypeName: string;
|
|
33
|
+
interfaces: ConfigInterfaceDescriptor[];
|
|
34
|
+
enums: ConfigEnumDescriptor[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export declare interface ConfigEnumDescriptor {
|
|
39
|
+
name: string;
|
|
40
|
+
values: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export declare interface ConfigField {
|
|
45
|
+
name: string;
|
|
46
|
+
classification: FieldClassification;
|
|
47
|
+
optional: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export declare interface ConfigInterfaceDescriptor {
|
|
52
|
+
name: string;
|
|
53
|
+
fields: ConfigField[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export declare type FieldClassification = ScalarFieldClassification | StructuralFieldClassification;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Generates TypeScript code for a config descriptor.
|
|
61
|
+
*
|
|
62
|
+
* Emits enum value constants first, then one `_ShapeDescriptor` constant per
|
|
63
|
+
* interface (in DFS post-order, so inner types appear before their references),
|
|
64
|
+
* followed by an exported `transformX(raw: unknown): X` function.
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare function generateConfigDescriptor(result: ConfigAnalysisResult): GeneratedConfigDescriptor;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Generated TypeScript source and imports for a config descriptor.
|
|
72
|
+
*
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export declare interface GeneratedConfigDescriptor {
|
|
76
|
+
/** TypeScript code lines for the descriptor constant(s) and transform function */
|
|
77
|
+
lines: string[];
|
|
78
|
+
/** Value symbol names required from the stdlib module */
|
|
79
|
+
requiredImports: ReadonlySet<string>;
|
|
80
|
+
/** Type-only symbol names required from the stdlib module */
|
|
81
|
+
requiredTypeImports: ReadonlySet<string>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export declare type ScalarFieldClassification = {
|
|
86
|
+
kind: 'primitive';
|
|
87
|
+
} | {
|
|
88
|
+
kind: 'decimal';
|
|
89
|
+
} | {
|
|
90
|
+
kind: 'datetime';
|
|
91
|
+
} | {
|
|
92
|
+
kind: 'enum';
|
|
93
|
+
typeName: string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The package specifier for the stdlib module used in generated import lines.
|
|
98
|
+
*
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
export declare const STDLIB_IMPORT_PATH = "@stripe/extensibility-sdk/stdlib";
|
|
102
|
+
|
|
103
|
+
/** @internal */
|
|
104
|
+
export declare type StructuralFieldClassification = {
|
|
105
|
+
kind: 'interface';
|
|
106
|
+
typeName: string;
|
|
107
|
+
} | {
|
|
108
|
+
kind: 'union';
|
|
109
|
+
typeName: string;
|
|
110
|
+
} | {
|
|
111
|
+
kind: 'array';
|
|
112
|
+
element: FieldClassification;
|
|
113
|
+
} | {
|
|
114
|
+
kind: 'map';
|
|
115
|
+
value: FieldClassification;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export { }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Project } from 'ts-morph';
|
|
2
|
+
|
|
3
|
+
/* Excluded from this release type: analyzeConfigType */
|
|
4
|
+
|
|
5
|
+
/* Excluded from this release type: analyzeConfigTypeInProject */
|
|
6
|
+
|
|
7
|
+
/* Excluded from this release type: ConfigAnalysisResult */
|
|
8
|
+
|
|
9
|
+
/* Excluded from this release type: ConfigEnumDescriptor */
|
|
10
|
+
|
|
11
|
+
/* Excluded from this release type: ConfigField */
|
|
12
|
+
|
|
13
|
+
/* Excluded from this release type: ConfigInterfaceDescriptor */
|
|
14
|
+
|
|
15
|
+
/* Excluded from this release type: FieldClassification */
|
|
16
|
+
|
|
17
|
+
/* Excluded from this release type: generateConfigDescriptor */
|
|
18
|
+
|
|
19
|
+
/* Excluded from this release type: GeneratedConfigDescriptor */
|
|
20
|
+
|
|
21
|
+
/* Excluded from this release type: ScalarFieldClassification */
|
|
22
|
+
|
|
23
|
+
/* Excluded from this release type: STDLIB_IMPORT_PATH */
|
|
24
|
+
|
|
25
|
+
/* Excluded from this release type: StructuralFieldClassification */
|
|
26
|
+
|
|
27
|
+
export { }
|