sdk-aws-lambda 0.5.0 → 0.7.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 (183) hide show
  1. package/dist/domain.objects/ApiGatewayRequestEventOnwire.d.ts +18 -0
  2. package/dist/domain.objects/ApiGatewayRequestEventOnwire.js +3 -0
  3. package/dist/domain.objects/ApiGatewayRequestEventOnwire.js.map +1 -0
  4. package/dist/domain.objects/ApiGatewayResponse.d.ts +17 -10
  5. package/dist/domain.objects/{ApiGatewayResponsePayload.d.ts → ApiGatewayResponseOnwire.d.ts} +8 -4
  6. package/dist/domain.objects/{ApiGatewayRequestPayload.js → ApiGatewayResponseOnwire.js} +1 -1
  7. package/dist/domain.objects/ApiGatewayResponseOnwire.js.map +1 -0
  8. package/dist/domain.operations/genLambdaEndpoint/InvokeInputSuperset.d.ts +125 -0
  9. package/dist/domain.operations/genLambdaEndpoint/{genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js → InvokeInputSuperset.js} +1 -1
  10. package/dist/domain.operations/genLambdaEndpoint/InvokeInputSuperset.js.map +1 -0
  11. package/dist/domain.operations/genLambdaEndpoint/TranslateLog.d.ts +0 -17
  12. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.d.ts +27 -0
  13. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified.d.ts +100 -0
  14. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified.js +3 -0
  15. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified.js.map +1 -0
  16. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.d.ts +34 -0
  17. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.js +141 -0
  18. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.js.map +1 -0
  19. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.d.ts +22 -0
  20. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.js +27 -0
  21. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.js.map +1 -0
  22. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{asApiGatewayResponsePayloadJson.d.ts → asApiGatewayResponseOnwireJson.d.ts} +11 -11
  23. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{asApiGatewayResponsePayloadJson.js → asApiGatewayResponseOnwireJson.js} +12 -12
  24. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwireJson.js.map +1 -0
  25. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.d.ts +39 -13
  26. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js +37 -11
  27. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js.map +1 -1
  28. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.d.ts +35 -0
  29. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.js +44 -0
  30. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.js.map +1 -0
  31. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.d.ts +95 -39
  32. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js +88 -62
  33. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js.map +1 -1
  34. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getAllWirePayloadKeysFound.d.ts → getAllResponseOnwireKeysFound.d.ts} +2 -2
  35. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllResponseOnwireKeysFound.js +43 -0
  36. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllResponseOnwireKeysFound.js.map +1 -0
  37. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV1ApiGatewayEvent.d.ts → getIsV1ApiGatewayRequestEvent.d.ts} +1 -1
  38. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV1ApiGatewayEvent.js → getIsV1ApiGatewayRequestEvent.js} +4 -4
  39. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV1ApiGatewayRequestEvent.js.map +1 -0
  40. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV2ApiGatewayEvent.d.ts → getIsV2ApiGatewayRequestEvent.d.ts} +1 -1
  41. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV2ApiGatewayEvent.js → getIsV2ApiGatewayRequestEvent.js} +4 -4
  42. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayRequestEvent.js.map +1 -0
  43. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.d.ts +8 -5
  44. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js +11 -8
  45. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js.map +1 -1
  46. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/{genApiGatewayEventNormalizationMiddleware.d.ts → genApiGatewayRequestEventNormalizationMiddleware.d.ts} +3 -3
  47. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/{genApiGatewayEventNormalizationMiddleware.js → genApiGatewayRequestEventNormalizationMiddleware.js} +8 -8
  48. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayRequestEventNormalizationMiddleware.js.map +1 -0
  49. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.d.ts +4 -4
  50. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.js +5 -5
  51. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.d.ts +36 -0
  52. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.js +113 -0
  53. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.js.map +1 -0
  54. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.d.ts +125 -0
  55. package/dist/domain.operations/genLambdaEndpoint/{genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js → genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.js} +32 -16
  56. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.js.map +1 -0
  57. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.d.ts +18 -0
  58. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.js +29 -0
  59. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.js.map +1 -0
  60. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.d.ts +23 -0
  61. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.js +38 -0
  62. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.js.map +1 -0
  63. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.d.ts +123 -0
  64. package/dist/{domain.objects/ApiGatewayResponsePayload.js → domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.js} +1 -1
  65. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.js.map +1 -0
  66. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.d.ts +23 -0
  67. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.js +33 -0
  68. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.js.map +1 -0
  69. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.d.ts +30 -0
  70. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.js +38 -0
  71. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.js.map +1 -0
  72. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.d.ts +30 -0
  73. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.js +86 -0
  74. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.js.map +1 -0
  75. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.d.ts +26 -0
  76. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.js +32 -0
  77. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.js.map +1 -0
  78. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.d.ts +82 -0
  79. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.js +108 -0
  80. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.js.map +1 -0
  81. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.d.ts +121 -0
  82. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.js +97 -0
  83. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.js.map +1 -0
  84. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.d.ts +52 -0
  85. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.js +68 -0
  86. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.js.map +1 -0
  87. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.d.ts +21 -0
  88. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.js +36 -0
  89. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.js.map +1 -0
  90. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.d.ts +46 -0
  91. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.js +79 -0
  92. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.js.map +1 -0
  93. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.js +31 -0
  94. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.js.map +1 -0
  95. package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.d.ts +8 -4
  96. package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.js.map +1 -1
  97. package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.d.ts +1 -1
  98. package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js +19 -1
  99. package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js.map +1 -1
  100. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.d.ts +10 -4
  101. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.d.ts +0 -4
  102. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.js +224 -3
  103. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.js.map +1 -1
  104. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.d.ts +12 -0
  105. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.js +23 -0
  106. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.js.map +1 -0
  107. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js +17 -6
  108. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js.map +1 -1
  109. package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.d.ts +16 -18
  110. package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js +16 -18
  111. package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js.map +1 -1
  112. package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.d.ts +5 -0
  113. package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js +5 -0
  114. package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js.map +1 -1
  115. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.d.ts +22 -14
  116. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js +23 -15
  117. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js.map +1 -1
  118. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.d.ts +19 -0
  119. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.js +26 -0
  120. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.js.map +1 -0
  121. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.d.ts +17 -0
  122. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.js +40 -1
  123. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.js.map +1 -1
  124. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.d.ts +15 -0
  125. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js +97 -9
  126. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js.map +1 -1
  127. package/dist/domain.operations/genLambdaEndpoint/middleware/getZodIssuesSummary.d.ts +20 -0
  128. package/dist/domain.operations/genLambdaEndpoint/middleware/getZodIssuesSummary.js +31 -2
  129. package/dist/domain.operations/genLambdaEndpoint/middleware/getZodIssuesSummary.js.map +1 -1
  130. package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.d.ts +78 -0
  131. package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.js +103 -0
  132. package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.js.map +1 -0
  133. package/dist/domain.operations/genServiceSdk/gen.file/banner.d.ts +2 -3
  134. package/dist/domain.operations/genServiceSdk/gen.file/banner.js +2 -3
  135. package/dist/domain.operations/genServiceSdk/gen.file/banner.js.map +1 -1
  136. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.d.ts +7 -2
  137. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js +7 -2
  138. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js.map +1 -1
  139. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js +24 -19
  140. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js.map +1 -1
  141. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.d.ts +10 -3
  142. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.js +10 -3
  143. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.js.map +1 -1
  144. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js +9 -23
  145. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js.map +1 -1
  146. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js +11 -18
  147. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js.map +1 -1
  148. package/dist/domain.operations/genServiceSdk/getAllJsonSchemaNodes.d.ts +59 -0
  149. package/dist/domain.operations/genServiceSdk/getAllJsonSchemaNodes.js +87 -0
  150. package/dist/domain.operations/genServiceSdk/getAllJsonSchemaNodes.js.map +1 -0
  151. package/dist/index.d.ts +63 -18
  152. package/dist/index.js +45 -14
  153. package/dist/index.js.map +1 -1
  154. package/package.json +6 -6
  155. package/readme.md +212 -60
  156. package/dist/domain.objects/ApiGatewayRequestPayload.d.ts +0 -12
  157. package/dist/domain.objects/ApiGatewayRequestPayload.js.map +0 -1
  158. package/dist/domain.objects/ApiGatewayResponsePayload.js.map +0 -1
  159. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.d.ts +0 -36
  160. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js.map +0 -1
  161. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.d.ts +0 -19
  162. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js +0 -24
  163. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js.map +0 -1
  164. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayloadJson.js.map +0 -1
  165. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.d.ts +0 -27
  166. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js +0 -118
  167. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js.map +0 -1
  168. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js +0 -34
  169. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js.map +0 -1
  170. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV1ApiGatewayEvent.js.map +0 -1
  171. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayEvent.js.map +0 -1
  172. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.js.map +0 -1
  173. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.d.ts +0 -27
  174. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js +0 -54
  175. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js.map +0 -1
  176. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.d.ts +0 -64
  177. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js.map +0 -1
  178. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.d.ts +0 -20
  179. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js +0 -31
  180. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js.map +0 -1
  181. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.d.ts +0 -5
  182. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.js +0 -16
  183. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.js.map +0 -1
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setEventFrozen = void 0;
4
+ /**
5
+ * .what = freezes a value and every object it reaches, in place
6
+ * .why = `Object.freeze` alone is shallow, so it would leave `event.headers` writable — and
7
+ * `headers` is exactly the object `@middy/http-cors` reads in its `after` hook
8
+ * (`@middy/http-cors/index.js:83`), after the handler has returned
9
+ *
10
+ * .why not `withImmute` = `domain-objects` ships a recursive helper whose name reads as this
11
+ * mechanism and is not it. measured in its dist (`withImmute.js:9-22,27-31`,
12
+ * domain-objects@0.33.0): it adds a `.clone()` — an affordance rather than an enforcement,
13
+ * so a write still succeeds — and it applies only where `isOfDomainObject(value)` holds,
14
+ * so on this plain-interface envelope it is a total no-op
15
+ *
16
+ * .note = in place, deliberately. a defensive copy would remove the same hazard and destroy the
17
+ * projection: `headers === event.headers` would stop to hold, and the bag could drift
18
+ * from the envelope it claims to project (`domain.terms/event.md`)
19
+ */
20
+ const setFrozenDeep = (value, seen) => {
21
+ if (value === null || typeof value !== 'object')
22
+ return;
23
+ if (seen.has(value))
24
+ return;
25
+ seen.add(value);
26
+ Object.freeze(value);
27
+ // recurse over the OWN values only; a prototype belongs to whoever declared it
28
+ for (const nested of Object.values(value))
29
+ setFrozenDeep(nested, seen);
30
+ };
31
+ /**
32
+ * .what = seals the envelope before `invoke` receives it
33
+ * .why = the envelope outlives the handler's turn, so a write through it corrupts a value
34
+ * somebody else reads after `invoke` returns — with no type error and no throw. the freeze
35
+ * makes that unrepresentable
36
+ *
37
+ * .why every family freezes, with no exception = the membership rule is the hand-off, never the
38
+ * reader set. who reads the envelope after `invoke` differs per family — a vendor for
39
+ * `forApiGateway` (`@middy/http-cors` and `…response-serializer`, in their `after` hooks),
40
+ * the sdk itself for `forSqs.perBatch` (`idsInBatch` is built from `decoded.records` after
41
+ * `invoke`), and neither for `forSqs.perRecord` or `forAsk`. an empty column is a
42
+ * property of today, so a rule keyed to one expires silently the first commit that adds a
43
+ * post-invoke read (`rule.require.frozen-invoke-inputs`)
44
+ *
45
+ * .why the cost is paid on purpose = `FrozenDeep<TInput>` makes `event` unassignable to every
46
+ * mutable parameter a handler forwards it to, so a handler must declare its sinks
47
+ * readonly. a guarantee that holds on three variants of four is a trap for whoever moves
48
+ * between them
49
+ *
50
+ * .where = the family root rather than inside `forApiGateway`, because two variants of one family
51
+ * reach for it. lifted on the second use (`rule.prefer.most-common-denominator`)
52
+ *
53
+ * .note = the projections freeze with it, by design: `headers`, `payload`, and `records` are the
54
+ * envelope's own slots, so a handler mutates none (`domain.terms/event.md`)
55
+ * .note = `forSqs.perBatch`'s harm is the sharpest, and `[case17]` walks it end to end: a handler
56
+ * that forges `event.records[n].id` would rewrite the set the unknown-id guard checks
57
+ * against, so the guard passes and sqs is answered with an `itemIdentifier` it cannot
58
+ * match — the message the author meant to save is deleted, on a successful invocation
59
+ *
60
+ * .why a `WeakSet` = an envelope and its `_.raw` share sub-objects, so each is reachable by two
61
+ * paths and would otherwise be walked twice. measured in both families:
62
+ *
63
+ * apiGateway -> `queryStringParameters` and `pathParameters` pass by reference
64
+ * (`asApiGatewayRequestEventUnified.ts:68-69`)
65
+ * sqs -> `wire.Records[n]` is reachable as `event._.raw.Records[n]` and as
66
+ * `event.records[n]._.raw` (`asSqsEventDecoded.ts:37`,
67
+ * `asSqsRecordDecoded.ts:94`)
68
+ *
69
+ * it is not a cycle guard. no cycle is reachable from this event — `requestContext` is an
70
+ * explicit four-field copy of primitives and `headers` is a new object — though the set
71
+ * would terminate one a later author introduced
72
+ *
73
+ * .note = a frozen write throws in strict mode and no-ops in sloppy mode. every module this sdk
74
+ * ships is an es module, which is strict by construction, so the throw is the behavior a
75
+ * consumer meets (ecma-262 §11.2.2)
76
+ * .note = the throw's message is terse — node raises a bare `TypeError: Cannot assign to read
77
+ * only property …`, which names no cause and no remedy. `Object.freeze` accepts no
78
+ * message, and the only mechanism that could supply one is a `Proxy` — a different
79
+ * object, so `headers === event.headers` would stop to hold. the remedy is prevention
80
+ * instead: `FrozenDeep` refuses the write at compile time, so a type-checked consumer
81
+ * never reaches the message (`rule.prefer.prevent-over-correct`)
82
+ *
83
+ * .why it returns = the same reference, narrowed to `FrozenDeep`. it still freezes in place — the
84
+ * return is the type half of one act, so a caller receives the guarantee from the step
85
+ * that establishes it rather than asserts it by hand at the hand-off
86
+ */
87
+ const setEventFrozen = (input) => {
88
+ setFrozenDeep(input.event, new WeakSet());
89
+ /**
90
+ * .why the cast = `FrozenDeep<TEvent>` is a conditional type, so on an unresolved generic
91
+ * typescript defers it and cannot prove `TEvent` satisfies it — a limit of the checker,
92
+ * never a gap in the claim. the line above is the proof, and it runs first
93
+ *
94
+ * .why here = this is the one named transformer whose whole job is the narrowing, so the
95
+ * assertion sits at the single seam that earns it rather than at every call site
96
+ * (`rule.forbid.as-cast` — an `as` at a boundary, documented, with its removal named)
97
+ *
98
+ * .removal = drops if typescript ever proves a homomorphic mapped type against its own input
99
+ */
100
+ return input.event;
101
+ };
102
+ exports.setEventFrozen = setEventFrozen;
103
+ //# sourceMappingURL=setEventFrozen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setEventFrozen.js","sourceRoot":"","sources":["../../../src/domain.operations/genLambdaEndpoint/setEventFrozen.ts"],"names":[],"mappings":";;;AAwBA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,aAAa,GAAG,CAAC,KAAc,EAAE,IAAqB,EAAQ,EAAE;IACpE,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO;IACxD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO;IAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEhB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErB,+EAA+E;IAC/E,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACI,MAAM,cAAc,GAAG,CAAS,KAEtC,EAAsB,EAAE;IACvB,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IAE1C;;;;;;;;;;OAUG;IACH,OAAO,KAAK,CAAC,KAA2B,CAAC;AAC3C,CAAC,CAAC;AAjBW,QAAA,cAAc,kBAiBzB"}
@@ -2,8 +2,7 @@
2
2
  * .what = the "generated — do not edit" banner prepended to every emitted file
