sdk-aws-lambda 0.6.0 → 0.7.1

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 (165) hide show
  1. package/dist/domain.objects/ApiGatewayRequestEventOnwire.d.ts +18 -0
  2. package/dist/domain.objects/ApiGatewayRequestEventOnwire.js +3 -0
  3. package/dist/domain.objects/ApiGatewayRequestEventOnwire.js.map +1 -0
  4. package/dist/domain.objects/ApiGatewayResponse.d.ts +17 -10
  5. package/dist/domain.objects/{ApiGatewayResponsePayload.d.ts → ApiGatewayResponseOnwire.d.ts} +8 -4
  6. package/dist/domain.objects/{ApiGatewayRequestPayload.js → ApiGatewayResponseOnwire.js} +1 -1
  7. package/dist/domain.objects/ApiGatewayResponseOnwire.js.map +1 -0
  8. package/dist/domain.operations/genLambdaEndpoint/InvokeInputSuperset.d.ts +128 -0
  9. package/dist/domain.operations/genLambdaEndpoint/{genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js → InvokeInputSuperset.js} +1 -1
  10. package/dist/domain.operations/genLambdaEndpoint/InvokeInputSuperset.js.map +1 -0
  11. package/dist/domain.operations/genLambdaEndpoint/TranslateLog.d.ts +0 -17
  12. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.d.ts +27 -0
  13. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified.d.ts +100 -0
  14. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified.js +3 -0
  15. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified.js.map +1 -0
  16. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.d.ts +34 -0
  17. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.js +141 -0
  18. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.js.map +1 -0
  19. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.d.ts +22 -0
  20. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.js +27 -0
  21. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.js.map +1 -0
  22. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{asApiGatewayResponsePayloadJson.d.ts → asApiGatewayResponseOnwireJson.d.ts} +11 -11
  23. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{asApiGatewayResponsePayloadJson.js → asApiGatewayResponseOnwireJson.js} +12 -12
  24. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwireJson.js.map +1 -0
  25. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.d.ts +15 -13
  26. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js +13 -11
  27. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js.map +1 -1
  28. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.d.ts +35 -0
  29. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.js +44 -0
  30. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.js.map +1 -0
  31. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.d.ts +93 -56
  32. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js +88 -62
  33. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js.map +1 -1
  34. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getAllWirePayloadKeysFound.d.ts → getAllResponseOnwireKeysFound.d.ts} +2 -2
  35. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllResponseOnwireKeysFound.js +43 -0
  36. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllResponseOnwireKeysFound.js.map +1 -0
  37. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV1ApiGatewayEvent.d.ts → getIsV1ApiGatewayRequestEvent.d.ts} +1 -1
  38. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV1ApiGatewayEvent.js → getIsV1ApiGatewayRequestEvent.js} +4 -4
  39. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV1ApiGatewayRequestEvent.js.map +1 -0
  40. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV2ApiGatewayEvent.d.ts → getIsV2ApiGatewayRequestEvent.d.ts} +1 -1
  41. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV2ApiGatewayEvent.js → getIsV2ApiGatewayRequestEvent.js} +4 -4
  42. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayRequestEvent.js.map +1 -0
  43. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.d.ts +8 -5
  44. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js +11 -8
  45. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js.map +1 -1
  46. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/{genApiGatewayEventNormalizationMiddleware.d.ts → genApiGatewayRequestEventNormalizationMiddleware.d.ts} +3 -3
  47. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/{genApiGatewayEventNormalizationMiddleware.js → genApiGatewayRequestEventNormalizationMiddleware.js} +8 -8
  48. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayRequestEventNormalizationMiddleware.js.map +1 -0
  49. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.d.ts +4 -4
  50. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.js +5 -5
  51. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.d.ts +36 -0
  52. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.js +113 -0
  53. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.js.map +1 -0
  54. package/dist/domain.operations/genLambdaEndpoint/{genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.d.ts → genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.d.ts} +50 -14
  55. package/dist/domain.operations/genLambdaEndpoint/{genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js → genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.js} +31 -16
  56. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.js.map +1 -0
  57. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.d.ts +18 -0
  58. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.js +29 -0
  59. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.js.map +1 -0
  60. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.d.ts +23 -0
  61. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.js +38 -0
  62. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.js.map +1 -0
  63. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.d.ts +123 -0
  64. package/dist/{domain.objects/ApiGatewayResponsePayload.js → domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.js} +1 -1
  65. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.js.map +1 -0
  66. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.d.ts +23 -0
  67. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.js +33 -0
  68. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.js.map +1 -0
  69. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.d.ts +30 -0
  70. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.js +38 -0
  71. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.js.map +1 -0
  72. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.d.ts +30 -0
  73. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.js +86 -0
  74. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.js.map +1 -0
  75. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.d.ts +26 -0
  76. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.js +32 -0
  77. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.js.map +1 -0
  78. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.d.ts +82 -0
  79. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.js +108 -0
  80. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.js.map +1 -0
  81. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.d.ts +121 -0
  82. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.js +97 -0
  83. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.js.map +1 -0
  84. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.d.ts +52 -0
  85. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.js +68 -0
  86. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.js.map +1 -0
  87. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.d.ts +21 -0
  88. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.js +36 -0
  89. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.js.map +1 -0
  90. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.d.ts +46 -0
  91. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.js +79 -0
  92. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.js.map +1 -0
  93. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.js +31 -0
  94. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.js.map +1 -0
  95. package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.d.ts +8 -4
  96. package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.js.map +1 -1
  97. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.d.ts +10 -4
  98. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.d.ts +12 -0
  99. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.js +23 -0
  100. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.js.map +1 -0
  101. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js +17 -6
  102. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js.map +1 -1
  103. package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.d.ts +16 -18
  104. package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js +16 -18
  105. package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js.map +1 -1
  106. package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.d.ts +5 -0
  107. package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js +5 -0
  108. package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js.map +1 -1
  109. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.d.ts +14 -14
  110. package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js +15 -15
  111. package/dist/domain.operations/genLambdaEndpoint/middleware/getIsConstraintError.js +4 -0
  112. package/dist/domain.operations/genLambdaEndpoint/middleware/getIsConstraintError.js.map +1 -1
  113. package/dist/domain.operations/genLambdaEndpoint/middleware/getIsFrozenMutatorRefusal.d.ts +17 -0
  114. package/dist/domain.operations/genLambdaEndpoint/middleware/getIsFrozenMutatorRefusal.js +32 -0
  115. package/dist/domain.operations/genLambdaEndpoint/middleware/getIsFrozenMutatorRefusal.js.map +1 -0
  116. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.d.ts +5 -8
  117. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.js +5 -8
  118. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.js.map +1 -1
  119. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.d.ts +9 -27
  120. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.js +9 -27
  121. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.js.map +1 -1
  122. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.d.ts +14 -0
  123. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js +48 -16
  124. package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js.map +1 -1
  125. package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.d.ts +40 -0
  126. package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.js +55 -0
  127. package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.js.map +1 -0
  128. package/dist/domain.operations/genServiceSdk/gen.file/banner.d.ts +2 -3
  129. package/dist/domain.operations/genServiceSdk/gen.file/banner.js +2 -3
  130. package/dist/domain.operations/genServiceSdk/gen.file/banner.js.map +1 -1
  131. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.d.ts +7 -2
  132. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js +7 -2
  133. package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js.map +1 -1
  134. package/dist/index.d.ts +39 -18
  135. package/dist/index.js +20 -14
  136. package/dist/index.js.map +1 -1
  137. package/package.json +8 -6
  138. package/readme.md +164 -93
  139. package/dist/domain.objects/ApiGatewayRequestPayload.d.ts +0 -12
  140. package/dist/domain.objects/ApiGatewayRequestPayload.js.map +0 -1
  141. package/dist/domain.objects/ApiGatewayResponsePayload.js.map +0 -1
  142. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.d.ts +0 -36
  143. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js.map +0 -1
  144. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.d.ts +0 -19
  145. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js +0 -24
  146. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js.map +0 -1
  147. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayloadJson.js.map +0 -1
  148. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.d.ts +0 -27
  149. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js +0 -118
  150. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js.map +0 -1
  151. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js +0 -34
  152. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js.map +0 -1
  153. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV1ApiGatewayEvent.js.map +0 -1
  154. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayEvent.js.map +0 -1
  155. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.js.map +0 -1
  156. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.d.ts +0 -27
  157. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js +0 -54
  158. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js.map +0 -1
  159. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js.map +0 -1
  160. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.d.ts +0 -20
  161. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js +0 -31
  162. package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js.map +0 -1
  163. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.d.ts +0 -5
  164. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.js +0 -16
  165. package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.js.map +0 -1
