sdk-aws-lambda 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/domain.objects/ApiGatewayRequestEventOnwire.d.ts +18 -0
- package/dist/domain.objects/ApiGatewayRequestEventOnwire.js +3 -0
- package/dist/domain.objects/ApiGatewayRequestEventOnwire.js.map +1 -0
- package/dist/domain.objects/ApiGatewayResponse.d.ts +17 -10
- package/dist/domain.objects/{ApiGatewayResponsePayload.d.ts → ApiGatewayResponseOnwire.d.ts} +8 -4
- package/dist/domain.objects/{ApiGatewayRequestPayload.js → ApiGatewayResponseOnwire.js} +1 -1
- package/dist/domain.objects/ApiGatewayResponseOnwire.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/InvokeInputSuperset.d.ts +125 -0
- package/dist/domain.operations/genLambdaEndpoint/{genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js → InvokeInputSuperset.js} +1 -1
- package/dist/domain.operations/genLambdaEndpoint/InvokeInputSuperset.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/TranslateLog.d.ts +0 -17
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.d.ts +27 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified.d.ts +100 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified.js +3 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.d.ts +34 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.js +141 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayRequestEventUnified.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.d.ts +22 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.js +27 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwire.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{asApiGatewayResponsePayloadJson.d.ts → asApiGatewayResponseOnwireJson.d.ts} +11 -11
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{asApiGatewayResponsePayloadJson.js → asApiGatewayResponseOnwireJson.js} +12 -12
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseOnwireJson.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.d.ts +15 -13
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js +13 -11
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.d.ts +35 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.js +44 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asHeaderKeysLowercased.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.d.ts +93 -56
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js +88 -62
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getAllWirePayloadKeysFound.d.ts → getAllResponseOnwireKeysFound.d.ts} +2 -2
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllResponseOnwireKeysFound.js +43 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllResponseOnwireKeysFound.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV1ApiGatewayEvent.d.ts → getIsV1ApiGatewayRequestEvent.d.ts} +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV1ApiGatewayEvent.js → getIsV1ApiGatewayRequestEvent.js} +4 -4
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV1ApiGatewayRequestEvent.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV2ApiGatewayEvent.d.ts → getIsV2ApiGatewayRequestEvent.d.ts} +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/{getIsV2ApiGatewayEvent.js → getIsV2ApiGatewayRequestEvent.js} +4 -4
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayRequestEvent.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.d.ts +8 -5
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js +11 -8
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/{genApiGatewayEventNormalizationMiddleware.d.ts → genApiGatewayRequestEventNormalizationMiddleware.d.ts} +3 -3
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/{genApiGatewayEventNormalizationMiddleware.js → genApiGatewayRequestEventNormalizationMiddleware.js} +8 -8
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayRequestEventNormalizationMiddleware.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.d.ts +4 -4
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.js +5 -5
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.d.ts +36 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.js +113 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/{genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.d.ts → genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.d.ts} +50 -14
- package/dist/domain.operations/genLambdaEndpoint/{genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js → genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.js} +31 -16
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.d.ts +18 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.js +29 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.d.ts +23 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.js +38 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.d.ts +123 -0
- package/dist/{domain.objects/ApiGatewayResponsePayload.js → domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.js} +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.d.ts +23 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.js +33 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsEventDecoded.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.d.ts +30 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.js +38 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsHeadersOnwire.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.d.ts +30 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.js +86 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/asSqsRecordDecoded.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.d.ts +26 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.js +32 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.d.ts +82 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.js +108 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.d.ts +121 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.js +97 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.d.ts +52 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.js +68 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genSqsEndpointMiddlewares.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.d.ts +21 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.js +36 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/getIsSqsEvent.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.d.ts +46 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.js +79 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/setSqsRecordValidated.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.js +31 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.d.ts +8 -4
- package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.d.ts +10 -4
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.d.ts +12 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.js +23 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionInput.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js +17 -6
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.d.ts +16 -18
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js +16 -18
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.d.ts +5 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js +5 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.d.ts +14 -14
- package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js +15 -15
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.d.ts +5 -8
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.js +5 -8
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedInput.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.d.ts +9 -27
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.js +9 -27
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidatedOutput.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.d.ts +14 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js +48 -16
- package/dist/domain.operations/genLambdaEndpoint/middleware/getValidationError.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.d.ts +78 -0
- package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.js +103 -0
- package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.js.map +1 -0
- package/dist/domain.operations/genServiceSdk/gen.file/banner.d.ts +2 -3
- package/dist/domain.operations/genServiceSdk/gen.file/banner.js +2 -3
- package/dist/domain.operations/genServiceSdk/gen.file/banner.js.map +1 -1
- package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.d.ts +7 -2
- package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js +7 -2
- package/dist/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.js.map +1 -1
- package/dist/index.d.ts +38 -18
- package/dist/index.js +20 -14
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/readme.md +164 -93
- package/dist/domain.objects/ApiGatewayRequestPayload.d.ts +0 -12
- package/dist/domain.objects/ApiGatewayRequestPayload.js.map +0 -1
- package/dist/domain.objects/ApiGatewayResponsePayload.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.d.ts +0 -36
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.d.ts +0 -19
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js +0 -24
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayloadJson.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.d.ts +0 -27
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js +0 -118
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js +0 -34
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV1ApiGatewayEvent.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getIsV2ApiGatewayEvent.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.d.ts +0 -27
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js +0 -54
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.d.ts +0 -20
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js +0 -31
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js.map +0 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.d.ts +0 -5
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.js +0 -16
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.isIntrospectionPayload.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type middy from '@middy/core';
|
|
2
|
+
import type { ZodSchema } from 'zod';
|
|
3
|
+
import type { ApiGatewayHeadersDeclared } from '../ApiGatewayRequestEventUnified';
|
|
4
|
+
/**
|
|
5
|
+
* .what = validates the pair a caller may constrain — `{ headers?, payload }` — against
|
|
6
|
+
* `schema.input`, then writes the validated values back into the envelope
|
|
7
|
+
* .why = `headers` and `payload` are projections of the envelope's own slots, so the handler's
|
|
8
|
+
* bag and `event.headers` / `event.payload` are one object each. that holds only while
|
|
9
|
+
* this step replaces the envelope's values rather than parse beside them — a side bag
|
|
10
|
+
* would leave the envelope stale, silently (`domain.terms/headers.md`)
|
|
11
|
+
*
|
|
12
|
+
* .note = the pair, never the whole event: `request.event` must stay http-shaped through the
|
|
13
|
+
* chain. `@middy/http-cors` reads `request.event.headers` and derives the http method
|
|
14
|
+
* from `request.event` in its `after` hook (`@middy/http-cors/index.js:38,83,106`), so
|
|
15
|
+
* the caller's value cannot take the event's place
|
|
16
|
+
*
|
|
17
|
+
* .note = the constraint is sharper than "http-shaped", and the precise form is what any future
|
|
18
|
+
* input translate must honor. cors picks its method extractor by
|
|
19
|
+
* `request.event.version ?? '1.0'` (`index.js:38,106`), and
|
|
20
|
+
* `ApiGatewayRequestEventUnified` declares no `version` — so cors always falls to its v1
|
|
21
|
+
* extractor, `(event) => event.httpMethod`. that works only because the unified shape
|
|
22
|
+
* carries `httpMethod` and `headers` at its top level under v1's own names
|
|
23
|
+
* .note = `httpMethod` is a compat key rather than this shape's word — the shape names the
|
|
24
|
+
* method `method`, and `httpMethod` rides beside it solely because cors reads that name
|
|
25
|
+
* verbatim. it is absent from the interface and present on the object
|
|
26
|
+
* (`asApiGatewayRequestEventUnified.ts`), so a reader who greps the interface will not
|
|
27
|
+
* find it
|
|
28
|
+
*/
|
|
29
|
+
export declare const genZodInputValidationMiddleware: <THeaders extends ApiGatewayHeadersDeclared, TPayload>(input: {
|
|
30
|
+
schema: ZodSchema<{
|
|
31
|
+
headers?: THeaders;
|
|
32
|
+
payload: TPayload;
|
|
33
|
+
}>;
|
|
34
|
+
}) => {
|
|
35
|
+
before: middy.MiddlewareFn<any, any>;
|
|
36
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genZodInputValidationMiddleware = void 0;
|
|
4
|
+
const getValidatedInput_1 = require("../../middleware/getValidatedInput");
|
|
5
|
+
/**
|
|
6
|
+
* .what = validates the pair a caller may constrain — `{ headers?, payload }` — against
|
|
7
|
+
* `schema.input`, then writes the validated values back into the envelope
|
|
8
|
+
* .why = `headers` and `payload` are projections of the envelope's own slots, so the handler's
|
|
9
|
+
* bag and `event.headers` / `event.payload` are one object each. that holds only while
|
|
10
|
+
* this step replaces the envelope's values rather than parse beside them — a side bag
|
|
11
|
+
* would leave the envelope stale, silently (`domain.terms/headers.md`)
|
|
12
|
+
*
|
|
13
|
+
* .note = the pair, never the whole event: `request.event` must stay http-shaped through the
|
|
14
|
+
* chain. `@middy/http-cors` reads `request.event.headers` and derives the http method
|
|
15
|
+
* from `request.event` in its `after` hook (`@middy/http-cors/index.js:38,83,106`), so
|
|
16
|
+
* the caller's value cannot take the event's place
|
|
17
|
+
*
|
|
18
|
+
* .note = the constraint is sharper than "http-shaped", and the precise form is what any future
|
|
19
|
+
* input translate must honor. cors picks its method extractor by
|
|
20
|
+
* `request.event.version ?? '1.0'` (`index.js:38,106`), and
|
|
21
|
+
* `ApiGatewayRequestEventUnified` declares no `version` — so cors always falls to its v1
|
|
22
|
+
* extractor, `(event) => event.httpMethod`. that works only because the unified shape
|
|
23
|
+
* carries `httpMethod` and `headers` at its top level under v1's own names
|
|
24
|
+
* .note = `httpMethod` is a compat key rather than this shape's word — the shape names the
|
|
25
|
+
* method `method`, and `httpMethod` rides beside it solely because cors reads that name
|
|
26
|
+
* verbatim. it is absent from the interface and present on the object
|
|
27
|
+
* (`asApiGatewayRequestEventUnified.ts`), so a reader who greps the interface will not
|
|
28
|
+
* find it
|
|
29
|
+
*/
|
|
30
|
+
const genZodInputValidationMiddleware = (input) => {
|
|
31
|
+
const before = async (request) => {
|
|
32
|
+
/**
|
|
33
|
+
* .as = this middleware is typed `<any, any>`, so middy hands `request.event` over as
|
|
34
|
+
* `any`. the value IS a `ApiGatewayRequestEventUnified` by this point — the chain registers
|
|
35
|
+
* `genApiGatewayRequestEventNormalizationMiddleware` ahead of this one, and that is the
|
|
36
|
+
* middleware that writes the reconciled shape into the slot
|
|
37
|
+
* .removal = drops when middy gains typed inference across `.use`, at which point this
|
|
38
|
+
* middleware's own type parameters name the slot's shape and no cast is owed
|
|
39
|
+
*
|
|
40
|
+
* .note = a cast to this slot owes this `.as` / `.removal` pair at both sites — here, and at
|
|
41
|
+
* `asApiGatewayRequestEventUnified`'s read one file over. a convention applied to
|
|
42
|
+
* one of two sites is a class left open (rule.require.sweep-the-defect-class)
|
|
43
|
+
* .why not a shared reader = the two sites read the slot at different pipeline points, so
|
|
44
|
+
* they cast to different types — `ApiGatewayRequestEventOnwire` there, the
|
|
45
|
+
* reconciled shape here. a reader over two types at two points buys a type
|
|
46
|
+
* parameter and hides no complexity (rule.prefer.wet-over-dry)
|
|
47
|
+
*/
|
|
48
|
+
const event = request.event;
|
|
49
|
+
/**
|
|
50
|
+
* the two slots a caller may constrain, read from the envelope the reconcile produced
|
|
51
|
+
*
|
|
52
|
+
* .note = `headers` is the WHOLE WIRE BAG, never the author's declared subset — and that
|
|
53
|
+
* asymmetry is the one footgun this design carries. the readme's phrase, "your schema
|
|
54
|
+
* governs the keys it declares", is true of the write-back below and false of this
|
|
55
|
+
* line. so a `.strict()` (or `z.strictObject`) header schema refuses every real
|
|
56
|
+
* request: api gateway always injects `host`, `x-forwarded-for`, `x-amzn-trace-id`,
|
|
57
|
+
* and cloudfront's own keys. measured — a strict bag yields `unrecognized_keys` on
|
|
58
|
+
* path `headers`, where the same schema in zod's default (strip) mode parses clean
|
|
59
|
+
*
|
|
60
|
+
* .why not a subset parse, which would make `.strict()` inert = the sdk cannot know which
|
|
61
|
+
* keys a schema declares without a reach into zod's internals, and that read fails
|
|
62
|
+
* open on a union, an effect, or a refinement. so the whole bag is what it can
|
|
63
|
+
* honestly hand over
|
|
64
|
+
* .why the remedy sits in `getValidationError` = the failure is already loud and total, so
|
|
65
|
+
* what it lacks is the cure rather than the symptom
|
|
66
|
+
* (`rule.require.errors-name-the-fix`). clamped by `[case5]` / `[case6]` there — the
|
|
67
|
+
* second is the positive control, since `.strict()` on `payload` is correct and must
|
|
68
|
+
* not draw the hint
|
|
69
|
+
*/
|
|
70
|
+
const inputAfter = (0, getValidatedInput_1.getValidatedInput)({
|
|
71
|
+
schema: input.schema,
|
|
72
|
+
value: { headers: event.headers, payload: event.payload },
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* .note = deliberate mutation — `request` is middy's only channel to hand a value onward,
|
|
76
|
+
* and `event` is an alias of `request.event`, so these write through to the chain
|
|
77
|
+
* .note = a sweep for this class must match the alias as well as the receiver
|
|
78
|
+
* (`^\s*(event|response|payload)\.\w+\s*=`); a grep anchored on `request.` alone
|
|
79
|
+
* misses these two lines
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* .what = headers merge. the author's schema governs the keys it declares; every other wire
|
|
83
|
+
* key survives untouched
|
|
84
|
+
* .why = zod strips unknown keys, so a schema like `headers: z.object({ authorization })`
|
|
85
|
+
* yields a bag with no `origin` — and `@middy/http-cors` reads `origin` out of this
|
|
86
|
+
* very slot in its `after` hook. a wholesale replace does not merely starve cors, it
|
|
87
|
+
* makes cors emit a wrong answer: with `origins: [a, b]` an absent origin returns
|
|
88
|
+
* `options.origins[0]` unconditionally (`@middy/http-cors/index.js:2-14`), so a caller
|
|
89
|
+
* from `b` receives `Access-Control-Allow-Origin: a` and the browser refuses a
|
|
90
|
+
* response this sdk allowlisted
|
|
91
|
+
* .why a merge and not a replace = the axis is who else reads the slot
|
|
92
|
+
* (`rule.require.read-the-slot-a-dependency-reads`). cors reads `origin`
|
|
93
|
+
* (`index.js:84`) and `@middy/http-response-serializer` reads `accept`
|
|
94
|
+
* (`index.js:25`), so the wire bag is not the author's to delete from. the body has no
|
|
95
|
+
* such reader, which is why its rule below differs
|
|
96
|
+
* .note = the merge also absorbs the absent key: an author who declares no `headers` gets
|
|
97
|
+
* `result.data.headers === undefined`, and a spread of `undefined` is a no-op. so one
|
|
98
|
+
* rule serves both cases, and no branch is owed
|
|
99
|
+
*/
|
|
100
|
+
event.headers = { ...event.headers, ...inputAfter.headers };
|
|
101
|
+
/**
|
|
102
|
+
* .what = payload replaces. the validated value takes the slot outright
|
|
103
|
+
* .why = the body is wholly the handler's — no middleware and no vendor reads it — so the
|
|
104
|
+
* schema's output is the only value that belongs here. it is also what lets
|
|
105
|
+
* `event.payload` carry the validated body, so the `invoke` hand-off owes no `as`-cast
|
|
106
|
+
* (`domain.terms/payload.md`)
|
|
107
|
+
*/
|
|
108
|
+
event.payload = inputAfter.payload;
|
|
109
|
+
};
|
|
110
|
+
return { before };
|
|
111
|
+
};
|
|
112
|
+
exports.genZodInputValidationMiddleware = genZodInputValidationMiddleware;
|
|
113
|
+
//# sourceMappingURL=genZodInputValidationMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genZodInputValidationMiddleware.js","sourceRoot":"","sources":["../../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware.ts"],"names":[],"mappings":";;;AAGA,0EAAuE;AAMvE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,MAAM,+BAA+B,GAAG,CAe7C,KAED,EAEC,EAAE;IACF,MAAM,MAAM,GAAiC,KAAK,EAAE,OAAO,EAAE,EAAE;QAC7D;;;;;;;;;;;;;;;WAeG;QACH,MAAM,KAAK,GAAG,OAAO,CAAC,KAAsC,CAAC;QAE7D;;;;;;;;;;;;;;;;;;;;WAoBG;QACH,MAAM,UAAU,GAAG,IAAA,qCAAiB,EAAC;YACnC,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;SAC1D,CAAC,CAAC;QAEH;;;;;;WAMG;QAEH;;;;;;;;;;;;;;;;;;WAkBG;QACH,KAAK,CAAC,OAAO,GAAG,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;QAE5D;;;;;;WAMG;QACH,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IACrC,CAAC,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC;AAzGW,QAAA,+BAA+B,mCAyG1C"}
|
|
@@ -4,16 +4,14 @@ import type { ContextLogTrail } from 'sdk-logs';
|
|
|
4
4
|
import type { ZodSchema } from 'zod';
|
|
5
5
|
import type { ContextAwsLambdaServer } from '../../../domain.objects/ContextAwsLambdaServer';
|
|
6
6
|
import type { WrappedPayload } from '../../lambdaEndpointWire/frame/getIsWrappedPayload';
|
|
7
|
+
import { type FrozenDeep } from '../setEventFrozen';
|
|
7
8
|
import type { TranslateLog } from '../TranslateLog';
|
|
8
9
|
/**
|
|
9
10
|
* .what = wrapped payload format: event nested under `event` key with trail
|
|
10
|
-
* .why = re-exported from its canonical owner (`lambdaEndpointWire/frame`)
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* runLambdaEndpoint/serde emits it in-process, getUnwrappedEventWithExid
|
|
15
|
-
* reads it. a second local declaration here would be the exact duplication
|
|
16
|
-
* that lift removed (`rule.prefer.most-common-denominator`).
|
|
11
|
+
* .why = re-exported from its canonical owner (`lambdaEndpointWire/frame`), the common
|
|
12
|
+
* ancestor of the three contexts that touch the frame — askLambdaEndpoint and
|
|
13
|
+
* runLambdaEndpoint/serde emit it, getUnwrappedEventWithExid reads it. one
|
|
14
|
+
* declaration, never a structural twin (`rule.prefer.most-common-denominator`)
|
|
17
15
|
*/
|
|
18
16
|
export type { WrappedPayload };
|
|
19
17
|
/**
|
|
@@ -30,12 +28,48 @@ export type FlatPayload<TInput> = TInput & {
|
|
|
30
28
|
* .why = handler accepts both wrapped and flat formats at runtime
|
|
31
29
|
*/
|
|
32
30
|
export type LambdaHandlerInput<TInput> = FlatPayload<TInput> | WrappedPayload<TInput>;
|
|
31
|
+
/**
|
|
32
|
+
* .what = a direct invoke as it arrived on the wire — wrapped with a trail, or flat
|
|
33
|
+
*/
|
|
34
|
+
export type AskEventOnwire = LambdaHandlerInput<unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* .what = a direct invoke with its two arrival formats reconciled
|
|
37
|
+
* .why = `askLambdaEndpoint` sends `{ event, trail }` and a manual invoke sends the value flat;
|
|
38
|
+
* a handler that reads either is format-locked. `Unified` names that reconciliation, as it
|
|
39
|
+
* names the v1/v2 one at api gateway. the raw arrival is at `_.raw`
|
|
40
|
+
*
|
|
41
|
+
* .note = the envelope's body slot is `payload`, as in every family, so `payload ===
|
|
42
|
+
* event.payload` holds here too (`domain.terms/payload.md`). the trail rides
|
|
43
|
+
* `context.log.trail`, never this envelope (`domain.terms/trail.md`)
|
|
44
|
+
*/
|
|
45
|
+
export interface AskEventUnified<TPayload> {
|
|
46
|
+
/**
|
|
47
|
+
* .what = the body — validated against `schema.input` by the time `invoke` runs
|
|
48
|
+
*/
|
|
49
|
+
payload: TPayload;
|
|
50
|
+
/**
|
|
51
|
+
* .what = the ejection route — the invoke exactly as it arrived, trail wrapper included
|
|
52
|
+
*/
|
|
53
|
+
_: {
|
|
54
|
+
raw: AskEventOnwire;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
33
57
|
/**
|
|
34
58
|
* .what = endpoint operation signature type
|
|
35
|
-
* .why = named type for invoke function
|
|
59
|
+
* .why = named type for the invoke function
|
|
36
60
|
*/
|
|
37
61
|
export type EndpointOperation<TInput, TOutput> = (input: {
|
|
38
|
-
|
|
62
|
+
/**
|
|
63
|
+
* .what = the body, parsed and validated — the value the handler was written to act on
|
|
64
|
+
* .note = the same object as `event.payload`, never a copy
|
|
65
|
+
*/
|
|
66
|
+
payload: FrozenDeep<TInput>;
|
|
67
|
+
/**
|
|
68
|
+
* .what = the whole object that arrived, reconciled (`domain.terms/event.md`)
|
|
69
|
+
* .why frozen = every family freezes what it hands `invoke`
|
|
70
|
+
* (`rule.require.frozen-invoke-inputs`)
|
|
71
|
+
*/
|
|
72
|
+
event: FrozenDeep<AskEventUnified<TInput>>;
|
|
39
73
|
}, context: ContextLogTrail) => Promise<TOutput>;
|
|
40
74
|
/**
|
|
41
75
|
* .what = sdk contract type for genLambdaEndpoint input
|
|
@@ -62,9 +96,7 @@ export type EndpointOperation<TInput, TOutput> = (input: {
|
|
|
62
96
|
* — the pair collapses per-consumer here, which that rule names as the legitimate case)
|
|
63
97
|
*
|
|
64
98
|
* .note = the names trace to this repo's extant position vocabulary — `inputBefore` /
|
|
65
|
-
* `inputAfter
|
|
66
|
-
* rename of `TInput` to `TInputAfter` belongs with F31, which collapses both families'
|
|
67
|
-
* validators at their common ancestor (rule.prefer.names-by-position-over-claim)
|
|
99
|
+
* `inputAfter` (rule.prefer.names-by-position-over-claim)
|
|
68
100
|
*/
|
|
69
101
|
export type GenLambdaEndpointInput<TInput, TOutput, TInputBefore = TInput> = {
|
|
70
102
|
schema: {
|
|
@@ -81,9 +113,13 @@ export type GenLambdaEndpointInput<TInput, TOutput, TInputBefore = TInput> = {
|
|
|
81
113
|
*/
|
|
82
114
|
export type GenLambdaEndpointContext = ContextAwsLambdaServer;
|
|
83
115
|
/**
|
|
84
|
-
* .what = generates a lambda handler with validation and trail context
|
|
116
|
+
* .what = generates a lambda handler with validation and trail context, for a DIRECT invoke
|
|
85
117
|
* .why = standardizes handler creation with schema validation and observability. the chain:
|
|
86
118
|
* constraint error (a caller fault becomes a response object, never a throw), internal
|
|
87
119
|
* service error (logs loudly), io logger, trail, input + output validation
|
|
120
|
+
*
|
|
121
|
+
* .note = this is a leaf of the `genLambdaEndpoint` family, and it is exported under its own
|
|
122
|
+
* variant name only. it is never re-exported bare from `src/index.ts` — a caller
|
|
123
|
+
* reaches it as `genLambdaEndpoint.forAsk` (`rule.forbid.unqualified-variant-exports`)
|
|
88
124
|
*/
|
|
89
|
-
export declare const
|
|
125
|
+
export declare const forAsk: <TInput, TOutput, TInputBefore = TInput>(input: GenLambdaEndpointInput<TInput, TOutput, TInputBefore>, context?: ContextAwsLambdaServer) => middy.MiddyfiedHandler<LambdaHandlerInput<TInputBefore>, TOutput, Error, Context>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.forAsk = void 0;
|
|
7
7
|
const core_1 = __importDefault(require("@middy/core"));
|
|
8
8
|
const asContextLogTrail_1 = require("../asContextLogTrail");
|
|
9
9
|
const genConstraintErrorMiddleware_1 = require("../middleware/genConstraintErrorMiddleware");
|
|
@@ -12,32 +12,46 @@ const genIntrospectionMiddleware_1 = require("../middleware/genIntrospectionMidd
|
|
|
12
12
|
const genIoLoggerMiddleware_1 = require("../middleware/genIoLoggerMiddleware");
|
|
13
13
|
const genTrailMiddleware_1 = require("../middleware/genTrailMiddleware");
|
|
14
14
|
const getValidatedOutput_1 = require("../middleware/getValidatedOutput");
|
|
15
|
+
const setEventFrozen_1 = require("../setEventFrozen");
|
|
16
|
+
const genAskEventOnwireCaptureMiddleware_1 = require("./middleware/genAskEventOnwireCaptureMiddleware");
|
|
15
17
|
const genZodEventValidationMiddleware_1 = require("./middleware/genZodEventValidationMiddleware");
|
|
16
18
|
/**
|
|
17
|
-
* .what = generates a lambda handler with validation and trail context
|
|
19
|
+
* .what = generates a lambda handler with validation and trail context, for a DIRECT invoke
|
|
18
20
|
* .why = standardizes handler creation with schema validation and observability. the chain:
|
|
19
21
|
* constraint error (a caller fault becomes a response object, never a throw), internal
|
|
20
22
|
* service error (logs loudly), io logger, trail, input + output validation
|
|
23
|
+
*
|
|
24
|
+
* .note = this is a leaf of the `genLambdaEndpoint` family, and it is exported under its own
|
|
25
|
+
* variant name only. it is never re-exported bare from `src/index.ts` — a caller
|
|
26
|
+
* reaches it as `genLambdaEndpoint.forAsk` (`rule.forbid.unqualified-variant-exports`)
|
|
21
27
|
*/
|
|
22
|
-
const
|
|
23
|
-
// typed by the
|
|
24
|
-
// before, and a rename that reached only one of them would have compiled
|
|
28
|
+
const forAsk = (
|
|
29
|
+
// typed by the exported contract rather than an inline restatement, so the two cannot drift
|
|
25
30
|
input, context) => {
|
|
26
31
|
// build logic that invokes user handler and validates output
|
|
27
32
|
const logic = async (event, lambdaContext) => {
|
|
28
33
|
// read the trail log `genTrailMiddleware` wrote; the cast lives in the shared reader
|
|
29
34
|
const { log } = (0, asContextLogTrail_1.asContextLogTrail)({ context: lambdaContext });
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
/**
|
|
36
|
+
* .what = seals the envelope before the handler's turn
|
|
37
|
+
* .where = after the validator, which has already written the envelope into `request.event`,
|
|
38
|
+
* so what freezes IS what the handler reads
|
|
39
|
+
* .why = every family freezes, through this one shared helper
|
|
40
|
+
* (`rule.require.frozen-invoke-inputs`)
|
|
41
|
+
*/
|
|
42
|
+
const eventFrozen = (0, setEventFrozen_1.setEventFrozen)({ event });
|
|
43
|
+
// invoke user handler; `payload` is the envelope's own slot, so the two stay one object
|
|
44
|
+
const response = await input.invoke({ payload: eventFrozen.payload, event: eventFrozen }, { log });
|
|
32
45
|
// validate output and return typed result
|
|
33
46
|
return (0, getValidatedOutput_1.getValidatedOutput)({ response, schema: input.schema.output });
|
|
34
47
|
};
|
|
35
48
|
// middleware order matters:
|
|
36
49
|
// 1. error handlers (onError) - must be first to catch errors from all other middleware
|
|
37
|
-
// 2.
|
|
38
|
-
// 3.
|
|
39
|
-
// 4.
|
|
40
|
-
// 5.
|
|
50
|
+
// 2. onwire capture (onBefore) - keeps the raw invoke, before trail unwraps it
|
|
51
|
+
// 3. trail (onBefore) - injects trail context (must be early so isContempCaller is set for error handlers)
|
|
52
|
+
// 4. io logger - logs input/output for debug
|
|
53
|
+
// 5. introspection (onBefore) - intercepts introspect requests, returns schema
|
|
54
|
+
// 6. validation (onBefore) - validates the body, then writes the envelope into `request.event`
|
|
41
55
|
const middlewares = [
|
|
42
56
|
/**
|
|
43
57
|
* .note = this family's response IS its payload, so a caller fault renders as the body
|
|
@@ -46,12 +60,13 @@ input, context) => {
|
|
|
46
60
|
*/
|
|
47
61
|
(0, genConstraintErrorMiddleware_1.genConstraintErrorMiddleware)({ asOutputAfter: (body) => body }),
|
|
48
62
|
(0, genInternalServiceErrorMiddleware_1.genInternalServiceErrorMiddleware)({ asOutputAfter: false }),
|
|
63
|
+
(0, genAskEventOnwireCaptureMiddleware_1.genAskEventOnwireCaptureMiddleware)(),
|
|
49
64
|
(0, genTrailMiddleware_1.genTrailMiddleware)(),
|
|
50
65
|
(0, genIoLoggerMiddleware_1.genIoLoggerMiddleware)({ logTranslate: input.logTranslate }),
|
|
51
66
|
(0, genIntrospectionMiddleware_1.genIntrospectionMiddleware)({
|
|
52
67
|
schema: input.schema,
|
|
53
68
|
env: context?.env,
|
|
54
|
-
//
|
|
69
|
+
// introspection runs before validation, so `request.event` still holds the bare body here
|
|
55
70
|
asInputAfter: (request) => request.event,
|
|
56
71
|
asOutputAfter: (schema) => schema,
|
|
57
72
|
}),
|
|
@@ -59,11 +74,11 @@ input, context) => {
|
|
|
59
74
|
];
|
|
60
75
|
/**
|
|
61
76
|
* .as = assertion needed because middleware transforms LambdaHandlerInput<TInputBefore> into
|
|
62
|
-
* TInput before logic runs — it unwraps the
|
|
63
|
-
* typescript cannot track
|
|
77
|
+
* AskEventUnified<TInput> before logic runs — it unwraps the frame, runs the codec, and
|
|
78
|
+
* builds the envelope — but typescript cannot track that through middy
|
|
64
79
|
* .removal = if middy gains typed middleware inference, remove cast
|
|
65
80
|
*/
|
|
66
81
|
return (0, core_1.default)(logic).use(middlewares);
|
|
67
82
|
};
|
|
68
|
-
exports.
|
|
69
|
-
//# sourceMappingURL=genLambdaEndpoint.
|
|
83
|
+
exports.forAsk = forAsk;
|
|
84
|
+
//# sourceMappingURL=genLambdaEndpoint.forAsk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genLambdaEndpoint.forAsk.js","sourceRoot":"","sources":["../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAgC;AAOhC,4DAAyD;AACzD,6FAA0F;AAC1F,uGAAoG;AACpG,yFAAsF;AACtF,+EAA4E;AAC5E,yEAAsE;AACtE,yEAAsE;AACtE,sDAAoE;AAEpE,wGAAqG;AACrG,kGAA+F;AAqH/F;;;;;;;;;GASG;AACI,MAAM,MAAM,GAAG;AACpB,4FAA4F;AAC5F,KAA4D,EAC5D,OAAgC,EAQhC,EAAE;IACF,6DAA6D;IAC7D,MAAM,KAAK,GAAG,KAAK,EACjB,KAA8B,EAC9B,aAAsB,EACJ,EAAE;QACpB,qFAAqF;QACrF,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,qCAAiB,EAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;QAE9D;;;;;;WAMG;QACH,MAAM,WAAW,GAAG,IAAA,+BAAc,EAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QAE9C,wFAAwF;QACxF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,CACjC,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,EACpD,EAAE,GAAG,EAAE,CACR,CAAC;QAEF,0CAA0C;QAC1C,OAAO,IAAA,uCAAkB,EAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACvE,CAAC,CAAC;IAEF,4BAA4B;IAC5B,wFAAwF;IACxF,+EAA+E;IAC/E,2GAA2G;IAC3G,6CAA6C;IAC7C,+EAA+E;IAC/E,+FAA+F;IAC/F,MAAM,WAAW,GAAG;QAClB;;;;WAIG;QACH,IAAA,2DAA4B,EAAC,EAAE,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;QAC/D,IAAA,qEAAiC,EAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAC3D,IAAA,uEAAkC,GAAE;QACpC,IAAA,uCAAkB,GAAE;QACpB,IAAA,6CAAqB,EAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC;QAC3D,IAAA,uDAA0B,EAAC;YACzB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,GAAG,EAAE,OAAO,EAAE,GAAG;YACjB,0FAA0F;YAC1F,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK;YACxC,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;SAClC,CAAC;QACF,IAAA,iEAA+B,EAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;KAChE,CAAC;IAEF;;;;;OAKG;IACH,OAAO,IAAA,cAAK,EACV,KAGqB,CACtB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACrB,CAAC,CAAC;AA/EW,QAAA,MAAM,UA+EjB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type middy from '@middy/core';
|
|
2
|
+
/**
|
|
3
|
+
* .what = the key under which the raw invoke rides in middy's `request.internal`
|
|
4
|
+
* .why = one name, shared by the writer and the reader, so the two cannot drift
|
|
5
|
+
*/
|
|
6
|
+
export declare const KEY_OF_ASK_EVENT_ONWIRE = "askEventOnwire";
|
|
7
|
+
/**
|
|
8
|
+
* .what = keeps the invoke exactly as it arrived, before `genTrailMiddleware` unwraps it
|
|
9
|
+
* .why = the envelope's `_.raw` must hold what arrived — trail wrapper included — and the trail
|
|
10
|
+
* step replaces `request.event` with the unwrapped body. so the raw value is saved first
|
|
11
|
+
*
|
|
12
|
+
* .why `request.internal` = middy's sanctioned side-channel between middlewares; no vendor
|
|
13
|
+
* middleware reads our key (`rule.require.read-the-slot-a-dependency-reads`)
|
|
14
|
+
* .where = anywhere ahead of `genTrailMiddleware` in the chain
|
|
15
|
+
*/
|
|
16
|
+
export declare const genAskEventOnwireCaptureMiddleware: () => {
|
|
17
|
+
before: middy.MiddlewareFn<any, any>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genAskEventOnwireCaptureMiddleware = exports.KEY_OF_ASK_EVENT_ONWIRE = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* .what = the key under which the raw invoke rides in middy's `request.internal`
|
|
6
|
+
* .why = one name, shared by the writer and the reader, so the two cannot drift
|
|
7
|
+
*/
|
|
8
|
+
exports.KEY_OF_ASK_EVENT_ONWIRE = 'askEventOnwire';
|
|
9
|
+
/**
|
|
10
|
+
* .what = keeps the invoke exactly as it arrived, before `genTrailMiddleware` unwraps it
|
|
11
|
+
* .why = the envelope's `_.raw` must hold what arrived — trail wrapper included — and the trail
|
|
12
|
+
* step replaces `request.event` with the unwrapped body. so the raw value is saved first
|
|
13
|
+
*
|
|
14
|
+
* .why `request.internal` = middy's sanctioned side-channel between middlewares; no vendor
|
|
15
|
+
* middleware reads our key (`rule.require.read-the-slot-a-dependency-reads`)
|
|
16
|
+
* .where = anywhere ahead of `genTrailMiddleware` in the chain
|
|
17
|
+
*/
|
|
18
|
+
const genAskEventOnwireCaptureMiddleware = () => {
|
|
19
|
+
const before = async (request) => {
|
|
20
|
+
// .note = deliberate mutation — `request` is middy's only channel to hand a value onward
|
|
21
|
+
request.internal = {
|
|
22
|
+
...request.internal,
|
|
23
|
+
[exports.KEY_OF_ASK_EVENT_ONWIRE]: request.event,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
return { before };
|
|
27
|
+
};
|
|
28
|
+
exports.genAskEventOnwireCaptureMiddleware = genAskEventOnwireCaptureMiddleware;
|
|
29
|
+
//# sourceMappingURL=genAskEventOnwireCaptureMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genAskEventOnwireCaptureMiddleware.js","sourceRoot":"","sources":["../../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genAskEventOnwireCaptureMiddleware.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACU,QAAA,uBAAuB,GAAG,gBAAgB,CAAC;AAExD;;;;;;;;GAQG;AACI,MAAM,kCAAkC,GAAG,GAEhD,EAAE;IACF,MAAM,MAAM,GAAiC,KAAK,EAAE,OAAO,EAAE,EAAE;QAC7D,yFAAyF;QACzF,OAAO,CAAC,QAAQ,GAAG;YACjB,GAAG,OAAO,CAAC,QAAQ;YACnB,CAAC,+BAAuB,CAAC,EAAE,OAAO,CAAC,KAAK;SACzC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC;AAZW,QAAA,kCAAkC,sCAY7C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type middy from '@middy/core';
|
|
2
|
+
import type { ZodSchema } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* .what = validates the body against a zod schema, then writes the reconciled envelope
|
|
5
|
+
* `{ payload, _: { raw } }` into `request.event`
|
|
6
|
+
* .why = the ask-endpoint family reaches this step with the unwrapped body AT `request.event`,
|
|
7
|
+
* so the body is what the schema describes. the envelope is built here, after the parse,
|
|
8
|
+
* so its `payload` slot holds the VALIDATED value — the projection `payload ===
|
|
9
|
+
* event.payload` rests on it (`domain.terms/payload.md`)
|
|
10
|
+
*
|
|
11
|
+
* .why not shared with its api-gateway peer = `genZodInputValidationMiddleware` differs on two
|
|
12
|
+
* axes, and each alone would be enough:
|
|
13
|
+
* - the home — that chain must keep `request.event` http-shaped for
|
|
14
|
+
* `@middy/http-cors`, so its body rides at `event.payload` of an envelope it did
|
|
15
|
+
* not build. this one builds its own envelope
|
|
16
|
+
* - the shape — its schema describes a pair (`{ headers?, payload }`) and it writes
|
|
17
|
+
* back into two envelope slots. this one describes a single value
|
|
18
|
+
*/
|
|
19
|
+
export declare const genZodEventValidationMiddleware: <TInput>(input: {
|
|
20
|
+
schema: ZodSchema<TInput>;
|
|
21
|
+
}) => {
|
|
22
|
+
before: middy.MiddlewareFn<any, any>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genZodEventValidationMiddleware = void 0;
|
|
4
|
+
const getValidatedInput_1 = require("../../middleware/getValidatedInput");
|
|
5
|
+
const genAskEventOnwireCaptureMiddleware_1 = require("./genAskEventOnwireCaptureMiddleware");
|
|
6
|
+
/**
|
|
7
|
+
* .what = validates the body against a zod schema, then writes the reconciled envelope
|
|
8
|
+
* `{ payload, _: { raw } }` into `request.event`
|
|
9
|
+
* .why = the ask-endpoint family reaches this step with the unwrapped body AT `request.event`,
|
|
10
|
+
* so the body is what the schema describes. the envelope is built here, after the parse,
|
|
11
|
+
* so its `payload` slot holds the VALIDATED value — the projection `payload ===
|
|
12
|
+
* event.payload` rests on it (`domain.terms/payload.md`)
|
|
13
|
+
*
|
|
14
|
+
* .why not shared with its api-gateway peer = `genZodInputValidationMiddleware` differs on two
|
|
15
|
+
* axes, and each alone would be enough:
|
|
16
|
+
* - the home — that chain must keep `request.event` http-shaped for
|
|
17
|
+
* `@middy/http-cors`, so its body rides at `event.payload` of an envelope it did
|
|
18
|
+
* not build. this one builds its own envelope
|
|
19
|
+
* - the shape — its schema describes a pair (`{ headers?, payload }`) and it writes
|
|
20
|
+
* back into two envelope slots. this one describes a single value
|
|
21
|
+
*/
|
|
22
|
+
const genZodEventValidationMiddleware = (input) => {
|
|
23
|
+
const before = async (request) => {
|
|
24
|
+
const inputAfter = (0, getValidatedInput_1.getValidatedInput)({
|
|
25
|
+
schema: input.schema,
|
|
26
|
+
value: request.event,
|
|
27
|
+
});
|
|
28
|
+
// write the envelope, with the parsed (transformed) body in its payload slot
|
|
29
|
+
// .note = deliberate mutation — `request` is middy's only channel to hand a value onward
|
|
30
|
+
request.event = {
|
|
31
|
+
payload: inputAfter,
|
|
32
|
+
_: { raw: request.internal?.[genAskEventOnwireCaptureMiddleware_1.KEY_OF_ASK_EVENT_ONWIRE] },
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
return { before };
|
|
36
|
+
};
|
|
37
|
+
exports.genZodEventValidationMiddleware = genZodEventValidationMiddleware;
|
|
38
|
+
//# sourceMappingURL=genZodEventValidationMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genZodEventValidationMiddleware.js","sourceRoot":"","sources":["../../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware.ts"],"names":[],"mappings":";;;AAGA,0EAAuE;AACvE,6FAA+E;AAE/E;;;;;;;;;;;;;;;GAeG;AACI,MAAM,+BAA+B,GAAG,CAAS,KAEvD,EAEC,EAAE;IACF,MAAM,MAAM,GAAiC,KAAK,EAAE,OAAO,EAAE,EAAE;QAC7D,MAAM,UAAU,GAAG,IAAA,qCAAiB,EAAC;YACnC,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;QAEH,6EAA6E;QAC7E,yFAAyF;QACzF,OAAO,CAAC,KAAK,GAAG;YACd,OAAO,EAAE,UAAU;YACnB,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,4DAAuB,CAAC,EAAE;SACxD,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC;AApBW,QAAA,+BAA+B,mCAoB1C"}
|
package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.d.ts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { SQSEvent, SQSRecord } from 'aws-lambda';
|
|
2
|
+
/**
|
|
3
|
+
* .what = the header bag as the wire carries it — one name per value, each a string or absent
|
|
4
|
+
* .why = `headers` names the metadata bag that rides beside the body, in any transport that
|
|
5
|
+
* carries one. sqs calls it `messageAttributes`; same concept, same word
|
|
6
|
+
* (`domain.terms/headers.md`)
|
|
7
|
+
*
|
|
8
|
+
* .note = flat, where aws wraps each value as `{ stringValue, dataType }`. the wrapper is a codec
|
|
9
|
+
* detail rather than a second dimension; the typed bag is at `_.raw.messageAttributes`
|
|
10
|
+
* .note = a `Binary` attribute's `binaryValue` lands here under its own name. to carry only
|
|
11
|
+
* `stringValue` would make a binary attribute read as absent
|
|
12
|
+
* .note = aws declares `stringListValues` / `binaryListValues` "Not implemented. Reserved for
|
|
13
|
+
* future use.", so neither is carried
|
|
14
|
+
*/
|
|
15
|
+
export type SqsHeadersOnwire = Record<string, string | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* .what = the shape an author's `schema.input.headers` may name — the wire bag, or absent
|
|
18
|
+
* .why = the `headers` key is optional, so header enforcement is opt-in and no extant sender can
|
|
19
|
+
* be refused by a schema that never mentioned them (`rule.require.explicit-optout`)
|
|
20
|
+
*
|
|
21
|
+
* .note = bound rather than free, because the validator spreads the validated headers back over
|
|
22
|
+
* the wire bag: `{ ...'abc' }` yields `{ 0: 'a', 1: 'b', 2: 'c' }` — a char map under the
|
|
23
|
+
* name of a header bag. the bound is the only layer that refuses it
|
|
24
|
+
*/
|
|
25
|
+
export type SqsHeadersDeclared = SqsHeadersOnwire | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* .what = the header bag a handler receives — the declared keys, beside every other attribute set
|
|
28
|
+
* .why = the validator writes headers back as a merge rather than a replace, so the emitted value
|
|
29
|
+
* carries both. a type of `THeadersDeclared` alone would regress the bag's open read
|
|
30
|
+
*
|
|
31
|
+
* .note = a conditional rather than a bare intersection: `SqsHeadersDeclared` admits `undefined`,
|
|
32
|
+
* and `undefined & Record<string, string | undefined>` reduces to `never` — so the bare
|
|
33
|
+
* form would hand a `never` to every handler that omits the `headers` key
|
|
34
|
+
* .note = clamped at the type level by `perRecord`'s `[case13]`, on both arms
|
|
35
|
+
*/
|
|
36
|
+
export type SqsHeadersMerged<THeadersDeclared extends SqsHeadersDeclared> = THeadersDeclared extends undefined ? SqsHeadersOnwire : SqsHeadersOnwire & THeadersDeclared;
|
|
37
|
+
/**
|
|
38
|
+
* .what = the two slots a caller may constrain on one sqs record
|
|
39
|
+
* .why = the validator writes the validated values back into the envelope, so the envelope's
|
|
40
|
+
* types must move with the caller's schema. without the parameter, `payload` could only be
|
|
41
|
+
* `unknown` and an `as`-cast would return at the `invoke` hand-off
|
|
42
|
+
*
|
|
43
|
+
* .note = the shape describes ONE record, in both variants. `perBatch` applies it N times rather
|
|
44
|
+
* than widen it, which is what lets one `schema.input` serve both
|
|
45
|
+
*/
|
|
46
|
+
export interface SqsRecordDecodedShape {
|
|
47
|
+
headers: SqsHeadersOnwire;
|
|
48
|
+
payload: unknown;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* .what = one sqs message, with its body decoded and its attributes flattened
|
|
52
|
+
* .why `Decoded` and not `Unified` = `Unified` names a v1/v2 split reconciled, and sqs has no
|
|
53
|
+
* version axis — one wire shape serves every queue. `Decoded` names the state of the
|
|
54
|
+
* value: aws hands the body over as a string and the attributes inside a vendor wrapper
|
|
55
|
+
*
|
|
56
|
+
* .note = header keys are carried verbatim, where the api-gateway family lowercases them. rfc
|
|
57
|
+
* 9110 §5.1 makes http field names case-insensitive; sqs attribute names are
|
|
58
|
+
* case-sensitive, so a fold here would merge two values the sender kept apart
|
|
59
|
+
* .note = there is no `SqsEventOnwire` alias. sqs's wire form is a single vendor type, `SQSEvent`,
|
|
60
|
+
* already named; the api-gateway alias exists because its wire form is an unnamed union
|
|
61
|
+
* .note = `headers` and `payload` are the handler's projections of these slots — one object each,
|
|
62
|
+
* never a copy. that holds only because the validator replaces the values here
|
|
63
|
+
*/
|
|
64
|
+
export interface SqsRecordDecoded<TShape extends SqsRecordDecodedShape = SqsRecordDecodedShape> {
|
|
65
|
+
/**
|
|
66
|
+
* .what = the message's own identifier, as sqs issued it
|
|
67
|
+
* .why `id` and not `messageId` = the type already says `SqsRecord`, so `message` would restate
|
|
68
|
+
* a dimension the name carries. aws's wire name is `messageId`
|
|
69
|
+
* .note = `perRecord` never reads it. `perBatch` returns
|
|
70
|
+
* `{ batchItemFailures: [{ itemIdentifier }] }`, and this is the value that goes in
|
|
71
|
+
*/
|
|
72
|
+
id: string;
|
|
73
|
+
/**
|
|
74
|
+
* .what = the message attributes the sender set, flattened to one name per value
|
|
75
|
+
* .note = keys are verbatim — sqs attribute names are case-sensitive
|
|
76
|
+
* .note = validated against `schema.input.headers` where the author declared one; an absent key
|
|
77
|
+
* constrains naught
|
|
78
|
+
*/
|
|
79
|
+
headers: TShape['headers'];
|
|
80
|
+
/**
|
|
81
|
+
* .what = the body — parsed, and validated by the time `logic` runs
|
|
82
|
+
* .why = the sdk's word for the body in every family. an sqs message has a body, so it has a
|
|
83
|
+
* payload (`domain.terms/payload.md`)
|
|
84
|
+
* .note = there is no unvalidated parsed body on this shape. the untouched wire string is at
|
|
85
|
+
* `_.raw.body`, for a handler that must verify a signature over the exact bytes
|
|
86
|
+
*/
|
|
87
|
+
payload: TShape['payload'];
|
|
88
|
+
/**
|
|
89
|
+
* .what = the ejection route — the vendor record, before this shape decoded it
|
|
90
|
+
* .why = `_` marks an escape hatch rather than a paved path. `receiptHandle`,
|
|
91
|
+
* `attributes.ApproximateReceiveCount`, `md5OfBody`, and the typed `messageAttributes`
|
|
92
|
+
* bag each live here
|
|
93
|
+
* .note = the vendor record by identity, never a copy — clamped by `perRecord`'s `[case12]`. a
|
|
94
|
+
* copy is invisible to a field check and drops whatever field the next handler needs
|
|
95
|
+
*/
|
|
96
|
+
_: {
|
|
97
|
+
raw: SQSRecord;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* .what = an sqs invoke, with every record decoded
|
|
102
|
+
* .why = `event` is the whole object that arrived, in every family. an sqs invoke carries N
|
|
103
|
+
* messages, so the whole object is the batch rather than one message of it
|
|
104
|
+
* (`domain.terms/event.md`)
|
|
105
|
+
*
|
|
106
|
+
* .note = the same shape for both variants. `perRecord` receives the whole event and refuses a
|
|
107
|
+
* batch of more than one, loudly — so `event.records.length` is a fact about the invoke
|
|
108
|
+
* rather than about the variant, and a handler that reads it reads the truth in both
|
|
109
|
+
*/
|
|
110
|
+
export interface SqsEventDecoded<TShape extends SqsRecordDecodedShape = SqsRecordDecodedShape> {
|
|
111
|
+
/**
|
|
112
|
+
* .what = the messages this invoke carries, in the order sqs delivered them
|
|
113
|
+
* .why `records` and not `Records` = aws capitalizes it on the wire; this shape does not. the
|
|
114
|
+
* untouched bag is at `_.raw.Records`
|
|
115
|
+
*/
|
|
116
|
+
records: SqsRecordDecoded<TShape>[];
|
|
117
|
+
/**
|
|
118
|
+
* .what = the ejection route — the wire form, before this shape decoded it
|
|
119
|
+
*/
|
|
120
|
+
_: {
|
|
121
|
+
raw: SQSEvent;
|
|
122
|
+
};
|
|
123
|
+
}
|
package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqsEventDecoded.js","sourceRoot":"","sources":["../../../../src/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded.ts"],"names":[],"mappings":""}
|