@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.
Files changed (253) hide show
  1. package/LICENSE.md +19 -0
  2. package/dist/bin/build-custom-object-definitions.cjs +2111 -0
  3. package/dist/bin/build-custom-object-definitions.d.ts +11 -0
  4. package/dist/bin/build-custom-object-definitions.d.ts.map +1 -0
  5. package/dist/bin/build-custom-object-definitions.js +2088 -0
  6. package/dist/bin/create-upload-image.cjs +2136 -0
  7. package/dist/bin/create-upload-image.d.ts +17 -0
  8. package/dist/bin/create-upload-image.d.ts.map +1 -0
  9. package/dist/bin/create-upload-image.js +2113 -0
  10. package/dist/bin/dev-tools-rpc.cjs +3874 -0
  11. package/dist/bin/dev-tools-rpc.d.ts +3 -0
  12. package/dist/bin/dev-tools-rpc.d.ts.map +1 -0
  13. package/dist/bin/dev-tools-rpc.js +3864 -0
  14. package/dist/bin/gen-schemas.cjs +20739 -0
  15. package/dist/bin/gen-schemas.d.ts +8 -0
  16. package/dist/bin/gen-schemas.d.ts.map +1 -0
  17. package/dist/bin/gen-schemas.js +20715 -0
  18. package/dist/bin/gen-workspace.cjs +3847 -0
  19. package/dist/bin/gen-workspace.d.ts +8 -0
  20. package/dist/bin/gen-workspace.d.ts.map +1 -0
  21. package/dist/bin/gen-workspace.js +3841 -0
  22. package/dist/bin/manifest.cjs +686 -0
  23. package/dist/bin/manifest.d.ts +10 -0
  24. package/dist/bin/manifest.d.ts.map +1 -0
  25. package/dist/bin/manifest.js +663 -0
  26. package/dist/bin/rpc/dispatch.d.ts +10 -0
  27. package/dist/bin/rpc/dispatch.d.ts.map +1 -0
  28. package/dist/bin/rpc/handlers.d.ts +4 -0
  29. package/dist/bin/rpc/handlers.d.ts.map +1 -0
  30. package/dist/bin/rpc/types.d.ts +29 -0
  31. package/dist/bin/rpc/types.d.ts.map +1 -0
  32. package/dist/bin/template-info.cjs +1511 -0
  33. package/dist/bin/template-info.d.ts +9 -0
  34. package/dist/bin/template-info.d.ts.map +1 -0
  35. package/dist/bin/template-info.js +1488 -0
  36. package/dist/custom-objects/build-definitions.d.ts +98 -0
  37. package/dist/custom-objects/build-definitions.d.ts.map +1 -0
  38. package/dist/custom-objects/generated/proto/custom_objects/pub/api/app_api/object_definitions_app_service.pb.d.ts +191 -0
  39. package/dist/custom-objects/generated/proto/custom_objects/pub/api/app_api/object_definitions_app_service.pb.d.ts.map +1 -0
  40. package/dist/custom-objects/generated/proto/custom_objects/pub/api/common/schema.pb.d.ts +131 -0
  41. package/dist/custom-objects/generated/proto/custom_objects/pub/api/common/schema.pb.d.ts.map +1 -0
  42. package/dist/custom-objects/generated/proto/google/protobuf/descriptor.pb.d.ts +1482 -0
  43. package/dist/custom-objects/generated/proto/google/protobuf/descriptor.pb.d.ts.map +1 -0
  44. package/dist/custom-objects/generated/proto/google/protobuf/timestamp.pb.d.ts +167 -0
  45. package/dist/custom-objects/generated/proto/google/protobuf/timestamp.pb.d.ts.map +1 -0
  46. package/dist/custom-objects/generated/proto/proto/annotations.pb.d.ts +64 -0
  47. package/dist/custom-objects/generated/proto/proto/annotations.pb.d.ts.map +1 -0
  48. package/dist/custom-objects/generated/proto/proto/extensions.pb.d.ts +657 -0
  49. package/dist/custom-objects/generated/proto/proto/extensions.pb.d.ts.map +1 -0
  50. package/dist/custom-objects/generated/proto/vendor/metadata/pub/api/api_metadata.pb.d.ts +105 -0
  51. package/dist/custom-objects/generated/proto/vendor/metadata/pub/api/api_metadata.pb.d.ts.map +1 -0
  52. package/dist/custom-objects/generated/proto/vendor/net/idempotency/idempotency_model.pb.d.ts +79 -0
  53. package/dist/custom-objects/generated/proto/vendor/net/idempotency/idempotency_model.pb.d.ts.map +1 -0
  54. package/dist/custom-objects/generated/proto/vendor/publicapi/api_group_enum.pb.d.ts +129 -0
  55. package/dist/custom-objects/generated/proto/vendor/publicapi/api_group_enum.pb.d.ts.map +1 -0
  56. package/dist/custom-objects/generated/proto/vendor/publicapi/api_visibility.pb.d.ts +76 -0
  57. package/dist/custom-objects/generated/proto/vendor/publicapi/api_visibility.pb.d.ts.map +1 -0
  58. package/dist/custom-objects/generated/proto/vendor/publicapi/customize_dispatch_middleware_enum.pb.d.ts +78 -0
  59. package/dist/custom-objects/generated/proto/vendor/publicapi/customize_dispatch_middleware_enum.pb.d.ts.map +1 -0
  60. package/dist/custom-objects/generated/proto/vendor/publicapi/docs_namespace_group_enum.pb.d.ts +146 -0
  61. package/dist/custom-objects/generated/proto/vendor/publicapi/docs_namespace_group_enum.pb.d.ts.map +1 -0
  62. package/dist/custom-objects/generated/proto/vendor/publicapi/documented_enum.pb.d.ts +76 -0
  63. package/dist/custom-objects/generated/proto/vendor/publicapi/documented_enum.pb.d.ts.map +1 -0
  64. package/dist/custom-objects/generated/proto/vendor/publicapi/event_scope_enum.pb.d.ts +92 -0
  65. package/dist/custom-objects/generated/proto/vendor/publicapi/event_scope_enum.pb.d.ts.map +1 -0
  66. package/dist/custom-objects/generated/proto/vendor/publicapi/extension_interface.pb.d.ts +124 -0
  67. package/dist/custom-objects/generated/proto/vendor/publicapi/extension_interface.pb.d.ts.map +1 -0
  68. package/dist/custom-objects/generated/proto/vendor/publicapi/feature_enum.pb.d.ts +1070 -0
  69. package/dist/custom-objects/generated/proto/vendor/publicapi/feature_enum.pb.d.ts.map +1 -0
  70. package/dist/custom-objects/generated/proto/vendor/publicapi/field_validation_rules.pb.d.ts +279 -0
  71. package/dist/custom-objects/generated/proto/vendor/publicapi/field_validation_rules.pb.d.ts.map +1 -0
  72. package/dist/custom-objects/generated/proto/vendor/publicapi/flavor_enum.pb.d.ts +78 -0
  73. package/dist/custom-objects/generated/proto/vendor/publicapi/flavor_enum.pb.d.ts.map +1 -0
  74. package/dist/custom-objects/generated/proto/vendor/publicapi/http_error_status.pb.d.ts +102 -0
  75. package/dist/custom-objects/generated/proto/vendor/publicapi/http_error_status.pb.d.ts.map +1 -0
  76. package/dist/custom-objects/generated/proto/vendor/publicapi/method_kind_enum.pb.d.ts +86 -0
  77. package/dist/custom-objects/generated/proto/vendor/publicapi/method_kind_enum.pb.d.ts.map +1 -0
  78. package/dist/custom-objects/generated/proto/vendor/publicapi/method_priority.pb.d.ts +80 -0
  79. package/dist/custom-objects/generated/proto/vendor/publicapi/method_priority.pb.d.ts.map +1 -0
  80. package/dist/custom-objects/generated/proto/vendor/publicapi/permission_check_enum.pb.d.ts +74 -0
  81. package/dist/custom-objects/generated/proto/vendor/publicapi/permission_check_enum.pb.d.ts.map +1 -0
  82. package/dist/custom-objects/generated/proto/vendor/publicapi/redaction_enum.pb.d.ts +76 -0
  83. package/dist/custom-objects/generated/proto/vendor/publicapi/redaction_enum.pb.d.ts.map +1 -0
  84. package/dist/custom-objects/generated/proto/vendor/publicapi/region_routers.pb.d.ts +103 -0
  85. package/dist/custom-objects/generated/proto/vendor/publicapi/region_routers.pb.d.ts.map +1 -0
  86. package/dist/custom-objects/generated/proto/vendor/publicapi/rollout_configs.pb.d.ts +153 -0
  87. package/dist/custom-objects/generated/proto/vendor/publicapi/rollout_configs.pb.d.ts.map +1 -0
  88. package/dist/custom-objects/generated/proto/vendor/publicapi/v2ext.pb.d.ts +1111 -0
  89. package/dist/custom-objects/generated/proto/vendor/publicapi/v2ext.pb.d.ts.map +1 -0
  90. package/dist/custom-objects/generated/proto/vendor/vext/annotations.pb.d.ts +602 -0
  91. package/dist/custom-objects/generated/proto/vendor/vext/annotations.pb.d.ts.map +1 -0
  92. package/dist/custom-objects/generated/proto/vendor/vext/extensions.pb.d.ts +144 -0
  93. package/dist/custom-objects/generated/proto/vendor/vext/extensions.pb.d.ts.map +1 -0
  94. package/dist/custom-objects/generated/proto/vendor/vext/privacy_unified_annotations.pb.d.ts +851 -0
  95. package/dist/custom-objects/generated/proto/vendor/vext/privacy_unified_annotations.pb.d.ts.map +1 -0
  96. package/dist/custom-objects/generated/proto/vendor/vext/xml_annotations.pb.d.ts +125 -0
  97. package/dist/custom-objects/generated/proto/vendor/vext/xml_annotations.pb.d.ts.map +1 -0
  98. package/dist/custom-objects/to-proto-json.d.ts +17 -0
  99. package/dist/custom-objects/to-proto-json.d.ts.map +1 -0
  100. package/dist/dependencies/index.cjs +601 -0
  101. package/dist/dependencies/index.d.ts +320 -0
  102. package/dist/dependencies/index.d.ts.map +1 -0
  103. package/dist/dependencies/index.js +560 -0
  104. package/dist/extensibility-dev-tools-alpha.d.ts +199 -0
  105. package/dist/extensibility-dev-tools-beta.d.ts +199 -0
  106. package/dist/extensibility-dev-tools-dependencies-alpha.d.ts +51 -0
  107. package/dist/extensibility-dev-tools-dependencies-beta.d.ts +51 -0
  108. package/dist/extensibility-dev-tools-dependencies-internal.d.ts +372 -0
  109. package/dist/extensibility-dev-tools-dependencies-public.d.ts +51 -0
  110. package/dist/extensibility-dev-tools-internal.d.ts +1722 -0
  111. package/dist/extensibility-dev-tools-jsonschema-tools-alpha.d.ts +57 -0
  112. package/dist/extensibility-dev-tools-jsonschema-tools-beta.d.ts +57 -0
  113. package/dist/extensibility-dev-tools-jsonschema-tools-internal.d.ts +123 -0
  114. package/dist/extensibility-dev-tools-jsonschema-tools-public.d.ts +57 -0
  115. package/dist/extensibility-dev-tools-manifest-alpha.d.ts +31 -0
  116. package/dist/extensibility-dev-tools-manifest-beta.d.ts +31 -0
  117. package/dist/extensibility-dev-tools-manifest-internal.d.ts +461 -0
  118. package/dist/extensibility-dev-tools-manifest-public.d.ts +31 -0
  119. package/dist/extensibility-dev-tools-public.d.ts +199 -0
  120. package/dist/extensibility-dev-tools-schemas-alpha.d.ts +9 -0
  121. package/dist/extensibility-dev-tools-schemas-beta.d.ts +9 -0
  122. package/dist/extensibility-dev-tools-schemas-internal.d.ts +41 -0
  123. package/dist/extensibility-dev-tools-schemas-public.d.ts +9 -0
  124. package/dist/extensibility-dev-tools-templates-alpha.d.ts +67 -0
  125. package/dist/extensibility-dev-tools-templates-beta.d.ts +67 -0
  126. package/dist/extensibility-dev-tools-templates-internal.d.ts +554 -0
  127. package/dist/extensibility-dev-tools-templates-public.d.ts +67 -0
  128. package/dist/extensibility-dev-tools-workspace-alpha.d.ts +51 -0
  129. package/dist/extensibility-dev-tools-workspace-beta.d.ts +51 -0
  130. package/dist/extensibility-dev-tools-workspace-internal.d.ts +410 -0
  131. package/dist/extensibility-dev-tools-workspace-public.d.ts +51 -0
  132. package/dist/index.cjs +3810 -0
  133. package/dist/index.d.ts +18 -0
  134. package/dist/index.d.ts.map +1 -0
  135. package/dist/index.js +3758 -0
  136. package/dist/jsonschema-tools.cjs +20451 -0
  137. package/dist/jsonschema-tools.d.ts +98 -0
  138. package/dist/jsonschema-tools.d.ts.map +1 -0
  139. package/dist/jsonschema-tools.js +20404 -0
  140. package/dist/manifest/index.cjs +610 -0
  141. package/dist/manifest/index.d.ts +8 -0
  142. package/dist/manifest/index.d.ts.map +1 -0
  143. package/dist/manifest/index.js +571 -0
  144. package/dist/manifest/manifest-v1.d.ts +102 -0
  145. package/dist/manifest/manifest-v1.d.ts.map +1 -0
  146. package/dist/manifest/manifest-v2.d.ts +253 -0
  147. package/dist/manifest/manifest-v2.d.ts.map +1 -0
  148. package/dist/manifest/stripe-app-manifest.d.ts +114 -0
  149. package/dist/manifest/stripe-app-manifest.d.ts.map +1 -0
  150. package/dist/schemas/index.cjs +20692 -0
  151. package/dist/schemas/index.d.ts +37 -0
  152. package/dist/schemas/index.d.ts.map +1 -0
  153. package/dist/schemas/index.js +20656 -0
  154. package/dist/templates/diff-viewer/diff-generator.d.ts +22 -0
  155. package/dist/templates/diff-viewer/diff-generator.d.ts.map +1 -0
  156. package/dist/templates/diff-viewer/diff-prompt.d.ts +13 -0
  157. package/dist/templates/diff-viewer/diff-prompt.d.ts.map +1 -0
  158. package/dist/templates/diff-viewer/index.d.ts +7 -0
  159. package/dist/templates/diff-viewer/index.d.ts.map +1 -0
  160. package/dist/templates/diff-viewer/terminal-renderer.d.ts +29 -0
  161. package/dist/templates/diff-viewer/terminal-renderer.d.ts.map +1 -0
  162. package/dist/templates/diff-viewer/types.d.ts +58 -0
  163. package/dist/templates/diff-viewer/types.d.ts.map +1 -0
  164. package/dist/templates/extensions/base.d.ts +23 -0
  165. package/dist/templates/extensions/base.d.ts.map +1 -0
  166. package/dist/templates/extensions/billing.bill.discount_calculation.d.ts +6 -0
  167. package/dist/templates/extensions/billing.bill.discount_calculation.d.ts.map +1 -0
  168. package/dist/templates/extensions/billing.customer_balance_application.d.ts +6 -0
  169. package/dist/templates/extensions/billing.customer_balance_application.d.ts.map +1 -0
  170. package/dist/templates/extensions/billing.invoice_collection_setting.d.ts +6 -0
  171. package/dist/templates/extensions/billing.invoice_collection_setting.d.ts.map +1 -0
  172. package/dist/templates/extensions/billing.prorations.d.ts +6 -0
  173. package/dist/templates/extensions/billing.prorations.d.ts.map +1 -0
  174. package/dist/templates/extensions/billing.recurring_billing_item_handling.d.ts +6 -0
  175. package/dist/templates/extensions/billing.recurring_billing_item_handling.d.ts.map +1 -0
  176. package/dist/templates/extensions/core.workflows.custom_action.d.ts +6 -0
  177. package/dist/templates/extensions/core.workflows.custom_action.d.ts.map +1 -0
  178. package/dist/templates/extensions/extend.objects.custom_objects.d.ts +6 -0
  179. package/dist/templates/extensions/extend.objects.custom_objects.d.ts.map +1 -0
  180. package/dist/templates/extensions/extend.workflows.custom_action.d.ts +6 -0
  181. package/dist/templates/extensions/extend.workflows.custom_action.d.ts.map +1 -0
  182. package/dist/templates/extensions/index.d.ts +13 -0
  183. package/dist/templates/extensions/index.d.ts.map +1 -0
  184. package/dist/templates/extensions/registry.d.ts +10 -0
  185. package/dist/templates/extensions/registry.d.ts.map +1 -0
  186. package/dist/templates/extensions/types.d.ts +104 -0
  187. package/dist/templates/extensions/types.d.ts.map +1 -0
  188. package/dist/templates/file-writer.d.ts +140 -0
  189. package/dist/templates/file-writer.d.ts.map +1 -0
  190. package/dist/templates/fs/_impl.d.ts +29 -0
  191. package/dist/templates/fs/_impl.d.ts.map +1 -0
  192. package/dist/templates/fs/filesystem.d.ts +8 -0
  193. package/dist/templates/fs/filesystem.d.ts.map +1 -0
  194. package/dist/templates/fs/in-memory.d.ts +9 -0
  195. package/dist/templates/fs/in-memory.d.ts.map +1 -0
  196. package/dist/templates/fs/index.d.ts +25 -0
  197. package/dist/templates/fs/index.d.ts.map +1 -0
  198. package/dist/templates/fs-utils.d.ts +17 -0
  199. package/dist/templates/fs-utils.d.ts.map +1 -0
  200. package/dist/templates/index.cjs +2248 -0
  201. package/dist/templates/index.d.ts +32 -0
  202. package/dist/templates/index.d.ts.map +1 -0
  203. package/dist/templates/index.js +2203 -0
  204. package/dist/templates/root/index.d.ts +60 -0
  205. package/dist/templates/root/index.d.ts.map +1 -0
  206. package/dist/templates/simple-templates.d.ts +8 -0
  207. package/dist/templates/simple-templates.d.ts.map +1 -0
  208. package/dist/templates/template-manager.d.ts +8 -0
  209. package/dist/templates/template-manager.d.ts.map +1 -0
  210. package/dist/templates/types.d.ts +9 -0
  211. package/dist/templates/types.d.ts.map +1 -0
  212. package/dist/tsconfig.build.tsbuildinfo +1 -0
  213. package/dist/workspace/index.cjs +3756 -0
  214. package/dist/workspace/index.d.ts +336 -0
  215. package/dist/workspace/index.d.ts.map +1 -0
  216. package/dist/workspace/index.js +3731 -0
  217. package/package.json +137 -0
  218. package/templates/extensions/billing.bill.discount_calculation/index.test.ts +15 -0
  219. package/templates/extensions/billing.bill.discount_calculation/index.ts +20 -0
  220. package/templates/extensions/billing.customer_balance_application/index.test.ts +15 -0
  221. package/templates/extensions/billing.customer_balance_application/index.ts +18 -0
  222. package/templates/extensions/billing.invoice_collection_setting/index.test.ts +15 -0
  223. package/templates/extensions/billing.invoice_collection_setting/index.ts +16 -0
  224. package/templates/extensions/billing.prorations/index.test.ts +15 -0
  225. package/templates/extensions/billing.prorations/index.ts +18 -0
  226. package/templates/extensions/billing.recurring_billing_item_handling/index.test.ts +15 -0
  227. package/templates/extensions/billing.recurring_billing_item_handling/index.ts +42 -0
  228. package/templates/extensions/common/.prettierignore +3 -0
  229. package/templates/extensions/common/eslint.config.mts.mustache +95 -0
  230. package/templates/extensions/common/package.json.mustache +26 -0
  231. package/templates/extensions/common/tsconfig.build.json.mustache +15 -0
  232. package/templates/extensions/common/tsconfig.json.mustache +16 -0
  233. package/templates/extensions/core.workflows.custom_action/custom_input.schema.json +6 -0
  234. package/templates/extensions/core.workflows.custom_action/index.test.ts +15 -0
  235. package/templates/extensions/core.workflows.custom_action/index.ts +31 -0
  236. package/templates/extensions/extend.workflows.custom_action/custom_input.schema.json +6 -0
  237. package/templates/extensions/extend.workflows.custom_action/index.test.ts +15 -0
  238. package/templates/extensions/extend.workflows.custom_action/index.ts +31 -0
  239. package/templates/root/.husky/pre-commit +1 -0
  240. package/templates/root/.prettierignore +5 -0
  241. package/templates/root/.prettierrc +7 -0
  242. package/templates/root/_gitignore +28 -0
  243. package/templates/root/custom-objects/package.json +20 -0
  244. package/templates/root/custom-objects/tsconfig.json +9 -0
  245. package/templates/root/eslint.config.mts +95 -0
  246. package/templates/root/package.json.mustache +32 -0
  247. package/templates/root/pnpm-workspace.yaml +7 -0
  248. package/templates/root/stripe-app.yaml.mustache +6 -0
  249. package/templates/root/tools/test.mts +38 -0
  250. package/templates/root/tsconfig.base.json +23 -0
  251. package/templates/root/tsconfig.json +15 -0
  252. package/templates/root/ui/package.json +17 -0
  253. package/templates/root/vitest.config.mts +47 -0
