@lakutata/entrypoint 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +183 -0
- package/THIRD_PARTY_NOTICES.md +206 -0
- package/dist/cjs/Entrypoint.d.ts +868 -0
- package/dist/cjs/Entrypoint.js +998 -0
- package/dist/cjs/adapter/commander/CommanderCLIEntrypoint.d.ts +192 -0
- package/dist/cjs/adapter/commander/CommanderCLIEntrypoint.js +439 -0
- package/dist/cjs/adapter/commander/Prompt.d.ts +22 -0
- package/dist/cjs/adapter/commander/Prompt.js +164 -0
- package/dist/cjs/adapter/commander/Width.d.ts +12 -0
- package/dist/cjs/adapter/commander/Width.js +67 -0
- package/dist/cjs/adapter/electron/ElectronIPCServiceEntrypoint.d.ts +203 -0
- package/dist/cjs/adapter/electron/ElectronIPCServiceEntrypoint.js +249 -0
- package/dist/cjs/adapter/express/ExpressHTTPEntrypoint.d.ts +172 -0
- package/dist/cjs/adapter/express/ExpressHTTPEntrypoint.js +301 -0
- package/dist/cjs/adapter/express/Responders.d.ts +89 -0
- package/dist/cjs/adapter/express/Responders.js +71 -0
- package/dist/cjs/adapter/express/StaticUI.d.ts +83 -0
- package/dist/cjs/adapter/express/StaticUI.js +104 -0
- package/dist/cjs/adapter/fastify/FastifyHTTPEntrypoint.d.ts +156 -0
- package/dist/cjs/adapter/fastify/FastifyHTTPEntrypoint.js +339 -0
- package/dist/cjs/adapter/fastify/Responders.d.ts +88 -0
- package/dist/cjs/adapter/fastify/Responders.js +77 -0
- package/dist/cjs/adapter/http/HTTPServiceEntrypoint.d.ts +117 -0
- package/dist/cjs/adapter/http/HTTPServiceEntrypoint.js +257 -0
- package/dist/cjs/adapter/jsonrpc/JSONRPCProtocol.d.ts +194 -0
- package/dist/cjs/adapter/jsonrpc/JSONRPCProtocol.js +187 -0
- package/dist/cjs/adapter/jsonrpc/JSONRPCServiceEntrypoint.d.ts +154 -0
- package/dist/cjs/adapter/jsonrpc/JSONRPCServiceEntrypoint.js +397 -0
- package/dist/cjs/adapter/schedule/ScheduleEntrypoint.d.ts +86 -0
- package/dist/cjs/adapter/schedule/ScheduleEntrypoint.js +275 -0
- package/dist/cjs/adapter/socket.io/SocketIOServiceEntrypoint.d.ts +138 -0
- package/dist/cjs/adapter/socket.io/SocketIOServiceEntrypoint.js +216 -0
- package/dist/cjs/channel/BuiltinChannels.d.ts +18 -0
- package/dist/cjs/channel/BuiltinChannels.js +128 -0
- package/dist/cjs/channel/Channel.d.ts +196 -0
- package/dist/cjs/channel/Channel.js +106 -0
- package/dist/cjs/channel/EntrypointAdapter.d.ts +195 -0
- package/dist/cjs/channel/EntrypointAdapter.js +43 -0
- package/dist/cjs/context/BaseContext.d.ts +75 -0
- package/dist/cjs/context/BaseContext.js +90 -0
- package/dist/cjs/context/CLIContext.d.ts +38 -0
- package/dist/cjs/context/CLIContext.js +53 -0
- package/dist/cjs/context/HTTPContext.d.ts +52 -0
- package/dist/cjs/context/HTTPContext.js +78 -0
- package/dist/cjs/context/ScheduleContext.d.ts +47 -0
- package/dist/cjs/context/ScheduleContext.js +65 -0
- package/dist/cjs/context/ServiceContext.d.ts +47 -0
- package/dist/cjs/context/ServiceContext.js +62 -0
- package/dist/cjs/decorators/CLIAction.d.ts +120 -0
- package/dist/cjs/decorators/CLIAction.js +13 -0
- package/dist/cjs/decorators/HTTPAction.d.ts +178 -0
- package/dist/cjs/decorators/HTTPAction.js +14 -0
- package/dist/cjs/decorators/Prefix.d.ts +44 -0
- package/dist/cjs/decorators/Prefix.js +48 -0
- package/dist/cjs/decorators/Schedule.d.ts +120 -0
- package/dist/cjs/decorators/Schedule.js +64 -0
- package/dist/cjs/decorators/ServiceAction.d.ts +116 -0
- package/dist/cjs/decorators/ServiceAction.js +12 -0
- package/dist/cjs/decorators/UseMiddlewares.d.ts +52 -0
- package/dist/cjs/decorators/UseMiddlewares.js +58 -0
- package/dist/cjs/decorators/http/DELETE.d.ts +87 -0
- package/dist/cjs/decorators/http/DELETE.js +7 -0
- package/dist/cjs/decorators/http/GET.d.ts +89 -0
- package/dist/cjs/decorators/http/GET.js +7 -0
- package/dist/cjs/decorators/http/HEAD.d.ts +84 -0
- package/dist/cjs/decorators/http/HEAD.js +7 -0
- package/dist/cjs/decorators/http/OPTIONS.d.ts +80 -0
- package/dist/cjs/decorators/http/OPTIONS.js +7 -0
- package/dist/cjs/decorators/http/PATCH.d.ts +90 -0
- package/dist/cjs/decorators/http/PATCH.js +7 -0
- package/dist/cjs/decorators/http/POST.d.ts +91 -0
- package/dist/cjs/decorators/http/POST.js +7 -0
- package/dist/cjs/decorators/http/PUT.d.ts +92 -0
- package/dist/cjs/decorators/http/PUT.js +7 -0
- package/dist/cjs/exceptions/AccessDeniedException.d.ts +10 -0
- package/dist/cjs/exceptions/AccessDeniedException.js +17 -0
- package/dist/cjs/exceptions/ControllerActionNotFoundException.d.ts +9 -0
- package/dist/cjs/exceptions/ControllerActionNotFoundException.js +16 -0
- package/dist/cjs/exceptions/DuplicateActionNameException.d.ts +8 -0
- package/dist/cjs/exceptions/DuplicateActionNameException.js +15 -0
- package/dist/cjs/exceptions/EntrypointStoppedException.d.ts +9 -0
- package/dist/cjs/exceptions/EntrypointStoppedException.js +16 -0
- package/dist/cjs/exceptions/InvalidActionGroupException.d.ts +4 -0
- package/dist/cjs/exceptions/InvalidActionGroupException.js +11 -0
- package/dist/cjs/exceptions/InvalidChannelException.d.ts +8 -0
- package/dist/cjs/exceptions/InvalidChannelException.js +15 -0
- package/dist/cjs/exceptions/InvalidEntrypointAdapterException.d.ts +9 -0
- package/dist/cjs/exceptions/InvalidEntrypointAdapterException.js +16 -0
- package/dist/cjs/exceptions/InvalidMiddlewareException.d.ts +8 -0
- package/dist/cjs/exceptions/InvalidMiddlewareException.js +15 -0
- package/dist/cjs/exceptions/InvalidPrefixException.d.ts +8 -0
- package/dist/cjs/exceptions/InvalidPrefixException.js +15 -0
- package/dist/cjs/exceptions/MiddlewareNextCalledException.d.ts +8 -0
- package/dist/cjs/exceptions/MiddlewareNextCalledException.js +15 -0
- package/dist/cjs/exceptions/RouteNotFoundException.d.ts +9 -0
- package/dist/cjs/exceptions/RouteNotFoundException.js +16 -0
- package/dist/cjs/exceptions/ServiceInvokeException.d.ts +11 -0
- package/dist/cjs/exceptions/ServiceInvokeException.js +14 -0
- package/dist/cjs/exports/CTRLDecorators.d.ts +13 -0
- package/dist/cjs/exports/CTRLDecorators.js +38 -0
- package/dist/cjs/exports/Channel.d.ts +14 -0
- package/dist/cjs/exports/Channel.js +33 -0
- package/dist/cjs/exports/CommanderAdapter.d.ts +1 -0
- package/dist/cjs/exports/CommanderAdapter.js +8 -0
- package/dist/cjs/exports/ElectronAdapter.d.ts +1 -0
- package/dist/cjs/exports/ElectronAdapter.js +9 -0
- package/dist/cjs/exports/Entrypoint.d.ts +24 -0
- package/dist/cjs/exports/Entrypoint.js +55 -0
- package/dist/cjs/exports/ExpressAdapter.d.ts +4 -0
- package/dist/cjs/exports/ExpressAdapter.js +15 -0
- package/dist/cjs/exports/FastifyAdapter.d.ts +4 -0
- package/dist/cjs/exports/FastifyAdapter.js +14 -0
- package/dist/cjs/exports/JSONRPCAdapter.d.ts +2 -0
- package/dist/cjs/exports/JSONRPCAdapter.js +11 -0
- package/dist/cjs/exports/SocketIOAdapter.d.ts +1 -0
- package/dist/cjs/exports/SocketIOAdapter.js +9 -0
- package/dist/cjs/lib/AccessControl.d.ts +118 -0
- package/dist/cjs/lib/AccessControl.js +208 -0
- package/dist/cjs/lib/AccessControlRule.d.ts +91 -0
- package/dist/cjs/lib/AccessControlRule.js +76 -0
- package/dist/cjs/lib/ActionOptions.d.ts +67 -0
- package/dist/cjs/lib/ActionOptions.js +67 -0
- package/dist/cjs/lib/ActionResult.d.ts +28 -0
- package/dist/cjs/lib/ActionResult.js +28 -0
- package/dist/cjs/lib/ApplicationOf.d.ts +6 -0
- package/dist/cjs/lib/ApplicationOf.js +14 -0
- package/dist/cjs/lib/Controller.d.ts +59 -0
- package/dist/cjs/lib/Controller.js +64 -0
- package/dist/cjs/lib/ControllerEntrypoint.d.ts +168 -0
- package/dist/cjs/lib/ControllerEntrypoint.js +239 -0
- package/dist/cjs/lib/GetActionDTOAndOptions.d.ts +29 -0
- package/dist/cjs/lib/GetActionDTOAndOptions.js +49 -0
- package/dist/cjs/lib/HTTPErrors.d.ts +55 -0
- package/dist/cjs/lib/HTTPErrors.js +52 -0
- package/dist/cjs/lib/Middleware.d.ts +146 -0
- package/dist/cjs/lib/Middleware.js +144 -0
- package/dist/cjs/lib/Prefix.d.ts +98 -0
- package/dist/cjs/lib/Prefix.js +151 -0
- package/dist/cjs/lib/Result.d.ts +173 -0
- package/dist/cjs/lib/Result.js +153 -0
- package/dist/cjs/lib/ServiceResponseCodec.d.ts +82 -0
- package/dist/cjs/lib/ServiceResponseCodec.js +117 -0
- package/dist/cjs/lib/StringifyPattern.d.ts +7 -0
- package/dist/cjs/lib/StringifyPattern.js +58 -0
- package/dist/cjs/lib/UnsetValue.d.ts +12 -0
- package/dist/cjs/lib/UnsetValue.js +216 -0
- package/dist/cjs/lib/pattern/GlobPattern.d.ts +34 -0
- package/dist/cjs/lib/pattern/GlobPattern.js +68 -0
- package/dist/cjs/lib/pattern/PatternManager.d.ts +103 -0
- package/dist/cjs/lib/pattern/PatternManager.js +233 -0
- package/dist/cjs/lib/schedule/Cron.d.ts +56 -0
- package/dist/cjs/lib/schedule/Cron.js +282 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types/CLIContextParams.d.ts +14 -0
- package/dist/cjs/types/CLIContextParams.js +2 -0
- package/dist/cjs/types/ErrorDescription.d.ts +14 -0
- package/dist/cjs/types/ErrorDescription.js +2 -0
- package/dist/cjs/types/HTTPContextParams.d.ts +27 -0
- package/dist/cjs/types/HTTPContextParams.js +2 -0
- package/dist/cjs/types/ScheduleContextParams.d.ts +21 -0
- package/dist/cjs/types/ScheduleContextParams.js +2 -0
- package/dist/cjs/types/ServiceContextParams.d.ts +16 -0
- package/dist/cjs/types/ServiceContextParams.js +2 -0
- package/dist/esm/Entrypoint.js +985 -0
- package/dist/esm/adapter/commander/CommanderCLIEntrypoint.js +433 -0
- package/dist/esm/adapter/commander/Prompt.js +127 -0
- package/dist/esm/adapter/commander/Width.js +63 -0
- package/dist/esm/adapter/electron/ElectronIPCServiceEntrypoint.js +212 -0
- package/dist/esm/adapter/express/ExpressHTTPEntrypoint.js +295 -0
- package/dist/esm/adapter/express/Responders.js +66 -0
- package/dist/esm/adapter/express/StaticUI.js +96 -0
- package/dist/esm/adapter/fastify/FastifyHTTPEntrypoint.js +333 -0
- package/dist/esm/adapter/fastify/Responders.js +73 -0
- package/dist/esm/adapter/http/HTTPServiceEntrypoint.js +253 -0
- package/dist/esm/adapter/jsonrpc/JSONRPCProtocol.js +182 -0
- package/dist/esm/adapter/jsonrpc/JSONRPCServiceEntrypoint.js +361 -0
- package/dist/esm/adapter/schedule/ScheduleEntrypoint.js +272 -0
- package/dist/esm/adapter/socket.io/SocketIOServiceEntrypoint.js +212 -0
- package/dist/esm/channel/BuiltinChannels.js +125 -0
- package/dist/esm/channel/Channel.js +100 -0
- package/dist/esm/channel/EntrypointAdapter.js +39 -0
- package/dist/esm/context/BaseContext.js +87 -0
- package/dist/esm/context/CLIContext.js +49 -0
- package/dist/esm/context/HTTPContext.js +74 -0
- package/dist/esm/context/ScheduleContext.js +61 -0
- package/dist/esm/context/ServiceContext.js +58 -0
- package/dist/esm/decorators/CLIAction.js +10 -0
- package/dist/esm/decorators/HTTPAction.js +11 -0
- package/dist/esm/decorators/Prefix.js +45 -0
- package/dist/esm/decorators/Schedule.js +61 -0
- package/dist/esm/decorators/ServiceAction.js +9 -0
- package/dist/esm/decorators/UseMiddlewares.js +55 -0
- package/dist/esm/decorators/http/DELETE.js +4 -0
- package/dist/esm/decorators/http/GET.js +4 -0
- package/dist/esm/decorators/http/HEAD.js +4 -0
- package/dist/esm/decorators/http/OPTIONS.js +4 -0
- package/dist/esm/decorators/http/PATCH.js +4 -0
- package/dist/esm/decorators/http/POST.js +4 -0
- package/dist/esm/decorators/http/PUT.js +4 -0
- package/dist/esm/exceptions/AccessDeniedException.js +13 -0
- package/dist/esm/exceptions/ControllerActionNotFoundException.js +12 -0
- package/dist/esm/exceptions/DuplicateActionNameException.js +11 -0
- package/dist/esm/exceptions/EntrypointStoppedException.js +12 -0
- package/dist/esm/exceptions/InvalidActionGroupException.js +7 -0
- package/dist/esm/exceptions/InvalidChannelException.js +11 -0
- package/dist/esm/exceptions/InvalidEntrypointAdapterException.js +12 -0
- package/dist/esm/exceptions/InvalidMiddlewareException.js +11 -0
- package/dist/esm/exceptions/InvalidPrefixException.js +11 -0
- package/dist/esm/exceptions/MiddlewareNextCalledException.js +11 -0
- package/dist/esm/exceptions/RouteNotFoundException.js +12 -0
- package/dist/esm/exceptions/ServiceInvokeException.js +10 -0
- package/dist/esm/exports/CTRLDecorators.js +19 -0
- package/dist/esm/exports/Channel.js +11 -0
- package/dist/esm/exports/CommanderAdapter.js +1 -0
- package/dist/esm/exports/ElectronAdapter.js +1 -0
- package/dist/esm/exports/Entrypoint.js +22 -0
- package/dist/esm/exports/ExpressAdapter.js +3 -0
- package/dist/esm/exports/FastifyAdapter.js +3 -0
- package/dist/esm/exports/JSONRPCAdapter.js +2 -0
- package/dist/esm/exports/SocketIOAdapter.js +1 -0
- package/dist/esm/lib/AccessControl.js +204 -0
- package/dist/esm/lib/AccessControlRule.js +72 -0
- package/dist/esm/lib/ActionOptions.js +63 -0
- package/dist/esm/lib/ActionResult.js +24 -0
- package/dist/esm/lib/ApplicationOf.js +11 -0
- package/dist/esm/lib/Controller.js +61 -0
- package/dist/esm/lib/ControllerEntrypoint.js +229 -0
- package/dist/esm/lib/GetActionDTOAndOptions.js +46 -0
- package/dist/esm/lib/HTTPErrors.js +48 -0
- package/dist/esm/lib/Middleware.js +134 -0
- package/dist/esm/lib/Prefix.js +143 -0
- package/dist/esm/lib/Result.js +147 -0
- package/dist/esm/lib/ServiceResponseCodec.js +113 -0
- package/dist/esm/lib/StringifyPattern.js +55 -0
- package/dist/esm/lib/UnsetValue.js +213 -0
- package/dist/esm/lib/pattern/GlobPattern.js +64 -0
- package/dist/esm/lib/pattern/PatternManager.js +229 -0
- package/dist/esm/lib/schedule/Cron.js +277 -0
- package/dist/esm/types/CLIContextParams.js +1 -0
- package/dist/esm/types/ErrorDescription.js +1 -0
- package/dist/esm/types/HTTPContextParams.js +1 -0
- package/dist/esm/types/ScheduleContextParams.js +1 -0
- package/dist/esm/types/ServiceContextParams.js +1 -0
- package/dist/types/Entrypoint.d.ts +868 -0
- package/dist/types/adapter/commander/CommanderCLIEntrypoint.d.ts +192 -0
- package/dist/types/adapter/commander/Prompt.d.ts +22 -0
- package/dist/types/adapter/commander/Width.d.ts +12 -0
- package/dist/types/adapter/electron/ElectronIPCServiceEntrypoint.d.ts +203 -0
- package/dist/types/adapter/express/ExpressHTTPEntrypoint.d.ts +172 -0
- package/dist/types/adapter/express/Responders.d.ts +89 -0
- package/dist/types/adapter/express/StaticUI.d.ts +83 -0
- package/dist/types/adapter/fastify/FastifyHTTPEntrypoint.d.ts +156 -0
- package/dist/types/adapter/fastify/Responders.d.ts +88 -0
- package/dist/types/adapter/http/HTTPServiceEntrypoint.d.ts +117 -0
- package/dist/types/adapter/jsonrpc/JSONRPCProtocol.d.ts +194 -0
- package/dist/types/adapter/jsonrpc/JSONRPCServiceEntrypoint.d.ts +154 -0
- package/dist/types/adapter/schedule/ScheduleEntrypoint.d.ts +86 -0
- package/dist/types/adapter/socket.io/SocketIOServiceEntrypoint.d.ts +138 -0
- package/dist/types/channel/BuiltinChannels.d.ts +18 -0
- package/dist/types/channel/Channel.d.ts +196 -0
- package/dist/types/channel/EntrypointAdapter.d.ts +195 -0
- package/dist/types/context/BaseContext.d.ts +75 -0
- package/dist/types/context/CLIContext.d.ts +38 -0
- package/dist/types/context/HTTPContext.d.ts +52 -0
- package/dist/types/context/ScheduleContext.d.ts +47 -0
- package/dist/types/context/ServiceContext.d.ts +47 -0
- package/dist/types/decorators/CLIAction.d.ts +120 -0
- package/dist/types/decorators/HTTPAction.d.ts +178 -0
- package/dist/types/decorators/Prefix.d.ts +44 -0
- package/dist/types/decorators/Schedule.d.ts +120 -0
- package/dist/types/decorators/ServiceAction.d.ts +116 -0
- package/dist/types/decorators/UseMiddlewares.d.ts +52 -0
- package/dist/types/decorators/http/DELETE.d.ts +87 -0
- package/dist/types/decorators/http/GET.d.ts +89 -0
- package/dist/types/decorators/http/HEAD.d.ts +84 -0
- package/dist/types/decorators/http/OPTIONS.d.ts +80 -0
- package/dist/types/decorators/http/PATCH.d.ts +90 -0
- package/dist/types/decorators/http/POST.d.ts +91 -0
- package/dist/types/decorators/http/PUT.d.ts +92 -0
- package/dist/types/exceptions/AccessDeniedException.d.ts +10 -0
- package/dist/types/exceptions/ControllerActionNotFoundException.d.ts +9 -0
- package/dist/types/exceptions/DuplicateActionNameException.d.ts +8 -0
- package/dist/types/exceptions/EntrypointStoppedException.d.ts +9 -0
- package/dist/types/exceptions/InvalidActionGroupException.d.ts +4 -0
- package/dist/types/exceptions/InvalidChannelException.d.ts +8 -0
- package/dist/types/exceptions/InvalidEntrypointAdapterException.d.ts +9 -0
- package/dist/types/exceptions/InvalidMiddlewareException.d.ts +8 -0
- package/dist/types/exceptions/InvalidPrefixException.d.ts +8 -0
- package/dist/types/exceptions/MiddlewareNextCalledException.d.ts +8 -0
- package/dist/types/exceptions/RouteNotFoundException.d.ts +9 -0
- package/dist/types/exceptions/ServiceInvokeException.d.ts +11 -0
- package/dist/types/exports/CTRLDecorators.d.ts +13 -0
- package/dist/types/exports/Channel.d.ts +14 -0
- package/dist/types/exports/CommanderAdapter.d.ts +1 -0
- package/dist/types/exports/ElectronAdapter.d.ts +1 -0
- package/dist/types/exports/Entrypoint.d.ts +24 -0
- package/dist/types/exports/ExpressAdapter.d.ts +4 -0
- package/dist/types/exports/FastifyAdapter.d.ts +4 -0
- package/dist/types/exports/JSONRPCAdapter.d.ts +2 -0
- package/dist/types/exports/SocketIOAdapter.d.ts +1 -0
- package/dist/types/lib/AccessControl.d.ts +118 -0
- package/dist/types/lib/AccessControlRule.d.ts +91 -0
- package/dist/types/lib/ActionOptions.d.ts +67 -0
- package/dist/types/lib/ActionResult.d.ts +28 -0
- package/dist/types/lib/ApplicationOf.d.ts +6 -0
- package/dist/types/lib/Controller.d.ts +59 -0
- package/dist/types/lib/ControllerEntrypoint.d.ts +168 -0
- package/dist/types/lib/GetActionDTOAndOptions.d.ts +29 -0
- package/dist/types/lib/HTTPErrors.d.ts +55 -0
- package/dist/types/lib/Middleware.d.ts +146 -0
- package/dist/types/lib/Prefix.d.ts +98 -0
- package/dist/types/lib/Result.d.ts +173 -0
- package/dist/types/lib/ServiceResponseCodec.d.ts +82 -0
- package/dist/types/lib/StringifyPattern.d.ts +7 -0
- package/dist/types/lib/UnsetValue.d.ts +12 -0
- package/dist/types/lib/pattern/GlobPattern.d.ts +34 -0
- package/dist/types/lib/pattern/PatternManager.d.ts +103 -0
- package/dist/types/lib/schedule/Cron.d.ts +56 -0
- package/dist/types/types/CLIContextParams.d.ts +14 -0
- package/dist/types/types/ErrorDescription.d.ts +14 -0
- package/dist/types/types/HTTPContextParams.d.ts +27 -0
- package/dist/types/types/ScheduleContextParams.d.ts +21 -0
- package/dist/types/types/ServiceContextParams.d.ts +16 -0
- package/package.json +152 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { CLIAction } from '../decorators/CLIAction.js';
|
|
2
|
+
export { HTTPAction } from '../decorators/HTTPAction.js';
|
|
3
|
+
export { DELETE } from '../decorators/http/DELETE.js';
|
|
4
|
+
export { GET } from '../decorators/http/GET.js';
|
|
5
|
+
export { HEAD } from '../decorators/http/HEAD.js';
|
|
6
|
+
export { OPTIONS } from '../decorators/http/OPTIONS.js';
|
|
7
|
+
export { PATCH } from '../decorators/http/PATCH.js';
|
|
8
|
+
export { POST } from '../decorators/http/POST.js';
|
|
9
|
+
export { PUT } from '../decorators/http/PUT.js';
|
|
10
|
+
export { ServiceAction } from '../decorators/ServiceAction.js';
|
|
11
|
+
export { UseMiddlewares } from '../decorators/UseMiddlewares.js';
|
|
12
|
+
export { Prefix } from '../decorators/Prefix.js';
|
|
13
|
+
export { Schedule, type ScheduleOptions } from '../decorators/Schedule.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Schedule = exports.Prefix = exports.UseMiddlewares = exports.ServiceAction = exports.PUT = exports.POST = exports.PATCH = exports.OPTIONS = exports.HEAD = exports.GET = exports.DELETE = exports.HTTPAction = exports.CLIAction = void 0;
|
|
4
|
+
//CLI actions
|
|
5
|
+
var CLIAction_js_1 = require("../decorators/CLIAction.js");
|
|
6
|
+
Object.defineProperty(exports, "CLIAction", { enumerable: true, get: function () { return CLIAction_js_1.CLIAction; } });
|
|
7
|
+
//HTTP actions
|
|
8
|
+
var HTTPAction_js_1 = require("../decorators/HTTPAction.js");
|
|
9
|
+
Object.defineProperty(exports, "HTTPAction", { enumerable: true, get: function () { return HTTPAction_js_1.HTTPAction; } });
|
|
10
|
+
var DELETE_js_1 = require("../decorators/http/DELETE.js");
|
|
11
|
+
Object.defineProperty(exports, "DELETE", { enumerable: true, get: function () { return DELETE_js_1.DELETE; } });
|
|
12
|
+
var GET_js_1 = require("../decorators/http/GET.js");
|
|
13
|
+
Object.defineProperty(exports, "GET", { enumerable: true, get: function () { return GET_js_1.GET; } });
|
|
14
|
+
var HEAD_js_1 = require("../decorators/http/HEAD.js");
|
|
15
|
+
Object.defineProperty(exports, "HEAD", { enumerable: true, get: function () { return HEAD_js_1.HEAD; } });
|
|
16
|
+
var OPTIONS_js_1 = require("../decorators/http/OPTIONS.js");
|
|
17
|
+
Object.defineProperty(exports, "OPTIONS", { enumerable: true, get: function () { return OPTIONS_js_1.OPTIONS; } });
|
|
18
|
+
var PATCH_js_1 = require("../decorators/http/PATCH.js");
|
|
19
|
+
Object.defineProperty(exports, "PATCH", { enumerable: true, get: function () { return PATCH_js_1.PATCH; } });
|
|
20
|
+
var POST_js_1 = require("../decorators/http/POST.js");
|
|
21
|
+
Object.defineProperty(exports, "POST", { enumerable: true, get: function () { return POST_js_1.POST; } });
|
|
22
|
+
var PUT_js_1 = require("../decorators/http/PUT.js");
|
|
23
|
+
Object.defineProperty(exports, "PUT", { enumerable: true, get: function () { return PUT_js_1.PUT; } });
|
|
24
|
+
//Service actions
|
|
25
|
+
var ServiceAction_js_1 = require("../decorators/ServiceAction.js");
|
|
26
|
+
Object.defineProperty(exports, "ServiceAction", { enumerable: true, get: function () { return ServiceAction_js_1.ServiceAction; } });
|
|
27
|
+
//Middlewares
|
|
28
|
+
var UseMiddlewares_js_1 = require("../decorators/UseMiddlewares.js");
|
|
29
|
+
Object.defineProperty(exports, "UseMiddlewares", { enumerable: true, get: function () { return UseMiddlewares_js_1.UseMiddlewares; } });
|
|
30
|
+
//Controller prefixes
|
|
31
|
+
var Prefix_js_1 = require("../decorators/Prefix.js");
|
|
32
|
+
Object.defineProperty(exports, "Prefix", { enumerable: true, get: function () { return Prefix_js_1.Prefix; } });
|
|
33
|
+
//Scheduled actions
|
|
34
|
+
var Schedule_js_1 = require("../decorators/Schedule.js");
|
|
35
|
+
Object.defineProperty(exports, "Schedule", { enumerable: true, get: function () { return Schedule_js_1.Schedule; } });
|
|
36
|
+
|
|
37
|
+
//The default of the entry: the entry itself (scripts/package-build/cjs-package.mjs)
|
|
38
|
+
if (!Object.prototype.hasOwnProperty.call(exports, 'default')) Object.defineProperty(exports, 'default', {value: exports})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The API of the packages providing a channel or an adapter
|
|
3
|
+
*/
|
|
4
|
+
export { defineChannel, getChannel, hasChannel, getChannelByContextType } from '../channel/Channel.js';
|
|
5
|
+
export type { ChannelDefinition, ChannelKind, ChannelEntry, ChannelMatch, ChannelMatcher } from '../channel/Channel.js';
|
|
6
|
+
export { isEntrypointAdapter, commandMap } from '../channel/EntrypointAdapter.js';
|
|
7
|
+
export type { EntrypointAdapter, ChannelRuntime, ChannelActionInfo, DispatchOptions } from '../channel/EntrypointAdapter.js';
|
|
8
|
+
export { registerControllerAction } from '../lib/ControllerEntrypoint.js';
|
|
9
|
+
export type { ActionDetails, ActionInfo } from '../lib/ControllerEntrypoint.js';
|
|
10
|
+
export { getActionDTOAndOptions } from '../lib/GetActionDTOAndOptions.js';
|
|
11
|
+
export { ActionOptions } from '../lib/ActionOptions.js';
|
|
12
|
+
export { HTTPChannel, CLIChannel, ServiceChannel, ScheduleChannel } from '../channel/BuiltinChannels.js';
|
|
13
|
+
export { ServiceResponseCodec, type ServiceResponse } from '../lib/ServiceResponseCodec.js';
|
|
14
|
+
export { getPrefix, setPrefix } from '../lib/Prefix.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPrefix = exports.getPrefix = exports.ServiceResponseCodec = exports.ScheduleChannel = exports.ServiceChannel = exports.CLIChannel = exports.HTTPChannel = exports.ActionOptions = exports.getActionDTOAndOptions = exports.registerControllerAction = exports.commandMap = exports.isEntrypointAdapter = exports.getChannelByContextType = exports.hasChannel = exports.getChannel = exports.defineChannel = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The API of the packages providing a channel or an adapter
|
|
6
|
+
*/
|
|
7
|
+
var Channel_js_1 = require("../channel/Channel.js");
|
|
8
|
+
Object.defineProperty(exports, "defineChannel", { enumerable: true, get: function () { return Channel_js_1.defineChannel; } });
|
|
9
|
+
Object.defineProperty(exports, "getChannel", { enumerable: true, get: function () { return Channel_js_1.getChannel; } });
|
|
10
|
+
Object.defineProperty(exports, "hasChannel", { enumerable: true, get: function () { return Channel_js_1.hasChannel; } });
|
|
11
|
+
Object.defineProperty(exports, "getChannelByContextType", { enumerable: true, get: function () { return Channel_js_1.getChannelByContextType; } });
|
|
12
|
+
var EntrypointAdapter_js_1 = require("../channel/EntrypointAdapter.js");
|
|
13
|
+
Object.defineProperty(exports, "isEntrypointAdapter", { enumerable: true, get: function () { return EntrypointAdapter_js_1.isEntrypointAdapter; } });
|
|
14
|
+
Object.defineProperty(exports, "commandMap", { enumerable: true, get: function () { return EntrypointAdapter_js_1.commandMap; } });
|
|
15
|
+
var ControllerEntrypoint_js_1 = require("../lib/ControllerEntrypoint.js");
|
|
16
|
+
Object.defineProperty(exports, "registerControllerAction", { enumerable: true, get: function () { return ControllerEntrypoint_js_1.registerControllerAction; } });
|
|
17
|
+
var GetActionDTOAndOptions_js_1 = require("../lib/GetActionDTOAndOptions.js");
|
|
18
|
+
Object.defineProperty(exports, "getActionDTOAndOptions", { enumerable: true, get: function () { return GetActionDTOAndOptions_js_1.getActionDTOAndOptions; } });
|
|
19
|
+
var ActionOptions_js_1 = require("../lib/ActionOptions.js");
|
|
20
|
+
Object.defineProperty(exports, "ActionOptions", { enumerable: true, get: function () { return ActionOptions_js_1.ActionOptions; } });
|
|
21
|
+
var BuiltinChannels_js_1 = require("../channel/BuiltinChannels.js");
|
|
22
|
+
Object.defineProperty(exports, "HTTPChannel", { enumerable: true, get: function () { return BuiltinChannels_js_1.HTTPChannel; } });
|
|
23
|
+
Object.defineProperty(exports, "CLIChannel", { enumerable: true, get: function () { return BuiltinChannels_js_1.CLIChannel; } });
|
|
24
|
+
Object.defineProperty(exports, "ServiceChannel", { enumerable: true, get: function () { return BuiltinChannels_js_1.ServiceChannel; } });
|
|
25
|
+
Object.defineProperty(exports, "ScheduleChannel", { enumerable: true, get: function () { return BuiltinChannels_js_1.ScheduleChannel; } });
|
|
26
|
+
var ServiceResponseCodec_js_1 = require("../lib/ServiceResponseCodec.js");
|
|
27
|
+
Object.defineProperty(exports, "ServiceResponseCodec", { enumerable: true, get: function () { return ServiceResponseCodec_js_1.ServiceResponseCodec; } });
|
|
28
|
+
var Prefix_js_1 = require("../lib/Prefix.js");
|
|
29
|
+
Object.defineProperty(exports, "getPrefix", { enumerable: true, get: function () { return Prefix_js_1.getPrefix; } });
|
|
30
|
+
Object.defineProperty(exports, "setPrefix", { enumerable: true, get: function () { return Prefix_js_1.setPrefix; } });
|
|
31
|
+
|
|
32
|
+
//The default of the entry: the entry itself (scripts/package-build/cjs-package.mjs)
|
|
33
|
+
if (!Object.prototype.hasOwnProperty.call(exports, 'default')) Object.defineProperty(exports, 'default', {value: exports})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { commanderCLIEntrypoint, type CommanderCLIEntrypointOptions, type CLIText, type CLITranslate } from '../adapter/commander/CommanderCLIEntrypoint.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commanderCLIEntrypoint = void 0;
|
|
4
|
+
var CommanderCLIEntrypoint_js_1 = require("../adapter/commander/CommanderCLIEntrypoint.js");
|
|
5
|
+
Object.defineProperty(exports, "commanderCLIEntrypoint", { enumerable: true, get: function () { return CommanderCLIEntrypoint_js_1.commanderCLIEntrypoint; } });
|
|
6
|
+
|
|
7
|
+
//The default of the entry: the entry itself (scripts/package-build/cjs-package.mjs)
|
|
8
|
+
if (!Object.prototype.hasOwnProperty.call(exports, 'default')) Object.defineProperty(exports, 'default', {value: exports})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { electronIPCServiceEntrypoint, ipcEventOfContext, type ElectronIPCServiceEntrypointOptions, type IPCMain, type IPCInvokeEvent, type IPCSender } from '../adapter/electron/ElectronIPCServiceEntrypoint.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ipcEventOfContext = exports.electronIPCServiceEntrypoint = void 0;
|
|
4
|
+
var ElectronIPCServiceEntrypoint_js_1 = require("../adapter/electron/ElectronIPCServiceEntrypoint.js");
|
|
5
|
+
Object.defineProperty(exports, "electronIPCServiceEntrypoint", { enumerable: true, get: function () { return ElectronIPCServiceEntrypoint_js_1.electronIPCServiceEntrypoint; } });
|
|
6
|
+
Object.defineProperty(exports, "ipcEventOfContext", { enumerable: true, get: function () { return ElectronIPCServiceEntrypoint_js_1.ipcEventOfContext; } });
|
|
7
|
+
|
|
8
|
+
//The default of the entry: the entry itself (scripts/package-build/cjs-package.mjs)
|
|
9
|
+
if (!Object.prototype.hasOwnProperty.call(exports, 'default')) Object.defineProperty(exports, 'default', {value: exports})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from '../Entrypoint.js';
|
|
2
|
+
export * from '../lib/Controller.js';
|
|
3
|
+
export * from '../lib/AccessControlRule.js';
|
|
4
|
+
export * from '../exceptions/AccessDeniedException.js';
|
|
5
|
+
export * from '../exceptions/DuplicateActionNameException.js';
|
|
6
|
+
export * from '../exceptions/ControllerActionNotFoundException.js';
|
|
7
|
+
export { AccessControl } from '../lib/AccessControl.js';
|
|
8
|
+
export { Middleware, type ActionInvocation, type Next, type MiddlewareHandler, type MiddlewareDefinition } from '../lib/Middleware.js';
|
|
9
|
+
export * from '../exceptions/InvalidMiddlewareException.js';
|
|
10
|
+
export * from '../exceptions/MiddlewareNextCalledException.js';
|
|
11
|
+
export { PrefixOptions } from '../lib/Prefix.js';
|
|
12
|
+
export * from '../exceptions/InvalidPrefixException.js';
|
|
13
|
+
export { ActionResult } from '../lib/ActionResult.js';
|
|
14
|
+
export type { ActionInfo } from '../lib/ControllerEntrypoint.js';
|
|
15
|
+
export type { EntrypointAdapter, ChannelRuntime, ChannelActionInfo, DispatchOptions } from '../channel/EntrypointAdapter.js';
|
|
16
|
+
export * from '../exceptions/InvalidChannelException.js';
|
|
17
|
+
export * from '../exceptions/InvalidEntrypointAdapterException.js';
|
|
18
|
+
export { Result, StatusResult, FileResult, EventsResult, type FileResultOptions, type SendEvent, type EventsProducer } from '../lib/Result.js';
|
|
19
|
+
export * from '../exceptions/RouteNotFoundException.js';
|
|
20
|
+
export * from '../exceptions/EntrypointStoppedException.js';
|
|
21
|
+
export * from '../exceptions/ServiceInvokeException.js';
|
|
22
|
+
export { scheduleEntrypoint, type ScheduleEntrypointOptions } from '../adapter/schedule/ScheduleEntrypoint.js';
|
|
23
|
+
export { httpServiceEntrypoint, httpRequestOfContext, type HTTPServiceEntrypointOptions } from '../adapter/http/HTTPServiceEntrypoint.js';
|
|
24
|
+
export { Cron, parseDuration } from '../lib/schedule/Cron.js';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.parseDuration = exports.Cron = exports.httpRequestOfContext = exports.httpServiceEntrypoint = exports.scheduleEntrypoint = exports.EventsResult = exports.FileResult = exports.StatusResult = exports.Result = exports.ActionResult = exports.PrefixOptions = exports.Middleware = exports.AccessControl = void 0;
|
|
18
|
+
__exportStar(require("../Entrypoint.js"), exports);
|
|
19
|
+
__exportStar(require("../lib/Controller.js"), exports);
|
|
20
|
+
__exportStar(require("../lib/AccessControlRule.js"), exports);
|
|
21
|
+
__exportStar(require("../exceptions/AccessDeniedException.js"), exports);
|
|
22
|
+
__exportStar(require("../exceptions/DuplicateActionNameException.js"), exports);
|
|
23
|
+
__exportStar(require("../exceptions/ControllerActionNotFoundException.js"), exports);
|
|
24
|
+
var AccessControl_js_1 = require("../lib/AccessControl.js");
|
|
25
|
+
Object.defineProperty(exports, "AccessControl", { enumerable: true, get: function () { return AccessControl_js_1.AccessControl; } });
|
|
26
|
+
var Middleware_js_1 = require("../lib/Middleware.js");
|
|
27
|
+
Object.defineProperty(exports, "Middleware", { enumerable: true, get: function () { return Middleware_js_1.Middleware; } });
|
|
28
|
+
__exportStar(require("../exceptions/InvalidMiddlewareException.js"), exports);
|
|
29
|
+
__exportStar(require("../exceptions/MiddlewareNextCalledException.js"), exports);
|
|
30
|
+
var Prefix_js_1 = require("../lib/Prefix.js");
|
|
31
|
+
Object.defineProperty(exports, "PrefixOptions", { enumerable: true, get: function () { return Prefix_js_1.PrefixOptions; } });
|
|
32
|
+
__exportStar(require("../exceptions/InvalidPrefixException.js"), exports);
|
|
33
|
+
var ActionResult_js_1 = require("../lib/ActionResult.js");
|
|
34
|
+
Object.defineProperty(exports, "ActionResult", { enumerable: true, get: function () { return ActionResult_js_1.ActionResult; } });
|
|
35
|
+
__exportStar(require("../exceptions/InvalidChannelException.js"), exports);
|
|
36
|
+
__exportStar(require("../exceptions/InvalidEntrypointAdapterException.js"), exports);
|
|
37
|
+
var Result_js_1 = require("../lib/Result.js");
|
|
38
|
+
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return Result_js_1.Result; } });
|
|
39
|
+
Object.defineProperty(exports, "StatusResult", { enumerable: true, get: function () { return Result_js_1.StatusResult; } });
|
|
40
|
+
Object.defineProperty(exports, "FileResult", { enumerable: true, get: function () { return Result_js_1.FileResult; } });
|
|
41
|
+
Object.defineProperty(exports, "EventsResult", { enumerable: true, get: function () { return Result_js_1.EventsResult; } });
|
|
42
|
+
__exportStar(require("../exceptions/RouteNotFoundException.js"), exports);
|
|
43
|
+
__exportStar(require("../exceptions/EntrypointStoppedException.js"), exports);
|
|
44
|
+
__exportStar(require("../exceptions/ServiceInvokeException.js"), exports);
|
|
45
|
+
var ScheduleEntrypoint_js_1 = require("../adapter/schedule/ScheduleEntrypoint.js");
|
|
46
|
+
Object.defineProperty(exports, "scheduleEntrypoint", { enumerable: true, get: function () { return ScheduleEntrypoint_js_1.scheduleEntrypoint; } });
|
|
47
|
+
var HTTPServiceEntrypoint_js_1 = require("../adapter/http/HTTPServiceEntrypoint.js");
|
|
48
|
+
Object.defineProperty(exports, "httpServiceEntrypoint", { enumerable: true, get: function () { return HTTPServiceEntrypoint_js_1.httpServiceEntrypoint; } });
|
|
49
|
+
Object.defineProperty(exports, "httpRequestOfContext", { enumerable: true, get: function () { return HTTPServiceEntrypoint_js_1.httpRequestOfContext; } });
|
|
50
|
+
var Cron_js_1 = require("../lib/schedule/Cron.js");
|
|
51
|
+
Object.defineProperty(exports, "Cron", { enumerable: true, get: function () { return Cron_js_1.Cron; } });
|
|
52
|
+
Object.defineProperty(exports, "parseDuration", { enumerable: true, get: function () { return Cron_js_1.parseDuration; } });
|
|
53
|
+
|
|
54
|
+
//The default of the entry: the entry itself (scripts/package-build/cjs-package.mjs)
|
|
55
|
+
if (!Object.prototype.hasOwnProperty.call(exports, 'default')) Object.defineProperty(exports, 'default', {value: exports})
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { expressHTTPEntrypoint, type ExpressHTTPEntrypointOptions, type ExpressHookContext } from '../adapter/express/ExpressHTTPEntrypoint.js';
|
|
2
|
+
export { JSONResponder, jsonEnvelope, statusOfError, describeError, type ExpressResponder, type HTTPErrorOrigin, type JSONEnvelopeOptions } from '../adapter/express/Responders.js';
|
|
3
|
+
export { staticUI, type StaticUIOptions } from '../adapter/express/StaticUI.js';
|
|
4
|
+
export { type ErrorDescription } from '../types/ErrorDescription.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.staticUI = exports.describeError = exports.statusOfError = exports.jsonEnvelope = exports.JSONResponder = exports.expressHTTPEntrypoint = void 0;
|
|
4
|
+
var ExpressHTTPEntrypoint_js_1 = require("../adapter/express/ExpressHTTPEntrypoint.js");
|
|
5
|
+
Object.defineProperty(exports, "expressHTTPEntrypoint", { enumerable: true, get: function () { return ExpressHTTPEntrypoint_js_1.expressHTTPEntrypoint; } });
|
|
6
|
+
var Responders_js_1 = require("../adapter/express/Responders.js");
|
|
7
|
+
Object.defineProperty(exports, "JSONResponder", { enumerable: true, get: function () { return Responders_js_1.JSONResponder; } });
|
|
8
|
+
Object.defineProperty(exports, "jsonEnvelope", { enumerable: true, get: function () { return Responders_js_1.jsonEnvelope; } });
|
|
9
|
+
Object.defineProperty(exports, "statusOfError", { enumerable: true, get: function () { return Responders_js_1.statusOfError; } });
|
|
10
|
+
Object.defineProperty(exports, "describeError", { enumerable: true, get: function () { return Responders_js_1.describeError; } });
|
|
11
|
+
var StaticUI_js_1 = require("../adapter/express/StaticUI.js");
|
|
12
|
+
Object.defineProperty(exports, "staticUI", { enumerable: true, get: function () { return StaticUI_js_1.staticUI; } });
|
|
13
|
+
|
|
14
|
+
//The default of the entry: the entry itself (scripts/package-build/cjs-package.mjs)
|
|
15
|
+
if (!Object.prototype.hasOwnProperty.call(exports, 'default')) Object.defineProperty(exports, 'default', {value: exports})
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { fastifyHTTPEntrypoint, type FastifyHTTPEntrypointOptions, type FastifyHookContext } from '../adapter/fastify/FastifyHTTPEntrypoint.js';
|
|
2
|
+
export { FastifyJSONResponder, fastifyJSONEnvelope, type FastifyResponder, type FastifyJSONEnvelopeOptions } from '../adapter/fastify/Responders.js';
|
|
3
|
+
export { statusOfError, describeError, type HTTPErrorOrigin } from '../lib/HTTPErrors.js';
|
|
4
|
+
export { type ErrorDescription } from '../types/ErrorDescription.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describeError = exports.statusOfError = exports.fastifyJSONEnvelope = exports.FastifyJSONResponder = exports.fastifyHTTPEntrypoint = void 0;
|
|
4
|
+
var FastifyHTTPEntrypoint_js_1 = require("../adapter/fastify/FastifyHTTPEntrypoint.js");
|
|
5
|
+
Object.defineProperty(exports, "fastifyHTTPEntrypoint", { enumerable: true, get: function () { return FastifyHTTPEntrypoint_js_1.fastifyHTTPEntrypoint; } });
|
|
6
|
+
var Responders_js_1 = require("../adapter/fastify/Responders.js");
|
|
7
|
+
Object.defineProperty(exports, "FastifyJSONResponder", { enumerable: true, get: function () { return Responders_js_1.FastifyJSONResponder; } });
|
|
8
|
+
Object.defineProperty(exports, "fastifyJSONEnvelope", { enumerable: true, get: function () { return Responders_js_1.fastifyJSONEnvelope; } });
|
|
9
|
+
var HTTPErrors_js_1 = require("../lib/HTTPErrors.js");
|
|
10
|
+
Object.defineProperty(exports, "statusOfError", { enumerable: true, get: function () { return HTTPErrors_js_1.statusOfError; } });
|
|
11
|
+
Object.defineProperty(exports, "describeError", { enumerable: true, get: function () { return HTTPErrors_js_1.describeError; } });
|
|
12
|
+
|
|
13
|
+
//The default of the entry: the entry itself (scripts/package-build/cjs-package.mjs)
|
|
14
|
+
if (!Object.prototype.hasOwnProperty.call(exports, 'default')) Object.defineProperty(exports, 'default', {value: exports})
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { jsonRPCServiceEntrypoint, type JSONRPCServiceEntrypointOptions } from '../adapter/jsonrpc/JSONRPCServiceEntrypoint.js';
|
|
2
|
+
export { JSONRPCErrorCode, jsonRPCRequestOfContext, type JSONRPCMappingOptions, type JSONRPCRequest, type JSONRPCRequestInfo, type JSONRPCResponse } from '../adapter/jsonrpc/JSONRPCProtocol.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsonRPCRequestOfContext = exports.JSONRPCErrorCode = exports.jsonRPCServiceEntrypoint = void 0;
|
|
4
|
+
var JSONRPCServiceEntrypoint_js_1 = require("../adapter/jsonrpc/JSONRPCServiceEntrypoint.js");
|
|
5
|
+
Object.defineProperty(exports, "jsonRPCServiceEntrypoint", { enumerable: true, get: function () { return JSONRPCServiceEntrypoint_js_1.jsonRPCServiceEntrypoint; } });
|
|
6
|
+
var JSONRPCProtocol_js_1 = require("../adapter/jsonrpc/JSONRPCProtocol.js");
|
|
7
|
+
Object.defineProperty(exports, "JSONRPCErrorCode", { enumerable: true, get: function () { return JSONRPCProtocol_js_1.JSONRPCErrorCode; } });
|
|
8
|
+
Object.defineProperty(exports, "jsonRPCRequestOfContext", { enumerable: true, get: function () { return JSONRPCProtocol_js_1.jsonRPCRequestOfContext; } });
|
|
9
|
+
|
|
10
|
+
//The default of the entry: the entry itself (scripts/package-build/cjs-package.mjs)
|
|
11
|
+
if (!Object.prototype.hasOwnProperty.call(exports, 'default')) Object.defineProperty(exports, 'default', {value: exports})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { socketIOServiceEntrypoint, socketOfContext, type SocketIOServiceEntrypointOptions } from '../adapter/socket.io/SocketIOServiceEntrypoint.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.socketOfContext = exports.socketIOServiceEntrypoint = void 0;
|
|
4
|
+
var SocketIOServiceEntrypoint_js_1 = require("../adapter/socket.io/SocketIOServiceEntrypoint.js");
|
|
5
|
+
Object.defineProperty(exports, "socketIOServiceEntrypoint", { enumerable: true, get: function () { return SocketIOServiceEntrypoint_js_1.socketIOServiceEntrypoint; } });
|
|
6
|
+
Object.defineProperty(exports, "socketOfContext", { enumerable: true, get: function () { return SocketIOServiceEntrypoint_js_1.socketOfContext; } });
|
|
7
|
+
|
|
8
|
+
//The default of the entry: the entry itself (scripts/package-build/cjs-package.mjs)
|
|
9
|
+
if (!Object.prototype.hasOwnProperty.call(exports, 'default')) Object.defineProperty(exports, 'default', {value: exports})
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { BaseObject, Exception, Container, IBaseObjectConstructor, FunctionSchema } from '@lakutata/core';
|
|
2
|
+
import { BaseActionInfo, CLIActionInfo, CLIContext, ContextType, HTTPActionInfo, HTTPContext, ServiceActionInfo, ServiceContext } from '../Entrypoint.js';
|
|
3
|
+
import { ActionDetails, type ActionInfo } from './ControllerEntrypoint.js';
|
|
4
|
+
import { AccessControlRule, AccessControlRuleHandler } from './AccessControlRule.js';
|
|
5
|
+
/**
|
|
6
|
+
* The access control of the entrypoint's actions: it checks a request to an action declared with `acl: true` against
|
|
7
|
+
* the entrypoint's rules and the action's own `rule`, or against the action's `rule` alone when `acl` is off. The
|
|
8
|
+
* entrypoint calls {@link AccessControl.run} for each request, after the input validation and before the action; a
|
|
9
|
+
* subclass of the entrypoint may replace it with a subclass (its protected `accessControl` property), for example to
|
|
10
|
+
* audit the decisions.
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import {Application} from 'lakutata'
|
|
14
|
+
* import {AccessControl, Controller, Entrypoint} from 'lakutata/com/entrypoint'
|
|
15
|
+
* import {GET} from 'lakutata/decorator/ctrl'
|
|
16
|
+
*
|
|
17
|
+
* //Log every access decision
|
|
18
|
+
* class AuditedAccessControl extends AccessControl {
|
|
19
|
+
* protected async match(): Promise<boolean> {
|
|
20
|
+
* const allowed: boolean = await super.match()
|
|
21
|
+
* console.log(`${this.target.name}: ${allowed ? 'allowed' : 'denied'}`)
|
|
22
|
+
* return allowed
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* class AuditedEntrypoint extends Entrypoint {
|
|
27
|
+
* protected readonly accessControl: typeof AccessControl = AuditedAccessControl
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* class ReportController extends Controller {
|
|
31
|
+
* @GET('/reports', {acl: true, rule: async (): Promise<boolean> => true})
|
|
32
|
+
* public async list(): Promise<string[]> {
|
|
33
|
+
* return []
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* Application.run(() => ({
|
|
38
|
+
* id: 'report.app',
|
|
39
|
+
* name: 'Report',
|
|
40
|
+
* components: {
|
|
41
|
+
* entrypoint: {class: AuditedEntrypoint, controllers: [ReportController]}
|
|
42
|
+
* }
|
|
43
|
+
* }))
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare class AccessControl extends BaseObject {
|
|
47
|
+
/**
|
|
48
|
+
* The request's container, where the rules are created.
|
|
49
|
+
* @protected
|
|
50
|
+
*/
|
|
51
|
+
protected readonly runtimeContainer: Container;
|
|
52
|
+
/**
|
|
53
|
+
* The descriptions of every action of the request's channel.
|
|
54
|
+
* @protected
|
|
55
|
+
*/
|
|
56
|
+
protected readonly actions: HTTPActionInfo[] | ServiceActionInfo[] | CLIActionInfo[];
|
|
57
|
+
/**
|
|
58
|
+
* The requested action: its identity and options (without the channel's fields).
|
|
59
|
+
* @protected
|
|
60
|
+
*/
|
|
61
|
+
protected readonly target: ActionInfo;
|
|
62
|
+
/**
|
|
63
|
+
* The request's context.
|
|
64
|
+
* @protected
|
|
65
|
+
*/
|
|
66
|
+
protected readonly context: CLIContext | HTTPContext | ServiceContext;
|
|
67
|
+
/**
|
|
68
|
+
* The action's validated input.
|
|
69
|
+
* @protected
|
|
70
|
+
*/
|
|
71
|
+
protected readonly input: Record<string, any>;
|
|
72
|
+
/**
|
|
73
|
+
* Called when the rules allow the request.
|
|
74
|
+
* @protected
|
|
75
|
+
*/
|
|
76
|
+
protected readonly allowCallback: () => void;
|
|
77
|
+
/**
|
|
78
|
+
* Called when a rule denies the request, with the error a rule threw (none when a rule resolved `false`).
|
|
79
|
+
* @protected
|
|
80
|
+
*/
|
|
81
|
+
protected readonly denyCallback: (error?: Error | Exception) => void;
|
|
82
|
+
/**
|
|
83
|
+
* The rules to check, in order: rule classes and rule functions.
|
|
84
|
+
* @protected
|
|
85
|
+
*/
|
|
86
|
+
protected readonly rules: (IBaseObjectConstructor<AccessControlRule> | AccessControlRuleHandler<any>)[];
|
|
87
|
+
/**
|
|
88
|
+
* Schema of access control rule constructors, built only when it is used
|
|
89
|
+
* @protected
|
|
90
|
+
*/
|
|
91
|
+
protected get accessControlRuleConstructorDTO(): FunctionSchema<typeof AccessControlRule>;
|
|
92
|
+
/**
|
|
93
|
+
* Check the rules and call the allow or deny callback.
|
|
94
|
+
* @protected
|
|
95
|
+
*/
|
|
96
|
+
protected init(): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Check the rules in order: a rule class is created in the request's container and checked when it supports the
|
|
99
|
+
* request's context type, a rule function is called with the context and the input.
|
|
100
|
+
* @returns `false` as soon as a rule resolves `false`, `true` when none does (no rule included).
|
|
101
|
+
* @throws {Error} The error a rule throws (the request is then denied with it).
|
|
102
|
+
* @protected
|
|
103
|
+
*/
|
|
104
|
+
protected match(): Promise<boolean>;
|
|
105
|
+
/**
|
|
106
|
+
* Check the access to an action: with `acl: true`, against the rules then the action's own `rule`; with `acl`
|
|
107
|
+
* off, against the action's `rule` alone; without either, the request is allowed without check.
|
|
108
|
+
* @param rules The entrypoint's rule classes.
|
|
109
|
+
* @param runtimeContainer The request's container, where the access control and the rules are created.
|
|
110
|
+
* @param context The request's context.
|
|
111
|
+
* @param input The action's validated input.
|
|
112
|
+
* @param details The requested action.
|
|
113
|
+
* @param getActionsCallback Returns the descriptions of the actions of a context type's channel.
|
|
114
|
+
* @returns Whether the request is allowed, and when it is not, the error to fail it with: the error a rule
|
|
115
|
+
* threw, or an `AccessDeniedException`.
|
|
116
|
+
*/
|
|
117
|
+
static run(rules: IBaseObjectConstructor<AccessControlRule>[], runtimeContainer: Container, context: CLIContext | HTTPContext | ServiceContext, input: Record<string, any>, details: ActionDetails, getActionsCallback: (type: ContextType | string) => BaseActionInfo[]): Promise<[boolean, Error | Exception | undefined]>;
|
|
118
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AccessControl = void 0;
|
|
13
|
+
const core_1 = require("@lakutata/core");
|
|
14
|
+
const di_1 = require("@lakutata/core/decorator/di");
|
|
15
|
+
const AccessDeniedException_js_1 = require("../exceptions/AccessDeniedException.js");
|
|
16
|
+
const AccessControlRule_js_1 = require("./AccessControlRule.js");
|
|
17
|
+
const utils_1 = require("@lakutata/utils");
|
|
18
|
+
/**
|
|
19
|
+
* The access control of the entrypoint's actions: it checks a request to an action declared with `acl: true` against
|
|
20
|
+
* the entrypoint's rules and the action's own `rule`, or against the action's `rule` alone when `acl` is off. The
|
|
21
|
+
* entrypoint calls {@link AccessControl.run} for each request, after the input validation and before the action; a
|
|
22
|
+
* subclass of the entrypoint may replace it with a subclass (its protected `accessControl` property), for example to
|
|
23
|
+
* audit the decisions.
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import {Application} from 'lakutata'
|
|
27
|
+
* import {AccessControl, Controller, Entrypoint} from 'lakutata/com/entrypoint'
|
|
28
|
+
* import {GET} from 'lakutata/decorator/ctrl'
|
|
29
|
+
*
|
|
30
|
+
* //Log every access decision
|
|
31
|
+
* class AuditedAccessControl extends AccessControl {
|
|
32
|
+
* protected async match(): Promise<boolean> {
|
|
33
|
+
* const allowed: boolean = await super.match()
|
|
34
|
+
* console.log(`${this.target.name}: ${allowed ? 'allowed' : 'denied'}`)
|
|
35
|
+
* return allowed
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* class AuditedEntrypoint extends Entrypoint {
|
|
40
|
+
* protected readonly accessControl: typeof AccessControl = AuditedAccessControl
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* class ReportController extends Controller {
|
|
44
|
+
* @GET('/reports', {acl: true, rule: async (): Promise<boolean> => true})
|
|
45
|
+
* public async list(): Promise<string[]> {
|
|
46
|
+
* return []
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* Application.run(() => ({
|
|
51
|
+
* id: 'report.app',
|
|
52
|
+
* name: 'Report',
|
|
53
|
+
* components: {
|
|
54
|
+
* entrypoint: {class: AuditedEntrypoint, controllers: [ReportController]}
|
|
55
|
+
* }
|
|
56
|
+
* }))
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
class AccessControl extends core_1.BaseObject {
|
|
60
|
+
/**
|
|
61
|
+
* Schema of access control rule constructors, built only when it is used
|
|
62
|
+
* @protected
|
|
63
|
+
*/
|
|
64
|
+
get accessControlRuleConstructorDTO() {
|
|
65
|
+
return core_1.DTO.Class(AccessControlRule_js_1.AccessControlRule);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Check the rules and call the allow or deny callback.
|
|
69
|
+
* @protected
|
|
70
|
+
*/
|
|
71
|
+
async init() {
|
|
72
|
+
try {
|
|
73
|
+
const matchResult = await this.match();
|
|
74
|
+
if (matchResult)
|
|
75
|
+
return this.allowCallback();
|
|
76
|
+
return this.denyCallback();
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
return this.denyCallback(e);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Check the rules in order: a rule class is created in the request's container and checked when it supports the
|
|
84
|
+
* request's context type, a rule function is called with the context and the input.
|
|
85
|
+
* @returns `false` as soon as a rule resolves `false`, `true` when none does (no rule included).
|
|
86
|
+
* @throws {Error} The error a rule throws (the request is then denied with it).
|
|
87
|
+
* @protected
|
|
88
|
+
*/
|
|
89
|
+
async match() {
|
|
90
|
+
for (const rule of this.rules) {
|
|
91
|
+
if ((0, utils_1.isSubclassOf)(rule, AccessControlRule_js_1.AccessControlRule)) {
|
|
92
|
+
const RuleObjectConstructor = (0, utils_1.As)(rule);
|
|
93
|
+
const ruleObjectInstance = await this.runtimeContainer.build(RuleObjectConstructor, {
|
|
94
|
+
actions: this.actions,
|
|
95
|
+
targetAction: this.target,
|
|
96
|
+
context: this.context,
|
|
97
|
+
input: this.input
|
|
98
|
+
});
|
|
99
|
+
if (!ruleObjectInstance.supportContextTypes.includes(this.context.type))
|
|
100
|
+
continue;
|
|
101
|
+
if (!(await ruleObjectInstance.rule()))
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
const handler = (0, utils_1.As)(rule);
|
|
106
|
+
if (!(await handler(this.context, this.input)))
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Check the access to an action: with `acl: true`, against the rules then the action's own `rule`; with `acl`
|
|
114
|
+
* off, against the action's `rule` alone; without either, the request is allowed without check.
|
|
115
|
+
* @param rules The entrypoint's rule classes.
|
|
116
|
+
* @param runtimeContainer The request's container, where the access control and the rules are created.
|
|
117
|
+
* @param context The request's context.
|
|
118
|
+
* @param input The action's validated input.
|
|
119
|
+
* @param details The requested action.
|
|
120
|
+
* @param getActionsCallback Returns the descriptions of the actions of a context type's channel.
|
|
121
|
+
* @returns Whether the request is allowed, and when it is not, the error to fail it with: the error a rule
|
|
122
|
+
* threw, or an `AccessDeniedException`.
|
|
123
|
+
*/
|
|
124
|
+
static async run(rules, runtimeContainer, context, input, details, getActionsCallback) {
|
|
125
|
+
const actions = getActionsCallback(context.type);
|
|
126
|
+
let allowed = !details.acl;
|
|
127
|
+
//The exception is created only when access is denied (building it captures a stack trace)
|
|
128
|
+
let exception;
|
|
129
|
+
if (!allowed) {
|
|
130
|
+
await runtimeContainer.set(this, {
|
|
131
|
+
// await runtimeContainer.build(this, {
|
|
132
|
+
rules: [...rules, details.rule].filter((rule) => !!rule),
|
|
133
|
+
runtimeContainer: runtimeContainer,
|
|
134
|
+
actions: actions,
|
|
135
|
+
context: context,
|
|
136
|
+
input: input,
|
|
137
|
+
target: details.getActionInfo(),
|
|
138
|
+
allowCallback: () => {
|
|
139
|
+
allowed = true;
|
|
140
|
+
},
|
|
141
|
+
denyCallback: (error) => {
|
|
142
|
+
allowed = false;
|
|
143
|
+
exception = error ? error : exception;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else if (details.rule) {
|
|
148
|
+
await runtimeContainer.set(this, {
|
|
149
|
+
// await runtimeContainer.build(this, {
|
|
150
|
+
rules: [details.rule],
|
|
151
|
+
runtimeContainer: runtimeContainer,
|
|
152
|
+
actions: actions,
|
|
153
|
+
context: context,
|
|
154
|
+
input: input,
|
|
155
|
+
target: details.getActionInfo(),
|
|
156
|
+
allowCallback: () => {
|
|
157
|
+
allowed = true;
|
|
158
|
+
},
|
|
159
|
+
denyCallback: (error) => {
|
|
160
|
+
allowed = false;
|
|
161
|
+
exception = error ? error : exception;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return [
|
|
166
|
+
allowed,
|
|
167
|
+
allowed ? undefined : (exception ? exception : new AccessDeniedException_js_1.AccessDeniedException())
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
exports.AccessControl = AccessControl;
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, di_1.Configurable)(),
|
|
174
|
+
__metadata("design:type", core_1.Container
|
|
175
|
+
/**
|
|
176
|
+
* The descriptions of every action of the request's channel.
|
|
177
|
+
* @protected
|
|
178
|
+
*/
|
|
179
|
+
)
|
|
180
|
+
], AccessControl.prototype, "runtimeContainer", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
(0, di_1.Configurable)(),
|
|
183
|
+
__metadata("design:type", Array)
|
|
184
|
+
], AccessControl.prototype, "actions", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, di_1.Configurable)(),
|
|
187
|
+
__metadata("design:type", Object)
|
|
188
|
+
], AccessControl.prototype, "target", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, di_1.Configurable)(),
|
|
191
|
+
__metadata("design:type", Object)
|
|
192
|
+
], AccessControl.prototype, "context", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
(0, di_1.Configurable)(),
|
|
195
|
+
__metadata("design:type", Object)
|
|
196
|
+
], AccessControl.prototype, "input", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, di_1.Configurable)(),
|
|
199
|
+
__metadata("design:type", Function)
|
|
200
|
+
], AccessControl.prototype, "allowCallback", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
(0, di_1.Configurable)(),
|
|
203
|
+
__metadata("design:type", Function)
|
|
204
|
+
], AccessControl.prototype, "denyCallback", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
(0, di_1.Configurable)(),
|
|
207
|
+
__metadata("design:type", Array)
|
|
208
|
+
], AccessControl.prototype, "rules", void 0);
|