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
@@ -24,11 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.getAllLambdaContracts = void 0;
27
- const LambdaCredentialsAbsentError_1 = require("../../domain.objects/LambdaCredentialsAbsentError");
28
27
  const LambdaIntrospectionBlockedError_1 = require("../../domain.objects/LambdaIntrospectionBlockedError");
29
28
  const LambdaServiceNotFoundError_1 = require("../../domain.objects/LambdaServiceNotFoundError");
30
29
  const asLambdaEndpoint_1 = require("../asLambdaEndpoint/asLambdaEndpoint");
31
30
  const getOneLambdaContract_1 = require("../getOneLambdaContract/getOneLambdaContract");
31
+ const throwIfCredentialsError_1 = require("../lambdaEndpointWire/error/throwIfCredentialsError");
32
32
  const asContractRecord_1 = require("./lambdaContract/asContractRecord");
33
33
  const getAllLambdaFunctionsByPrefix_1 = require("./lambdaFunction/getAllLambdaFunctionsByPrefix");
34
34
  /**
@@ -57,18 +57,29 @@ const getAllLambdaContracts = async (input, context) => {
57
57
  hint: 're-run with --env prep',
58
58
  });
59
59
  }
60
- // build prefix from service + access
61
- const prefix = `${input.which.service}-${context.env.access}-`;
60
+ // build prefix through asLambdaEndpoint — the SINGLE owner of the slug format
61
+ // (define.lambda-endpoint-ubiqlang). the prefix is the slug of an endpoint with
62
+ // an empty function: '{service}-{access}-'. a slug built through the owner cannot
63
+ // fork the join convention here (this was the 2nd hand-rolled speaker; now one).
64
+ const prefix = (0, asLambdaEndpoint_1.asLambdaEndpoint)({
65
+ service: input.which.service,
66
+ access: context.env.access,
67
+ function: '',
68
+ }).slug;
62
69
  // get or create LambdaClient (genLambdaSdk always returns valid client)
63
70
  const sdkLambda = context.aws?.lambda?.sdk ??
64
71
  (await Promise.resolve().then(() => __importStar(require('../../access/sdks/lambda/genLambdaSdk'))).then((m) => m.genLambdaSdk({ env: { region: context.env.region } })));
65
72
  // discover endpoint slugs by prefix. a creds failure surfaces on this first aws
66
73
  // call — map it to a caller-must-fix LambdaCredentialsAbsentError (with an unlock
67
74
  // hint), not a raw aws CredentialsProviderError
68
- const slugs = await (0, getAllLambdaFunctionsByPrefix_1.getAllLambdaFunctionsByPrefix)({ prefix }, { sdkLambda }).catch((error) => throwIfCredentialsError({
75
+ const slugs = await (0, getAllLambdaFunctionsByPrefix_1.getAllLambdaFunctionsByPrefix)({ prefix }, { sdkLambda }).catch((error) => (0, throwIfCredentialsError_1.throwIfCredentialsError)({
69
76
  error,
70
- service: input.which.service,
77
+ message: 'aws credentials are absent or expired; cannot introspect',
71
78
  access: context.env.access,
79
+ metadata: {
80
+ service: input.which.service,
81
+ access: context.env.access,
82
+ },
72
83
  }));
73
84
  // throw if no endpoints found
74
85
  if (slugs.length === 0) {
@@ -101,34 +112,4 @@ const getAllLambdaContracts = async (input, context) => {
101
112
  return (0, asContractRecord_1.asContractRecord)(entries);
102
113
  };
103
114
  exports.getAllLambdaContracts = getAllLambdaContracts;
104
- /**
105
- * .what = decide whether an error is an aws sdk credentials failure
106
- * .why = a creds failure is caller-must-fix (unlock + retry), not a malfunction —
107
- * the discovery boundary maps it to a hinted LambdaCredentialsAbsentError
108
- */
109
- const getIsCredentialsError = (error) => {
110
- if (!(error instanceof Error))
111
- return false;
112
- const name = error.name.toLowerCase();
113
- const message = error.message.toLowerCase();
114
- return (name.includes('credential') ||
115
- message.includes('credential') ||
116
- (message.includes('security token') && message.includes('expired')));
117
- };
118
- /**
119
- * .what = map an aws credentials failure to a hinted LambdaCredentialsAbsentError
120
- * .why = surface a creds failure with an unlock hint (caller-must-fix) rather than a
121
- * raw aws error; any non-creds error rethrows unchanged. returns `never` — it
122
- * always throws — so the caller keeps a non-null slug list.
123
- */
124
- const throwIfCredentialsError = (input) => {
125
- if (!getIsCredentialsError(input.error))
126
- throw input.error;
127
- throw new LambdaCredentialsAbsentError_1.LambdaCredentialsAbsentError('aws credentials are absent or expired; cannot introspect', {
128
- service: input.service,
129
- access: input.access,
130
- hint: 'unlock prep creds (e.g. `rhx keyrack unlock --owner ehmpath --env prep`), then re-run',
131
- cause: input.error instanceof Error ? input.error : undefined,
132
- });
133
- };
134
115
  //# sourceMappingURL=getAllLambdaContracts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getAllLambdaContracts.js","sourceRoot":"","sources":["../../../src/domain.operations/getAllLambdaContracts/getAllLambdaContracts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,oGAAiG;AAEjG,0GAAuG;AACvG,gG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AAG,CAAC,KAAc,EAAW,EAAE;IACxD,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAC5C,OAAO,CACL,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC3B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC9B,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CACpE,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,uBAAuB,GAAG,CAAC,KAIhC,EAAS,EAAE;IACV,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,MAAM,KAAK,CAAC,KAAK,CAAC;IAC3D,MAAM,IAAI,2DAA4B,CACpC,0DAA0D,EAC1D;QACE,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,uFAAuF;QAC7F,KAAK,EAAE,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;KAC9D,CACF,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"getAllLambdaContracts.js","sourceRoot":"","sources":["../../../src/domain.operations/getAllLambdaContracts/getAllLambdaContracts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0GAAuG;AACvG,gGAA6F;AAC7F,2EAAwE;AACxE,uFAAoF;AACpF,iGAA8F;AAC9F,wEAAqE;AACrE,kGAA+F;AAE/F;;;;;;;;;;;;;;;GAeG;AACI,MAAM,qBAAqB,GAAG,KAAK,EACxC,KAIC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O,CAAC,CAAC;AACnC,CAAC,CAAC;AAjGW,QAAA,qBAAqB,yBAiGhC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getExidFromContext.js","sourceRoot":"","sources":["../../../../src/domain.operations/lambdaEndpointWire/context/getExidFromContext.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEpC;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAElC,EAAuD,EAAE;IACxD,8BAA8B;IAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC;IACpC,IAAI,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAE/C,kDAAkD;IAClD,OAAO,EAAE,IAAI,EAAE,QAAQ,IAAA,mBAAU,GAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAC/D,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLogForExidExtraction.js","sourceRoot":"","sources":["../../../../src/domain.operations/lambdaEndpointWire/context/getLogForExidExtraction.ts"],"names":[],"mappings":";;;AAUA;;;;;;;GAOG;AACI,MAAM,uBAAuB,GAAG,CAAC,KAEvC,EAAoD,EAAE;IACrD,IAAI,CAAC,KAAK,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAC5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC7C,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;AAC3D,CAAC,CAAC;AANW,QAAA,uBAAuB,2BAMlC"}
