@stripe/extensibility-custom-objects-tools 0.40.0

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 (52) hide show
  1. package/LICENSE.md +19 -0
  2. package/README.md +32 -0
  3. package/dist/build/build.d.ts +46 -0
  4. package/dist/build/build.d.ts.map +1 -0
  5. package/dist/build/cli.cjs +992 -0
  6. package/dist/build/cli.d.ts +3 -0
  7. package/dist/build/cli.d.ts.map +1 -0
  8. package/dist/build/cli.js +991 -0
  9. package/dist/build/extract-schemas.cli.cjs +8747 -0
  10. package/dist/build/extract-schemas.cli.d.ts +9 -0
  11. package/dist/build/extract-schemas.cli.d.ts.map +1 -0
  12. package/dist/build/extract-schemas.cli.js +8738 -0
  13. package/dist/build/extract-schemas.d.ts +17 -0
  14. package/dist/build/extract-schemas.d.ts.map +1 -0
  15. package/dist/build/package-build.d.ts +115 -0
  16. package/dist/build/package-build.d.ts.map +1 -0
  17. package/dist/extensibility-custom-objects-tools-alpha.d.ts +153 -0
  18. package/dist/extensibility-custom-objects-tools-beta.d.ts +32 -0
  19. package/dist/extensibility-custom-objects-tools-internal-alpha.d.ts +77 -0
  20. package/dist/extensibility-custom-objects-tools-internal-beta.d.ts +77 -0
  21. package/dist/extensibility-custom-objects-tools-internal-internal.d.ts +475 -0
  22. package/dist/extensibility-custom-objects-tools-internal-public.d.ts +77 -0
  23. package/dist/extensibility-custom-objects-tools-internal.d.ts +153 -0
  24. package/dist/extensibility-custom-objects-tools-public.d.ts +32 -0
  25. package/dist/generators/index.d.ts +43 -0
  26. package/dist/generators/index.d.ts.map +1 -0
  27. package/dist/index.cjs +956 -0
  28. package/dist/index.d.ts +13 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +927 -0
  31. package/dist/internal.cjs +8820 -0
  32. package/dist/internal.d.ts +7 -0
  33. package/dist/internal.d.ts.map +1 -0
  34. package/dist/internal.js +8791 -0
  35. package/dist/transformer/classify-fields.d.ts +105 -0
  36. package/dist/transformer/classify-fields.d.ts.map +1 -0
  37. package/dist/transformer/generate-descriptors.d.ts +72 -0
  38. package/dist/transformer/generate-descriptors.d.ts.map +1 -0
  39. package/dist/transformer/metadata.d.ts +25 -0
  40. package/dist/transformer/metadata.d.ts.map +1 -0
  41. package/dist/transformer/transform.d.ts +35 -0
  42. package/dist/transformer/transform.d.ts.map +1 -0
  43. package/dist/transformer/types.d.ts +146 -0
  44. package/dist/transformer/types.d.ts.map +1 -0
  45. package/dist/transformer/visitors.d.ts +99 -0
  46. package/dist/transformer/visitors.d.ts.map +1 -0
  47. package/dist/tsconfig.build.tsbuildinfo +1 -0
  48. package/generators/custom-object/files/___packagesSubfolder___/src/___apiName___.object.ts.mustache +95 -0
  49. package/generators/custom-object-test/files/___packagesSubfolder___/src/___apiName___.object.test.ts.mustache +35 -0
  50. package/generators/custom-objects-workspace/files/___packagesSubfolder___/package.json.mustache +20 -0
  51. package/generators/custom-objects-workspace/files/___packagesSubfolder___/tsconfig.json +9 -0
  52. package/package.json +77 -0
package/LICENSE.md ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2026 Stripe, Inc. (https://stripe.com)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @stripe/extensibility-custom-objects-tools
2
+
3
+ Build-time transformer for Stripe custom objects.
4
+
5
+ Transforms TypeScript files containing `@CustomObject` decorators into platform-ready code with proxy-based change tracking, auto-save logic, and type-safe method dispatch.
6
+
7
+ ## CLI Usage
8
+
9
+ ```bash
10
+ custom-objects-build --input src --output dist
11
+ ```
12
+
13
+ ## Programmatic Usage
14
+
15
+ ```typescript
16
+ import { transform } from '@stripe/extensibility-custom-objects-tools';
17
+
18
+ const result = transform(sourceCode, 'my-file.ts');
19
+ // result.code — transformed source code
20
+ // result.metadata — extracted platform metadata
21
+ // result.errors — any transformation errors
22
+ ```
23
+
24
+ ## What It Does
25
+
26
+ - Extracts metadata from `@CustomObject` and `@Action` decorators
27
+ - Injects proxy wrapping in constructors for change tracking
28
+ - Adds auto-save logic to instance action methods
29
+ - Removes decorators from output (no runtime decorator overhead)
30
+ - Generates type-safe wrapper classes for method dispatch
31
+
32
+ See the main package docs for details: [@stripe/extensibility-custom-objects](../extensibility-custom-objects)
@@ -0,0 +1,46 @@
1
+ import type { TransformError } from '../transformer/types.js';
2
+ /**
3
+ * Options for the build process.
4
+ * @alpha
5
+ */
6
+ export interface BuildOptions {
7
+ /** Input directory containing TypeScript source files */
8
+ inputDir: string;
9
+ /** Output directory for transformed files */
10
+ outputDir: string;
11
+ /** Whether to generate source maps (not yet implemented) */
12
+ sourceMap?: boolean;
13
+ }
14
+ /**
15
+ * Result of transforming a single file.
16
+ * @alpha
17
+ */
18
+ export interface FileResult {
19
+ /** Input file path */
20
+ inputPath: string;
21
+ /** Output file path */
22
+ outputPath: string;
23
+ /** Whether the transformation succeeded */
24
+ success: boolean;
25
+ /** Any errors that occurred */
26
+ errors: TransformError[];
27
+ }
28
+ /**
29
+ * Result of the entire build process.
30
+ * @alpha
31
+ */
32
+ export interface BuildResult {
33
+ /** Results for each processed file */
34
+ files: FileResult[];
35
+ /** Any global errors */
36
+ errors: TransformError[];
37
+ }
38
+ /**
39
+ * Builds the custom objects by transforming TypeScript files.
40
+ *
41
+ * @param options - Build options
42
+ * @returns Build result
43
+ * @alpha
44
+ */
45
+ export declare function build(options: BuildOptions): Promise<BuildResult>;
46
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/build/build.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,wBAAwB;IACxB,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AA0DD;;;;;;GAMG;AACH,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAqFvE"}