sdk-aws-lambda 0.3.0 → 0.4.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/access/sdks/lambda/genLambdaSdk.d.ts +8 -1
- package/dist/access/sdks/lambda/genLambdaSdk.js +57 -4
- package/dist/access/sdks/lambda/genLambdaSdk.js.map +1 -1
- package/dist/domain.objects/ApiGatewayRequestPayload.d.ts +12 -0
- package/dist/domain.objects/ApiGatewayRequestPayload.js +3 -0
- package/dist/domain.objects/ApiGatewayRequestPayload.js.map +1 -0
- package/dist/domain.objects/ApiGatewayResponse.d.ts +30 -0
- package/dist/domain.objects/ApiGatewayResponse.js +3 -0
- package/dist/domain.objects/ApiGatewayResponse.js.map +1 -0
- package/dist/domain.objects/ApiGatewayResponsePayload.d.ts +30 -0
- package/dist/domain.objects/ApiGatewayResponsePayload.js +3 -0
- package/dist/domain.objects/ApiGatewayResponsePayload.js.map +1 -0
- package/dist/domain.objects/HttpStatusCode.d.ts +1 -0
- package/dist/domain.objects/HttpStatusCode.js +1 -0
- package/dist/domain.objects/HttpStatusCode.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/TranslateLog.d.ts +29 -0
- package/dist/domain.operations/genLambdaEndpoint/TranslateLog.js +3 -0
- package/dist/domain.operations/genLambdaEndpoint/TranslateLog.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/asContextLogTrail.d.ts +29 -0
- package/dist/domain.operations/genLambdaEndpoint/asContextLogTrail.js +30 -0
- package/dist/domain.operations/genLambdaEndpoint/asContextLogTrail.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.d.ts +36 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js +3 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.d.ts +19 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js +24 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayload.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayloadJson.d.ts +26 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayloadJson.js +31 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponsePayloadJson.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.d.ts +33 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js +39 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.d.ts +27 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js +118 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asUnifiedApiGatewayEvent.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.d.ts +76 -36
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js +153 -45
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.d.ts +8 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js +34 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/getAllWirePayloadKeysFound.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.d.ts +19 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js +36 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.d.ts +7 -24
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.js +19 -103
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.d.ts +20 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.js +48 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.d.ts +16 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js +32 -0
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.d.ts +6 -22
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js +24 -18
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.d.ts +11 -2
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js +12 -2
- package/dist/domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/asContextTrailed.d.ts +37 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/asContextTrailed.js +24 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/asContextTrailed.js.map +1 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.d.ts +18 -10
- package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.js +20 -23
- package/dist/domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.d.ts +29 -6
- package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js +23 -28
- package/dist/domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.d.ts +16 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js +9 -13
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.d.ts +27 -6
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js +29 -4
- package/dist/domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js +12 -4
- package/dist/domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.d.ts +27 -2
- package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js +34 -13
- package/dist/domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware.js.map +1 -1
- package/dist/domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody.js +1 -0
- package/dist/domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody.js.map +1 -1
- package/dist/index.d.ts +40 -2
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/package.json +12 -11
- package/readme.md +50 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
* define endpoints, ask endpoints, auto-propagate trace-ids.
|
|
5
5
|
*/
|
|
6
6
|
export { BadRequestError } from 'helpful-errors';
|
|
7
|
+
/**
|
|
8
|
+
* .what = releases every LambdaClient this sdk memoized on the caller's behalf
|
|
9
|
+
* .why = `askLambdaEndpoint` findserts a client per region and holds it for the process, so
|
|
10
|
+
* its keep-alive agent can hold the event loop open in a cli or one-off command. a
|
|
11
|
+
* library that makes process-lifetime state owes the caller a way to release it
|
|
12
|
+
*/
|
|
13
|
+
export { delLambdaSdks } from './access/sdks/lambda/genLambdaSdk';
|
|
14
|
+
export type { ApiGatewayRequestPayload } from './domain.objects/ApiGatewayRequestPayload';
|
|
15
|
+
export type { ApiGatewayResponse } from './domain.objects/ApiGatewayResponse';
|
|
16
|
+
export type { ApiGatewayResponsePayload } from './domain.objects/ApiGatewayResponsePayload';
|
|
7
17
|
export type { ContextAwsLambdaCaller } from './domain.objects/ContextAwsLambdaCaller';
|
|
8
18
|
export type { ContextAwsLambdaServer, EnvAccess, EnvConfig, } from './domain.objects/ContextAwsLambdaServer';
|
|
9
19
|
export { GeneratedFile } from './domain.objects/GeneratedFile';
|
|
@@ -23,19 +33,47 @@ export { askLambdaEndpoint } from './domain.operations/askLambdaEndpoint/askLamb
|
|
|
23
33
|
export { asCacheWithoutSet } from './domain.operations/askLambdaEndpoint/cache/asCacheWithoutSet';
|
|
24
34
|
export { getAskLambdaCacheKey } from './domain.operations/askLambdaEndpoint/cache/getAskLambdaCacheKey';
|
|
25
35
|
export { asLambdaEndpoint } from './domain.operations/asLambdaEndpoint/asLambdaEndpoint';
|
|
36
|
+
export { asApiGatewayResponseSchema } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema';
|
|
26
37
|
export type { CorsConfig, ForApiGatewayContext, ForApiGatewayInput, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway';
|
|
27
38
|
export { forApiGateway } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway';
|
|
28
|
-
export
|
|
39
|
+
export { isApiGatewayResponse } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse';
|
|
29
40
|
export { genApiGatewayEventNormalizationMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware';
|
|
41
|
+
export { genContentTypeCoherenceMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware';
|
|
42
|
+
export { genZodBodyValidationMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware';
|
|
43
|
+
export type { UnifiedApiGatewayEvent } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/UnifiedApiGatewayEvent';
|
|
30
44
|
export type { EndpointOperation, FlatPayload, GenLambdaEndpointContext, GenLambdaEndpointInput, LambdaHandlerInput, WrappedPayload, } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint';
|
|
31
45
|
export { genLambdaEndpoint } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint';
|
|
32
46
|
export { genZodEventValidationMiddleware } from './domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware';
|
|
47
|
+
/**
|
|
48
|
+
* .what = the shared `request.context` reader every exported middleware uses
|
|
49
|
+
* .why = it centralizes the one cast that reaches the trail fields this sdk itself wrote onto
|
|
50
|
+
* the lambda context. a consumer who authors a PEER of the exported middlewares would
|
|
51
|
+
* otherwise restate that cast — the exact sprawl this reader exists to retire
|
|
52
|
+
* (rule.forbid.as-cast)
|
|
53
|
+
*/
|
|
54
|
+
export { asContextTrailed, type ContextTrailed, } from './domain.operations/genLambdaEndpoint/middleware/asContextTrailed';
|
|
33
55
|
export { genConstraintErrorMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware';
|
|
56
|
+
export { genInternalServiceErrorMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware';
|
|
34
57
|
export { genIntrospectionMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware';
|
|
35
|
-
export type { IoLogTranslate } from './domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware';
|
|
36
58
|
export { genIoLoggerMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware';
|
|
37
59
|
export { genTrailMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genTrailMiddleware';
|
|
38
60
|
export { genZodOutputValidationMiddleware } from './domain.operations/genLambdaEndpoint/middleware/genZodOutputValidationMiddleware';
|
|
61
|
+
/**
|
|
62
|
+
* .what = the two error-body shapes `genConstraintErrorMiddleware.asOutputAfter` receives
|
|
63
|
+
* .why = that middleware is public, so its OWN parameter type must be nameable by a consumer.
|
|
64
|
+
* an unexported parameter type forces an `any` or a hand-copied re-declaration at the
|
|
65
|
+
* public boundary (rule.forbid.as-cast)
|
|
66
|
+
*/
|
|
67
|
+
export type { LambdaEndpointErrorResponseBodyAncient, LambdaEndpointErrorResponseBodyContemp, } from './domain.operations/genLambdaEndpoint/middleware/getErrorResponseBody';
|
|
68
|
+
/**
|
|
69
|
+
* .note = `TranslateLog` is public because `logTranslate` accepts it, and it replaces the
|
|
70
|
+
* formerly-public `IoLogTranslate`. its three designed peers — `Translate<TShapes>`,
|
|
71
|
+
* `LambdaEndpointShapes`, `Translator<TFrom, TInto>` — are DELETED rather than
|
|
72
|
+
* unexported: no config field ever accepted a `Translate`, so all three would ship with
|
|
73
|
+
* zero consumers (rule.prefer.wet-over-dry). the design survives in `1.vision.yield.md`,
|
|
74
|
+
* so a later round restores a TERM from a record rather than a dead declaration
|
|
75
|
+
*/
|
|
76
|
+
export type { TranslateLog } from './domain.operations/genLambdaEndpoint/TranslateLog';
|
|
39
77
|
export { genServiceSdk } from './domain.operations/genServiceSdk/genServiceSdk';
|
|
40
78
|
export { type GetAllLambdaContractsContext, type GetAllLambdaContractsInput, getAllLambdaContracts, } from './domain.operations/getAllLambdaContracts/getAllLambdaContracts';
|
|
41
79
|
export { getAllLambdaFunctionsByPrefix } from './domain.operations/getAllLambdaContracts/lambdaFunction/getAllLambdaFunctionsByPrefix';
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,18 @@
|
|
|
5
5
|
* define endpoints, ask endpoints, auto-propagate trace-ids.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.getOneLambdaContract = exports.getAllLambdaFunctionsByPrefix = exports.getAllLambdaContracts = exports.genServiceSdk = exports.genZodOutputValidationMiddleware = exports.genTrailMiddleware = exports.genIoLoggerMiddleware = exports.genIntrospectionMiddleware = exports.genConstraintErrorMiddleware = exports.genZodEventValidationMiddleware = exports.genLambdaEndpoint = exports.genApiGatewayEventNormalizationMiddleware = exports.forApiGateway = 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.BadRequestError = void 0;
|
|
8
|
+
exports.getOneLambdaContract = exports.getAllLambdaFunctionsByPrefix = exports.getAllLambdaContracts = exports.genServiceSdk = exports.genZodOutputValidationMiddleware = exports.genTrailMiddleware = exports.genIoLoggerMiddleware = exports.genIntrospectionMiddleware = exports.genInternalServiceErrorMiddleware = exports.genConstraintErrorMiddleware = exports.asContextTrailed = exports.genZodEventValidationMiddleware = exports.genLambdaEndpoint = exports.genZodBodyValidationMiddleware = exports.genContentTypeCoherenceMiddleware = exports.genApiGatewayEventNormalizationMiddleware = exports.isApiGatewayResponse = exports.forApiGateway = exports.asApiGatewayResponseSchema = 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
9
|
// re-export from helpful-errors for convenience
|
|
10
10
|
var helpful_errors_1 = require("helpful-errors");
|
|
11
11
|
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return helpful_errors_1.BadRequestError; } });
|
|
12
|
+
/**
|
|
13
|
+
* .what = releases every LambdaClient this sdk memoized on the caller's behalf
|
|
14
|
+
* .why = `askLambdaEndpoint` findserts a client per region and holds it for the process, so
|
|
15
|
+
* its keep-alive agent can hold the event loop open in a cli or one-off command. a
|
|
16
|
+
* library that makes process-lifetime state owes the caller a way to release it
|
|
17
|
+
*/
|
|
18
|
+
var genLambdaSdk_1 = require("./access/sdks/lambda/genLambdaSdk");
|
|
19
|
+
Object.defineProperty(exports, "delLambdaSdks", { enumerable: true, get: function () { return genLambdaSdk_1.delLambdaSdks; } });
|
|
12
20
|
var GeneratedFile_1 = require("./domain.objects/GeneratedFile");
|
|
13
21
|
Object.defineProperty(exports, "GeneratedFile", { enumerable: true, get: function () { return GeneratedFile_1.GeneratedFile; } });
|
|
14
22
|
var HttpStatusCode_1 = require("./domain.objects/HttpStatusCode");
|
|
@@ -42,16 +50,35 @@ Object.defineProperty(exports, "getAskLambdaCacheKey", { enumerable: true, get:
|
|
|
42
50
|
// transformers
|
|
43
51
|
var asLambdaEndpoint_1 = require("./domain.operations/asLambdaEndpoint/asLambdaEndpoint");
|
|
44
52
|
Object.defineProperty(exports, "asLambdaEndpoint", { enumerable: true, get: function () { return asLambdaEndpoint_1.asLambdaEndpoint; } });
|
|
53
|
+
var asApiGatewayResponseSchema_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/asApiGatewayResponseSchema");
|
|
54
|
+
Object.defineProperty(exports, "asApiGatewayResponseSchema", { enumerable: true, get: function () { return asApiGatewayResponseSchema_1.asApiGatewayResponseSchema; } });
|
|
45
55
|
var genLambdaEndpoint_forApiGateway_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/genLambdaEndpoint.forApiGateway");
|
|
46
56
|
Object.defineProperty(exports, "forApiGateway", { enumerable: true, get: function () { return genLambdaEndpoint_forApiGateway_1.forApiGateway; } });
|
|
57
|
+
var isApiGatewayResponse_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/isApiGatewayResponse");
|
|
58
|
+
Object.defineProperty(exports, "isApiGatewayResponse", { enumerable: true, get: function () { return isApiGatewayResponse_1.isApiGatewayResponse; } });
|
|
47
59
|
var genApiGatewayEventNormalizationMiddleware_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genApiGatewayEventNormalizationMiddleware");
|
|
48
60
|
Object.defineProperty(exports, "genApiGatewayEventNormalizationMiddleware", { enumerable: true, get: function () { return genApiGatewayEventNormalizationMiddleware_1.genApiGatewayEventNormalizationMiddleware; } });
|
|
61
|
+
var genContentTypeCoherenceMiddleware_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genContentTypeCoherenceMiddleware");
|
|
62
|
+
Object.defineProperty(exports, "genContentTypeCoherenceMiddleware", { enumerable: true, get: function () { return genContentTypeCoherenceMiddleware_1.genContentTypeCoherenceMiddleware; } });
|
|
63
|
+
var genZodBodyValidationMiddleware_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forApiGateway/middleware/genZodBodyValidationMiddleware");
|
|
64
|
+
Object.defineProperty(exports, "genZodBodyValidationMiddleware", { enumerable: true, get: function () { return genZodBodyValidationMiddleware_1.genZodBodyValidationMiddleware; } });
|
|
49
65
|
var genLambdaEndpoint_forAskEndpoint_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/genLambdaEndpoint.forAskEndpoint");
|
|
50
66
|
Object.defineProperty(exports, "genLambdaEndpoint", { enumerable: true, get: function () { return genLambdaEndpoint_forAskEndpoint_1.genLambdaEndpoint; } });
|
|
51
67
|
var genZodEventValidationMiddleware_1 = require("./domain.operations/genLambdaEndpoint/genLambdaEndpoint.forAskEndpoint/middleware/genZodEventValidationMiddleware");
|
|
52
68
|
Object.defineProperty(exports, "genZodEventValidationMiddleware", { enumerable: true, get: function () { return genZodEventValidationMiddleware_1.genZodEventValidationMiddleware; } });
|
|
69
|
+
/**
|
|
70
|
+
* .what = the shared `request.context` reader every exported middleware uses
|
|
71
|
+
* .why = it centralizes the one cast that reaches the trail fields this sdk itself wrote onto
|
|
72
|
+
* the lambda context. a consumer who authors a PEER of the exported middlewares would
|
|
73
|
+
* otherwise restate that cast — the exact sprawl this reader exists to retire
|
|
74
|
+
* (rule.forbid.as-cast)
|
|
75
|
+
*/
|
|
76
|
+
var asContextTrailed_1 = require("./domain.operations/genLambdaEndpoint/middleware/asContextTrailed");
|
|
77
|
+
Object.defineProperty(exports, "asContextTrailed", { enumerable: true, get: function () { return asContextTrailed_1.asContextTrailed; } });
|
|
53
78
|
var genConstraintErrorMiddleware_1 = require("./domain.operations/genLambdaEndpoint/middleware/genConstraintErrorMiddleware");
|
|
54
79
|
Object.defineProperty(exports, "genConstraintErrorMiddleware", { enumerable: true, get: function () { return genConstraintErrorMiddleware_1.genConstraintErrorMiddleware; } });
|
|
80
|
+
var genInternalServiceErrorMiddleware_1 = require("./domain.operations/genLambdaEndpoint/middleware/genInternalServiceErrorMiddleware");
|
|
81
|
+
Object.defineProperty(exports, "genInternalServiceErrorMiddleware", { enumerable: true, get: function () { return genInternalServiceErrorMiddleware_1.genInternalServiceErrorMiddleware; } });
|
|
55
82
|
var genIntrospectionMiddleware_1 = require("./domain.operations/genLambdaEndpoint/middleware/genIntrospectionMiddleware");
|
|
56
83
|
Object.defineProperty(exports, "genIntrospectionMiddleware", { enumerable: true, get: function () { return genIntrospectionMiddleware_1.genIntrospectionMiddleware; } });
|
|
57
84
|
var genIoLoggerMiddleware_1 = require("./domain.operations/genLambdaEndpoint/middleware/genIoLoggerMiddleware");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gDAAgD;AAChD,iDAAiD;AAAxC,iHAAA,eAAe,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;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;AACvB,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,+IAA8I;AAArI,wIAAA,0BAA0B,OAAA;AAMnC,yJAAsI;AAA7H,gIAAA,aAAa,OAAA;AACtB,mIAAkI;AAAzH,4HAAA,oBAAoB,OAAA;AAC7B,wLAAuL;AAA9K,sKAAA,yCAAyC,OAAA;AAClD,wKAAuK;AAA9J,sJAAA,iCAAiC,OAAA;AAC1C,kKAAiK;AAAxJ,gJAAA,8BAA8B,OAAA;AAUvC,4JAA4I;AAAnI,qIAAA,iBAAiB,OAAA;AAC1B,qKAAoK;AAA3J,kJAAA,+BAA+B,OAAA;AACxC;;;;;;GAMG;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;AAoBzC,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"}
|
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.4.1",
|
|
6
6
|
"repository": "ehmpathy/sdk-aws-lambda",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/sdk-aws-lambda",
|
|
8
8
|
"keywords": [
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"test:lint:biome": "biome check --diagnostic-level=error",
|
|
46
46
|
"test:lint:biome:all": "biome check",
|
|
47
47
|
"test:lint": "npm run test:lint:biome && npm run test:lint:deps",
|
|
48
|
-
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([
|
|
49
|
-
"test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([
|
|
50
|
-
"test:acceptance:locally": "npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([
|
|
48
|
+
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=origin/main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
49
|
+
"test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=origin/main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
50
|
+
"test:acceptance:locally": "npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
51
51
|
"test": "npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally",
|
|
52
|
-
"test:acceptance": "npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([
|
|
52
|
+
"test:acceptance": "npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
|
|
53
53
|
"prepush": "npm run test && npm run build",
|
|
54
54
|
"prepublish": "npm run build",
|
|
55
55
|
"preversion": "npm run prepush",
|
|
@@ -73,6 +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.4",
|
|
76
77
|
"with-simple-cache": "0.15.3",
|
|
77
78
|
"zod": "4.4.3"
|
|
78
79
|
},
|
|
@@ -99,13 +100,13 @@
|
|
|
99
100
|
"esbuild-register": "3.6.0",
|
|
100
101
|
"husky": "8.0.3",
|
|
101
102
|
"jest": "30.2.0",
|
|
102
|
-
"rhachet": "1.
|
|
103
|
-
"rhachet-brains-anthropic": "0.4.
|
|
104
|
-
"rhachet-brains-fireworksai": "0.1.
|
|
103
|
+
"rhachet": "1.47.5",
|
|
104
|
+
"rhachet-brains-anthropic": "0.4.3",
|
|
105
|
+
"rhachet-brains-fireworksai": "0.1.7",
|
|
105
106
|
"rhachet-brains-xai": "0.3.3",
|
|
106
|
-
"rhachet-roles-bhrain": "0.
|
|
107
|
-
"rhachet-roles-bhuild": "0.21.
|
|
108
|
-
"rhachet-roles-ehmpathy": "1.38.
|
|
107
|
+
"rhachet-roles-bhrain": "0.37.0",
|
|
108
|
+
"rhachet-roles-bhuild": "0.21.36",
|
|
109
|
+
"rhachet-roles-ehmpathy": "1.38.12",
|
|
109
110
|
"rhachet-roles-rhachet": "0.1.7",
|
|
110
111
|
"test-fns": "1.15.8",
|
|
111
112
|
"tsc-alias": "1.8.10",
|
package/readme.md
CHANGED
|
@@ -99,11 +99,46 @@ const contracts = await getAllLambdaContracts(
|
|
|
99
99
|
// returns: { getUser: {...schema}, getSettings: {...schema} }
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
# the http wire response
|
|
103
|
+
|
|
104
|
+
`forApiGateway()` handlers own their **exact wire response** — any status, any headers, any body, or
|
|
105
|
+
none at all. return an `ApiGatewayResponse`, and it reaches the wire as written.
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import { forApiGateway, asApiGatewayResponseSchema } from 'sdk-aws-lambda';
|
|
109
|
+
|
|
110
|
+
export const handler = forApiGateway({
|
|
111
|
+
schema: {
|
|
112
|
+
input: z.any(), // a twilio form blob
|
|
113
|
+
output: asApiGatewayResponseSchema({ body: z.undefined() }),
|
|
114
|
+
},
|
|
115
|
+
invoke: async ({ event }) => ({ status: 204 }), // 204, no body
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
| return | wire |
|
|
120
|
+
|---|---|
|
|
121
|
+
| `{ body: x }` | 200 + json — the convenient default |
|
|
122
|
+
| `{ status: 204 }` | 204, no body, **no `content-type`** |
|
|
123
|
+
| `{ status: 308, headers: { Location } }` | a redirect |
|
|
124
|
+
| `{ headers: { 'Content-Type': 'text/xml' }, body: xml }` | your bytes, verbatim |
|
|
125
|
+
| `{}` | ⛔ a **compile error** — at least one key is required |
|
|
126
|
+
|
|
127
|
+
set a `Content-Type` yourself and the serializer stands aside, so xml/text reach the wire
|
|
128
|
+
byte-identical. omit it with a body and you get `application/json`.
|
|
129
|
+
|
|
130
|
+
### schema is required; `z.any()` is the opt-out
|
|
131
|
+
|
|
132
|
+
`schema.output` describes what `invoke` **returns** (the envelope), so
|
|
133
|
+
`asApiGatewayResponseSchema({ body })` wraps a body schema into it. a required field with a visible
|
|
134
|
+
opt-out keeps validation and introspection on one code path, and puts the choice where a reviewer can
|
|
135
|
+
see it.
|
|
136
|
+
|
|
102
137
|
# features
|
|
103
138
|
|
|
104
139
|
- **genLambdaEndpoint** — define lambda endpoints with validation, log capture, error classification
|
|
105
140
|
- `genLambdaEndpoint()` — direct invoke (default)
|
|
106
|
-
- `forApiGateway()` — http via api gateway
|
|
141
|
+
- `forApiGateway()` — http via api gateway, with full wire-response control (above)
|
|
107
142
|
- **askLambdaEndpoint** — ask another lambda with typed request/response, automatic trail propagation
|
|
108
143
|
- **trace-id propagation** — pass `log` and trail.exid auto-threads through the call chain
|
|
109
144
|
- **introspection** — expose json-schema via `{ introspect: 'schema' }` (prep only)
|
|
@@ -111,4 +146,17 @@ const contracts = await getAllLambdaContracts(
|
|
|
111
146
|
|
|
112
147
|
# docs
|
|
113
148
|
|
|
114
|
-
|
|
149
|
+
**this readme is the consumer doc.** the contract, the migration, and the live defects are all
|
|
150
|
+
above — you need read no further to use the package.
|
|
151
|
+
|
|
152
|
+
the links below are **internal design records**, kept for a maintainer who wants the reasons:
|
|
153
|
+
|
|
154
|
+
- ⚠️ they are **not in the npm tarball** (`"files": ["/dist"]`), so they open on github only
|
|
155
|
+
- ⚠️ they are process journals — fulcrum tables, review-round narration, references to briefs that
|
|
156
|
+
live outside this package. they read as a decision log, never as a guide
|
|
157
|
+
|
|
158
|
+
<!-- prettier-ignore -->
|
|
159
|
+
| record | holds |
|
|
160
|
+
|---|---|
|
|
161
|
+
| [the wire-response design](./.behavior/v2026_08_03.feat-apigateway-wire-response/1.vision.yield.md) | why the contract widened rather than grew a peer, its four named pipeline points, and each deferred defect with its clamp |
|
|
162
|
+
| [the endpoint vocabulary](./.behavior/v2026_05_08.rename/1.vision.yield.md) | how `LambdaEndpoint` and its slug were named |
|