sdk-aws-lambda 0.4.2 → 0.6.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 (204) hide show
  1. package/dist/contract/cli/gen.js +18 -0
  2. package/dist/contract/cli/gen.js.map +1 -1
  3. package/dist/domain.objects/AwsIdentitySynthetic.d.ts +20 -0
  4. package/dist/domain.objects/AwsIdentitySynthetic.js +24 -0
  5. package/dist/domain.objects/AwsIdentitySynthetic.js.map +1 -0
  6. package/dist/domain.objects/LambdaEndpointDialect.d.ts +19 -0
  7. package/dist/domain.objects/LambdaEndpointDialect.js +3 -0
  8. package/dist/domain.objects/LambdaEndpointDialect.js.map +1 -0
  9. package/dist/domain.objects/LambdaEndpointErrorResponseBody.d.ts +70 -0
  10. package/dist/domain.objects/LambdaEndpointErrorResponseBody.js +41 -0
  11. package/dist/domain.objects/LambdaEndpointErrorResponseBody.js.map +1 -0
  12. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.asExampleUuid.d.ts +7 -0
  13. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.asExampleUuid.js +13 -0
  14. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.asExampleUuid.js.map +1 -0
  15. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.constants.d.ts +36 -0
  16. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.constants.js +88 -0
  17. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.constants.js.map +1 -0
  18. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.d.ts +81 -0
  19. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromApiGateway.d.ts +75 -0
  20. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromApiGateway.js +163 -0
  21. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromApiGateway.js.map +1 -0
  22. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromKinesis.d.ts +32 -0
  23. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromKinesis.js +55 -0
  24. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromKinesis.js.map +1 -0
  25. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromS3.d.ts +40 -0
  26. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromS3.js +71 -0
  27. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromS3.js.map +1 -0
  28. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromSns.d.ts +27 -0
  29. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromSns.js +51 -0
  30. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromSns.js.map +1 -0
  31. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromSqs.d.ts +35 -0
  32. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromSqs.js +50 -0
  33. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.fromSqs.js.map +1 -0
  34. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.js +59 -0
  35. package/dist/domain.operations/asLambdaEvent/asLambdaEvent.js.map +1 -0
  36. package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.d.ts +2 -1
  37. package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.js +19 -18
  38. package/dist/domain.operations/askLambdaEndpoint/askLambdaEndpoint.js.map +1 -1
  39. package/dist/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.js +1 -1
  40. package/dist/domain.operations/askLambdaEndpoint/invoke/executeLambdaInvocation.js.map +1 -1
  41. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.d.ts +24 -0
  42. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js +24 -0
  43. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js.map +1 -1
  44. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.d.ts +19 -0
  45. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js.map +1 -1
  46. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js +7 -7
  47. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js.map +1 -1
  48. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.d.ts +37 -10
  49. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js +3 -2
  50. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js.map +1 -1
  51. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js +6 -6
  52. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js.map +1 -1
  53. package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.d.ts +1 -1
  54. package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js +19 -1
  55. package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js.map +1 -1
  56. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.d.ts +0 -4
  57. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.js +224 -3
  58. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.getJsonSchemaFromZod.js.map +1 -1
  59. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.d.ts +12 -4
  60. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js +12 -4
  61. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js.map +1 -1
  62. package/dist/domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody.d.ts +6 -19
  63. package/dist/domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody.js +6 -1
  64. package/dist/domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody.js.map +1 -1
  65. package/dist/domain.operations/genLambdaEndpoint/middleware/getUnwrappedEventWithExid.d.ts +1 -1
  66. package/dist/domain.operations/genLambdaEndpoint/middleware/getUnwrappedEventWithExid.js +1 -1
  67. package/dist/domain.operations/genLambdaEndpoint/middleware/getUnwrappedEventWithExid.js.map +1 -1
  68. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.d.ts +22 -0
  69. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.js +29 -0
  70. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.js.map +1 -0
  71. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.d.ts +35 -0
  72. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.js +58 -1
  73. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.js.map +1 -1
  74. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.d.ts +1 -0
  75. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js +65 -9
  76. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js.map +1 -1
  77. package/dist/domain.operations/genLambdaEndpoint/middleware/getZodIssuesSummary.d.ts +20 -0
  78. package/dist/domain.operations/genLambdaEndpoint/middleware/getZodIssuesSummary.js +31 -2
  79. package/dist/domain.operations/genLambdaEndpoint/middleware/getZodIssuesSummary.js.map +1 -1
  80. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js +24 -19
  81. package/dist/domain.operations/genServiceSdk/gen.mechanism/getTypescriptFromJsonSchema.js.map +1 -1
  82. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.d.ts +10 -3
  83. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.js +10 -3
  84. package/dist/domain.operations/genServiceSdk/gen.resource/asDomainObjectPragma.js.map +1 -1
  85. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js +9 -23
  86. package/dist/domain.operations/genServiceSdk/gen.resource/assertAllDomainObjectRefsBind.js.map +1 -1
  87. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js +11 -18
  88. package/dist/domain.operations/genServiceSdk/gen.resource/getAllDomainObjectsFromContracts.js.map +1 -1
  89. package/dist/domain.operations/genServiceSdk/getAllJsonSchemaNodes.d.ts +59 -0
  90. package/dist/domain.operations/genServiceSdk/getAllJsonSchemaNodes.js +87 -0
  91. package/dist/domain.operations/genServiceSdk/getAllJsonSchemaNodes.js.map +1 -0
  92. package/dist/domain.operations/getAllLambdaContracts/getAllLambdaContracts.js +16 -35
  93. package/dist/domain.operations/getAllLambdaContracts/getAllLambdaContracts.js.map +1 -1
  94. package/dist/domain.operations/lambdaEndpointWire/context/getExidFromContext.js.map +1 -0
  95. package/dist/domain.operations/lambdaEndpointWire/context/getLogForExidExtraction.js.map +1 -0
  96. package/dist/domain.operations/lambdaEndpointWire/context/getOneTrailExid.d.ts +36 -0
  97. package/dist/domain.operations/lambdaEndpointWire/context/getOneTrailExid.js +53 -0
  98. package/dist/domain.operations/lambdaEndpointWire/context/getOneTrailExid.js.map +1 -0
  99. package/dist/domain.operations/lambdaEndpointWire/error/getIsContempErrorTagged.d.ts +1 -0
  100. package/dist/domain.operations/lambdaEndpointWire/error/getIsContempErrorTagged.js +32 -0
  101. package/dist/domain.operations/lambdaEndpointWire/error/getIsContempErrorTagged.js.map +1 -0
  102. package/dist/domain.operations/lambdaEndpointWire/error/getIsLambdaErrorResponse.d.ts +63 -0
  103. package/dist/domain.operations/lambdaEndpointWire/error/getIsLambdaErrorResponse.js +39 -0
  104. package/dist/domain.operations/lambdaEndpointWire/error/getIsLambdaErrorResponse.js.map +1 -0
  105. package/dist/domain.operations/lambdaEndpointWire/error/getLambdaErrorMetadata.js.map +1 -0
  106. package/dist/domain.operations/lambdaEndpointWire/error/getStackTraceString.js.map +1 -0
  107. package/dist/domain.operations/lambdaEndpointWire/error/throwIfCredentialsError.d.ts +54 -0
  108. package/dist/domain.operations/lambdaEndpointWire/error/throwIfCredentialsError.js +107 -0
  109. package/dist/domain.operations/lambdaEndpointWire/error/throwIfCredentialsError.js.map +1 -0
  110. package/dist/domain.operations/{genLambdaEndpoint/middleware → lambdaEndpointWire/frame}/getIsWrappedPayload.d.ts +6 -0
  111. package/dist/domain.operations/lambdaEndpointWire/frame/getIsWrappedPayload.js.map +1 -0
  112. package/dist/domain.operations/lambdaEndpointWire/getParsedResponse.d.ts +45 -0
  113. package/dist/domain.operations/lambdaEndpointWire/getParsedResponse.js +173 -0
  114. package/dist/domain.operations/lambdaEndpointWire/getParsedResponse.js.map +1 -0
  115. package/dist/domain.operations/lambdaEndpointWire/serde/asUnprefixedErrorMessage.d.ts +21 -0
  116. package/dist/domain.operations/lambdaEndpointWire/serde/asUnprefixedErrorMessage.js +33 -0
  117. package/dist/domain.operations/lambdaEndpointWire/serde/asUnprefixedErrorMessage.js.map +1 -0
  118. package/dist/domain.operations/lambdaEndpointWire/serde/getDecodedPayload.js.map +1 -0
  119. package/dist/domain.operations/lambdaEndpointWire/serde/getParsedJson.js.map +1 -0
  120. package/dist/domain.operations/runLambdaEndpoint/context/asLambdaContext.d.ts +24 -0
  121. package/dist/domain.operations/runLambdaEndpoint/context/asLambdaContext.js +70 -0
  122. package/dist/domain.operations/runLambdaEndpoint/context/asLambdaContext.js.map +1 -0
  123. package/dist/domain.operations/runLambdaEndpoint/dialect/LambdaEndpointRunOutput.d.ts +67 -0
  124. package/dist/domain.operations/runLambdaEndpoint/dialect/LambdaEndpointRunOutput.js +3 -0
  125. package/dist/domain.operations/runLambdaEndpoint/dialect/LambdaEndpointRunOutput.js.map +1 -0
  126. package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointDialect.d.ts +26 -0
  127. package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointDialect.js +43 -0
  128. package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointDialect.js.map +1 -0
  129. package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointOutput.d.ts +47 -0
  130. package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointOutput.js +89 -0
  131. package/dist/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointOutput.js.map +1 -0
  132. package/dist/domain.operations/runLambdaEndpoint/dialect/isLambdaEndpointErrorEnvelope.d.ts +73 -0
  133. package/dist/domain.operations/runLambdaEndpoint/dialect/isLambdaEndpointErrorEnvelope.js +108 -0
  134. package/dist/domain.operations/runLambdaEndpoint/dialect/isLambdaEndpointErrorEnvelope.js.map +1 -0
  135. package/dist/domain.operations/runLambdaEndpoint/error/isErrorLike.d.ts +50 -0
  136. package/dist/domain.operations/runLambdaEndpoint/error/isErrorLike.js +55 -0
  137. package/dist/domain.operations/runLambdaEndpoint/error/isErrorLike.js.map +1 -0
  138. package/dist/domain.operations/runLambdaEndpoint/guard/assertEventIsGiven.d.ts +56 -0
  139. package/dist/domain.operations/runLambdaEndpoint/guard/assertEventIsGiven.js +57 -0
  140. package/dist/domain.operations/runLambdaEndpoint/guard/assertEventIsGiven.js.map +1 -0
  141. package/dist/domain.operations/runLambdaEndpoint/guard/assertHandlerIsRunnable.d.ts +16 -0
  142. package/dist/domain.operations/runLambdaEndpoint/guard/assertHandlerIsRunnable.js +71 -0
  143. package/dist/domain.operations/runLambdaEndpoint/guard/assertHandlerIsRunnable.js.map +1 -0
  144. package/dist/domain.operations/runLambdaEndpoint/local/asLocalRunIdentity.d.ts +48 -0
  145. package/dist/domain.operations/runLambdaEndpoint/local/asLocalRunIdentity.js +57 -0
  146. package/dist/domain.operations/runLambdaEndpoint/local/asLocalRunIdentity.js.map +1 -0
  147. package/dist/domain.operations/runLambdaEndpoint/local/getOneHandlerFromServerlessYml.d.ts +18 -0
  148. package/dist/domain.operations/runLambdaEndpoint/local/getOneHandlerFromServerlessYml.js +239 -0
  149. package/dist/domain.operations/runLambdaEndpoint/local/getOneHandlerFromServerlessYml.js.map +1 -0
  150. package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.d.ts +82 -0
  151. package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.js +67 -0
  152. package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.js.map +1 -0
  153. package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onReferenced.d.ts +120 -0
  154. package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onReferenced.js +119 -0
  155. package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onReferenced.js.map +1 -0
  156. package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onSerialized.d.ts +98 -0
  157. package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onSerialized.js +176 -0
  158. package/dist/domain.operations/runLambdaEndpoint/runLambdaEndpoint.onSerialized.js.map +1 -0
  159. package/dist/domain.operations/runLambdaEndpoint/serde/asFramedPayload.d.ts +41 -0
  160. package/dist/domain.operations/runLambdaEndpoint/serde/asFramedPayload.js +62 -0
  161. package/dist/domain.operations/runLambdaEndpoint/serde/asFramedPayload.js.map +1 -0
  162. package/dist/domain.operations/runLambdaEndpoint/serde/asWireFunctionErrorPayload.d.ts +40 -0
  163. package/dist/domain.operations/runLambdaEndpoint/serde/asWireFunctionErrorPayload.js +68 -0
  164. package/dist/domain.operations/runLambdaEndpoint/serde/asWireFunctionErrorPayload.js.map +1 -0
  165. package/dist/domain.operations/runLambdaEndpoint/serde/asWirePayload.d.ts +34 -0
  166. package/dist/domain.operations/runLambdaEndpoint/serde/asWirePayload.js +39 -0
  167. package/dist/domain.operations/runLambdaEndpoint/serde/asWirePayload.js.map +1 -0
  168. package/dist/domain.operations/runLambdaEndpoint/serde/asWireStripped.d.ts +25 -0
  169. package/dist/domain.operations/runLambdaEndpoint/serde/asWireStripped.js +85 -0
  170. package/dist/domain.operations/runLambdaEndpoint/serde/asWireStripped.js.map +1 -0
  171. package/dist/index.d.ts +34 -0
  172. package/dist/index.js +50 -1
  173. package/dist/index.js.map +1 -1
  174. package/package.json +4 -3
  175. package/readme.md +188 -48
  176. package/dist/domain.operations/askLambdaEndpoint/context/getExidFromContext.js.map +0 -1
  177. package/dist/domain.operations/askLambdaEndpoint/context/getLogForExidExtraction.js.map +0 -1
  178. package/dist/domain.operations/askLambdaEndpoint/error/getIsLambdaErrorResponse.d.ts +0 -42
  179. package/dist/domain.operations/askLambdaEndpoint/error/getIsLambdaErrorResponse.js +0 -21
  180. package/dist/domain.operations/askLambdaEndpoint/error/getIsLambdaErrorResponse.js.map +0 -1
  181. package/dist/domain.operations/askLambdaEndpoint/error/getLambdaErrorMetadata.js.map +0 -1
  182. package/dist/domain.operations/askLambdaEndpoint/error/getStackTraceString.js.map +0 -1
  183. package/dist/domain.operations/askLambdaEndpoint/serde/asUnprefixedErrorMessage.d.ts +0 -13
  184. package/dist/domain.operations/askLambdaEndpoint/serde/asUnprefixedErrorMessage.js +0 -26
  185. package/dist/domain.operations/askLambdaEndpoint/serde/asUnprefixedErrorMessage.js.map +0 -1
  186. package/dist/domain.operations/askLambdaEndpoint/serde/getDecodedPayload.js.map +0 -1
  187. package/dist/domain.operations/askLambdaEndpoint/serde/getParsedJson.js.map +0 -1
  188. package/dist/domain.operations/askLambdaEndpoint/serde/getParsedResponse.d.ts +0 -15
  189. package/dist/domain.operations/askLambdaEndpoint/serde/getParsedResponse.js +0 -100
  190. package/dist/domain.operations/askLambdaEndpoint/serde/getParsedResponse.js.map +0 -1
  191. package/dist/domain.operations/genLambdaEndpoint/middleware/getIsWrappedPayload.js.map +0 -1
  192. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/context/getExidFromContext.d.ts +0 -0
  193. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/context/getExidFromContext.js +0 -0
  194. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/context/getLogForExidExtraction.d.ts +0 -0
  195. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/context/getLogForExidExtraction.js +0 -0
  196. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/error/getLambdaErrorMetadata.d.ts +0 -0
  197. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/error/getLambdaErrorMetadata.js +0 -0
  198. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/error/getStackTraceString.d.ts +0 -0
  199. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/error/getStackTraceString.js +0 -0
  200. /package/dist/domain.operations/{genLambdaEndpoint/middleware → lambdaEndpointWire/frame}/getIsWrappedPayload.js +0 -0
  201. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/serde/getDecodedPayload.d.ts +0 -0
  202. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/serde/getDecodedPayload.js +0 -0
  203. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/serde/getParsedJson.d.ts +0 -0
  204. /package/dist/domain.operations/{askLambdaEndpoint → lambdaEndpointWire}/serde/getParsedJson.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asLambdaEndpointOutput.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/dialect/asLambdaEndpointOutput.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAGjD,mFAA0F;AAG1F;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,sBAAsB,GAAG,CAC7B,MAAY,EAIZ,EAAE,CAAC,CAAC,IAAA,uEAAuC,EAAC,MAAM,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACI,MAAM,sBAAsB,GAAG,CACpC,MAAY,EACuD,EAAE;IACrE,IAAI,sBAAsB,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAElD,yEAAyE;IACzE,EAAE;IACF,0EAA0E;IAC1E,6EAA6E;IAC7E,6EAA6E;IAC7E,6EAA6E;IAC7E,mDAAmD;IACnD,EAAE;IACF,8EAA8E;IAC9E,wEAAwE;IACxE,qDAAqD;IACrD,MAAM,IAAI,gCAAe,CACvB,mEAAmE,EACnE;QACE,MAAM;QACN,IAAI,EAAE,8dAA8d;KACre,CACF,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,sBAAsB,0BAuBjC"}
