sdk-aws-lambda 0.2.0 → 0.4.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 (149) hide show
  1. package/dist/contract/cli/asGenArgs.d.ts +21 -0
  2. package/dist/contract/cli/asGenArgs.js +69 -0
  3. package/dist/contract/cli/asGenArgs.js.map +1 -0
  4. package/dist/contract/cli/gen.d.ts +23 -0
  5. package/dist/contract/cli/gen.js +72 -0
  6. package/dist/contract/cli/gen.js.map +1 -0
  7. package/dist/domain.objects/ApiGatewayRequestPayload.d.ts +12 -0
  8. package/dist/domain.objects/ApiGatewayRequestPayload.js +3 -0
  9. package/dist/domain.objects/ApiGatewayRequestPayload.js.map +1 -0
  10. package/dist/domain.objects/ApiGatewayResponse.d.ts +30 -0
  11. package/dist/domain.objects/ApiGatewayResponse.js +3 -0
  12. package/dist/domain.objects/ApiGatewayResponse.js.map +1 -0
  13. package/dist/domain.objects/ApiGatewayResponsePayload.d.ts +30 -0
  14. package/dist/domain.objects/ApiGatewayResponsePayload.js +3 -0
  15. package/dist/domain.objects/ApiGatewayResponsePayload.js.map +1 -0
  16. package/dist/domain.objects/DomainObjectCaptured.d.ts +51 -0
  17. package/dist/domain.objects/DomainObjectCaptured.js +8 -0
  18. package/dist/domain.objects/DomainObjectCaptured.js.map +1 -0
  19. package/dist/domain.objects/GeneratedFile.d.ts +18 -0
  20. package/dist/domain.objects/GeneratedFile.js +8 -0
  21. package/dist/domain.objects/GeneratedFile.js.map +1 -0
  22. package/dist/domain.objects/HttpStatusCode.d.ts +1 -0
  23. package/dist/domain.objects/HttpStatusCode.js +1 -0
  24. package/dist/domain.objects/HttpStatusCode.js.map +1 -1
  25. package/dist/domain.objects/LambdaCredentialsAbsentError.d.ts +11 -0
  26. package/dist/domain.objects/LambdaCredentialsAbsentError.js +16 -0
  27. package/dist/domain.objects/LambdaCredentialsAbsentError.js.map +1 -0
  28. package/dist/domain.objects/LambdaDomainObjectNotCapturableError.d.ts +12 -0
  29. package/dist/domain.objects/LambdaDomainObjectNotCapturableError.js +17 -0
  30. package/dist/domain.objects/LambdaDomainObjectNotCapturableError.js.map +1 -0
  31. package/dist/domain.objects/LambdaDomainObjectRefUnbindableError.d.ts +14 -0
  32. package/dist/domain.objects/LambdaDomainObjectRefUnbindableError.js +19 -0
  33. package/dist/domain.objects/LambdaDomainObjectRefUnbindableError.js.map +1 -0
  34. package/dist/domain.operations/genLambdaEndpoint/TranslateLog.d.ts +29 -0
  35. package/dist/domain.operations/genLambdaEndpoint/TranslateLog.js +3 -0
  36. package/dist/domain.operations/genLambdaEndpoint/TranslateLog.js.map +1 -0
  37. package/dist/domain.operations/genLambdaEndpoint/asContextLogTrail.d.ts +29 -0
  38. package/dist/domain.operations/genLambdaEndpoint/asContextLogTrail.js +30 -0
  39. package/dist/domain.operations/genLambdaEndpoint/asContextLogTrail.js.map +1 -0
  40. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.d.ts +36 -0
  41. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js +3 -0
  42. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js.map +1 -0
  43. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.d.ts +19 -0
  44. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js +24 -0
  45. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js.map +1 -0
  46. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayloadJson.d.ts +26 -0
  47. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayloadJson.js +31 -0
  48. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayloadJson.js.map +1 -0
  49. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.d.ts +33 -0
  50. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js +39 -0
  51. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js.map +1 -0
  52. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.d.ts +27 -0
  53. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js +118 -0
  54. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js.map +1 -0
  55. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.d.ts +76 -36
  56. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js +153 -45
  57. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js.map +1 -1
  58. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.d.ts +8 -0
  59. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js +34 -0
  60. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js.map +1 -0
  61. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.d.ts +19 -0
  62. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js +36 -0
  63. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js.map +1 -0
  64. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.d.ts +7 -24
  65. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.js +19 -103
  66. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.js.map +1 -1
  67. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.d.ts +20 -0
  68. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.js +48 -0
  69. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.js.map +1 -0
  70. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.d.ts +16 -0
  71. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js +32 -0
  72. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js.map +1 -1
  73. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.d.ts +6 -22
  74. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js +24 -18
  75. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js.map +1 -1
  76. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.d.ts +11 -2
  77. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js +12 -2
  78. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js.map +1 -1
  79. package/dist/domain.operations/genLambdaEndpoint/middleware/asContextTrailed.d.ts +37 -0
  80. package/dist/domain.operations/genLambdaEndpoint/middleware/asContextTrailed.js +24 -0
  81. package/dist/domain.operations/genLambdaEndpoint/middleware/asContextTrailed.js.map +1 -0
  82. package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.d.ts +18 -10
  83. package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.js +20 -23
  84. package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.js.map +1 -1
  85. package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.d.ts +29 -6
  86. package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js +23 -28
  87. package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js.map +1 -1
  88. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.d.ts +16 -1
  89. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js +9 -13
  90. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js.map +1 -1
  91. package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.d.ts +27 -6
  92. package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js +29 -4
  93. package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js.map +1 -1
  94. package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js +12 -4
  95. package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js.map +1 -1
  96. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.d.ts +27 -2
  97. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js +34 -13
  98. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js.map +1 -1
  99. package/dist/domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody.js +1 -0
  100. package/dist/domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody.js.map +1 -1
  101. package/dist/domain.operations/genServiceSdk/asServiceSymbols/asServiceSymbols.d.ts +16 -0
  102. package/dist/domain.operations/genServiceSdk/asServiceSymbols/asServiceSymbols.js +36 -0
  103. package/dist/domain.operations/genServiceSdk/asServiceSymbols/asServiceSymbols.js.map +1 -0
  104. package/dist/domain.operations/genServiceSdk/gen.file/asBarrelFileSource.d.ts +10 -0
  105. package/dist/domain.operations/genServiceSdk/gen.file/asBarrelFileSource.js +18 -0
  106. package/dist/domain.operations/genServiceSdk/gen.file/asBarrelFileSource.js.map +1 -0
  107. package/dist/domain.operations/genServiceSdk/gen.file/asMechanismsFileSource.d.ts +14 -0
  108. package/dist/domain.operations/genServiceSdk/gen.file/asMechanismsFileSource.js +44 -0
  109. package/dist/domain.operations/genServiceSdk/gen.file/asMechanismsFileSource.js.map +1 -0
  110. package/dist/domain.operations/genServiceSdk/gen.file/asResourcesFileSource.d.ts +11 -0
  111. package/dist/domain.operations/genServiceSdk/gen.file/asResourcesFileSource.js +42 -0
  112. package/dist/domain.operations/genServiceSdk/gen.file/asResourcesFileSource.js.map +1 -0
  113. package/dist/domain.operations/genServiceSdk/gen.file/banner.d.ts +9 -0
  114. package/dist/domain.operations/genServiceSdk/gen.file/banner.js +16 -0
  115. package/dist/domain.operations/genServiceSdk/gen.file/banner.js.map +1 -0
  116. package/dist/domain.operations/genServiceSdk/gen.file/formatTypescript.d.ts +20 -0
  117. package/dist/domain.operations/genServiceSdk/gen.file/formatTypescript.js +44 -0
  118. package/dist/domain.operations/genServiceSdk/gen.file/formatTypescript.js.map +1 -0
  119. package/dist/domain.operations/genServiceSdk/gen.file/setGeneratedFilesBatch.d.ts +13 -0
  120. package/dist/domain.operations/genServiceSdk/gen.file/setGeneratedFilesBatch.js +49 -0
  121. package/dist/domain.operations/genServiceSdk/gen.file/setGeneratedFilesBatch.js.map +1 -0
  122. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.d.ts +16 -0
  123. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js +39 -0
  124. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js.map +1 -0
  125. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.d.ts +35 -0
  126. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js +189 -0
  127. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js.map +1 -0
  128. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.d.ts +15 -0
  129. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.js +37 -0
  130. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.js.map +1 -0
  131. package/dist/domain.operations/genServiceSdk/gen.resource/asResourceClassSource.d.ts +26 -0
  132. package/dist/domain.operations/genServiceSdk/gen.resource/asResourceClassSource.js +106 -0
  133. package/dist/domain.operations/genServiceSdk/gen.resource/asResourceClassSource.js.map +1 -0
  134. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.d.ts +15 -0
  135. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js +51 -0
  136. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js.map +1 -0
  137. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.d.ts +14 -0
  138. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js +68 -0
  139. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js.map +1 -0
  140. package/dist/domain.operations/genServiceSdk/genServiceSdk.d.ts +20 -0
  141. package/dist/domain.operations/genServiceSdk/genServiceSdk.js +88 -0
  142. package/dist/domain.operations/genServiceSdk/genServiceSdk.js.map +1 -0
  143. package/dist/domain.operations/getAllLambdaContracts/getAllLambdaContracts.js +49 -4
  144. package/dist/domain.operations/getAllLambdaContracts/getAllLambdaContracts.js.map +1 -1
  145. package/dist/index.d.ts +38 -2
  146. package/dist/index.js +31 -1
  147. package/dist/index.js.map +1 -1
  148. package/package.json +18 -14
  149. package/readme.md +50 -2