@@ -0,0 +1,36 @@
1
+ import type { ContextLogTrail } from 'sdk-logs';
2
+ /**
3
+ * .what = gets the caller's trail exid, and reports when one had to be generated
4
+ * .why = every caller that addresses an endpoint owes BOTH halves, and the second
5
+ * half is the one that gets dropped
6
+ *
7
+ * 🔴 **this exists because the two halves were a stated PARITY REQUIREMENT rather
8
+ * than a structural one.** `getExidFromContext` deliberately emits no log of
9
+ * its own — it returns `source` so each caller may report the fallback (see
10
+ * its docblock). that design is right, and it means every caller must
11
+ * remember to act on `source` — an obligation a reader cannot catch
12
+ * themselves miss.
13
+ *
14
+ * ⚠️ **and a caller that forgets diverges on an OBSERVABLE, with no test to
15
+ * catch it:**
16
+ *
17
+ * | if `source` were dropped at one locus | a caller who sent no trail exid sees |
18
+ * |---|---|
19
+ * | the locus that reports | `trail.exid.generated` on the debug log |
20
+ * | the locus that forgot | silence |
21
+ *
22
+ * ⇒ a migrant who omitted the trail would meet a clean run at one locus and a log
23
+ * full of the warn at the other — the exact surprise the locus-parity design
24
+ * exists to prevent, and no assertion anywhere would go red.
25
+ *
26
+ * ✅ **so the parity is now held by the CALL, never by a comment.** both callers
27
+ * invoke this one operation, so a change to the report reaches both at once and
28
+ * neither can drift from the other.
29
+ *
30
+ * .note = the debug emission is the sdk's own diagnostic. no payload, no output
31
+ * type, and no error stance moves with it, so this is observable to an operator
32
+ * and invisible to the wire.
33
+ */
34
+ export declare const getOneTrailExid: (input: {
35
+ log: ContextLogTrail['log'];
36
+ }) => string;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOneTrailExid = void 0;
4
+ const getExidFromContext_1 = require("./getExidFromContext");
5
+ const getLogForExidExtraction_1 = require("./getLogForExidExtraction");
6
+ /**
7
+ * .what = gets the caller's trail exid, and reports when one had to be generated
8
+ * .why = every caller that addresses an endpoint owes BOTH halves, and the second
9
+ * half is the one that gets dropped
10
+ *
11
+ * 🔴 **this exists because the two halves were a stated PARITY REQUIREMENT rather
12
+ * than a structural one.** `getExidFromContext` deliberately emits no log of
13
+ * its own — it returns `source` so each caller may report the fallback (see
14
+ * its docblock). that design is right, and it means every caller must
15
+ * remember to act on `source` — an obligation a reader cannot catch
16
+ * themselves miss.
17
+ *
18
+ * ⚠️ **and a caller that forgets diverges on an OBSERVABLE, with no test to
19
+ * catch it:**
20
+ *
21
+ * | if `source` were dropped at one locus | a caller who sent no trail exid sees |
22
+ * |---|---|
23
+ * | the locus that reports | `trail.exid.generated` on the debug log |
24
+ * | the locus that forgot | silence |
25
+ *
26
+ * ⇒ a migrant who omitted the trail would meet a clean run at one locus and a log
27
+ * full of the warn at the other — the exact surprise the locus-parity design
28
+ * exists to prevent, and no assertion anywhere would go red.
29
+ *
30
+ * ✅ **so the parity is now held by the CALL, never by a comment.** both callers
31
+ * invoke this one operation, so a change to the report reaches both at once and
32
+ * neither can drift from the other.
33
+ *
34
+ * .note = the debug emission is the sdk's own diagnostic. no payload, no output
35
+ * type, and no error stance moves with it, so this is observable to an operator
36
+ * and invisible to the wire.
37
+ */
38
+ const getOneTrailExid = (input) => {
39
+ const { exid, source } = (0, getExidFromContext_1.getExidFromContext)({
40
+ log: (0, getLogForExidExtraction_1.getLogForExidExtraction)({ log: input.log }),
41
+ });
42
+ // report the fallback, so a caller that did not propagate a trail can see why
43
+ // their traces do not join up
44
+ if (source === 'generated') {
45
+ input.log.debug('trail.exid.generated', {
46
+ exid,
47
+ note: 'no trail exid in context, generated new one',
48
+ });
49
+ }
50
+ return exid;
51
+ };
52
+ exports.getOneTrailExid = getOneTrailExid;
53
+ //# sourceMappingURL=getOneTrailExid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOneTrailExid.js","sourceRoot":"","sources":["../../../../src/domain.operations/lambdaEndpointWire/context/getOneTrailExid.ts"],"names":[],"mappings":";;;AAEA,6DAA0D;AAC1D,uEAAoE;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACI,MAAM,eAAe,GAAG,CAAC,KAE/B,EAAU,EAAE;IACX,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAA,uCAAkB,EAAC;QAC1C,GAAG,EAAE,IAAA,iDAAuB,EAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;KACjD,CAAC,CAAC;IAEH,8EAA8E;IAC9E,8BAA8B;IAC9B,IAAI,MAAM,KAAK,WAAW,EAAE,CAAC;QAC3B,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,EAAE;YACtC,IAAI;YACJ,IAAI,EAAE,6CAA6C;SACpD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B"}
@@ -0,0 +1 @@
1
+ export declare const getIsContempErrorTagged: (value: unknown) => boolean;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIsContempErrorTagged = void 0;
4
+ const LambdaEndpointErrorResponseBody_1 = require("../../../domain.objects/LambdaEndpointErrorResponseBody");
5
+ /**
6
+ * .what = the contemp half of "is this an error envelope" — one shared tag check
7
+ * .why = both boundaries (wire + run) ask the identical question of a tag, so one
8
+ * writer. a fork between a producer and a detector fails SILENT: the detector
9
+ * stops to recognize the envelope, and a caller fault reads as a success payload.
10
+ *
11
+ * 🔴 matches the PREFIX, never the full tag. a decoder must accept an envelope from
12
+ * ANY codec version; an equality check would stop to recognize a `v2` envelope
13
+ * the day a `v1` service met one — the silent break above.
14
+ *
15
+ * 🔴 an ABSENT `@version` is version 0 — the v0.3.0 producer, already deployed,
16
+ * emits a bare `…::contemp`. tolerance is finite; it dies once every producer
17
+ * stamps a version.
18
+ *
19
+ * .note = the match is prefix + (`@` | end). a bare `startsWith` would admit a peer
20
+ * codec named `…::contempFOO`.
21
+ */
22
+ const CONTEMP_TAG_BOUNDARY = new RegExp(`^${LambdaEndpointErrorResponseBody_1.LAMBDA_ENDPOINT_ERROR_SERDE_CONTEMP_PREFIX}(@|$)`);
23
+ const getIsContempErrorTagged = (value) => {
24
+ if (typeof value !== 'object' || value === null)
25
+ return false;
26
+ const serde = value.error?._serde;
27
+ if (typeof serde !== 'string')
28
+ return false;
29
+ return CONTEMP_TAG_BOUNDARY.test(serde);
30
+ };
31
+ exports.getIsContempErrorTagged = getIsContempErrorTagged;
32
+ //# sourceMappingURL=getIsContempErrorTagged.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getIsContempErrorTagged.js","sourceRoot":"","sources":["../../../../src/domain.operations/lambdaEndpointWire/error/getIsContempErrorTagged.ts"],"names":[],"mappings":";;;AAAA,6GAAqH;AAErH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,oBAAoB,GAAG,IAAI,MAAM,CACrC,IAAI,4EAA0C,OAAO,CACtD,CAAC;AAEK,MAAM,uBAAuB,GAAG,CAAC,KAAc,EAAW,EAAE;IACjE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,KAAK,GAAI,KAA0C,CAAC,KAAK,EAAE,MAAM,CAAC;IACxE,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC"}
@@ -0,0 +1,63 @@
1
+ import type { LambdaEndpointErrorResponseBodyAncient, LambdaEndpointErrorResponseBodyContemp } from '../../../domain.objects/LambdaEndpointErrorResponseBody';
2
+ /**
3
+ * contemp error response shape from genLambdaEndpoint
4
+ * .note = an ALIAS of the canonical shape, never a copy — so a field added
5
+ * there arrives here rather than waits for someone to notice.
6
+ */
7
+ export type LambdaErrorResponseContemp = LambdaEndpointErrorResponseBodyContemp;
8
+ /**
9
+ * ancient error response shape from AWS Lambda or old genLambdaEndpoint
10
+ * .note = stackTrace can be string[] (aws native) or string (genLambdaEndpoint)
11
+ *
12
+ * 🔴 **DERIVED from the canonical shape rather than hand-declared**, so the two
13
+ * can diverge only where this file says they may:
14
+ *
15
+ * | field | why it differs from the canonical |
16
+ * |---|---|
17
+ * | `errorType?` | **optional here.** aws emits a duration-exceeded fault with a message and no type — see `getIsAncientErrorResponse` below |
18
+ * | `stackTrace?` | **added here.** aws sends it on the wire; this package's own emitter does not (`getErrorResponseBodyAncient`) |
19
+ *
20
+ * 🟡 it is WIDER than the canonical, one-directionally and on purpose: it models
21
+ * what comes OFF a wire (aws, this package, or a legacy handler) where the
22
+ * canonical models what this package PUTS ON one. the derivation adds and
23
+ * never removes, and every other field tracks the canonical automatically.
24
+ */
25
+ export type LambdaErrorResponseAncient = Omit<LambdaEndpointErrorResponseBodyAncient, 'errorType'> & {
26
+ errorType?: string;
27
+ /**
28
+ * .note = string[] (aws native) or string (a legacy genLambdaEndpoint handler)
29
+ */
30
+ stackTrace?: string[] | string;
31
+ };
32
+ /**
33
+ * .what = checks if parsed response is a contemp lambda error response, and narrows it
34
+ * .why = the wire boundary needs the NARROW; the tag read itself is shared
35
+ *
36
+ * .note = the predicate body is `getIsContempErrorTagged`, which the run boundary
37
+ * calls too. what stays here is only the `parsed is …` narrow, because the two
38
+ * boundaries narrow to different declared types — see that operation for why
39
+ * the contemp halves share and the ancient halves do not.
40
+ */
41
+ export declare const getIsContempErrorResponse: (parsed: unknown) => parsed is LambdaEndpointErrorResponseBodyContemp;
42
+ /**
43
+ * .what = checks if parsed response is an ancient lambda error response
44
+ * .why = ancient errors have flat errorMessage property
45
+ *
46
+ * 🔴 the single-field check is DELIBERATE — it is not the question
47
+ * `isLambdaEndpointErrorEnvelope` asks:
48
+ *
49
+ * | predicate | requires | answers |
50
+ * |---|---|---|
51
+ * | this one, on the WIRE | `errorMessage` alone | *"did the UPSTREAM fault, by any route?"* |
52
+ * | `isLambdaEndpointErrorEnvelope`, on a RUN | both fields, both `string` | *"did MY HANDLER return an envelope?"* |
53
+ *
54
+ * ⚠️ `errorType` is optional because AWS makes it so — a lambda that exceeds its
55
+ * duration answers with an `errorMessage` and no type. a check that demanded
56
+ * both would refuse a payload this package's own types declare legal, and the
57
+ * downgrade is QUIET: the rich message is replaced by the generic
58
+ * fall-through one on the commonest production failure.
59
+ *
60
+ * .note = so this is intentionally LOOSER than its run-side peer. to "reconcile"
61
+ * the two is to delete a case, never to remove a drift.
62
+ */
63
+ export declare const getIsAncientErrorResponse: (parsed: unknown) => parsed is LambdaErrorResponseAncient;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIsAncientErrorResponse = exports.getIsContempErrorResponse = void 0;
4
+ const getIsContempErrorTagged_1 = require("./getIsContempErrorTagged");
5
+ /**
6
+ * .what = checks if parsed response is a contemp lambda error response, and narrows it
7
+ * .why = the wire boundary needs the NARROW; the tag read itself is shared
8
+ *
9
+ * .note = the predicate body is `getIsContempErrorTagged`, which the run boundary
10
+ * calls too. what stays here is only the `parsed is …` narrow, because the two
11
+ * boundaries narrow to different declared types — see that operation for why
12
+ * the contemp halves share and the ancient halves do not.
13
+ */
14
+ const getIsContempErrorResponse = (parsed) => (0, getIsContempErrorTagged_1.getIsContempErrorTagged)(parsed);
15
+ exports.getIsContempErrorResponse = getIsContempErrorResponse;
16
+ /**
17
+ * .what = checks if parsed response is an ancient lambda error response
18
+ * .why = ancient errors have flat errorMessage property
19
+ *
20
+ * 🔴 the single-field check is DELIBERATE — it is not the question
21
+ * `isLambdaEndpointErrorEnvelope` asks:
22
+ *
23
+ * | predicate | requires | answers |
24
+ * |---|---|---|
25
+ * | this one, on the WIRE | `errorMessage` alone | *"did the UPSTREAM fault, by any route?"* |
26
+ * | `isLambdaEndpointErrorEnvelope`, on a RUN | both fields, both `string` | *"did MY HANDLER return an envelope?"* |
27
+ *
28
+ * ⚠️ `errorType` is optional because AWS makes it so — a lambda that exceeds its
29
+ * duration answers with an `errorMessage` and no type. a check that demanded
30
+ * both would refuse a payload this package's own types declare legal, and the
31
+ * downgrade is QUIET: the rich message is replaced by the generic
32
+ * fall-through one on the commonest production failure.
33
+ *
34
+ * .note = so this is intentionally LOOSER than its run-side peer. to "reconcile"
35
+ * the two is to delete a case, never to remove a drift.
36
+ */
37
+ const getIsAncientErrorResponse = (parsed) => typeof parsed === 'object' && parsed !== null && 'errorMessage' in parsed;
38
+ exports.getIsAncientErrorResponse = getIsAncientErrorResponse;
39
+ //# sourceMappingURL=getIsLambdaErrorResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getIsLambdaErrorResponse.js","sourceRoot":"","sources":["../../../../src/domain.operations/lambdaEndpointWire/error/getIsLambdaErrorResponse.ts"],"names":[],"mappings":";;;AAIA,uEAAoE;AAqCpE;;;;;;;;GAQG;AACI,MAAM,yBAAyB,GAAG,CACvC,MAAe,EACuB,EAAE,CAAC,IAAA,iDAAuB,EAAC,MAAM,CAAC,CAAC;AAF9D,QAAA,yBAAyB,6BAEqC;AAE3E;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,yBAAyB,GAAG,CACvC,MAAe,EACuB,EAAE,CACxC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,cAAc,IAAI,MAAM,CAAC;AAH/D,QAAA,yBAAyB,6BAGsC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLambdaErrorMetadata.js","sourceRoot":"","sources":["../../../../src/domain.operations/lambdaEndpointWire/error/getLambdaErrorMetadata.ts"],"names":[],"mappings":";;;AAWA;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAC,KAEtC,EAAuB,EAAE;IACxB,OAAO;QACL,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,KAAK,SAAS,IAAI;YAC/C,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO;SACrC,CAAC;QACF,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,YAAY,KAAK,SAAS,IAAI;YACpD,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY;SAC/C,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,sBAAsB,0BAWjC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getStackTraceString.js","sourceRoot":"","sources":["../../../../src/domain.operations/lambdaEndpointWire/error/getStackTraceString.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAEnC,EAAsB,EAAE;IACvB,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACrD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxE,OAAO,KAAK,CAAC,UAAU,CAAC;AAC1B,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * .what = decide whether an error is an aws sdk credentials failure, ANYWHERE in
3
+ * its cause chain
4
+ * .why = a creds failure is caller-must-fix (unlock + retry) at every boundary a
5
+ * DEVELOPER drives, so it is worth a named error rather than aws's own
6
+ *
7
+ * 🔴 the CHAIN WALK removes a dependency on a peer file's message format. the
8
+ * invoke path wraps first (`executeLambdaInvocation.ts:63`), so the top-level
9
+ * name is `LambdaEndpointError` and the only thing that carries *"credentials"*
10
+ * up to it is an interpolated `${error.message}` — a format choice a reasonable
11
+ * edit would quietly end.
12
+ *
13
+ * ⚠️ probed: a detector reduced to a top-level read leaves `[case12]` GREEN, so
14
+ * the walk is not what makes the invoke path work today. `[case2]` of this
15
+ * file's unit suite is what bites.
16
+ *
17
+ * ⇒ a belt-and-braces guard on a live coupling, worth its four lines because a
18
+ * dead detector fails QUIET — it returns `false`, the error rethrows, and the
19
+ * developer is back to aws's own string with no test red.
20
+ */
21
+ export declare const getIsCredentialsError: (error: unknown, seen?: Set<unknown>) => boolean;
22
+ /**
23
+ * .what = maps an aws credentials failure to a hinted `LambdaCredentialsAbsentError`;
24
+ * rethrows every other error unchanged
25
+ * .why = an absent credential is the one aws fault a developer fixes in ONE
26
+ * command, and aws's *"Could not load credentials from any providers"* says
27
+ * naught about which env, which owner, or what to run.
28
+ *
29
+ * 🔴 the boundary this must NOT be wired into: `askLambdaEndpoint`, a RUNTIME
30
+ * caller. same aws error, opposite diagnosis —
31
+ *
32
+ * | boundary | who meets it | an absent credential is |
33
+ * |---|---|---|
34
+ * | `getAllLambdaContracts`, `onSerialized({ at: 'cloud' })` | a developer, at a terminal | an expired sso session |
35
+ * | `askLambdaEndpoint` | a deployed lambda, in prod | a broken execution role |
36
+ *
37
+ * `LambdaCredentialsAbsentError extends ConstraintError` ⇒ caller fault, no
38
+ * retry, NO ALARM (invariant.badrequesterror-not-lambda-error). to map it on
39
+ * the runtime path would suppress the prod alarm that names a broken role.
40
+ *
41
+ * ⚠️ so the runtime path's lack of this mapper is a DESIGN, not a gap.
42
+ */
43
+ export declare const throwIfCredentialsError: (input: {
44
+ error: unknown;
45
+ message: string;
46
+ /**
47
+ * .what = the env the caller addressed, so the hint names THEIR env
48
+ * .why = a hardcoded `--env prep` names the WRONG env for a `prod` caller, and
49
+ * a wrong hint is worse than none — it reads authoritative and sends the
50
+ * developer to unlock a credential that was never the one absent.
51
+ */
52
+ access: string;
53
+ metadata: Record<string, unknown>;
54
+ }) => never;
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.throwIfCredentialsError = exports.getIsCredentialsError = void 0;
4
+ const helpful_errors_1 = require("helpful-errors");
5
+ const LambdaCredentialsAbsentError_1 = require("../../../domain.objects/LambdaCredentialsAbsentError");
6
+ /**
7
+ * .what = decide whether an error is an aws sdk credentials failure, ANYWHERE in
8
+ * its cause chain
9
+ * .why = a creds failure is caller-must-fix (unlock + retry) at every boundary a
10
+ * DEVELOPER drives, so it is worth a named error rather than aws's own
11
+ *
12
+ * 🔴 the CHAIN WALK removes a dependency on a peer file's message format. the
13
+ * invoke path wraps first (`executeLambdaInvocation.ts:63`), so the top-level
14
+ * name is `LambdaEndpointError` and the only thing that carries *"credentials"*
15
+ * up to it is an interpolated `${error.message}` — a format choice a reasonable
16
+ * edit would quietly end.
17
+ *
18
+ * ⚠️ probed: a detector reduced to a top-level read leaves `[case12]` GREEN, so
19
+ * the walk is not what makes the invoke path work today. `[case2]` of this
20
+ * file's unit suite is what bites.
21
+ *
22
+ * ⇒ a belt-and-braces guard on a live coupling, worth its four lines because a
23
+ * dead detector fails QUIET — it returns `false`, the error rethrows, and the
24
+ * developer is back to aws's own string with no test red.
25
+ */
26
+ const getIsCredentialsError = (error,
27
+ // 🔴 a SET, never a `cause === error` self-compare — that catches a one-step
28
+ // cycle and recurses to `RangeError` on a two-step one (`A→B→A`). a stack
29
+ // overflow REPLACES the real error with a crash that names neither the fault
30
+ // nor the fix, which is worse than the quiet failure above.
31
+ seen = new Set()) => {
32
+ // 🔴 `instanceof Error`, NOT the shared `isErrorLike` duck-type: the line below
33
+ // reads `error.name`, which a `.message`-only shape check does not guarantee.
34
+ // the cross-realm risk is bounded here — both callers raise the aws sdk error
35
+ // in-realm, so a realm-foreign `Error` cannot reach this gate.
36
+ if (!(error instanceof Error))
37
+ return false;
38
+ if (seen.has(error))
39
+ return false;
40
+ seen.add(error);
41
+ const name = error.name.toLowerCase();
42
+ const message = error.message.toLowerCase();
43
+ /**
44
+ * 🔴 the MESSAGE arm reads AWS's vocabulary, so it applies only to an error aws
45
+ * raised. a `HelpfulError`'s `.message` at these boundaries is most often the
46
+ * HANDLER's own text — `getParsedResponse` hydrates a caller fault into a
47
+ * bare `ConstraintError` that carries whatever the endpoint rejected with.
48
+ *
49
+ * ⇒ so an endpoint whose DOMAIN is credentials rejects with *"credential is
50
+ * invalid for this surfer"*, and an unguarded match would send the
51
+ * developer to unlock a credential that was never absent — a hint that is
52
+ * confident and wrong, which is worse than none.
53
+ *
54
+ * ✅ it costs no reach: a genuine aws fault wrapped by a `HelpfulError` is still
55
+ * found through `metadata.cause`, where both arms apply.
56
+ *
57
+ * 🟡 the NAME arm is left unguarded — a class name does not survive the wire.
58
+ */
59
+ const isAwsRaised = !(error instanceof helpful_errors_1.HelpfulError);
60
+ const isMatchHere = name.includes('credential') ||
61
+ (isAwsRaised &&
62
+ (message.includes('credential') ||
63
+ (message.includes('security token') && message.includes('expired'))));
64
+ if (isMatchHere)
65
+ return true;
66
+ // walk the cause, so a wrap at any depth cannot hide the fault. `cause` is
67
+ // read off both the standard `Error.cause` and `helpful-errors`' metadata,
68
+ // which is where this repo's own wrappers put it.
69
+ const cause = error.cause ??
70
+ error.metadata?.cause;
71
+ if (cause === undefined)
72
+ return false;
73
+ return (0, exports.getIsCredentialsError)(cause, seen);
74
+ };
75
+ exports.getIsCredentialsError = getIsCredentialsError;
76
+ /**
77
+ * .what = maps an aws credentials failure to a hinted `LambdaCredentialsAbsentError`;
78
+ * rethrows every other error unchanged
79
+ * .why = an absent credential is the one aws fault a developer fixes in ONE
80
+ * command, and aws's *"Could not load credentials from any providers"* says
81
+ * naught about which env, which owner, or what to run.
82
+ *
83
+ * 🔴 the boundary this must NOT be wired into: `askLambdaEndpoint`, a RUNTIME
84
+ * caller. same aws error, opposite diagnosis —
85
+ *
86
+ * | boundary | who meets it | an absent credential is |
87
+ * |---|---|---|
88
+ * | `getAllLambdaContracts`, `onSerialized({ at: 'cloud' })` | a developer, at a terminal | an expired sso session |
89
+ * | `askLambdaEndpoint` | a deployed lambda, in prod | a broken execution role |
90
+ *
91
+ * `LambdaCredentialsAbsentError extends ConstraintError` ⇒ caller fault, no
92
+ * retry, NO ALARM (invariant.badrequesterror-not-lambda-error). to map it on
93
+ * the runtime path would suppress the prod alarm that names a broken role.
94
+ *
95
+ * ⚠️ so the runtime path's lack of this mapper is a DESIGN, not a gap.
96
+ */
97
+ const throwIfCredentialsError = (input) => {
98
+ if (!(0, exports.getIsCredentialsError)(input.error))
99
+ throw input.error;
100
+ throw new LambdaCredentialsAbsentError_1.LambdaCredentialsAbsentError(input.message, {
101
+ ...input.metadata,
102
+ hint: `unlock aws creds (e.g. \`rhx keyrack unlock --owner ehmpath --env ${input.access}\`), then re-run`,
103
+ cause: input.error instanceof Error ? input.error : undefined,
104
+ });
105
+ };
106
+ exports.throwIfCredentialsError = throwIfCredentialsError;
107
+ //# sourceMappingURL=throwIfCredentialsError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throwIfCredentialsError.js","sourceRoot":"","sources":["../../../../src/domain.operations/lambdaEndpointWire/error/throwIfCredentialsError.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAE9C,uGAAoG;AAEpG;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,qBAAqB,GAAG,CACnC,KAAc;AACd,6EAA6E;AAC7E,6EAA6E;AAC7E,gFAAgF;AAChF,+DAA+D;AAC/D,OAAqB,IAAI,GAAG,EAAE,EACrB,EAAE;IACX,gFAAgF;IAChF,iFAAiF;IACjF,iFAAiF;IACjF,kEAAkE;IAClE,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAClC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEhB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAE5C;;;;;;;;;;;;;;;OAeG;IACH,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,YAAY,6BAAY,CAAC,CAAC;IACrD,MAAM,WAAW,GACf,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC3B,CAAC,WAAW;YACV,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;gBAC7B,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IAE7B,2EAA2E;IAC3E,2EAA2E;IAC3E,kDAAkD;IAClD,MAAM,KAAK,GACR,KAA6B,CAAC,KAAK;QACnC,KAA4C,CAAC,QAAQ,EAAE,KAAK,CAAC;IAChE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,IAAA,6BAAqB,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC,CAAC;AAnDW,QAAA,qBAAqB,yBAmDhC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,uBAAuB,GAAG,CAAC,KAavC,EAAS,EAAE;IACV,IAAI,CAAC,IAAA,6BAAqB,EAAC,KAAK,CAAC,KAAK,CAAC;QAAE,MAAM,KAAK,CAAC,KAAK,CAAC;IAC3D,MAAM,IAAI,2DAA4B,CAAC,KAAK,CAAC,OAAO,EAAE;QACpD,GAAG,KAAK,CAAC,QAAQ;QACjB,IAAI,EAAE,qEAAqE,KAAK,CAAC,MAAM,kBAAkB;QACzG,KAAK,EAAE,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;KAC9D,CAAC,CAAC;AACL,CAAC,CAAC;AApBW,QAAA,uBAAuB,2BAoBlC"}
@@ -1,6 +1,12 @@
1
1
  /**
2
2
  * .what = wrapped payload format with event and trail
3
3
  * .why = askLambdaEndpoint sends this format for trail propagation
4
+ *
5
+ * .note = it lives at this common ancestor because THREE contexts touch the
6
+ * frame — `askLambdaEndpoint` emits it over the wire, `asFramedPayload` emits
7
+ * it in-process, and `getUnwrappedEventWithExid` reads it. a detector parked
8
+ * inside the reader forces both emitters to reach in
9
+ * (`rule.prefer.most-common-denominator`).
4
10
  */