@@ -16,31 +16,32 @@ const genIntrospectionMiddleware_1 = require("../middleware/genIntrospectionMidd
16
16
  const genIoLoggerMiddleware_1 = require("../middleware/genIoLoggerMiddleware");
17
17
  const genTrailMiddleware_1 = require("../middleware/genTrailMiddleware");
18
18
  const getValidatedOutput_1 = require("../middleware/getValidatedOutput");
19
- const asApiGatewayResponsePayload_1 = require("./asApiGatewayResponsePayload");
20
- const asApiGatewayResponsePayloadJson_1 = require("./asApiGatewayResponsePayloadJson");
21
- const asUnifiedApiGatewayEvent_1 = require("./asUnifiedApiGatewayEvent");
22
- const getAllWirePayloadKeysFound_1 = require("./getAllWirePayloadKeysFound");
19
+ const setEventFrozen_1 = require("../setEventFrozen");
20
+ const asApiGatewayRequestEventUnified_1 = require("./asApiGatewayRequestEventUnified");
21
+ const asApiGatewayResponseOnwire_1 = require("./asApiGatewayResponseOnwire");
22
+ const asApiGatewayResponseOnwireJson_1 = require("./asApiGatewayResponseOnwireJson");
23
+ const getAllResponseOnwireKeysFound_1 = require("./getAllResponseOnwireKeysFound");
23
24
  const isApiGatewayResponse_1 = require("./isApiGatewayResponse");
24
- const genApiGatewayEventNormalizationMiddleware_1 = require("./middleware/genApiGatewayEventNormalizationMiddleware");
25
+ const genApiGatewayRequestEventNormalizationMiddleware_1 = require("./middleware/genApiGatewayRequestEventNormalizationMiddleware");
25
26
  const genContentTypeCoherenceMiddleware_1 = require("./middleware/genContentTypeCoherenceMiddleware");
26
- const genZodBodyValidationMiddleware_1 = require("./middleware/genZodBodyValidationMiddleware");
27
+ const genZodInputValidationMiddleware_1 = require("./middleware/genZodInputValidationMiddleware");
27
28
  /** .what = converts this sdk's cors config into `@middy/http-cors` options */
28
29
  const corsInputToCorsConfig = (cors) => {
29
30
  return {
30
31
  /**
31
- * ⚠️ .what = supplies EITHER `origin` or `origins`, and OMITS the key it does not supply.
32
- * NEVER pass a key you do not mean to set — not `maxAge`, not any later addition
32
+ * .what = supplies either `origin` or `origins`, and omits the key it does not supply
33
33
  * .why = `@middy/http-cors` merges as `{ ...defaults, ...opts }` (`index.cjs:44-47`), so an
34
- * explicit `undefined` CLOBBERS the default. its `origins` default is `[]` and
34
+ * explicit `undefined` clobbers the default. its `origins` default is `[]` and
35
35
  * `getOrigin` opens with `options.origins.length` (`index.cjs:12-13`), so
36
36
  * `origins: undefined` throws from `after` and turns every success into a 500
37
+ * .note = so pass no key you do not mean to set — not `maxAge`, not any later addition
37
38
  */
38
39
  ...(cors.origins === '*' ? { origin: '*' } : { origins: cors.origins }),
39
40
  credentials: cors.credentials,
40
41
  headers: cors.headers ?? 'content-type,authorization',
41
42
  /**
42
- * ⚠️ .absent by choice = `disableBeforePreflightResponse: false` would turn on the vendor's
43
- * `OPTIONS` short-circuit — limit 1 on `CorsConfig`. blast radius, probed: ONE case
43
+ * .absent by choice = `disableBeforePreflightResponse: false` would turn on the vendor's
44
+ * `OPTIONS` short-circuit — limit 1 on `CorsConfig`. blast radius, probed: one case
44
45
  * (`[case11]` moves to a 204). left because it changes `OPTIONS` for every
45
46
  * cors-configured handler, and one that answers `OPTIONS` itself would lose the request
46
47
  */
@@ -57,7 +58,7 @@ const serializers = [
57
58
  * .why = adds cors, security headers, error conversion, body serialization, and validation
58
59
  */
59
60
  const forApiGateway = (config, context) => {
60
- const deserialize = config.deserialize ?? asUnifiedApiGatewayEvent_1.DESERIALIZE_DEFAULT;
61
+ const deserialize = config.deserialize ?? asApiGatewayRequestEventUnified_1.DESERIALIZE_DEFAULT;
61
62
  /**
62
63
  * .what = the handler's own step: invoke, assure, validate, encode
63
64
  * .why = by here the chain has reconciled the request and refused a wrong body shape, so
@@ -67,13 +68,34 @@ const forApiGateway = (config, context) => {
67
68
  // read the trail log `genTrailMiddleware` wrote; the cast lives in the shared reader
68
69
  const { log } = (0, asContextLogTrail_1.asContextLogTrail)({ context: lambdaContext });
69
70
  /**
70
- * .as = `event.body` is `TInput` by the time this runs, because
71
- * `genZodBodyValidationMiddleware` has already parsed it against `schema.input`
72
- * and replaced it with the parsed value
73
- * .removal = drops when the input translate owns this seam, which needs `inputAfter` to
74
- * have one home across both chains — see the 🚧 note in the execution yield
71
+ * .what = seals the envelope before the handler can touch it
72
+ * .why = `event` IS middy's `request.event`, by reference, and two vendors read it in their
73
+ * `after` hooks — after `invoke` has returned. a handler that writes through it
74
+ * corrupts what they read, with no error anywhere
75
+ * .why deep = a shallow freeze leaves `event.headers`, `event.params`, and `event._.raw`
76
+ * writable, and `headers` is exactly the object `@middy/http-cors` reads
77
+ * (`index.js:83`)
78
+ * .why safe = measured across the five installed `@middy/*` packages: 8 reads of
79
+ * `request.event`, and 0 writes. every sdk write to it is a `before` hook, so none
80
+ * survives to here (`domain.terms/event.md`)
81
+ *
82
+ * .residual = `@middy/http-json-body-parser` does write `request.event.body`
83
+ * (`index.js:25`) and would throw under this freeze. it is imported nowhere in
84
+ * `src/` — this sdk parses the body itself, in `asApiGatewayRequestEventUnified`
85
+ */
86
+ const eventFrozen = (0, setEventFrozen_1.setEventFrozen)({ event });
87
+ /**
88
+ * .what = hands over the pair plus the envelope; the two lifted fields are PROJECTIONS of
89
+ * its slots
90
+ * .note = read from `eventFrozen` rather than `event` — it is the SAME reference (the freeze
91
+ * is in place), and the narrowed type is what carries the readonly guarantee to the
92
+ * handler. a read off `event` would hand over the pre-freeze type and silently drop it
75
93
  */
76
- const response = await config.invoke({ event: event.body, rawEvent: event }, { log });
94
+ const response = await config.invoke({
95
+ headers: eventFrozen.headers,
96
+ payload: eventFrozen.payload,
97
+ event: eventFrozen,
98
+ }, { log });
77
99
  /**
78
100
  * .what = refuses the aws WIRE shape, and names the rename that fixes it
79
101
  * .why = `isApiGatewayResponse` rejects it too, but `withAssure` takes a name and no message,
@@ -83,16 +105,16 @@ const forApiGateway = (config, context) => {
83
105
  * ConstraintError would answer 400 and tell the caller THEY erred, which is false
84
106
  * (invariant.badrequesterror-not-lambda-error)
85
107
  */
86
- const keysOfWirePayload = typeof response === 'object' && response !== null
87
- ? (0, getAllWirePayloadKeysFound_1.getAllWirePayloadKeysFound)({ response })
108
+ const keysOfResponseOnwire = typeof response === 'object' && response !== null
109
+ ? (0, getAllResponseOnwireKeysFound_1.getAllResponseOnwireKeysFound)({ response })
88
110
  : [];
89
- if (keysOfWirePayload.length)
90
- helpful_errors_1.MalfunctionError.throw('handler returned the aws wire payload shape rather than an ApiGatewayResponse', {
91
- keysOfWirePayload,
111
+ if (keysOfResponseOnwire.length)
112
+ helpful_errors_1.MalfunctionError.throw('handler returned the aws ApiGatewayResponseOnwire shape rather than an ApiGatewayResponse', {
113
+ keysOfResponseOnwire,
92
114
  fix: 'rename `statusCode` to `status`, and return the body as a value rather than a JSON string',
93
115
  response,
94
116
  });
95
- // the throw above took every wire-payload response, so this closes the REST — a string, an
117
+ // the throw above took every response-wire shape, so this closes the REST — a string, an
96
118
  // array, a null. one names a fix for the likely mistake; this one covers the others
97
119
  isApiGatewayResponse_1.isApiGatewayResponse.assure(response);
98
120
  // validate the whole response envelope against the declared output schema
@@ -101,7 +123,7 @@ const forApiGateway = (config, context) => {
101
123
  schema: config.schema.output,
102
124
  });
103
125
  // the wire encode — status defaults here, before any middleware observes the response
104
- return (0, asApiGatewayResponsePayload_1.asApiGatewayResponsePayload)({ response: validatedResponse });
126
+ return (0, asApiGatewayResponseOnwire_1.asApiGatewayResponseOnwire)({ response: validatedResponse });
105
127
  };
106
128
  // 0. content-type coherence (after + onError) - drops Content-Type when the body is absent
107
129
  // 1. constraint error (onError) - a caller fault becomes a 400
@@ -113,49 +135,50 @@ const forApiGateway = (config, context) => {
113
135
  // 7. event normalization (before) - reconciles a v1/v2 request
114
136
  // 8. trail (before) - injects trail context
115
137
  // 9. introspection (before) - short-circuits an introspect request
116
- // 10. body validation (before) - validates event.body against schema.input
138
+ // 10. input validation (before) - validates { headers, payload } against schema.input
117
139
  //
118
- // ⚠️ ORDER IS LOAD-BEARING, ON TWO AXES — middy holds the hook phases in OPPOSITE orders, and
119
- // a break on either axis no-ops silently: no throw, no log, no type error. state your
120
- // entry's needs against BOTH before you place it.
140
+ // the order carries the load, on two axes — middy holds the hook phases in opposite orders, and
141
+ // a break on either axis no-ops silently: no throw, no log, no type error. state your entry's
142
+ // needs against both before you place it.
121
143
  //
122
- // ── `before` — FORWARD order ── an entry that READS what another `before` PRODUCES sits
123
- // at a HIGHER index. producers: 7 -> unified `request.event`; 8 -> `request.context.log`
124
- // + `isContempCaller`; 10 -> the validated `event.body`
144
+ // `before` — forward order. an entry that reads what another `before` produces sits at a
145
+ // higher index. producers: 7 -> unified `request.event`; 8 -> `request.context.log` +
146
+ // `isContempCaller`; 10 -> the validated `event.headers` + `event.payload`
125
147
  //
126
- // ── `after` / `onError` — REVERSE order (middy `unshift`s them) ── an entry whose
127
- // `onError` READS `request.response` sits at a LOWER index than the builders (1,2) that
128
- // SET it. entry 0 is last on both hooks, which is the only slot that can correct a
129
- // header the serializer already stamped
148
+ // `after` / `onError` — reverse order, since middy `unshift`s them. an entry whose `onError`
149
+ // reads `request.response` sits at a lower index than the builders (1,2) that set it.
150
+ // entry 0 is last on both hooks, the only slot that can correct a header the serializer
151
+ // already stamped
130
152
  //
131
- // the `onError` family that reads `request.response` — membership by CAUSE, never by guard
132
- // syntax (the vendors test `=== undefined`, the io logger tests truthiness):
133
- // ✅ 0 genContentTypeCoherenceMiddleware -> runs LAST, sees the response
134
- // ⛔ 3 genIoLoggerMiddleware -> runs EARLY, response undefined
135
- // ⛔ 5 @middy/http-cors -> so NO cors on a 4xx/5xx
136
- // ⛔ 6 @middy/http-security-headers -> so NO owasp on a 4xx/5xx
153
+ // the `onError` family that reads `request.response` — membership by cause, never by guard
154
+ // syntax (the vendors test `=== undefined`, the io logger tests truthiness):
155
+ // 0 genContentTypeCoherenceMiddleware -> runs last, sees the response
156
+ // 3 genIoLoggerMiddleware -> runs early, response undefined
157
+ // 5 @middy/http-cors -> so no cors on a 4xx/5xx
158
+ // 6 @middy/http-security-headers -> so no owasp on a 4xx/5xx
137
159
  //
138
- // the three ⛔ are ONE deferred fix (F32) — the reorder also moves the SUCCESS-path `after`
139
- // order for every handler. the `before` axis is violated too; see the note on entry 3.
160
+ // the three that no-op are one deferred fix — the reorder also moves the success-path `after`
161
+ // order for every handler. the `before` axis is violated too; see the note on entry 3.
162
+ // `.dream/v2026_09_22.fix.no-cors-or-owasp-headers-on-error-responses.md`
140
163
  const middlewares = [
141
164
  (0, genContentTypeCoherenceMiddleware_1.genContentTypeCoherenceMiddleware)(),
142
165
  /**
143
- * .note = both keep the invocation a SUCCESS — a caller fault must not emit a cloudwatch
166
+ * .note = both keep the invocation a success — a caller fault must not emit a cloudwatch
144
167
  * error (invariant.badrequesterror-not-lambda-error) — and the 500 body carries a
145
168
  * generic message plus the correlation id, never the error's own message
146
169
  *
147
- * .note = this family is ALWAYS-ANCIENT by construction, so the shared middleware's
170
+ * .note = this family is always-ancient by construction, so the shared middleware's
148
171
  * `isContempCaller` branch resolves one way and needs no guard: an http payload is
149
172
  * an api-gateway envelope, which `getIsWrappedPayload` cannot match, and where trail
150
173
  * never ran `asContextTrailed` defaults the flag to `false`
151
174
  */
152
175
  (0, genConstraintErrorMiddleware_1.genConstraintErrorMiddleware)({
153
- asOutputAfter: (body) => (0, asApiGatewayResponsePayloadJson_1.asApiGatewayResponsePayloadJson)({ status: 400, body }),
176
+ asOutputAfter: (payload) => (0, asApiGatewayResponseOnwireJson_1.asApiGatewayResponseOnwireJson)({ status: 400, payload }),
154
177
  }),
155
178
  (0, genInternalServiceErrorMiddleware_1.genInternalServiceErrorMiddleware)({
156
- asOutputAfter: ({ exid }) => (0, asApiGatewayResponsePayloadJson_1.asApiGatewayResponsePayloadJson)({
179
+ asOutputAfter: ({ exid }) => (0, asApiGatewayResponseOnwireJson_1.asApiGatewayResponseOnwireJson)({
157
180
  status: 500,
158
- body: {
181
+ payload: {
159
182
  errorMessage: 'internal server error',
160
183
  errorType: 'InternalServiceError',
161
184
  ...(exid ? { correlationId: exid } : {}),
@@ -163,9 +186,9 @@ const forApiGateway = (config, context) => {
163
186
  }),
164
187
  }),
165
188
  /**
166
- * ⚠️ .breaks the `before` axis, deliberately — this reads `request.context.log`, which
189
+ * .breaks the `before` axis, deliberately — this reads `request.context.log`, which
167
190
  * `genTrailMiddleware` (8) produces, so `handler.input` never logs. the record is on
168
- * `logTranslate`; the repair moves TRAIL to index 3, never this entry — trail declares
191
+ * `logTranslate`; the repair moves trail to index 3, never this entry — trail declares
169
192
  * only a `before`, so its move cannot disturb the `after`/`onError` order
170
193
  */
171
194
  (0, genIoLoggerMiddleware_1.genIoLoggerMiddleware)({ logTranslate: config.logTranslate }),
@@ -174,36 +197,39 @@ const forApiGateway = (config, context) => {
174
197
  defaultContentType: 'application/json',
175
198
  }),
176
199
  /**
177
- * ⚠️ .breaks the `onError` axis, deliberately — these two sit BELOW the error builders, so
200
+ * .breaks the `onError` axis, deliberately — these two sit below the error builders, so
178
201
  * their `onError` hooks run first, see no response, and no-op. that is limit 2 on
179
202
  * `CorsConfig`. the repair also moves their `after` hooks relative to the serializer,
180
- * so it changes every SUCCESS response's headers too
203
+ * so it changes every success response's headers too
181
204
  */
182
205
  ...(config.cors ? [(0, http_cors_1.default)(corsInputToCorsConfig(config.cors))] : []),
183
206
  (0, http_security_headers_1.default)({
184
207
  frameOptions: { action: 'DENY' },
185
208
  }),
186
- (0, genApiGatewayEventNormalizationMiddleware_1.genApiGatewayEventNormalizationMiddleware)({ parseBody: deserialize.body }),
209
+ (0, genApiGatewayRequestEventNormalizationMiddleware_1.genApiGatewayRequestEventNormalizationMiddleware)({
210
+ parsePayload: deserialize.payload,
211
+ }),
187
212
  (0, genTrailMiddleware_1.genTrailMiddleware)(),
188
213
  (0, genIntrospectionMiddleware_1.genIntrospectionMiddleware)({
189
214
  schema: config.schema,
190
215
  env: context?.env,
191
216
  /**
192
- * .what = this family keeps `inputAfter` at `event.body`, and owes a WIRE payload back
217
+ * .what = this family keeps `inputAfter` at `event.payload`, and owes an
218
+ * `ApiGatewayResponseOnwire` back
193
219
  * .why = `request.event` must stay http-shaped for `@middy/http-cors`, so the caller's
194
- * value rides at `event.body` rather than in the event's place. and the
195
- * short-circuit bypasses the serializer, so the body is stringified here
220
+ * value rides at `event.payload` rather than in the event's place. and the
221
+ * short-circuit bypasses the serializer, so the body is encoded here
196
222
  */
197
- asInputAfter: (request) => request.event?.body,
198
- asOutputAfter: (schema) => (0, asApiGatewayResponsePayloadJson_1.asApiGatewayResponsePayloadJson)({ status: 200, body: schema }),
223
+ asInputAfter: (request) => request.event?.payload,
224
+ asOutputAfter: (schema) => (0, asApiGatewayResponseOnwireJson_1.asApiGatewayResponseOnwireJson)({ status: 200, payload: schema }),
199
225
  }),
200
- (0, genZodBodyValidationMiddleware_1.genZodBodyValidationMiddleware)({ schema: config.schema.input }),
226
+ (0, genZodInputValidationMiddleware_1.genZodInputValidationMiddleware)({ schema: config.schema.input }),
201
227
  ];
202
228
  /**
203
229
  * .as = the chain translates both ends, and typescript cannot track a transform across a
204
230
  * middleware chain:
205
- * - input: ApiGatewayRequestPayload -> TInput (before logic)
206
- * - output: ApiGatewayResponsePayload<TBody> -> ApiGatewayResponsePayload (after)
231
+ * - input: ApiGatewayRequestEventOnwire -> TPayload (before logic)
232
+ * - output: ApiGatewayResponseOnwire<TBody> -> ApiGatewayResponseOnwire (after)
207
233
  * the second is the serializer's step — it encodes the body to bytes
208
234
  * .removal = drops if middy gains typed inference across `.use`; every shape it spans is
209
235
  * already named, so only the cast is owed
@@ -1 +1 @@
1
- {"version":3,"file":"genLambdaEndpoint.forApiGateway.js","sourceRoot":"","sources":["../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAgC;AAChC,iEAAwC;AACxC,+FAAqE;AACrE,yFAA+D;AAE/D,mDAAkD;AAQlD,4DAAyD;AACzD,6FAA0F;AAC1F,uGAAoG;AACpG,yFAAsF;AACtF,+EAA4E;AAC5E,yEAAsE;AACtE,yEAAsE;AAEtE,+EAA4E;AAC5E,uFAAoF;AACpF,yEAAiE;AACjE,6EAA0E;AAC1E,iEAA8D;AAC9D,sHAAmH;AACnH,sGAAmG;AACnG,gGAA6F;AAmJ7F,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AA8B,EAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;KAChE,CAAC;IAEF;;;;;;;;OAQG;IACH,OAAO,IAAA,cAAK,EACV,KAGuC,CACxC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACrB,CAAC,CAAC;AA3LW,QAAA,aAAa,iBA2LxB"}
1
+ {"version":3,"file":"genLambdaEndpoint.forApiGateway.js","sourceRoot":"","sources":["../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAgC;AAChC,iEAAwC;AACxC,+FAAqE;AACrE,yFAA+D;AAE/D,mDAAkD;AASlD,4DAAyD;AACzD,6FAA0F;AAC1F,uGAAoG;AACpG,yFAAsF;AACtF,+EAA4E;AAC5E,yEAAsE;AACtE,yEAAsE;AACtE,sDAAmD;AAOnD,uFAAwE;AACxE,6EAA0E;AAC1E,qFAAkF;AAClF,mFAAgF;AAChF,iEAA8D;AAC9D,oIAAiI;AACjI,sGAAmG;AACnG,kGAA+F;AA0L/F,8EAA8E;AAC9E,MAAM,qBAAqB,GAAG,CAAC,IAAgB,EAAE,EAAE;IACjD,OAAO;QACL;;;;;;;WAOG;QACH,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;QACvE,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,4BAA4B;QAErD;;;;;WAKG;KACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG;IAClB;QACE,KAAK,EAAE,qBAAqB;QAC5B,UAAU,EAAE,CAAC,EAAE,IAAI,EAAqB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,I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AAqB,EAAC,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;QAC5D,IAAA,kCAAsB,EAAC;YACrB,WAAW;YACX,kBAAkB,EAAE,kBAAkB;SACvC,CAAC;QACF;;;;;WAKG;QACH,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAQ,EAAC,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,IAAA,+BAAmB,EAAC;YAClB,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;SACjC,CAAC;QACF,IAAA,mGAAgD,EAAC;YAC/C,YAAY,EAAE,WAAW,CAAC,OAAO;SAClC,CAAC;QACF,IAAA,uCAAkB,GAAE;QACpB,IAAA,uDAA0B,EAAC;YACzB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,GAAG,EAAE,OAAO,EAAE,GAAG;YACjB;;;;;;eAMG;YACH,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO;YACjD,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CACxB,IAAA,+DAA8B,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;SACnE,CAAC;QACF,IAAA,iEAA+B,EAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;KACjE,CAAC;IAEF;;;;;;;;OAQG;IACH,OAAO,IAAA,cAAK,EACV,KAGsC,CACvC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACrB,CAAC,CAAC;AA5NW,QAAA,aAAa,iBA4NxB"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * .what = lists which aws wire-payload keys a handler's response carries
2
+ * .what = lists which aws response-wire keys a handler's response carries
3
3
  * .why = one detector, so the public type-check and the handler-side guard cannot drift. the
4
4
  * check needs a boolean; the guard needs the key NAMES to tell the author the fix
5
5
  */
6
- export declare const getAllWirePayloadKeysFound: (input: {
6
+ export declare const getAllResponseOnwireKeysFound: (input: {
7
7
  response: object;
8
8
  }) => string[];
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAllResponseOnwireKeysFound = void 0;
4
+ /**
5
+ * .what = the wire keys an author who knows aws's response shape writes from habit, every one
6
+ * of which the encode would drop without a word
7
+ *
8
+ * .note = two of these are severe, and both for one reason: the field's name changed, so a
9
+ * return that still uses the wire word is silently wrong rather than refused —
10
+ *
11
+ * statusCode -> status `status ?? 200` replaces a caller's 404 with a 200, and
12
+ * double-encodes the body they already stringified
13
+ * body -> payload the response emits empty and the author sees a bare 200
14
+ *
15
+ * the rest are deferred keys, quieter and equally silent
16
+ * .note = `body` is clamped by `[case15][t1]` — drop it from this record and that one test goes
17
+ * red (a 200 where a 500 is due) while its four siblings stay green
18
+ * (`rule.require.clamp-edge-cases`)
19
+ *
20
+ * .note = a `Record<K, true>` rather than a `string[]`, so the compiler holds it exhaustive: a
21
+ * list proves each entry is real and says not one word about an absent one, which is the
22
+ * drift that matters. drop a key and tsc raises TS2741
23
+ */
24
+ const IS_KEY_OF_RESPONSE_WIRE_UNREAD = {
25
+ statusCode: true,
26
+ body: true,
27
+ multiValueHeaders: true,
28
+ isBase64Encoded: true,
29
+ cookies: true,
30
+ };
31
+ /**
32
+ * .what = the same list, as keys
33
+ * .why = one source of truth, so the exhaustive map and the iterated list cannot drift apart
34
+ */
35
+ const KEYS_OF_RESPONSE_WIRE = Object.keys(IS_KEY_OF_RESPONSE_WIRE_UNREAD);
36
+ /**
37
+ * .what = lists which aws response-wire keys a handler's response carries
38
+ * .why = one detector, so the public type-check and the handler-side guard cannot drift. the
39
+ * check needs a boolean; the guard needs the key NAMES to tell the author the fix
40
+ */
41
+ const getAllResponseOnwireKeysFound = (input) => KEYS_OF_RESPONSE_WIRE.filter((key) => key in input.response);
42
+ exports.getAllResponseOnwireKeysFound = getAllResponseOnwireKeysFound;
43
+ //# sourceMappingURL=getAllResponseOnwireKeysFound.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllResponseOnwireKeysFound.js","sourceRoot":"","sources":["../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllResponseOnwireKeysFound.ts"],"names":[],"mappings":";;;AAqBA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,8BAA8B,GAClC;IACE,UAAU,EAAE,IAAI;IAChB,IAAI,EAAE,IAAI;IACV,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,IAAI;IACrB,OAAO,EAAE,IAAI;CACd,CAAC;AAEJ;;;GAGG;AACH,MAAM,qBAAqB,GAAa,MAAM,CAAC,IAAI,CACjD,8BAA8B,CAC/B,CAAC;AAEF;;;;GAIG;AACI,MAAM,6BAA6B,GAAG,CAAC,KAE7C,EAAY,EAAE,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;AAFhE,QAAA,6BAA6B,iCAEmC"}
@@ -3,4 +3,4 @@ import type { APIGatewayProxyEvent } from 'aws-lambda';
3
3
  * .what = type guard for API Gateway v1 (REST API) events
4
4
  * .why = enables detection of event format for middleware
5
5
  */
6
- export declare const getIsV1ApiGatewayEvent: (event: unknown) => event is APIGatewayProxyEvent;
6
+ export declare const getIsV1ApiGatewayRequestEvent: (event: unknown) => event is APIGatewayProxyEvent;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIsV1ApiGatewayEvent = void 0;
3
+ exports.getIsV1ApiGatewayRequestEvent = void 0;
4
4
  /**
5
5
  * .what = type guard for API Gateway v1 (REST API) events
6
6
  * .why = enables detection of event format for middleware
7
7
  */
8
- const getIsV1ApiGatewayEvent = (event) => {
8
+ const getIsV1ApiGatewayRequestEvent = (event) => {
9
9
  if (!event || typeof event !== 'object')
10
10
  return false;
11
11
  const obj = event;
12
12
  // v1 events have httpMethod (v2 uses requestContext.http.method)
13
13
  return typeof obj.httpMethod === 'string';
14
14
  };
15
- exports.getIsV1ApiGatewayEvent = getIsV1ApiGatewayEvent;
16
- //# sourceMappingURL=getIsV1ApiGatewayEvent.js.map
15
+ exports.getIsV1ApiGatewayRequestEvent = getIsV1ApiGatewayRequestEvent;
16
+ //# sourceMappingURL=getIsV1ApiGatewayRequestEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getIsV1ApiGatewayRequestEvent.js","sourceRoot":"","sources":["../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV1ApiGatewayRequestEvent.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAC3C,KAAc,EACiB,EAAE;IACjC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,GAAG,GAAG,KAAgC,CAAC;IAE7C,iEAAiE;IACjE,OAAO,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,CAAC;AAC5C,CAAC,CAAC;AARW,QAAA,6BAA6B,iCAQxC"}
@@ -3,4 +3,4 @@ import type { APIGatewayProxyEventV2 } from 'aws-lambda';
3
3
  * .what = type guard for api gateway v2 (http api) events
4
4
  * .why = enables detection of event format for middleware
5
5
  */
6
- export declare const getIsV2ApiGatewayEvent: (event: unknown) => event is APIGatewayProxyEventV2;
6
+ export declare const getIsV2ApiGatewayRequestEvent: (event: unknown) => event is APIGatewayProxyEventV2;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIsV2ApiGatewayEvent = void 0;
3
+ exports.getIsV2ApiGatewayRequestEvent = void 0;
4
4
  /**
5
5
  * .what = type guard for api gateway v2 (http api) events
6
6
  * .why = enables detection of event format for middleware
7
7
  */
8
- const getIsV2ApiGatewayEvent = (event) => {
8
+ const getIsV2ApiGatewayRequestEvent = (event) => {
9
9
  if (!event || typeof event !== 'object')
10
10
  return false;
11
11
  const obj = event;
12
12
  // v2 events have version field set to '2.0'
13
13
  return obj.version === '2.0';
14
14
  };
15
- exports.getIsV2ApiGatewayEvent = getIsV2ApiGatewayEvent;
16
- //# sourceMappingURL=getIsV2ApiGatewayEvent.js.map
15
+ exports.getIsV2ApiGatewayRequestEvent = getIsV2ApiGatewayRequestEvent;
16
+ //# sourceMappingURL=getIsV2ApiGatewayRequestEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getIsV2ApiGatewayRequestEvent.js","sourceRoot":"","sources":["../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayRequestEvent.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAC3C,KAAc,EACmB,EAAE;IACnC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,GAAG,GAAG,KAAgC,CAAC;IAE7C,4CAA4C;IAC5C,OAAO,GAAG,CAAC,OAAO,KAAK,KAAK,CAAC;AAC/B,CAAC,CAAC;AARW,QAAA,6BAA6B,iCAQxC"}
@@ -1,7 +1,7 @@
1
1
  import type { ApiGatewayResponse } from '../../../domain.objects/ApiGatewayResponse';
2
2
  /**
3
3
  * .what = checks that a value is an ApiGatewayResponse — an object with at least one of
4
- * status, headers, or body, and none of the aws wire-payload keys
4
+ * status, headers, or payload, and none of the aws response-wire keys
5
5
  * .why = the type refuses `{}` at compile time, but a handler's return crosses an
6
6
  * `unknown` boundary at run time (a js caller, an `any`, a cast). this is the
7
7
  * runtime backstop for the invariants the type holds
@@ -10,10 +10,13 @@ import type { ApiGatewayResponse } from '../../../domain.objects/ApiGatewayRespo
10
10
  * `schema.output`'s job; this exists so an empty, non-object, or wire-shaped return
11
11
  * fails loud HERE rather than reach middy's `statusCode ??= 500` and emit a silent 500
12
12
  *
13
- * .note = the foreign-key half closes a MIGRATION hazard the cardinality half could not see.
14
- * `{ statusCode: 404, body: JSON.stringify(x) }` — the aws-native shape, and the one
15
- * the wish's own `.ground` evidence used — satisfies `'body' in input`, so it used to
16
- * pass. it then lost its 404 to `status ?? 200` and had its body encoded twice
13
+ * .note = the foreign-key half closes a hazard the cardinality half cannot see.
14
+ * `{ statusCode: 404, body: JSON.stringify(x) }` — the aws-native shape — satisfies the
15
+ * cardinality half, then loses its 404 to `status ?? 200` and has its body encoded twice
17
16
  * (rule.forbid.failhide)
17
+ *
18
+ * .note = `body` is a foreign key, since the envelope's body slot is `payload`, and
19
+ * `asApiGatewayResponseOnwire` reads `'payload' in response` — so it would drop a `body`
20
+ * with no word. the foreign-key half turns that silent drop into a throw that names the fix
18
21
  */
19
22
  export declare const isApiGatewayResponse: import("type-fns").AssessWithAssure<unknown, ApiGatewayResponse<unknown>>;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isApiGatewayResponse = void 0;
4
4
  const type_fns_1 = require("type-fns");
5
- const getAllWirePayloadKeysFound_1 = require("./getAllWirePayloadKeysFound");
5
+ const getAllResponseOnwireKeysFound_1 = require("./getAllResponseOnwireKeysFound");
6
6
  /**
7
7
  * .what = checks that a value is an ApiGatewayResponse — an object with at least one of
8
- * status, headers, or body, and none of the aws wire-payload keys
8
+ * status, headers, or payload, and none of the aws response-wire keys
9
9
  * .why = the type refuses `{}` at compile time, but a handler's return crosses an
10
10
  * `unknown` boundary at run time (a js caller, an `any`, a cast). this is the
11
11
  * runtime backstop for the invariants the type holds
@@ -14,11 +14,14 @@ const getAllWirePayloadKeysFound_1 = require("./getAllWirePayloadKeysFound");
14
14
  * `schema.output`'s job; this exists so an empty, non-object, or wire-shaped return
15
15
  * fails loud HERE rather than reach middy's `statusCode ??= 500` and emit a silent 500
16
16
  *
17
- * .note = the foreign-key half closes a MIGRATION hazard the cardinality half could not see.
18
- * `{ statusCode: 404, body: JSON.stringify(x) }` — the aws-native shape, and the one
19
- * the wish's own `.ground` evidence used — satisfies `'body' in input`, so it used to
20
- * pass. it then lost its 404 to `status ?? 200` and had its body encoded twice
17
+ * .note = the foreign-key half closes a hazard the cardinality half cannot see.
18
+ * `{ statusCode: 404, body: JSON.stringify(x) }` — the aws-native shape — satisfies the
19
+ * cardinality half, then loses its 404 to `status ?? 200` and has its body encoded twice
21
20
  * (rule.forbid.failhide)
21
+ *
22
+ * .note = `body` is a foreign key, since the envelope's body slot is `payload`, and
23
+ * `asApiGatewayResponseOnwire` reads `'payload' in response` — so it would drop a `body`
24
+ * with no word. the foreign-key half turns that silent drop into a throw that names the fix
22
25
  */
23
26
  exports.isApiGatewayResponse = (0, type_fns_1.withAssure)((input) => {
24
27
  // reject a non-object; a response is always an envelope
@@ -28,9 +31,9 @@ exports.isApiGatewayResponse = (0, type_fns_1.withAssure)((input) => {
28
31
  if (Array.isArray(input))
29
32
  return false;
30
33
  // reject the aws wire shape; no step here reads its keys, so they would vanish
31
- if ((0, getAllWirePayloadKeysFound_1.getAllWirePayloadKeysFound)({ response: input }).length)
34
+ if ((0, getAllResponseOnwireKeysFound_1.getAllResponseOnwireKeysFound)({ response: input }).length)
32
35
  return false;
33
36
  // require at least one of the three fields — this is what PickAny encodes
34
- return 'status' in input || 'headers' in input || 'body' in input;
37
+ return 'status' in input || 'headers' in input || 'payload' in input;
35
38
  }, { name: 'isApiGatewayResponse' });
36
39
  //# sourceMappingURL=isApiGatewayResponse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isApiGatewayResponse.js","sourceRoot":"","sources":["../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAGtC,6EAA0E;AAE1E;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAU,EAC5C,CAAC,KAAc,EAAwC,EAAE;IACvD,wDAAwD;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAE9D,2DAA2D;IAC3D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEvC,+EAA+E;IAC/E,IAAI,IAAA,uDAA0B,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAEzE,0EAA0E;IAC1E,OAAO,QAAQ,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC;AACpE,CAAC,EACD,EAAE,IAAI,EAAE,sBAAsB,EAAE,CACjC,CAAC"}
1
+ {"version":3,"file":"isApiGatewayResponse.js","sourceRoot":"","sources":["../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAGtC,mFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAU,EAC5C,CAAC,KAAc,EAAwC,EAAE;IACvD,wDAAwD;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAE9D,2DAA2D;IAC3D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEvC,+EAA+E;IAC/E,IAAI,IAAA,6DAA6B,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAE5E,0EAA0E;IAC1E,OAAO,QAAQ,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,CAAC;AACvE,CAAC,EACD,EAAE,IAAI,EAAE,sBAAsB,EAAE,CACjC,CAAC"}
@@ -4,12 +4,12 @@ import type middy from '@middy/core';
4
4
  * .why = the api-gateway chain must read the same whichever version the trigger delivers, so
5
5
  * this runs first and every step after it reads one shape
6
6
  *
7
- * .note = this DELEGATES to `asUnifiedApiGatewayEvent` rather than hold its own copy of the
7
+ * .note = this DELEGATES to `asApiGatewayRequestEventUnified` rather than hold its own copy of the
8
8
  * reconcile logic. one guarantee, one implementation, two entry points — a second
9
9
  * copy would be the parallel code path (rule.forbid.parallel-codepaths)
10
10
  */
11
- export declare const genApiGatewayEventNormalizationMiddleware: (input: {
12
- parseBody: boolean;
11
+ export declare const genApiGatewayRequestEventNormalizationMiddleware: (input: {
12
+ parsePayload: boolean;
13
13
  }) => {
14
14
  before: middy.MiddlewareFn<any, any>;
15
15
  };
@@ -1,31 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genApiGatewayEventNormalizationMiddleware = void 0;
4
- const asUnifiedApiGatewayEvent_1 = require("../asUnifiedApiGatewayEvent");
3
+ exports.genApiGatewayRequestEventNormalizationMiddleware = void 0;
4
+ const asApiGatewayRequestEventUnified_1 = require("../asApiGatewayRequestEventUnified");
5
5
  /**
6
6
  * .what = replaces the event with the v1/v2-reconciled shape
7
7
  * .why = the api-gateway chain must read the same whichever version the trigger delivers, so
8
8
  * this runs first and every step after it reads one shape
9
9
  *
10
- * .note = this DELEGATES to `asUnifiedApiGatewayEvent` rather than hold its own copy of the
10
+ * .note = this DELEGATES to `asApiGatewayRequestEventUnified` rather than hold its own copy of the
11
11
  * reconcile logic. one guarantee, one implementation, two entry points — a second
12
12
  * copy would be the parallel code path (rule.forbid.parallel-codepaths)
13
13
  */
14
- const genApiGatewayEventNormalizationMiddleware = (input) => {
14
+ const genApiGatewayRequestEventNormalizationMiddleware = (input) => {
15
15
  const before = async (request) => {
16
16
  /**
17
17
  * .as = both casts exist because this middleware is typed `<any, any>`, so `request.event`
18
18
  * is `any` on the way in and its declared type on the way out. the transform is
19
- * real — `ApiGatewayRequestPayload` becomes `UnifiedApiGatewayEvent` — and middy
19
+ * real — `ApiGatewayRequestEventOnwire` becomes `ApiGatewayRequestEventUnified` — and middy
20
20
  * cannot track a shape change across a `before` hook
21
21
  * .removal = drops when middy gains typed inference across `.use`, at which point the
22
22
  * middleware's own two type parameters name these shapes and no cast is owed
23
23
  *
24
24
  * .note = DELIBERATE MUTATION — `request` is middy's only channel to hand a value onward
25
25
  */
26
- request.event = (0, asUnifiedApiGatewayEvent_1.asUnifiedApiGatewayEvent)({ payload: request.event }, { deserialize: { body: input.parseBody } });
26
+ request.event = (0, asApiGatewayRequestEventUnified_1.asApiGatewayRequestEventUnified)({ wire: request.event }, { deserialize: { payload: input.parsePayload } });
27
27
  };
28
28
  return { before };
29
29
  };
30
- exports.genApiGatewayEventNormalizationMiddleware = genApiGatewayEventNormalizationMiddleware;
31
- //# sourceMappingURL=genApiGatewayEventNormalizationMiddleware.js.map
30
+ exports.genApiGatewayRequestEventNormalizationMiddleware = genApiGatewayRequestEventNormalizationMiddleware;
31
+ //# sourceMappingURL=genApiGatewayRequestEventNormalizationMiddleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genApiGatewayRequestEventNormalizationMiddleware.js","sourceRoot":"","sources":["../../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayRequestEventNormalizationMiddleware.ts"],"names":[],"mappings":";;;AAGA,wFAAqF;AAErF;;;;;;;;GAQG;AACI,MAAM,gDAAgD,GAAG,CAAC,KAEhE,EAEC,EAAE;IACF,MAAM,MAAM,GAAiC,KAAK,EAAE,OAAO,EAAE,EAAE;QAC7D;;;;;;;;;WASG;QACH,OAAO,CAAC,KAAK,GAAG,IAAA,iEAA+B,EAC7C,EAAE,IAAI,EAAE,OAAO,CAAC,KAAqC,EAAE,EACvD,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,YAAY,EAAE,EAAE,CACd,CAAC;IACvC,CAAC,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC;AAvBW,QAAA,gDAAgD,oDAuB3D"}
@@ -5,10 +5,10 @@ import type middy from '@middy/core';
5
5
  * the defect this whole affordance exists to retire. a 204 and a 308 each reach the wire
6
6
  * body-less and would otherwise claim `application/json`
7
7
  *
8
- * ⚠️ .note = MUST be registered FIRST in the chain array. middy `unshift`s `after` and `onError`,
9
- * so index 0 runs LAST on both — the only position later than the serializer that stamps
10
- * the header, and later than the error builders that set `request.response`. anywhere
11
- * else, the `onError` hook meets an absent response and returns early
8
+ * .note = must be registered first in the chain array. middy `unshift`s `after` and `onError`,
9
+ * so index 0 runs last on both — the only position later than the serializer that
10
+ * stamps the header, and later than the error builders that set `request.response`.
11
+ * anywhere else, the `onError` hook meets an absent response and returns early
12
12
  *
13
13
  * .note = the same function serves both hooks, so one implementation holds the guarantee on
14
14
  * either path. no error response is body-less today, so `onError` finds no work yet; it
@@ -7,10 +7,10 @@ exports.genContentTypeCoherenceMiddleware = void 0;
7
7
  * the defect this whole affordance exists to retire. a 204 and a 308 each reach the wire
8
8
  * body-less and would otherwise claim `application/json`
9
9
  *
10
- * ⚠️ .note = MUST be registered FIRST in the chain array. middy `unshift`s `after` and `onError`,
11
- * so index 0 runs LAST on both — the only position later than the serializer that stamps
12
- * the header, and later than the error builders that set `request.response`. anywhere
13
- * else, the `onError` hook meets an absent response and returns early
10
+ * .note = must be registered first in the chain array. middy `unshift`s `after` and `onError`,
11
+ * so index 0 runs last on both — the only position later than the serializer that
12
+ * stamps the header, and later than the error builders that set `request.response`.
13
+ * anywhere else, the `onError` hook meets an absent response and returns early
14
14
  *
15
15
  * .note = the same function serves both hooks, so one implementation holds the guarantee on
16
16
  * either path. no error response is body-less today, so `onError` finds no work yet; it
@@ -29,7 +29,7 @@ const genContentTypeCoherenceMiddleware = () => {
29
29
  * declares the shape this chain always puts there — `httpSecurityHeaders`, `httpCors`,
30
30
  * and the error builders each write a flat string map
31
31
  * .removal = drops when middy gains typed response inference, at which point
32
- * `ApiGatewayResponsePayload['headers']` types this member directly
32
+ * `ApiGatewayResponseOnwire['headers']` types this member directly
33
33
  */
34
34
  const headers = request.response.headers;
35
35
  if (!headers)