@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,253 @@
1
+ /**
2
+ * Custom object definition (internal representation with separate fields)
3
+ * @internal
4
+ */
5
+ export interface _CustomObjectDefinition {
6
+ /** Object identifier (e.g., "device", "loyalty_card") */
7
+ id: string;
8
+ /** Specification type (e.g., "typescript") */
9
+ type: string;
10
+ /** Path to the definition file */
11
+ path: string;
12
+ /** Export name derived from id via PascalCase (e.g., "Device", "LoyaltyCard") */
13
+ name: string;
14
+ }
15
+ /**
16
+ * Custom object definition as stored in YAML (nested under definitions).
17
+ *
18
+ * `id` is the source of truth for identity. The export name used at build time
19
+ * is derived via `_toPascalCase(id)`, so `id` must be valid snake_case that
20
+ * round-trips cleanly (e.g., `device`, `loyalty_card`, `http_request`).
21
+ * Consecutive-uppercase class names like `MyHTTPClient` are NOT round-trip safe
22
+ * (`my_http_client` → `MyHttpClient`). A future `export_name` field may address
23
+ * this; for now, avoid ids that would produce ambiguous PascalCase names.
24
+ *
25
+ * @example
26
+ * ```yaml
27
+ * custom_object_definitions:
28
+ * definitions:
29
+ * - id: device
30
+ * specification:
31
+ * type: typescript
32
+ * content: src/device.object.ts
33
+ * ```
34
+ *
35
+ * @internal
36
+ */
37
+ export interface _CustomObjectDefinitionYaml {
38
+ /** Object identifier (e.g., `device`, `loyalty_card`). */
39
+ id: string;
40
+ /** Specification describing the type and source file for the definition. */
41
+ specification: {
42
+ type: string;
43
+ content: string;
44
+ };
45
+ }
46
+ /**
47
+ * Wrapper for custom_object_definitions in the manifest.
48
+ * @internal
49
+ */
50
+ export interface _CustomObjectDefinitionsBlock {
51
+ /** List of custom object definition entries. */
52
+ definitions?: _CustomObjectDefinitionYaml[];
53
+ }
54
+ /**
55
+ * A reference to a schema file in the project (type + relative path).
56
+ *
57
+ * Note: stripe-cli-apps-plugin is the authoritative representation of the
58
+ * Stripe App manifest. Types here are a best-effort mirror.
59
+ * @internal
60
+ */
61
+ export interface _SchemaReference {
62
+ /** The schema format. */
63
+ type: 'json_schema' | 'jsonforms';
64
+ /** Relative path to the schema file. Named `content` to match the manifest field. */
65
+ content: string;
66
+ }
67
+ /**
68
+ * Authentication configuration for an endpoint.
69
+ * @internal
70
+ */
71
+ export interface _EndpointAuth {
72
+ /** The type of authentication. */
73
+ type: 'bearer_token' | 'header';
74
+ /** The name of the secret containing the authentication credential. */
75
+ secret_name: string;
76
+ /** The name of the header to use for authentication (required when type is 'header'). */
77
+ header_name?: string;
78
+ }
79
+ /**
80
+ * Configuration for a single endpoint environment (live, test, managed_sandbox).
81
+ * @internal
82
+ */
83
+ export interface _EndpointDefinition {
84
+ /** The HTTPS URL of the endpoint. */
85
+ url?: string;
86
+ /** The purpose of the endpoint. */
87
+ purpose?: string;
88
+ /** Authentication configuration. */
89
+ auth?: _EndpointAuth;
90
+ }
91
+ /**
92
+ * Extension configuration schemas (JSON Schema for validation, UI Schema for rendering).
93
+ * @internal
94
+ */
95
+ export interface _ExtensionConfiguration {
96
+ /** JSON Schema file for validating extension configuration. */
97
+ input_schema: _SchemaReference;
98
+ /** UI Schema file for rendering the configuration form. */
99
+ ui_schema: _SchemaReference;
100
+ }
101
+ /**
102
+ * Extension configuration for stripe-app.yaml
103
+ * @internal
104
+ */
105
+ export interface _ExtensionConfig {
106
+ /** Extension identifier (e.g., `username.my-ext`). */
107
+ id: string;
108
+ /** Human-readable extension name. */
109
+ name: string;
110
+ /** Extension interface ID (e.g., `com.stripe.billing.bill`). */
111
+ interface_id: string;
112
+ /** Extension version string. */
113
+ version: string;
114
+ /** Developer-defined description for the extension (max 300 chars). */
115
+ description?: string;
116
+ /** Stripe API version to use for this extension (e.g., `2024-06-05`). */
117
+ stripe_version?: string;
118
+ /** Entry point script path, used by legacy script format. */
119
+ script_entry_point?: string;
120
+ /** Inline script definition (type + content path). */
121
+ script?: {
122
+ type: string;
123
+ content: string;
124
+ };
125
+ /** Required permissions for the extension. */
126
+ permissions: string[];
127
+ /** Method implementations keyed by method name. */
128
+ methods: Record<string, unknown>;
129
+ /** Optional configuration schemas for the extension. */
130
+ configuration?: _ExtensionConfiguration;
131
+ /** Remote function endpoints for the extension. */
132
+ endpoints?: {
133
+ /** The unique identifier for the endpoint. */
134
+ id: string;
135
+ /** The type of endpoint. */
136
+ type: 'remote_function' | 'custom_http';
137
+ /** Configuration for the live environment. */
138
+ live?: _EndpointDefinition;
139
+ /** Configuration for the managed sandbox environment. */
140
+ managed_sandbox?: _EndpointDefinition;
141
+ /** Configuration for the test environment. */
142
+ test?: _EndpointDefinition;
143
+ }[];
144
+ }
145
+ /**
146
+ * V2 manifest structure (stripe-app.yaml)
147
+ * @internal
148
+ */
149
+ export interface _ManifestV2Data {
150
+ /** The app identifier. */
151
+ id: string;
152
+ /** The app display name. */
153
+ name: string;
154
+ /** The app version string. */
155
+ version: string;
156
+ /** Registered extension configurations. */
157
+ extensions?: _ExtensionConfig[];
158
+ /** Custom object definitions block. */
159
+ custom_object_definitions?: _CustomObjectDefinitionsBlock;
160
+ /** Additional manifest fields. */
161
+ [key: string]: unknown;
162
+ }
163
+ /**
164
+ * Manages stripe-app.yaml (V2) manifest file operations
165
+ *
166
+ * Capabilities:
167
+ * - Extensions (add, update, get)
168
+ * - App metadata (id, name)
169
+ *
170
+ * @example
171
+ * ```ts
172
+ * const manifest = await _ManifestV2.load('./stripe-app.yaml')
173
+ * manifest.addOrUpdateExtension({
174
+ * id: 'username.my-ext',
175
+ * name: 'my-ext',
176
+ * interfaceId: 'com.stripe.test',
177
+ * version: '0.0.1',
178
+ * scriptEntryPoint: 'scripts/my-ext/index.ts',
179
+ * permissions: [],
180
+ * methods: { my_run: { implementation_type: 'script' } }
181
+ * })
182
+ * await manifest.save()
183
+ * ```
184
+ * @internal
185
+ */
186
+ export declare class _ManifestV2 {
187
+ private readonly filePath;
188
+ private data;
189
+ private constructor();
190
+ /**
191
+ * Load stripe-app.yaml from disk
192
+ * @param filePath - Path to stripe-app.yaml
193
+ * @throws Error if file is invalid or cannot be read
194
+ */
195
+ static load(filePath: string): Promise<_ManifestV2>;
196
+ /**
197
+ * Get the app ID from the manifest
198
+ */
199
+ getAppId(): string | undefined;
200
+ /**
201
+ * Get the app name from the manifest
202
+ */
203
+ getAppName(): string | undefined;
204
+ /**
205
+ * Get all custom object definitions, parsed into internal format.
206
+ * Entries are guaranteed structurally valid by load-time validation.
207
+ */
208
+ getCustomObjects(): _CustomObjectDefinition[];
209
+ /**
210
+ * Check if a custom object exists by id
211
+ */
212
+ hasCustomObject(id: string): boolean;
213
+ /**
214
+ * Add a custom object definition.
215
+ *
216
+ * Identity is keyed on `id` alone. The export name is derived via
217
+ * `_toPascalCase(id)` at read time, so `id` should be valid snake_case
218
+ * (e.g., "device", "loyalty_card", "http_request").
219
+ *
220
+ * @param id - Object identifier (e.g., "device", "loyalty_card")
221
+ * @param content - Path to the definition file (e.g., "src/device.object.ts")
222
+ * @param type - Specification type, defaults to "typescript"
223
+ * @returns true if added, false if already exists
224
+ */
225
+ addCustomObject(id: string, content: string, type?: string): boolean;
226
+ /**
227
+ * Remove a custom object definition by id
228
+ * @param id - Object identifier to remove
229
+ * @returns true if removed, false if not found
230
+ */
231
+ removeCustomObject(id: string): boolean;
232
+ /**
233
+ * Add a new extension or update an existing one by ID
234
+ * If an extension with the provided ID exists, it will be replaced entirely
235
+ * @param extension - Extension configuration with all required fields including id
236
+ * @returns The extension ID
237
+ */
238
+ addOrUpdateExtension(extension: _ExtensionConfig): string;
239
+ /**
240
+ * Get a read-only view of all extensions
241
+ */
242
+ getExtensions(): readonly Readonly<_ExtensionConfig>[];
243
+ /**
244
+ * Get the raw manifest data (for reading other fields)
245
+ */
246
+ getRawData(): Readonly<_ManifestV2Data>;
247
+ /**
248
+ * Save changes back to disk
249
+ * @throws Error if file cannot be written
250
+ */
251
+ save(): Promise<void>;
252
+ }
253
+ //# sourceMappingURL=manifest-v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-v2.d.ts","sourceRoot":"","sources":["../../src/manifest/manifest-v2.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,2BAA2B;IAC1C,0DAA0D;IAC1D,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;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AS;IAQhC;;;OAGG;IACH,gBAAgB,IAAI,uBAAuB,EAAE;IAc7C;;OAEG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAMpC;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,SAAe,GAAG,OAAO;IAe1E;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAsBvC;;;;;OAKG;IACH,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM;IA6CzD;;OAEG;IACH,aAAa,IAAI,SAAS,QAAQ,CAAC,gBAAgB,CAAC,EAAE;IAItD;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,eAAe,CAAC;IAIvC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAW5B"}
@@ -0,0 +1,114 @@
1
+ import type { _CustomObjectEntry } from './manifest-v1.js';
2
+ import type { _ExtensionConfig } from './manifest-v2.js';
3
+ /**
4
+ * Manifest version types
5
+ * @internal
6
+ */
7
+ export type _ManifestVersion = 'v1' | 'v2';
8
+ /**
9
+ * Unified interface for Stripe App manifest operations.
10
+ *
11
+ * This class provides an abstraction over both V1 (stripe-app.json) and V2 (stripe-app.yaml)
12
+ * manifest formats, automatically detecting the version and delegating to the appropriate reader.
13
+ *
14
+ * Capabilities by version:
15
+ * - V1 (JSON): Custom objects, app metadata
16
+ * - V2 (YAML): Extensions, custom objects, app metadata
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const manifest = await _StripeAppManifest.load('./stripe-app.yaml')
21
+ * manifest.addOrUpdateExtension({ ... })
22
+ * await manifest.save()
23
+ * ```
24
+ * @internal
25
+ */
26
+ export declare class _StripeAppManifest {
27
+ private readonly manifestPath;
28
+ private readonly version;
29
+ private readonly v1;
30
+ private readonly v2;
31
+ private constructor();
32
+ /**
33
+ * Load a manifest file, automatically detecting the version.
34
+ * @param manifestPath - Path to stripe-app.json or stripe-app.yaml
35
+ * @returns Loaded manifest instance
36
+ */
37
+ static load(manifestPath: string): Promise<_StripeAppManifest>;
38
+ /**
39
+ * Detect manifest version from file path.
40
+ * TODO: Add content-based detection if needed.
41
+ */
42
+ private static detectVersion;
43
+ /**
44
+ * Get the detected manifest version
45
+ */
46
+ getVersion(): _ManifestVersion;
47
+ /**
48
+ * Get the manifest file path
49
+ */
50
+ getManifestPath(): string;
51
+ /**
52
+ * Get the app ID from the manifest
53
+ */
54
+ getAppId(): string | undefined;
55
+ /**
56
+ * Get the app name from the manifest
57
+ */
58
+ getAppName(): string | undefined;
59
+ /**
60
+ * Get all custom objects from the manifest
61
+ */
62
+ getCustomObjects(): _CustomObjectEntry[];
63
+ /**
64
+ * Check if a custom object entry exists in the manifest.
65
+ *
66
+ * **V2 note:** Identity is keyed on `_toSnakeCase(className)` alone — `filePath`
67
+ * is not considered. Two entries with the same class name but different file
68
+ * paths are treated as the same object. The `_toSnakeCase` → `_toPascalCase`
69
+ * round-trip is lossless for typical class names but lossy for consecutive
70
+ * uppercase (e.g., `HTTPClient` → `http_client` → `HttpClient`). The manifest
71
+ * `id` field is the source of truth; see `_CustomObjectDefinitionYaml` docs.
72
+ */
73
+ hasCustomObject(entry: _CustomObjectEntry): boolean;
74
+ /**
75
+ * Add a custom object entry to the manifest.
76
+ *
77
+ * **V2 note:** The manifest `id` is derived as `_toSnakeCase(className)` and
78
+ * `filePath` is stored as the specification `content` path. Identity/dedup
79
+ * is based on `id` alone — see `hasCustomObject` for details.
80
+ *
81
+ * @param entry - The custom object entry to add
82
+ * @returns true if entry was added, false if it already existed
83
+ */
84
+ addCustomObject(entry: _CustomObjectEntry): boolean;
85
+ /**
86
+ * Remove a custom object entry from the manifest.
87
+ *
88
+ * **V2 note:** Removal is keyed on `_toSnakeCase(className)` — `filePath` is
89
+ * not considered. See `hasCustomObject` for identity semantics.
90
+ *
91
+ * @param entry - The custom object entry to remove
92
+ * @returns true if entry was removed, false if it didn't exist
93
+ */
94
+ removeCustomObject(entry: _CustomObjectEntry): boolean;
95
+ /**
96
+ * Get all extensions from the manifest
97
+ * @throws Error if manifest version doesn't support extensions
98
+ */
99
+ getExtensions(): readonly Readonly<_ExtensionConfig>[];
100
+ /**
101
+ * Add or update an extension in the manifest.
102
+ * If an extension with the same ID exists, it will be replaced.
103
+ *
104
+ * @param config - Full extension configuration
105
+ * @returns The extension ID
106
+ * @throws Error if manifest version doesn't support extensions
107
+ */
108
+ addOrUpdateExtension(config: _ExtensionConfig): string;
109
+ /**
110
+ * Save changes back to disk
111
+ */
112
+ save(): Promise<void>;
113
+ }
114
+ //# sourceMappingURL=stripe-app-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripe-app-manifest.d.ts","sourceRoot":"","sources":["../../src/manifest/stripe-app-manifest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJrB,OAAO;IAOP;;;;OAIG;WACU,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAYpE;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAc5B;;OAEG;IACH,UAAU,IAAI,gBAAgB;IAI9B;;OAEG;IACH,eAAe,IAAI,MAAM;IAQzB;;OAEG;IACH,QAAQ,IAAI,MAAM,GAAG,SAAS;IAU9B;;OAEG;IACH,U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