3
3
  * .why = readers should re-run the codegen, not hand-edit the output (uc.1); the
4
4
  * robot-arm 🦾 signals at a glance that a machine wrote this file
5
- * .note = the glyph must survive the biome/stdin format pass — an earlier ⚠️ was
6
- * mangled to `!` by the pipe (5.3 verification i4); 🦾 is asserted to
7
- * round-trip cleanly in formatTypescript.integration.test.ts
5
+ * .note = the glyph must survive the biome/stdin format pass — not every emoji does, so 🦾 is
6
+ * asserted to round-trip cleanly in formatTypescript.integration.test.ts
8
7
  */
9
8
  export declare const banner = "/**\n * \uD83E\uDDBE generated by `sdk-aws-lambda gen` \u2014 do not edit.\n * re-run the codegen to update.\n */";
@@ -5,9 +5,8 @@ exports.banner = void 0;
5
5
  * .what = the "generated — do not edit" banner prepended to every emitted file
6
6
  * .why = readers should re-run the codegen, not hand-edit the output (uc.1); the
7
7
  * robot-arm 🦾 signals at a glance that a machine wrote this file
8
- * .note = the glyph must survive the biome/stdin format pass — an earlier ⚠️ was
9
- * mangled to `!` by the pipe (5.3 verification i4); 🦾 is asserted to
10
- * round-trip cleanly in formatTypescript.integration.test.ts
8
+ * .note = the glyph must survive the biome/stdin format pass — not every emoji does, so 🦾 is
9
+ * asserted to round-trip cleanly in formatTypescript.integration.test.ts
11
10
  */
