@stripe/extensibility-script-build-tools 1.5.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/README.md +180 -0
- package/dist/config-introspect.d.ts +17 -0
- package/dist/config-introspect.d.ts.map +1 -0
- package/dist/dispatch.d.ts +24 -0
- package/dist/dispatch.d.ts.map +1 -0
- package/dist/errors.d.ts +26 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/extensibility-script-build-tools-alpha.d.ts +19 -0
- package/dist/extensibility-script-build-tools-beta.d.ts +19 -0
- package/dist/extensibility-script-build-tools-internal.d.ts +93 -0
- package/dist/extensibility-script-build-tools-public.d.ts +19 -0
- package/dist/index.cjs +237827 -0
- package/dist/index.d.cts +89 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +237820 -0
- package/dist/plugin.d.ts +41 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/runtime-introspect.d.ts +24 -0
- package/dist/runtime-introspect.d.ts.map +1 -0
- package/dist/sdk-types/extensions/billing/bill/discount_calculation.d.ts +226 -0
- package/dist/sdk-types/extensions/billing/bill/discount_calculation.d.ts.map +1 -0
- package/dist/sdk-types/extensions/billing/bill/index.d.ts +2 -0
- package/dist/sdk-types/extensions/billing/bill/index.d.ts.map +1 -0
- package/dist/sdk-types/extensions/billing/customer_balance_application.d.ts +82 -0
- package/dist/sdk-types/extensions/billing/customer_balance_application.d.ts.map +1 -0
- package/dist/sdk-types/extensions/billing/index.d.ts +8 -0
- package/dist/sdk-types/extensions/billing/index.d.ts.map +1 -0
- package/dist/sdk-types/extensions/billing/invoice_collection_setting.d.ts +117 -0
- package/dist/sdk-types/extensions/billing/invoice_collection_setting.d.ts.map +1 -0
- package/dist/sdk-types/extensions/billing/prorations.d.ts +222 -0
- package/dist/sdk-types/extensions/billing/prorations.d.ts.map +1 -0
- package/dist/sdk-types/extensions/billing/recurring_billing_item_handling.d.ts +326 -0
- package/dist/sdk-types/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -0
- package/dist/sdk-types/extensions/billing/types.d.ts +33 -0
- package/dist/sdk-types/extensions/billing/types.d.ts.map +1 -0
- package/dist/sdk-types/extensions/context.d.ts +9 -0
- package/dist/sdk-types/extensions/context.d.ts.map +1 -0
- package/dist/sdk-types/extensions/core/index.d.ts +3 -0
- package/dist/sdk-types/extensions/core/index.d.ts.map +1 -0
- package/dist/sdk-types/extensions/core/workflows/custom_action.d.ts +142 -0
- package/dist/sdk-types/extensions/core/workflows/custom_action.d.ts.map +1 -0
- package/dist/sdk-types/extensions/core/workflows/index.d.ts +2 -0
- package/dist/sdk-types/extensions/core/workflows/index.d.ts.map +1 -0
- package/dist/sdk-types/extensions/extend/index.d.ts +3 -0
- package/dist/sdk-types/extensions/extend/index.d.ts.map +1 -0
- package/dist/sdk-types/extensions/extend/workflows/custom_action.d.ts +142 -0
- package/dist/sdk-types/extensions/extend/workflows/custom_action.d.ts.map +1 -0
- package/dist/sdk-types/extensions/extend/workflows/index.d.ts +2 -0
- package/dist/sdk-types/extensions/extend/workflows/index.d.ts.map +1 -0
- package/dist/sdk-types/extensions/index.d.ts +9 -0
- package/dist/sdk-types/extensions/index.d.ts.map +1 -0
- package/dist/sdk-types/extensions/registry.d.ts +19 -0
- package/dist/sdk-types/extensions/registry.d.ts.map +1 -0
- package/dist/sdk-types/extensions/types.d.ts +10 -0
- package/dist/sdk-types/extensions/types.d.ts.map +1 -0
- package/dist/transform.d.ts +49 -0
- package/dist/transform.d.ts.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types.d.ts +40 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +57 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when the user's extension source contains a problem that prevents
|
|
5
|
+
* the platform dispatch plugin from processing it. The message is directly
|
|
6
|
+
* actionable by the extension author.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
declare class _BuildUserError extends Error {
|
|
10
|
+
/** Error class name, overridden for stack trace readability. */
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Wraps an unexpected error caught by the platform dispatch plugin. Indicates
|
|
15
|
+
* a bug in the plugin or an unanticipated environment condition, not a problem
|
|
16
|
+
* with the extension author's code.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
declare class _BuildSystemError extends Error {
|
|
20
|
+
/** The original error that triggered this system error. */
|
|
21
|
+
readonly cause: unknown;
|
|
22
|
+
/** Error class name, overridden for stack trace readability. */
|
|
23
|
+
name: string;
|
|
24
|
+
constructor(message: string,
|
|
25
|
+
/** The original error that triggered this system error. */
|
|
26
|
+
cause: unknown);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare const _brand: unique symbol;
|
|
30
|
+
/**
|
|
31
|
+
* Pre-computed analysis result from `_analyzeForDispatch`. Treat as opaque —
|
|
32
|
+
* pass directly to `_createPlatformDispatchPlugin` without inspecting or
|
|
33
|
+
* constructing.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
interface _DispatchAnalysis {
|
|
37
|
+
/** Nominal brand that prevents construction outside this module. */
|
|
38
|
+
readonly [_brand]: never;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Analyzes the extension entry point to determine if a full platform dispatch
|
|
42
|
+
* shim can be built. Returns opaque analysis data when all conditions are met:
|
|
43
|
+
*
|
|
44
|
+
* - The entry point has a named default export
|
|
45
|
+
* - The export implements a recognised extension interface
|
|
46
|
+
* - The installed SDK version provides `$platformWrap*` factories
|
|
47
|
+
*
|
|
48
|
+
* Returns `null` if any condition is not met (old SDK, unrecognised interface,
|
|
49
|
+
* no named default export, or non-extension script). The caller should treat
|
|
50
|
+
* `null` as "build without the plugin".
|
|
51
|
+
*
|
|
52
|
+
* Throws `_BuildUserError` if a reserved identifier collision is detected in
|
|
53
|
+
* the source (only checked when a shim would otherwise be installed).
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
declare function _analyzeForDispatch(entryPoint: string): _DispatchAnalysis | null;
|
|
57
|
+
/**
|
|
58
|
+
* Creates an esbuild plugin that appends a proxy dispatch table export
|
|
59
|
+
* (`__stripe_platform_dispatch__`) to the extension entry point.
|
|
60
|
+
*
|
|
61
|
+
* Requires pre-computed analysis from `_analyzeForDispatch`. The plugin uses
|
|
62
|
+
* the cached source and descriptor data directly, avoiding redundant file
|
|
63
|
+
* reads and SDK introspection during the build.
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
declare function _createPlatformDispatchPlugin(analysis: _DispatchAnalysis): esbuild.Plugin;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Creates a platform dispatch invoker from a bundled extension module.
|
|
70
|
+
*
|
|
71
|
+
* Reads `mod['__stripe_platform_dispatch__'].dispatch` and returns a callable
|
|
72
|
+
* that forwards to it.
|
|
73
|
+
*
|
|
74
|
+
* Returns `null` only if the dispatch table export is entirely absent —
|
|
75
|
+
* meaning the module was not built with the platform dispatch plugin at all.
|
|
76
|
+
* When the plugin was used, the table is always present (even for entry points
|
|
77
|
+
* with no recognised extension interface), so callers can use `null` as an
|
|
78
|
+
* unambiguous "plugin not run" signal.
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
declare function _createPlatformDispatch(mod: Record<string, unknown>): ((exportName: string, methodName: string, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown) | null;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Name of the dispatch table export injected by the platform dispatch plugin.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
declare const _DISPATCH_TABLE_EXPORT = "__stripe_platform_dispatch__";
|
|
88
|
+
|
|
89
|
+
export { _BuildSystemError, _BuildUserError, _DISPATCH_TABLE_EXPORT, type _DispatchAnalysis, _analyzeForDispatch, _createPlatformDispatch, _createPlatformDispatchPlugin };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when the user's extension source contains a problem that prevents
|
|
5
|
+
* the platform dispatch plugin from processing it. The message is directly
|
|
6
|
+
* actionable by the extension author.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
declare class _BuildUserError extends Error {
|
|
10
|
+
/** Error class name, overridden for stack trace readability. */
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Wraps an unexpected error caught by the platform dispatch plugin. Indicates
|
|
15
|
+
* a bug in the plugin or an unanticipated environment condition, not a problem
|
|
16
|
+
* with the extension author's code.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
declare class _BuildSystemError extends Error {
|
|
20
|
+
/** The original error that triggered this system error. */
|
|
21
|
+
readonly cause: unknown;
|
|
22
|
+
/** Error class name, overridden for stack trace readability. */
|
|
23
|
+
name: string;
|
|
24
|
+
constructor(message: string,
|
|
25
|
+
/** The original error that triggered this system error. */
|
|
26
|
+
cause: unknown);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare const _brand: unique symbol;
|
|
30
|
+
/**
|
|
31
|
+
* Pre-computed analysis result from `_analyzeForDispatch`. Treat as opaque —
|
|
32
|
+
* pass directly to `_createPlatformDispatchPlugin` without inspecting or
|
|
33
|
+
* constructing.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
interface _DispatchAnalysis {
|
|
37
|
+
/** Nominal brand that prevents construction outside this module. */
|
|
38
|
+
readonly [_brand]: never;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Analyzes the extension entry point to determine if a full platform dispatch
|
|
42
|
+
* shim can be built. Returns opaque analysis data when all conditions are met:
|
|
43
|
+
*
|
|
44
|
+
* - The entry point has a named default export
|
|
45
|
+
* - The export implements a recognised extension interface
|
|
46
|
+
* - The installed SDK version provides `$platformWrap*` factories
|
|
47
|
+
*
|
|
48
|
+
* Returns `null` if any condition is not met (old SDK, unrecognised interface,
|
|
49
|
+
* no named default export, or non-extension script). The caller should treat
|
|
50
|
+
* `null` as "build without the plugin".
|
|
51
|
+
*
|
|
52
|
+
* Throws `_BuildUserError` if a reserved identifier collision is detected in
|
|
53
|
+
* the source (only checked when a shim would otherwise be installed).
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
declare function _analyzeForDispatch(entryPoint: string): _DispatchAnalysis | null;
|
|
57
|
+
/**
|
|
58
|
+
* Creates an esbuild plugin that appends a proxy dispatch table export
|
|
59
|
+
* (`__stripe_platform_dispatch__`) to the extension entry point.
|
|
60
|
+
*
|
|
61
|
+
* Requires pre-computed analysis from `_analyzeForDispatch`. The plugin uses
|
|
62
|
+
* the cached source and descriptor data directly, avoiding redundant file
|
|
63
|
+
* reads and SDK introspection during the build.
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
declare function _createPlatformDispatchPlugin(analysis: _DispatchAnalysis): esbuild.Plugin;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Creates a platform dispatch invoker from a bundled extension module.
|
|
70
|
+
*
|
|
71
|
+
* Reads `mod['__stripe_platform_dispatch__'].dispatch` and returns a callable
|
|
72
|
+
* that forwards to it.
|
|
73
|
+
*
|
|
74
|
+
* Returns `null` only if the dispatch table export is entirely absent —
|
|
75
|
+
* meaning the module was not built with the platform dispatch plugin at all.
|
|
76
|
+
* When the plugin was used, the table is always present (even for entry points
|
|
77
|
+
* with no recognised extension interface), so callers can use `null` as an
|
|
78
|
+
* unambiguous "plugin not run" signal.
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
declare function _createPlatformDispatch(mod: Record<string, unknown>): ((exportName: string, methodName: string, wireArgs: unknown, wireConfig: unknown, ctx: unknown) => unknown) | null;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Name of the dispatch table export injected by the platform dispatch plugin.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
declare const _DISPATCH_TABLE_EXPORT = "__stripe_platform_dispatch__";
|
|
88
|
+
|
|
89
|
+
export { _BuildSystemError, _BuildUserError, _DISPATCH_TABLE_EXPORT, type _DispatchAnalysis, _analyzeForDispatch, _createPlatformDispatch, _createPlatformDispatchPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,eAAe,EACf,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC"}
|