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,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setEventFrozen = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* .what = freezes a value and every object it reaches, in place
|
|
6
|
+
* .why = `Object.freeze` alone is shallow, so it would leave `event.headers` writable — and
|
|
7
|
+
* `headers` is exactly the object `@middy/http-cors` reads in its `after` hook
|
|
8
|
+
* (`@middy/http-cors/index.js:83`), after the handler has returned
|
|
9
|
+
*
|
|
10
|
+
* .why not `withImmute` = `domain-objects` ships a recursive helper whose name reads as this
|
|
11
|
+
* mechanism and is not it. measured in its dist (`withImmute.js:9-22,27-31`,
|
|
12
|
+
* domain-objects@0.33.0): it adds a `.clone()` — an affordance rather than an enforcement,
|
|
13
|
+
* so a write still succeeds — and it applies only where `isOfDomainObject(value)` holds,
|
|
14
|
+
* so on this plain-interface envelope it is a total no-op
|
|
15
|
+
*
|
|
16
|
+
* .note = in place, deliberately. a defensive copy would remove the same hazard and destroy the
|
|
17
|
+
* projection: `headers === event.headers` would stop to hold, and the bag could drift
|
|
18
|
+
* from the envelope it claims to project (`domain.terms/event.md`)
|
|
19
|
+
*/
|
|
20
|
+
const setFrozenDeep = (value, seen) => {
|
|
21
|
+
if (value === null || typeof value !== 'object')
|
|
22
|
+
return;
|
|
23
|
+
if (seen.has(value))
|
|
24
|
+
return;
|
|
25
|
+
seen.add(value);
|
|
26
|
+
Object.freeze(value);
|
|
27
|
+
// recurse over the OWN values only; a prototype belongs to whoever declared it
|
|
28
|
+
for (const nested of Object.values(value))
|
|
29
|
+
setFrozenDeep(nested, seen);
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* .what = seals the envelope before `invoke` receives it
|
|
33
|
+
* .why = the envelope outlives the handler's turn, so a write through it corrupts a value
|
|
34
|
+
* somebody else reads after `invoke` returns — with no type error and no throw. the freeze
|
|
35
|
+
* makes that unrepresentable
|
|
36
|
+
*
|
|
37
|
+
* .why every family freezes, with no exception = the membership rule is the hand-off, never the
|
|
38
|
+
* reader set. who reads the envelope after `invoke` differs per family — a vendor for
|
|
39
|
+
* `forApiGateway` (`@middy/http-cors` and `…response-serializer`, in their `after` hooks),
|
|
40
|
+
* the sdk itself for `forSqs.perBatch` (`idsInBatch` is built from `decoded.records` after
|
|
41
|
+
* `invoke`), and neither for `forSqs.perRecord` or `forAsk`. an empty column is a
|
|
42
|
+
* property of today, so a rule keyed to one expires silently the first commit that adds a
|
|
43
|
+
* post-invoke read (`rule.require.frozen-invoke-inputs`)
|
|
44
|
+
*
|
|
45
|
+
* .why the cost is paid on purpose = `FrozenDeep<TInput>` makes `event` unassignable to every
|
|
46
|
+
* mutable parameter a handler forwards it to, so a handler must declare its sinks
|
|
47
|
+
* readonly. a guarantee that holds on three variants of four is a trap for whoever moves
|
|
48
|
+
* between them
|
|
49
|
+
*
|
|
50
|
+
* .where = the family root rather than inside `forApiGateway`, because two variants of one family
|
|
51
|
+
* reach for it. lifted on the second use (`rule.prefer.most-common-denominator`)
|
|
52
|
+
*
|
|
53
|
+
* .note = the projections freeze with it, by design: `headers`, `payload`, and `records` are the
|
|
54
|
+
* envelope's own slots, so a handler mutates none (`domain.terms/event.md`)
|
|
55
|
+
* .note = `forSqs.perBatch`'s harm is the sharpest, and `[case17]` walks it end to end: a handler
|
|
56
|
+
* that forges `event.records[n].id` would rewrite the set the unknown-id guard checks
|
|
57
|
+
* against, so the guard passes and sqs is answered with an `itemIdentifier` it cannot
|
|
58
|
+
* match — the message the author meant to save is deleted, on a successful invocation
|
|
59
|
+
*
|
|
60
|
+
* .why a `WeakSet` = an envelope and its `_.raw` share sub-objects, so each is reachable by two
|
|
61
|
+
* paths and would otherwise be walked twice. measured in both families:
|
|
62
|
+
*
|
|
63
|
+
* apiGateway -> `queryStringParameters` and `pathParameters` pass by reference
|
|
64
|
+
* (`asApiGatewayRequestEventUnified.ts:68-69`)
|
|
65
|
+
* sqs -> `wire.Records[n]` is reachable as `event._.raw.Records[n]` and as
|
|
66
|
+
* `event.records[n]._.raw` (`asSqsEventDecoded.ts:37`,
|
|
67
|
+
* `asSqsRecordDecoded.ts:94`)
|
|
68
|
+
*
|
|
69
|
+
* it is not a cycle guard. no cycle is reachable from this event — `requestContext` is an
|
|
70
|
+
* explicit four-field copy of primitives and `headers` is a new object — though the set
|
|
71
|
+
* would terminate one a later author introduced
|
|
72
|
+
*
|
|
73
|
+
* .note = a frozen write throws in strict mode and no-ops in sloppy mode. every module this sdk
|
|
74
|
+
* ships is an es module, which is strict by construction, so the throw is the behavior a
|
|
75
|
+
* consumer meets (ecma-262 §11.2.2)
|
|
76
|
+
* .note = the throw's message is terse — node raises a bare `TypeError: Cannot assign to read
|
|
77
|
+
* only property …`, which names no cause and no remedy. `Object.freeze` accepts no
|
|
78
|
+
* message, and the only mechanism that could supply one is a `Proxy` — a different
|
|
79
|
+
* object, so `headers === event.headers` would stop to hold. the remedy is prevention
|
|
80
|
+
* instead: `FrozenDeep` refuses the write at compile time, so a type-checked consumer
|
|
81
|
+
* never reaches the message (`rule.prefer.prevent-over-correct`)
|
|
82
|
+
*
|
|
83
|
+
* .why it returns = the same reference, narrowed to `FrozenDeep`. it still freezes in place — the
|
|
84
|
+
* return is the type half of one act, so a caller receives the guarantee from the step
|
|
85
|
+
* that establishes it rather than asserts it by hand at the hand-off
|
|
86
|
+
*/
|
|
87
|
+
const setEventFrozen = (input) => {
|
|
88
|
+
setFrozenDeep(input.event, new WeakSet());
|
|
89
|
+
/**
|
|
90
|
+
* .why the cast = `FrozenDeep<TEvent>` is a conditional type, so on an unresolved generic
|
|
91
|
+
* typescript defers it and cannot prove `TEvent` satisfies it — a limit of the checker,
|
|
92
|
+
* never a gap in the claim. the line above is the proof, and it runs first
|
|
93
|
+
*
|
|
94
|
+
* .why here = this is the one named transformer whose whole job is the narrowing, so the
|
|
95
|
+
* assertion sits at the single seam that earns it rather than at every call site
|
|
96
|
+
* (`rule.forbid.as-cast` — an `as` at a boundary, documented, with its removal named)
|
|
97
|
+
*
|
|
98
|
+
* .removal = drops if typescript ever proves a homomorphic mapped type against its own input
|
|
99
|
+
*/
|
|
100
|
+
return input.event;
|
|
101
|
+
};
|
|
102
|
+
exports.setEventFrozen = setEventFrozen;
|
|
103
|
+
//# sourceMappingURL=setEventFrozen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setEventFrozen.js","sourceRoot":"","sources":["../../../src/domain.operations/genLambdaEndpoint/setEventFrozen.ts"],"names":[],"mappings":";;;AAwBA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,aAAa,GAAG,CAAC,KAAc,EAAE,IAAqB,EAAQ,EAAE;IACpE,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO;IACxD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO;IAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEhB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErB,+EAA+E;IAC/E,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACI,MAAM,cAAc,GAAG,CAAS,KAEtC,EAAsB,EAAE;IACvB,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IAE1C;;;;;;;;;;OAUG;IACH,OAAO,KAAK,CAAC,KAA2B,CAAC;AAC3C,CAAC,CAAC;AAjBW,QAAA,cAAc,kBAiBzB"}
|
|
@@ -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,6 +2,10 @@
|
|
|
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';
|
|
7
11
|
/**
|
|
@@ -11,9 +15,9 @@ export { BadRequestError } from 'helpful-errors';
|
|
|
11
15
|
* library that makes process-lifetime state owes the caller a way to release it
|
|
12
16
|
*/
|
|
13
17
|
export { delLambdaSdks } from './access/sdks/lambda/genLambdaSdk';
|
|
14
|
-
export type {
|
|
18
|
+
export type { ApiGatewayRequestEventOnwire } from './domain.objects/ApiGatewayRequestEventOnwire';
|
|
15
19
|
export type { ApiGatewayResponse } from './domain.objects/ApiGatewayResponse';
|
|
16
|
-
export type {
|
|
20
|
+
export type { ApiGatewayResponseOnwire } from './domain.objects/ApiGatewayResponseOnwire';
|
|
17
21
|
export type { ContextAwsLambdaCaller } from './domain.objects/ContextAwsLambdaCaller';
|
|
18
22
|
export type { ContextAwsLambdaServer, EnvAccess, EnvConfig, } from './domain.objects/ContextAwsLambdaServer';
|
|
19
23
|
export { GeneratedFile } from './domain.objects/GeneratedFile';
|
|
@@ -35,23 +39,36 @@ export { asCacheWithoutSet } from './domain.operations/askLambdaEndpoint/cache/a
|
|
|
35
39
|
export { getAskLambdaCacheKey } from './domain.operations/askLambdaEndpoint/cache/getAskLambdaCacheKey';
|
|
36
40
|
export { asLambdaEndpoint } from './domain.operations/asLambdaEndpoint/asLambdaEndpoint';
|
|
37
41
|
export { asLambdaEvent } from './domain.operations/asLambdaEvent/asLambdaEvent';
|
|
42
|
+
/**
|
|
43
|
+
* .what = the `genLambdaEndpoint` family —
|
|
44
|
+
* `{ forAsk, forApiGateway, forSqs: { perRecord, perBatch } }`
|
|
45
|
+
* .why = no variant is exported bare beside it, so autocomplete enumerates the family
|
|
46
|
+
* (`rule.forbid.unqualified-variant-exports`)
|
|
47
|
+
*/
|
|
48
|
+
export { genLambdaEndpoint } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint';
|
|
49
|
+
export type { ApiGatewayHeadersDeclared, ApiGatewayHeadersMerged, ApiGatewayHeadersOnwire, ApiGatewayRequestEventUnified, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/ApiGatewayRequestEventUnified';
|
|
38
50
|
export { asApiGatewayResponseSchema } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema';
|
|
39
51
|
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
52
|
export { isApiGatewayResponse } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse';
|
|
42
|
-
export {
|
|
53
|
+
export { genApiGatewayRequestEventNormalizationMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayRequestEventNormalizationMiddleware';
|
|
43
54
|
export { genContentTypeCoherenceMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware';
|
|
44
|
-
export {
|
|
45
|
-
export type {
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
export { genZodInputValidationMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodInputValidationMiddleware';
|
|
56
|
+
export type { EndpointOperation, FlatPayload, GenLambdaEndpointContext, GenLambdaEndpointInput, LambdaHandlerInput, WrappedPayload, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/genLambdaEndpoint.forAsk';
|
|
57
|
+
export { genZodEventValidationMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAsk/middleware/genZodEventValidationMiddleware';
|
|
58
|
+
/**
|
|
59
|
+
* .what = the `forSqs` sub-family's types, through `SqsEventDecoded`
|
|
60
|
+
* .why = each is reachable from `ForSqsPerRecordInput` / `ForSqsPerBatchInput`, so a consumer
|
|
61
|
+
* must be able to name it
|
|
62
|
+
* .note = the chain's own operations (`asSqsEventDecoded`, `setSqsRecordValidated`, …) stay
|
|
63
|
+
* unexported, as do the api-gateway peers
|
|
64
|
+
*/
|
|
65
|
+
export type { ForSqsPerBatchInput, SqsRecordSuccessRef, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perBatch';
|
|
66
|
+
export type { ForSqsPerRecordInput } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/genLambdaEndpoint.forSqs.perRecord';
|
|
67
|
+
export type { SqsEventDecoded, SqsHeadersDeclared, SqsHeadersMerged, SqsHeadersOnwire, SqsRecordDecoded, SqsRecordDecodedShape, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forSqs/SqsEventDecoded';
|
|
49
68
|
/**
|
|
50
69
|
* .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)
|
|
70
|
+
* .why = it holds the one cast to the trail fields this sdk writes, so a consumer who authors a
|
|
71
|
+
* peer middleware need not restate it (rule.forbid.as-cast)
|
|
55
72
|
*/
|
|
56
73
|
export { asContextTrailed, type ContextTrailed, } from './domain.operations/genLambdaEndpoint/middleware/asContextTrailed';
|
|
57
74
|
export { genConstraintErrorMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware';
|
|
@@ -62,9 +79,7 @@ export { genTrailMiddleware } from './domain.operations/genLambdaEndpoint/middle
|
|
|
62
79
|
export { genZodOutputValidationMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware';
|
|
63
80
|
/**
|
|
64
81
|
* .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)
|
|
82
|
+
* .why = a public middleware's parameter types must be nameable by a consumer
|
|
68
83
|
*/
|
|
69
84
|
export type { LambdaEndpointErrorResponseBodyAncient, LambdaEndpointErrorResponseBodyContemp, } from './domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody';
|
|
70
85
|
/**
|
|
@@ -93,12 +108,17 @@ export { getValidatedOutput, type OutputValidationErrorMetadata, } from './domai
|
|
|
93
108
|
export type { ValidationErrorMetadata } from './domain.operations/genLambdaEndpoint/middleware/getValidationError';
|
|
94
109
|
export type { ZodIssueSummary } from './domain.operations/genLambdaEndpoint/middleware/getZodIssuesSummary';
|
|
95
110
|
/**
|
|
111
|
+
* .what = types reachable from the public `ForApiGatewayInput` signature
|
|
112
|
+
* .why = a consumer who declares a handler apart from the call site must be able to name them
|
|
113
|
+
*/
|
|
114
|
+
export type { FrozenDeep } from './domain.operations/genLambdaEndpoint/setEventFrozen';
|
|
115
|
+
/**
|
|
116
|
+
* .what = the `logTranslate` config type
|
|
96
117
|
* .note = `TranslateLog` is public because `logTranslate` accepts it, and it replaces the
|
|
97
118
|
* formerly-public `IoLogTranslate`. its three designed peers — `Translate<TShapes>`,
|
|
98
119
|
* `LambdaEndpointShapes`, `Translator<TFrom, TInto>` — are DELETED rather than
|
|
99
120
|
* 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
|
|
121
|
+
* zero consumers (rule.prefer.wet-over-dry)
|
|
102
122
|
*/
|
|
103
123
|
export type { TranslateLog } from './domain.operations/genLambdaEndpoint/TranslateLog';
|
|
104
124
|
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;AAExB;;;;;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;AAmBpB,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.0",
|
|
6
6
|
"repository": "ehmpathy/sdk-aws-lambda",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/sdk-aws-lambda",
|
|
8
8
|
"keywords": [
|
|
@@ -101,13 +101,13 @@
|
|
|
101
101
|
"esbuild-register": "3.6.0",
|
|
102
102
|
"husky": "8.0.3",
|
|
103
103
|
"jest": "30.2.0",
|
|
104
|
-
"rhachet": "1.
|
|
104
|
+
"rhachet": "1.48.0",
|
|
105
105
|
"rhachet-brains-anthropic": "0.4.3",
|
|
106
|
-
"rhachet-brains-fireworksai": "0.
|
|
106
|
+
"rhachet-brains-fireworksai": "0.2.3",
|
|
107
107
|
"rhachet-brains-xai": "0.3.3",
|
|
108
|
-
"rhachet-roles-bhrain": "0.37.
|
|
108
|
+
"rhachet-roles-bhrain": "0.37.2",
|
|
109
109
|
"rhachet-roles-bhuild": "0.21.36",
|
|
110
|
-
"rhachet-roles-ehmpathy": "1.39.
|
|
110
|
+
"rhachet-roles-ehmpathy": "1.39.1",
|
|
111
111
|
"rhachet-roles-rhachet": "0.1.7",
|
|
112
112
|
"test-fns": "1.15.8",
|
|
113
113
|
"tsc-alias": "1.8.10",
|