5
11
  export interface WrappedPayload<TEvent = unknown> {
6
12
  event: TEvent;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getIsWrappedPayload.js","sourceRoot":"","sources":["../../../../src/domain.operations/lambdaEndpointWire/frame/getIsWrappedPayload.ts"],"names":[],"mappings":";;;AAeA;;;GAGG;AACH,MAAM,YAAY,GAAG,CAAC,KAAc,EAA8B,EAAE;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACrE,OAAO,KAAK,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;AACtD,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,mBAAmB,GAAG,CACjC,OAAgB,EACmB,EAAE;IACrC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAClE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QACzE,OAAO,KAAK,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,GAAG,OAA6C,CAAC;IACxD,OAAO,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC,CAAC;AAbW,QAAA,mBAAmB,uBAa9B"}
@@ -0,0 +1,45 @@
1
+ import type { LambdaEndpoint } from '../../domain.objects/LambdaEndpoint';
2
+ /**
3
+ * .what = reads a lambda's raw wire response, and throws whatever fault it carries
4
+ * .why = this is the SERIALIZED boundary's hydration step — the one place a
5
+ * returned error envelope becomes a thrown error, which is what makes a
6
+ * caller's experience differ from the host's
7
+ * (`define.lambda-endpoint-run-boundary`)
8
+ *
9
+ * 🔴 **the branch order IS the contract, and it is precedence rather than a
10
+ * sequence of independent checks.** each branch wins over the ones below it:
11
+ *
12
+ * | # | when | it throws |
13
+ * |---|---|---|
14
+ * | 1 | the payload is absent or is not json | `LambdaEndpointError` |
15
+ * | 2 | a CONTEMP envelope — `{ error: { _serde, class, … } }` | `ConstraintError` when `class` is one; else `LambdaEndpointError` |
16
+ * | 3 | an ANCIENT envelope — `{ errorMessage, … }` | `ConstraintError` when `errorType` is `ConstraintError` **or** `BadRequestError`; else `LambdaEndpointError` |
17
+ * | 4 | aws reported a `functionError` and no shape above matched | `LambdaEndpointError`, with the payload in `details` |
18
+ * | 5 | none of the above | returns the payload as `TResponse` |
19
+ *
20
+ * ⚠️ **rows 2 and 3 split on the same question and answer it differently**, which
21
+ * is deliberate: a caller's bad request is not a lambda failure, so it
22
+ * hydrates to `ConstraintError` rather than to an invocation error
23
+ * (`invariant.badrequesterror-not-lambda-error`). the ancient arm accepts
24
+ * `BadRequestError` too, because that is the name the legacy family emits for
25
+ * the same fact (`invariant.ancient-vs-contemp-callers`).
26
+ *
27
+ * ⚠️ **row 4 reads aws's own verdict, and it only ever NARROWS** — the block at
28
+ * its site carries the argument.
29
+ *
30
+ * 🟡 **row 3 is LOOSER than its run-side peer by design** — it admits an envelope
31
+ * with no `errorType`, because a lambda that exceeds its duration answers
32
+ * exactly that shape. `getIsLambdaErrorResponse.ts` carries the argument.
33
+ *
34
+ * .note = three fulcrums cite this operation — **F16** (it was lifted here, so
35
+ * both callers share one serde), **F19/F20** (whether its two detectors should
36
+ * share one implementation with the run-side third), and **F17** (why the
37
+ * raw-wire test fixture must NOT route through it: this hydration is precisely
38
+ * what that instrument exists to observe from the outside).
39
+ */
40
+ export declare const getParsedResponse: <TResponse>(input: {
41
+ payload: Uint8Array | undefined;
42
+ functionError: string | undefined;
43
+ endpoint: LambdaEndpoint;
44
+ exid: string | null;
45
+ }) => TResponse;