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.
- 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 +128 -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/getIsConstraintError.js +4 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/getIsConstraintError.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getIsFrozenMutatorRefusal.d.ts +17 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/getIsFrozenMutatorRefusal.js +32 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/getIsFrozenMutatorRefusal.js.map +1 -0
- 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 +40 -0
- package/dist/domain.operations/genLambdaEndpoint/setEventFrozen.js +55 -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 +39 -18
- package/dist/index.js +20 -14
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
- 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,40 @@
|
|
|
1
|
+
import { type FrozenDeep } from 'type-fns';
|
|
2
|
+
/**
|
|
3
|
+
* .what = seals the envelope before `invoke` receives it, in place, typed `FrozenDeep`
|
|
4
|
+
* .why = the envelope outlives the handler's turn, so a write through it corrupts a value
|
|
5
|
+
* somebody else reads after `invoke` returns — with no type error and no throw. the freeze
|
|
6
|
+
* makes that unrepresentable
|
|
7
|
+
*
|
|
8
|
+
* .why every family freezes, with no exception = the membership rule is the hand-off, never the
|
|
9
|
+
* reader set. who reads the envelope after `invoke` differs per family — a vendor for
|
|
10
|
+
* `forApiGateway` (`@middy/http-cors` and `…response-serializer`, in their `after` hooks),
|
|
11
|
+
* the sdk itself for `forSqs.perBatch` (`idsInBatch` is built from `decoded.records` after
|
|
12
|
+
* `invoke`), and neither for `forSqs.perRecord` or `forAsk`. an empty column is a
|
|
13
|
+
* property of today, so a rule keyed to one expires silently the first commit that adds a
|
|
14
|
+
* post-invoke read (`rule.require.frozen-invoke-inputs`)
|
|
15
|
+
*
|
|
16
|
+
* .why type-fns' `asFrozenDeep` = the type and the runtime come from one package, so they cannot
|
|
17
|
+
* drift: what `FrozenDeep` refuses at compile time, `asFrozenDeep` refuses at run time. that
|
|
18
|
+
* includes the state a bare `Object.freeze` cannot reach — a `Date`, `Map`, `Set`, `WeakMap`,
|
|
19
|
+
* or `WeakSet` has its mutators replaced by throwers, and the walk reaches symbol keys and
|
|
20
|
+
* non-enumerable own props
|
|
21
|
+
*
|
|
22
|
+
* .note = in place, deliberately. `asFrozenDeep` returns the same reference, so
|
|
23
|
+
* `headers === event.headers` holds and the bag cannot drift from the envelope it projects
|
|
24
|
+
* (`domain.terms/event.md`). a defensive copy would remove the hazard and break the projection
|
|
25
|
+
* .note = the projections freeze with it, by design: `headers`, `payload`, and `records` are the
|
|
26
|
+
* envelope's own slots, so a handler mutates none
|
|
27
|
+
* .note = `forSqs.perBatch`'s harm is the sharpest, and `[case17]` walks it end to end: a handler
|
|
28
|
+
* that forges `event.records[n].id` would rewrite the set the unknown-id guard checks
|
|
29
|
+
* against, so sqs is answered with an `itemIdentifier` it cannot match
|
|
30
|
+
*
|
|
31
|
+
* .why a refusal is a `MalfunctionError` = `asFrozenDeep` refuses, all or none and before any
|
|
32
|
+
* freeze, a value it cannot seal: a typed array that holds bytes, a global or sticky
|
|
33
|
+
* `RegExp`. `JSON.parse` yields neither, so one reaches the envelope only when the handler's
|
|
34
|
+
* own schema builds it. that is a server fault, never the caller's, so it must not ride the
|
|
35
|
+
* caller-fault path a bare `ConstraintError` would take (`getIsConstraintError`). the
|
|
36
|
+
* type-fns refusal rides as `cause`, so its `path` and `hint` still name the fix
|
|
37
|
+
*/
|
|
38
|
+
export declare const setEventFrozen: <TEvent>(input: {
|
|
39
|
+
event: TEvent;
|
|
40
|
+
}) => FrozenDeep<TEvent>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setEventFrozen = void 0;
|
|
4
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
5
|
+
const type_fns_1 = require("type-fns");
|
|
6
|
+
/**
|
|
7
|
+
* .what = seals the envelope before `invoke` receives it, in place, typed `FrozenDeep`
|
|
8
|
+
* .why = the envelope outlives the handler's turn, so a write through it corrupts a value
|
|
9
|
+
* somebody else reads after `invoke` returns — with no type error and no throw. the freeze
|
|
10
|
+
* makes that unrepresentable
|
|
11
|
+
*
|
|
12
|
+
* .why every family freezes, with no exception = the membership rule is the hand-off, never the
|
|
13
|
+
* reader set. who reads the envelope after `invoke` differs per family — a vendor for
|
|
14
|
+
* `forApiGateway` (`@middy/http-cors` and `…response-serializer`, in their `after` hooks),
|
|
15
|
+
* the sdk itself for `forSqs.perBatch` (`idsInBatch` is built from `decoded.records` after
|
|
16
|
+
* `invoke`), and neither for `forSqs.perRecord` or `forAsk`. an empty column is a
|
|
17
|
+
* property of today, so a rule keyed to one expires silently the first commit that adds a
|
|
18
|
+
* post-invoke read (`rule.require.frozen-invoke-inputs`)
|
|
19
|
+
*
|
|
20
|
+
* .why type-fns' `asFrozenDeep` = the type and the runtime come from one package, so they cannot
|
|
21
|
+
* drift: what `FrozenDeep` refuses at compile time, `asFrozenDeep` refuses at run time. that
|
|
22
|
+
* includes the state a bare `Object.freeze` cannot reach — a `Date`, `Map`, `Set`, `WeakMap`,
|
|
23
|
+
* or `WeakSet` has its mutators replaced by throwers, and the walk reaches symbol keys and
|
|
24
|
+
* non-enumerable own props
|
|
25
|
+
*
|
|
26
|
+
* .note = in place, deliberately. `asFrozenDeep` returns the same reference, so
|
|
27
|
+
* `headers === event.headers` holds and the bag cannot drift from the envelope it projects
|
|
28
|
+
* (`domain.terms/event.md`). a defensive copy would remove the hazard and break the projection
|
|
29
|
+
* .note = the projections freeze with it, by design: `headers`, `payload`, and `records` are the
|
|
30
|
+
* envelope's own slots, so a handler mutates none
|
|
31
|
+
* .note = `forSqs.perBatch`'s harm is the sharpest, and `[case17]` walks it end to end: a handler
|
|
32
|
+
* that forges `event.records[n].id` would rewrite the set the unknown-id guard checks
|
|
33
|
+
* against, so sqs is answered with an `itemIdentifier` it cannot match
|
|
34
|
+
*
|
|
35
|
+
* .why a refusal is a `MalfunctionError` = `asFrozenDeep` refuses, all or none and before any
|
|
36
|
+
* freeze, a value it cannot seal: a typed array that holds bytes, a global or sticky
|
|
37
|
+
* `RegExp`. `JSON.parse` yields neither, so one reaches the envelope only when the handler's
|
|
38
|
+
* own schema builds it. that is a server fault, never the caller's, so it must not ride the
|
|
39
|
+
* caller-fault path a bare `ConstraintError` would take (`getIsConstraintError`). the
|
|
40
|
+
* type-fns refusal rides as `cause`, so its `path` and `hint` still name the fix
|
|
41
|
+
*/
|
|
42
|
+
const setEventFrozen = (input) => {
|
|
43
|
+
try {
|
|
44
|
+
return (0, type_fns_1.asFrozenDeep)(input.event);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
// a non-error throw is no refusal of the walk; let it surface as-is
|
|
48
|
+
if (!(error instanceof Error))
|
|
49
|
+
throw error;
|
|
50
|
+
// a refusal: the handler's schema built a value the freeze cannot seal
|
|
51
|
+
throw new helpful_errors_1.MalfunctionError('the event holds a value the invoke freeze cannot seal — the handler schema built it', { cause: error });
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.setEventFrozen = setEventFrozen;
|
|
55
|
+
//# sourceMappingURL=setEventFrozen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setEventFrozen.js","sourceRoot":"","sources":["../../../src/domain.operations/genLambdaEndpoint/setEventFrozen.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAClD,uCAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACI,MAAM,cAAc,GAAG,CAAS,KAEtC,EAAsB,EAAE;IACvB,IAAI,CAAC;QACH,OAAO,IAAA,uBAAY,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,oEAAoE;QACpE,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAE3C,uEAAuE;QACvE,MAAM,IAAI,iCAAgB,CACxB,qFAAqF,EACrF,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB"}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* .what = the "generated — do not edit" banner prepended to every emitted file
|
|
3
3
|
* .why = readers should re-run the codegen, not hand-edit the output (uc.1); the
|
|
4
4
|
* robot-arm 🦾 signals at a glance that a machine wrote this file
|
|
5
|
-
* .note = the glyph must survive the biome/stdin format pass —
|
|
6
|
-
*
|
|
7
|
-
* round-trip cleanly in formatTypescript.integration.test.ts
|
|
5
|
+
* .note = the glyph must survive the biome/stdin format pass — not every emoji does, so 🦾 is
|
|
6
|
+
* asserted to round-trip cleanly in formatTypescript.integration.test.ts
|
|
8
7
|
*/
|
|
9
8
|
export declare const banner = "/**\n * \uD83E\uDDBE generated by `sdk-aws-lambda gen` \u2014 do not edit.\n * re-run the codegen to update.\n */";
|
|
@@ -5,9 +5,8 @@ exports.banner = void 0;
|
|
|
5
5
|
* .what = the "generated — do not edit" banner prepended to every emitted file
|
|
6
6
|
* .why = readers should re-run the codegen, not hand-edit the output (uc.1); the
|
|
7
7
|
* robot-arm 🦾 signals at a glance that a machine wrote this file
|
|
8
|
-
* .note = the glyph must survive the biome/stdin format pass —
|
|
9
|
-
*
|
|
10
|
-
* round-trip cleanly in formatTypescript.integration.test.ts
|
|
8
|
+
* .note = the glyph must survive the biome/stdin format pass — not every emoji does, so 🦾 is
|
|
9
|
+
* asserted to round-trip cleanly in formatTypescript.integration.test.ts
|
|
11
10
|
*/
|
|
12
11
|
exports.banner = `/**
|
|
13
12
|
* 🦾 generated by \`sdk-aws-lambda gen\` — do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.file/banner.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.file/banner.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACU,QAAA,MAAM,GAAG;;;IAGlB,CAAC"}
|
|
@@ -5,8 +5,13 @@ import type { LambdaEndpointSchema } from '../../../domain.objects/LambdaEndpoin
|
|
|
5
5
|
* .why = the mechanisms file exposes one fn per discovered endpoint (uc.1); each
|
|
6
6
|
* is a thin, typed call into the endpoint by its service+function
|
|
7
7
|
*
|
|
8
|
-
* .note = `event` is the
|
|
9
|
-
*
|
|
8
|
+
* .note = `event` is **the whole object the invoke delivers** — aws's own word, and this
|
|
9
|
+
* repo's term for it (`domain.terms/event.md`). a direct-invoke lambda carries no
|
|
10
|
+
* envelope, so what arrives IS the caller's input and the two coincide here. that
|
|
11
|
+
* coincidence is a property of this trigger, never of the word: at api gateway the
|
|
12
|
+
* two differ, and there `event` names the envelope while `payload` names its body
|
|
13
|
+
*
|
|
14
|
+
* .note = the wrapper keeps the caller's `context` ambient (env.access lives there)
|
|
10
15
|
*/
|
|
11
16
|
export declare const asMechanismFnSource: (input: {
|
|
12
17
|
service: string;
|
|
@@ -8,8 +8,13 @@ const getTypescriptFromJsonSchema_1 = require("./getTypescriptFromJsonSchema");
|
|
|
8
8
|
* .why = the mechanisms file exposes one fn per discovered endpoint (uc.1); each
|
|
9
9
|
* is a thin, typed call into the endpoint by its service+function
|
|
10
10
|
*
|
|
11
|
-
* .note = `event` is the
|
|
12
|
-
*
|
|
11
|
+
* .note = `event` is **the whole object the invoke delivers** — aws's own word, and this
|
|
12
|
+
* repo's term for it (`domain.terms/event.md`). a direct-invoke lambda carries no
|
|
13
|
+
* envelope, so what arrives IS the caller's input and the two coincide here. that
|
|
14
|
+
* coincidence is a property of this trigger, never of the word: at api gateway the
|
|
15
|
+
* two differ, and there `event` names the envelope while `payload` names its body
|
|
16
|
+
*
|
|
17
|
+
* .note = the wrapper keeps the caller's `context` ambient (env.access lives there)
|
|
13
18
|
*/
|
|
14
19
|
const asMechanismFnSource = (input) => {
|
|
15
20
|
// the typed shapes for this endpoint's event (input) and result (output)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asMechanismFnSource.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.ts"],"names":[],"mappings":";;;AACA,+EAA4E;AAE5E
|
|
1
|
+
{"version":3,"file":"asMechanismFnSource.js","sourceRoot":"","sources":["../../../../src/domain.operations/genServiceSdk/gen.mechanism/asMechanismFnSource.ts"],"names":[],"mappings":";;;AACA,+EAA4E;AAE5E;;;;;;;;;;;;;GAaG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAKnC,EAAU,EAAE;IACX,yEAAyE;IACzE,MAAM,SAAS,GAAG,IAAA,yDAA2B,EAAC;QAC5C,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;QAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,IAAA,yDAA2B,EAAC;QAC7C,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;QAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAC;IAEH,8EAA8E;IAC9E,8EAA8E;IAC9E,wEAAwE;IACxE,OAAO;QACL,KAAK,KAAK,CAAC,QAAQ,KAAK;QACxB,cAAc,SAAS,GAAG;QAC1B,sCAAsC;QACtC,gBAAgB,UAAU,MAAM;QAChC,yBAAyB,SAAS,KAAK,UAAU,IAAI;QACrD,6BAA6B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc;QACrH,gBAAgB;QAChB,QAAQ;KACT,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC,CAAC;AA7BW,QAAA,mBAAmB,uBA6B9B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
* sdk-aws-lambda
|
|
3
3
|
*
|
|
4
4
|
* define endpoints, ask endpoints, auto-propagate trace-ids.
|
|
5
|
+
*
|
|
6
|
+
* .note = the trace-id propagates lambda to lambda, via the `{ event, trail }` wrapper
|
|
7
|
+
* `askLambdaEndpoint` sends. it does not cross an http or a queue boundary — those
|
|
8
|
+
* triggers mint a fresh `exid` per invoke (`domain.terms/trail.md`)
|
|
5
9
|
*/
|
|
6
10
|
export { BadRequestError } from 'helpful-errors';
|
|
11
|
+
/**
|
|
12
|
+
* .what = the type of every value a `genLambdaEndpoint.for*` variant hands its `invoke`
|
|
13
|
+
* .why = a consumer who declares a handler apart from the call site must be able to name it
|
|
14
|
+
* .note = `FrozenDeep` is type-fns' own, re-exported so no consumer import changes
|
|
15
|
+
*/
|
|
16
|
+
export type { FrozenDeep } from 'type-fns';
|
|
7
17
|
/**
|
|
8
18
|
* .what = releases every LambdaClient this sdk memoized on the caller's behalf
|
|
9
19
|
* .why = `askLambdaEndpoint` findserts a client per region and holds it for the process, so
|
|
@@ -11,9 +21,9 @@ export { BadRequestError } from 'helpful-errors';
|
|
|
11
21
|
* library that makes process-lifetime state owes the caller a way to release it
|
|
12
22
|
*/
|
|
13
23
|
export { delLambdaSdks } from './access/sdks/lambda/genLambdaSdk';
|
|
14
|
-
export type {
|
|
24
|
+
export type { ApiGatewayRequestEventOnwire } from './domain.objects/ApiGatewayRequestEventOnwire';
|
|
15
25
|
export type { ApiGatewayResponse } from './domain.objects/ApiGatewayResponse';
|
|
16
|
-
export type {
|
|
26
|
+
export type { ApiGatewayResponseOnwire } from './domain.objects/ApiGatewayResponseOnwire';
|
|
17
27
|
export type { ContextAwsLambdaCaller } from './domain.objects/ContextAwsLambdaCaller';
|
|
18
28
|
export type { ContextAwsLambdaServer, EnvAccess, EnvConfig, } from './domain.objects/ContextAwsLambdaServer';
|
|
19
29
|
export { GeneratedFile } from './domain.objects/GeneratedFile';
|
|
@@ -35,23 +45,36 @@ export { asCacheWithoutSet } from './domain.operations/askLambdaEndpoint/cache/a
|
|
|
35
45
|
export { getAskLambdaCacheKey } from './domain.operations/askLambdaEndpoint/cache/getAskLambdaCacheKey';
|
|
36
46
|
export { asLambdaEndpoint } from './domain.operations/asLambdaEndpoint/asLambdaEndpoint';
|
|
37
47
|
export { asLambdaEvent } from './domain.operations/asLambdaEvent/asLambdaEvent';
|
|
48
|
+
/**
|
|
49
|
+
* .what = the `genLambdaEndpoint` family —
|
|
50
|
+
* `{ forAsk, forApiGateway, forSqs: { perRecord, perBatch } }`
|
|
51
|
+
* .why = no variant is exported bare beside it, so autocomplete enumerates the family
|
|
52
|
+
* (`rule.forbid.unqualified-variant-exports`)
|
|
53
|
+
*/
|
|
54
|
+
export { genLambdaEndpoint } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint';
|
|
55
|
+
export type { ApiGatewayHeadersDeclared, ApiGatewayHeadersMerged, ApiGatewayHeadersOnwire, ApiGatewayRequestEventUnified, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified';
|
|
38
56
|
export { asApiGatewayResponseSchema } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema';
|
|
39
57
|
export type { CorsConfig, ForApiGatewayContext, ForApiGatewayInput, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway';
|
|
40
|
-
export { forApiGateway } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway';
|
|
41
58
|
export { isApiGatewayResponse } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse';
|
|
42
|
-
export {
|
|
59
|
+
export { genApiGatewayRequestEventNormalizationMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayRequestEventNormalizationMiddleware';
|
|
43
60
|
export { genContentTypeCoherenceMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware';
|
|
44
|
-
export {
|
|
45
|
-
export type {
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
export { genZodInputValidationMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware';
|
|
62
|
+
export type { EndpointOperation, FlatPayload, GenLambdaEndpointContext, GenLambdaEndpointInput, LambdaHandlerInput, WrappedPayload, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk';
|
|
63
|
+
export { genZodEventValidationMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware';
|
|
64
|
+
/**
|
|
65
|
+
* .what = the `forSqs` sub-family's types, through `SqsEventDecoded`
|
|
66
|
+
* .why = each is reachable from `ForSqsPerRecordInput` / `ForSqsPerBatchInput`, so a consumer
|
|
67
|
+
* must be able to name it
|
|
68
|
+
* .note = the chain's own operations (`asSqsEventDecoded`, `setSqsRecordValidated`, …) stay
|
|
69
|
+
* unexported, as do the api-gateway peers
|
|
70
|
+
*/
|
|
71
|
+
export type { ForSqsPerBatchInput, SqsRecordSuccessRef, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch';
|
|
72
|
+
export type { ForSqsPerRecordInput } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord';
|
|
73
|
+
export type { SqsEventDecoded, SqsHeadersDeclared, SqsHeadersMerged, SqsHeadersOnwire, SqsRecordDecoded, SqsRecordDecodedShape, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded';
|
|
49
74
|
/**
|
|
50
75
|
* .what = the shared `request.context` reader every exported middleware uses
|
|
51
|
-
* .why = it
|
|
52
|
-
*
|
|
53
|
-
* otherwise restate that cast — the exact sprawl this reader exists to retire
|
|
54
|
-
* (rule.forbid.as-cast)
|
|
76
|
+
* .why = it holds the one cast to the trail fields this sdk writes, so a consumer who authors a
|
|
77
|
+
* peer middleware need not restate it (rule.forbid.as-cast)
|
|
55
78
|
*/
|
|
56
79
|
export { asContextTrailed, type ContextTrailed, } from './domain.operations/genLambdaEndpoint/middleware/asContextTrailed';
|
|
57
80
|
export { genConstraintErrorMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware';
|
|
@@ -62,9 +85,7 @@ export { genTrailMiddleware } from './domain.operations/genLambdaEndpoint/middle
|
|
|
62
85
|
export { genZodOutputValidationMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware';
|
|
63
86
|
/**
|
|
64
87
|
* .what = the two error-body shapes `genConstraintErrorMiddleware.asOutputAfter` receives
|
|
65
|
-
* .why =
|
|
66
|
-
* an unexported parameter type forces an `any` or a hand-copied re-declaration at the
|
|
67
|
-
* public boundary (rule.forbid.as-cast)
|
|
88
|
+
* .why = a public middleware's parameter types must be nameable by a consumer
|
|
68
89
|
*/
|
|
69
90
|
export type { LambdaEndpointErrorResponseBodyAncient, LambdaEndpointErrorResponseBodyContemp, } from './domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody';
|
|
70
91
|
/**
|
|
@@ -93,12 +114,12 @@ export { getValidatedOutput, type OutputValidationErrorMetadata, } from './domai
|
|
|
93
114
|
export type { ValidationErrorMetadata } from './domain.operations/genLambdaEndpoint/middleware/getValidationError';
|
|
94
115
|
export type { ZodIssueSummary } from './domain.operations/genLambdaEndpoint/middleware/getZodIssuesSummary';
|
|
95
116
|
/**
|
|
117
|
+
* .what = the `logTranslate` config type
|
|
96
118
|
* .note = `TranslateLog` is public because `logTranslate` accepts it, and it replaces the
|
|
97
119
|
* formerly-public `IoLogTranslate`. its three designed peers — `Translate<TShapes>`,
|
|
98
120
|
* `LambdaEndpointShapes`, `Translator<TFrom, TInto>` — are DELETED rather than
|
|
99
121
|
* unexported: no config field ever accepted a `Translate`, so all three would ship with
|
|
100
|
-
* zero consumers (rule.prefer.wet-over-dry)
|
|
101
|
-
* so a later round restores a TERM from a record rather than a dead declaration
|
|
122
|
+
* zero consumers (rule.prefer.wet-over-dry)
|
|
102
123
|
*/
|
|
103
124
|
export type { TranslateLog } from './domain.operations/genLambdaEndpoint/TranslateLog';
|
|
104
125
|
export { genServiceSdk } from './domain.operations/genServiceSdk/genServiceSdk';
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
* sdk-aws-lambda
|
|
4
4
|
*
|
|
5
5
|
* define endpoints, ask endpoints, auto-propagate trace-ids.
|
|
6
|
+
*
|
|
7
|
+
* .note = the trace-id propagates lambda to lambda, via the `{ event, trail }` wrapper
|
|
8
|
+
* `askLambdaEndpoint` sends. it does not cross an http or a queue boundary — those
|
|
9
|
+
* triggers mint a fresh `exid` per invoke (`domain.terms/trail.md`)
|
|
6
10
|
*/
|
|
7
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.runLambdaEndpoint = exports.isLambdaEndpointErrorEnvelopeContemp = exports.isLambdaEndpointErrorEnvelopeAncient = exports.asLambdaEndpointErrorEnvelopeContemp = exports.asLambdaEndpointErrorEnvelopeAncient = exports.asLambdaEndpointOutput = exports.asLambdaContext = exports.getOneLambdaContract = exports.getAllLambdaFunctionsByPrefix = exports.getAllLambdaContracts = exports.genServiceSdk = exports.getValidatedOutput = exports.getValidatedInput = exports.genZodOutputValidationMiddleware = exports.genTrailMiddleware = exports.genIoLoggerMiddleware = exports.genIntrospectionMiddleware = exports.genInternalServiceErrorMiddleware = exports.genConstraintErrorMiddleware = exports.asContextTrailed = exports.genZodEventValidationMiddleware = exports.
|
|
12
|
+
exports.runLambdaEndpoint = exports.isLambdaEndpointErrorEnvelopeContemp = exports.isLambdaEndpointErrorEnvelopeAncient = exports.asLambdaEndpointErrorEnvelopeContemp = exports.asLambdaEndpointErrorEnvelopeAncient = exports.asLambdaEndpointOutput = exports.asLambdaContext = exports.getOneLambdaContract = exports.getAllLambdaFunctionsByPrefix = exports.getAllLambdaContracts = exports.genServiceSdk = exports.getValidatedOutput = exports.getValidatedInput = exports.genZodOutputValidationMiddleware = exports.genTrailMiddleware = exports.genIoLoggerMiddleware = exports.genIntrospectionMiddleware = exports.genInternalServiceErrorMiddleware = exports.genConstraintErrorMiddleware = exports.asContextTrailed = exports.genZodEventValidationMiddleware = exports.genZodInputValidationMiddleware = exports.genContentTypeCoherenceMiddleware = exports.genApiGatewayRequestEventNormalizationMiddleware = exports.isApiGatewayResponse = exports.asApiGatewayResponseSchema = exports.genLambdaEndpoint = exports.asLambdaEvent = exports.asLambdaEndpoint = exports.getAskLambdaCacheKey = exports.asCacheWithoutSet = exports.askLambdaEndpoint = exports.LambdaServiceNotFoundError = exports.LambdaIntrospectionNotSupportedError = exports.LambdaIntrospectionBlockedError = exports.LambdaFunctionNotFoundError = exports.LambdaEndpointError = exports.LambdaEndpoint = exports.LambdaDomainObjectRefUnbindableError = exports.LambdaDomainObjectNotCapturableError = exports.LambdaCredentialsAbsentError = exports.HttpStatusCode = exports.GeneratedFile = exports.delLambdaSdks = exports.BadRequestError = void 0;
|
|
9
13
|
// re-export from helpful-errors for convenience
|
|
10
14
|
var helpful_errors_1 = require("helpful-errors");
|
|
11
15
|
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return helpful_errors_1.BadRequestError; } });
|
|
@@ -53,28 +57,30 @@ Object.defineProperty(exports, "asLambdaEndpoint", { enumerable: true, get: func
|
|
|
53
57
|
// test utils — the event source axis (construct the envelope a source delivers)
|
|
54
58
|
var asLambdaEvent_1 = require("./domain.operations/asLambdaEvent/asLambdaEvent");
|
|
55
59
|
Object.defineProperty(exports, "asLambdaEvent", { enumerable: true, get: function () { return asLambdaEvent_1.asLambdaEvent; } });
|
|
60
|
+
/**
|
|
61
|
+
* .what = the `genLambdaEndpoint` family —
|
|
62
|
+
* `{ forAsk, forApiGateway, forSqs: { perRecord, perBatch } }`
|
|
63
|
+
* .why = no variant is exported bare beside it, so autocomplete enumerates the family
|
|
64
|
+
* (`rule.forbid.unqualified-variant-exports`)
|
|
65
|
+
*/
|
|
66
|
+
var genLambdaEndpoint_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint");
|
|
67
|
+
Object.defineProperty(exports, "genLambdaEndpoint", { enumerable: true, get: function () { return genLambdaEndpoint_1.genLambdaEndpoint; } });
|
|
56
68
|
var asApiGatewayResponseSchema_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema");
|
|
57
69
|
Object.defineProperty(exports, "asApiGatewayResponseSchema", { enumerable: true, get: function () { return asApiGatewayResponseSchema_1.asApiGatewayResponseSchema; } });
|
|
58
|
-
var genLambdaEndpoint_forApiGateway_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway");
|
|
59
|
-
Object.defineProperty(exports, "forApiGateway", { enumerable: true, get: function () { return genLambdaEndpoint_forApiGateway_1.forApiGateway; } });
|
|
60
70
|
var isApiGatewayResponse_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse");
|
|
61
71
|
Object.defineProperty(exports, "isApiGatewayResponse", { enumerable: true, get: function () { return isApiGatewayResponse_1.isApiGatewayResponse; } });
|
|
62
|
-
var
|
|
63
|
-
Object.defineProperty(exports, "
|
|
72
|
+
var genApiGatewayRequestEventNormalizationMiddleware_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayRequestEventNormalizationMiddleware");
|
|
73
|
+
Object.defineProperty(exports, "genApiGatewayRequestEventNormalizationMiddleware", { enumerable: true, get: function () { return genApiGatewayRequestEventNormalizationMiddleware_1.genApiGatewayRequestEventNormalizationMiddleware; } });
|
|
64
74
|
var genContentTypeCoherenceMiddleware_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware");
|
|
65
75
|
Object.defineProperty(exports, "genContentTypeCoherenceMiddleware", { enumerable: true, get: function () { return genContentTypeCoherenceMiddleware_1.genContentTypeCoherenceMiddleware; } });
|
|
66
|
-
var
|
|
67
|
-
Object.defineProperty(exports, "
|
|
68
|
-
var
|
|
69
|
-
Object.defineProperty(exports, "genLambdaEndpoint", { enumerable: true, get: function () { return genLambdaEndpoint_forAskEndpoint_1.genLambdaEndpoint; } });
|
|
70
|
-
var genZodEventValidationMiddleware_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware");
|
|
76
|
+
var genZodInputValidationMiddleware_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware");
|
|
77
|
+
Object.defineProperty(exports, "genZodInputValidationMiddleware", { enumerable: true, get: function () { return genZodInputValidationMiddleware_1.genZodInputValidationMiddleware; } });
|
|
78
|
+
var genZodEventValidationMiddleware_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware");
|
|
71
79
|
Object.defineProperty(exports, "genZodEventValidationMiddleware", { enumerable: true, get: function () { return genZodEventValidationMiddleware_1.genZodEventValidationMiddleware; } });
|
|
72
80
|
/**
|
|
73
81
|
* .what = the shared `request.context` reader every exported middleware uses
|
|
74
|
-
* .why = it
|
|
75
|
-
*
|
|
76
|
-
* otherwise restate that cast — the exact sprawl this reader exists to retire
|
|
77
|
-
* (rule.forbid.as-cast)
|
|
82
|
+
* .why = it holds the one cast to the trail fields this sdk writes, so a consumer who authors a
|
|
83
|
+
* peer middleware need not restate it (rule.forbid.as-cast)
|
|
78
84
|
*/
|
|
79
85
|
var asContextTrailed_1 = require("./domain.operations/genLambdaEndpoint/middleware/asContextTrailed");
|
|
80
86
|
Object.defineProperty(exports, "asContextTrailed", { enumerable: true, get: function () { return asContextTrailed_1.asContextTrailed; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,gDAAgD;AAChD,iDAAiD;AAAxC,iHAAA,eAAe,OAAA;AAQxB;;;;;GAKG;AACH,kEAAkE;AAAzD,6GAAA,aAAa,OAAA;AAWtB,gEAA+D;AAAtD,8GAAA,aAAa,OAAA;AACtB,kEAAiE;AAAxD,gHAAA,cAAc,OAAA;AACvB,8FAA6F;AAApF,4IAAA,4BAA4B,OAAA;AACrC,8GAA6G;AAApG,4JAAA,oCAAoC,OAAA;AAC7C,8GAA6G;AAApG,4JAAA,oCAAoC,OAAA;AAC7C,kEAAiE;AAAxD,gHAAA,cAAc,OAAA;AAEvB,4EAA2E;AAAlE,0HAAA,mBAAmB,OAAA;AAE5B,4BAA4B;AAC5B,4FAA2F;AAAlF,0IAAA,2BAA2B,OAAA;AACpC,oGAAmG;AAA1F,kJAAA,+BAA+B,OAAA;AACxC,8GAA6G;AAApG,4JAAA,oCAAoC,OAAA;AAC7C,0FAAyF;AAAhF,wIAAA,0BAA0B,OAAA;AAKnC,oBAAoB;AACpB,6FAA4F;AAAnF,sHAAA,iBAAiB,OAAA;AAC1B,mGAAkG;AAAzF,sHAAA,iBAAiB,OAAA;AAC1B,yGAAwG;AAA/F,4HAAA,oBAAoB,OAAA;AAC7B,eAAe;AACf,0FAAyF;AAAhF,oHAAA,gBAAgB,OAAA;AACzB,gFAAgF;AAChF,iFAAgF;AAAvE,8GAAA,aAAa,OAAA;AACtB;;;;;GAKG;AACH,6FAA4F;AAAnF,sHAAA,iBAAiB,OAAA;AAO1B,+IAA8I;AAArI,wIAAA,0BAA0B,OAAA;AAMnC,mIAAkI;AAAzH,4HAAA,oBAAoB,OAAA;AAC7B,sMAAqM;AAA5L,oLAAA,gDAAgD,OAAA;AACzD,wKAAuK;AAA9J,sJAAA,iCAAiC,OAAA;AAC1C,oKAAmK;AAA1J,kJAAA,+BAA+B,OAAA;AASxC,6JAA4J;AAAnJ,kJAAA,+BAA+B,OAAA;AAqBxC;;;;GAIG;AACH,sGAG2E;AAFzE,oHAAA,gBAAgB,OAAA;AAGlB,8HAA6H;AAApH,4IAAA,4BAA4B,OAAA;AACrC,wIAAuI;AAA9H,sJAAA,iCAAiC,OAAA;AAC1C,0HAAyH;AAAhH,wIAAA,0BAA0B,OAAA;AACnC,gHAA+G;AAAtG,8HAAA,qBAAqB,OAAA;AAC9B,gCAAgC;AAChC,0GAAyG;AAAhG,wHAAA,kBAAkB,OAAA;AAC3B,sIAAqI;AAA5H,oJAAA,gCAAgC,OAAA;AASzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wGAAuG;AAA9F,sHAAA,iBAAiB,OAAA;AAC1B,0GAG6E;AAF3E,wHAAA,kBAAkB,OAAA;AAcpB,8DAA8D;AAC9D,iFAAgF;AAAvE,8GAAA,aAAa,OAAA;AACtB,0CAA0C;AAC1C,yGAIyE;AADvE,8HAAA,qBAAqB,OAAA;AAEvB,wIAAuI;AAA9H,8IAAA,6BAA6B,OAAA;AACtC,sGAIuE;AADrE,4HAAA,oBAAoB,OAAA;AAEtB,gFAAgF;AAChF,iGAAgG;AAAvF,kHAAA,eAAe,OAAA;AACxB,8EAA8E;AAC9E,yEAAyE;AACzE,+EAA+E;AAC/E,4EAA4E;AAC5E,4CAA4C;AAC5C,+GAA8G;AAArG,gIAAA,sBAAsB,OAAA;AAC/B,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAC9E,0CAA0C;AAC1C,6HAKqF;AAJnF,qJAAA,oCAAoC,OAAA;AACpC,qJAAA,oCAAoC,OAAA;AACpC,qJAAA,oCAAoC,OAAA;AACpC,qJAAA,oCAAoC,OAAA;AAMtC,6FAA4F;AAAnF,sHAAA,iBAAiB,OAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "sdk-aws-lambda",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "a simple and opinionated sdk for aws lambda. define endpoints, ask endpoints, auto-propagate trace-ids.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.7.1",
|
|
6
6
|
"repository": "ehmpathy/sdk-aws-lambda",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/sdk-aws-lambda",
|
|
8
8
|
"keywords": [
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"sdk-environment": "0.1.5",
|
|
74
74
|
"sdk-logs": "0.9.0",
|
|
75
75
|
"simple-in-memory-cache": "0.4.0",
|
|
76
|
-
"type-fns": "1.21.
|
|
76
|
+
"type-fns": "1.21.5",
|
|
77
77
|
"with-simple-cache": "0.15.3",
|
|
78
78
|
"yaml": "2.9.0",
|
|
79
79
|
"zod": "4.4.3"
|
|
@@ -100,14 +100,16 @@
|
|
|
100
100
|
"esbuild": "0.28.1",
|
|
101
101
|
"esbuild-register": "3.6.0",
|
|
102
102
|
"husky": "8.0.3",
|
|
103
|
+
"iso-time": "1.11.7",
|
|
103
104
|
"jest": "30.2.0",
|
|
104
|
-
"rhachet": "1.
|
|
105
|
+
"rhachet": "1.48.1",
|
|
105
106
|
"rhachet-brains-anthropic": "0.4.3",
|
|
106
|
-
"rhachet-brains-fireworksai": "0.
|
|
107
|
+
"rhachet-brains-fireworksai": "0.2.3",
|
|
108
|
+
"rhachet-brains-openrouter": "0.1.1",
|
|
107
109
|
"rhachet-brains-xai": "0.3.3",
|
|
108
|
-
"rhachet-roles-bhrain": "0.
|
|
110
|
+
"rhachet-roles-bhrain": "0.38.0",
|
|
109
111
|
"rhachet-roles-bhuild": "0.21.36",
|
|
110
|
-
"rhachet-roles-ehmpathy": "1.39.
|
|
112
|
+
"rhachet-roles-ehmpathy": "1.39.2",
|
|
111
113
|
"rhachet-roles-rhachet": "0.1.7",
|
|
112
114
|
"test-fns": "1.15.8",
|
|
113
115
|
"tsc-alias": "1.8.10",
|