12
11
  exports.banner = `/**
13
12
  * 🦾 generated by \`sdk-aws-lambda gen\` — do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.file/banner.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACU,QAAA,MAAM,GAAG;;;IAGlB,CAAC"}
1
+ {"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.file/banner.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACU,QAAA,MAAM,GAAG;;;IAGlB,CAAC"}
@@ -5,8 +5,13 @@ import type { LambdaEndpointSchema } from '../../../domain.objects/LambdaEndpoin
5
5
  * .why = the mechanisms file exposes one fn per discovered endpoint (uc.1); each
6
6
  * is a thin, typed call into the endpoint by its service+function
7
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)
8
+ * .note = `event` is **the whole object the invoke delivers** — aws's own word, and this
9
+ * repo's term for it (`domain.terms/event.md`). a direct-invoke lambda carries no
10
+ * envelope, so what arrives IS the caller's input and the two coincide here. that
11
+ * coincidence is a property of this trigger, never of the word: at api gateway the
12
+ * two differ, and there `event` names the envelope while `payload` names its body
13
+ *
14
+ * .note = the wrapper keeps the caller's `context` ambient (env.access lives there)
10
15
  */
11
16
  export declare const asMechanismFnSource: (input: {
12
17
  service: string;
@@ -8,8 +8,13 @@ const getTypescriptFromJsonSchema_1 = require("./getTypescriptFromJsonSchema");
8
8
  * .why = the mechanisms file exposes one fn per discovered endpoint (uc.1); each
9
9
  * is a thin, typed call into the endpoint by its service+function
10
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)
11
+ * .note = `event` is **the whole object the invoke delivers** — aws's own word, and this
12
+ * repo's term for it (`domain.terms/event.md`). a direct-invoke lambda carries no
13
+ * envelope, so what arrives IS the caller's input and the two coincide here. that
14
+ * coincidence is a property of this trigger, never of the word: at api gateway the
15
+ * two differ, and there `event` names the envelope while `payload` names its body
16
+ *
17
+ * .note = the wrapper keeps the caller's `context` ambient (env.access lives there)
13
18
  */
14
19
  const asMechanismFnSource = (input) => {
15
20
  // the typed shapes for this endpoint's event (input) and result (output)
@@ -1 +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"}
1
+ {"version":3,"file":"asMechanismFnSource.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.ts"],"names":[],"mappings":";;;AACA,+EAA4E;AAE5E;;;;;;;;;;;;;GAaG;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"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRefGenericsUsed = exports.getTypescriptFromJsonSchema = void 0;
4
4
  const helpful_errors_1 = require("helpful-errors");
5
+ const getAllJsonSchemaNodes_1 = require("../getAllJsonSchemaNodes");
5
6
  /**
6
7
  * .what = compile a json-schema into a TypeScript type literal string
7
8
  * .why = the codegen needs typed shapes for mechanism args/returns + resource
@@ -68,6 +69,23 @@ const asType = (node, dobjRefs, skipRootPragma = false) => {
68
69
  return asArray(node, dobjRefs);
69
70
  if (type === 'object')
70
71
  return asObject(node, dobjRefs);
72
+ // `not: {}` → void. the node declares that NO json value is valid at this position —
73
+ // the shape `getJsonSchemaFromZod` emits for a `z.undefined()` / `z.void()` position,
74
+ // and the shape zod itself emits for `z.never()`
75
+ //
76
+ // .why `void` and not `never` = it must read correctly at BOTH positions this node
77
+ // reaches. as a mechanism's return, `Promise<void>` is right and `Promise<never>`
78
+ // would claim the call cannot return at all; as a key, `k?: void` permits the key
79
+ // to be absent, which is what the position accepts. `void` is the one TS type that
80
+ // is correct in each
81
+ //
82
+ // ⚠️ .why it is NOT left to the `unknown` fallthrough below = `unknown` says "any value
83
+ // may be here", which is the exact inverse of what this node declares. so the
84
+ // generated client would carry a rubber-stamp for the one position whose contract
85
+ // is the most precise one available (rule.forbid.failhide)
86
+ const not = node.not;
87
+ if (not && Object.keys(not).length === 0)
88
+ return 'void';
71
89
  // no recognizable shape → unknown (surfaces upstream schema looseness)
72
90
  return 'unknown';
73
91
  };
@@ -130,7 +148,7 @@ const REF_GENERIC_BY = {
130
148
  };
131
149
  /**
132
150
  * .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)
151
+ * pragma stamped by `X.contract().ref(by)` in domain-objects)
134
152
  * .why = a reference field carries only the referenced dobj (`of`) + which key (`by`)
135
153
  */
136
154
  const asRefPragma = (node) => node['x-domain-object-ref'];
@@ -161,27 +179,14 @@ const asRefType = (node, dobjRefs) => {
161
179
  */
162
180
  const getRefGenericsUsed = (input) => {
163
181
  const used = new Set();
164
- collectRefGenerics(input.schema, input.dobjRefs, used);
182
+ for (const node of (0, getAllJsonSchemaNodes_1.getAllJsonSchemaNodes)({ root: input.schema })) {
183
+ const ref = asRefPragma(node);
184
+ if (ref && input.dobjRefs[ref.of])
185
+ used.add(REF_GENERIC_BY[ref.by]);
186
+ }
165
187
  return [...used].sort();
166
188
  };
167
189
  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
190
  /**
186
191
  * .what = render a property key, quoted when it is not a valid identifier
187
192
  */
@@ -1 +1 @@
1
- {"version":3,"file":"getTypescriptFromJsonSchema.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.ts"],"names":[],"mappings":";;;AACA,mDAAyD;AAGzD;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,2BAA2B,GAAG,CAAC,KAI3C,EAAU,EAAE,CACX,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAE,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,CAAC;AAL5D,QAAA,2BAA2B,+BAKiC;AAEzE;;;GAGG;AACH,MAAM,MAAM,GAAG,CACb,IAAgB,EAChB,QAAgC,EAChC,cAAc,GAAG,KAAK,EACd,EAAE;IACV,6EAA6E;IAC7E,wFAAwF;IACxF,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC1C,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAE5B,8EAA8E;IAC9E,4EAA4E;IAC5E,MAAM,MAAM,GAAI,IAAiD,CAC/D,iBAAiB,CAClB,CAAC;IACF,IAAI,CAAC,cAAc,IAAI,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QACpD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAW,CAAC;IAEzC,uBAAuB;IACvB,IAAI,OAAO,IAAI,IAAI;QAAE,OAAO,SAAS,CAAE,IAA2B,CAAC,KAAK,CAAC,CAAC;IAE1E,2BAA2B;IAC3B,MAAM,UAAU,GAAI,IAA6B,CAAC,IAAI,CAAC;IACvD,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAE7D,wBAAwB;IACxB,MAAM,KAAK,GACR,IAAiC,CAAC,K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;QAAE,OAAO;IAEtD,MAAM,GAAG,GAAG,WAAW,CAAC,IAAkB,CAAC,CAAC;IAC5C,IAAI,GAAG,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAAE,IAAI,CAAC,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"}
1
+ {"version":3,"file":"getTypescriptFromJsonSchema.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.ts"],"names":[],"mappings":";;;AACA,mDAAyD;AAGzD,oEAAiE;AAEjE;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,2BAA2B,GAAG,CAAC,KAI3C,EAAU,EAAE,CACX,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAE,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,CAAC;AAL5D,QAAA,2BAA2B,+BAKiC;AAEzE;;;GAGG;AACH,MAAM,MAAM,GAAG,CACb,IAAgB,EAChB,QAAgC,EAChC,cAAc,GAAG,KAAK,EACd,EAAE;IACV,6EAA6E;IAC7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AAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC"}
@@ -4,11 +4,18 @@ import type { DomainObjectCaptured } from '../../../domain.objects/DomainObjectC
4
4
  * .what = read the `x-domain-object` pragma off one json-schema node → a
5
5
  * DomainObjectCaptured, or null when the node carries no pragma
6
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
7
+ * from `X.contract()`; a plain shape has no pragma and stays a plain type
8
8
  *
9
- * .kind = domain-objects@0.33.0 stamps the true `kind` on the pragma (via getKind).
9
+ * .kind = domain-objects stamps the true `kind` on the pragma (via getKind) since 0.33.0.
10
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)
11
+ * only for a pre-0.33 producer whose pragma omits `kind`
12
+ *
13
+ * .note = ⚠️ that fallback is REAL backcompat, and it holds for a reason this repo's own
14
+ * version cannot settle: the pragma's producer is the REMOTE lambda under
15
+ * introspection, which runs its own `domain-objects` on its own release cadence.
16
+ * so our bump to 0.34.0 does not retire a pre-0.33 producer — a peer service
17
+ * still on 0.32.x emits a `kind`-less pragma, and to drop the fallback would
18
+ * mis-type its every entity as a literal, silently
12
19
  */
13
20
  export declare const asDomainObjectPragma: (input: {
14
21
  node: JSONSchema;
@@ -5,11 +5,18 @@ exports.asDomainObjectPragma = void 0;
5
5
  * .what = read the `x-domain-object` pragma off one json-schema node → a
6
6
  * DomainObjectCaptured, or null when the node carries no pragma
7
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
8
+ * from `X.contract()`; a plain shape has no pragma and stays a plain type
9
9
  *
10
- * .kind = domain-objects@0.33.0 stamps the true `kind` on the pragma (via getKind).
10
+ * .kind = domain-objects stamps the true `kind` on the pragma (via getKind) since 0.33.0.
11
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)
12
+ * only for a pre-0.33 producer whose pragma omits `kind`
13
+ *
14
+ * .note = ⚠️ that fallback is REAL backcompat, and it holds for a reason this repo's own
15
+ * version cannot settle: the pragma's producer is the REMOTE lambda under
16
+ * introspection, which runs its own `domain-objects` on its own release cadence.
17
+ * so our bump to 0.34.0 does not retire a pre-0.33 producer — a peer service
18
+ * still on 0.32.x emits a `kind`-less pragma, and to drop the fallback would
19
+ * mis-type its every entity as a literal, silently
13
20
  */
14
21
  const asDomainObjectPragma = (input) => {
15
22
  // read the pragma keyword off the node (absent → not a domain-object)
@@ -1 +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"}
1
+ {"version":3,"file":"asDomainObjectPragma.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.ts"],"names":[],"mappings":";;;AAKA;;;;;;;;;;;;;;;;GAgBG;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"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assertAllDomainObjectRefsBind = void 0;
4
4
  const LambdaDomainObjectRefUnbindableError_1 = require("../../../domain.objects/LambdaDomainObjectRefUnbindableError");
5
+ const getAllJsonSchemaNodes_1 = require("../getAllJsonSchemaNodes");
5
6
  /**
6
7
  * .what = verify every `x-domain-object-ref` across a service's contracts names a
7
8
  * dobj that is captured in full (present in `capturedNames`)
@@ -15,10 +16,13 @@ const LambdaDomainObjectRefUnbindableError_1 = require("../../../domain.objects/
15
16
  const assertAllDomainObjectRefsBind = (input) => {
16
17
  const referencedNames = new Set();
17
18
  // walk each endpoint's input + output schema trees for ref-pragma names
18
- for (const schema of Object.values(input.contracts)) {
19
- collectRefNames({ node: schema.input, into: referencedNames });
20
- collectRefNames({ node: schema.output, into: referencedNames });
21
- }
19
+ for (const schema of Object.values(input.contracts))
20
+ for (const root of [schema.input, schema.output])
21
+ for (const node of (0, getAllJsonSchemaNodes_1.getAllJsonSchemaNodes)({ root })) {
22
+ const ref = node['x-domain-object-ref'];
23
+ if (ref?.of)
24
+ referencedNames.add(ref.of);
25
+ }
22
26
  // every referenced name must be captured in full; else the ref cannot bind
23
27
  const unbound = [...referencedNames]
24
28
  .filter((name) => !input.capturedNames.has(name))
@@ -26,26 +30,8 @@ const assertAllDomainObjectRefsBind = (input) => {
26
30
  if (unbound.length > 0)
27
31
  throw new LambdaDomainObjectRefUnbindableError_1.LambdaDomainObjectRefUnbindableError(`domain-object reference(s) cannot bind: ${unbound.join(', ')} — referenced by key but captured by no endpoint`, {
28
32
  unbound,
29
- hint: 'surface each referenced domain-object in full on some endpoint of this service (return it whole via `.contract`) so the codegen can declare its resource',
33
+ hint: 'surface each referenced domain-object in full on some endpoint of this service (return it whole via `X.contract()`) so the codegen can declare its resource',
30
34
  });
31
35
  };
32
36
  exports.assertAllDomainObjectRefsBind = assertAllDomainObjectRefsBind;
33
- /**
34
- * .what = recursively read every `x-domain-object-ref` name in a schema tree
35
- */
36
- const collectRefNames = (input) => {
37
- const { node, into } = input;
38
- if (typeof node !== 'object' || node === null)
39
- return;
40
- const ref = node['x-domain-object-ref'];
41
- if (ref?.of)
42
- into.add(ref.of);
43
- for (const value of Object.values(node)) {
44
- if (Array.isArray(value))
45
- for (const item of value)
46
- collectRefNames({ node: item, into });
47
- else
48
- collectRefNames({ node: value, into });
49
- }
50
- };
51
37
  //# sourceMappingURL=assertAllDomainObjectRefsBind.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertAllDomainObjectRefsBind.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.ts"],"names":[],"mappings":";;;AAEA,uHAAoH;AAGpH;;;;;;;;;GASG;AACI,MAAM,6BAA6B,GAAG,CAAC,KAG7C,EAAQ,EAAE;IACT,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAE1C,wEAAwE;IACxE,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QACpD,eAAe,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;QAC/D,eAAe,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,2EAA2E;IAC3E,MAAM,OAAO,GAAG,CAAC,GAAG,eAAe,CAAC;SACjC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAChD,IAAI,EAAE,CAAC;IACV,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QACpB,MAAM,IAAI,2EAAoC,CAC5C,2CAA2C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,kDAAkD,EAC/G;YACE,OAAO;YACP,IAAI,EAAE,0JAA0J;SACjK,CACF,CAAC;AACN,CAAC,CAAC;AAxBW,QAAA,6BAA6B,iCAwBxC;AAEF;;GAEG;AACH,MAAM,eAAe,GAAG,CAAC,KAA2C,EAAQ,EAAE;IAC5E,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAC7B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO;IAEtD,MAAM,GAAG,GAAI,IAA0D,CACrE,qBAAqB,CACtB,CAAC;IACF,IAAI,GAAG,EAAE,EAAE;QAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAE9B,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,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;;YAC7D,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"assertAllDomainObjectRefsBind.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.ts"],"names":[],"mappings":";;;AAEA,uHAAoH;AAEpH,oEAAiE;AAEjE;;;;;;;;;GASG;AACI,MAAM,6BAA6B,GAAG,CAAC,KAG7C,EAAQ,EAAE;IACT,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAE1C,wEAAwE;IACxE,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;QACjD,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;YAC9C,KAAK,MAAM,IAAI,IAAI,IAAA,6CAAqB,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;gBACnD,MAAM,GAAG,GAAI,IAA0D,CACrE,qBAAqB,CACtB,CAAC;gBACF,IAAI,GAAG,EAAE,EAAE;oBAAE,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC3C,CAAC;IAEL,2EAA2E;IAC3E,MAAM,OAAO,GAAG,CAAC,GAAG,eAAe,CAAC;SACjC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAChD,IAAI,EAAE,CAAC;IACV,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QACpB,MAAM,IAAI,2EAAoC,CAC5C,2CAA2C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,kDAAkD,EAC/G;YACE,OAAO;YACP,IAAI,EAAE,6JAA6J;SACpK,CACF,CAAC;AACN,CAAC,CAAC;AA5BW,QAAA,6BAA6B,iCA4BxC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAllDomainObjectsFromContracts = void 0;
4
4
  const LambdaDomainObjectNotCapturableError_1 = require("../../../domain.objects/LambdaDomainObjectNotCapturableError");
5
+ const getAllJsonSchemaNodes_1 = require("../getAllJsonSchemaNodes");
5
6
  const asDomainObjectPragma_1 = require("./asDomainObjectPragma");
6
7
  /**
7
8
  * .what = collect every domain-object captured across a service's contracts,
@@ -16,23 +17,23 @@ const getAllDomainObjectsFromContracts = (input) => {
16
17
  // collect every dobj contract from every endpoint's input + output schemas
17
18
  const captured = new Map();
18
19
  // walk each endpoint's input and output schema trees
19
- for (const schema of Object.values(input.contracts)) {
20
- collectFromNode({ node: schema.input, captured });
21
- collectFromNode({ node: schema.output, captured });
22
- }
20
+ for (const schema of Object.values(input.contracts))
21
+ for (const root of [schema.input, schema.output])
22
+ for (const node of (0, getAllJsonSchemaNodes_1.getAllJsonSchemaNodes)({ root }))
23
+ captureDomainObjectAt({ node, captured });
23
24
  // return the de-duplicated contracts in stable (name-sorted) order
24
25
  return [...captured.values()].sort((a, b) => a.name.localeCompare(b.name));
25
26
  };
26
27
  exports.getAllDomainObjectsFromContracts = getAllDomainObjectsFromContracts;
27
28
  /**
28
- * .what = recursively walk a json-schema node, collect every `x-domain-object`
29
- * .why = a dobj can appear at any depth (properties, items, $defs, anyOf, etc.)
29
+ * .what = capture ONE node, if it carries an `x-domain-object` pragma
30
+ * .why = the descent that reaches every node is `getAllJsonSchemaNodes`; what is left here
31
+ * is this file's own semantics — the pragma read, the uc.9 guard, and the de-dup.
32
+ * a dobj can appear at any depth (properties, items, $defs, anyOf, etc.), and the
33
+ * walker reaches each without this function aware of the shape it sat in
30
34
  */
31
- const collectFromNode = (input) => {
35
+ const captureDomainObjectAt = (input) => {
32
36
  const { node, captured } = input;
33
- // skip non-object nodes (leaves like strings/booleans/numbers)
34
- if (typeof node !== 'object' || node === null)
35
- return;
36
37
  // capture this node if it carries a domain-object pragma
37
38
  const contract = (0, asDomainObjectPragma_1.asDomainObjectPragma)({ node: node });
38
39
  if (contract) {
@@ -46,14 +47,6 @@ const collectFromNode = (input) => {
46
47
  if (!captured.has(contract.name))
47
48
  captured.set(contract.name, contract);
48
49
  }
49
- // recurse into every child value (arrays + nested objects)
50
- for (const value of Object.values(node)) {
51
- if (Array.isArray(value))
52
- for (const item of value)
53
- collectFromNode({ node: item, captured });
54
- else
55
- collectFromNode({ node: value, captured });
56
- }
57
50
  };
58
51
  /**
59
52
  * .what = decide whether a schema node has an object shape we can reconstruct
@@ -1 +1 @@
1
- {"version":3,"file":"getAllDomainObjectsFromContracts.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.ts"],"names":[],"mappings":";;;AAGA,uHAAoH;AAEpH,iEAA8D;AAE9D;;;;;;;;GAQG;AACI,MAAM,gCAAgC,GAAG,CAAC,KAEhD,EAA0B,EAAE;IAC3B,2EAA2E;IAC3E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAgC,CAAC;IAEzD,qDAAqD;IACrD,KAAK,MAAM,MAAM,IAAI,MAAM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AED,2DAA2D;IAC3D,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,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;;YACjE,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClD,CAAC;AACH,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAW,EAAE;IACrD,MAAM,UAAU,GAAI,IAAiC,CAAC,UAAU,CAAC;IACjE,OAAO,CACL,OAAO,UAAU,KAAK,QAAQ;QAC9B,UAAU,KAAK,IAAI;QACnB,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CACnC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"getAllDomainObjectsFromContracts.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.ts"],"names":[],"mappings":";;;AAGA,uHAAoH;AAEpH,oEAAiE;AACjE,iEAA8D;AAE9D;;;;;;;;GAQG;AACI,MAAM,gCAAgC,GAAG,CAAC,KAEhD,EAA0B,EAAE;IAC3B,2EAA2E;IAC3E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAgC,CAAC;IAEzD,qDAAqD;IACrD,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;QACjD,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;YAC9C,KAAK,MAAM,IAAI,IAAI,IAAA,6CAAqB,EAAC,EAAE,IAAI,EAAE,CAAC;gBAChD,qBAAqB,CAAC,EAAE,IAAI,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AC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * .what = every object node in a json-schema tree, in pre-order
3
+ * .why = three call sites each hand-rolled this identical recursive descent, which clears
4
+ * `rule.prefer.wet-over-dry`'s rule-of-three by a wide margin. each one wanted the
5
+ * SAME traversal and a DIFFERENT thing per node, so the walk was all they shared
6
+ *
7
+ * .the three it replaces:
8
+ * - `collectRefNames` — `gen.resource/assertAllDomainObjectRefsBind.ts`
9
+ * - `collectFromNode` — `gen.resource/getAllDomainObjectsFromContracts.ts`
10
+ * - `collectRefGenerics` — `gen.mechanism/getTypescriptFromJsonSchema.ts`
11
+ *
12
+ * .why it returns a LIST rather than takes a `visit` callback = a list turns each caller's
13
+ * body into a flat `for` loop it can read in one pass. a callback keeps the inversion
14
+ * of control the hand-rolled recursion already had, so it would have collapsed the
15
+ * duplication and left the decode cost (`rule.forbid.inline-decode-friction`), and
16
+ * its name would have had to start with a verb the repo does not sanction
17
+ * (`rule.require.get-set-gen-verbs`)
18
+ *
19
+ * .why it lives HERE = `gen.resource/` and `gen.mechanism/` are the two consumers, so
20
+ * `genServiceSdk/` is their common ancestor (`rule.prefer.most-common-denominator`).
21
+ * it is not lifted higher: no third subtree asks for it
22
+ *
23
+ * ⚠️ .why PRE-ORDER is part of the contract = one caller
24
+ * (`getAllDomainObjectsFromContracts`) keeps the FIRST capture of a repeated name and
25
+ * throws on the first uncapturable one, so the order a node is met in is observable. a
26
+ * post-order or breadth-first walk would change which duplicate wins and which node the
27
+ * throw names
28
+ *
29
+ * .note = it descends EVERY value of every object, so `properties`, `items`, `$defs`,
30
+ * `anyOf`, and any keyword a future zod emits are all reached with no edit here.
31
+ * that is the property the three hand-rolled copies each had, and each had to keep
32
+ *
33
+ * ⚠️ .why a VISITED set = a graph that cycles by IDENTITY has no base case here, so the
34
+ * descent recurses until the stack blows — a `RangeError` with no diagnostic, at all
35
+ * three consumers at once. the three hand-rolled copies each carried the same hole;
36
+ * one shared walk is what lets ONE guard close it (that correctness fix is the payoff
37
+ * the extraction was argued on, so it belongs here rather than deferred)
38
+ *
39
+ * - today's real inputs are acyclic: `z.toJSONSchema` emits a self-reference as the
40
+ * STRING `'#'`, which is a leaf, so no shipped fixture reaches the guard
41
+ * - ⇒ so this guards against a shape zod does not emit TODAY, and against the
42
+ * hand-built fixture that a caller of this now-shared primitive may hand it
43
+ *
44
+ * ⚠️ .the consequence is WIDER than a cycle, and it is deliberate = the set dedupes by
45
+ * REFERENCE, so a DAG — one object reachable by two distinct paths — is now recorded
46
+ * ONCE rather than twice. measured against all three consumers before it landed:
47
+ *
48
+ * - `assertAllDomainObjectRefsBind` -> `referencedNames.add(ref.of)` — a Set
49
+ * - `getAllDomainObjectsFromContracts` -> a Map keyed by name, first wins — set-like
50
+ * - `getTypescriptFromJsonSchema` -> `used.add(REF_GENERIC_BY[…])` — a Set
51
+ *
52
+ * ⇒ every one accumulates set-semantically by NAME, so a second visit to the SAME
53
+ * object adds no entry any of them can observe. a caller that COUNTED nodes would
54
+ * observe it, and no such caller exists — `[case6]` states the property so a future
55
+ * one meets it as a contract rather than as a surprise
56
+ */
57
+ export declare const getAllJsonSchemaNodes: (input: {
58
+ root: unknown;
59
+ }) => object[];
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAllJsonSchemaNodes = void 0;
4
+ /**
5
+ * .what = every object node in a json-schema tree, in pre-order
6
+ * .why = three call sites each hand-rolled this identical recursive descent, which clears
7
+ * `rule.prefer.wet-over-dry`'s rule-of-three by a wide margin. each one wanted the
8
+ * SAME traversal and a DIFFERENT thing per node, so the walk was all they shared
9
+ *
10
+ * .the three it replaces:
11
+ * - `collectRefNames` — `gen.resource/assertAllDomainObjectRefsBind.ts`
12
+ * - `collectFromNode` — `gen.resource/getAllDomainObjectsFromContracts.ts`
13
+ * - `collectRefGenerics` — `gen.mechanism/getTypescriptFromJsonSchema.ts`
14
+ *
15
+ * .why it returns a LIST rather than takes a `visit` callback = a list turns each caller's
16
+ * body into a flat `for` loop it can read in one pass. a callback keeps the inversion
17
+ * of control the hand-rolled recursion already had, so it would have collapsed the
18
+ * duplication and left the decode cost (`rule.forbid.inline-decode-friction`), and
19
+ * its name would have had to start with a verb the repo does not sanction
20
+ * (`rule.require.get-set-gen-verbs`)
21
+ *
22
+ * .why it lives HERE = `gen.resource/` and `gen.mechanism/` are the two consumers, so
23
+ * `genServiceSdk/` is their common ancestor (`rule.prefer.most-common-denominator`).
24
+ * it is not lifted higher: no third subtree asks for it
25
+ *
26
+ * ⚠️ .why PRE-ORDER is part of the contract = one caller
27
+ * (`getAllDomainObjectsFromContracts`) keeps the FIRST capture of a repeated name and
28
+ * throws on the first uncapturable one, so the order a node is met in is observable. a
29
+ * post-order or breadth-first walk would change which duplicate wins and which node the
30
+ * throw names
31
+ *
32
+ * .note = it descends EVERY value of every object, so `properties`, `items`, `$defs`,
33
+ * `anyOf`, and any keyword a future zod emits are all reached with no edit here.
34
+ * that is the property the three hand-rolled copies each had, and each had to keep
35
+ *
36
+ * ⚠️ .why a VISITED set = a graph that cycles by IDENTITY has no base case here, so the
37
+ * descent recurses until the stack blows — a `RangeError` with no diagnostic, at all
38
+ * three consumers at once. the three hand-rolled copies each carried the same hole;
39
+ * one shared walk is what lets ONE guard close it (that correctness fix is the payoff
40
+ * the extraction was argued on, so it belongs here rather than deferred)
41
+ *
42
+ * - today's real inputs are acyclic: `z.toJSONSchema` emits a self-reference as the
43
+ * STRING `'#'`, which is a leaf, so no shipped fixture reaches the guard
44
+ * - ⇒ so this guards against a shape zod does not emit TODAY, and against the
45
+ * hand-built fixture that a caller of this now-shared primitive may hand it
46
+ *
47
+ * ⚠️ .the consequence is WIDER than a cycle, and it is deliberate = the set dedupes by
48
+ * REFERENCE, so a DAG — one object reachable by two distinct paths — is now recorded
49
+ * ONCE rather than twice. measured against all three consumers before it landed:
50
+ *
51
+ * - `assertAllDomainObjectRefsBind` -> `referencedNames.add(ref.of)` — a Set
52
+ * - `getAllDomainObjectsFromContracts` -> a Map keyed by name, first wins — set-like
53
+ * - `getTypescriptFromJsonSchema` -> `used.add(REF_GENERIC_BY[…])` — a Set
54
+ *
55
+ * ⇒ every one accumulates set-semantically by NAME, so a second visit to the SAME
56
+ * object adds no entry any of them can observe. a caller that COUNTED nodes would
57
+ * observe it, and no such caller exists — `[case6]` states the property so a future
58
+ * one meets it as a contract rather than as a surprise
59
+ */
60
+ const getAllJsonSchemaNodes = (input) => {
61
+ const nodes = [];
62
+ // track nodes already recorded, so a cycle terminates and a DAG is not double-counted
63
+ const visited = new WeakSet();
64
+ const descend = (node) => {
65
+ // skip leaves — a string, a number, a boolean, a null carries no node
66
+ if (typeof node !== 'object' || node === null)
67
+ return;
68
+ // stop at a node already met, so a cycle by identity terminates rather than overflows
69
+ if (visited.has(node))
70
+ return;
71
+ visited.add(node);
72
+ // record this node BEFORE its children, so the list reads in pre-order
73
+ nodes.push(node);
74
+ // descend into every child value, arrays and nested objects alike
75
+ for (const value of Object.values(node)) {
76
+ if (Array.isArray(value))
77
+ for (const item of value)
78
+ descend(item);
79
+ else
80
+ descend(value);
81
+ }
82
+ };
83
+ descend(input.root);
84
+ return nodes;
85
+ };
86
+ exports.getAllJsonSchemaNodes = getAllJsonSchemaNodes;
87
+ //# sourceMappingURL=getAllJsonSchemaNodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllJsonSchemaNodes.js","sourceRoot":"","sources":["../../../src/domain.operations/genServiceSdk/getAllJsonSchemaNodes.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAwB,EAAY,EAAE;IAC1E,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,sFAAsF;IACtF,MAAM,OAAO,GAAG,IAAI,OAAO,EAAU,CAAC;IAEtC,MAAM,OAAO,GAAG,CAAC,IAAa,EAAQ,EAAE;QACtC,sEAAsE;QACtE,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO;QAEtD,sFAAsF;QACtF,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QAC9B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAElB,uEAAuE;QACvE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEjB,kEAAkE;QAClE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,IAA+B,CAAC,EAAE,CAAC;YACnE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBAAE,KAAK,MAAM,IAAI,IAAI,KAAK;oBAAE,OAAO,CAAC,IAAI,CAAC,CAAC;;gBAC7D,OAAO,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA1BW,QAAA,qBAAqB,yBA0BhC"}