@@ -0,0 +1,73 @@
1
+ import type { LambdaEndpointErrorResponseBodyAncient, LambdaEndpointErrorResponseBodyContemp } from '../../../domain.objects/LambdaEndpointErrorResponseBody';
2
+ import type { LambdaEndpointErrorEnvelope } from './LambdaEndpointRunOutput';
3
+ /**
4
+ * .what = narrows a run output to the CONTEMP constraint envelope it may carry
5
+ * .why = the contemp envelope stamps its own codec tag (`…::contemp@$v`) and we
6
+ * author every one, so this narrow is EXACT: carries the tag ⇒ is one; lacks it
7
+ * ⇒ is not. no shape heuristic, no fallback.
8
+ *
9
+ * .note = dialect-fixed on purpose. the caller names the dialect by WHICH function
10
+ * they call, so the tag check and the shape check never run on one value —
11
+ * which is what stops a contemp caller from reading `.error.message` as
12
+ * `undefined` off an ancient value.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const res = await runLambdaEndpoint.onReferenced({ event, handler });
17
+ * if (isLambdaEndpointErrorEnvelopeContemp(res)) res.error.class; // ✅ exact, by the tag
18
+ * ```
19
+ */
20
+ export declare const isLambdaEndpointErrorEnvelopeContemp: (output: unknown) => output is LambdaEndpointErrorResponseBodyContemp;
21
+ /**
22
+ * .what = narrows a run output to the ANCIENT constraint envelope it may carry
23
+ * .why = the ancient wire carries no tag, so this reads the flat
24
+ * `{ errorMessage: string, errorType: string }` pair.
25
+ *
26
+ * ⚠️ a HEURISTIC, inherently — a success output that happens to carry those two
27
+ * string keys is indistinguishable from a rejection, and the ancient dialect
28
+ * has no discriminator to stamp.
29
+ *
30
+ * .note = demands BOTH fields, stricter than the wire's `getIsAncientErrorResponse`
31
+ * (`'errorMessage' in parsed`). this asks *"did MY handler reject?"*; the wire
32
+ * asks *"did the upstream fault, by any route?"* — and aws sends a bare
33
+ * `errorMessage` with no type on a duration-exceeded fault.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const old = await runLambdaEndpoint.onReferenced({ event, handler, struct: { payload: 'ancient' } });
38
+ * if (isLambdaEndpointErrorEnvelopeAncient(old)) old.errorType; // ⚠️ by shape, ambiguous
39
+ * ```
40
+ */
41
+ export declare const isLambdaEndpointErrorEnvelopeAncient: (output: unknown) => output is LambdaEndpointErrorResponseBodyAncient;
42
+ /**
43
+ * .what = is this run output EITHER dialect's constraint envelope?
44
+ * .why = `asLambdaEndpointOutput` subtracts the whole envelope union to leave the
45
+ * handler's output, so it needs both dialects at once. private — a consumer
46
+ * picks a dialect-fixed peer above.
47
+ */
48
+ export declare const isLambdaEndpointErrorEnvelopeAnyDialect: (output: unknown) => output is LambdaEndpointErrorEnvelope<"contemp" | "ancient">;
49
+ /**
50
+ * .what = asserts a run output IS the CONTEMP constraint envelope, and narrows it
51
+ * .why = a test that reads `.error.message` must fail LOUD when the endpoint
52
+ * answered with a success payload — a silent `undefined` teaches naught
53
+ * (rule.require.failfast). `ConstraintError`, because the fault is the caller's.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const envelope = asLambdaEndpointErrorEnvelopeContemp(res);
58
+ * expect(envelope.error.message).toContain('the uuid names no known surfer');
59
+ * ```
60
+ */
61
+ export declare const asLambdaEndpointErrorEnvelopeContemp: (output: unknown) => LambdaEndpointErrorResponseBodyContemp;
62
+ /**
63
+ * .what = asserts a run output IS the ANCIENT constraint envelope, and narrows it
64
+ * .why = for a caller that declared `struct.payload: 'ancient'`. reads the flat
65
+ * shape, so its confidence is the wire's — see the guard above.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * const envelope = asLambdaEndpointErrorEnvelopeAncient(old);
70
+ * expect(envelope.errorType).toEqual('BadRequestError');
71
+ * ```
72
+ */
73
+ export declare const asLambdaEndpointErrorEnvelopeAncient: (output: unknown) => LambdaEndpointErrorResponseBodyAncient;
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asLambdaEndpointErrorEnvelopeAncient = exports.asLambdaEndpointErrorEnvelopeContemp = exports.isLambdaEndpointErrorEnvelopeAnyDialect = exports.isLambdaEndpointErrorEnvelopeAncient = exports.isLambdaEndpointErrorEnvelopeContemp = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ const getIsContempErrorTagged_1 = require("../../lambdaEndpointWire/error/getIsContempErrorTagged");
6
+ /**
7
+ * .what = narrows a run output to the CONTEMP constraint envelope it may carry
8
+ * .why = the contemp envelope stamps its own codec tag (`…::contemp@$v`) and we
9
+ * author every one, so this narrow is EXACT: carries the tag ⇒ is one; lacks it
10
+ * ⇒ is not. no shape heuristic, no fallback.
11
+ *
12
+ * .note = dialect-fixed on purpose. the caller names the dialect by WHICH function
13
+ * they call, so the tag check and the shape check never run on one value —
14
+ * which is what stops a contemp caller from reading `.error.message` as
15
+ * `undefined` off an ancient value.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const res = await runLambdaEndpoint.onReferenced({ event, handler });
20
+ * if (isLambdaEndpointErrorEnvelopeContemp(res)) res.error.class; // ✅ exact, by the tag
21
+ * ```
22
+ */
23
+ const isLambdaEndpointErrorEnvelopeContemp = (output) => (0, getIsContempErrorTagged_1.getIsContempErrorTagged)(output);
24
+ exports.isLambdaEndpointErrorEnvelopeContemp = isLambdaEndpointErrorEnvelopeContemp;
25
+ /**
26
+ * .what = narrows a run output to the ANCIENT constraint envelope it may carry
27
+ * .why = the ancient wire carries no tag, so this reads the flat
28
+ * `{ errorMessage: string, errorType: string }` pair.
29
+ *
30
+ * ⚠️ a HEURISTIC, inherently — a success output that happens to carry those two
31
+ * string keys is indistinguishable from a rejection, and the ancient dialect
32
+ * has no discriminator to stamp.
33
+ *
34
+ * .note = demands BOTH fields, stricter than the wire's `getIsAncientErrorResponse`
35
+ * (`'errorMessage' in parsed`). this asks *"did MY handler reject?"*; the wire
36
+ * asks *"did the upstream fault, by any route?"* — and aws sends a bare
37
+ * `errorMessage` with no type on a duration-exceeded fault.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const old = await runLambdaEndpoint.onReferenced({ event, handler, struct: { payload: 'ancient' } });
42
+ * if (isLambdaEndpointErrorEnvelopeAncient(old)) old.errorType; // ⚠️ by shape, ambiguous
43
+ * ```
44
+ */
45
+ const isLambdaEndpointErrorEnvelopeAncient = (output) => {
46
+ if (typeof output !== 'object' || output === null)
47
+ return false;
48
+ /**
49
+ * .as = the inspection cast every type guard is made of. fields are optional +
50
+ * `unknown`, so it asserts no shape — the check below decides.
51
+ * .removal = never; a `x is T` predicate is rule.forbid.as-cast's own carve-out.
52
+ */
53
+ const ancient = output;
54
+ return (typeof ancient.errorMessage === 'string' &&
55
+ typeof ancient.errorType === 'string');
56
+ };
57
+ exports.isLambdaEndpointErrorEnvelopeAncient = isLambdaEndpointErrorEnvelopeAncient;
58
+ /**
59
+ * .what = is this run output EITHER dialect's constraint envelope?
60
+ * .why = `asLambdaEndpointOutput` subtracts the whole envelope union to leave the
61
+ * handler's output, so it needs both dialects at once. private — a consumer
62
+ * picks a dialect-fixed peer above.
63
+ */
64
+ const isLambdaEndpointErrorEnvelopeAnyDialect = (output) => (0, exports.isLambdaEndpointErrorEnvelopeContemp)(output) ||
65
+ (0, exports.isLambdaEndpointErrorEnvelopeAncient)(output);
66
+ exports.isLambdaEndpointErrorEnvelopeAnyDialect = isLambdaEndpointErrorEnvelopeAnyDialect;
67
+ /**
68
+ * .what = asserts a run output IS the CONTEMP constraint envelope, and narrows it
69
+ * .why = a test that reads `.error.message` must fail LOUD when the endpoint
70
+ * answered with a success payload — a silent `undefined` teaches naught
71
+ * (rule.require.failfast). `ConstraintError`, because the fault is the caller's.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const envelope = asLambdaEndpointErrorEnvelopeContemp(res);
76
+ * expect(envelope.error.message).toContain('the uuid names no known surfer');
77
+ * ```
78
+ */
79
+ const asLambdaEndpointErrorEnvelopeContemp = (output) => {
80
+ if ((0, exports.isLambdaEndpointErrorEnvelopeContemp)(output))
81
+ return output;
82
+ throw new helpful_errors_1.ConstraintError('the endpoint answered with an output, never a contemp constraint envelope', {
83
+ output,
84
+ hint: 'the handler did not reject this event with a contemp envelope. assert on the output shape, send an event the schema refuses, or — if you declared the ancient dialect — use asLambdaEndpointErrorEnvelopeAncient.',
85
+ });
86
+ };
87
+ exports.asLambdaEndpointErrorEnvelopeContemp = asLambdaEndpointErrorEnvelopeContemp;
88
+ /**
89
+ * .what = asserts a run output IS the ANCIENT constraint envelope, and narrows it
90
+ * .why = for a caller that declared `struct.payload: 'ancient'`. reads the flat
91
+ * shape, so its confidence is the wire's — see the guard above.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * const envelope = asLambdaEndpointErrorEnvelopeAncient(old);
96
+ * expect(envelope.errorType).toEqual('BadRequestError');
97
+ * ```
98
+ */
99
+ const asLambdaEndpointErrorEnvelopeAncient = (output) => {
100
+ if ((0, exports.isLambdaEndpointErrorEnvelopeAncient)(output))
101
+ return output;
102
+ throw new helpful_errors_1.ConstraintError('the endpoint answered with an output, never an ancient constraint envelope', {
103
+ output,
104
+ hint: 'the handler did not return a flat { errorMessage, errorType } envelope. assert on the output shape, or — if you expected the contemp dialect — use asLambdaEndpointErrorEnvelopeContemp.',
105
+ });
106
+ };
107
+ exports.asLambdaEndpointErrorEnvelopeAncient = asLambdaEndpointErrorEnvelopeAncient;
108
+ //# sourceMappingURL=isLambdaEndpointErrorEnvelope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isLambdaEndpointErrorEnvelope.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/dialect/isLambdaEndpointErrorEnvelope.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAMjD,oGAAiG;AAGjG;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,oCAAoC,GAAG,CAClD,MAAe,EACmC,EAAE,CACpD,IAAA,iDAAuB,EAAC,MAAM,CAAC,CAAC;AAHrB,QAAA,oCAAoC,wCAGf;AAElC;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,oCAAoC,GAAG,CAClD,MAAe,EACmC,EAAE;IACpD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEhE;;;;OAIG;IACH,MAAM,OAAO,GAAG,MAAyD,CAAC;IAC1E,OAAO,CACL,OAAO,OAAO,CAAC,YAAY,KAAK,QAAQ;QACxC,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,CACtC,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,oCAAoC,wCAe/C;AAEF;;;;;GAKG;AACI,MAAM,uCAAuC,GAAG,CACrD,MAAe,EAC+C,EAAE,CAChE,IAAA,4CAAoC,EAAC,MAAM,CAAC;IAC5C,IAAA,4CAAoC,EAAC,MAAM,CAAC,CAAC;AAJlC,QAAA,uCAAuC,2CAIL;AAE/C;;;;;;;;;;;GAWG;AACI,MAAM,oCAAoC,GAAG,CAClD,MAAe,EACyB,EAAE;IAC1C,IAAI,IAAA,4CAAoC,EAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAEhE,MAAM,IAAI,gCAAe,CACvB,2EAA2E,EAC3E;QACE,MAAM;QACN,IAAI,EAAE,mNAAmN;KAC1N,CACF,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,oCAAoC,wCAY/C;AAEF;;;;;;;;;;GAUG;AACI,MAAM,oCAAoC,GAAG,CAClD,MAAe,EACyB,EAAE;IAC1C,IAAI,IAAA,4CAAoC,EAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAEhE,MAAM,IAAI,gCAAe,CACvB,4EAA4E,EAC5E;QACE,MAAM;QACN,IAAI,EAAE,0LAA0L;KACjM,CACF,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,oCAAoC,wCAY/C"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * .what = narrows an `unknown` catch value to an `Error`, by SHAPE rather than
3
+ * by prototype
4
+ * .why = 🔴 `instanceof Error` is unreliable across this util's own boundaries,
5
+ * and the failure is silent.
6
+ *
7
+ * jest runs each module in its own vm context, so an `Error` thrown in
8
+ * one realm fails the prototype check in another. the check does not
9
+ * error — it returns `false`, and every site then degrades to a
10
+ * stringified fallback that drops the constructor name and the stack.
11
+ *
12
+ * 🔴 **this exists because the same duck-type has THREE call sites, and a fork
13
+ * between any two of them is silent.**
14
+ *
15
+ * | site | what it wanted |
16
+ * |---|---|
17
+ * | `runLambdaEndpoint.onSerialized.ts` (`asWireFunctionErrorPayload`) | `message` · `stack` · `constructor.name` |
18
+ * | `serde/asWireStripped.ts` | the whole `Error`, to hang as a `cause` |
19
+ * | `local/getOneHandlerFromServerlessYml.ts` | `message`, to branch on a text match |
20
+ *
21
+ * ⇒ `rule.prefer.wet-over-dry`'s own threshold: 1 usage inline, 2 copy-paste,
22
+ * **3+ consider the abstraction**. it reached three.
23
+ *
24
+ * .note = the risk this prices is a FOURTH site, not duplication:
25
+ *
26
+ * > *"cross-realm boundaries are endemic to this local-locus/jest
27
+ * > architecture, so a 4th is likely … [and] has no canonical pattern to reach
28
+ * > for and will probably write a 4th slightly-different variant."*
29
+ *
30
+ * ✅ **and a fork between copies is measured, not hypothetical.** the three
31
+ * sites above each want a different return: the value cast to `Error`, a
32
+ * fresh `Error`, a bare string with `''` as its fallback. same predicate,
33
+ * three contracts.
34
+ *
35
+ * .note = it is a PREDICATE rather than three getters, and that is what lets one
36
+ * operation serve all three sites: a narrow to `Error` gives each caller the
37
+ * field it wants, typed, with no second import
38
+ * (`rule.require.assure-via-type-checks`, `rule.require.get-set-gen-verbs`'s
39
+ * `is*` prefix).
40
+ *
41
+ * .note = it lives at `runLambdaEndpoint/` rather than higher because all three
42
+ * consumers do (`rule.prefer.most-common-denominator`: lift to the common
43
+ * ancestor of the callers that exist, never past it).
44
+ *
45
+ * ⚠️ **the shape it tests is `.message`, and that is deliberate.** `.stack` is
46
+ * optional on a real `Error` and absent on a plain thrown object; `.name` is
47
+ * present on a bare `{ name }` bag. `.message` as a string is the one field
48
+ * every `Error` carries and few impostors do.
49
+ */
50
+ export declare const isErrorLike: (value: unknown) => value is Error;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isErrorLike = void 0;
4
+ /**
5
+ * .what = narrows an `unknown` catch value to an `Error`, by SHAPE rather than
6
+ * by prototype
7
+ * .why = 🔴 `instanceof Error` is unreliable across this util's own boundaries,
8
+ * and the failure is silent.
9
+ *
10
+ * jest runs each module in its own vm context, so an `Error` thrown in
11
+ * one realm fails the prototype check in another. the check does not
12
+ * error — it returns `false`, and every site then degrades to a
13
+ * stringified fallback that drops the constructor name and the stack.
14
+ *
15
+ * 🔴 **this exists because the same duck-type has THREE call sites, and a fork
16
+ * between any two of them is silent.**
17
+ *
18
+ * | site | what it wanted |
19
+ * |---|---|
20
+ * | `runLambdaEndpoint.onSerialized.ts` (`asWireFunctionErrorPayload`) | `message` · `stack` · `constructor.name` |
21
+ * | `serde/asWireStripped.ts` | the whole `Error`, to hang as a `cause` |
22
+ * | `local/getOneHandlerFromServerlessYml.ts` | `message`, to branch on a text match |
23
+ *
24
+ * ⇒ `rule.prefer.wet-over-dry`'s own threshold: 1 usage inline, 2 copy-paste,
25
+ * **3+ consider the abstraction**. it reached three.
26
+ *
27
+ * .note = the risk this prices is a FOURTH site, not duplication:
28
+ *
29
+ * > *"cross-realm boundaries are endemic to this local-locus/jest
30
+ * > architecture, so a 4th is likely … [and] has no canonical pattern to reach
31
+ * > for and will probably write a 4th slightly-different variant."*
32
+ *
33
+ * ✅ **and a fork between copies is measured, not hypothetical.** the three
34
+ * sites above each want a different return: the value cast to `Error`, a
35
+ * fresh `Error`, a bare string with `''` as its fallback. same predicate,
36
+ * three contracts.
37
+ *
38
+ * .note = it is a PREDICATE rather than three getters, and that is what lets one
39
+ * operation serve all three sites: a narrow to `Error` gives each caller the
40
+ * field it wants, typed, with no second import
41
+ * (`rule.require.assure-via-type-checks`, `rule.require.get-set-gen-verbs`'s
42
+ * `is*` prefix).
43
+ *
44
+ * .note = it lives at `runLambdaEndpoint/` rather than higher because all three
45
+ * consumers do (`rule.prefer.most-common-denominator`: lift to the common
46
+ * ancestor of the callers that exist, never past it).
47
+ *
48
+ * ⚠️ **the shape it tests is `.message`, and that is deliberate.** `.stack` is
49
+ * optional on a real `Error` and absent on a plain thrown object; `.name` is
50
+ * present on a bare `{ name }` bag. `.message` as a string is the one field
51
+ * every `Error` carries and few impostors do.
52
+ */
53
+ const isErrorLike = (value) => typeof value?.message === 'string';
54
+ exports.isErrorLike = isErrorLike;
55
+ //# sourceMappingURL=isErrorLike.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isErrorLike.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/error/isErrorLike.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACI,MAAM,WAAW,GAAG,CAAC,KAAc,EAAkB,EAAE,CAC5D,OAAQ,KAA+B,EAAE,OAAO,KAAK,QAAQ,CAAC;AADnD,QAAA,WAAW,eACwC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * .what = refuses an absent event, with an error that names the fix
3
+ * .why = both boundaries need this guard, and each needs it AHEAD of any
4
+ * delegation — so the two call sites stay, and only the TEXT is lifted.
5
+ *
6
+ * ⇒ the placement rule and its cause: `serde/asWireFunctionErrorPayload.ts`,
7
+ * section *"what this DROPS"*. it is the canonical account; this file
8
+ * states only what it MEASURED.
9
+ *
10
+ * ## ✅ this guard's own probe — and the two loci fail DIFFERENTLY
11
+ *
12
+ * measured by a probe that disabled the serialized guard and left the referenced
13
+ * twin in place, so the twin was the only guard that could have answered:
14
+ *
15
+ * | locus | with only the twin's guard |
16
+ * |---|---|
17
+ * | `'cloud'` | never reaches the twin — `JSON.stringify` DROPS an `undefined` key, and the fault surfaces **90s away, in aws** (case=9) |
18
+ * | `'local'` | the message crossed, and `metadata.hint` came back **`""`** |
19
+ *
20
+ * ⇒ so the delegated guard would answer one locus late and the other locus
21
+ * stripped of the one field that names the fix.
22
+ *
23
+ * ## 🔴 why the EXTRACTION, given the two call sites are deliberate
24
+ *
25
+ * ⚠️ **the duplication that stays and the duplication that goes are different
26
+ * duplications, and a review that conflates them reaches the wrong verdict.**
27
+ *
28
+ * | what is duplicated | verdict |
29
+ * |---|---|
30
+ * | the guard's **placement** — one per boundary, ahead of delegation | ✅ **deliberate**, and measured above. it stays |
31
+ * | the guard's **message and hint text**, byte-for-byte in two files | 🔴 a drift hazard. it goes |
32
+ *
33
+ * ⇒ so this operation changes no control flow at all: each boundary refuses
34
+ * its own absent event, at the same line, before any `.catch` exists. what
35
+ * is shared is the one fact the two had in common — the words.
36
+ *
37
+ * ⇒ **so the third guard this family grows is correct on both boundaries by
38
+ * construction**: it states its text once here, and each boundary keeps its own
39
+ * placement. `guard/assertHandlerIsRunnable.ts` is the peer that follows the
40
+ * same shape.
41
+ */
42
+ export declare const assertEventIsGiven: (input: {
43
+ event: unknown;
44
+ /**
45
+ * .what = the boundary's own context fields, merged into the error's metadata
46
+ * .why = the serialized boundary can name `which` and `at`; the referenced one
47
+ * has neither, and passes `null` rather than an absent key.
48
+ *
49
+ * .note = `| null` rather than optional, deliberately. `rule.forbid.undefined-inputs`
50
+ * grades an optional attribute on an INTERNAL contract a blocker, and scopes
51
+ * its exception to the boundary a human meets. F15 took that exception for the
52
+ * five optionals on this drive's PUBLIC surface; this operation is internal,
53
+ * reached only by the two callers below, so the rule's letter governs it.
54
+ */
55
+ metadata: Record<string, unknown> | null;
56
+ }) => void;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertEventIsGiven = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ /**
6
+ * .what = refuses an absent event, with an error that names the fix
7
+ * .why = both boundaries need this guard, and each needs it AHEAD of any
8
+ * delegation — so the two call sites stay, and only the TEXT is lifted.
9
+ *
10
+ * ⇒ the placement rule and its cause: `serde/asWireFunctionErrorPayload.ts`,
11
+ * section *"what this DROPS"*. it is the canonical account; this file
12
+ * states only what it MEASURED.
13
+ *
14
+ * ## ✅ this guard's own probe — and the two loci fail DIFFERENTLY
15
+ *
16
+ * measured by a probe that disabled the serialized guard and left the referenced
17
+ * twin in place, so the twin was the only guard that could have answered:
18
+ *
19
+ * | locus | with only the twin's guard |
20
+ * |---|---|
21
+ * | `'cloud'` | never reaches the twin — `JSON.stringify` DROPS an `undefined` key, and the fault surfaces **90s away, in aws** (case=9) |
22
+ * | `'local'` | the message crossed, and `metadata.hint` came back **`""`** |
23
+ *
24
+ * ⇒ so the delegated guard would answer one locus late and the other locus
25
+ * stripped of the one field that names the fix.
26
+ *
27
+ * ## 🔴 why the EXTRACTION, given the two call sites are deliberate
28
+ *
29
+ * ⚠️ **the duplication that stays and the duplication that goes are different
30
+ * duplications, and a review that conflates them reaches the wrong verdict.**
31
+ *
32
+ * | what is duplicated | verdict |
33
+ * |---|---|
34
+ * | the guard's **placement** — one per boundary, ahead of delegation | ✅ **deliberate**, and measured above. it stays |
35
+ * | the guard's **message and hint text**, byte-for-byte in two files | 🔴 a drift hazard. it goes |
36
+ *
37
+ * ⇒ so this operation changes no control flow at all: each boundary refuses
38
+ * its own absent event, at the same line, before any `.catch` exists. what
39
+ * is shared is the one fact the two had in common — the words.
40
+ *
41
+ * ⇒ **so the third guard this family grows is correct on both boundaries by
42
+ * construction**: it states its text once here, and each boundary keeps its own
43
+ * placement. `guard/assertHandlerIsRunnable.ts` is the peer that follows the
44
+ * same shape.
45
+ */
46
+ const assertEventIsGiven = (input) => {
47
+ // .note = no `return` prefix, unlike the call sites this was extracted from.
48
+ // `ConstraintError.throw` answers `never` and this operation answers `void`,
49
+ // so `return ConstraintError.throw(…)` trips `lint/correctness/noVoidTypeReturn`.
50
+ if (input.event === undefined)
51
+ helpful_errors_1.ConstraintError.throw('no event was given, so there is no payload to send the endpoint', {
52
+ ...(input.metadata ?? {}),
53
+ hint: 'pass `event: {}` if the endpoint genuinely takes no input — that is what the wire delivers for an empty invoke. an `undefined` here is usually a typo in the variable you meant to pass.',
54
+ });
55
+ };
56
+ exports.assertEventIsGiven = assertEventIsGiven;
57
+ //# sourceMappingURL=assertEventIsGiven.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertEventIsGiven.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/guard/assertEventIsGiven.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAclC,EAAQ,EAAE;IACT,6EAA6E;IAC7E,+EAA+E;IAC/E,oFAAoF;IACpF,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAC3B,gCAAe,CAAC,KAAK,CACnB,iEAAiE,EACjE;YACE,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;YACzB,IAAI,EAAE,0LAA0L;SACjM,CACF,CAAC;AACN,CAAC,CAAC;AA1BW,QAAA,kBAAkB,sBA0B7B"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * .what = refuses a handler this util cannot run, with an error that names the fix
3
+ * .why = both boundaries need these guards AHEAD of any delegation, so they live
4
+ * in one shared operation with two call sites.
5
+ *
6
+ * 🔴 placement is the whole repair, and it is measured. with this removed from
7
+ * `onSerialized` the same guard fires INSIDE the delegation and
8
+ * `asWireFunctionErrorPayload` washes its metadata — same `ConstraintError`,
9
+ * and `metadata.hint` is gone.
10
+ *
11
+ * ⚠️ a duplicate ahead of the delegation would repair the probed caller and leave
12
+ * every other hint-bearer washed. see `serde/asWireFunctionErrorPayload.ts`.
13
+ */
14
+ export declare const assertHandlerIsRunnable: (input: {
15
+ handler: unknown;
16
+ }) => void;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertHandlerIsRunnable = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ /**
6
+ * .what = refuses a handler this util cannot run, with an error that names the fix
7
+ * .why = both boundaries need these guards AHEAD of any delegation, so they live
8
+ * in one shared operation with two call sites.
9
+ *
10
+ * 🔴 placement is the whole repair, and it is measured. with this removed from
11
+ * `onSerialized` the same guard fires INSIDE the delegation and
12
+ * `asWireFunctionErrorPayload` washes its metadata — same `ConstraintError`,
13
+ * and `metadata.hint` is gone.
14
+ *
15
+ * ⚠️ a duplicate ahead of the delegation would repair the probed caller and leave
16
+ * every other hint-bearer washed. see `serde/asWireFunctionErrorPayload.ts`.
17
+ */
18
+ const assertHandlerIsRunnable = (input) => {
19
+ // 🔴 the likeliest migrant slip is the IMPORT: a wrong export name binds
20
+ // `handler` to `undefined`, and `input.handler(…)` throws a bare
21
+ // `TypeError: input.handler is not a function` — which names neither this
22
+ // util nor the fix (rule.require.errors-name-the-fix).
23
+ //
24
+ // .note = typescript types `handler` as a function at the referenced boundary,
25
+ // so this reads redundant there. a test file is routinely `any`-typed at the
26
+ // import, and this is the external boundary.
27
+ //
28
+ // .note = no `return` prefix — `ConstraintError.throw` answers `never` and this
29
+ // answers `void`, which trips `lint/correctness/noVoidTypeReturn`.
30
+ if (typeof input.handler !== 'function')
31
+ helpful_errors_1.ConstraintError.throw('the handler given is not a function, so there is no endpoint to run', {
32
+ received: input.handler === undefined ? 'undefined' : typeof input.handler,
33
+ hint: 'check the import — a wrong export name binds `handler` to undefined. `runLambdaEndpoint.onReferenced` takes the handler itself, never its module.',
34
+ });
35
+ // 🔴 a CALLBACK-style handler is refused by ARITY, because its failure is
36
+ // otherwise SILENT. it answers `undefined` rather than a promise, so the
37
+ // author gets `undefined` back on a green path and the handler's later
38
+ // `callback(err, result)` throws OUT OF BAND with no test to fail —
39
+ // rule.forbid.failhide at the boundary.
40
+ //
41
+ // measured by a probe that disabled this guard:
42
+ //
43
+ // | the handler | without this guard |
44
+ // |---|---|
45
+ // | calls `callback(…)` synchronously | `TypeError: callback is not a function` |
46
+ // | calls it later, or not at all | 🔴 no error at all — `undefined`, green |
47
+ //
48
+ // the second is the shape a REAL callback handler takes, so the common case
49
+ // is the silent one.
50
+ //
51
+ // .note = the false positive is a promise handler that declares an unused third
52
+ // parameter. measured across `ahbode/*`: 1 match, in a research doc, never a
53
+ // handler — every handler in the population is middy-wrapped. the hint names
54
+ // the escape rather than assume it cannot happen.
55
+ //
56
+ // 🔴 .the MIRROR false negative is real: `Function.prototype.length` counts
57
+ // parameters before the first rest, so `(...args) => handler(...args)`
58
+ // reports 0 whatever it wraps — the shape `rule.require.hook-wrapper-pattern`
59
+ // composes with. a thenable check cannot fix it either: a SYNC handler answers
60
+ // a non-thenable exactly as a callback handler does. clamped as a known limit
61
+ // (`assertHandlerIsRunnable.knownLimit.test.ts`).
62
+ //
63
+ // ⇒ this guard is a NET, never a proof.
64
+ if (input.handler.length >= 3)
65
+ helpful_errors_1.ConstraintError.throw('the handler given is callback-style, and this util runs handlers that answer with a promise', {
66
+ declaredParameters: input.handler.length,
67
+ hint: 'answer with a promise instead of a callback — `async (event, context) => …`. if your handler already answers with a promise and merely declares an unused third parameter, drop it from the signature.',
68
+ });
69
+ };
70
+ exports.assertHandlerIsRunnable = assertHandlerIsRunnable;
71
+ //# sourceMappingURL=assertHandlerIsRunnable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertHandlerIsRunnable.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/guard/assertHandlerIsRunnable.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAEjD;;;;;;;;;;;;GAYG;AACI,MAAM,uBAAuB,GAAG,CAAC,KAA2B,EAAQ,EAAE;IAC3E,yEAAyE;IACzE,oEAAoE;IACpE,6EAA6E;IAC7E,0DAA0D;IAC1D,EAAE;IACF,gFAAgF;IAChF,gFAAgF;IAChF,gDAAgD;IAChD,EAAE;IACF,iFAAiF;IACjF,sEAAsE;IACtE,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU;QACrC,gCAAe,CAAC,KAAK,CACnB,qEAAqE,EACrE;YACE,QAAQ,EACN,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO;YAClE,IAAI,EAAE,mJAAmJ;SAC1J,CACF,CAAC;IAEJ,0EAA0E;IAC1E,4EAA4E;IAC5E,0EAA0E;IAC1E,uEAAuE;IACvE,2CAA2C;IAC3C,EAAE;IACF,mDAAmD;IACnD,EAAE;IACF,0CAA0C;IAC1C,eAAe;IACf,qFAAqF;IACrF,iFAAiF;IACjF,EAAE;IACF,+EAA+E;IAC/E,wBAAwB;IACxB,EAAE;IACF,gFAAgF;IAChF,+EAA+E;IAC/E,+EAA+E;IAC/E,oDAAoD;IACpD,EAAE;IACF,4EAA4E;IAC5E,0EAA0E;IAC1E,iFAAiF;IACjF,kFAAkF;IAClF,iFAAiF;IACjF,qDAAqD;IACrD,EAAE;IACF,2CAA2C;IAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC;QAC3B,gCAAe,CAAC,KAAK,CACnB,6FAA6F,EAC7F;YACE,kBAAkB,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;YACxC,IAAI,EAAE,wMAAwM;SAC/M,CACF,CAAC;AACN,CAAC,CAAC;AA3DW,QAAA,uBAAuB,2BA2DlC"}
@@ -0,0 +1,48 @@
1
+ import type { Context } from 'aws-lambda';
2
+ import type { LambdaEndpoint } from '../../../domain.objects/LambdaEndpoint';
3
+ /**
4
+ * .what = casts an endpoint into the runtime identity aws would have supplied
5
+ * .why = the local locus must answer the same `context.functionName` the cloud
6
+ * locus does, or a handler that branches on it takes the wrong branch in
7
+ * every ci pipeline
8
+ *
9
+ * 🔴 **the identity is DERIVED from the endpoint, never defaulted.**
10
+ *
11
+ * `context.functionName` is, per `define.lambda-endpoint-ubiqlang`, the
12
+ * endpoint's **slug** — so aws delivers `svc-x-test-getY` at `at: 'cloud'`.
13
+ * supply no identity at the local locus and `asLambdaContext()` falls back to
14
+ * its own placeholder, so one call answers two identities:
15
+ *
16
+ * | locus | `context.functionName` the handler would see |
17
+ * |---|---|
18
+ * | `'cloud'` | `svc-x-test-getY` — the slug |
19
+ * | `'local'` | `run-lambda-endpoint` — a default |
20
+ *
21
+ * ⇒ and F6 names `functionName` *"the one field a handler can legitimately
22
+ * branch on"*, on measured evidence. so a handler that branches would take the
23
+ * WRONG branch on the locus that runs in every ci pipeline, and the right one
24
+ * only against real aws — the most expensive place to learn it.
25
+ *
26
+ * 🔴 **and it is a DERIVATION, never a knob.** a `context?: Partial<Context>`
27
+ * passthrough on `onSerialized` is declined, and the reason is the boundary's
28
+ * own contract:
29
+ *
30
+ * - `at: 'cloud'` CANNOT honor a context override — aws builds it
31
+ * - ⇒ so the parameter would be a knob one locus silently ignores
32
+ * (`rule.forbid.unexpected-defaults`), on the one operation whose stated
33
+ * guarantee is that *"the locus changes where, never what"*
34
+ *
35
+ * and the override is not needed, because the identity is not the caller's to
36
+ * supply: they already named it in `which` (`rule.require.solve-at-cause`). an
37
+ * author who genuinely wants to forge a context holds the referenced boundary,
38
+ * where the override lives and where no wire can contradict it.
39
+ *
40
+ * .note = the account id is a placeholder, deliberately, and it is the ONE
41
+ * placeholder — `domain.objects/AwsIdentitySynthetic` owns it. a local copy of
42
+ * the region default or of the account here makes this file another
43
+ * independent speaker of one convention.
44
+ */
45
+ export declare const asLocalRunIdentity: (input: {
46
+ endpoint: LambdaEndpoint;
47
+ region: string | undefined;
48
+ }) => Partial<Context>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asLocalRunIdentity = void 0;
4
+ const AwsIdentitySynthetic_1 = require("../../../domain.objects/AwsIdentitySynthetic");
5
+ /**
6
+ * .what = casts an endpoint into the runtime identity aws would have supplied
7
+ * .why = the local locus must answer the same `context.functionName` the cloud
8
+ * locus does, or a handler that branches on it takes the wrong branch in
9
+ * every ci pipeline
10
+ *
11
+ * 🔴 **the identity is DERIVED from the endpoint, never defaulted.**
12
+ *
13
+ * `context.functionName` is, per `define.lambda-endpoint-ubiqlang`, the
14
+ * endpoint's **slug** — so aws delivers `svc-x-test-getY` at `at: 'cloud'`.
15
+ * supply no identity at the local locus and `asLambdaContext()` falls back to
16
+ * its own placeholder, so one call answers two identities:
17
+ *
18
+ * | locus | `context.functionName` the handler would see |
19
+ * |---|---|
20
+ * | `'cloud'` | `svc-x-test-getY` — the slug |
21
+ * | `'local'` | `run-lambda-endpoint` — a default |
22
+ *
23
+ * ⇒ and F6 names `functionName` *"the one field a handler can legitimately
24
+ * branch on"*, on measured evidence. so a handler that branches would take the
25
+ * WRONG branch on the locus that runs in every ci pipeline, and the right one
26
+ * only against real aws — the most expensive place to learn it.
27
+ *
28
+ * 🔴 **and it is a DERIVATION, never a knob.** a `context?: Partial<Context>`
29
+ * passthrough on `onSerialized` is declined, and the reason is the boundary's
30
+ * own contract:
31
+ *
32
+ * - `at: 'cloud'` CANNOT honor a context override — aws builds it
33
+ * - ⇒ so the parameter would be a knob one locus silently ignores
34
+ * (`rule.forbid.unexpected-defaults`), on the one operation whose stated
35
+ * guarantee is that *"the locus changes where, never what"*
36
+ *
37
+ * and the override is not needed, because the identity is not the caller's to
38
+ * supply: they already named it in `which` (`rule.require.solve-at-cause`). an
39
+ * author who genuinely wants to forge a context holds the referenced boundary,
40
+ * where the override lives and where no wire can contradict it.
41
+ *
42
+ * .note = the account id is a placeholder, deliberately, and it is the ONE
43
+ * placeholder — `domain.objects/AwsIdentitySynthetic` owns it. a local copy of
44
+ * the region default or of the account here makes this file another
45
+ * independent speaker of one convention.
46
+ */
47
+ const asLocalRunIdentity = (input) => {
48
+ const region = input.region ?? AwsIdentitySynthetic_1.AWS_REGION_SYNTHETIC;
49
+ return {
50
+ functionName: input.endpoint.slug,
51
+ invokedFunctionArn: `arn:aws:lambda:${region}:${AwsIdentitySynthetic_1.AWS_ACCOUNT_SYNTHETIC}:function:${input.endpoint.slug}`,
52
+ logGroupName: `/aws/lambda/${input.endpoint.slug}`,
53
+ logStreamName: input.endpoint.slug,
54
+ };
55
+ };
56
+ exports.asLocalRunIdentity = asLocalRunIdentity;
57
+ //# sourceMappingURL=asLocalRunIdentity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asLocalRunIdentity.js","sourceRoot":"","sources":["../../../../src/domain.operations/runLambdaEndpoint/local/asLocalRunIdentity.ts"],"names":[],"mappings":";;;AAEA,uFAGsD;AAGtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAGlC,EAAoB,EAAE;IACrB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,2CAAoB,CAAC;IAEpD,OAAO;QACL,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI;QACjC,kBAAkB,EAAE,kBAAkB,MAAM,IAAI,4CAAqB,aAAa,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE;QACvG,YAAY,EAAE,eAAe,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE;QAClD,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI;KACnC,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,kBAAkB,sBAY7B"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * .what = looks up the handler function a serverless.yml declares for an endpoint
3
+ * .why = `at: 'local'` addresses the endpoint by SLUG, so the util must find the
4
+ * function the slug names. same mechanism the incumbent uses.
5
+ *
6
+ * 🔴 every failure names the fix — case=10's whole subject. when the lookup fails
7
+ * the incumbent's error blames the HANDLER and the author debugs the wrong
8
+ * file, so each throw below states what was sought, where it looked, and what
9
+ * to do (rule.require.errors-name-the-fix).
10
+ */
11
+ export declare const getOneHandlerFromServerlessYml: (input: {
12
+ service: string;
13
+ function: string;
14
+ /**
15
+ * where to start the search for the project root. cwd by default.
16
+ */
17
+ from?: string;
18
+ }) => Promise<(event: unknown, context: unknown) => Promise<unknown>>;