@@ -0,0 +1,320 @@
1
+ /**
2
+ * Dependencies module for installing and tracking dependencies
3
+ *
4
+ * This module handles the installation and tracking of dependencies required by generated code:
5
+ * - npm dependencies (added to package.json dependencies)
6
+ * - dev npm dependencies (added to package.json devDependencies)
7
+ * - Stripe CLI plugin dependencies (checks if installed, can auto-install)
8
+ *
9
+ * @deprecated NOT FOR EXTERNAL USE. This subpath is Stripe-internal and will be removed in a future release. External consumers must not depend on it.
10
+ * @internal
11
+ */
12
+ import { type _CliContext } from '@stripe/extensibility-tool-utils';
13
+ /**
14
+ * A runtime npm dependency to add to `dependencies` in package.json.
15
+ * @internal
16
+ */
17
+ export interface _NpmDependency {
18
+ /** Discriminant tag identifying this as a runtime npm dependency. */
19
+ type: 'npm';
20
+ /** npm package name. */
21
+ name: string;
22
+ /** Semver version range. */
23
+ version: string;
24
+ }
25
+ /**
26
+ * A dev npm dependency to add to `devDependencies` in package.json.
27
+ * @internal
28
+ */
29
+ export interface _DevNpmDependency {
30
+ /** Discriminant tag identifying this as a dev npm dependency. */
31
+ type: 'dev-npm';
32
+ /** npm package name. */
33
+ name: string;
34
+ /** Semver version range. */
35
+ version: string;
36
+ }
37
+ /**
38
+ * A Stripe CLI plugin dependency that must be installed via `stripe plugin install`.
39
+ * @internal
40
+ */
41
+ export interface _StripeCliPluginDependency {
42
+ /** Discriminant tag identifying this as a Stripe CLI plugin dependency. */
43
+ type: 'stripe-cli-plugin';
44
+ /** Plugin shortname (e.g., `extensibility`). */
45
+ name: string;
46
+ /** Minimum required semver version of the plugin. */
47
+ minVersion?: string;
48
+ }
49
+ /**
50
+ * A dependency that the workspace needs: npm runtime, npm dev, or Stripe CLI plugin.
51
+ * @internal
52
+ */
53
+ export type _Dependency = _NpmDependency | _DevNpmDependency | _StripeCliPluginDependency;
54
+ /**
55
+ * Create a runtime npm dependency descriptor.
56
+ * @internal
57
+ */
58
+ export declare function _npmDep(name: string, version: string): _NpmDependency;
59
+ /**
60
+ * Create a dev npm dependency descriptor.
61
+ * @internal
62
+ */
63
+ export declare function _devNpmDep(name: string, version: string): _DevNpmDependency;
64
+ /**
65
+ * Create a Stripe CLI plugin dependency descriptor.
66
+ * @internal
67
+ */
68
+ export declare function _stripeCliPluginDep(name: string, minVersion?: string): _StripeCliPluginDependency;
69
+ /**
70
+ * Result of checking whether a dependency is satisfied.
71
+ * @internal
72
+ */
73
+ export interface _CheckResult {
74
+ /** Whether the dependency requirement is currently satisfied. */
75
+ satisfied: boolean;
76
+ /** The currently installed version, if any. */
77
+ currentVersion?: string;
78
+ /** Human-readable message describing the check result. */
79
+ message: string;
80
+ }
81
+ /**
82
+ * Result of checking whether a dependency version conflicts with an existing installation.
83
+ * @internal
84
+ */
85
+ export interface _ConflictResult {
86
+ /** Whether a version conflict exists. */
87
+ hasConflict: boolean;
88
+ /** The version currently installed, if any. */
89
+ existingVersion?: string;
90
+ /** The version being requested, if applicable. */
91
+ requestedVersion?: string;
92
+ /** Human-readable message describing the conflict, if any. */
93
+ message?: string;
94
+ }
95
+ /**
96
+ * The action to take for a dependency: add new, update existing, no-op, or flag a conflict.
97
+ * @internal
98
+ */
99
+ export type _DependencyAction = 'add' | 'update' | 'already-satisfied' | 'conflict';
100
+ /**
101
+ * A pending dependency change accumulated by the dependency manager before commit.
102
+ * @internal
103
+ */
104
+ export interface _PendingChange {
105
+ /** The dependency this change applies to. */
106
+ dependency: _Dependency;
107
+ /** The action that will be taken for this dependency. */
108
+ action: _DependencyAction;
109
+ /** Human-readable message describing the pending change. */
110
+ message: string;
111
+ /** The previously installed version, if an update is involved. */
112
+ previousVersion?: string;
113
+ /** Conflict details when action is 'conflict'. */
114
+ conflict?: _ConflictResult;
115
+ /** Whether conflict has been resolved (force install) */
116
+ conflictResolved?: boolean;
117
+ }
118
+ /**
119
+ * Input for requesting dependency installation.
120
+ * @internal
121
+ */
122
+ export interface _EnsureDependenciesInput {
123
+ /** Dependencies that must be present. */
124
+ required: _Dependency[];
125
+ /** Dependencies that are preferred but not required. */
126
+ optional?: _Dependency[];
127
+ }
128
+ /**
129
+ * Options for committing accumulated dependency changes.
130
+ * @internal
131
+ */
132
+ export interface _CommitOptions {
133
+ /** If true, run package manager install for npm deps. Default: true */
134
+ runInstall?: boolean;
135
+ }
136
+ /**
137
+ * Summary of changes applied by a dependency manager commit.
138
+ * @internal
139
+ */
140
+ export interface _CommitResult {
141
+ /** Number of new dependencies added. */
142
+ added: number;
143
+ /** Number of existing dependencies updated. */
144
+ updated: number;
145
+ }
146
+ /**
147
+ * Package manager detected in the workspace.
148
+ * @internal
149
+ */
150
+ export type _PackageManager = 'pnpm' | 'yarn' | 'npm';
151
+ /**
152
+ * Detect the package manager used in the workspace by looking for lockfiles.
153
+ * @internal
154
+ */
155
+ export declare function _detectPackageManager(cwd: string): _PackageManager;
156
+ /**
157
+ * Handler interface for a specific dependency type (npm or Stripe CLI plugin).
158
+ * @internal
159
+ */
160
+ export interface _DependencyHandler<T extends _Dependency> {
161
+ /** Check if dependency is satisfied */
162
+ check(dep: T): Promise<_CheckResult>;
163
+ /** Check for conflicts with existing state */
164
+ checkConflict(dep: T): Promise<_ConflictResult>;
165
+ /** Add the dependency (update package.json for npm, noop for stripe cli) */
166
+ add(dep: T): Promise<{
167
+ action: 'add' | 'update';
168
+ message: string;
169
+ }>;
170
+ /** Run actual install (npm install for npm deps, stripe plugin install for cli) */
171
+ install(deps: T[]): Promise<void>;
172
+ }
173
+ /**
174
+ * Options for constructing an npm dependency handler.
175
+ * @internal
176
+ */
177
+ export interface _NpmHandlerOptions {
178
+ /** Working directory containing the target package.json. */
179
+ cwd: string;
180
+ /** Whether to suppress console output. */
181
+ quiet: boolean;
182
+ /** If true, manage devDependencies; otherwise manage dependencies. */
183
+ devDependencies?: boolean;
184
+ /** CLI context for user-facing output. */
185
+ context?: _CliContext;
186
+ }
187
+ /**
188
+ * Handles npm and dev-npm dependency installation via package.json updates.
189
+ * @internal
190
+ */
191
+ export declare class _NpmDependencyHandler implements _DependencyHandler<_NpmDependency | _DevNpmDependency> {
192
+ private readonly cwd;
193
+ private readonly quiet;
194
+ private readonly devDependencies;
195
+ private readonly context;
196
+ constructor(options: _NpmHandlerOptions);
197
+ private get dependencyKey();
198
+ private get dependencyLabel();
199
+ /** Check whether the npm dependency is already present in package.json. */
200
+ check(dep: _NpmDependency | _DevNpmDependency): Promise<_CheckResult>;
201
+ /** Check whether the requested version conflicts with the currently installed version. */
202
+ checkConflict(dep: _NpmDependency | _DevNpmDependency): Promise<_ConflictResult>;
203
+ /** Add or update the npm dependency in package.json. */
204
+ add(dep: _NpmDependency | _DevNpmDependency): Promise<{
205
+ action: 'add' | 'update';
206
+ message: string;
207
+ }>;
208
+ /** Run the package manager install command in the working directory. */
209
+ install(_deps: (_NpmDependency | _DevNpmDependency)[]): Promise<void>;
210
+ private versionsCompatible;
211
+ private extractMajorVersion;
212
+ }
213
+ /**
214
+ * Options for constructing a Stripe CLI plugin dependency handler.
215
+ * @internal
216
+ */
217
+ export interface _StripeCliPluginHandlerOptions {
218
+ /** Path to the Stripe CLI config directory (e.g., `~/.config/stripe`). */
219
+ stripeConfigDir: string;
220
+ /** Whether to suppress console output. */
221
+ quiet: boolean;
222
+ /** CLI context for user-facing output. */
223
+ context?: _CliContext;
224
+ }
225
+ /**
226
+ * Handles Stripe CLI plugin installation via `stripe plugin install`.
227
+ * @internal
228
+ */
229
+ export declare class _StripeCliPluginHandler implements _DependencyHandler<_StripeCliPluginDependency> {
230
+ private readonly stripeConfigDir;
231
+ private readonly quiet;
232
+ private readonly context;
233
+ constructor(options: _StripeCliPluginHandlerOptions);
234
+ /** Check whether the Stripe CLI plugin is installed and meets the minimum version. */
235
+ check(dep: _StripeCliPluginDependency): Promise<_CheckResult>;
236
+ /** Check whether the installed plugin version conflicts with the requested minimum. */
237
+ checkConflict(dep: _StripeCliPluginDependency): Promise<_ConflictResult>;
238
+ /** Stage a Stripe CLI plugin for installation; the actual install happens in `install`. */
239
+ add(dep: _StripeCliPluginDependency): Promise<{
240
+ action: 'add' | 'update';
241
+ message: string;
242
+ }>;
243
+ /** Install Stripe CLI plugins using `stripe plugin install`. */
244
+ install(deps: _StripeCliPluginDependency[]): Promise<void>;
245
+ private findPluginInToml;
246
+ /**
247
+ * Check if installed version satisfies the required minimum version.
248
+ *
249
+ * Permissive policy: Non-semver versions (e.g., "local.build.dev", "dev", "canary-abc123")
250
+ * always satisfy version requirements. This avoids forcing upgrades during local development
251
+ * when developers are using locally built plugins.
252
+ *
253
+ * For valid semver versions, uses the semver library for proper semantic version comparison.
254
+ *
255
+ * @param installed - The installed version string
256
+ * @param required - The required minimum version string
257
+ * @returns true if installed version satisfies requirement
258
+ */
259
+ private isVersionSatisfied;
260
+ }
261
+ /**
262
+ * Options for constructing a dependency manager.
263
+ * @internal
264
+ */
265
+ export interface _DependencyManagerOptions {
266
+ /** Working directory (defaults to process.cwd()) */
267
+ cwd?: string;
268
+ /** Path to Stripe config directory (defaults to ~/.config/stripe) */
269
+ stripeConfigDir?: string;
270
+ /** Whether to suppress console output */
271
+ quiet?: boolean;
272
+ /** CLI context for user-facing output */
273
+ context?: _CliContext;
274
+ }
275
+ /**
276
+ * Orchestrates dependency analysis and installation across all dependency types.
277
+ * @internal
278
+ */
279
+ export declare class _DependencyManager {
280
+ private readonly cwd;
281
+ private readonly stripeConfigDir;
282
+ private readonly quiet;
283
+ private readonly context;
284
+ private readonly npmHandler;
285
+ private readonly devNpmHandler;
286
+ private readonly stripeCliPluginHandler;
287
+ /** Internal state: pending changes indexed by dependency key */
288
+ private pendingChanges;
289
+ /** Whether commit() has been called */
290
+ private committed;
291
+ constructor(options?: _DependencyManagerOptions);
292
+ /**
293
+ * Analyze dependencies and accumulate changes.
294
+ * Can be called multiple times before commit().
295
+ * Returns the changes for this specific call.
296
+ */
297
+ ensureDependencies(input: _EnsureDependenciesInput): Promise<_PendingChange[]>;
298
+ /**
299
+ * Resolve a conflict by marking it for force install.
300
+ * Throws if the dependency is not in conflict state.
301
+ */
302
+ resolveConflict(dep: _Dependency): void;
303
+ /**
304
+ * Get all pending changes (accumulated across all ensureDependencies calls).
305
+ */
306
+ getPendingChanges(): _PendingChange[];
307
+ /**
308
+ * Commit all accumulated changes.
309
+ * - For npm deps: updates package.json, optionally runs package manager install
310
+ * - For Stripe CLI deps: always installs (no separate add step)
311
+ *
312
+ * @param options - Commit options. `options.runInstall`: if true, run package manager install for npm deps (default: true)
313
+ * @returns Summary of changes made
314
+ * @throws If called more than once
315
+ */
316
+ commit(options?: _CommitOptions): Promise<_CommitResult>;
317
+ private analyzeDependency;
318
+ private getHandler;
319
+ }
320
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1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