@@ -0,0 +1,20 @@
1
+ /**
2
+ * .what = format a generated typescript file's text via the biome formatter
3
+ * .why = the emitter assembles bespoke text; running it through biome guarantees
4
+ * the output matches the extant biome config (quote style, spacing, object
5
+ * layout) instead of our hand-rolled whitespace — so the generated files are
6
+ * drop-in clean, not a source of lint churn
7
+ *
8
+ * .note = spawns the biome native cli (found from `@biomejs/biome`) as a
9
+ * subprocess over stdin. `--stdin-file-path` is a VIRTUAL name biome uses
10
+ * for (a) language detection and (b) matching the config's `files.includes`
11
+ * — NOT a real fs read. we pass `src/<filename>` so it matches the standard
12
+ * `src/**` include (generated sdks live under src/access/svcs/); biome
13
+ * discovers the config from cwd and falls back to defaults if none.
14
+ *
15
+ * .throws MalfunctionError — biome could not be spawned or exited non-zero
16
+ */
17
+ export declare const formatTypescript: (input: {
18
+ content: string;
19
+ path: string;
20
+ }) => Promise<string>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatTypescript = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ const node_child_process_1 = require("node:child_process");
6
+ const node_path_1 = require("node:path");
7
+ /**
8
+ * .what = format a generated typescript file's text via the biome formatter
9
+ * .why = the emitter assembles bespoke text; running it through biome guarantees
10
+ * the output matches the extant biome config (quote style, spacing, object
11
+ * layout) instead of our hand-rolled whitespace — so the generated files are
12
+ * drop-in clean, not a source of lint churn
13
+ *
14
+ * .note = spawns the biome native cli (found from `@biomejs/biome`) as a
15
+ * subprocess over stdin. `--stdin-file-path` is a VIRTUAL name biome uses
16
+ * for (a) language detection and (b) matching the config's `files.includes`
17
+ * — NOT a real fs read. we pass `src/<filename>` so it matches the standard
18
+ * `src/**` include (generated sdks live under src/access/svcs/); biome
19
+ * discovers the config from cwd and falls back to defaults if none.
20
+ *
21
+ * .throws MalfunctionError — biome could not be spawned or exited non-zero
22
+ */
23
+ const formatTypescript = async (input) => {
24
+ // locate the biome cli shim shipped by the `@biomejs/biome` package
25
+ const biomeBin = require.resolve('@biomejs/biome/bin/biome');
26
+ // a src-conventional virtual name so biome's `files.includes` matches + formats
27
+ const virtualPath = `src/${(0, node_path_1.basename)(input.path)}`;
28
+ // format over stdin; `--stdin-file-path` tells biome the language + include match
29
+ return new Promise((done, fail) => {
30
+ const child = (0, node_child_process_1.execFile)(process.execPath, [biomeBin, 'format', `--stdin-file-path=${virtualPath}`], { maxBuffer: 10 * 1024 * 1024 }, (error, stdout, stderr) => {
31
+ if (error)
32
+ return fail(new helpful_errors_1.MalfunctionError('biome failed to format generated text', {
33
+ cause: error,
34
+ path: input.path,
35
+ stderr,
36
+ }));
37
+ return done(stdout);
38
+ });
39
+ // feed the unformatted text to biome's stdin
40
+ child.stdin?.end(input.content);
41
+ });
42
+ };
43
+ exports.formatTypescript = formatTypescript;
44
+ //# sourceMappingURL=formatTypescript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatTypescript.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.file/formatTypescript.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAElD,2DAA8C;AAC9C,yCAAqC;AAErC;;;;;;;;;;;;;;;GAeG;AACI,MAAM,gBAAgB,GAAG,KAAK,EAAE,KAGtC,EAAmB,EAAE;IACpB,oEAAoE;IACpE,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAE7D,gFAAgF;IAChF,MAAM,WAAW,GAAG,OAAO,IAAA,oBAAQ,EAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IAElD,kFAAkF;IAClF,OAAO,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAChC,MAAM,KAAK,GAAG,IAAA,6BAAQ,EACpB,OAAO,CAAC,QAAQ,EAChB,CAAC,QAAQ,EAAE,QAAQ,EAAE,qBAAqB,WAAW,EAAE,CAAC,EACxD,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,EAC/B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACxB,IAAI,KAAK;gBACP,OAAO,IAAI,CACT,IAAI,iCAAgB,CAAC,uCAAuC,EAAE;oBAC5D,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,MAAM;iBACP,CAAC,CACH,CAAC;YACJ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC,CACF,CAAC;QAEF,6CAA6C;QAC7C,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAhCW,QAAA,gBAAgB,oBAgC3B"}
@@ -0,0 +1,13 @@
1
+ import type { GeneratedFile } from '../../../domain.objects/GeneratedFile';
2
+ /**
3
+ * .what = write a batch of generated files atomically (all-or-none on disk)
4
+ * .why = three sequential single-file writes could leave a partial sdk if the fs
5
+ * fails on file 2 of 3; this stages all to temp names, then renames each
6
+ * into place — on any failure it removes the temp files and throws, so the
7
+ * target directory is never left with a partial set (uc.1 all-or-none)
8
+ *
9
+ * .throws MalfunctionError — a filesystem write/rename failed; temps are cleaned
10
+ */
11
+ export declare const setGeneratedFilesBatch: (input: {
12
+ files: GeneratedFile[];
13
+ }) => Promise<void>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setGeneratedFilesBatch = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ const promises_1 = require("node:fs/promises");
6
+ const node_path_1 = require("node:path");
7
+ /**
8
+ * .what = write a batch of generated files atomically (all-or-none on disk)
9
+ * .why = three sequential single-file writes could leave a partial sdk if the fs
10
+ * fails on file 2 of 3; this stages all to temp names, then renames each
11
+ * into place — on any failure it removes the temp files and throws, so the
12
+ * target directory is never left with a partial set (uc.1 all-or-none)
13
+ *
14
+ * .throws MalfunctionError — a filesystem write/rename failed; temps are cleaned
15
+ */
16
+ const setGeneratedFilesBatch = async (input) => {
17
+ // pair each target path with an adjacent temp path
18
+ const staged = input.files.map((file) => ({
19
+ finalPath: file.path,
20
+ tempPath: `${file.path}.tmp-${process.pid}-${Date.now()}`,
21
+ content: file.content,
22
+ }));
23
+ try {
24
+ // write every file to its temp path first (parent dirs made as needed)
25
+ for (const item of staged) {
26
+ await (0, promises_1.mkdir)((0, node_path_1.dirname)(item.finalPath), { recursive: true });
27
+ await (0, promises_1.writeFile)(item.tempPath, item.content, 'utf-8');
28
+ }
29
+ // commit: rename each temp into its final place
30
+ for (const item of staged) {
31
+ await (0, promises_1.rename)(item.tempPath, item.finalPath);
32
+ }
33
+ }
34
+ catch (error) {
35
+ // cleanup: attempt to remove every temp file, then fail loud with the
36
+ // original cause. allSettled (not a per-item catch) is deliberate — the
37
+ // primary fs error is what must surface; a secondary cleanup failure must
38
+ // neither mask it nor abort the other cleanups. `rm({ force: true })` is
39
+ // already a no-op for an absent temp, so the only settle-rejections here
40
+ // are genuine unlink faults, which are subordinate to the thrown cause.
41
+ await Promise.allSettled(staged.map((item) => (0, promises_1.rm)(item.tempPath, { force: true })));
42
+ throw new helpful_errors_1.MalfunctionError('failed to write generated files', {
43
+ cause: error instanceof Error ? error : new Error(String(error)),
44
+ paths: input.files.map((f) => f.path),
45
+ });
46
+ }
47
+ };
48
+ exports.setGeneratedFilesBatch = setGeneratedFilesBatch;
49
+ //# sourceMappingURL=setGeneratedFilesBatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setGeneratedFilesBatch.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.file/setGeneratedFilesBatch.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAElD,+CAAgE;AAChE,yCAAoC;AAGpC;;;;;;;;GAQG;AACI,MAAM,sBAAsB,GAAG,KAAK,EAAE,KAE5C,EAAiB,EAAE;IAClB,mDAAmD;IACnD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACxC,SAAS,EAAE,IAAI,CAAC,IAAI;QACpB,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAI,QAAQ,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE;QACzD,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC,CAAC,CAAC;IAEJ,IAAI,CAAC;QACH,uEAAuE;QACvE,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YAC1B,MAAM,IAAA,gBAAK,EAAC,IAAA,mBAAO,EAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1D,MAAM,IAAA,oBAAS,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;QAED,gDAAgD;QAChD,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YAC1B,MAAM,IAAA,iBAAM,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,sEAAsE;QACtE,wEAAwE;QACxE,0EAA0E;QAC1E,yEAAyE;QACzE,yEAAyE;QACzE,wEAAwE;QACxE,MAAM,OAAO,CAAC,UAAU,CACtB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,aAAE,EAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CACzD,CAAC;QACF,MAAM,IAAI,iCAAgB,CAAC,iCAAiC,EAAE;YAC5D,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SACtC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AApCW,QAAA,sBAAsB,0BAoCjC"}
@@ -0,0 +1,16 @@
1
+ import type { LambdaEndpointSchema } from '../../../domain.objects/LambdaEndpointSchema';
2
+ /**
3
+ * .what = emit one mechanism fn: a typed `(event, context)` wrapper around
4
+ * `askLambdaEndpoint` for a single endpoint
5
+ * .why = the mechanisms file exposes one fn per discovered endpoint (uc.1); each
6
+ * is a thin, typed call into the endpoint by its service+function
7
+ *
8
+ * .note = `event` is the repo's ubiqlang lambda-payload input; the wrapper keeps
9
+ * the caller's `context` ambient (env.access lives there)
10
+ */
11
+ export declare const asMechanismFnSource: (input: {
12
+ service: string;
13
+ function: string;
14
+ schema: LambdaEndpointSchema;
15
+ dobjRefs: Record<string, string>;
16
+ }) => string;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asMechanismFnSource = void 0;
4
+ const getTypescriptFromJsonSchema_1 = require("./getTypescriptFromJsonSchema");
5
+ /**
6
+ * .what = emit one mechanism fn: a typed `(event, context)` wrapper around
7
+ * `askLambdaEndpoint` for a single endpoint
8
+ * .why = the mechanisms file exposes one fn per discovered endpoint (uc.1); each
9
+ * is a thin, typed call into the endpoint by its service+function
10
+ *
11
+ * .note = `event` is the repo's ubiqlang lambda-payload input; the wrapper keeps
12
+ * the caller's `context` ambient (env.access lives there)
13
+ */
14
+ const asMechanismFnSource = (input) => {
15
+ // the typed shapes for this endpoint's event (input) and result (output)
16
+ const eventType = (0, getTypescriptFromJsonSchema_1.getTypescriptFromJsonSchema)({
17
+ schema: input.schema.input,
18
+ dobjRefs: input.dobjRefs,
19
+ });
20
+ const resultType = (0, getTypescriptFromJsonSchema_1.getTypescriptFromJsonSchema)({
21
+ schema: input.schema.output,
22
+ dobjRefs: input.dobjRefs,
23
+ });
24
+ // the fn: passes which + event to askLambdaEndpoint, threads context through.
25
+ // the explicit <event, result> generics make the call self-evident — a reader
26
+ // sees the contract at the call site, not only via the outer annotation
27
+ return [
28
+ ` ${input.function}: (`,
29
+ ` event: ${eventType},`,
30
+ ` context: ContextAwsLambdaCaller,`,
31
+ ` ): Promise<${resultType}> =>`,
32
+ ` askLambdaEndpoint<${eventType}, ${resultType}>(`,
33
+ ` { which: { service: ${JSON.stringify(input.service)}, function: ${JSON.stringify(input.function)} }, event },`,
34
+ ` context,`,
35
+ ` ),`,
36
+ ].join('\n');
37
+ };
38
+ exports.asMechanismFnSource = asMechanismFnSource;
39
+ //# sourceMappingURL=asMechanismFnSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asMechanismFnSource.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.ts"],"names":[],"mappings":";;;AACA,+EAA4E;AAE5E;;;;;;;;GAQG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAKnC,EAAU,EAAE;IACX,yEAAyE;IACzE,MAAM,SAAS,GAAG,IAAA,yDAA2B,EAAC;QAC5C,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;QAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,IAAA,yDAA2B,EAAC;QAC7C,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;QAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAC;IAEH,8EAA8E;IAC9E,8EAA8E;IAC9E,wEAAwE;IACxE,OAAO;QACL,KAAK,KAAK,CAAC,QAAQ,KAAK;QACxB,cAAc,SAAS,GAAG;QAC1B,sCAAsC;QACtC,gBAAgB,UAAU,MAAM;QAChC,yBAAyB,SAAS,KAAK,UAAU,IAAI;QACrD,6BAA6B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc;QACrH,gBAAgB;QAChB,QAAQ;KACT,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC,CAAC;AA7BW,QAAA,mBAAmB,uBA6B9B"}
@@ -0,0 +1,35 @@
1
+ import type { JSONSchema } from 'zod/v4/core/json-schema';
2
+ /**
3
+ * .what = compile a json-schema into a TypeScript type literal string
4
+ * .why = the codegen needs typed shapes for mechanism args/returns + resource
5
+ * interfaces; a bespoke emitter (vs an external tool) keeps output fully
6
+ * deterministic for snapshots and avoids a heavy dep + esm/jest friction
7
+ *
8
+ * .note = these schemas come from zod via `z.toJSONSchema`, so the shapes are a
9
+ * known, bounded subset (object/array/string/number/boolean/enum/const/
10
+ * anyOf/allOf/$ref-free). unknown shapes surface as `unknown`.
11
+ *
12
+ * .dobjRefs = map of `x-domain-object` name → the prefixed resource name; when a
13
+ * sub-node carries a captured dobj pragma, its type becomes that
14
+ * prefixed name (a reference) instead of an inline shape
15
+ *
16
+ * .asRootShape = when true, the ROOT node renders its own shape even if it carries
17
+ * a dobj pragma (so a resource can render its own interface body);
18
+ * nested pragma nodes still become refs. default false — so a
19
+ * top-level dobj (e.g. a mechanism's `job` field) becomes a ref.
20
+ */
21
+ export declare const getTypescriptFromJsonSchema: (input: {
22
+ schema: JSONSchema;
23
+ dobjRefs?: Record<string, string>;
24
+ asRootShape?: boolean;
25
+ }) => string;
26
+ /**
27
+ * .what = the set of domain-objects ref generics (`Ref` / `RefByPrimary` /
28
+ * `RefByUnique`) a schema tree uses, for the resources-file import line
29
+ * .why = a resources file that references dobjs must import exactly the ref generics
30
+ * it emits — no more (no unused import), no less
31
+ */
32
+ export declare const getRefGenericsUsed: (input: {
33
+ schema: JSONSchema;
34
+ dobjRefs: Record<string, string>;
35
+ }) => string[];
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRefGenericsUsed = exports.getTypescriptFromJsonSchema = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ /**
6
+ * .what = compile a json-schema into a TypeScript type literal string
7
+ * .why = the codegen needs typed shapes for mechanism args/returns + resource
8
+ * interfaces; a bespoke emitter (vs an external tool) keeps output fully
9
+ * deterministic for snapshots and avoids a heavy dep + esm/jest friction
10
+ *
11
+ * .note = these schemas come from zod via `z.toJSONSchema`, so the shapes are a
12
+ * known, bounded subset (object/array/string/number/boolean/enum/const/
13
+ * anyOf/allOf/$ref-free). unknown shapes surface as `unknown`.
14
+ *
15
+ * .dobjRefs = map of `x-domain-object` name → the prefixed resource name; when a
16
+ * sub-node carries a captured dobj pragma, its type becomes that
17
+ * prefixed name (a reference) instead of an inline shape
18
+ *
19
+ * .asRootShape = when true, the ROOT node renders its own shape even if it carries
20
+ * a dobj pragma (so a resource can render its own interface body);
21
+ * nested pragma nodes still become refs. default false — so a
22
+ * top-level dobj (e.g. a mechanism's `job` field) becomes a ref.
23
+ */
24
+ const getTypescriptFromJsonSchema = (input) => asType(input.schema, input.dobjRefs ?? {}, input.asRootShape ?? false);
25
+ exports.getTypescriptFromJsonSchema = getTypescriptFromJsonSchema;
26
+ /**
27
+ * .what = render one json-schema node as a TS type literal
28
+ * .why = recursive core of the emitter
29
+ */
30
+ const asType = (node, dobjRefs, skipRootPragma = false) => {
31
+ // a node tagged as a domain-object REFERENCE becomes a typed Ref against the
32
+ // referenced dobj's prefixed resource name (e.g. RefByPrimary<typeof SvcSurfSeaturtle>)
33
+ const refType = asRefType(node, dobjRefs);
34
+ if (refType)
35
+ return refType;
36
+ // a node tagged as a captured dobj becomes a reference to its prefixed name —
37
+ // unless this is the root shape render (a resource emits its own interface)
38
+ const pragma = node['x-domain-object'];
39
+ if (!skipRootPragma && pragma && dobjRefs[pragma.name])
40
+ return dobjRefs[pragma.name];
41
+ // const → literal type
42
+ if ('const' in node)
43
+ return asLiteral(node.const);
44
+ // enum → union of literals
45
+ const enumValues = node.enum;
46
+ if (enumValues)
47
+ return enumValues.map(asLiteral).join(' | ');
48
+ // anyOf / oneOf → union
49
+ const anyOf = node.anyOf ??
50
+ node.oneOf;
51
+ if (anyOf)
52
+ return anyOf.map((m) => asType(m, dobjRefs)).join(' | ');
53
+ // allOf → intersection
54
+ const allOf = node.allOf;
55
+ if (allOf)
56
+ return allOf.map((m) => asType(m, dobjRefs)).join(' & ');
57
+ // by json-schema `type`
58
+ const type = node.type;
59
+ if (type === 'string')
60
+ return 'string';
61
+ if (type === 'number' || type === 'integer')
62
+ return 'number';
63
+ if (type === 'boolean')
64
+ return 'boolean';
65
+ if (type === 'null')
66
+ return 'null';
67
+ if (type === 'array')
68
+ return asArray(node, dobjRefs);
69
+ if (type === 'object')
70
+ return asObject(node, dobjRefs);
71
+ // no recognizable shape → unknown (surfaces upstream schema looseness)
72
+ return 'unknown';
73
+ };
74
+ /**
75
+ * .what = render an object node as `{ key: type; ... }`
76
+ * .why = objects are the dominant shape; honor `required` for optionality
77
+ */
78
+ const asObject = (node, dobjRefs) => {
79
+ const properties = node
80
+ .properties;
81
+ if (!properties || Object.keys(properties).length === 0)
82
+ return 'unknown';
83
+ const required = new Set(node.required ?? []);
84
+ const members = Object.entries(properties).map(([key, propSchema]) => {
85
+ const optional = required.has(key) ? '' : '?';
86
+ return `${asKey(key)}${optional}: ${asType(propSchema, dobjRefs)};`;
87
+ });
88
+ return `{ ${members.join(' ')} }`;
89
+ };
90
+ /**
91
+ * .what = render an array node as `type[]`
92
+ * .why = items may be a single schema or absent (→ unknown[]); emit the idiomatic
93
+ * `T[]` form, consistent with the absent-items branch (not a mixed
94
+ * `Array<T>` vs `unknown[]` style)
95
+ * .note = union/intersection item types are parenthesized so `A | B` renders as
96
+ * `(A | B)[]`, not the ambiguous `A | B[]`
97
+ */
98
+ const asArray = (node, dobjRefs) => {
99
+ const items = node.items;
100
+ if (!items)
101
+ return 'unknown[]';
102
+ const itemType = asType(items, dobjRefs);
103
+ const needsParens = /\s[|&]\s/.test(itemType);
104
+ return needsParens ? `(${itemType})[]` : `${itemType}[]`;
105
+ };
106
+ /**
107
+ * .what = render a literal value as a TS literal type
108
+ */
109
+ const asLiteral = (value) => {
110
+ if (typeof value === 'string')
111
+ return JSON.stringify(value);
112
+ if (typeof value === 'number' || typeof value === 'boolean')
113
+ return String(value);
114
+ if (value === null)
115
+ return 'null';
116
+ throw new helpful_errors_1.UnexpectedCodePathError('cannot render literal type for value', {
117
+ value,
118
+ });
119
+ };
120
+ /**
121
+ * .what = the domain-objects ref generic (`Ref` / `RefByPrimary` / `RefByUnique`) a
122
+ * given `by` maps to
123
+ * .why = the `x-domain-object-ref` pragma's `by` says which key(s) the reference
124
+ * carries; each maps to its domain-objects type
125
+ */
126
+ const REF_GENERIC_BY = {
127
+ primary: 'RefByPrimary',
128
+ unique: 'RefByUnique',
129
+ ref: 'Ref',
130
+ };
131
+ /**
132
+ * .what = read the `x-domain-object-ref` pragma off a schema node (the reference
133
+ * pragma stamped by `X.contract.ref(by)` in domain-objects@0.33.0)
134
+ * .why = a reference field carries only the referenced dobj (`of`) + which key (`by`)
135
+ */
136
+ const asRefPragma = (node) => node['x-domain-object-ref'];
137
+ /**
138
+ * .what = render a node tagged with `x-domain-object-ref` as a typed Ref, or null
139
+ * when the node carries no ref pragma (or the referenced dobj is unbound)
140
+ * .why = a reference field emits `RefByPrimary<typeof SvcSurfSeaturtle>` (etc)
141
+ * instead of an inline key-shape, so the generated sdk keeps the reference
142
+ * relationship + is typed against the prefixed resource
143
+ * .note = the referenced dobj MUST be captured in full (present in dobjRefs) so the
144
+ * `typeof <prefixed>` binds; an unbound ref returns null here and the caller
145
+ * falls back to the plain inline shape (the bind-or-fail check lives upstream)
146
+ */
147
+ const asRefType = (node, dobjRefs) => {
148
+ const ref = asRefPragma(node);
149
+ if (!ref)
150
+ return null;
151
+ const prefixed = dobjRefs[ref.of];
152
+ if (!prefixed)
153
+ return null;
154
+ return `${REF_GENERIC_BY[ref.by]}<typeof ${prefixed}>`;
155
+ };
156
+ /**
157
+ * .what = the set of domain-objects ref generics (`Ref` / `RefByPrimary` /
158
+ * `RefByUnique`) a schema tree uses, for the resources-file import line
159
+ * .why = a resources file that references dobjs must import exactly the ref generics
160
+ * it emits — no more (no unused import), no less
161
+ */
162
+ const getRefGenericsUsed = (input) => {
163
+ const used = new Set();
164
+ collectRefGenerics(input.schema, input.dobjRefs, used);
165
+ return [...used].sort();
166
+ };
167
+ exports.getRefGenericsUsed = getRefGenericsUsed;
168
+ /**
169
+ * .what = recursively collect the ref generics used across a schema tree
170
+ */
171
+ const collectRefGenerics = (node, dobjRefs, used) => {
172
+ if (typeof node !== 'object' || node === null)
173
+ return;
174
+ const ref = asRefPragma(node);
175
+ if (ref && dobjRefs[ref.of])
176
+ used.add(REF_GENERIC_BY[ref.by]);
177
+ for (const value of Object.values(node)) {
178
+ if (Array.isArray(value))
179
+ for (const item of value)
180
+ collectRefGenerics(item, dobjRefs, used);
181
+ else
182
+ collectRefGenerics(value, dobjRefs, used);
183
+ }
184
+ };
185
+ /**
186
+ * .what = render a property key, quoted when it is not a valid identifier
187
+ */
188
+ const asKey = (key) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? key : JSON.stringify(key);
189
+ //# sourceMappingURL=getTypescriptFromJsonSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTypescriptFromJsonSchema.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSd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AC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAE9D,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,IAA+B,CAAC,EAAE,CAAC;QACnE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACtB,KAAK,MAAM,IAAI,IAAI,KAAK;gBAAE,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;;YAChE,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;AACH,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,KAAK,GAAG,CAAC,GAAW,EAAU,EAAE,CACpC,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { JSONSchema } from 'zod/v4/core/json-schema';
2
+ import type { DomainObjectCaptured } from '../../../domain.objects/DomainObjectCaptured';
3
+ /**
4
+ * .what = read the `x-domain-object` pragma off one json-schema node → a
5
+ * DomainObjectCaptured, or null when the node carries no pragma
6
+ * .why = a captured node identifies a domain-object only if its schema was built
7
+ * from `SomeDobj.contract`; a plain shape has no pragma and stays a plain type
8
+ *
9
+ * .kind = domain-objects@0.33.0 stamps the true `kind` on the pragma (via getKind).
10
+ * read it directly; fall back to the legacy `primary`-non-empty heuristic
11
+ * only for a pre-0.33 producer whose pragma omits `kind` (cross-version safe)
12
+ */
13
+ export declare const asDomainObjectPragma: (input: {
14
+ node: JSONSchema;
15
+ }) => DomainObjectCaptured | null;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asDomainObjectPragma = void 0;
4
+ /**
5
+ * .what = read the `x-domain-object` pragma off one json-schema node → a
6
+ * DomainObjectCaptured, or null when the node carries no pragma
7
+ * .why = a captured node identifies a domain-object only if its schema was built
8
+ * from `SomeDobj.contract`; a plain shape has no pragma and stays a plain type
9
+ *
10
+ * .kind = domain-objects@0.33.0 stamps the true `kind` on the pragma (via getKind).
11
+ * read it directly; fall back to the legacy `primary`-non-empty heuristic
12
+ * only for a pre-0.33 producer whose pragma omits `kind` (cross-version safe)
13
+ */
14
+ const asDomainObjectPragma = (input) => {
15
+ // read the pragma keyword off the node (absent → not a domain-object)
16
+ const pragma = input.node['x-domain-object'];
17
+ if (!pragma)
18
+ return null;
19
+ // default the omitted key-fields (getContract omits them when absent)
20
+ const primary = pragma.primary ?? [];
21
+ const unique = pragma.unique ?? [];
22
+ const alias = pragma.alias ?? null;
23
+ const nested = pragma.nested ?? {};
24
+ // read the stamped kind; fall back to the heuristic for a pre-0.33 pragma
25
+ const kind = pragma.kind ?? (primary.length > 0 ? 'entity' : 'literal');
26
+ return {
27
+ name: pragma.name,
28
+ kind,
29
+ primary,
30
+ unique,
31
+ alias,
32
+ nested,
33
+ shape: input.node,
34
+ };
35
+ };
36
+ exports.asDomainObjectPragma = asDomainObjectPragma;
37
+ //# sourceMappingURL=asDomainObjectPragma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asDomainObjectPragma.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.ts"],"names":[],"mappings":";;;AAKA;;;;;;;;;GASG;AACI,MAAM,oBAAoB,GAAG,CAAC,KAEpC,EAA+B,EAAE;IAChC,sEAAsE;IACtE,MAAM,MAAM,GAAI,KAAK,CAAC,IAAmD,CACvE,iBAAiB,CAClB,CAAC;IACF,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,sEAAsE;IACtE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;IAEnC,0EAA0E;IAC1E,MAAM,IAAI,GACR,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE7D,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI;QACJ,OAAO;QACP,MAAM;QACN,KAAK;QACL,MAAM;QACN,KAAK,EAAE,KAAK,CAAC,IAAI;KACM,CAAC;AAC5B,CAAC,CAAC;AA5BW,QAAA,oBAAoB,wBA4B/B"}
@@ -0,0 +1,26 @@
1
+ import type { DomainObjectKind } from 'domain-objects';
2
+ import type { DomainObjectCaptured } from '../../../domain.objects/DomainObjectCaptured';
3
+ /**
4
+ * .what = the domain-objects base class each `kind` maps to
5
+ * .why = the pragma stamps the true `kind`; the resource extends the base class it
6
+ * names (entity→DomainEntity, literal→DomainLiteral, event→DomainEvent,
7
+ * object→a plain DomainObject)
8
+ */
9
+ export declare const BASE_CLASS_BY_KIND: Record<DomainObjectKind, string>;
10
+ /**
11
+ * .what = emit the TS source for one captured domain-object: its prefixed
12
+ * interface + prefixed class with primary/unique/alias/nested (no schema)
13
+ * .why = the resources file declares each upstream dobj so the consumer gets a
14
+ * real DomainEntity/DomainLiteral (etc), not a bare type (uc.2)
15
+ *
16
+ * .rules
17
+ * - class name = `prefix + name` (the TS class name from the pragma; NOT alias)
18
+ * - base class = the domain-objects class the pragma's `kind` maps to
19
+ * - nested type names are prefixed via the same formula
20
+ * - no `static schema` — consumers do not re-validate
21
+ */
22
+ export declare const asResourceClassSource: (input: {
23
+ dobj: DomainObjectCaptured;
24
+ prefix: string;
25
+ dobjRefs: Record<string, string>;
26
+ }) => string;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asResourceClassSource = exports.BASE_CLASS_BY_KIND = void 0;
4
+ const getTypescriptFromJsonSchema_1 = require("../gen.mechanism/getTypescriptFromJsonSchema");
5
+ /**
6
+ * .what = the domain-objects base class each `kind` maps to
7
+ * .why = the pragma stamps the true `kind`; the resource extends the base class it
8
+ * names (entity→DomainEntity, literal→DomainLiteral, event→DomainEvent,
9
+ * object→a plain DomainObject)
10
+ */
11
+ exports.BASE_CLASS_BY_KIND = {
12
+ entity: 'DomainEntity',
13
+ literal: 'DomainLiteral',
14
+ event: 'DomainEvent',
15
+ object: 'DomainObject',
16
+ };
17
+ /**
18
+ * .what = emit the TS source for one captured domain-object: its prefixed
19
+ * interface + prefixed class with primary/unique/alias/nested (no schema)
20
+ * .why = the resources file declares each upstream dobj so the consumer gets a
21
+ * real DomainEntity/DomainLiteral (etc), not a bare type (uc.2)
22
+ *
23
+ * .rules
24
+ * - class name = `prefix + name` (the TS class name from the pragma; NOT alias)
25
+ * - base class = the domain-objects class the pragma's `kind` maps to
26
+ * - nested type names are prefixed via the same formula
27
+ * - no `static schema` — consumers do not re-validate
28
+ */
29
+ const asResourceClassSource = (input) => {
30
+ const { dobj, prefix } = input;
31
+ // the emitted symbol name for this dobj (e.g. SvcJobsJob)
32
+ const symbol = `${prefix}${dobj.name}`;
33
+ // the interface shape, with nested dobj-tagged props referenced by prefixed
34
+ // name; asRootShape renders THIS dobj's own shape (not a self-ref)
35
+ const shape = (0, getTypescriptFromJsonSchema_1.getTypescriptFromJsonSchema)({
36
+ schema: dobj.shape,
37
+ dobjRefs: input.dobjRefs,
38
+ asRootShape: true,
39
+ });
40
+ // the base class the dobj's kind maps to
41
+ const base = exports.BASE_CLASS_BY_KIND[dobj.kind];
42
+ // the static key + metadata lines (omit those with no content)
43
+ const statics = [
44
+ asStaticArray('primary', dobj.primary),
45
+ asStaticArray('unique', dobj.unique),
46
+ asStaticAlias(dobj.alias),
47
+ asStaticNested(dobj.nested, prefix),
48
+ ].filter((line) => line !== null);
49
+ const interfaceLine = `export interface ${symbol} ${shape}`;
50
+ const classBody = statics.length > 0 ? `\n ${statics.join('\n ')}\n` : '';
51
+ const classLine = `export class ${symbol} extends ${base}<${symbol}> implements ${symbol} {${classBody}}`;
52
+ // a blank line between the interface + class halves makes each dobj's two-part
53
+ // structure obvious at a glance (biome preserves the gap)
54
+ return `${interfaceLine}\n\n${classLine}`;
55
+ };
56
+ exports.asResourceClassSource = asResourceClassSource;
57
+ /**
58
+ * .what = render a `public static primary = [...] as const;` line, or null if empty
59
+ */
60
+ const asStaticArray = (name, values) => {
61
+ if (values.length === 0)
62
+ return null;
63
+ const items = values.map((v) => JSON.stringify(v)).join(', ');
64
+ return `public static ${name} = [${items}] as const;`;
65
+ };
66
+ /**
67
+ * .what = render a `public static alias = ...;` line, or null if absent
68
+ * .why = the alias is a string ('surfboard') or an object ({ singular, plural });
69
+ * render it as a TS literal — NOT `JSON.stringify` (which emits cramped raw
70
+ * json `{"singular":"job"}` with quoted keys, a codegen blemish)
71
+ */
72
+ const asStaticAlias = (alias) => {
73
+ if (alias === null)
74
+ return null;
75
+ return `public static alias = ${asAliasLiteral(alias)};`;
76
+ };
77
+ /**
78
+ * .what = render an alias value as a clean TS literal
79
+ * .why = a string alias becomes a string literal; an object alias becomes an
80
+ * object literal with unquoted keys + spaces (`{ singular: "job" }`)
81
+ */
82
+ const asAliasLiteral = (alias) => {
83
+ if (typeof alias === 'string')
84
+ return JSON.stringify(alias);
85
+ const members = Object.entries(alias).map(([key, value]) => `${key}: ${JSON.stringify(value)}`);
86
+ return `{ ${members.join(', ')} }`;
87
+ };
88
+ /**
89
+ * .what = render a `public static nested = { key: PrefixedType, ... };` line
90
+ * .why = each nested type name gets the service prefix, so it points at the
91
+ * prefixed resource declaration; an array value (polymorphic) emits an
92
+ * array of prefixed names
93
+ */
94
+ const asStaticNested = (nested, prefix) => {
95
+ const entries = Object.entries(nested);
96
+ if (entries.length === 0)
97
+ return null;
98
+ const members = entries.map(([key, typeName]) => {
99
+ const value = Array.isArray(typeName)
100
+ ? `[${typeName.map((n) => `${prefix}${n}`).join(', ')}]`
101
+ : `${prefix}${typeName}`;
102
+ return `${key}: ${value}`;
103
+ });
104
+ return `public static nested = { ${members.join(', ')} };`;
105
+ };
106
+ //# sourceMappingURL=asResourceClassSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asResourceClassSource.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.resource/asResourceClassSource.ts"],"names":[],"mappings":";;;AAGA,8FAA2F;AAE3F;;;;;GAKG;AACU,QAAA,kBAAkB,GAAqC;IAClE,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,aAAa;IACpB,MAAM,EAAE,cAAc;CACvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACI,MAAM,qBAAqB,GAAG,CAAC,KAIrC,EAAU,EAAE;IACX,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAE/B,0DAA0D;IAC1D,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAEvC,4EAA4E;IAC5E,mEAAmE;IACnE,MAAM,KAAK,GAAG,IAAA,yDAA2B,EAAC;QACxC,MAAM,EAAE,IAAI,CAAC,KAAK;QAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,yCAAyC;IACzC,MAAM,IAAI,GAAG,0BAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE3C,+DAA+D;IAC/D,MAAM,OAAO,GAAG;QACd,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC;QACtC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;QACpC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;QACzB,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;KACpC,CA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