@geekmidas/constructs 0.0.3 → 0.0.5
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/{AmazonApiGatewayEndpointAdaptor-D_Q_NTMT.cjs → AmazonApiGatewayEndpointAdaptor-BEzWkW5m.cjs} +32 -9
- package/dist/AmazonApiGatewayEndpointAdaptor-BEzWkW5m.cjs.map +1 -0
- package/dist/{AmazonApiGatewayEndpointAdaptor-DtzgQ9Vb.d.cts → AmazonApiGatewayEndpointAdaptor-BFhJ2Rpz.d.cts} +5 -2
- package/dist/{AmazonApiGatewayEndpointAdaptor-DNZLntHj.d.mts → AmazonApiGatewayEndpointAdaptor-BrB3RfbI.d.mts} +5 -2
- package/dist/{AmazonApiGatewayEndpointAdaptor-QzIAnWzS.mjs → AmazonApiGatewayEndpointAdaptor-CASfHEj9.mjs} +32 -9
- package/dist/AmazonApiGatewayEndpointAdaptor-CASfHEj9.mjs.map +1 -0
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-Gw-j61qM.d.cts → AmazonApiGatewayV1EndpointAdaptor-Bd-o8ese.d.cts} +3 -3
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-DbJa4cpU.d.mts → AmazonApiGatewayV1EndpointAdaptor-BtNXt0-4.d.mts} +3 -3
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-BF5bGWV1.mjs → AmazonApiGatewayV1EndpointAdaptor-RPnkGENb.mjs} +2 -2
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-BF5bGWV1.mjs.map → AmazonApiGatewayV1EndpointAdaptor-RPnkGENb.mjs.map} +1 -1
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-Bh4tckwd.cjs → AmazonApiGatewayV1EndpointAdaptor-l1df4rFt.cjs} +2 -2
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-Bh4tckwd.cjs.map → AmazonApiGatewayV1EndpointAdaptor-l1df4rFt.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-BOaOkLXF.mjs → AmazonApiGatewayV2EndpointAdaptor-C5Ctz7C_.mjs} +2 -2
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-BOaOkLXF.mjs.map → AmazonApiGatewayV2EndpointAdaptor-C5Ctz7C_.mjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-BlKn-KJ6.d.mts → AmazonApiGatewayV2EndpointAdaptor-DAJdtgek.d.mts} +3 -3
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-L4Ywv3Pk.cjs → AmazonApiGatewayV2EndpointAdaptor-DH9yJsC8.cjs} +2 -2
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-L4Ywv3Pk.cjs.map → AmazonApiGatewayV2EndpointAdaptor-DH9yJsC8.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-LUlpwmUW.d.cts → AmazonApiGatewayV2EndpointAdaptor-DX-Uci5w.d.cts} +3 -3
- package/dist/{Endpoint-D1nnEsBU.cjs → Endpoint-BVZJb4OR.cjs} +128 -4
- package/dist/Endpoint-BVZJb4OR.cjs.map +1 -0
- package/dist/{Endpoint-DYUjJdEs.d.mts → Endpoint-C7jPJzAH.d.mts} +115 -6
- package/dist/{Endpoint-DNlmybXV.mjs → Endpoint-DVEmKo6G.mjs} +123 -5
- package/dist/Endpoint-DVEmKo6G.mjs.map +1 -0
- package/dist/{Endpoint-C7z9YJHK.d.cts → Endpoint-XUMNAXYy.d.cts} +115 -6
- package/dist/{EndpointBuilder-CpjIMYb0.mjs → EndpointBuilder-Bhy91l_c.mjs} +2 -2
- package/dist/{EndpointBuilder-CpjIMYb0.mjs.map → EndpointBuilder-Bhy91l_c.mjs.map} +1 -1
- package/dist/{EndpointBuilder-B2iScUND.d.mts → EndpointBuilder-CFtWQhcv.d.mts} +2 -2
- package/dist/{EndpointBuilder-BhRd626m.cjs → EndpointBuilder-DDnqW7rT.cjs} +2 -2
- package/dist/{EndpointBuilder-BhRd626m.cjs.map → EndpointBuilder-DDnqW7rT.cjs.map} +1 -1
- package/dist/{EndpointBuilder-1fw103D6.d.cts → EndpointBuilder-t6fVEKBH.d.cts} +2 -2
- package/dist/{EndpointFactory-DLpEbLzL.mjs → EndpointFactory-CNz3Wa08.mjs} +4 -3
- package/dist/EndpointFactory-CNz3Wa08.mjs.map +1 -0
- package/dist/{EndpointFactory-ChmVHWim.cjs → EndpointFactory-Cw_6-53M.cjs} +4 -3
- package/dist/EndpointFactory-Cw_6-53M.cjs.map +1 -0
- package/dist/{EndpointFactory-D576BhaH.d.cts → EndpointFactory-DBRGrXAy.d.mts} +10 -10
- package/dist/{EndpointFactory-DZQpM-9K.d.mts → EndpointFactory-DInjHvFR.d.cts} +10 -10
- package/dist/{HonoEndpointAdaptor-01cH100U.d.mts → HonoEndpointAdaptor-BY2Ovj31.d.mts} +4 -4
- package/dist/{HonoEndpointAdaptor-6LERutxi.cjs → HonoEndpointAdaptor-BsGMcxYb.cjs} +23 -8
- package/dist/HonoEndpointAdaptor-BsGMcxYb.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-ua6mp3gt.d.cts → HonoEndpointAdaptor-OtKS5Dsd.d.cts} +4 -4
- package/dist/{HonoEndpointAdaptor-fs2928iO.mjs → HonoEndpointAdaptor-Y4AD3E9g.mjs} +23 -8
- package/dist/HonoEndpointAdaptor-Y4AD3E9g.mjs.map +1 -0
- package/dist/{Subscriber-G7EUI3yc.cjs → Subscriber-CSt7EOlT.cjs} +1 -1
- package/dist/{Subscriber-G7EUI3yc.cjs.map → Subscriber-CSt7EOlT.cjs.map} +1 -1
- package/dist/{Subscriber-BTwKnz3c.mjs → Subscriber-DkCDcTUL.mjs} +1 -1
- package/dist/{Subscriber-BTwKnz3c.mjs.map → Subscriber-DkCDcTUL.mjs.map} +1 -1
- package/dist/{SubscriberBuilder-C1me_972.mjs → SubscriberBuilder-Bn9Hyi28.mjs} +2 -2
- package/dist/{SubscriberBuilder-C1me_972.mjs.map → SubscriberBuilder-Bn9Hyi28.mjs.map} +1 -1
- package/dist/{SubscriberBuilder-C6iZvuDe.cjs → SubscriberBuilder-RsiOmnwq.cjs} +2 -2
- package/dist/{SubscriberBuilder-C6iZvuDe.cjs.map → SubscriberBuilder-RsiOmnwq.cjs.map} +1 -1
- package/dist/{TestEndpointAdaptor-B4SvJvK-.cjs → TestEndpointAdaptor-CbNeUT3Y.cjs} +20 -6
- package/dist/TestEndpointAdaptor-CbNeUT3Y.cjs.map +1 -0
- package/dist/{TestEndpointAdaptor-CelYsQi0.mjs → TestEndpointAdaptor-DD3aygPp.mjs} +20 -6
- package/dist/TestEndpointAdaptor-DD3aygPp.mjs.map +1 -0
- package/dist/{TestEndpointAdaptor-Da0ooGt2.d.mts → TestEndpointAdaptor-Db0cm1fb.d.mts} +3 -3
- package/dist/{TestEndpointAdaptor-CHcgyI3V.d.cts → TestEndpointAdaptor-v7A-7hTs.d.cts} +3 -3
- package/dist/adaptors/aws.cjs +4 -4
- package/dist/adaptors/aws.d.cts +5 -5
- package/dist/adaptors/aws.d.mts +4 -4
- package/dist/adaptors/aws.mjs +4 -4
- package/dist/adaptors/hono.cjs +3 -3
- package/dist/adaptors/hono.d.cts +3 -3
- package/dist/adaptors/hono.d.mts +2 -2
- package/dist/adaptors/hono.mjs +3 -3
- package/dist/adaptors/testing.cjs +2 -2
- package/dist/adaptors/testing.d.cts +3 -3
- package/dist/adaptors/testing.d.mts +2 -2
- package/dist/adaptors/testing.mjs +2 -2
- package/dist/crons/Cron.d.cts +1 -1
- package/dist/crons/CronBuilder.d.cts +1 -1
- package/dist/crons/index.d.cts +5 -5
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.cjs +2 -2
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.cts +3 -3
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.mts +2 -2
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.mjs +2 -2
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.cjs +3 -3
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.cts +4 -4
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.mts +3 -3
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.mjs +3 -3
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.cjs +3 -3
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.cts +4 -4
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.mts +3 -3
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.mjs +3 -3
- package/dist/endpoints/Endpoint.cjs +2 -1
- package/dist/endpoints/Endpoint.d.cts +3 -3
- package/dist/endpoints/Endpoint.d.mts +2 -2
- package/dist/endpoints/Endpoint.mjs +2 -2
- package/dist/endpoints/EndpointBuilder.cjs +2 -2
- package/dist/endpoints/EndpointBuilder.d.cts +3 -3
- package/dist/endpoints/EndpointBuilder.d.mts +2 -2
- package/dist/endpoints/EndpointBuilder.mjs +2 -2
- package/dist/endpoints/EndpointFactory.cjs +3 -3
- package/dist/endpoints/EndpointFactory.d.cts +4 -4
- package/dist/endpoints/EndpointFactory.d.mts +3 -3
- package/dist/endpoints/EndpointFactory.mjs +3 -3
- package/dist/endpoints/HonoEndpointAdaptor.cjs +3 -3
- package/dist/endpoints/HonoEndpointAdaptor.d.cts +3 -3
- package/dist/endpoints/HonoEndpointAdaptor.d.mts +2 -2
- package/dist/endpoints/HonoEndpointAdaptor.mjs +3 -3
- package/dist/endpoints/TestEndpointAdaptor.cjs +2 -2
- package/dist/endpoints/TestEndpointAdaptor.d.cts +3 -3
- package/dist/endpoints/TestEndpointAdaptor.d.mts +2 -2
- package/dist/endpoints/TestEndpointAdaptor.mjs +2 -2
- package/dist/endpoints/helpers.cjs +2 -2
- package/dist/endpoints/helpers.d.cts +2 -2
- package/dist/endpoints/helpers.d.mts +1 -1
- package/dist/endpoints/helpers.mjs +2 -2
- package/dist/endpoints/index.cjs +3 -3
- package/dist/endpoints/index.cjs.map +1 -1
- package/dist/endpoints/index.d.cts +7 -7
- package/dist/endpoints/index.d.mts +6 -6
- package/dist/endpoints/index.mjs +3 -3
- package/dist/endpoints/index.mjs.map +1 -1
- package/dist/functions/index.d.cts +1 -1
- package/dist/{helpers-CjvCSIF5.cjs → helpers-BSzj2AiQ.cjs} +2 -2
- package/dist/{helpers-CjvCSIF5.cjs.map → helpers-BSzj2AiQ.cjs.map} +1 -1
- package/dist/{helpers-CP7A0U_s.mjs → helpers-C9WBx7ms.mjs} +2 -2
- package/dist/{helpers-CP7A0U_s.mjs.map → helpers-C9WBx7ms.mjs.map} +1 -1
- package/dist/index-BxApEwAF.d.cts +9 -0
- package/dist/subscribers/Subscriber.cjs +1 -1
- package/dist/subscribers/Subscriber.mjs +1 -1
- package/dist/subscribers/SubscriberBuilder.cjs +2 -2
- package/dist/subscribers/SubscriberBuilder.mjs +2 -2
- package/dist/subscribers/index.cjs +2 -2
- package/dist/subscribers/index.d.cts +2 -2
- package/dist/subscribers/index.d.mts +2 -2
- package/dist/subscribers/index.mjs +2 -2
- package/package.json +4 -4
- package/src/endpoints/EndpointFactory.ts +88 -18
- package/src/endpoints/index.ts +1 -1
- package/test.ts +92 -0
- package/dist/AmazonApiGatewayEndpointAdaptor-D_Q_NTMT.cjs.map +0 -1
- package/dist/AmazonApiGatewayEndpointAdaptor-QzIAnWzS.mjs.map +0 -1
- package/dist/Endpoint-D1nnEsBU.cjs.map +0 -1
- package/dist/Endpoint-DNlmybXV.mjs.map +0 -1
- package/dist/EndpointFactory-ChmVHWim.cjs.map +0 -1
- package/dist/EndpointFactory-DLpEbLzL.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-6LERutxi.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-fs2928iO.mjs.map +0 -1
- package/dist/TestEndpointAdaptor-B4SvJvK-.cjs.map +0 -1
- package/dist/TestEndpointAdaptor-CelYsQi0.mjs.map +0 -1
- package/dist/index-zOH9f4sh.d.cts +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
2
|
const require_publisher = require('./publisher-lFQleddL.cjs');
|
|
3
|
-
const require_Endpoint = require('./Endpoint-
|
|
3
|
+
const require_Endpoint = require('./Endpoint-BVZJb4OR.cjs');
|
|
4
4
|
const __geekmidas_errors = require_chunk.__toESM(require("@geekmidas/errors"));
|
|
5
5
|
const lodash_set = require_chunk.__toESM(require("lodash.set"));
|
|
6
6
|
const __middy_core = require_chunk.__toESM(require("@middy/core"));
|
|
@@ -28,10 +28,12 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
28
28
|
const { body, query, params } = this.getInput(req.event);
|
|
29
29
|
const headers = req.event.headers;
|
|
30
30
|
const header = require_Endpoint.Endpoint.createHeaders(headers);
|
|
31
|
+
const cookie = require_Endpoint.Endpoint.createCookies(headers.cookie);
|
|
31
32
|
(0, lodash_set.default)(req.event, "body", await this.endpoint.parseInput(body, "body"));
|
|
32
33
|
(0, lodash_set.default)(req.event, "query", await this.endpoint.parseInput(query, "query"));
|
|
33
34
|
(0, lodash_set.default)(req.event, "params", await this.endpoint.parseInput(params, "params"));
|
|
34
35
|
(0, lodash_set.default)(req.event, "header", header);
|
|
36
|
+
(0, lodash_set.default)(req.event, "cookie", cookie);
|
|
35
37
|
} catch (error) {
|
|
36
38
|
if (error && typeof error === "object" && Array.isArray(error)) throw new __geekmidas_errors.UnprocessableEntityError("Validation failed", error);
|
|
37
39
|
throw error;
|
|
@@ -61,9 +63,11 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
61
63
|
const logger = req.event.logger;
|
|
62
64
|
const services = req.event.services;
|
|
63
65
|
const header = req.event.header;
|
|
66
|
+
const cookie = req.event.cookie;
|
|
64
67
|
const session = req.event.session;
|
|
65
68
|
const isAuthorized = await this.endpoint.authorize({
|
|
66
69
|
header,
|
|
70
|
+
cookie,
|
|
67
71
|
services,
|
|
68
72
|
logger,
|
|
69
73
|
session
|
|
@@ -81,7 +85,8 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
81
85
|
req.event.session = await this.endpoint.getSession({
|
|
82
86
|
logger,
|
|
83
87
|
services,
|
|
84
|
-
header: req.event.header
|
|
88
|
+
header: req.event.header,
|
|
89
|
+
cookie: req.event.cookie
|
|
85
90
|
});
|
|
86
91
|
} };
|
|
87
92
|
}
|
|
@@ -99,20 +104,38 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
99
104
|
}
|
|
100
105
|
async _handler(event) {
|
|
101
106
|
const input = this.endpoint.refineInput(event);
|
|
107
|
+
const responseBuilder = new require_Endpoint.ResponseBuilder();
|
|
102
108
|
const response = await this.endpoint.handler({
|
|
103
109
|
header: event.header,
|
|
110
|
+
cookie: event.cookie,
|
|
104
111
|
logger: event.logger,
|
|
105
112
|
services: event.services,
|
|
106
113
|
session: event.session,
|
|
107
114
|
...input
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
}, responseBuilder);
|
|
116
|
+
let data = response;
|
|
117
|
+
let metadata = responseBuilder.getMetadata();
|
|
118
|
+
if (require_Endpoint.Endpoint.hasMetadata(response)) {
|
|
119
|
+
data = response.data;
|
|
120
|
+
metadata = response.metadata;
|
|
121
|
+
}
|
|
122
|
+
const output = this.endpoint.outputSchema ? await this.endpoint.parseOutput(data) : void 0;
|
|
123
|
+
const body = output !== void 0 ? JSON.stringify(output) : void 0;
|
|
124
|
+
event.__response = output;
|
|
125
|
+
const lambdaResponse = {
|
|
126
|
+
statusCode: metadata.status ?? this.endpoint.status,
|
|
114
127
|
body
|
|
115
128
|
};
|
|
129
|
+
if (metadata.headers && Object.keys(metadata.headers).length > 0) lambdaResponse.headers = { ...metadata.headers };
|
|
130
|
+
if (metadata.cookies && metadata.cookies.size > 0) {
|
|
131
|
+
const setCookieHeaders = [];
|
|
132
|
+
for (const [name, { value, options }] of metadata.cookies) setCookieHeaders.push(require_Endpoint.Endpoint.formatCookieHeader(name, value, options));
|
|
133
|
+
if (setCookieHeaders.length > 0) lambdaResponse.multiValueHeaders = {
|
|
134
|
+
...lambdaResponse.multiValueHeaders,
|
|
135
|
+
"Set-Cookie": setCookieHeaders
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return lambdaResponse;
|
|
116
139
|
}
|
|
117
140
|
get handler() {
|
|
118
141
|
const handler = this._handler.bind(this);
|
|
@@ -127,4 +150,4 @@ Object.defineProperty(exports, 'AmazonApiGatewayEndpoint', {
|
|
|
127
150
|
return AmazonApiGatewayEndpoint;
|
|
128
151
|
}
|
|
129
152
|
});
|
|
130
|
-
//# sourceMappingURL=AmazonApiGatewayEndpointAdaptor-
|
|
153
|
+
//# sourceMappingURL=AmazonApiGatewayEndpointAdaptor-BEzWkW5m.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmazonApiGatewayEndpointAdaptor-BEzWkW5m.cjs","names":["envParser: EnvironmentParser<{}>","endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName\n >","UnprocessableEntityError","UnauthorizedError","event: Event<TEvent, TInput, TServices, TLogger, TSession>","ResponseBuilder","lambdaResponse: AmazonApiGatewayEndpointHandlerResponse","setCookieHeaders: string[]"],"sources":["../src/endpoints/AmazonApiGatewayEndpointAdaptor.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { HttpMethod } from '../types';\nimport { Endpoint, type EndpointSchemas, ResponseBuilder } from './Endpoint';\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport middy, { type MiddlewareObj } from '@middy/core';\nimport type {\n APIGatewayProxyEvent,\n APIGatewayProxyEventV2,\n Context,\n} from 'aws-lambda';\nimport set from 'lodash.set';\n\nimport {\n UnauthorizedError,\n UnprocessableEntityError,\n wrapError,\n} from '@geekmidas/errors';\nimport type { EventPublisher } from '@geekmidas/events';\nimport {\n type Service,\n ServiceDiscovery,\n type ServiceRecord,\n} from '@geekmidas/services';\n\nimport type {\n InferComposableStandardSchema,\n InferStandardSchema,\n} from '@geekmidas/schema';\nimport { publishConstructEvents } from '../publisher';\n\n// Helper function to publish events\n\nexport abstract class AmazonApiGatewayEndpoint<\n THandler extends\n | AmazonApiGatewayV1EndpointHandler\n | AmazonApiGatewayV2EndpointHandler,\n TEvent extends HandlerEvent<THandler>,\n TRoute extends string,\n TMethod extends HttpMethod,\n TInput extends EndpointSchemas = {},\n TOutSchema extends StandardSchemaV1 | undefined = undefined,\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n TEventPublisher extends EventPublisher<any> | undefined = undefined,\n TEventPublisherServiceName extends string = string,\n> {\n constructor(\n protected envParser: EnvironmentParser<{}>,\n protected readonly endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName\n >,\n ) {}\n\n private error(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n onError: (req) => {\n (req.event.logger || this.endpoint.logger).error(\n req.error || {},\n 'Error processing request',\n );\n const wrappedError = wrapError(req.error);\n\n // Set the response with the proper status code from the HttpError\n req.response = {\n statusCode: wrappedError.statusCode,\n body: wrappedError.body,\n };\n },\n };\n }\n abstract getInput(e: TEvent): GetInputResponse;\n\n private input(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: async (req) => {\n try {\n const { body, query, params } = this.getInput(req.event);\n const headers = req.event.headers as Record<string, string>;\n const header = Endpoint.createHeaders(headers);\n const cookie = Endpoint.createCookies(headers.cookie);\n\n set(req.event, 'body', await this.endpoint.parseInput(body, 'body'));\n\n set(\n req.event,\n 'query',\n await this.endpoint.parseInput(query, 'query'),\n );\n set(\n req.event,\n 'params',\n await this.endpoint.parseInput(params, 'params'),\n );\n set(req.event, 'header', header);\n set(req.event, 'cookie', cookie);\n } catch (error) {\n // Convert validation errors to 422 Unprocessable Entity\n if (error && typeof error === 'object' && Array.isArray(error)) {\n throw new UnprocessableEntityError('Validation failed', error);\n }\n throw error;\n }\n },\n };\n }\n\n abstract getLoggerContext(data: TEvent, context: Context): LoggerContext;\n\n private logger(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: (req) => {\n req.event.logger = this.endpoint.logger.child({\n route: this.endpoint.route,\n host: req.event.headers?.host,\n method: this.endpoint.method,\n ...this.getLoggerContext(req.event, req.context),\n }) as TLogger;\n },\n };\n }\n private services(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: async (req) => {\n const logger = req.event.logger as TLogger;\n const serviceDiscovery = ServiceDiscovery.getInstance<\n ServiceRecord<TServices>,\n TLogger\n >(logger, this.envParser);\n\n const services = await serviceDiscovery.register(\n this.endpoint.services,\n );\n\n req.event.services = services;\n },\n };\n }\n\n private authorize(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: async (req) => {\n const logger = req.event.logger as TLogger;\n const services = req.event.services;\n const header = req.event.header;\n const cookie = req.event.cookie;\n const session = req.event.session as TSession;\n\n const isAuthorized = await this.endpoint.authorize({\n header,\n cookie,\n services,\n logger,\n session,\n });\n\n if (!isAuthorized) {\n logger.warn('Unauthorized access attempt');\n throw new UnauthorizedError(\n 'Unauthorized access to the endpoint',\n 'You do not have permission to access this resource.',\n );\n }\n },\n };\n }\n\n private session(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: async (req) => {\n const logger = req.event.logger as TLogger;\n const services = req.event.services;\n req.event.session = (await this.endpoint.getSession({\n logger,\n services,\n header: req.event.header,\n cookie: req.event.cookie,\n })) as TSession;\n },\n };\n }\n\n private events(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n after: async (req) => {\n const event = req.event;\n const response = (event as any)\n .__response as InferStandardSchema<TOutSchema>;\n const statusCode = req.response?.statusCode ?? this.endpoint.status;\n\n // Only publish events on successful responses (2xx status codes)\n if (Endpoint.isSuccessStatus(statusCode)) {\n const logger = event.logger as TLogger;\n const serviceDiscovery = ServiceDiscovery.getInstance<\n ServiceRecord<TServices>,\n TLogger\n >(logger, this.envParser);\n await publishConstructEvents(\n this.endpoint,\n response,\n serviceDiscovery,\n logger,\n );\n }\n },\n };\n }\n\n private async _handler(\n event: Event<TEvent, TInput, TServices, TLogger, TSession>,\n ) {\n const input = this.endpoint.refineInput(event);\n\n const responseBuilder = new ResponseBuilder();\n const response = await this.endpoint.handler(\n {\n header: event.header,\n cookie: event.cookie,\n logger: event.logger,\n services: event.services,\n session: event.session,\n ...input,\n },\n responseBuilder,\n );\n\n // Check if response has metadata\n let data = response;\n let metadata = responseBuilder.getMetadata();\n\n if (Endpoint.hasMetadata(response)) {\n data = response.data;\n metadata = response.metadata;\n }\n\n const output = this.endpoint.outputSchema\n ? await this.endpoint.parseOutput(data)\n : undefined;\n\n const body = output !== undefined ? JSON.stringify(output) : undefined;\n\n // Store response for middleware access\n (event as any).__response = output;\n\n // Build response with metadata\n const lambdaResponse: AmazonApiGatewayEndpointHandlerResponse = {\n statusCode: metadata.status ?? this.endpoint.status,\n body,\n };\n\n // Add custom headers\n if (metadata.headers && Object.keys(metadata.headers).length > 0) {\n lambdaResponse.headers = { ...metadata.headers };\n }\n\n // Format cookies as Set-Cookie headers\n if (metadata.cookies && metadata.cookies.size > 0) {\n const setCookieHeaders: string[] = [];\n for (const [name, { value, options }] of metadata.cookies) {\n setCookieHeaders.push(\n Endpoint.formatCookieHeader(name, value, options),\n );\n }\n\n if (setCookieHeaders.length > 0) {\n lambdaResponse.multiValueHeaders = {\n ...lambdaResponse.multiValueHeaders,\n 'Set-Cookie': setCookieHeaders,\n };\n }\n }\n\n return lambdaResponse;\n }\n\n get handler() {\n const handler = this._handler.bind(this);\n return middy(handler)\n .use(this.logger())\n .use(this.error())\n .use(this.services())\n .use(this.input())\n .use(this.session())\n .use(this.authorize())\n .use(this.events()) as unknown as THandler;\n }\n}\n\nexport type Event<\n TEvent extends APIGatewayProxyEvent | APIGatewayProxyEventV2,\n TInput extends EndpointSchemas = {},\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n> = {\n services: ServiceRecord<TServices>;\n logger: TLogger;\n header(key: string): string | undefined;\n cookie(name: string): string | undefined;\n session: TSession;\n} & TEvent &\n InferComposableStandardSchema<TInput>;\n\ntype Middleware<\n TEvent extends APIGatewayProxyEvent | APIGatewayProxyEventV2,\n TInput extends EndpointSchemas = {},\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n> = MiddlewareObj<Event<TEvent, TInput, TServices, TLogger, TSession>>;\n\nexport type AmazonApiGatewayEndpointHandlerResponse = {\n statusCode: number;\n body: string | undefined;\n headers?: Record<string, string>;\n multiValueHeaders?: Record<string, string[]>;\n};\n\nexport type LoggerContext = {\n fn: {\n name: string;\n version: string;\n };\n req: {\n id: string | undefined;\n awsRequestId: string;\n path: string;\n ip: string | undefined;\n userAgent: string | undefined;\n };\n};\n\nexport type GetInputResponse = {\n body: any;\n query: any;\n params: any;\n};\n\nexport type AmazonApiGatewayV1EndpointHandler = (\n event: APIGatewayProxyEvent,\n context: Context,\n) => Promise<AmazonApiGatewayEndpointHandlerResponse>;\n\nexport type AmazonApiGatewayV2EndpointHandler = (\n event: APIGatewayProxyEventV2,\n context: Context,\n) => Promise<AmazonApiGatewayEndpointHandlerResponse>;\n\nexport type HandlerEvent<T extends Function> = T extends (\n event: infer E,\n context: Context,\n) => any\n ? E\n : never;\n"],"mappings":";;;;;;;;;AAkCA,IAAsB,2BAAtB,MAcE;CACA,YACYA,WACSC,UAWnB;EAZU;EACS;CAWjB;CAEJ,AAAQ,QAAwD;AAC9D,SAAO,EACL,SAAS,CAAC,QAAQ;AAChB,IAAC,IAAI,MAAM,UAAU,KAAK,SAAS,QAAQ,MACzC,IAAI,SAAS,CAAE,GACf,2BACD;GACD,MAAM,eAAe,kCAAU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
+
import { Endpoint, EndpointSchemas } from "./Endpoint-XUMNAXYy.cjs";
|
|
3
3
|
import { EventPublisher } from "@geekmidas/events";
|
|
4
4
|
import { Logger } from "@geekmidas/logger";
|
|
5
5
|
import { Service, ServiceRecord } from "@geekmidas/services";
|
|
@@ -29,11 +29,14 @@ type Event<TEvent extends APIGatewayProxyEvent | APIGatewayProxyEventV2, TInput
|
|
|
29
29
|
services: ServiceRecord<TServices>;
|
|
30
30
|
logger: TLogger;
|
|
31
31
|
header(key: string): string | undefined;
|
|
32
|
+
cookie(name: string): string | undefined;
|
|
32
33
|
session: TSession;
|
|
33
34
|
} & TEvent & InferComposableStandardSchema<TInput>;
|
|
34
35
|
type AmazonApiGatewayEndpointHandlerResponse = {
|
|
35
36
|
statusCode: number;
|
|
36
37
|
body: string | undefined;
|
|
38
|
+
headers?: Record<string, string>;
|
|
39
|
+
multiValueHeaders?: Record<string, string[]>;
|
|
37
40
|
};
|
|
38
41
|
type LoggerContext = {
|
|
39
42
|
fn: {
|
|
@@ -58,4 +61,4 @@ type AmazonApiGatewayV2EndpointHandler = (event: APIGatewayProxyEventV2, context
|
|
|
58
61
|
type HandlerEvent<T extends Function> = T extends ((event: infer E, context: Context) => any) ? E : never;
|
|
59
62
|
//#endregion
|
|
60
63
|
export { AmazonApiGatewayEndpoint, AmazonApiGatewayEndpointHandlerResponse, AmazonApiGatewayV1EndpointHandler, AmazonApiGatewayV2EndpointHandler, Event, GetInputResponse, HandlerEvent, LoggerContext };
|
|
61
|
-
//# sourceMappingURL=AmazonApiGatewayEndpointAdaptor-
|
|
64
|
+
//# sourceMappingURL=AmazonApiGatewayEndpointAdaptor-BFhJ2Rpz.d.cts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpMethod } from "./types-CVq20-fE.mjs";
|
|
2
|
-
import { Endpoint, EndpointSchemas } from "./Endpoint-
|
|
2
|
+
import { Endpoint, EndpointSchemas } from "./Endpoint-C7jPJzAH.mjs";
|
|
3
3
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
4
4
|
import { Service, ServiceRecord } from "@geekmidas/services";
|
|
5
5
|
import { EventPublisher } from "@geekmidas/events";
|
|
@@ -29,11 +29,14 @@ type Event<TEvent extends APIGatewayProxyEvent | APIGatewayProxyEventV2, TInput
|
|
|
29
29
|
services: ServiceRecord<TServices>;
|
|
30
30
|
logger: TLogger;
|
|
31
31
|
header(key: string): string | undefined;
|
|
32
|
+
cookie(name: string): string | undefined;
|
|
32
33
|
session: TSession;
|
|
33
34
|
} & TEvent & InferComposableStandardSchema<TInput>;
|
|
34
35
|
type AmazonApiGatewayEndpointHandlerResponse = {
|
|
35
36
|
statusCode: number;
|
|
36
37
|
body: string | undefined;
|
|
38
|
+
headers?: Record<string, string>;
|
|
39
|
+
multiValueHeaders?: Record<string, string[]>;
|
|
37
40
|
};
|
|
38
41
|
type LoggerContext = {
|
|
39
42
|
fn: {
|
|
@@ -58,4 +61,4 @@ type AmazonApiGatewayV2EndpointHandler = (event: APIGatewayProxyEventV2, context
|
|
|
58
61
|
type HandlerEvent<T extends Function> = T extends ((event: infer E, context: Context) => any) ? E : never;
|
|
59
62
|
//#endregion
|
|
60
63
|
export { AmazonApiGatewayEndpoint, AmazonApiGatewayEndpointHandlerResponse, AmazonApiGatewayV1EndpointHandler, AmazonApiGatewayV2EndpointHandler, Event, GetInputResponse, HandlerEvent, LoggerContext };
|
|
61
|
-
//# sourceMappingURL=AmazonApiGatewayEndpointAdaptor-
|
|
64
|
+
//# sourceMappingURL=AmazonApiGatewayEndpointAdaptor-BrB3RfbI.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { publishConstructEvents } from "./publisher-Bw4770Hi.mjs";
|
|
2
|
-
import { Endpoint } from "./Endpoint-
|
|
2
|
+
import { Endpoint, ResponseBuilder } from "./Endpoint-DVEmKo6G.mjs";
|
|
3
3
|
import { UnauthorizedError, UnprocessableEntityError, wrapError } from "@geekmidas/errors";
|
|
4
4
|
import set from "lodash.set";
|
|
5
5
|
import middy from "@middy/core";
|
|
@@ -27,10 +27,12 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
27
27
|
const { body, query, params } = this.getInput(req.event);
|
|
28
28
|
const headers = req.event.headers;
|
|
29
29
|
const header = Endpoint.createHeaders(headers);
|
|
30
|
+
const cookie = Endpoint.createCookies(headers.cookie);
|
|
30
31
|
set(req.event, "body", await this.endpoint.parseInput(body, "body"));
|
|
31
32
|
set(req.event, "query", await this.endpoint.parseInput(query, "query"));
|
|
32
33
|
set(req.event, "params", await this.endpoint.parseInput(params, "params"));
|
|
33
34
|
set(req.event, "header", header);
|
|
35
|
+
set(req.event, "cookie", cookie);
|
|
34
36
|
} catch (error) {
|
|
35
37
|
if (error && typeof error === "object" && Array.isArray(error)) throw new UnprocessableEntityError("Validation failed", error);
|
|
36
38
|
throw error;
|
|
@@ -60,9 +62,11 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
60
62
|
const logger = req.event.logger;
|
|
61
63
|
const services = req.event.services;
|
|
62
64
|
const header = req.event.header;
|
|
65
|
+
const cookie = req.event.cookie;
|
|
63
66
|
const session = req.event.session;
|
|
64
67
|
const isAuthorized = await this.endpoint.authorize({
|
|
65
68
|
header,
|
|
69
|
+
cookie,
|
|
66
70
|
services,
|
|
67
71
|
logger,
|
|
68
72
|
session
|
|
@@ -80,7 +84,8 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
80
84
|
req.event.session = await this.endpoint.getSession({
|
|
81
85
|
logger,
|
|
82
86
|
services,
|
|
83
|
-
header: req.event.header
|
|
87
|
+
header: req.event.header,
|
|
88
|
+
cookie: req.event.cookie
|
|
84
89
|
});
|
|
85
90
|
} };
|
|
86
91
|
}
|
|
@@ -98,20 +103,38 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
98
103
|
}
|
|
99
104
|
async _handler(event) {
|
|
100
105
|
const input = this.endpoint.refineInput(event);
|
|
106
|
+
const responseBuilder = new ResponseBuilder();
|
|
101
107
|
const response = await this.endpoint.handler({
|
|
102
108
|
header: event.header,
|
|
109
|
+
cookie: event.cookie,
|
|
103
110
|
logger: event.logger,
|
|
104
111
|
services: event.services,
|
|
105
112
|
session: event.session,
|
|
106
113
|
...input
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
}, responseBuilder);
|
|
115
|
+
let data = response;
|
|
116
|
+
let metadata = responseBuilder.getMetadata();
|
|
117
|
+
if (Endpoint.hasMetadata(response)) {
|
|
118
|
+
data = response.data;
|
|
119
|
+
metadata = response.metadata;
|
|
120
|
+
}
|
|
121
|
+
const output = this.endpoint.outputSchema ? await this.endpoint.parseOutput(data) : void 0;
|
|
122
|
+
const body = output !== void 0 ? JSON.stringify(output) : void 0;
|
|
123
|
+
event.__response = output;
|
|
124
|
+
const lambdaResponse = {
|
|
125
|
+
statusCode: metadata.status ?? this.endpoint.status,
|
|
113
126
|
body
|
|
114
127
|
};
|
|
128
|
+
if (metadata.headers && Object.keys(metadata.headers).length > 0) lambdaResponse.headers = { ...metadata.headers };
|
|
129
|
+
if (metadata.cookies && metadata.cookies.size > 0) {
|
|
130
|
+
const setCookieHeaders = [];
|
|
131
|
+
for (const [name, { value, options }] of metadata.cookies) setCookieHeaders.push(Endpoint.formatCookieHeader(name, value, options));
|
|
132
|
+
if (setCookieHeaders.length > 0) lambdaResponse.multiValueHeaders = {
|
|
133
|
+
...lambdaResponse.multiValueHeaders,
|
|
134
|
+
"Set-Cookie": setCookieHeaders
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return lambdaResponse;
|
|
115
138
|
}
|
|
116
139
|
get handler() {
|
|
117
140
|
const handler = this._handler.bind(this);
|
|
@@ -121,4 +144,4 @@ var AmazonApiGatewayEndpoint = class {
|
|
|
121
144
|
|
|
122
145
|
//#endregion
|
|
123
146
|
export { AmazonApiGatewayEndpoint };
|
|
124
|
-
//# sourceMappingURL=AmazonApiGatewayEndpointAdaptor-
|
|
147
|
+
//# sourceMappingURL=AmazonApiGatewayEndpointAdaptor-CASfHEj9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmazonApiGatewayEndpointAdaptor-CASfHEj9.mjs","names":["envParser: EnvironmentParser<{}>","endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName\n >","event: Event<TEvent, TInput, TServices, TLogger, TSession>","lambdaResponse: AmazonApiGatewayEndpointHandlerResponse","setCookieHeaders: string[]"],"sources":["../src/endpoints/AmazonApiGatewayEndpointAdaptor.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { HttpMethod } from '../types';\nimport { Endpoint, type EndpointSchemas, ResponseBuilder } from './Endpoint';\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport middy, { type MiddlewareObj } from '@middy/core';\nimport type {\n APIGatewayProxyEvent,\n APIGatewayProxyEventV2,\n Context,\n} from 'aws-lambda';\nimport set from 'lodash.set';\n\nimport {\n UnauthorizedError,\n UnprocessableEntityError,\n wrapError,\n} from '@geekmidas/errors';\nimport type { EventPublisher } from '@geekmidas/events';\nimport {\n type Service,\n ServiceDiscovery,\n type ServiceRecord,\n} from '@geekmidas/services';\n\nimport type {\n InferComposableStandardSchema,\n InferStandardSchema,\n} from '@geekmidas/schema';\nimport { publishConstructEvents } from '../publisher';\n\n// Helper function to publish events\n\nexport abstract class AmazonApiGatewayEndpoint<\n THandler extends\n | AmazonApiGatewayV1EndpointHandler\n | AmazonApiGatewayV2EndpointHandler,\n TEvent extends HandlerEvent<THandler>,\n TRoute extends string,\n TMethod extends HttpMethod,\n TInput extends EndpointSchemas = {},\n TOutSchema extends StandardSchemaV1 | undefined = undefined,\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n TEventPublisher extends EventPublisher<any> | undefined = undefined,\n TEventPublisherServiceName extends string = string,\n> {\n constructor(\n protected envParser: EnvironmentParser<{}>,\n protected readonly endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName\n >,\n ) {}\n\n private error(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n onError: (req) => {\n (req.event.logger || this.endpoint.logger).error(\n req.error || {},\n 'Error processing request',\n );\n const wrappedError = wrapError(req.error);\n\n // Set the response with the proper status code from the HttpError\n req.response = {\n statusCode: wrappedError.statusCode,\n body: wrappedError.body,\n };\n },\n };\n }\n abstract getInput(e: TEvent): GetInputResponse;\n\n private input(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: async (req) => {\n try {\n const { body, query, params } = this.getInput(req.event);\n const headers = req.event.headers as Record<string, string>;\n const header = Endpoint.createHeaders(headers);\n const cookie = Endpoint.createCookies(headers.cookie);\n\n set(req.event, 'body', await this.endpoint.parseInput(body, 'body'));\n\n set(\n req.event,\n 'query',\n await this.endpoint.parseInput(query, 'query'),\n );\n set(\n req.event,\n 'params',\n await this.endpoint.parseInput(params, 'params'),\n );\n set(req.event, 'header', header);\n set(req.event, 'cookie', cookie);\n } catch (error) {\n // Convert validation errors to 422 Unprocessable Entity\n if (error && typeof error === 'object' && Array.isArray(error)) {\n throw new UnprocessableEntityError('Validation failed', error);\n }\n throw error;\n }\n },\n };\n }\n\n abstract getLoggerContext(data: TEvent, context: Context): LoggerContext;\n\n private logger(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: (req) => {\n req.event.logger = this.endpoint.logger.child({\n route: this.endpoint.route,\n host: req.event.headers?.host,\n method: this.endpoint.method,\n ...this.getLoggerContext(req.event, req.context),\n }) as TLogger;\n },\n };\n }\n private services(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: async (req) => {\n const logger = req.event.logger as TLogger;\n const serviceDiscovery = ServiceDiscovery.getInstance<\n ServiceRecord<TServices>,\n TLogger\n >(logger, this.envParser);\n\n const services = await serviceDiscovery.register(\n this.endpoint.services,\n );\n\n req.event.services = services;\n },\n };\n }\n\n private authorize(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: async (req) => {\n const logger = req.event.logger as TLogger;\n const services = req.event.services;\n const header = req.event.header;\n const cookie = req.event.cookie;\n const session = req.event.session as TSession;\n\n const isAuthorized = await this.endpoint.authorize({\n header,\n cookie,\n services,\n logger,\n session,\n });\n\n if (!isAuthorized) {\n logger.warn('Unauthorized access attempt');\n throw new UnauthorizedError(\n 'Unauthorized access to the endpoint',\n 'You do not have permission to access this resource.',\n );\n }\n },\n };\n }\n\n private session(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n before: async (req) => {\n const logger = req.event.logger as TLogger;\n const services = req.event.services;\n req.event.session = (await this.endpoint.getSession({\n logger,\n services,\n header: req.event.header,\n cookie: req.event.cookie,\n })) as TSession;\n },\n };\n }\n\n private events(): Middleware<TEvent, TInput, TServices, TLogger> {\n return {\n after: async (req) => {\n const event = req.event;\n const response = (event as any)\n .__response as InferStandardSchema<TOutSchema>;\n const statusCode = req.response?.statusCode ?? this.endpoint.status;\n\n // Only publish events on successful responses (2xx status codes)\n if (Endpoint.isSuccessStatus(statusCode)) {\n const logger = event.logger as TLogger;\n const serviceDiscovery = ServiceDiscovery.getInstance<\n ServiceRecord<TServices>,\n TLogger\n >(logger, this.envParser);\n await publishConstructEvents(\n this.endpoint,\n response,\n serviceDiscovery,\n logger,\n );\n }\n },\n };\n }\n\n private async _handler(\n event: Event<TEvent, TInput, TServices, TLogger, TSession>,\n ) {\n const input = this.endpoint.refineInput(event);\n\n const responseBuilder = new ResponseBuilder();\n const response = await this.endpoint.handler(\n {\n header: event.header,\n cookie: event.cookie,\n logger: event.logger,\n services: event.services,\n session: event.session,\n ...input,\n },\n responseBuilder,\n );\n\n // Check if response has metadata\n let data = response;\n let metadata = responseBuilder.getMetadata();\n\n if (Endpoint.hasMetadata(response)) {\n data = response.data;\n metadata = response.metadata;\n }\n\n const output = this.endpoint.outputSchema\n ? await this.endpoint.parseOutput(data)\n : undefined;\n\n const body = output !== undefined ? JSON.stringify(output) : undefined;\n\n // Store response for middleware access\n (event as any).__response = output;\n\n // Build response with metadata\n const lambdaResponse: AmazonApiGatewayEndpointHandlerResponse = {\n statusCode: metadata.status ?? this.endpoint.status,\n body,\n };\n\n // Add custom headers\n if (metadata.headers && Object.keys(metadata.headers).length > 0) {\n lambdaResponse.headers = { ...metadata.headers };\n }\n\n // Format cookies as Set-Cookie headers\n if (metadata.cookies && metadata.cookies.size > 0) {\n const setCookieHeaders: string[] = [];\n for (const [name, { value, options }] of metadata.cookies) {\n setCookieHeaders.push(\n Endpoint.formatCookieHeader(name, value, options),\n );\n }\n\n if (setCookieHeaders.length > 0) {\n lambdaResponse.multiValueHeaders = {\n ...lambdaResponse.multiValueHeaders,\n 'Set-Cookie': setCookieHeaders,\n };\n }\n }\n\n return lambdaResponse;\n }\n\n get handler() {\n const handler = this._handler.bind(this);\n return middy(handler)\n .use(this.logger())\n .use(this.error())\n .use(this.services())\n .use(this.input())\n .use(this.session())\n .use(this.authorize())\n .use(this.events()) as unknown as THandler;\n }\n}\n\nexport type Event<\n TEvent extends APIGatewayProxyEvent | APIGatewayProxyEventV2,\n TInput extends EndpointSchemas = {},\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n> = {\n services: ServiceRecord<TServices>;\n logger: TLogger;\n header(key: string): string | undefined;\n cookie(name: string): string | undefined;\n session: TSession;\n} & TEvent &\n InferComposableStandardSchema<TInput>;\n\ntype Middleware<\n TEvent extends APIGatewayProxyEvent | APIGatewayProxyEventV2,\n TInput extends EndpointSchemas = {},\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n> = MiddlewareObj<Event<TEvent, TInput, TServices, TLogger, TSession>>;\n\nexport type AmazonApiGatewayEndpointHandlerResponse = {\n statusCode: number;\n body: string | undefined;\n headers?: Record<string, string>;\n multiValueHeaders?: Record<string, string[]>;\n};\n\nexport type LoggerContext = {\n fn: {\n name: string;\n version: string;\n };\n req: {\n id: string | undefined;\n awsRequestId: string;\n path: string;\n ip: string | undefined;\n userAgent: string | undefined;\n };\n};\n\nexport type GetInputResponse = {\n body: any;\n query: any;\n params: any;\n};\n\nexport type AmazonApiGatewayV1EndpointHandler = (\n event: APIGatewayProxyEvent,\n context: Context,\n) => Promise<AmazonApiGatewayEndpointHandlerResponse>;\n\nexport type AmazonApiGatewayV2EndpointHandler = (\n event: APIGatewayProxyEventV2,\n context: Context,\n) => Promise<AmazonApiGatewayEndpointHandlerResponse>;\n\nexport type HandlerEvent<T extends Function> = T extends (\n event: infer E,\n context: Context,\n) => any\n ? E\n : never;\n"],"mappings":";;;;;;;;AAkCA,IAAsB,2BAAtB,MAcE;CACA,YACYA,WACSC,UAWnB;EAZU;EACS;CAWjB;CAEJ,AAAQ,QAAwD;AAC9D,SAAO,EACL,SAAS,CAAC,QAAQ;AAChB,IAAC,IAAI,MAAM,UAAU,KAAK,SAAS,QAAQ,MACzC,IAAI,SAAS,CAAE,GACf,2BACD;GACD,MAAM,eAAe,UAAU,IAAI,MAAM;AAGzC,OAAI,WAAW;IACb,YAAY,aAAa;IACzB,MAAM,aAAa;GACpB;EACF,EACF;CACF;CAGD,AAAQ,QAAwD;AAC9D,SAAO,EACL,QAAQ,OAAO,QAAQ;AACrB,OAAI;IACF,MAAM,EAAE,MAAM,OAAO,QAAQ,GAAG,KAAK,SAAS,IAAI,MAAM;IACxD,MAAM,UAAU,IAAI,MAAM;IAC1B,MAAM,SAAS,SAAS,cAAc,QAAQ;IAC9C,MAAM,SAAS,SAAS,cAAc,QAAQ,OAAO;AAErD,QAAI,IAAI,OAAO,QAAQ,MAAM,KAAK,SAAS,WAAW,MAAM,OAAO,CAAC;AAEpE,QACE,IAAI,OACJ,SACA,MAAM,KAAK,SAAS,WAAW,OAAO,QAAQ,CAC/C;AACD,QACE,IAAI,OACJ,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OAAO,GAAG;GACjD,MAAMC,mBAA6B,CAAE;AACrC,QAAK,MAAM,CAAC,MAAM,EAAE,OAAO,SAAS,CAAC,IAAI,SAAS,QAChD,kBAAiB,KACf,SAAS,mBAAmB,MAAM,OAAO,QAAQ,CAClD;AAGH,OAAI,iBAAiB,SAAS,EAC5B,gBAAe,oBAAoB;IACjC,GAAG,eAAe;IAClB,cAAc;GACf;EAEJ;AAED,SAAO;CACR;CAED,IAAI,UAAU;EACZ,MAAM,UAAU,KAAK,SAAS,KAAK,KAAK;AACxC,SAAO,MAAM,QAAQ,CAClB,IAAI,KAAK,QAAQ,CAAC,CAClB,IAAI,KAAK,OAAO,CAAC,CACjB,IAAI,KAAK,UAAU,CAAC,CACpB,IAAI,KAAK,OAAO,CAAC,CACjB,IAAI,KAAK,SAAS,CAAC,CACnB,IAAI,KAAK,WAAW,CAAC,CACrB,IAAI,KAAK,QAAQ,CAAC;CACtB;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpMethod } from "./types-Bp9ysFXd.cjs";
|
|
2
|
-
import { Endpoint, EndpointSchemas } from "./Endpoint-
|
|
3
|
-
import { AmazonApiGatewayEndpoint, AmazonApiGatewayV1EndpointHandler, GetInputResponse, LoggerContext } from "./AmazonApiGatewayEndpointAdaptor-
|
|
2
|
+
import { Endpoint, EndpointSchemas } from "./Endpoint-XUMNAXYy.cjs";
|
|
3
|
+
import { AmazonApiGatewayEndpoint, AmazonApiGatewayV1EndpointHandler, GetInputResponse, LoggerContext } from "./AmazonApiGatewayEndpointAdaptor-BFhJ2Rpz.cjs";
|
|
4
4
|
import { EventPublisher } from "@geekmidas/events";
|
|
5
5
|
import { Logger } from "@geekmidas/logger";
|
|
6
6
|
import { Service } from "@geekmidas/services";
|
|
@@ -18,4 +18,4 @@ declare class AmazonApiGatewayV1Endpoint<TRoute extends string, TMethod extends
|
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
20
|
export { AmazonApiGatewayV1Endpoint };
|
|
21
|
-
//# sourceMappingURL=AmazonApiGatewayV1EndpointAdaptor-
|
|
21
|
+
//# sourceMappingURL=AmazonApiGatewayV1EndpointAdaptor-Bd-o8ese.d.cts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpMethod } from "./types-CVq20-fE.mjs";
|
|
2
|
-
import { Endpoint, EndpointSchemas } from "./Endpoint-
|
|
3
|
-
import { AmazonApiGatewayEndpoint, AmazonApiGatewayV1EndpointHandler, GetInputResponse, LoggerContext } from "./AmazonApiGatewayEndpointAdaptor-
|
|
2
|
+
import { Endpoint, EndpointSchemas } from "./Endpoint-C7jPJzAH.mjs";
|
|
3
|
+
import { AmazonApiGatewayEndpoint, AmazonApiGatewayV1EndpointHandler, GetInputResponse, LoggerContext } from "./AmazonApiGatewayEndpointAdaptor-BrB3RfbI.mjs";
|
|
4
4
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
5
5
|
import { Service } from "@geekmidas/services";
|
|
6
6
|
import { EventPublisher } from "@geekmidas/events";
|
|
@@ -18,4 +18,4 @@ declare class AmazonApiGatewayV1Endpoint<TRoute extends string, TMethod extends
|
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
20
|
export { AmazonApiGatewayV1Endpoint };
|
|
21
|
-
//# sourceMappingURL=AmazonApiGatewayV1EndpointAdaptor-
|
|
21
|
+
//# sourceMappingURL=AmazonApiGatewayV1EndpointAdaptor-BtNXt0-4.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AmazonApiGatewayEndpoint } from "./AmazonApiGatewayEndpointAdaptor-
|
|
1
|
+
import { AmazonApiGatewayEndpoint } from "./AmazonApiGatewayEndpointAdaptor-CASfHEj9.mjs";
|
|
2
2
|
import { parseQueryParams } from "./parseQueryParams-DSk9xl09.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/endpoints/AmazonApiGatewayV1EndpointAdaptor.ts
|
|
@@ -39,4 +39,4 @@ var AmazonApiGatewayV1Endpoint = class extends AmazonApiGatewayEndpoint {
|
|
|
39
39
|
|
|
40
40
|
//#endregion
|
|
41
41
|
export { AmazonApiGatewayV1Endpoint };
|
|
42
|
-
//# sourceMappingURL=AmazonApiGatewayV1EndpointAdaptor-
|
|
42
|
+
//# sourceMappingURL=AmazonApiGatewayV1EndpointAdaptor-RPnkGENb.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonApiGatewayV1EndpointAdaptor-
|
|
1
|
+
{"version":3,"file":"AmazonApiGatewayV1EndpointAdaptor-RPnkGENb.mjs","names":["e: APIGatewayProxyEvent","mergedParams: Record<string, string | string[]>","data: APIGatewayProxyEvent","context: Context","envParser: EnvironmentParser<{}>","endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n >"],"sources":["../src/endpoints/AmazonApiGatewayV1EndpointAdaptor.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { HttpMethod } from '../types';\nimport type { Endpoint, EndpointSchemas } from './Endpoint';\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { APIGatewayProxyEvent, Context } from 'aws-lambda';\n\nimport type { EventPublisher } from '@geekmidas/events';\nimport type { Service } from '@geekmidas/services';\nimport {\n AmazonApiGatewayEndpoint,\n type AmazonApiGatewayV1EndpointHandler,\n type GetInputResponse,\n type LoggerContext,\n} from './AmazonApiGatewayEndpointAdaptor';\nimport { parseQueryParams } from './parseQueryParams';\n\nexport class AmazonApiGatewayV1Endpoint<\n TRoute extends string,\n TMethod extends HttpMethod,\n TInput extends EndpointSchemas = {},\n TOutSchema extends StandardSchemaV1 | undefined = undefined,\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n TEventPublisher extends EventPublisher<any> | undefined = undefined,\n> extends AmazonApiGatewayEndpoint<\n AmazonApiGatewayV1EndpointHandler,\n APIGatewayProxyEvent,\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n> {\n getInput(e: APIGatewayProxyEvent): GetInputResponse {\n // For arrays, AWS API Gateway V1 provides multiValueQueryStringParameters\n const multiValueParams = e.multiValueQueryStringParameters || {};\n const singleValueParams = e.queryStringParameters || {};\n\n // Merge single and multi-value parameters\n const mergedParams: Record<string, string | string[]> = {};\n\n // Add single value parameters\n for (const [key, value] of Object.entries(singleValueParams)) {\n if (value !== undefined) {\n mergedParams[key] = value;\n }\n }\n\n // Override with multi-value parameters where applicable\n for (const [key, values] of Object.entries(multiValueParams)) {\n if (values && values.length > 1) {\n mergedParams[key] = values;\n }\n }\n\n return {\n body: e.body ? JSON.parse(e.body) : undefined,\n query: parseQueryParams(mergedParams),\n params: e.pathParameters || {},\n };\n }\n getLoggerContext(\n data: APIGatewayProxyEvent,\n context: Context,\n ): LoggerContext {\n return {\n fn: {\n name: context.functionName,\n version: context.functionVersion,\n },\n req: {\n id: data.requestContext.requestId,\n awsRequestId: context.awsRequestId,\n ip: data.requestContext.identity.sourceIp,\n userAgent: data.requestContext.identity.userAgent || undefined,\n path: data.requestContext.path,\n },\n };\n }\n constructor(\n protected envParser: EnvironmentParser<{}>,\n protected readonly endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n >,\n ) {\n super(envParser, endpoint);\n }\n}\n"],"mappings":";;;;AAkBA,IAAa,6BAAb,cASU,yBAWR;CACA,SAASA,GAA2C;EAElD,MAAM,mBAAmB,EAAE,mCAAmC,CAAE;EAChE,MAAM,oBAAoB,EAAE,yBAAyB,CAAE;EAGvD,MAAMC,eAAkD,CAAE;AAG1D,OAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,kBAAkB,CAC1D,KAAI,iBACF,cAAa,OAAO;AAKxB,OAAK,MAAM,CAAC,KAAK,OAAO,IAAI,OAAO,QAAQ,iBAAiB,CAC1D,KAAI,UAAU,OAAO,SAAS,EAC5B,cAAa,OAAO;AAIxB,SAAO;GACL,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,KAAK;GACjC,OAAO,iBAAiB,aAAa;GACrC,QAAQ,EAAE,kBAAkB,CAAE;EAC/B;CACF;CACD,iBACEC,MACAC,SACe;AACf,SAAO;GACL,IAAI;IACF,MAAM,QAAQ;IACd,SAAS,QAAQ;GAClB;GACD,KAAK;IACH,IAAI,KAAK,eAAe;IACxB,cAAc,QAAQ;IACtB,IAAI,KAAK,eAAe,SAAS;IACjC,WAAW,KAAK,eAAe,SAAS;IACxC,MAAM,KAAK,eAAe;GAC3B;EACF;CACF;CACD,YACYC,WACSC,UAUnB;AACA,QAAM,WAAW,SAAS;EAZhB;EACS;CAYpB;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_AmazonApiGatewayEndpointAdaptor = require('./AmazonApiGatewayEndpointAdaptor-
|
|
1
|
+
const require_AmazonApiGatewayEndpointAdaptor = require('./AmazonApiGatewayEndpointAdaptor-BEzWkW5m.cjs');
|
|
2
2
|
const require_parseQueryParams = require('./parseQueryParams-C2EjouGt.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/endpoints/AmazonApiGatewayV1EndpointAdaptor.ts
|
|
@@ -44,4 +44,4 @@ Object.defineProperty(exports, 'AmazonApiGatewayV1Endpoint', {
|
|
|
44
44
|
return AmazonApiGatewayV1Endpoint;
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
//# sourceMappingURL=AmazonApiGatewayV1EndpointAdaptor-
|
|
47
|
+
//# sourceMappingURL=AmazonApiGatewayV1EndpointAdaptor-l1df4rFt.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonApiGatewayV1EndpointAdaptor-
|
|
1
|
+
{"version":3,"file":"AmazonApiGatewayV1EndpointAdaptor-l1df4rFt.cjs","names":["AmazonApiGatewayEndpoint","e: APIGatewayProxyEvent","mergedParams: Record<string, string | string[]>","data: APIGatewayProxyEvent","context: Context","envParser: EnvironmentParser<{}>","endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n >"],"sources":["../src/endpoints/AmazonApiGatewayV1EndpointAdaptor.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { HttpMethod } from '../types';\nimport type { Endpoint, EndpointSchemas } from './Endpoint';\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { APIGatewayProxyEvent, Context } from 'aws-lambda';\n\nimport type { EventPublisher } from '@geekmidas/events';\nimport type { Service } from '@geekmidas/services';\nimport {\n AmazonApiGatewayEndpoint,\n type AmazonApiGatewayV1EndpointHandler,\n type GetInputResponse,\n type LoggerContext,\n} from './AmazonApiGatewayEndpointAdaptor';\nimport { parseQueryParams } from './parseQueryParams';\n\nexport class AmazonApiGatewayV1Endpoint<\n TRoute extends string,\n TMethod extends HttpMethod,\n TInput extends EndpointSchemas = {},\n TOutSchema extends StandardSchemaV1 | undefined = undefined,\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n TEventPublisher extends EventPublisher<any> | undefined = undefined,\n> extends AmazonApiGatewayEndpoint<\n AmazonApiGatewayV1EndpointHandler,\n APIGatewayProxyEvent,\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n> {\n getInput(e: APIGatewayProxyEvent): GetInputResponse {\n // For arrays, AWS API Gateway V1 provides multiValueQueryStringParameters\n const multiValueParams = e.multiValueQueryStringParameters || {};\n const singleValueParams = e.queryStringParameters || {};\n\n // Merge single and multi-value parameters\n const mergedParams: Record<string, string | string[]> = {};\n\n // Add single value parameters\n for (const [key, value] of Object.entries(singleValueParams)) {\n if (value !== undefined) {\n mergedParams[key] = value;\n }\n }\n\n // Override with multi-value parameters where applicable\n for (const [key, values] of Object.entries(multiValueParams)) {\n if (values && values.length > 1) {\n mergedParams[key] = values;\n }\n }\n\n return {\n body: e.body ? JSON.parse(e.body) : undefined,\n query: parseQueryParams(mergedParams),\n params: e.pathParameters || {},\n };\n }\n getLoggerContext(\n data: APIGatewayProxyEvent,\n context: Context,\n ): LoggerContext {\n return {\n fn: {\n name: context.functionName,\n version: context.functionVersion,\n },\n req: {\n id: data.requestContext.requestId,\n awsRequestId: context.awsRequestId,\n ip: data.requestContext.identity.sourceIp,\n userAgent: data.requestContext.identity.userAgent || undefined,\n path: data.requestContext.path,\n },\n };\n }\n constructor(\n protected envParser: EnvironmentParser<{}>,\n protected readonly endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n >,\n ) {\n super(envParser, endpoint);\n }\n}\n"],"mappings":";;;;AAkBA,IAAa,6BAAb,cASUA,iEAWR;CACA,SAASC,GAA2C;EAElD,MAAM,mBAAmB,EAAE,mCAAmC,CAAE;EAChE,MAAM,oBAAoB,EAAE,yBAAyB,CAAE;EAGvD,MAAMC,eAAkD,CAAE;AAG1D,OAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,kBAAkB,CAC1D,KAAI,iBACF,cAAa,OAAO;AAKxB,OAAK,MAAM,CAAC,KAAK,OAAO,IAAI,OAAO,QAAQ,iBAAiB,CAC1D,KAAI,UAAU,OAAO,SAAS,EAC5B,cAAa,OAAO;AAIxB,SAAO;GACL,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,KAAK;GACjC,OAAO,0CAAiB,aAAa;GACrC,QAAQ,EAAE,kBAAkB,CAAE;EAC/B;CACF;CACD,iBACEC,MACAC,SACe;AACf,SAAO;GACL,IAAI;IACF,MAAM,QAAQ;IACd,SAAS,QAAQ;GAClB;GACD,KAAK;IACH,IAAI,KAAK,eAAe;IACxB,cAAc,QAAQ;IACtB,IAAI,KAAK,eAAe,SAAS;IACjC,WAAW,KAAK,eAAe,SAAS;IACxC,MAAM,KAAK,eAAe;GAC3B;EACF;CACF;CACD,YACYC,WACSC,UAUnB;AACA,QAAM,WAAW,SAAS;EAZhB;EACS;CAYpB;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AmazonApiGatewayEndpoint } from "./AmazonApiGatewayEndpointAdaptor-
|
|
1
|
+
import { AmazonApiGatewayEndpoint } from "./AmazonApiGatewayEndpointAdaptor-CASfHEj9.mjs";
|
|
2
2
|
import { parseQueryParams } from "./parseQueryParams-DSk9xl09.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/endpoints/AmazonApiGatewayV2EndpointAdaptor.ts
|
|
@@ -38,4 +38,4 @@ var AmazonApiGatewayV2Endpoint = class extends AmazonApiGatewayEndpoint {
|
|
|
38
38
|
|
|
39
39
|
//#endregion
|
|
40
40
|
export { AmazonApiGatewayV2Endpoint };
|
|
41
|
-
//# sourceMappingURL=AmazonApiGatewayV2EndpointAdaptor-
|
|
41
|
+
//# sourceMappingURL=AmazonApiGatewayV2EndpointAdaptor-C5Ctz7C_.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonApiGatewayV2EndpointAdaptor-
|
|
1
|
+
{"version":3,"file":"AmazonApiGatewayV2EndpointAdaptor-C5Ctz7C_.mjs","names":["e: APIGatewayProxyEventV2","processedParams: Record<string, string | string[]>","event: APIGatewayProxyEventV2","context: Context","envParser: EnvironmentParser<{}>","endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n >"],"sources":["../src/endpoints/AmazonApiGatewayV2EndpointAdaptor.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { HttpMethod } from '../types';\nimport type { Endpoint, EndpointSchemas } from './Endpoint';\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { EventPublisher } from '@geekmidas/events';\nimport type { Service } from '@geekmidas/services';\nimport type { APIGatewayProxyEventV2, Context } from 'aws-lambda';\nimport {\n AmazonApiGatewayEndpoint,\n type AmazonApiGatewayV2EndpointHandler,\n type GetInputResponse,\n type LoggerContext,\n} from './AmazonApiGatewayEndpointAdaptor';\nimport { parseQueryParams } from './parseQueryParams';\n\nexport class AmazonApiGatewayV2Endpoint<\n TRoute extends string,\n TMethod extends HttpMethod,\n TInput extends EndpointSchemas = {},\n TOutSchema extends StandardSchemaV1 | undefined = undefined,\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n TEventPublisher extends EventPublisher<any> | undefined = undefined,\n> extends AmazonApiGatewayEndpoint<\n AmazonApiGatewayV2EndpointHandler,\n APIGatewayProxyEventV2,\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n> {\n getInput(e: APIGatewayProxyEventV2): GetInputResponse {\n // API Gateway V2 handles arrays as comma-separated values\n const queryParams = e.queryStringParameters || {};\n const processedParams: Record<string, string | string[]> = {};\n\n for (const [key, value] of Object.entries(queryParams)) {\n if (value !== undefined) {\n // Check if value contains comma and could be an array\n // Be careful not to split values that legitimately contain commas\n if (value.includes(',') && !value.includes('\"')) {\n processedParams[key] = value.split(',').map((v) => v.trim());\n } else {\n processedParams[key] = value;\n }\n }\n }\n\n return {\n body: e.body ? JSON.parse(e.body) : undefined,\n query: parseQueryParams(processedParams),\n params: e.pathParameters || {},\n };\n }\n getLoggerContext(\n event: APIGatewayProxyEventV2,\n context: Context,\n ): LoggerContext {\n return {\n fn: {\n name: context.functionName,\n version: context.functionVersion,\n },\n req: {\n id: event.requestContext.requestId,\n awsRequestId: context.awsRequestId,\n ip: event.requestContext.http.sourceIp,\n userAgent: event.requestContext.http.userAgent || undefined,\n path: event.requestContext.http.path,\n },\n };\n }\n constructor(\n protected envParser: EnvironmentParser<{}>,\n protected readonly endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n >,\n ) {\n super(envParser, endpoint);\n }\n}\n"],"mappings":";;;;AAiBA,IAAa,6BAAb,cASU,yBAWR;CACA,SAASA,GAA6C;EAEpD,MAAM,cAAc,EAAE,yBAAyB,CAAE;EACjD,MAAMC,kBAAqD,CAAE;AAE7D,OAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,YAAY,CACpD,KAAI,iBAGF,KAAI,MAAM,SAAS,IAAI,KAAK,MAAM,SAAS,KAAI,CAC7C,iBAAgB,OAAO,MAAM,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;MAE5D,iBAAgB,OAAO;AAK7B,SAAO;GACL,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,KAAK;GACjC,OAAO,iBAAiB,gBAAgB;GACxC,QAAQ,EAAE,kBAAkB,CAAE;EAC/B;CACF;CACD,iBACEC,OACAC,SACe;AACf,SAAO;GACL,IAAI;IACF,MAAM,QAAQ;IACd,SAAS,QAAQ;GAClB;GACD,KAAK;IACH,IAAI,MAAM,eAAe;IACzB,cAAc,QAAQ;IACtB,IAAI,MAAM,eAAe,KAAK;IAC9B,WAAW,MAAM,eAAe,KAAK;IACrC,MAAM,MAAM,eAAe,KAAK;GACjC;EACF;CACF;CACD,YACYC,WACSC,UAUnB;AACA,QAAM,WAAW,SAAS;EAZhB;EACS;CAYpB;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpMethod } from "./types-CVq20-fE.mjs";
|
|
2
|
-
import { Endpoint, EndpointSchemas } from "./Endpoint-
|
|
3
|
-
import { AmazonApiGatewayEndpoint, AmazonApiGatewayV2EndpointHandler, GetInputResponse, LoggerContext } from "./AmazonApiGatewayEndpointAdaptor-
|
|
2
|
+
import { Endpoint, EndpointSchemas } from "./Endpoint-C7jPJzAH.mjs";
|
|
3
|
+
import { AmazonApiGatewayEndpoint, AmazonApiGatewayV2EndpointHandler, GetInputResponse, LoggerContext } from "./AmazonApiGatewayEndpointAdaptor-BrB3RfbI.mjs";
|
|
4
4
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
5
5
|
import { Service } from "@geekmidas/services";
|
|
6
6
|
import { EventPublisher } from "@geekmidas/events";
|
|
@@ -18,4 +18,4 @@ declare class AmazonApiGatewayV2Endpoint<TRoute extends string, TMethod extends
|
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
20
|
export { AmazonApiGatewayV2Endpoint };
|
|
21
|
-
//# sourceMappingURL=AmazonApiGatewayV2EndpointAdaptor-
|
|
21
|
+
//# sourceMappingURL=AmazonApiGatewayV2EndpointAdaptor-DAJdtgek.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_AmazonApiGatewayEndpointAdaptor = require('./AmazonApiGatewayEndpointAdaptor-
|
|
1
|
+
const require_AmazonApiGatewayEndpointAdaptor = require('./AmazonApiGatewayEndpointAdaptor-BEzWkW5m.cjs');
|
|
2
2
|
const require_parseQueryParams = require('./parseQueryParams-C2EjouGt.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/endpoints/AmazonApiGatewayV2EndpointAdaptor.ts
|
|
@@ -43,4 +43,4 @@ Object.defineProperty(exports, 'AmazonApiGatewayV2Endpoint', {
|
|
|
43
43
|
return AmazonApiGatewayV2Endpoint;
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
//# sourceMappingURL=AmazonApiGatewayV2EndpointAdaptor-
|
|
46
|
+
//# sourceMappingURL=AmazonApiGatewayV2EndpointAdaptor-DH9yJsC8.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonApiGatewayV2EndpointAdaptor-
|
|
1
|
+
{"version":3,"file":"AmazonApiGatewayV2EndpointAdaptor-DH9yJsC8.cjs","names":["AmazonApiGatewayEndpoint","e: APIGatewayProxyEventV2","processedParams: Record<string, string | string[]>","event: APIGatewayProxyEventV2","context: Context","envParser: EnvironmentParser<{}>","endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n >"],"sources":["../src/endpoints/AmazonApiGatewayV2EndpointAdaptor.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { HttpMethod } from '../types';\nimport type { Endpoint, EndpointSchemas } from './Endpoint';\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { EventPublisher } from '@geekmidas/events';\nimport type { Service } from '@geekmidas/services';\nimport type { APIGatewayProxyEventV2, Context } from 'aws-lambda';\nimport {\n AmazonApiGatewayEndpoint,\n type AmazonApiGatewayV2EndpointHandler,\n type GetInputResponse,\n type LoggerContext,\n} from './AmazonApiGatewayEndpointAdaptor';\nimport { parseQueryParams } from './parseQueryParams';\n\nexport class AmazonApiGatewayV2Endpoint<\n TRoute extends string,\n TMethod extends HttpMethod,\n TInput extends EndpointSchemas = {},\n TOutSchema extends StandardSchemaV1 | undefined = undefined,\n TServices extends Service[] = [],\n TLogger extends Logger = Logger,\n TSession = unknown,\n TEventPublisher extends EventPublisher<any> | undefined = undefined,\n> extends AmazonApiGatewayEndpoint<\n AmazonApiGatewayV2EndpointHandler,\n APIGatewayProxyEventV2,\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n> {\n getInput(e: APIGatewayProxyEventV2): GetInputResponse {\n // API Gateway V2 handles arrays as comma-separated values\n const queryParams = e.queryStringParameters || {};\n const processedParams: Record<string, string | string[]> = {};\n\n for (const [key, value] of Object.entries(queryParams)) {\n if (value !== undefined) {\n // Check if value contains comma and could be an array\n // Be careful not to split values that legitimately contain commas\n if (value.includes(',') && !value.includes('\"')) {\n processedParams[key] = value.split(',').map((v) => v.trim());\n } else {\n processedParams[key] = value;\n }\n }\n }\n\n return {\n body: e.body ? JSON.parse(e.body) : undefined,\n query: parseQueryParams(processedParams),\n params: e.pathParameters || {},\n };\n }\n getLoggerContext(\n event: APIGatewayProxyEventV2,\n context: Context,\n ): LoggerContext {\n return {\n fn: {\n name: context.functionName,\n version: context.functionVersion,\n },\n req: {\n id: event.requestContext.requestId,\n awsRequestId: context.awsRequestId,\n ip: event.requestContext.http.sourceIp,\n userAgent: event.requestContext.http.userAgent || undefined,\n path: event.requestContext.http.path,\n },\n };\n }\n constructor(\n protected envParser: EnvironmentParser<{}>,\n protected readonly endpoint: Endpoint<\n TRoute,\n TMethod,\n TInput,\n TOutSchema,\n TServices,\n TLogger,\n TSession,\n TEventPublisher\n >,\n ) {\n super(envParser, endpoint);\n }\n}\n"],"mappings":";;;;AAiBA,IAAa,6BAAb,cASUA,iEAWR;CACA,SAASC,GAA6C;EAEpD,MAAM,cAAc,EAAE,yBAAyB,CAAE;EACjD,MAAMC,kBAAqD,CAAE;AAE7D,OAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,YAAY,CACpD,KAAI,iBAGF,KAAI,MAAM,SAAS,IAAI,KAAK,MAAM,SAAS,KAAI,CAC7C,iBAAgB,OAAO,MAAM,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;MAE5D,iBAAgB,OAAO;AAK7B,SAAO;GACL,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,KAAK;GACjC,OAAO,0CAAiB,gBAAgB;GACxC,QAAQ,EAAE,kBAAkB,CAAE;EAC/B;CACF;CACD,iBACEC,OACAC,SACe;AACf,SAAO;GACL,IAAI;IACF,MAAM,QAAQ;IACd,SAAS,QAAQ;GAClB;GACD,KAAK;IACH,IAAI,MAAM,eAAe;IACzB,cAAc,QAAQ;IACtB,IAAI,MAAM,eAAe,KAAK;IAC9B,WAAW,MAAM,eAAe,KAAK;IACrC,MAAM,MAAM,eAAe,KAAK;GACjC;EACF;CACF;CACD,YACYC,WACSC,UAUnB;AACA,QAAM,WAAW,SAAS;EAZhB;EACS;CAYpB;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpMethod } from "./types-Bp9ysFXd.cjs";
|
|
2
|
-
import { Endpoint, EndpointSchemas } from "./Endpoint-
|
|
3
|
-
import { AmazonApiGatewayEndpoint, AmazonApiGatewayV2EndpointHandler, GetInputResponse, LoggerContext } from "./AmazonApiGatewayEndpointAdaptor-
|
|
2
|
+
import { Endpoint, EndpointSchemas } from "./Endpoint-XUMNAXYy.cjs";
|
|
3
|
+
import { AmazonApiGatewayEndpoint, AmazonApiGatewayV2EndpointHandler, GetInputResponse, LoggerContext } from "./AmazonApiGatewayEndpointAdaptor-BFhJ2Rpz.cjs";
|
|
4
4
|
import { EventPublisher } from "@geekmidas/events";
|
|
5
5
|
import { Logger } from "@geekmidas/logger";
|
|
6
6
|
import { Service } from "@geekmidas/services";
|
|
@@ -18,4 +18,4 @@ declare class AmazonApiGatewayV2Endpoint<TRoute extends string, TMethod extends
|
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
20
|
export { AmazonApiGatewayV2Endpoint };
|
|
21
|
-
//# sourceMappingURL=AmazonApiGatewayV2EndpointAdaptor-
|
|
21
|
+
//# sourceMappingURL=AmazonApiGatewayV2EndpointAdaptor-DX-Uci5w.d.cts.map
|