@geekmidas/constructs 0.0.16 → 0.0.17
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/{Cron-Bi3QOge_.cjs → Cron-3bP5rwXs.cjs} +1 -1
- package/dist/{Cron-Bi3QOge_.cjs.map → Cron-3bP5rwXs.cjs.map} +1 -1
- package/dist/{Cron-Dy_HW2Vv.mjs → Cron-gISh3p1m.mjs} +1 -1
- package/dist/{Cron-Dy_HW2Vv.mjs.map → Cron-gISh3p1m.mjs.map} +1 -1
- package/dist/{CronBuilder-Dv_w7Yri.cjs → CronBuilder-2zUMc0WT.cjs} +2 -2
- package/dist/{CronBuilder-Dv_w7Yri.cjs.map → CronBuilder-2zUMc0WT.cjs.map} +1 -1
- package/dist/{CronBuilder-Bl3A2Zp4.mjs → CronBuilder-BCYftl8v.mjs} +2 -2
- package/dist/{CronBuilder-Bl3A2Zp4.mjs.map → CronBuilder-BCYftl8v.mjs.map} +1 -1
- package/dist/{EndpointBuilder-DLoHiV83.d.mts → EndpointBuilder-D02Qo4Ha.d.mts} +9 -8
- package/dist/{EndpointBuilder-C3cdFvpS.d.cts → EndpointBuilder-DHPOWw0B.d.cts} +9 -8
- package/dist/{EndpointBuilder-I--56szz.mjs → EndpointBuilder-DN0NQp1W.mjs} +2 -1
- package/dist/EndpointBuilder-DN0NQp1W.mjs.map +1 -0
- package/dist/{EndpointBuilder-B8vyK_Fy.cjs → EndpointBuilder-bMiowRHY.cjs} +2 -1
- package/dist/EndpointBuilder-bMiowRHY.cjs.map +1 -0
- package/dist/{EndpointFactory-jm5ZKNDj.mjs → EndpointFactory-B0ldqkHz.mjs} +3 -2
- package/dist/EndpointFactory-B0ldqkHz.mjs.map +1 -0
- package/dist/{EndpointFactory-Sho97vyd.d.cts → EndpointFactory-DFFXRU-l.d.cts} +22 -21
- package/dist/{EndpointFactory-BR9goiXy.cjs → EndpointFactory-DqvIVjOy.cjs} +3 -2
- package/dist/EndpointFactory-DqvIVjOy.cjs.map +1 -0
- package/dist/{EndpointFactory-6YMPR9pB.d.mts → EndpointFactory-g84YJjGf.d.mts} +22 -21
- package/dist/{HonoEndpointAdaptor-7hIKI32d.d.mts → HonoEndpointAdaptor-Br1vuQ3A.d.mts} +3 -3
- package/dist/{HonoEndpointAdaptor-Bwp0-Z-K.d.cts → HonoEndpointAdaptor-Dc8XsOxw.d.cts} +3 -3
- package/dist/adaptors/aws.d.cts +1 -1
- package/dist/adaptors/aws.d.mts +1 -1
- package/dist/adaptors/hono.d.cts +2 -2
- package/dist/adaptors/hono.d.mts +2 -2
- package/dist/adaptors/testing.d.cts +1 -1
- package/dist/adaptors/testing.d.mts +1 -1
- package/dist/crons/Cron.cjs +1 -1
- package/dist/crons/Cron.d.cts +1 -1
- package/dist/crons/Cron.d.mts +1 -1
- package/dist/crons/Cron.mjs +1 -1
- package/dist/crons/CronBuilder.cjs +2 -2
- package/dist/crons/CronBuilder.d.cts +1 -1
- package/dist/crons/CronBuilder.d.mts +1 -1
- package/dist/crons/CronBuilder.mjs +2 -2
- package/dist/crons/index.cjs +2 -2
- package/dist/crons/index.d.cts +1 -1
- package/dist/crons/index.d.mts +5 -5
- package/dist/crons/index.mjs +2 -2
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.cts +1 -1
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.mts +1 -1
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.cts +1 -1
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.mts +1 -1
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.cts +1 -1
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.mts +1 -1
- package/dist/endpoints/Endpoint.d.cts +1 -1
- package/dist/endpoints/Endpoint.d.mts +1 -1
- package/dist/endpoints/EndpointBuilder.cjs +1 -1
- package/dist/endpoints/EndpointBuilder.d.cts +2 -2
- package/dist/endpoints/EndpointBuilder.d.mts +2 -2
- package/dist/endpoints/EndpointBuilder.mjs +1 -1
- package/dist/endpoints/EndpointFactory.cjs +2 -2
- package/dist/endpoints/EndpointFactory.d.cts +3 -3
- package/dist/endpoints/EndpointFactory.d.mts +3 -3
- package/dist/endpoints/EndpointFactory.mjs +2 -2
- package/dist/endpoints/HonoEndpointAdaptor.d.cts +2 -2
- package/dist/endpoints/HonoEndpointAdaptor.d.mts +2 -2
- package/dist/endpoints/TestEndpointAdaptor.d.cts +1 -1
- package/dist/endpoints/TestEndpointAdaptor.d.mts +1 -1
- package/dist/endpoints/audit.d.cts +1 -1
- package/dist/endpoints/audit.d.mts +1 -1
- package/dist/endpoints/helpers.d.cts +1 -1
- package/dist/endpoints/helpers.d.mts +1 -1
- package/dist/endpoints/index.cjs +2 -2
- package/dist/endpoints/index.d.cts +5 -5
- package/dist/endpoints/index.d.mts +5 -5
- package/dist/endpoints/index.mjs +2 -2
- package/dist/endpoints/processAudits.d.cts +1 -1
- package/dist/endpoints/processAudits.d.mts +1 -1
- package/dist/functions/index.d.cts +1 -1
- package/dist/functions/index.d.mts +1 -1
- package/dist/{index-Chb-374q.d.mts → index-C1dy81Sw.d.cts} +2 -2
- package/dist/index-TxufD5Xp.d.mts +10 -0
- package/dist/subscribers/index.d.mts +2 -2
- package/package.json +5 -5
- package/src/endpoints/EndpointBuilder.ts +28 -45
- package/src/endpoints/EndpointFactory.ts +38 -6
- package/dist/EndpointBuilder-B8vyK_Fy.cjs.map +0 -1
- package/dist/EndpointBuilder-I--56szz.mjs.map +0 -1
- package/dist/EndpointFactory-BR9goiXy.cjs.map +0 -1
- package/dist/EndpointFactory-jm5ZKNDj.mjs.map +0 -1
- package/dist/index-Bu0XAj5A.d.cts +0 -10
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Authorizer } from "./Authorizer-BTmly8ps.cjs";
|
|
2
2
|
import { ActorExtractor, AuthorizeFn, SessionFn } from "./Endpoint-Bu8Phz6y.cjs";
|
|
3
|
-
import { EndpointBuilder } from "./EndpointBuilder-
|
|
4
|
-
import { AuditStorage } from "@geekmidas/audit";
|
|
3
|
+
import { EndpointBuilder } from "./EndpointBuilder-DHPOWw0B.cjs";
|
|
4
|
+
import { AuditStorage, AuditableAction, ExtractStorageAuditAction } from "@geekmidas/audit";
|
|
5
5
|
import { EventPublisher, MappedEvent } from "@geekmidas/events";
|
|
6
6
|
import { Logger } from "@geekmidas/logger";
|
|
7
7
|
import { Service } from "@geekmidas/services";
|
|
8
8
|
|
|
9
9
|
//#region src/endpoints/EndpointFactory.d.ts
|
|
10
|
-
declare class EndpointFactory<TServices extends Service[] = [], TBasePath extends string = '', TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuthorizers extends readonly string[] = readonly string[], TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string> {
|
|
10
|
+
declare class EndpointFactory<TServices extends Service[] = [], TBasePath extends string = '', TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuthorizers extends readonly string[] = readonly string[], TAuditStorage extends AuditStorage<any> | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = ExtractStorageAuditAction<NonNullable<TAuditStorage>>, TDatabase = undefined, TDatabaseServiceName extends string = string> {
|
|
11
11
|
private defaultServices;
|
|
12
12
|
private basePath;
|
|
13
13
|
private defaultAuthorizeFn?;
|
|
@@ -33,35 +33,36 @@ declare class EndpointFactory<TServices extends Service[] = [], TBasePath extend
|
|
|
33
33
|
defaultActorExtractor
|
|
34
34
|
}?: EndpointFactoryOptions<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>);
|
|
35
35
|
static joinPaths<TBasePath extends string, P extends string>(path: P, basePath?: TBasePath): JoinPaths<TBasePath, P>;
|
|
36
|
-
authorizers<const T extends readonly string[]>(authorizers: T): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, T, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
37
|
-
route<TPath extends string>(path: TPath): EndpointFactory<TServices, JoinPaths<TBasePath, TPath>, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
38
|
-
authorize(fn: AuthorizeFn<TServices, TLogger, TSession>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
39
|
-
services<S extends Service[]>(services: S): EndpointFactory<[...S, ...TServices], TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
40
|
-
logger<L extends Logger>(logger: L): EndpointFactory<TServices, TBasePath, L, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
41
|
-
publisher<T extends EventPublisher<any>, TServiceName extends string = string>(publisher: Service<TServiceName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, T, TServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
42
|
-
session<T>(session: SessionFn<TServices, TLogger, T>): EndpointFactory<TServices, TBasePath, TLogger, T, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
36
|
+
authorizers<const T extends readonly string[]>(authorizers: T): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, T, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
37
|
+
route<TPath extends string>(path: TPath): EndpointFactory<TServices, JoinPaths<TBasePath, TPath>, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
38
|
+
authorize(fn: AuthorizeFn<TServices, TLogger, TSession>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
39
|
+
services<S extends Service[]>(services: S): EndpointFactory<[...S, ...TServices], TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
40
|
+
logger<L extends Logger>(logger: L): EndpointFactory<TServices, TBasePath, L, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
41
|
+
publisher<T extends EventPublisher<any>, TServiceName extends string = string>(publisher: Service<TServiceName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, T, TServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
42
|
+
session<T>(session: SessionFn<TServices, TLogger, T>): EndpointFactory<TServices, TBasePath, TLogger, T, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
43
43
|
/**
|
|
44
44
|
* Set the database service for endpoints created from this factory.
|
|
45
45
|
* The database will be available in handler context as `db`.
|
|
46
46
|
*/
|
|
47
|
-
database<T, TName extends string>(service: Service<TName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, T, TName>;
|
|
47
|
+
database<T, TName extends string>(service: Service<TName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, T, TName>;
|
|
48
48
|
/**
|
|
49
49
|
* Set the auditor storage service for endpoints created from this factory.
|
|
50
50
|
* This enables audit functionality and makes `auditor` available in handler context.
|
|
51
|
+
* The audit action type is automatically inferred from the storage's generic parameter.
|
|
51
52
|
*/
|
|
52
|
-
auditor<T extends AuditStorage
|
|
53
|
+
auditor<T extends AuditStorage<any>, TName extends string>(storage: Service<TName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, T, TName, ExtractStorageAuditAction<T>, TDatabase, TDatabaseServiceName>;
|
|
53
54
|
/**
|
|
54
55
|
* Set the actor extractor function for endpoints created from this factory.
|
|
55
56
|
* The actor is extracted from the request context and attached to all audits.
|
|
56
57
|
*/
|
|
57
|
-
actor(extractor: ActorExtractor<TServices, TSession, TLogger>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
58
|
+
actor(extractor: ActorExtractor<TServices, TSession, TLogger>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
58
59
|
private createBuilder;
|
|
59
|
-
post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "POST", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
60
|
-
get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "GET", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
61
|
-
put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "PUT", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
62
|
-
delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "DELETE", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
63
|
-
patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "PATCH", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
64
|
-
options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "OPTIONS", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
60
|
+
post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "POST", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
61
|
+
get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "GET", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
62
|
+
put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "PUT", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
63
|
+
delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "DELETE", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
64
|
+
patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "PATCH", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
65
|
+
options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "OPTIONS", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
65
66
|
}
|
|
66
67
|
type RemoveTrailingSlash<T extends string> = T extends `${infer Rest}/` ? Rest extends '' ? T : Rest : T;
|
|
67
68
|
type JoinPaths<TBasePath extends string, TPath extends string> = RemoveTrailingSlash<TBasePath extends '' ? TPath : TPath extends '' ? TBasePath : TBasePath extends '/' ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest}` ? `${TBasePath}/${Rest}` : `${TBasePath}/${TPath}`>;
|
|
@@ -79,7 +80,7 @@ interface EndpointFactoryOptions<TServices extends Service[] = [], TBasePath ext
|
|
|
79
80
|
defaultDatabaseService?: Service<TDatabaseServiceName, TDatabase>;
|
|
80
81
|
defaultActorExtractor?: ActorExtractor<TServices, TSession, TLogger>;
|
|
81
82
|
}
|
|
82
|
-
declare const e: EndpointFactory<[], "", Logger, unknown, undefined, string, readonly string[], undefined, string, undefined, string>;
|
|
83
|
+
declare const e: EndpointFactory<[], "", Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string>;
|
|
83
84
|
//#endregion
|
|
84
85
|
export { EndpointFactory, EndpointFactoryOptions, JoinPaths, RemoveTrailingSlash, e };
|
|
85
|
-
//# sourceMappingURL=EndpointFactory-
|
|
86
|
+
//# sourceMappingURL=EndpointFactory-DFFXRU-l.d.cts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_EndpointBuilder = require('./EndpointBuilder-
|
|
2
|
+
const require_EndpointBuilder = require('./EndpointBuilder-bMiowRHY.cjs');
|
|
3
3
|
const __geekmidas_logger_console = require_chunk.__toESM(require("@geekmidas/logger/console"));
|
|
4
4
|
const lodash_uniqby = require_chunk.__toESM(require("lodash.uniqby"));
|
|
5
5
|
|
|
@@ -170,6 +170,7 @@ var EndpointFactory = class EndpointFactory {
|
|
|
170
170
|
/**
|
|
171
171
|
* Set the auditor storage service for endpoints created from this factory.
|
|
172
172
|
* This enables audit functionality and makes `auditor` available in handler context.
|
|
173
|
+
* The audit action type is automatically inferred from the storage's generic parameter.
|
|
173
174
|
*/
|
|
174
175
|
auditor(storage) {
|
|
175
176
|
return new EndpointFactory({
|
|
@@ -254,4 +255,4 @@ Object.defineProperty(exports, 'e', {
|
|
|
254
255
|
return e;
|
|
255
256
|
}
|
|
256
257
|
});
|
|
257
|
-
//# sourceMappingURL=EndpointFactory-
|
|
258
|
+
//# sourceMappingURL=EndpointFactory-DqvIVjOy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndpointFactory-DqvIVjOy.cjs","names":["ConsoleLogger","path: P","basePath: TBasePath","authorizers: T","path: TPath","fn: AuthorizeFn<TServices, TLogger, TSession>","services: S","logger: L","publisher: Service<TServiceName, T>","session: SessionFn<TServices, TLogger, T>","service: Service<TName, T>","storage: Service<TName, T>","extractor: ActorExtractor<TServices, TSession, TLogger>","method: TMethod","EndpointBuilder"],"sources":["../src/endpoints/EndpointFactory.ts"],"sourcesContent":["import type {\n AuditStorage,\n AuditableAction,\n ExtractStorageAuditAction,\n} from '@geekmidas/audit';\nimport type { EventPublisher, MappedEvent } from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport { ConsoleLogger } from '@geekmidas/logger/console';\nimport type { Service } from '@geekmidas/services';\nimport uniqBy from 'lodash.uniqby';\nimport type { HttpMethod } from '../types';\nimport type { ActorExtractor } from './audit';\nimport type { Authorizer } from './Authorizer';\nimport type { AuthorizeFn, SessionFn } from './Endpoint';\nimport { EndpointBuilder } from './EndpointBuilder';\n\nconst DEFAULT_LOGGER = new ConsoleLogger() as any;\n\nexport class EndpointFactory<\n TServices extends Service[] = [],\n TBasePath extends string = '',\n TLogger extends Logger = Logger,\n TSession = unknown,\n TEventPublisher extends EventPublisher<any> | undefined = undefined,\n TEventPublisherServiceName extends string = string,\n TAuthorizers extends readonly string[] = readonly string[],\n TAuditStorage extends AuditStorage<any> | undefined = undefined,\n TAuditStorageServiceName extends string = string,\n TAuditAction extends AuditableAction<string, unknown> = ExtractStorageAuditAction<\n NonNullable<TAuditStorage>\n >,\n TDatabase = undefined,\n TDatabaseServiceName extends string = string,\n> {\n // @ts-ignore\n private defaultServices: TServices;\n private basePath: TBasePath = '' as TBasePath;\n private defaultAuthorizeFn?: AuthorizeFn<TServices, TLogger, TSession>;\n private defaultEventPublisher:\n | Service<TEventPublisherServiceName, TEventPublisher>\n | undefined;\n private defaultSessionExtractor?: SessionFn<TServices, TLogger, TSession>;\n private defaultLogger: TLogger = DEFAULT_LOGGER;\n private availableAuthorizers: Authorizer[] = [];\n private defaultAuthorizerName?: TAuthorizers[number];\n private defaultAuditorStorage:\n | Service<TAuditStorageServiceName, TAuditStorage>\n | undefined;\n private defaultDatabaseService:\n | Service<TDatabaseServiceName, TDatabase>\n | undefined;\n private defaultActorExtractor?: ActorExtractor<TServices, TSession, TLogger>;\n\n constructor({\n basePath,\n defaultAuthorizeFn,\n defaultLogger,\n defaultSessionExtractor,\n // @ts-ignore\n defaultServices = [] as TServices,\n defaultEventPublisher,\n availableAuthorizers = [],\n defaultAuthorizerName,\n defaultAuditorStorage,\n defaultDatabaseService,\n defaultActorExtractor,\n }: EndpointFactoryOptions<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TDatabase,\n TDatabaseServiceName\n > = {}) {\n // Initialize default services\n this.defaultServices = uniqBy(\n defaultServices,\n (s) => s.serviceName,\n ) as TServices;\n\n this.basePath = basePath || ('' as TBasePath);\n this.defaultAuthorizeFn = defaultAuthorizeFn;\n this.defaultLogger = defaultLogger || (DEFAULT_LOGGER as TLogger);\n this.defaultSessionExtractor = defaultSessionExtractor;\n this.defaultEventPublisher = defaultEventPublisher;\n this.availableAuthorizers = availableAuthorizers;\n this.defaultAuthorizerName = defaultAuthorizerName;\n this.defaultAuditorStorage = defaultAuditorStorage;\n this.defaultDatabaseService = defaultDatabaseService;\n this.defaultActorExtractor = defaultActorExtractor;\n }\n\n static joinPaths<TBasePath extends string, P extends string>(\n path: P,\n basePath: TBasePath = '' as TBasePath,\n ): JoinPaths<TBasePath, P> {\n // Handle empty cases\n if (!basePath && !path) return '/' as JoinPaths<TBasePath, P>;\n if (!basePath)\n return (path.startsWith('/') ? path : '/' + path) as JoinPaths<\n TBasePath,\n P\n >;\n if (!path)\n return (\n basePath.startsWith('/') ? basePath : '/' + basePath\n ) as JoinPaths<TBasePath, P>;\n\n const base = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;\n const segment = path.startsWith('/') ? path : '/' + path;\n\n let result = base + segment;\n\n // Ensure leading slash\n if (!result.startsWith('/')) {\n result = '/' + result;\n }\n\n // Normalize multiple slashes (except in the middle of the path where they might be intentional)\n result = result.replace(/^\\/+/g, '/');\n\n // Remove trailing slash unless it's the root path \"/\"\n if (result.length > 1 && result.endsWith('/')) {\n result = result.slice(0, -1);\n }\n\n return result as JoinPaths<TBasePath, P>;\n }\n\n // Configure available authorizers\n authorizers<const T extends readonly string[]>(\n authorizers: T,\n ): EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n T,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n > {\n const authorizerConfigs = authorizers.map((name) => ({\n name,\n }));\n return new EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n T,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n >({\n defaultServices: this.defaultServices,\n basePath: this.basePath,\n defaultAuthorizeFn: this.defaultAuthorizeFn,\n defaultLogger: this.defaultLogger,\n defaultSessionExtractor: this.defaultSessionExtractor,\n defaultEventPublisher: this.defaultEventPublisher,\n availableAuthorizers: authorizerConfigs,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: this.defaultAuditorStorage,\n defaultDatabaseService: this.defaultDatabaseService,\n defaultActorExtractor: this.defaultActorExtractor,\n });\n }\n\n // Create a sub-router with a path prefix\n route<TPath extends string>(\n path: TPath,\n ): EndpointFactory<\n TServices,\n JoinPaths<TBasePath, TPath>,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n > {\n const newBasePath = EndpointFactory.joinPaths(path, this.basePath);\n return new EndpointFactory<\n TServices,\n JoinPaths<TBasePath, TPath>,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n >({\n defaultServices: this.defaultServices,\n basePath: newBasePath,\n defaultAuthorizeFn: this.defaultAuthorizeFn,\n defaultLogger: this.defaultLogger,\n defaultSessionExtractor: this.defaultSessionExtractor,\n defaultEventPublisher: this.defaultEventPublisher,\n availableAuthorizers: this.availableAuthorizers,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: this.defaultAuditorStorage,\n defaultDatabaseService: this.defaultDatabaseService,\n defaultActorExtractor: this.defaultActorExtractor,\n });\n }\n\n // Create a new factory with authorization\n authorize(\n fn: AuthorizeFn<TServices, TLogger, TSession>,\n ): EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n > {\n return new EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n >({\n defaultServices: this.defaultServices,\n basePath: this.basePath,\n defaultAuthorizeFn: fn,\n defaultLogger: this.defaultLogger,\n defaultSessionExtractor: this.defaultSessionExtractor,\n defaultEventPublisher: this.defaultEventPublisher,\n availableAuthorizers: this.availableAuthorizers,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: this.defaultAuditorStorage,\n defaultDatabaseService: this.defaultDatabaseService,\n defaultActorExtractor: this.defaultActorExtractor,\n });\n }\n\n // Create a new factory with services\n services<S extends Service[]>(\n services: S,\n ): EndpointFactory<\n [...S, ...TServices],\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n > {\n return new EndpointFactory<\n [...S, ...TServices],\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n >({\n defaultServices: [...services, ...this.defaultServices],\n basePath: this.basePath,\n defaultAuthorizeFn: this.defaultAuthorizeFn,\n defaultLogger: this.defaultLogger,\n defaultSessionExtractor: this.defaultSessionExtractor,\n defaultEventPublisher: this.defaultEventPublisher,\n availableAuthorizers: this.availableAuthorizers,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: this.defaultAuditorStorage,\n defaultDatabaseService: this.defaultDatabaseService,\n defaultActorExtractor: this.defaultActorExtractor,\n });\n }\n\n logger<L extends Logger>(\n logger: L,\n ): EndpointFactory<\n TServices,\n TBasePath,\n L,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n > {\n return new EndpointFactory<\n TServices,\n TBasePath,\n L,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n >({\n defaultServices: this.defaultServices,\n basePath: this.basePath,\n defaultAuthorizeFn: this.defaultAuthorizeFn as unknown as AuthorizeFn<\n TServices,\n L,\n TSession\n >,\n defaultLogger: logger,\n defaultSessionExtractor: this\n .defaultSessionExtractor as unknown as SessionFn<\n TServices,\n L,\n TSession\n >,\n defaultEventPublisher: this.defaultEventPublisher,\n availableAuthorizers: this.availableAuthorizers,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: this.defaultAuditorStorage,\n defaultDatabaseService: this.defaultDatabaseService,\n defaultActorExtractor: this\n .defaultActorExtractor as unknown as ActorExtractor<TServices, TSession, L>,\n });\n }\n\n publisher<\n T extends EventPublisher<any>,\n TServiceName extends string = string,\n >(\n publisher: Service<TServiceName, T>,\n ): EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n T,\n TServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n > {\n return new EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n T,\n TServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n >({\n defaultServices: this.defaultServices,\n basePath: this.basePath,\n defaultAuthorizeFn: this.defaultAuthorizeFn,\n defaultLogger: this.defaultLogger,\n defaultSessionExtractor: this.defaultSessionExtractor,\n defaultEventPublisher: publisher,\n availableAuthorizers: this.availableAuthorizers,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: this.defaultAuditorStorage,\n defaultDatabaseService: this.defaultDatabaseService,\n defaultActorExtractor: this.defaultActorExtractor,\n });\n }\n\n session<T>(\n session: SessionFn<TServices, TLogger, T>,\n ): EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n T,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n > {\n return new EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n T,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n >({\n defaultServices: this.defaultServices,\n basePath: this.basePath,\n defaultAuthorizeFn: this.defaultAuthorizeFn as unknown as AuthorizeFn<\n TServices,\n TLogger,\n T\n >,\n defaultLogger: this.defaultLogger,\n defaultSessionExtractor: session,\n defaultEventPublisher: this.defaultEventPublisher,\n availableAuthorizers: this.availableAuthorizers,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: this.defaultAuditorStorage,\n defaultDatabaseService: this.defaultDatabaseService,\n defaultActorExtractor: this\n .defaultActorExtractor as unknown as ActorExtractor<TServices, T, TLogger>,\n });\n }\n\n /**\n * Set the database service for endpoints created from this factory.\n * The database will be available in handler context as `db`.\n */\n database<T, TName extends string>(\n service: Service<TName, T>,\n ): EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n T,\n TName\n > {\n return new EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n T,\n TName\n >({\n defaultServices: this.defaultServices,\n basePath: this.basePath,\n defaultAuthorizeFn: this.defaultAuthorizeFn,\n defaultLogger: this.defaultLogger,\n defaultSessionExtractor: this.defaultSessionExtractor,\n defaultEventPublisher: this.defaultEventPublisher,\n availableAuthorizers: this.availableAuthorizers,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: this.defaultAuditorStorage,\n defaultDatabaseService: service,\n });\n }\n\n /**\n * Set the auditor storage service for endpoints created from this factory.\n * This enables audit functionality and makes `auditor` available in handler context.\n * The audit action type is automatically inferred from the storage's generic parameter.\n */\n auditor<T extends AuditStorage<any>, TName extends string>(\n storage: Service<TName, T>,\n ): EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n T,\n TName,\n ExtractStorageAuditAction<T>,\n TDatabase,\n TDatabaseServiceName\n > {\n return new EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n T,\n TName,\n ExtractStorageAuditAction<T>,\n TDatabase,\n TDatabaseServiceName\n >({\n defaultServices: this.defaultServices,\n basePath: this.basePath,\n defaultAuthorizeFn: this.defaultAuthorizeFn,\n defaultLogger: this.defaultLogger,\n defaultSessionExtractor: this.defaultSessionExtractor,\n defaultEventPublisher: this.defaultEventPublisher,\n availableAuthorizers: this.availableAuthorizers,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: storage,\n defaultDatabaseService: this.defaultDatabaseService,\n defaultActorExtractor: this.defaultActorExtractor as unknown as ActorExtractor<\n TServices,\n TSession,\n TLogger\n >,\n });\n }\n\n /**\n * Set the actor extractor function for endpoints created from this factory.\n * The actor is extracted from the request context and attached to all audits.\n */\n actor(\n extractor: ActorExtractor<TServices, TSession, TLogger>,\n ): EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n > {\n return new EndpointFactory<\n TServices,\n TBasePath,\n TLogger,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n >({\n defaultServices: this.defaultServices,\n basePath: this.basePath,\n defaultAuthorizeFn: this.defaultAuthorizeFn,\n defaultLogger: this.defaultLogger,\n defaultSessionExtractor: this.defaultSessionExtractor,\n defaultEventPublisher: this.defaultEventPublisher,\n availableAuthorizers: this.availableAuthorizers,\n defaultAuthorizerName: this.defaultAuthorizerName,\n defaultAuditorStorage: this.defaultAuditorStorage,\n defaultDatabaseService: this.defaultDatabaseService,\n defaultActorExtractor: extractor,\n });\n }\n\n private createBuilder<TMethod extends HttpMethod, TPath extends string>(\n method: TMethod,\n path: TPath,\n ): EndpointBuilder<\n JoinPaths<TBasePath, TPath>,\n TMethod,\n {},\n TServices,\n TLogger,\n undefined,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n > {\n const fullPath = EndpointFactory.joinPaths(path, this.basePath);\n const builder = new EndpointBuilder<\n JoinPaths<TBasePath, TPath>,\n TMethod,\n {},\n TServices,\n TLogger,\n undefined,\n TSession,\n TEventPublisher,\n TEventPublisherServiceName,\n TAuthorizers,\n TAuditStorage,\n TAuditStorageServiceName,\n TAuditAction,\n TDatabase,\n TDatabaseServiceName\n >(fullPath, method);\n\n if (this.defaultAuthorizeFn) {\n // @ts-ignore\n builder._authorize = this.defaultAuthorizeFn;\n }\n if (this.defaultServices.length) {\n // Create a copy to avoid sharing references between builders\n builder._services = [...this.defaultServices] as TServices;\n }\n\n if (this.defaultLogger) {\n builder._logger = this.defaultLogger as TLogger;\n }\n\n if (this.defaultSessionExtractor) {\n builder._getSession = this.defaultSessionExtractor as SessionFn<\n TServices,\n TLogger,\n TSession\n >;\n }\n\n if (this.defaultEventPublisher) {\n builder._setPublisher(this.defaultEventPublisher);\n }\n\n // Set available authorizers and default\n builder._availableAuthorizers = this.availableAuthorizers;\n if (this.defaultAuthorizerName) {\n builder._authorizerName = this.defaultAuthorizerName;\n }\n\n // Set auditor storage if configured\n if (this.defaultAuditorStorage) {\n builder._setAuditorStorage(this.defaultAuditorStorage as any);\n }\n\n // Set database service if configured\n if (this.defaultDatabaseService) {\n builder._setDatabaseService(this.defaultDatabaseService as any);\n }\n\n // Set actor extractor if configured\n if (this.defaultActorExtractor) {\n builder._actorExtractor = this.defaultActorExtractor;\n }\n\n return builder;\n }\n\n post<TPath extends string>(path: TPath) {\n return this.createBuilder('POST', path);\n }\n\n get<TPath extends string>(path: TPath) {\n return this.createBuilder('GET', path);\n }\n\n put<TPath extends string>(path: TPath) {\n return this.createBuilder('PUT', path);\n }\n\n delete<TPath extends string>(path: TPath) {\n return this.createBuilder('DELETE', path);\n }\n\n patch<TPath extends string>(path: TPath) {\n return this.createBuilder('PATCH', path);\n }\n\n options<TPath extends string>(path: TPath) {\n return this.createBuilder('OPTIONS', path);\n }\n}\n\nexport type RemoveTrailingSlash<T extends string> = T extends `${infer Rest}/`\n ? Rest extends ''\n ? T // Keep \"/\" as is\n : Rest\n : T;\n\nexport type JoinPaths<\n TBasePath extends string,\n TPath extends string,\n> = RemoveTrailingSlash<\n TBasePath extends ''\n ? TPath\n : TPath extends ''\n ? TBasePath\n : TBasePath extends '/'\n ? TPath extends `/${string}`\n ? TPath\n : `/${TPath}`\n : TBasePath extends `${infer Base}/`\n ? TPath extends `/${infer Rest}`\n ? `${Base}/${Rest}`\n : `${Base}/${TPath}`\n : TPath extends `/${infer Rest}`\n ? `${TBasePath}/${Rest}`\n : `${TBasePath}/${TPath}`\n>;\n\nexport interface EndpointFactoryOptions<\n TServices extends Service[] = [],\n TBasePath extends string = '',\n TLogger extends Logger = Logger,\n TSession = unknown,\n TEventPublisher extends EventPublisher<any> | undefined = undefined,\n TEventPublisherServiceName extends string = string,\n TAuthorizers extends readonly string[] = readonly string[],\n TAuditStorage extends AuditStorage | undefined = undefined,\n TAuditStorageServiceName extends string = string,\n TDatabase = undefined,\n TDatabaseServiceName extends string = string,\n> {\n defaultServices?: TServices;\n basePath?: TBasePath;\n defaultAuthorizeFn?: AuthorizeFn<TServices, TLogger, TSession>;\n defaultLogger?: TLogger;\n defaultSessionExtractor?: SessionFn<TServices, TLogger, TSession>;\n defaultEventPublisher?: Service<TEventPublisherServiceName, TEventPublisher>;\n defaultEvents?: MappedEvent<TEventPublisher, undefined>[];\n availableAuthorizers?: Authorizer[];\n defaultAuthorizerName?: TAuthorizers[number];\n defaultAuditorStorage?: Service<TAuditStorageServiceName, TAuditStorage>;\n defaultDatabaseService?: Service<TDatabaseServiceName, TDatabase>;\n defaultActorExtractor?: ActorExtractor<TServices, TSession, TLogger>;\n}\n\nexport const e = new EndpointFactory();\n"],"mappings":"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"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Authorizer } from "./Authorizer-pmPvIVgv.mjs";
|
|
2
2
|
import { ActorExtractor, AuthorizeFn, SessionFn } from "./Endpoint-Bbs_sFvg.mjs";
|
|
3
|
-
import { EndpointBuilder } from "./EndpointBuilder-
|
|
3
|
+
import { EndpointBuilder } from "./EndpointBuilder-D02Qo4Ha.mjs";
|
|
4
4
|
import { Service } from "@geekmidas/services";
|
|
5
|
-
import { AuditStorage } from "@geekmidas/audit";
|
|
5
|
+
import { AuditStorage, AuditableAction, ExtractStorageAuditAction } from "@geekmidas/audit";
|
|
6
6
|
import { EventPublisher, MappedEvent } from "@geekmidas/events";
|
|
7
7
|
import { Logger } from "@geekmidas/logger";
|
|
8
8
|
|
|
9
9
|
//#region src/endpoints/EndpointFactory.d.ts
|
|
10
|
-
declare class EndpointFactory<TServices extends Service[] = [], TBasePath extends string = '', TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuthorizers extends readonly string[] = readonly string[], TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string> {
|
|
10
|
+
declare class EndpointFactory<TServices extends Service[] = [], TBasePath extends string = '', TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuthorizers extends readonly string[] = readonly string[], TAuditStorage extends AuditStorage<any> | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = ExtractStorageAuditAction<NonNullable<TAuditStorage>>, TDatabase = undefined, TDatabaseServiceName extends string = string> {
|
|
11
11
|
private defaultServices;
|
|
12
12
|
private basePath;
|
|
13
13
|
private defaultAuthorizeFn?;
|
|
@@ -33,35 +33,36 @@ declare class EndpointFactory<TServices extends Service[] = [], TBasePath extend
|
|
|
33
33
|
defaultActorExtractor
|
|
34
34
|
}?: EndpointFactoryOptions<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>);
|
|
35
35
|
static joinPaths<TBasePath extends string, P extends string>(path: P, basePath?: TBasePath): JoinPaths<TBasePath, P>;
|
|
36
|
-
authorizers<const T extends readonly string[]>(authorizers: T): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, T, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
37
|
-
route<TPath extends string>(path: TPath): EndpointFactory<TServices, JoinPaths<TBasePath, TPath>, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
38
|
-
authorize(fn: AuthorizeFn<TServices, TLogger, TSession>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
39
|
-
services<S extends Service[]>(services: S): EndpointFactory<[...S, ...TServices], TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
40
|
-
logger<L extends Logger>(logger: L): EndpointFactory<TServices, TBasePath, L, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
41
|
-
publisher<T extends EventPublisher<any>, TServiceName extends string = string>(publisher: Service<TServiceName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, T, TServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
42
|
-
session<T>(session: SessionFn<TServices, TLogger, T>): EndpointFactory<TServices, TBasePath, TLogger, T, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
36
|
+
authorizers<const T extends readonly string[]>(authorizers: T): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, T, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
37
|
+
route<TPath extends string>(path: TPath): EndpointFactory<TServices, JoinPaths<TBasePath, TPath>, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
38
|
+
authorize(fn: AuthorizeFn<TServices, TLogger, TSession>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
39
|
+
services<S extends Service[]>(services: S): EndpointFactory<[...S, ...TServices], TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
40
|
+
logger<L extends Logger>(logger: L): EndpointFactory<TServices, TBasePath, L, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
41
|
+
publisher<T extends EventPublisher<any>, TServiceName extends string = string>(publisher: Service<TServiceName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, T, TServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
42
|
+
session<T>(session: SessionFn<TServices, TLogger, T>): EndpointFactory<TServices, TBasePath, TLogger, T, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
43
43
|
/**
|
|
44
44
|
* Set the database service for endpoints created from this factory.
|
|
45
45
|
* The database will be available in handler context as `db`.
|
|
46
46
|
*/
|
|
47
|
-
database<T, TName extends string>(service: Service<TName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, T, TName>;
|
|
47
|
+
database<T, TName extends string>(service: Service<TName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, T, TName>;
|
|
48
48
|
/**
|
|
49
49
|
* Set the auditor storage service for endpoints created from this factory.
|
|
50
50
|
* This enables audit functionality and makes `auditor` available in handler context.
|
|
51
|
+
* The audit action type is automatically inferred from the storage's generic parameter.
|
|
51
52
|
*/
|
|
52
|
-
auditor<T extends AuditStorage
|
|
53
|
+
auditor<T extends AuditStorage<any>, TName extends string>(storage: Service<TName, T>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, T, TName, ExtractStorageAuditAction<T>, TDatabase, TDatabaseServiceName>;
|
|
53
54
|
/**
|
|
54
55
|
* Set the actor extractor function for endpoints created from this factory.
|
|
55
56
|
* The actor is extracted from the request context and attached to all audits.
|
|
56
57
|
*/
|
|
57
|
-
actor(extractor: ActorExtractor<TServices, TSession, TLogger>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>;
|
|
58
|
+
actor(extractor: ActorExtractor<TServices, TSession, TLogger>): EndpointFactory<TServices, TBasePath, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
58
59
|
private createBuilder;
|
|
59
|
-
post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "POST", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
60
|
-
get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "GET", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
61
|
-
put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "PUT", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
62
|
-
delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "DELETE", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
63
|
-
patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "PATCH", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
64
|
-
options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "OPTIONS", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName,
|
|
60
|
+
post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "POST", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
61
|
+
get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "GET", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
62
|
+
put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "PUT", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
63
|
+
delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "DELETE", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
64
|
+
patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "PATCH", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
65
|
+
options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TBasePath extends "" ? TPath : TPath extends "" ? TBasePath : TBasePath extends "/" ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest_1}` ? `${TBasePath}/${Rest_1}` : `${TBasePath}/${TPath}`>, "OPTIONS", {}, TServices, TLogger, undefined, TSession, TEventPublisher, TEventPublisherServiceName, TAuthorizers, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>;
|
|
65
66
|
}
|
|
66
67
|
type RemoveTrailingSlash<T extends string> = T extends `${infer Rest}/` ? Rest extends '' ? T : Rest : T;
|
|
67
68
|
type JoinPaths<TBasePath extends string, TPath extends string> = RemoveTrailingSlash<TBasePath extends '' ? TPath : TPath extends '' ? TBasePath : TBasePath extends '/' ? TPath extends `/${string}` ? TPath : `/${TPath}` : TBasePath extends `${infer Base}/` ? TPath extends `/${infer Rest}` ? `${Base}/${Rest}` : `${Base}/${TPath}` : TPath extends `/${infer Rest}` ? `${TBasePath}/${Rest}` : `${TBasePath}/${TPath}`>;
|
|
@@ -79,7 +80,7 @@ interface EndpointFactoryOptions<TServices extends Service[] = [], TBasePath ext
|
|
|
79
80
|
defaultDatabaseService?: Service<TDatabaseServiceName, TDatabase>;
|
|
80
81
|
defaultActorExtractor?: ActorExtractor<TServices, TSession, TLogger>;
|
|
81
82
|
}
|
|
82
|
-
declare const e: EndpointFactory<[], "", Logger, unknown, undefined, string, readonly string[], undefined, string, undefined, string>;
|
|
83
|
+
declare const e: EndpointFactory<[], "", Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string>;
|
|
83
84
|
//#endregion
|
|
84
85
|
export { EndpointFactory, EndpointFactoryOptions, JoinPaths, RemoveTrailingSlash, e };
|
|
85
|
-
//# sourceMappingURL=EndpointFactory-
|
|
86
|
+
//# sourceMappingURL=EndpointFactory-g84YJjGf.d.mts.map
|
|
@@ -7,7 +7,7 @@ import { EnvironmentParser } from "@geekmidas/envkit";
|
|
|
7
7
|
import { EventPublisher } from "@geekmidas/events";
|
|
8
8
|
import { Logger } from "@geekmidas/logger";
|
|
9
9
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
10
|
-
import * as
|
|
10
|
+
import * as hono_types0 from "hono/types";
|
|
11
11
|
|
|
12
12
|
//#region src/endpoints/HonoEndpointAdaptor.d.ts
|
|
13
13
|
interface HonoEndpointOptions {
|
|
@@ -33,11 +33,11 @@ declare class HonoEndpoint<TRoute extends string, TMethod extends HttpMethod, TI
|
|
|
33
33
|
static validate<T extends StandardSchemaV1>(c: Context<any, string, {}>, data: unknown, schema?: T): Promise<unknown>;
|
|
34
34
|
addRoute(serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>, TLogger>, app: Hono): void;
|
|
35
35
|
static applyEventMiddleware(app: Hono, serviceDiscovery: ServiceDiscovery<any, any>): void;
|
|
36
|
-
static fromRoutes<TLogger extends Logger, TServices extends Service[]>(routes: string[], envParser: EnvironmentParser<{}>, app: Hono<
|
|
36
|
+
static fromRoutes<TLogger extends Logger, TServices extends Service[]>(routes: string[], envParser: EnvironmentParser<{}>, app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/"> | undefined, logger: TLogger, cwd?: string, options?: HonoEndpointOptions): Promise<Hono>;
|
|
37
37
|
static addRoutes<TServices extends Service[] = [], TLogger extends Logger = Logger>(endpoints: Endpoint<string, HttpMethod, any, any, TServices, TLogger>[], serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>, TLogger>, app: Hono, options?: HonoEndpointOptions): void;
|
|
38
38
|
static addRoute<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string>(endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>, serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>, TLogger>, app: Hono): void;
|
|
39
39
|
static addDocsRoute<TServices extends Service[] = [], TLogger extends Logger = Logger>(endpoints: Endpoint<string, HttpMethod, any, any, TServices, TLogger>[], app: Hono, docsPath: string, openApiOptions?: HonoEndpointOptions['openApiOptions']): void;
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
export { HonoEndpoint, HonoEndpointOptions };
|
|
43
|
-
//# sourceMappingURL=HonoEndpointAdaptor-
|
|
43
|
+
//# sourceMappingURL=HonoEndpointAdaptor-Br1vuQ3A.d.mts.map
|
|
@@ -6,7 +6,7 @@ import { Logger } from "@geekmidas/logger";
|
|
|
6
6
|
import { Service, ServiceDiscovery, ServiceRecord } from "@geekmidas/services";
|
|
7
7
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
8
8
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
9
|
-
import * as
|
|
9
|
+
import * as hono_types7 from "hono/types";
|
|
10
10
|
import { Context, Hono } from "hono";
|
|
11
11
|
|
|
12
12
|
//#region src/endpoints/HonoEndpointAdaptor.d.ts
|
|
@@ -33,11 +33,11 @@ declare class HonoEndpoint<TRoute extends string, TMethod extends HttpMethod, TI
|
|
|
33
33
|
static validate<T extends StandardSchemaV1>(c: Context<any, string, {}>, data: unknown, schema?: T): Promise<unknown>;
|
|
34
34
|
addRoute(serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>, TLogger>, app: Hono): void;
|
|
35
35
|
static applyEventMiddleware(app: Hono, serviceDiscovery: ServiceDiscovery<any, any>): void;
|
|
36
|
-
static fromRoutes<TLogger extends Logger, TServices extends Service[]>(routes: string[], envParser: EnvironmentParser<{}>, app: Hono<
|
|
36
|
+
static fromRoutes<TLogger extends Logger, TServices extends Service[]>(routes: string[], envParser: EnvironmentParser<{}>, app: Hono<hono_types7.BlankEnv, hono_types7.BlankSchema, "/"> | undefined, logger: TLogger, cwd?: string, options?: HonoEndpointOptions): Promise<Hono>;
|
|
37
37
|
static addRoutes<TServices extends Service[] = [], TLogger extends Logger = Logger>(endpoints: Endpoint<string, HttpMethod, any, any, TServices, TLogger>[], serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>, TLogger>, app: Hono, options?: HonoEndpointOptions): void;
|
|
38
38
|
static addRoute<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string>(endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>, serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>, TLogger>, app: Hono): void;
|
|
39
39
|
static addDocsRoute<TServices extends Service[] = [], TLogger extends Logger = Logger>(endpoints: Endpoint<string, HttpMethod, any, any, TServices, TLogger>[], app: Hono, docsPath: string, openApiOptions?: HonoEndpointOptions['openApiOptions']): void;
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
export { HonoEndpoint, HonoEndpointOptions };
|
|
43
|
-
//# sourceMappingURL=HonoEndpointAdaptor-
|
|
43
|
+
//# sourceMappingURL=HonoEndpointAdaptor-Dc8XsOxw.d.cts.map
|
package/dist/adaptors/aws.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ import "../types-Bp9ysFXd.cjs";
|
|
|
3
3
|
import "../Function-VI1TB3Mh.cjs";
|
|
4
4
|
import "../BaseFunctionBuilder-DUZMbEr3.cjs";
|
|
5
5
|
import "../FunctionBuilder-CjVEFTYC.cjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-C1dy81Sw.cjs";
|
|
7
7
|
import "../Authorizer-BTmly8ps.cjs";
|
|
8
8
|
import "../Endpoint-Bu8Phz6y.cjs";
|
|
9
9
|
import "../AmazonApiGatewayEndpointAdaptor-ro0RMLzr.cjs";
|
package/dist/adaptors/aws.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import "../types-DKf0juBf.mjs";
|
|
|
3
3
|
import "../Function-V9M9UVHp.mjs";
|
|
4
4
|
import "../BaseFunctionBuilder-CbDnPZpD.mjs";
|
|
5
5
|
import "../FunctionBuilder-D1ofSeMd.mjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-TxufD5Xp.mjs";
|
|
7
7
|
import "../Authorizer-pmPvIVgv.mjs";
|
|
8
8
|
import "../Endpoint-Bbs_sFvg.mjs";
|
|
9
9
|
import "../AmazonApiGatewayEndpointAdaptor-4hPy5vty.mjs";
|
package/dist/adaptors/hono.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ import "../types-Bp9ysFXd.cjs";
|
|
|
3
3
|
import "../Function-VI1TB3Mh.cjs";
|
|
4
4
|
import "../BaseFunctionBuilder-DUZMbEr3.cjs";
|
|
5
5
|
import "../FunctionBuilder-CjVEFTYC.cjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-C1dy81Sw.cjs";
|
|
7
7
|
import "../Authorizer-BTmly8ps.cjs";
|
|
8
8
|
import "../Endpoint-Bu8Phz6y.cjs";
|
|
9
|
-
import { HonoEndpoint } from "../HonoEndpointAdaptor-
|
|
9
|
+
import { HonoEndpoint } from "../HonoEndpointAdaptor-Dc8XsOxw.cjs";
|
|
10
10
|
export { HonoEndpoint };
|
package/dist/adaptors/hono.d.mts
CHANGED
|
@@ -3,8 +3,8 @@ import "../types-DKf0juBf.mjs";
|
|
|
3
3
|
import "../Function-V9M9UVHp.mjs";
|
|
4
4
|
import "../BaseFunctionBuilder-CbDnPZpD.mjs";
|
|
5
5
|
import "../FunctionBuilder-D1ofSeMd.mjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-TxufD5Xp.mjs";
|
|
7
7
|
import "../Authorizer-pmPvIVgv.mjs";
|
|
8
8
|
import "../Endpoint-Bbs_sFvg.mjs";
|
|
9
|
-
import { HonoEndpoint } from "../HonoEndpointAdaptor-
|
|
9
|
+
import { HonoEndpoint } from "../HonoEndpointAdaptor-Br1vuQ3A.mjs";
|
|
10
10
|
export { HonoEndpoint };
|
|
@@ -3,7 +3,7 @@ import "../types-Bp9ysFXd.cjs";
|
|
|
3
3
|
import "../Function-VI1TB3Mh.cjs";
|
|
4
4
|
import "../BaseFunctionBuilder-DUZMbEr3.cjs";
|
|
5
5
|
import "../FunctionBuilder-CjVEFTYC.cjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-C1dy81Sw.cjs";
|
|
7
7
|
import "../Authorizer-BTmly8ps.cjs";
|
|
8
8
|
import "../Endpoint-Bu8Phz6y.cjs";
|
|
9
9
|
import { TestEndpointAdaptor } from "../TestEndpointAdaptor-H5To8PH7.cjs";
|
|
@@ -3,7 +3,7 @@ import "../types-DKf0juBf.mjs";
|
|
|
3
3
|
import "../Function-V9M9UVHp.mjs";
|
|
4
4
|
import "../BaseFunctionBuilder-CbDnPZpD.mjs";
|
|
5
5
|
import "../FunctionBuilder-D1ofSeMd.mjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-TxufD5Xp.mjs";
|
|
7
7
|
import "../Authorizer-pmPvIVgv.mjs";
|
|
8
8
|
import "../Endpoint-Bbs_sFvg.mjs";
|
|
9
9
|
import { TestEndpointAdaptor } from "../TestEndpointAdaptor-jxn68ayg.mjs";
|
package/dist/crons/Cron.cjs
CHANGED
|
@@ -3,6 +3,6 @@ require('../Function-DagDbeXo.cjs');
|
|
|
3
3
|
require('../BaseFunctionBuilder-C5Se7pdL.cjs');
|
|
4
4
|
require('../FunctionBuilder-DXvG_XD-.cjs');
|
|
5
5
|
require('../functions-FCb-wWFC.cjs');
|
|
6
|
-
const require_Cron = require('../Cron-
|
|
6
|
+
const require_Cron = require('../Cron-3bP5rwXs.cjs');
|
|
7
7
|
|
|
8
8
|
exports.Cron = require_Cron.Cron;
|
package/dist/crons/Cron.d.cts
CHANGED
|
@@ -2,6 +2,6 @@ import "../Construct-dI_rgdSp.cjs";
|
|
|
2
2
|
import "../Function-VI1TB3Mh.cjs";
|
|
3
3
|
import "../BaseFunctionBuilder-DUZMbEr3.cjs";
|
|
4
4
|
import "../FunctionBuilder-CjVEFTYC.cjs";
|
|
5
|
-
import "../index-
|
|
5
|
+
import "../index-C1dy81Sw.cjs";
|
|
6
6
|
import { Cron, CronExpression, RateExpression, ScheduleExpression } from "../Cron-COdfP0Jd.cjs";
|
|
7
7
|
export { Cron, CronExpression, RateExpression, ScheduleExpression };
|
package/dist/crons/Cron.d.mts
CHANGED
|
@@ -2,6 +2,6 @@ import "../Construct-ZPqE0vhn.mjs";
|
|
|
2
2
|
import "../Function-V9M9UVHp.mjs";
|
|
3
3
|
import "../BaseFunctionBuilder-CbDnPZpD.mjs";
|
|
4
4
|
import "../FunctionBuilder-D1ofSeMd.mjs";
|
|
5
|
-
import "../index-
|
|
5
|
+
import "../index-TxufD5Xp.mjs";
|
|
6
6
|
import { Cron, CronExpression, RateExpression, ScheduleExpression } from "../Cron-D8cn_ahj.mjs";
|
|
7
7
|
export { Cron, CronExpression, RateExpression, ScheduleExpression };
|
package/dist/crons/Cron.mjs
CHANGED
|
@@ -3,6 +3,6 @@ import "../Function-DfKsM5Kx.mjs";
|
|
|
3
3
|
import "../BaseFunctionBuilder-B5gkW0Kt.mjs";
|
|
4
4
|
import "../FunctionBuilder-CVT7bG2o.mjs";
|
|
5
5
|
import "../functions-JhRsNoAZ.mjs";
|
|
6
|
-
import { Cron } from "../Cron-
|
|
6
|
+
import { Cron } from "../Cron-gISh3p1m.mjs";
|
|
7
7
|
|
|
8
8
|
export { Cron };
|
|
@@ -3,7 +3,7 @@ require('../Function-DagDbeXo.cjs');
|
|
|
3
3
|
require('../BaseFunctionBuilder-C5Se7pdL.cjs');
|
|
4
4
|
require('../FunctionBuilder-DXvG_XD-.cjs');
|
|
5
5
|
require('../functions-FCb-wWFC.cjs');
|
|
6
|
-
require('../Cron-
|
|
7
|
-
const require_CronBuilder = require('../CronBuilder-
|
|
6
|
+
require('../Cron-3bP5rwXs.cjs');
|
|
7
|
+
const require_CronBuilder = require('../CronBuilder-2zUMc0WT.cjs');
|
|
8
8
|
|
|
9
9
|
exports.CronBuilder = require_CronBuilder.CronBuilder;
|
|
@@ -2,7 +2,7 @@ import "../Construct-dI_rgdSp.cjs";
|
|
|
2
2
|
import "../Function-VI1TB3Mh.cjs";
|
|
3
3
|
import "../BaseFunctionBuilder-DUZMbEr3.cjs";
|
|
4
4
|
import "../FunctionBuilder-CjVEFTYC.cjs";
|
|
5
|
-
import "../index-
|
|
5
|
+
import "../index-C1dy81Sw.cjs";
|
|
6
6
|
import "../Cron-COdfP0Jd.cjs";
|
|
7
7
|
import { CronBuilder } from "../CronBuilder-DntF6H3A.cjs";
|
|
8
8
|
export { CronBuilder };
|
|
@@ -2,7 +2,7 @@ import "../Construct-ZPqE0vhn.mjs";
|
|
|
2
2
|
import "../Function-V9M9UVHp.mjs";
|
|
3
3
|
import "../BaseFunctionBuilder-CbDnPZpD.mjs";
|
|
4
4
|
import "../FunctionBuilder-D1ofSeMd.mjs";
|
|
5
|
-
import "../index-
|
|
5
|
+
import "../index-TxufD5Xp.mjs";
|
|
6
6
|
import "../Cron-D8cn_ahj.mjs";
|
|
7
7
|
import { CronBuilder } from "../CronBuilder-DoMnSs_0.mjs";
|
|
8
8
|
export { CronBuilder };
|
|
@@ -3,7 +3,7 @@ import "../Function-DfKsM5Kx.mjs";
|
|
|
3
3
|
import "../BaseFunctionBuilder-B5gkW0Kt.mjs";
|
|
4
4
|
import "../FunctionBuilder-CVT7bG2o.mjs";
|
|
5
5
|
import "../functions-JhRsNoAZ.mjs";
|
|
6
|
-
import "../Cron-
|
|
7
|
-
import { CronBuilder } from "../CronBuilder-
|
|
6
|
+
import "../Cron-gISh3p1m.mjs";
|
|
7
|
+
import { CronBuilder } from "../CronBuilder-BCYftl8v.mjs";
|
|
8
8
|
|
|
9
9
|
export { CronBuilder };
|
package/dist/crons/index.cjs
CHANGED
|
@@ -3,8 +3,8 @@ require('../Function-DagDbeXo.cjs');
|
|
|
3
3
|
require('../BaseFunctionBuilder-C5Se7pdL.cjs');
|
|
4
4
|
require('../FunctionBuilder-DXvG_XD-.cjs');
|
|
5
5
|
require('../functions-FCb-wWFC.cjs');
|
|
6
|
-
const require_Cron = require('../Cron-
|
|
7
|
-
const require_CronBuilder = require('../CronBuilder-
|
|
6
|
+
const require_Cron = require('../Cron-3bP5rwXs.cjs');
|
|
7
|
+
const require_CronBuilder = require('../CronBuilder-2zUMc0WT.cjs');
|
|
8
8
|
|
|
9
9
|
//#region src/crons/index.ts
|
|
10
10
|
const c = new require_CronBuilder.CronBuilder();
|
package/dist/crons/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import "../Construct-dI_rgdSp.cjs";
|
|
|
2
2
|
import "../Function-VI1TB3Mh.cjs";
|
|
3
3
|
import "../BaseFunctionBuilder-DUZMbEr3.cjs";
|
|
4
4
|
import "../FunctionBuilder-CjVEFTYC.cjs";
|
|
5
|
-
import "../index-
|
|
5
|
+
import "../index-C1dy81Sw.cjs";
|
|
6
6
|
import { Cron, CronExpression, RateExpression, ScheduleExpression } from "../Cron-COdfP0Jd.cjs";
|
|
7
7
|
import { CronBuilder } from "../CronBuilder-DntF6H3A.cjs";
|
|
8
8
|
import * as _geekmidas_logger2 from "@geekmidas/logger";
|
package/dist/crons/index.d.mts
CHANGED
|
@@ -2,15 +2,15 @@ import "../Construct-ZPqE0vhn.mjs";
|
|
|
2
2
|
import "../Function-V9M9UVHp.mjs";
|
|
3
3
|
import "../BaseFunctionBuilder-CbDnPZpD.mjs";
|
|
4
4
|
import "../FunctionBuilder-D1ofSeMd.mjs";
|
|
5
|
-
import "../index-
|
|
5
|
+
import "../index-TxufD5Xp.mjs";
|
|
6
6
|
import { Cron, CronExpression, RateExpression, ScheduleExpression } from "../Cron-D8cn_ahj.mjs";
|
|
7
7
|
import { CronBuilder } from "../CronBuilder-DoMnSs_0.mjs";
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
8
|
+
import * as _geekmidas_services4 from "@geekmidas/services";
|
|
9
|
+
import * as _geekmidas_logger5 from "@geekmidas/logger";
|
|
10
|
+
import * as _geekmidas_schema3 from "@geekmidas/schema";
|
|
11
11
|
|
|
12
12
|
//#region src/crons/index.d.ts
|
|
13
|
-
declare const c: CronBuilder<
|
|
13
|
+
declare const c: CronBuilder<_geekmidas_schema3.ComposableStandardSchema, _geekmidas_services4.Service<string, unknown>[], _geekmidas_logger5.Logger, undefined, undefined, string, undefined, string>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { Cron, CronBuilder, CronExpression, RateExpression, ScheduleExpression, c };
|
|
16
16
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/crons/index.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import "../Function-DfKsM5Kx.mjs";
|
|
|
3
3
|
import "../BaseFunctionBuilder-B5gkW0Kt.mjs";
|
|
4
4
|
import "../FunctionBuilder-CVT7bG2o.mjs";
|
|
5
5
|
import "../functions-JhRsNoAZ.mjs";
|
|
6
|
-
import { Cron } from "../Cron-
|
|
7
|
-
import { CronBuilder } from "../CronBuilder-
|
|
6
|
+
import { Cron } from "../Cron-gISh3p1m.mjs";
|
|
7
|
+
import { CronBuilder } from "../CronBuilder-BCYftl8v.mjs";
|
|
8
8
|
|
|
9
9
|
//#region src/crons/index.ts
|
|
10
10
|
const c = new CronBuilder();
|
|
@@ -3,7 +3,7 @@ import "../types-Bp9ysFXd.cjs";
|
|
|
3
3
|
import "../Function-VI1TB3Mh.cjs";
|
|
4
4
|
import "../BaseFunctionBuilder-DUZMbEr3.cjs";
|
|
5
5
|
import "../FunctionBuilder-CjVEFTYC.cjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-C1dy81Sw.cjs";
|
|
7
7
|
import "../Authorizer-BTmly8ps.cjs";
|
|
8
8
|
import "../Endpoint-Bu8Phz6y.cjs";
|
|
9
9
|
import { AmazonApiGatewayEndpoint, AmazonApiGatewayEndpointHandlerResponse, AmazonApiGatewayV1EndpointHandler, AmazonApiGatewayV2EndpointHandler, Event, GetInputResponse, HandlerEvent, LoggerContext } from "../AmazonApiGatewayEndpointAdaptor-ro0RMLzr.cjs";
|
|
@@ -3,7 +3,7 @@ import "../types-DKf0juBf.mjs";
|
|
|
3
3
|
import "../Function-V9M9UVHp.mjs";
|
|
4
4
|
import "../BaseFunctionBuilder-CbDnPZpD.mjs";
|
|
5
5
|
import "../FunctionBuilder-D1ofSeMd.mjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-TxufD5Xp.mjs";
|
|
7
7
|
import "../Authorizer-pmPvIVgv.mjs";
|
|
8
8
|
import "../Endpoint-Bbs_sFvg.mjs";
|
|
9
9
|
import { AmazonApiGatewayEndpoint, AmazonApiGatewayEndpointHandlerResponse, AmazonApiGatewayV1EndpointHandler, AmazonApiGatewayV2EndpointHandler, Event, GetInputResponse, HandlerEvent, LoggerContext } from "../AmazonApiGatewayEndpointAdaptor-4hPy5vty.mjs";
|
|
@@ -3,7 +3,7 @@ import "../types-Bp9ysFXd.cjs";
|
|
|
3
3
|
import "../Function-VI1TB3Mh.cjs";
|
|
4
4
|
import "../BaseFunctionBuilder-DUZMbEr3.cjs";
|
|
5
5
|
import "../FunctionBuilder-CjVEFTYC.cjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-C1dy81Sw.cjs";
|
|
7
7
|
import "../Authorizer-BTmly8ps.cjs";
|
|
8
8
|
import "../Endpoint-Bu8Phz6y.cjs";
|
|
9
9
|
import "../AmazonApiGatewayEndpointAdaptor-ro0RMLzr.cjs";
|
|
@@ -3,7 +3,7 @@ import "../types-DKf0juBf.mjs";
|
|
|
3
3
|
import "../Function-V9M9UVHp.mjs";
|
|
4
4
|
import "../BaseFunctionBuilder-CbDnPZpD.mjs";
|
|
5
5
|
import "../FunctionBuilder-D1ofSeMd.mjs";
|
|
6
|
-
import "../index-
|
|
6
|
+
import "../index-TxufD5Xp.mjs";
|
|
7
7
|
import "../Authorizer-pmPvIVgv.mjs";
|
|
8
8
|
import "../Endpoint-Bbs_sFvg.mjs";
|
|
9
9
|
import "../AmazonApiGatewayEndpointAdaptor-4hPy5vty.mjs";
|