@stripe/extensibility-dev-tools 0.23.5
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/bin/build-custom-object-definitions.cjs +2111 -0
- package/dist/bin/build-custom-object-definitions.d.ts +11 -0
- package/dist/bin/build-custom-object-definitions.d.ts.map +1 -0
- package/dist/bin/build-custom-object-definitions.js +2088 -0
- package/dist/bin/create-upload-image.cjs +2136 -0
- package/dist/bin/create-upload-image.d.ts +17 -0
- package/dist/bin/create-upload-image.d.ts.map +1 -0
- package/dist/bin/create-upload-image.js +2113 -0
- package/dist/bin/dev-tools-rpc.cjs +3874 -0
- package/dist/bin/dev-tools-rpc.d.ts +3 -0
- package/dist/bin/dev-tools-rpc.d.ts.map +1 -0
- package/dist/bin/dev-tools-rpc.js +3864 -0
- package/dist/bin/gen-schemas.cjs +20739 -0
- package/dist/bin/gen-schemas.d.ts +8 -0
- package/dist/bin/gen-schemas.d.ts.map +1 -0
- package/dist/bin/gen-schemas.js +20715 -0
- package/dist/bin/gen-workspace.cjs +3847 -0
- package/dist/bin/gen-workspace.d.ts +8 -0
- package/dist/bin/gen-workspace.d.ts.map +1 -0
- package/dist/bin/gen-workspace.js +3841 -0
- package/dist/bin/manifest.cjs +686 -0
- package/dist/bin/manifest.d.ts +10 -0
- package/dist/bin/manifest.d.ts.map +1 -0
- package/dist/bin/manifest.js +663 -0
- package/dist/bin/rpc/dispatch.d.ts +10 -0
- package/dist/bin/rpc/dispatch.d.ts.map +1 -0
- package/dist/bin/rpc/handlers.d.ts +4 -0
- package/dist/bin/rpc/handlers.d.ts.map +1 -0
- package/dist/bin/rpc/types.d.ts +29 -0
- package/dist/bin/rpc/types.d.ts.map +1 -0
- package/dist/bin/template-info.cjs +1511 -0
- package/dist/bin/template-info.d.ts +9 -0
- package/dist/bin/template-info.d.ts.map +1 -0
- package/dist/bin/template-info.js +1488 -0
- package/dist/custom-objects/build-definitions.d.ts +98 -0
- package/dist/custom-objects/build-definitions.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/custom_objects/pub/api/app_api/object_definitions_app_service.pb.d.ts +191 -0
- package/dist/custom-objects/generated/proto/custom_objects/pub/api/app_api/object_definitions_app_service.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/custom_objects/pub/api/common/schema.pb.d.ts +131 -0
- package/dist/custom-objects/generated/proto/custom_objects/pub/api/common/schema.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/google/protobuf/descriptor.pb.d.ts +1482 -0
- package/dist/custom-objects/generated/proto/google/protobuf/descriptor.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/google/protobuf/timestamp.pb.d.ts +167 -0
- package/dist/custom-objects/generated/proto/google/protobuf/timestamp.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/proto/annotations.pb.d.ts +64 -0
- package/dist/custom-objects/generated/proto/proto/annotations.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/proto/extensions.pb.d.ts +657 -0
- package/dist/custom-objects/generated/proto/proto/extensions.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/metadata/pub/api/api_metadata.pb.d.ts +105 -0
- package/dist/custom-objects/generated/proto/vendor/metadata/pub/api/api_metadata.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/net/idempotency/idempotency_model.pb.d.ts +79 -0
- package/dist/custom-objects/generated/proto/vendor/net/idempotency/idempotency_model.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/api_group_enum.pb.d.ts +129 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/api_group_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/api_visibility.pb.d.ts +76 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/api_visibility.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/customize_dispatch_middleware_enum.pb.d.ts +78 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/customize_dispatch_middleware_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/docs_namespace_group_enum.pb.d.ts +146 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/docs_namespace_group_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/documented_enum.pb.d.ts +76 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/documented_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/event_scope_enum.pb.d.ts +92 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/event_scope_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/extension_interface.pb.d.ts +124 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/extension_interface.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/feature_enum.pb.d.ts +1070 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/feature_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/field_validation_rules.pb.d.ts +279 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/field_validation_rules.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/flavor_enum.pb.d.ts +78 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/flavor_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/http_error_status.pb.d.ts +102 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/http_error_status.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/method_kind_enum.pb.d.ts +86 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/method_kind_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/method_priority.pb.d.ts +80 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/method_priority.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/permission_check_enum.pb.d.ts +74 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/permission_check_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/redaction_enum.pb.d.ts +76 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/redaction_enum.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/region_routers.pb.d.ts +103 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/region_routers.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/rollout_configs.pb.d.ts +153 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/rollout_configs.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/v2ext.pb.d.ts +1111 -0
- package/dist/custom-objects/generated/proto/vendor/publicapi/v2ext.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/vext/annotations.pb.d.ts +602 -0
- package/dist/custom-objects/generated/proto/vendor/vext/annotations.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/vext/extensions.pb.d.ts +144 -0
- package/dist/custom-objects/generated/proto/vendor/vext/extensions.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/vext/privacy_unified_annotations.pb.d.ts +851 -0
- package/dist/custom-objects/generated/proto/vendor/vext/privacy_unified_annotations.pb.d.ts.map +1 -0
- package/dist/custom-objects/generated/proto/vendor/vext/xml_annotations.pb.d.ts +125 -0
- package/dist/custom-objects/generated/proto/vendor/vext/xml_annotations.pb.d.ts.map +1 -0
- package/dist/custom-objects/to-proto-json.d.ts +17 -0
- package/dist/custom-objects/to-proto-json.d.ts.map +1 -0
- package/dist/dependencies/index.cjs +601 -0
- package/dist/dependencies/index.d.ts +320 -0
- package/dist/dependencies/index.d.ts.map +1 -0
- package/dist/dependencies/index.js +560 -0
- package/dist/extensibility-dev-tools-alpha.d.ts +199 -0
- package/dist/extensibility-dev-tools-beta.d.ts +199 -0
- package/dist/extensibility-dev-tools-dependencies-alpha.d.ts +51 -0
- package/dist/extensibility-dev-tools-dependencies-beta.d.ts +51 -0
- package/dist/extensibility-dev-tools-dependencies-internal.d.ts +372 -0
- package/dist/extensibility-dev-tools-dependencies-public.d.ts +51 -0
- package/dist/extensibility-dev-tools-internal.d.ts +1722 -0
- package/dist/extensibility-dev-tools-jsonschema-tools-alpha.d.ts +57 -0
- package/dist/extensibility-dev-tools-jsonschema-tools-beta.d.ts +57 -0
- package/dist/extensibility-dev-tools-jsonschema-tools-internal.d.ts +123 -0
- package/dist/extensibility-dev-tools-jsonschema-tools-public.d.ts +57 -0
- package/dist/extensibility-dev-tools-manifest-alpha.d.ts +31 -0
- package/dist/extensibility-dev-tools-manifest-beta.d.ts +31 -0
- package/dist/extensibility-dev-tools-manifest-internal.d.ts +461 -0
- package/dist/extensibility-dev-tools-manifest-public.d.ts +31 -0
- package/dist/extensibility-dev-tools-public.d.ts +199 -0
- package/dist/extensibility-dev-tools-schemas-alpha.d.ts +9 -0
- package/dist/extensibility-dev-tools-schemas-beta.d.ts +9 -0
- package/dist/extensibility-dev-tools-schemas-internal.d.ts +41 -0
- package/dist/extensibility-dev-tools-schemas-public.d.ts +9 -0
- package/dist/extensibility-dev-tools-templates-alpha.d.ts +67 -0
- package/dist/extensibility-dev-tools-templates-beta.d.ts +67 -0
- package/dist/extensibility-dev-tools-templates-internal.d.ts +554 -0
- package/dist/extensibility-dev-tools-templates-public.d.ts +67 -0
- package/dist/extensibility-dev-tools-workspace-alpha.d.ts +51 -0
- package/dist/extensibility-dev-tools-workspace-beta.d.ts +51 -0
- package/dist/extensibility-dev-tools-workspace-internal.d.ts +410 -0
- package/dist/extensibility-dev-tools-workspace-public.d.ts +51 -0
- package/dist/index.cjs +3810 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3758 -0
- package/dist/jsonschema-tools.cjs +20451 -0
- package/dist/jsonschema-tools.d.ts +98 -0
- package/dist/jsonschema-tools.d.ts.map +1 -0
- package/dist/jsonschema-tools.js +20404 -0
- package/dist/manifest/index.cjs +610 -0
- package/dist/manifest/index.d.ts +8 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +571 -0
- package/dist/manifest/manifest-v1.d.ts +102 -0
- package/dist/manifest/manifest-v1.d.ts.map +1 -0
- package/dist/manifest/manifest-v2.d.ts +253 -0
- package/dist/manifest/manifest-v2.d.ts.map +1 -0
- package/dist/manifest/stripe-app-manifest.d.ts +114 -0
- package/dist/manifest/stripe-app-manifest.d.ts.map +1 -0
- package/dist/schemas/index.cjs +20692 -0
- package/dist/schemas/index.d.ts +37 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +20656 -0
- package/dist/templates/diff-viewer/diff-generator.d.ts +22 -0
- package/dist/templates/diff-viewer/diff-generator.d.ts.map +1 -0
- package/dist/templates/diff-viewer/diff-prompt.d.ts +13 -0
- package/dist/templates/diff-viewer/diff-prompt.d.ts.map +1 -0
- package/dist/templates/diff-viewer/index.d.ts +7 -0
- package/dist/templates/diff-viewer/index.d.ts.map +1 -0
- package/dist/templates/diff-viewer/terminal-renderer.d.ts +29 -0
- package/dist/templates/diff-viewer/terminal-renderer.d.ts.map +1 -0
- package/dist/templates/diff-viewer/types.d.ts +58 -0
- package/dist/templates/diff-viewer/types.d.ts.map +1 -0
- package/dist/templates/extensions/base.d.ts +23 -0
- package/dist/templates/extensions/base.d.ts.map +1 -0
- package/dist/templates/extensions/billing.bill.discount_calculation.d.ts +6 -0
- package/dist/templates/extensions/billing.bill.discount_calculation.d.ts.map +1 -0
- package/dist/templates/extensions/billing.customer_balance_application.d.ts +6 -0
- package/dist/templates/extensions/billing.customer_balance_application.d.ts.map +1 -0
- package/dist/templates/extensions/billing.invoice_collection_setting.d.ts +6 -0
- package/dist/templates/extensions/billing.invoice_collection_setting.d.ts.map +1 -0
- package/dist/templates/extensions/billing.prorations.d.ts +6 -0
- package/dist/templates/extensions/billing.prorations.d.ts.map +1 -0
- package/dist/templates/extensions/billing.recurring_billing_item_handling.d.ts +6 -0
- package/dist/templates/extensions/billing.recurring_billing_item_handling.d.ts.map +1 -0
- package/dist/templates/extensions/core.workflows.custom_action.d.ts +6 -0
- package/dist/templates/extensions/core.workflows.custom_action.d.ts.map +1 -0
- package/dist/templates/extensions/extend.objects.custom_objects.d.ts +6 -0
- package/dist/templates/extensions/extend.objects.custom_objects.d.ts.map +1 -0
- package/dist/templates/extensions/extend.workflows.custom_action.d.ts +6 -0
- package/dist/templates/extensions/extend.workflows.custom_action.d.ts.map +1 -0
- package/dist/templates/extensions/index.d.ts +13 -0
- package/dist/templates/extensions/index.d.ts.map +1 -0
- package/dist/templates/extensions/registry.d.ts +10 -0
- package/dist/templates/extensions/registry.d.ts.map +1 -0
- package/dist/templates/extensions/types.d.ts +104 -0
- package/dist/templates/extensions/types.d.ts.map +1 -0
- package/dist/templates/file-writer.d.ts +140 -0
- package/dist/templates/file-writer.d.ts.map +1 -0
- package/dist/templates/fs/_impl.d.ts +29 -0
- package/dist/templates/fs/_impl.d.ts.map +1 -0
- package/dist/templates/fs/filesystem.d.ts +8 -0
- package/dist/templates/fs/filesystem.d.ts.map +1 -0
- package/dist/templates/fs/in-memory.d.ts +9 -0
- package/dist/templates/fs/in-memory.d.ts.map +1 -0
- package/dist/templates/fs/index.d.ts +25 -0
- package/dist/templates/fs/index.d.ts.map +1 -0
- package/dist/templates/fs-utils.d.ts +17 -0
- package/dist/templates/fs-utils.d.ts.map +1 -0
- package/dist/templates/index.cjs +2248 -0
- package/dist/templates/index.d.ts +32 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +2203 -0
- package/dist/templates/root/index.d.ts +60 -0
- package/dist/templates/root/index.d.ts.map +1 -0
- package/dist/templates/simple-templates.d.ts +8 -0
- package/dist/templates/simple-templates.d.ts.map +1 -0
- package/dist/templates/template-manager.d.ts +8 -0
- package/dist/templates/template-manager.d.ts.map +1 -0
- package/dist/templates/types.d.ts +9 -0
- package/dist/templates/types.d.ts.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/workspace/index.cjs +3756 -0
- package/dist/workspace/index.d.ts +336 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +3731 -0
- package/package.json +137 -0
- package/templates/extensions/billing.bill.discount_calculation/index.test.ts +15 -0
- package/templates/extensions/billing.bill.discount_calculation/index.ts +20 -0
- package/templates/extensions/billing.customer_balance_application/index.test.ts +15 -0
- package/templates/extensions/billing.customer_balance_application/index.ts +18 -0
- package/templates/extensions/billing.invoice_collection_setting/index.test.ts +15 -0
- package/templates/extensions/billing.invoice_collection_setting/index.ts +16 -0
- package/templates/extensions/billing.prorations/index.test.ts +15 -0
- package/templates/extensions/billing.prorations/index.ts +18 -0
- package/templates/extensions/billing.recurring_billing_item_handling/index.test.ts +15 -0
- package/templates/extensions/billing.recurring_billing_item_handling/index.ts +42 -0
- package/templates/extensions/common/.prettierignore +3 -0
- package/templates/extensions/common/eslint.config.mts.mustache +95 -0
- package/templates/extensions/common/package.json.mustache +26 -0
- package/templates/extensions/common/tsconfig.build.json.mustache +15 -0
- package/templates/extensions/common/tsconfig.json.mustache +16 -0
- package/templates/extensions/core.workflows.custom_action/custom_input.schema.json +6 -0
- package/templates/extensions/core.workflows.custom_action/index.test.ts +15 -0
- package/templates/extensions/core.workflows.custom_action/index.ts +31 -0
- package/templates/extensions/extend.workflows.custom_action/custom_input.schema.json +6 -0
- package/templates/extensions/extend.workflows.custom_action/index.test.ts +15 -0
- package/templates/extensions/extend.workflows.custom_action/index.ts +31 -0
- package/templates/root/.husky/pre-commit +1 -0
- package/templates/root/.prettierignore +5 -0
- package/templates/root/.prettierrc +7 -0
- package/templates/root/_gitignore +28 -0
- package/templates/root/custom-objects/package.json +20 -0
- package/templates/root/custom-objects/tsconfig.json +9 -0
- package/templates/root/eslint.config.mts +95 -0
- package/templates/root/package.json.mustache +32 -0
- package/templates/root/pnpm-workspace.yaml +7 -0
- package/templates/root/stripe-app.yaml.mustache +6 -0
- package/templates/root/tools/test.mts +38 -0
- package/templates/root/tsconfig.base.json +23 -0
- package/templates/root/tsconfig.json +15 -0
- package/templates/root/ui/package.json +17 -0
- package/templates/root/vitest.config.mts +47 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DiffResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generates a unified diff between old and new file content.
|
|
4
|
+
*
|
|
5
|
+
* @param filePath - Path to the file (for display purposes)
|
|
6
|
+
* @param oldContent - Existing file content
|
|
7
|
+
* @param newContent - New file content to compare against
|
|
8
|
+
* @param contextLines - Number of context lines to show (default 3, use large number for full file)
|
|
9
|
+
* @returns Structured diff result with parsed lines
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateDiff(filePath: string, oldContent: string, newContent: string, contextLines?: number): Promise<DiffResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Reads existing file from disk for diff comparison.
|
|
15
|
+
* Returns empty string if file doesn't exist (treat as all new content).
|
|
16
|
+
*
|
|
17
|
+
* @param resolvedPath - Fully resolved absolute path to the file to read
|
|
18
|
+
* @returns File content or empty string if file doesn't exist
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function readExistingFile(resolvedPath: string): Promise<string>;
|
|
22
|
+
//# sourceMappingURL=diff-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-generator.d.ts","sourceRoot":"","sources":["../../../src/templates/diff-viewer/diff-generator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,SAAI,GACf,OAAO,CAAC,UAAU,CAAC,CAyBrB;AAwDD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW5E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { _OverwriteDecision } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Shows an advanced diff viewer with scrolling and colorized output.
|
|
4
|
+
* Falls back to basic prompt if not in a TTY or on error.
|
|
5
|
+
*
|
|
6
|
+
* @param filePath - Relative path to the file (for display)
|
|
7
|
+
* @param cwd - Working directory to resolve the path from
|
|
8
|
+
* @param newContent - New content that would be written
|
|
9
|
+
* @returns User's decision about overwriting
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function _advancedDiffPrompt(filePath: string, cwd: string, newContent: string): Promise<_OverwriteDecision>;
|
|
13
|
+
//# sourceMappingURL=diff-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-prompt.d.ts","sourceRoot":"","sources":["../../../src/templates/diff-viewer/diff-prompt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,kBAAkB,EAEnB,MAAM,YAAY,CAAC;AAyCpB;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,kBAAkB,CAAC,CAuF7B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advanced diff viewer for overwrite prompts.
|
|
3
|
+
* Provides colorized, scrollable diff display in the terminal.
|
|
4
|
+
*/
|
|
5
|
+
export { _advancedDiffPrompt } from './diff-prompt.js';
|
|
6
|
+
export type { DiffLine, DiffResult, _OverwriteDecision, ViewerState } from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/diff-viewer/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ViewerState } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Renders the diff viewer UI inline in the natural console flow.
|
|
4
|
+
* The window is only as tall as needed, up to 75% of terminal height.
|
|
5
|
+
*
|
|
6
|
+
* @param state - Current viewer state (mutated to update renderedHeight)
|
|
7
|
+
* @param filePath - Path to the file being displayed
|
|
8
|
+
* @param clearPrevious - Whether to clear the previous render before rendering
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function render(state: ViewerState, filePath: string, clearPrevious?: boolean): void;
|
|
12
|
+
/**
|
|
13
|
+
* Clears the prompt line and moves to a new line.
|
|
14
|
+
* The diff remains visible in the terminal history.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function clearDiffWindow(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the current terminal dimensions.
|
|
20
|
+
* Uses stty/tput to read directly from /dev/tty since go-plugin redirects stdio.
|
|
21
|
+
*
|
|
22
|
+
* @returns Object with rows and columns properties
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function getTerminalSize(): {
|
|
26
|
+
rows: number;
|
|
27
|
+
columns: number;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=terminal-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-renderer.d.ts","sourceRoot":"","sources":["../../../src/templates/diff-viewer/terminal-renderer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAY,WAAW,EAAE,MAAM,YAAY,CAAC;AAuBxD;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CACpB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,MAAM,EAChB,aAAa,UAAQ,GACpB,IAAI,CAkDN;AAuGD;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAmDD;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CA4DnE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { _OverwriteDecision } from '../file-writer.js';
|
|
2
|
+
export type { _OverwriteDecision };
|
|
3
|
+
/**
|
|
4
|
+
* Represents a single line in a unified diff output.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface DiffLine {
|
|
8
|
+
/** The type of change this line represents */
|
|
9
|
+
type: 'add' | 'remove' | 'context' | 'header';
|
|
10
|
+
/** The text content of the line (including +/- prefix from diff) */
|
|
11
|
+
text: string;
|
|
12
|
+
/** Line number in the old file (for remove/context lines) */
|
|
13
|
+
oldLine?: number;
|
|
14
|
+
/** Line number in the new file (for add/context lines) */
|
|
15
|
+
newLine?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Result of generating a diff between two file contents.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export interface DiffResult {
|
|
22
|
+
/** Parsed diff lines */
|
|
23
|
+
lines: DiffLine[];
|
|
24
|
+
/** Original file name */
|
|
25
|
+
oldFileName: string;
|
|
26
|
+
/** New file name */
|
|
27
|
+
newFileName: string;
|
|
28
|
+
/** Whether the file is binary (cannot show diff) */
|
|
29
|
+
isBinary: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* State of the diff viewer during user interaction.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export interface ViewerState {
|
|
36
|
+
/** Current scroll offset (top visible line index) */
|
|
37
|
+
scrollOffset: number;
|
|
38
|
+
/** Maximum scroll offset allowed */
|
|
39
|
+
maxScroll: number;
|
|
40
|
+
/** All diff lines to display */
|
|
41
|
+
diffLines: DiffLine[];
|
|
42
|
+
/** Terminal height in rows */
|
|
43
|
+
terminalHeight: number;
|
|
44
|
+
/** Terminal width in columns */
|
|
45
|
+
terminalWidth: number;
|
|
46
|
+
/** Whether terminal was in raw mode before we took over */
|
|
47
|
+
wasRaw: boolean;
|
|
48
|
+
/** Number of lines rendered in last render (for re-rendering on scroll) */
|
|
49
|
+
renderedHeight: number;
|
|
50
|
+
/** Whether to show full file context (true) or standard context (false) */
|
|
51
|
+
fullFileMode: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Internal result from keypress handler.
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export type KeypressResult = 'continue' | _OverwriteDecision;
|
|
58
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/templates/diff-viewer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,8CAA8C;IAC9C,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC9C,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,wBAAwB;IACxB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,8BAA8B;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { _ExtensionParams, _ExtensionTemplateOutput } from './types.js';
|
|
2
|
+
import type { _GeneratedFile, _TemplateContext } from '../types.js';
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare const LANGUAGE_SERVER_PACKAGE_NAME = "@stripe/extensibility-language-server";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const LANGUAGE_SERVER_PACKAGE_VERSION = "^0.2.0";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export type _ExecutionProfile = 'restricted' | 'egress';
|
|
9
|
+
/** @internal */
|
|
10
|
+
export interface _BaseTemplateParams extends _ExtensionParams {
|
|
11
|
+
extensionInterfaceId: string;
|
|
12
|
+
executionProfile: _ExecutionProfile;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Generate the ESLint config file for an extension workspace.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function _createExtensionEslintConfigFile(params: Pick<_ExtensionParams, 'id'> & {
|
|
19
|
+
extensionInterfaceId: string;
|
|
20
|
+
}, context: _TemplateContext): _GeneratedFile;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare function _createBaseOutput(params: _BaseTemplateParams, context: _TemplateContext): _ExtensionTemplateOutput;
|
|
23
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpE,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,0CAA0C,CAAC;AAEpF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,WAAW,CAAC;AAExD,gBAAgB;AAChB,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAExD,gBAAgB;AAChB,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,iBAAiB,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GAAG;IAAE,oBAAoB,EAAE,MAAM,CAAA;CAAE,EACvE,OAAO,EAAE,gBAAgB,GACxB,cAAc,CAahB;AAED,gBAAgB;AAChB,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,gBAAgB,GACxB,wBAAwB,CA2C1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.bill.discount_calculation.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/billing.bill.discount_calculation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;;;;AAgDrD,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.customer_balance_application.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/billing.customer_balance_application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;;;;AA+CrD,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.invoice_collection_setting.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/billing.invoice_collection_setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;;;;AAgDrD,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.prorations.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/billing.prorations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;;;;AA+CrD,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.recurring_billing_item_handling.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/billing.recurring_billing_item_handling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;;;;AAuDrD,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.workflows.custom_action.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/core.workflows.custom_action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;;;;AA8DrD,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend.objects.custom_objects.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/extend.objects.custom_objects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;;;;AAyCrD,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend.workflows.custom_action.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/extend.workflows.custom_action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;;;;AA8DrD,wBAEE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension template manager with built-in templates
|
|
3
|
+
*/
|
|
4
|
+
import { _ExtensionTemplateManager } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* ExtensionTemplateManager configured with built-in templates
|
|
7
|
+
* Automatically selects filesystem or in-memory implementation
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const _templateManager: _ExtensionTemplateManager;
|
|
11
|
+
export { _createExtensionEslintConfigFile } from './base.js';
|
|
12
|
+
export * from './types.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAIvD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2BAG5B,CAAC;AAEF,OAAO,EAAE,gCAAgC,EAAE,MAAM,WAAW,CAAC;AAG7D,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry of built-in extension templates
|
|
3
|
+
*/
|
|
4
|
+
import type { _ExtensionTemplate } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Default registry of built-in templates
|
|
7
|
+
*/
|
|
8
|
+
declare const DEFAULT_TEMPLATES: Record<string, _ExtensionTemplate>;
|
|
9
|
+
export default DEFAULT_TEMPLATES;
|
|
10
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAUrD;;GAEG;AACH,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CASzD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension-specific template types
|
|
3
|
+
*
|
|
4
|
+
* Specializes the generic template system for extension generation
|
|
5
|
+
* Maintains backward compatibility with existing extension command
|
|
6
|
+
*/
|
|
7
|
+
import type { _NpmDependency, _DevNpmDependency } from '../../dependencies/index.js';
|
|
8
|
+
import { _TemplateManager } from '../template-manager.js';
|
|
9
|
+
import type { _Template, _TemplateOutput } from '../types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Post-generation hook configuration
|
|
12
|
+
* Either `script` (run via `pnpm run`) or `exec` (run via `pnpm exec`)
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export type _PostGenerationHook = {
|
|
16
|
+
/** Script name to run via `pnpm run <script>` */
|
|
17
|
+
script: string;
|
|
18
|
+
/** Optional description of what this hook does */
|
|
19
|
+
description?: string;
|
|
20
|
+
} | {
|
|
21
|
+
/** Command to run via `pnpm exec <command>` */
|
|
22
|
+
exec: string;
|
|
23
|
+
/** Optional description of what this hook does */
|
|
24
|
+
description?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Parameters for extension template generation
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export interface _ExtensionParams extends Record<string, unknown> {
|
|
31
|
+
/** Extension ID (validated to be safe for file paths and IDs) */
|
|
32
|
+
id: string;
|
|
33
|
+
/** Human-readable name for the extension */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Package version (preserved from existing package.json, defaults to 0.0.1) */
|
|
36
|
+
version: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Output from extension template generation
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export interface _ExtensionTemplateOutput extends _TemplateOutput {
|
|
43
|
+
/** Methods configuration for stripe-app.yaml */
|
|
44
|
+
methods: Record<string, unknown>;
|
|
45
|
+
/** Dependencies required by the extension */
|
|
46
|
+
dependencies?: {
|
|
47
|
+
/** Regular dependencies (added to dependencies field) */
|
|
48
|
+
runtime?: _NpmDependency[];
|
|
49
|
+
/** Development dependencies (added to devDependencies field) */
|
|
50
|
+
dev?: _DevNpmDependency[];
|
|
51
|
+
};
|
|
52
|
+
/** Post-generation hooks to run after files are generated and dependencies installed */
|
|
53
|
+
postGenerationHooks?: _PostGenerationHook[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Static metadata for a single method on an extension template
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export interface _ExtensionMethodInfo {
|
|
60
|
+
/** Implementation types supported by this method (e.g. 'script', 'remote-function') */
|
|
61
|
+
implementation_types: string[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Extension template - specialization of generic Template with a description
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
export interface _ExtensionTemplate extends _Template<_ExtensionParams, _ExtensionTemplateOutput> {
|
|
68
|
+
/** Short human-readable description of the extension interface */
|
|
69
|
+
description: string;
|
|
70
|
+
/** Whether this template is deprecated and should not be offered for new extensions */
|
|
71
|
+
deprecated?: boolean;
|
|
72
|
+
/** Whether this template is hidden from `stripe generate` (used only by the build pipeline) */
|
|
73
|
+
hidden?: boolean;
|
|
74
|
+
/** Static metadata for each method — implementation types supported per method */
|
|
75
|
+
methods: Record<string, _ExtensionMethodInfo>;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Summary info for a registered extension template
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export interface _ExtensionTemplateInfo {
|
|
82
|
+
/** Template key (the extension interface ID) */
|
|
83
|
+
key: string;
|
|
84
|
+
/** Short human-readable description */
|
|
85
|
+
description: string;
|
|
86
|
+
/** Whether this template is deprecated */
|
|
87
|
+
deprecated: boolean;
|
|
88
|
+
/** Whether this template is hidden from user-facing generators */
|
|
89
|
+
hidden: boolean;
|
|
90
|
+
/** Static metadata for each method — implementation types supported per method */
|
|
91
|
+
methods: Record<string, _ExtensionMethodInfo>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Extension template manager
|
|
95
|
+
* Specialized TemplateManager for extension generation
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
export declare class _ExtensionTemplateManager extends _TemplateManager<_ExtensionParams, _ExtensionTemplateOutput, _ExtensionTemplate> {
|
|
99
|
+
/**
|
|
100
|
+
* Get summary info for all registered extension templates
|
|
101
|
+
*/
|
|
102
|
+
getTemplateInfo(): _ExtensionTemplateInfo[];
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/templates/extensions/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACD;IACE,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEN;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/D,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,eAAe;IAC/D,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC,6CAA6C;IAC7C,YAAY,CAAC,EAAE;QACb,yDAAyD;QACzD,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;QAC3B,gEAAgE;QAChE,GAAG,CAAC,EAAE,iBAAiB,EAAE,CAAC;KAC3B,CAAC;IAEF,wFAAwF;IACxF,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,uFAAuF;IACvF,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,SAAS,CACnD,gBAAgB,EAChB,wBAAwB,CACzB;IACC,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,uFAAuF;IACvF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+FAA+F;IAC/F,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,UAAU,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAC/C;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,gBAAgB,CAC7D,gBAAgB,EAChB,wBAAwB,EACxB,kBAAkB,CACnB;IACC;;OAEG;IACH,eAAe,IAAI,sBAAsB,EAAE;CAS5C"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File writer for generated files
|
|
3
|
+
*
|
|
4
|
+
* Handles the common pattern of writing multiple files with directory creation
|
|
5
|
+
* and existence checking
|
|
6
|
+
*/
|
|
7
|
+
import type { _GeneratedFile } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* User decision when prompted about overwriting a file
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export type _OverwriteDecision = 'overwrite' | 'skip' | 'overwrite-all' | 'abort';
|
|
13
|
+
/**
|
|
14
|
+
* Callback function for prompting about file overwrites
|
|
15
|
+
* @param path - Relative path to the file that would be overwritten
|
|
16
|
+
* @param cwd - Working directory (for resolving the path)
|
|
17
|
+
* @param newContent - Content of the file that would be written
|
|
18
|
+
* @returns Promise resolving to user's decision
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export type _OverwritePromptCallback = (path: string, cwd: string, newContent: string) => Promise<_OverwriteDecision>;
|
|
22
|
+
/**
|
|
23
|
+
* File write behavior modes
|
|
24
|
+
* - 'overwrite-all': Overwrite all existing files
|
|
25
|
+
* - 'abort-if-existing': Refuse to write ANY files if ANY already exist (all-or-nothing)
|
|
26
|
+
* - 'if-missing': Skip individual files that exist, write only missing files
|
|
27
|
+
* - function: Prompt before overwriting each file (interactive ask mode)
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export type _WriteMode = 'overwrite-all' | 'abort-if-existing' | 'if-missing' | _OverwritePromptCallback;
|
|
31
|
+
/**
|
|
32
|
+
* Options for writing generated files
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export interface _FileWriterOptions {
|
|
36
|
+
/**
|
|
37
|
+
* Working directory to write files relative to
|
|
38
|
+
* Defaults to process.cwd()
|
|
39
|
+
*/
|
|
40
|
+
cwd?: string;
|
|
41
|
+
/**
|
|
42
|
+
* How to handle existing files:
|
|
43
|
+
* - 'overwrite-all': Overwrite all existing files
|
|
44
|
+
* - 'abort-if-existing': Refuse to write ANY files if ANY already exist (all-or-nothing)
|
|
45
|
+
* - 'if-missing': Skip individual files that exist, write only missing files
|
|
46
|
+
* - function: Prompt before overwriting each file (interactive ask mode)
|
|
47
|
+
* Defaults to 'abort-if-existing'
|
|
48
|
+
*/
|
|
49
|
+
write?: _WriteMode;
|
|
50
|
+
/**
|
|
51
|
+
* Callback invoked after a file is successfully written
|
|
52
|
+
* @param file - The file that was written
|
|
53
|
+
* @param wasOverwrite - True if file existed and was overwritten, false if newly created
|
|
54
|
+
*/
|
|
55
|
+
onFileWritten?: (file: _GeneratedFile, wasOverwrite: boolean) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Callback invoked when a file already exists and is skipped
|
|
58
|
+
* @param file - The file that was skipped
|
|
59
|
+
*/
|
|
60
|
+
onFileSkipped?: (file: _GeneratedFile) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Callback invoked when a file already exists with identical content
|
|
63
|
+
* @param file - The file that is identical
|
|
64
|
+
*/
|
|
65
|
+
onFileIdentical?: (file: _GeneratedFile) => void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Result of writing files
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export interface _FileWriteResult {
|
|
72
|
+
/**
|
|
73
|
+
* Paths of files that were successfully written (relative to cwd)
|
|
74
|
+
* Includes both newly created files and overwritten files
|
|
75
|
+
*/
|
|
76
|
+
written: string[];
|
|
77
|
+
/**
|
|
78
|
+
* Paths of all files that already existed before the operation (relative to cwd)
|
|
79
|
+
* Always populated when files exist, regardless of whether they were overwritten
|
|
80
|
+
*/
|
|
81
|
+
existing: string[];
|
|
82
|
+
/**
|
|
83
|
+
* Whether the entire operation was skipped due to overwrite='abort-if-existing' with existing files
|
|
84
|
+
* True only when overwrite='abort-if-existing' and files exist (all-or-nothing behavior)
|
|
85
|
+
* False for all other modes including interactive (even if user skips all files)
|
|
86
|
+
*/
|
|
87
|
+
skipped: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the user aborted the operation during interactive prompting
|
|
90
|
+
* True only when user chose 'quit' during interactive mode
|
|
91
|
+
* Caller should stop further processing (dependencies, hooks, etc.)
|
|
92
|
+
*/
|
|
93
|
+
aborted: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Simple text-based prompt for overwrite decisions
|
|
97
|
+
* Uses single-keypress input in interactive terminals (no Enter required)
|
|
98
|
+
* Falls back to line-based input in non-interactive environments (tests, CI)
|
|
99
|
+
*
|
|
100
|
+
* @param filePath - Path to the file that would be overwritten
|
|
101
|
+
* @returns Promise resolving to user's decision
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
export declare function _promptOverwrite(filePath: string): Promise<_OverwriteDecision>;
|
|
105
|
+
/**
|
|
106
|
+
* Write generated files to disk with configurable write behavior
|
|
107
|
+
*
|
|
108
|
+
* Write modes:
|
|
109
|
+
* - 'overwrite-all': Overwrite all existing files without prompting
|
|
110
|
+
* - 'abort-if-existing': Refuse to write ANY files if ANY exist (all-or-nothing, sets skipped=true)
|
|
111
|
+
* - 'if-missing': Write only files that don't exist, skip existing ones individually
|
|
112
|
+
* - function: Prompt for each existing file (y/n/a/q), allows selective overwriting
|
|
113
|
+
*
|
|
114
|
+
* Always creates parent directories as needed (mkdir -p behavior)
|
|
115
|
+
*
|
|
116
|
+
* @param files - Files to write
|
|
117
|
+
* @param options - Write options (cwd, write mode, callbacks)
|
|
118
|
+
* @returns Result with written files, existing files, and skip status
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* // All-or-nothing mode
|
|
123
|
+
* const result = await _writeGeneratedFiles(files, {
|
|
124
|
+
* cwd: process.cwd(),
|
|
125
|
+
* write: 'abort-if-existing'
|
|
126
|
+
* })
|
|
127
|
+
* if (result.skipped) {
|
|
128
|
+
* throw new Error(`Files exist: ${result.existing.join(', ')}`)
|
|
129
|
+
* }
|
|
130
|
+
*
|
|
131
|
+
* // Interactive mode
|
|
132
|
+
* await _writeGeneratedFiles(files, {
|
|
133
|
+
* cwd: process.cwd(),
|
|
134
|
+
* write: async (path, newContent) => await _promptOverwrite(path)
|
|
135
|
+
* })
|
|
136
|
+
* ```
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
export declare function _writeGeneratedFiles(files: _GeneratedFile[], options?: _FileWriterOptions): Promise<_FileWriteResult>;
|
|
140
|
+
//# sourceMappingURL=file-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-writer.d.ts","sourceRoot":"","sources":["../../src/templates/file-writer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAKjD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,MAAM,GAAG,eAAe,GAAG,OAAO,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,mBAAmB,GACnB,YAAY,GACZ,wBAAwB,CAAC;AAE7B;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IAEtE;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAE/C;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;;OAGG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4GpF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,cAAc,EAAE,EACvB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,gBAAgB,CAAC,CAiH3B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template FS implementation selector - DO NOT MODIFY
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ MAGIC HAPPENS HERE ⚠️
|
|
5
|
+
*
|
|
6
|
+
* This file gets REPLACED during CJS bundling via an esbuild plugin.
|
|
7
|
+
*
|
|
8
|
+
* - ESM builds: This file is used as-is (exports filesystem implementation)
|
|
9
|
+
* - CJS builds: This entire file is swapped with a virtual module that exports
|
|
10
|
+
* in-memory implementation with bundled templates
|
|
11
|
+
*
|
|
12
|
+
* The plugin (scripts/create-templates-bundle-plugin.mts) intercepts imports
|
|
13
|
+
* of this file during CJS bundling and provides a complete replacement that:
|
|
14
|
+
* 1. Contains TEMPLATE_FS_IMAGE array with all template content
|
|
15
|
+
* 2. Imports createInMemoryTemplateFS
|
|
16
|
+
* 3. Exports fs instance created with the bundled data
|
|
17
|
+
*
|
|
18
|
+
* DO NOT add anything else to this file - it will break CJS bundling.
|
|
19
|
+
* Any additional exports should go in index.ts instead.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Default TemplateFS instance rooted at templates/
|
|
23
|
+
*
|
|
24
|
+
* ESM: Uses filesystem implementation (reads from templates/ directory)
|
|
25
|
+
* CJS: This entire file is replaced with in-memory implementation
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare const _fs: import("@stripe/extensibility-tool-utils")._TemplateFS;
|
|
29
|
+
//# sourceMappingURL=_impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_impl.d.ts","sourceRoot":"","sources":["../../../src/templates/fs/_impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAoBH;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,wDAA0C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template helper functions
|
|
3
|
+
*
|
|
4
|
+
* @deprecated Implementation moved to `@stripe/extensibility-tool-utils`.
|
|
5
|
+
* This file re-exports under the original name for backward compatibility.
|
|
6
|
+
*/
|
|
7
|
+
export { _createFilesystemTemplateFS as createTemplateFS } from '@stripe/extensibility-tool-utils';
|
|
8
|
+
//# sourceMappingURL=filesystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../../src/templates/fs/filesystem.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,2BAA2B,IAAI,gBAAgB,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory TemplateFS implementation
|
|
3
|
+
*
|
|
4
|
+
* Re-exported from @stripe/extensibility-tool-utils where the canonical
|
|
5
|
+
* definitions now live. This module preserves the existing import paths.
|
|
6
|
+
*/
|
|
7
|
+
export { _createInMemoryTemplateFS } from '@stripe/extensibility-tool-utils';
|
|
8
|
+
export type { _TemplateFSImageEntry as TemplateFSImageEntry, _InMemoryTemplateFS as InMemoryTemplateFS, } from '@stripe/extensibility-tool-utils';
|
|
9
|
+
//# sourceMappingURL=in-memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory.d.ts","sourceRoot":"","sources":["../../../src/templates/fs/in-memory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,YAAY,EACV,qBAAqB,IAAI,oBAAoB,EAC7C,mBAAmB,IAAI,kBAAkB,GAC1C,MAAM,kCAAkC,CAAC"}
|