lakutata 2.0.54 → 2.0.56

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.
Files changed (118) hide show
  1. package/com/cacher.cjs +1 -1
  2. package/com/cacher.d.ts +1 -1
  3. package/com/cacher.mjs +1 -1
  4. package/com/docker.d.ts +1 -1
  5. package/com/entrypoint.cjs +29 -11
  6. package/com/entrypoint.d.ts +11 -182
  7. package/com/entrypoint.mjs +12 -0
  8. package/decorator/asst.d.ts +1 -1
  9. package/decorator/ctrl.cjs +15 -5
  10. package/decorator/ctrl.d.ts +112 -10
  11. package/decorator/ctrl.mjs +11 -1
  12. package/decorator/di.d.ts +2 -2
  13. package/decorator/dto.d.ts +3 -3
  14. package/decorator/orm.d.ts +1 -1
  15. package/helper.cjs +13 -11
  16. package/helper.d.ts +1 -1
  17. package/helper.mjs +3 -1
  18. package/lakutata.cjs +18 -6
  19. package/lakutata.d.ts +7 -8
  20. package/lakutata.mjs +12 -0
  21. package/orm.d.ts +1 -1
  22. package/package.json +1 -1
  23. package/src/components/cacher/Cacher.cjs +1 -1
  24. package/src/components/cacher/Cacher.mjs +1 -1
  25. package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +1 -1
  26. package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +1 -1
  27. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.cjs +2 -2
  28. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.mjs +2 -2
  29. package/src/components/cacher/adapters/CreateMongoCacheAdapter.cjs +2 -2
  30. package/src/components/cacher/adapters/CreateMongoCacheAdapter.mjs +2 -2
  31. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.cjs +2 -2
  32. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.mjs +2 -2
  33. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.cjs +2 -2
  34. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.mjs +2 -2
  35. package/src/components/cacher/adapters/CreateRedisCacheAdapter.cjs +2 -2
  36. package/src/components/cacher/adapters/CreateRedisCacheAdapter.mjs +2 -2
  37. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.cjs +2 -2
  38. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.mjs +2 -2
  39. package/src/components/entrypoint/Entrypoint.cjs +1074 -973
  40. package/src/components/entrypoint/Entrypoint.mjs +884 -781
  41. package/src/components/entrypoint/exceptions/AccessDenyException.cjs +35 -0
  42. package/src/components/entrypoint/exceptions/AccessDenyException.mjs +29 -0
  43. package/src/components/entrypoint/exceptions/DuplicateActionNameException.cjs +34 -0
  44. package/src/components/entrypoint/exceptions/DuplicateActionNameException.mjs +28 -0
  45. package/src/components/entrypoint/lib/AccessControl.cjs +247 -0
  46. package/src/components/entrypoint/lib/AccessControl.mjs +241 -0
  47. package/src/components/entrypoint/lib/AccessControlRule.cjs +163 -0
  48. package/src/components/entrypoint/lib/AccessControlRule.mjs +157 -0
  49. package/src/decorators/ctrl/CLIAction.cjs +17 -10
  50. package/src/decorators/ctrl/CLIAction.mjs +17 -10
  51. package/src/decorators/ctrl/HTTPAction.cjs +18 -11
  52. package/src/decorators/ctrl/HTTPAction.mjs +16 -9
  53. package/src/decorators/ctrl/ServiceAction.cjs +15 -8
  54. package/src/decorators/ctrl/ServiceAction.mjs +16 -9
  55. package/src/decorators/ctrl/http/DELETE.cjs +13 -3
  56. package/src/decorators/ctrl/http/DELETE.mjs +13 -3
  57. package/src/decorators/ctrl/http/GET.cjs +13 -3
  58. package/src/decorators/ctrl/http/GET.mjs +13 -3
  59. package/src/decorators/ctrl/http/HEAD.cjs +13 -3
  60. package/src/decorators/ctrl/http/HEAD.mjs +13 -3
  61. package/src/decorators/ctrl/http/OPTIONS.cjs +13 -3
  62. package/src/decorators/ctrl/http/OPTIONS.mjs +13 -3
  63. package/src/decorators/ctrl/http/PATCH.cjs +13 -3
  64. package/src/decorators/ctrl/http/PATCH.mjs +13 -3
  65. package/src/decorators/ctrl/http/POST.cjs +13 -3
  66. package/src/decorators/ctrl/http/POST.mjs +13 -3
  67. package/src/decorators/ctrl/http/PUT.cjs +13 -3
  68. package/src/decorators/ctrl/http/PUT.mjs +13 -3
  69. package/src/lib/base/internal/ActionOptions.cjs +79 -0
  70. package/src/lib/base/internal/ActionOptions.mjs +73 -0
  71. package/src/lib/base/internal/ControllerEntrypoint.cjs +625 -53
  72. package/src/lib/base/internal/ControllerEntrypoint.mjs +640 -68
  73. package/src/lib/base/internal/GetActionDTOAndOptions.cjs +89 -0
  74. package/src/lib/base/internal/GetActionDTOAndOptions.mjs +83 -0
  75. package/src/lib/base/internal/StringifyPattern.cjs +69 -0
  76. package/src/lib/base/internal/StringifyPattern.mjs +63 -0
  77. package/src/lib/core/Application.cjs +29 -17
  78. package/src/lib/core/Application.mjs +33 -21
  79. package/src/lib/helpers/MD5.cjs +1 -1
  80. package/src/lib/helpers/MD5.mjs +1 -1
  81. package/src/lib/helpers/SHA1.cjs +1 -1
  82. package/src/lib/helpers/SHA1.mjs +1 -1
  83. package/src/lib/helpers/SHA256.cjs +1 -1
  84. package/src/lib/helpers/SHA256.mjs +1 -1
  85. package/src/lib/helpers/SortArray.cjs +18 -201
  86. package/src/lib/helpers/SortArray.mjs +17 -200
  87. package/vendor/Package.19.cjs +85 -90
  88. package/vendor/Package.19.mjs +1 -1
  89. package/vendor/Package.3.cjs +1 -1
  90. package/vendor/Package.3.mjs +1 -1
  91. package/vendor/Package.610.cjs +85 -103
  92. package/vendor/Package.610.mjs +80 -98
  93. package/vendor/Package.611.cjs +100 -121
  94. package/vendor/Package.611.mjs +97 -120
  95. package/vendor/Package.612.cjs +196 -0
  96. package/vendor/Package.612.mjs +180 -0
  97. package/vendor/Package.64.cjs +140 -4118
  98. package/vendor/Package.64.mjs +140 -4126
  99. package/vendor/Package.65.cjs +4142 -692
  100. package/vendor/Package.65.mjs +4151 -689
  101. package/vendor/Package.66.cjs +571 -535
  102. package/vendor/Package.66.mjs +586 -528
  103. package/vendor/Package.67.cjs +633 -96
  104. package/vendor/Package.67.mjs +619 -94
  105. package/vendor/Package.68.cjs +96 -294
  106. package/vendor/Package.68.mjs +95 -295
  107. package/vendor/Package.69.cjs +297 -113
  108. package/vendor/Package.69.mjs +285 -97
  109. package/vendor/TypeDef.10.d.ts +13 -2
  110. package/vendor/TypeDef.11.d.ts +6 -5
  111. package/vendor/TypeDef.12.d.ts +104 -4
  112. package/vendor/TypeDef.13.d.ts +315 -62
  113. package/vendor/TypeDef.3.d.ts +2 -2
  114. package/vendor/TypeDef.5.d.ts +1 -1
  115. package/vendor/TypeDef.7.d.ts +19 -10
  116. package/vendor/TypeDef.8.d.ts +2 -20
  117. package/vendor/TypeDef.9.d.ts +5 -2
  118. package/vendor/TypeDef.14.d.ts +0 -72
package/com/cacher.cjs CHANGED
@@ -34,7 +34,7 @@ require("../vendor/Package.1.cjs");
34
34
 
35
35
  require("events");
36
36
 
37
- require("../vendor/Package.65.cjs");
37
+ require("../vendor/Package.66.cjs");
38
38
 
39
39
  require("buffer");
40
40
 
package/com/cacher.d.ts CHANGED
@@ -3,7 +3,7 @@ import EventEmitter from 'node:events';
3
3
  import { D as DTO } from '../vendor/TypeDef.5.js';
4
4
  import { C as Component } from '../vendor/TypeDef.3.js';
5
5
  import { C as ComponentOptionsBuilder } from '../vendor/TypeDef.6.js';
6
- import { E as Exception } from '../vendor/TypeDef.8.js';
6
+ import { E as Exception } from '../vendor/TypeDef.7.js';
7
7
 
8
8
  type EventListener = (...arguments_: any[]) => void;
9
9
  declare class EventManager {
package/com/cacher.mjs CHANGED
@@ -28,7 +28,7 @@ import "../vendor/Package.1.mjs";
28
28
 
29
29
  import "events";
30
30
 
31
- import "../vendor/Package.65.mjs";
31
+ import "../vendor/Package.66.mjs";
32
32
 
33
33
  import "buffer";
34
34
 
package/com/docker.d.ts CHANGED
@@ -11,7 +11,7 @@ import { D as DTO } from '../vendor/TypeDef.5.js';
11
11
  import { Logger } from './logger.js';
12
12
  import { Writable } from 'node:stream';
13
13
  import { C as ComponentOptionsBuilder } from '../vendor/TypeDef.6.js';
14
- import { E as Exception } from '../vendor/TypeDef.8.js';
14
+ import { E as Exception } from '../vendor/TypeDef.7.js';
15
15
 
16
16
  interface Prompt {
17
17
  prompt: string;
@@ -10,15 +10,21 @@ const e = require("../src/components/entrypoint/Entrypoint.cjs");
10
10
 
11
11
  const r = require("../src/components/entrypoint/lib/Controller.cjs");
12
12
 
13
- const i = require("../src/components/entrypoint/exceptions/ControllerActionNotFoundException.cjs");
13
+ const c = require("../src/components/entrypoint/lib/AccessControlRule.cjs");
14
14
 
15
- const s = require("../src/lib/base/Context.cjs");
15
+ const s = require("../src/components/entrypoint/exceptions/AccessDenyException.cjs");
16
16
 
17
- const c = require("../src/lib/context/CLIContext.cjs");
17
+ const i = require("../src/components/entrypoint/exceptions/DuplicateActionNameException.cjs");
18
18
 
19
- const t = require("../src/lib/context/HTTPContext.cjs");
19
+ const t = require("../src/components/entrypoint/exceptions/ControllerActionNotFoundException.cjs");
20
20
 
21
- const o = require("../src/lib/context/ServiceContext.cjs");
21
+ const n = require("../src/lib/base/Context.cjs");
22
+
23
+ const o = require("../src/lib/context/CLIContext.cjs");
24
+
25
+ const u = require("../src/lib/context/HTTPContext.cjs");
26
+
27
+ const l = require("../src/lib/context/ServiceContext.cjs");
22
28
 
23
29
  require("../vendor/Package.5.cjs");
24
30
 
@@ -182,6 +188,10 @@ require("../src/lib/helpers/GetObjectNestingDepth.cjs");
182
188
 
183
189
  require("../src/exceptions/InvalidActionPatternDepthException.cjs");
184
190
 
191
+ require("../src/lib/base/internal/StringifyPattern.cjs");
192
+
193
+ require("../vendor/Package.64.cjs");
194
+
185
195
  require("../src/lib/base/internal/PatternManager.cjs");
186
196
 
187
197
  require("../src/exceptions/DestroyRuntimeContainerException.cjs");
@@ -190,6 +200,8 @@ require("../src/lib/helpers/GetObjectPropertyPaths.cjs");
190
200
 
191
201
  require("../src/lib/helpers/UniqueArray.cjs");
192
202
 
203
+ require("../src/components/entrypoint/lib/AccessControl.cjs");
204
+
193
205
  require("node:http");
194
206
 
195
207
  exports.BuildCLIEntrypoint = e.BuildCLIEntrypoint;
@@ -210,20 +222,26 @@ Object.defineProperty(exports, "Controller", {
210
222
  get: () => r.Controller
211
223
  });
212
224
 
213
- exports.ControllerActionNotFoundException = i.ControllerActionNotFoundException;
225
+ exports.AccessControlRule = c.AccessControlRule;
226
+
227
+ exports.AccessDenyException = s.AccessDenyException;
228
+
229
+ exports.DuplicateActionNameException = i.DuplicateActionNameException;
230
+
231
+ exports.ControllerActionNotFoundException = t.ControllerActionNotFoundException;
214
232
 
215
233
  Object.defineProperty(exports, "BaseContext", {
216
234
  enumerable: true,
217
- get: () => s.BaseContext
235
+ get: () => n.BaseContext
218
236
  });
219
237
 
220
238
  Object.defineProperty(exports, "ContextType", {
221
239
  enumerable: true,
222
- get: () => s.ContextType
240
+ get: () => n.ContextType
223
241
  });
224
242
 
225
- exports.CLIContext = c.CLIContext;
243
+ exports.CLIContext = o.CLIContext;
226
244
 
227
- exports.HTTPContext = t.HTTPContext;
245
+ exports.HTTPContext = u.HTTPContext;
228
246
 
229
- exports.ServiceContext = o.ServiceContext;
247
+ exports.ServiceContext = l.ServiceContext;
@@ -1,193 +1,22 @@
1
1
  import '../vendor/TypeDef.2.js';
2
- import { I as IBaseObjectConstructor, M as Module, C as Component } from '../vendor/TypeDef.3.js';
3
- import { C as Controller, a as CLIContext, H as HTTPContext, S as ServiceContext } from '../vendor/TypeDef.14.js';
4
- export { B as BaseContext, b as ContextType, c as ControllerProperty } from '../vendor/TypeDef.14.js';
5
- import { A as ActionPattern } from '../vendor/TypeDef.9.js';
6
- import { D as DTO, J as JSONSchema } from '../vendor/TypeDef.5.js';
7
- import { I as IPatRun } from '../vendor/TypeDef.7.js';
8
- import { E as Exception } from '../vendor/TypeDef.8.js';
2
+ export { w as AccessControlRule, A as AccessControlRuleHandler, B as BaseActionInfo, q as BaseContext, k as BuildCLIEntrypoint, n as BuildEntrypoints, l as BuildHTTPEntrypoint, m as BuildServiceEntrypoint, j as CLIActionInfo, r as CLIContext, C as CLIEntrypoint, c as CLIEntrypointHandler, a as CLIMap, p as ContextType, v as Controller, u as ControllerProperty, o as Entrypoint, E as EntrypointDestroyer, f as EntrypointDestroyerRegistrar, g as EntrypointOptions, h as HTTPActionInfo, s as HTTPContext, H as HTTPEntrypoint, d as HTTPEntrypointHandler, b as HTTPRouteMap, i as ServiceActionInfo, t as ServiceContext, S as ServiceEntrypoint, e as ServiceEntrypointHandler } from '../vendor/TypeDef.13.js';
3
+ import { E as Exception } from '../vendor/TypeDef.7.js';
4
+ import '../vendor/TypeDef.3.js';
5
+ import '../vendor/TypeDef.5.js';
6
+ import '../vendor/TypeDef.10.js';
9
7
  import 'node:http';
10
8
 
11
- type ActionPatternMap = Map<ActionPattern, ActionDetails>;
12
- type ActionDetails<ClassPrototype extends Controller = Controller, DTOConstructor extends typeof DTO = typeof DTO> = {
13
- pattern: ActionPattern;
14
- constructor: IBaseObjectConstructor<ClassPrototype>;
15
- method: string | number | symbol;
16
- dtoConstructor: DTOConstructor;
17
- jsonSchema: JSONSchema;
18
- };
19
-
20
- type PatternManagerOptions = {
21
- globMatch?: boolean;
22
- };
23
- declare class PatternManager implements IPatRun {
24
- #private;
25
- constructor(options?: PatternManagerOptions);
26
- /**
27
- * Register a pattern, and the object that will be returned if an input matches.
28
- * Both keys and values are considered to be strings.
29
- * Other types are converted to strings.
30
- * @param pattern
31
- * @param obj
32
- */
33
- add(pattern: Record<string, any>, obj: any): this;
34
- /**
35
- * Remove this pattern, and it's object, from the matcher.
36
- * @param pattern
37
- */
38
- remove(pattern: Record<string, any>): this;
39
- /**
40
- * Return the unique match for this subject, or null if not found.
41
- * The properties of the subject are matched against the patterns previously added, and the most specifc pattern wins.
42
- * Unknown properties in the subject are ignored.
43
- * You can optionally provide a second boolean parameter, exact. If true, then all properties of the subject must match.
44
- *
45
- * If the optional third boolean parameter collect is true, then find returns an array of all sub matches
46
- * (i.e. run find on each element of the power set of the subject pattern elements, and collate in breadth first order).
47
- * Thus, {a:1,b:2} will generate {a:1},{b:2},{a:1,b:2} searches.
48
- * If exact is true, only increasing sub patterns in lexicographical order are chosen.
49
- * Thus, {a:1,b:2} will generate {a:1},{a:1,b:2}, omitting {b:2}. (You probably want to set exact to false!).
50
- * @param subject
51
- * @param exact
52
- */
53
- find(subject: Record<string, any>, exact?: boolean): any;
54
- /**
55
- * Return the list of registered patterns that contain this partial pattern.
56
- * You can use wildcards for property values.
57
- * Omitted values are not equivalent to a wildcard of "*", you must specify each property explicitly.
58
- * @param partialPattern
59
- */
60
- list(partialPattern?: Record<string, any> | undefined): {
61
- match: Record<string, any>;
62
- data: any;
63
- }[];
64
- /**
65
- * Generate a string representation of the decision tree for debugging.
66
- */
67
- toJSON(): string;
9
+ declare class AccessDenyException extends Exception {
10
+ errno: string | number;
11
+ message: string;
68
12
  }
69
13
 
70
- type CLIEntrypoint = (module: Module, cliMap: CLIMap, handler: CLIEntrypointHandler, registerDestroy: EntrypointDestroyerRegistrar) => void;
71
- type HTTPEntrypoint = (module: Module, routeMap: HTTPRouteMap, handler: HTTPEntrypointHandler, registerDestroy: EntrypointDestroyerRegistrar) => void;
72
- type ServiceEntrypoint = (module: Module, handler: ServiceEntrypointHandler, registerDestroy: EntrypointDestroyerRegistrar) => void;
73
- type CLIMap = Map<string, JSONSchema>;
74
- type HTTPRouteMap<HTTPMethods = string> = Map<string, Set<HTTPMethods>>;
75
- type CLIEntrypointHandler<T = unknown> = (context: CLIContext, abortController?: AbortController) => Promise<T>;
76
- type HTTPEntrypointHandler<T = unknown> = (context: HTTPContext, abortController?: AbortController) => Promise<T>;
77
- type ServiceEntrypointHandler<T = unknown> = (context: ServiceContext, abortController?: AbortController) => Promise<T>;
78
- type EntrypointDestroyer = () => void | Promise<void>;
79
- type EntrypointDestroyerRegistrar = (destroyer: EntrypointDestroyer) => void;
80
- type EntrypointOptions = {
81
- controllers: IBaseObjectConstructor<Controller>[];
82
- cli?: CLIEntrypoint | CLIEntrypoint[];
83
- http?: HTTPEntrypoint | HTTPEntrypoint[];
84
- service?: ServiceEntrypoint | ServiceEntrypoint[];
85
- };
86
- /**
87
- * Build cli entrypoint
88
- * @param entrypoint
89
- * @constructor
90
- */
91
- declare const BuildCLIEntrypoint: (entrypoint: CLIEntrypoint) => CLIEntrypoint;
92
- /**
93
- * Build http entrypoint
94
- * @param entrypoint
95
- * @constructor
96
- */
97
- declare const BuildHTTPEntrypoint: (entrypoint: HTTPEntrypoint) => HTTPEntrypoint;
98
- /**
99
- * Build service entrypoint
100
- * @param entrypoint
101
- * @constructor
102
- */
103
- declare const BuildServiceEntrypoint: (entrypoint: ServiceEntrypoint) => ServiceEntrypoint;
104
- /**
105
- * Build entrypoints options for Entrypoint component
106
- * @param options
107
- * @constructor
108
- */
109
- declare const BuildEntrypoints: (options: EntrypointOptions) => EntrypointOptions;
110
- /**
111
- * Entrypoint Component
112
- */
113
- declare class Entrypoint extends Component {
114
- protected readonly CLIActionPatternMap: ActionPatternMap;
115
- protected readonly HTTPActionPatternMap: ActionPatternMap;
116
- protected readonly ServiceActionPatternMap: ActionPatternMap;
117
- protected readonly CLIActionPatternManager: PatternManager;
118
- protected readonly HTTPActionPatternManager: PatternManager;
119
- protected readonly ServiceActionPatternManager: PatternManager;
120
- protected readonly entrypointDestroyers: EntrypointDestroyer[];
121
- protected readonly controllers: IBaseObjectConstructor<Controller>[];
122
- protected readonly cli?: CLIEntrypoint | CLIEntrypoint[];
123
- protected readonly http?: HTTPEntrypoint | HTTPEntrypoint[];
124
- protected readonly service?: ServiceEntrypoint | ServiceEntrypoint[];
125
- /**
126
- * Initializer
127
- * @protected
128
- */
129
- protected init(): Promise<void>;
130
- /**
131
- * Destroyer
132
- * @protected
133
- */
134
- protected destroy(): Promise<void>;
135
- /**
136
- * Run controller's method and return its result (without AbortController)
137
- * @param details
138
- * @param context
139
- * @param dtoConstructor
140
- * @protected
141
- */
142
- protected runControllerMethodWithoutAbortController<DTOConstructor extends typeof DTO = typeof DTO>(details: ActionDetails, context: CLIContext | HTTPContext | ServiceContext, dtoConstructor: DTOConstructor): Promise<unknown>;
143
- /**
144
- * Run controller's method and return its result (with AbortController)
145
- * @param details
146
- * @param context
147
- * @param dtoConstructor
148
- * @param abortController
149
- * @protected
150
- */
151
- protected runControllerMethodWithAbortController<DTOConstructor extends typeof DTO = typeof DTO>(details: ActionDetails, context: CLIContext | HTTPContext | ServiceContext, dtoConstructor: DTOConstructor, abortController: AbortController): Promise<unknown>;
152
- /**
153
- * Run controller's method and return its result
154
- * @param details
155
- * @param context
156
- * @param dtoConstructor
157
- * @param abortController
158
- * @protected
159
- */
160
- protected runControllerMethod<DTOConstructor extends typeof DTO = typeof DTO>(details: ActionDetails, context: CLIContext | HTTPContext | ServiceContext, dtoConstructor: DTOConstructor, abortController?: AbortController): Promise<unknown>;
161
- /**
162
- * Register
163
- * @param eps
164
- * @param registerFunc
165
- * @protected
166
- */
167
- protected register<T>(eps: any | any[] | undefined, registerFunc: (entrypoint: T) => void): void;
168
- /**
169
- * Register CLI entrypoint
170
- * @param entrypoint
171
- * @protected
172
- */
173
- protected registerCLIEntrypoint(entrypoint: CLIEntrypoint): void;
174
- /**
175
- * Register http entrypoint
176
- * @param entrypoint
177
- * @protected
178
- */
179
- protected registerHTTPEntrypoint(entrypoint: HTTPEntrypoint): void;
180
- /**
181
- * Register service entrypoint
182
- * @param entrypoint
183
- * @protected
184
- */
185
- protected registerServiceEntrypoint(entrypoint: ServiceEntrypoint): void;
14
+ declare class DuplicateActionNameException extends Exception {
15
+ errno: string | number;
186
16
  }
187
17
 
188
18
  declare class ControllerActionNotFoundException extends Exception {
189
19
  errno: string | number;
190
20
  }
191
21
 
192
- export { BuildCLIEntrypoint, BuildEntrypoints, BuildHTTPEntrypoint, BuildServiceEntrypoint, CLIContext, Controller, ControllerActionNotFoundException, Entrypoint, HTTPContext, ServiceContext };
193
- export type { CLIEntrypoint, CLIEntrypointHandler, CLIMap, EntrypointDestroyer, EntrypointDestroyerRegistrar, EntrypointOptions, HTTPEntrypoint, HTTPEntrypointHandler, HTTPRouteMap, ServiceEntrypoint, ServiceEntrypointHandler };
22
+ export { AccessDenyException, ControllerActionNotFoundException, DuplicateActionNameException };
@@ -4,6 +4,12 @@ export { BuildCLIEntrypoint, BuildEntrypoints, BuildHTTPEntrypoint, BuildService
4
4
 
5
5
  export { Controller } from "../src/components/entrypoint/lib/Controller.mjs";
6
6
 
7
+ export { AccessControlRule } from "../src/components/entrypoint/lib/AccessControlRule.mjs";
8
+
9
+ export { AccessDenyException } from "../src/components/entrypoint/exceptions/AccessDenyException.mjs";
10
+
11
+ export { DuplicateActionNameException } from "../src/components/entrypoint/exceptions/DuplicateActionNameException.mjs";
12
+
7
13
  export { ControllerActionNotFoundException } from "../src/components/entrypoint/exceptions/ControllerActionNotFoundException.mjs";
8
14
 
9
15
  export { BaseContext, ContextType } from "../src/lib/base/Context.mjs";
@@ -176,6 +182,10 @@ import "../src/lib/helpers/GetObjectNestingDepth.mjs";
176
182
 
177
183
  import "../src/exceptions/InvalidActionPatternDepthException.mjs";
178
184
 
185
+ import "../src/lib/base/internal/StringifyPattern.mjs";
186
+
187
+ import "../vendor/Package.64.mjs";
188
+
179
189
  import "../src/lib/base/internal/PatternManager.mjs";
180
190
 
181
191
  import "../src/exceptions/DestroyRuntimeContainerException.mjs";
@@ -184,4 +194,6 @@ import "../src/lib/helpers/GetObjectPropertyPaths.mjs";
184
194
 
185
195
  import "../src/lib/helpers/UniqueArray.mjs";
186
196
 
197
+ import "../src/components/entrypoint/lib/AccessControl.mjs";
198
+
187
199
  import "node:http";
@@ -1,5 +1,5 @@
1
1
  import '../vendor/TypeDef.2.js';
2
- import { M as MethodDecorator } from '../vendor/TypeDef.10.js';
2
+ import { M as MethodDecorator } from '../vendor/TypeDef.8.js';
3
3
 
4
4
  type BeforeFunction<ClassPrototype extends Object, Method extends (...args: any[]) => unknown> = (this: ClassPrototype, ...args: Parameters<Method>) => Promise<Parameters<Method> | void> | Parameters<Method> | void;
5
5
  type AfterFunction<ClassPrototype extends Object, Method extends (...args: any[]) => unknown> = (this: ClassPrototype, result: Awaited<ReturnType<Method>>) => Promise<ReturnType<Method> | void> | ReturnType<Method> | void;
@@ -20,9 +20,9 @@ const i = require("../src/decorators/ctrl/http/OPTIONS.cjs");
20
20
 
21
21
  const o = require("../src/decorators/ctrl/http/PATCH.cjs");
22
22
 
23
- const a = require("../src/decorators/ctrl/http/POST.cjs");
23
+ const n = require("../src/decorators/ctrl/http/POST.cjs");
24
24
 
25
- const n = require("../src/decorators/ctrl/http/PUT.cjs");
25
+ const a = require("../src/decorators/ctrl/http/PUT.cjs");
26
26
 
27
27
  const l = require("../src/decorators/ctrl/ServiceAction.cjs");
28
28
 
@@ -64,7 +64,11 @@ require("../src/lib/base/internal/CamelCase.cjs");
64
64
 
65
65
  require("../src/lib/helpers/NoCase.cjs");
66
66
 
67
- require("../src/lib/base/internal/FlexibleDTO.cjs");
67
+ require("../src/lib/base/internal/StringifyPattern.cjs");
68
+
69
+ require("../vendor/Package.64.cjs");
70
+
71
+ require("../src/lib/base/internal/ActionOptions.cjs");
68
72
 
69
73
  require("../vendor/Package.1.cjs");
70
74
 
@@ -96,6 +100,12 @@ require("../src/constants/DTOMetadataKey.cjs");
96
100
 
97
101
  require("../src/lib/helpers/ObjectPrototype.cjs");
98
102
 
103
+ require("../src/decorators/dto/Expect.cjs");
104
+
105
+ require("../src/lib/base/internal/GetActionDTOAndOptions.cjs");
106
+
107
+ require("../src/lib/base/internal/FlexibleDTO.cjs");
108
+
99
109
  require("../src/decorators/dto/IndexSignature.cjs");
100
110
 
101
111
  exports.CLIAction = r.CLIAction;
@@ -112,8 +122,8 @@ exports.OPTIONS = i.OPTIONS;
112
122
 
113
123
  exports.PATCH = o.PATCH;
114
124
 
115
- exports.POST = a.POST;
125
+ exports.POST = n.POST;
116
126
 
117
- exports.PUT = n.PUT;
127
+ exports.PUT = a.PUT;
118
128
 
119
129
  exports.ServiceAction = l.ServiceAction;
@@ -1,10 +1,34 @@
1
1
  import '../vendor/TypeDef.2.js';
2
- import { C as Controller, c as ControllerProperty } from '../vendor/TypeDef.14.js';
3
- import { M as MethodDecorator } from '../vendor/TypeDef.10.js';
2
+ import { q as BaseContext, A as AccessControlRuleHandler, v as Controller, u as ControllerProperty, r as CLIContext, s as HTTPContext, t as ServiceContext } from '../vendor/TypeDef.13.js';
3
+ import { M as MethodDecorator } from '../vendor/TypeDef.8.js';
4
4
  import { D as DTO } from '../vendor/TypeDef.5.js';
5
- import { A as ActionPattern } from '../vendor/TypeDef.9.js';
5
+ import { A as ActionPattern } from '../vendor/TypeDef.10.js';
6
6
  import '../vendor/TypeDef.3.js';
7
7
  import 'node:http';
8
+ import '../vendor/TypeDef.7.js';
9
+
10
+ declare class ActionOptions<T extends BaseContext<Record<string, any>>> extends DTO {
11
+ /**
12
+ * Whether enable access control for this action
13
+ */
14
+ acl?: boolean;
15
+ /**
16
+ * Action name
17
+ */
18
+ name?: string;
19
+ /**
20
+ * Action description
21
+ */
22
+ description?: string;
23
+ /**
24
+ * Action group names
25
+ */
26
+ groups?: string[];
27
+ /**
28
+ * Action rule callback
29
+ */
30
+ rule?: AccessControlRuleHandler<T>;
31
+ }
8
32
 
9
33
  /**
10
34
  * Method Decorator
@@ -19,6 +43,21 @@ declare function CLIAction<ClassPrototype extends Controller, Method, DTOConstru
19
43
  * @constructor
20
44
  */
21
45
  declare function CLIAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(command: string, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
46
+ /**
47
+ * Method Decorator
48
+ * @param command
49
+ * @param actionOptions
50
+ * @constructor
51
+ */
52
+ declare function CLIAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(command: string, actionOptions: ActionOptions<CLIContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
53
+ /**
54
+ * Method Decorator
55
+ * @param command
56
+ * @param dtoConstructor
57
+ * @param actionOptions
58
+ * @constructor
59
+ */
60
+ declare function CLIAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(command: string, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<CLIContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
22
61
 
23
62
  /**
24
63
  * Method Decorator
@@ -35,6 +74,23 @@ declare function HTTPAction<ClassPrototype extends Controller, Method, DTOConstr
35
74
  * @constructor
36
75
  */
37
76
  declare function HTTPAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(route: string, method: string, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
77
+ /**
78
+ * Method Decorator
79
+ * @param route
80
+ * @param method
81
+ * @param actionOptions
82
+ * @constructor
83
+ */
84
+ declare function HTTPAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(route: string, method: string, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
85
+ /**
86
+ * Method Decorator
87
+ * @param route
88
+ * @param method
89
+ * @param dtoConstructor
90
+ * @param actionOptions
91
+ * @constructor
92
+ */
93
+ declare function HTTPAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(route: string, method: string, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
38
94
  /**
39
95
  * Method Decorator
40
96
  * @param route
@@ -50,20 +106,51 @@ declare function HTTPAction<ClassPrototype extends Controller, Method, DTOConstr
50
106
  * @constructor
51
107
  */
52
108
  declare function HTTPAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(route: string, methods: string[], dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
109
+ /**
110
+ * Method Decorator
111
+ * @param route
112
+ * @param methods
113
+ * @param actionOptions
114
+ * @constructor
115
+ */
116
+ declare function HTTPAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(route: string, methods: string[], actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
117
+ /**
118
+ * Method Decorator
119
+ * @param route
120
+ * @param methods
121
+ * @param dtoConstructor
122
+ * @param actionOptions
123
+ * @constructor
124
+ */
125
+ declare function HTTPAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(route: string, methods: string[], dtoConstructor: DTOConstructor, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
53
126
 
54
- declare function DELETE<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor?: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
127
+ declare function DELETE<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
128
+ declare function DELETE<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
129
+ declare function DELETE<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
55
130
 
56
- declare function GET<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor?: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
131
+ declare function GET<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
132
+ declare function GET<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
133
+ declare function GET<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
57
134
 
58
- declare function HEAD<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor?: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
135
+ declare function HEAD<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
136
+ declare function HEAD<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
137
+ declare function HEAD<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
59
138
 
60
- declare function OPTIONS<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor?: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
139
+ declare function OPTIONS<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
140
+ declare function OPTIONS<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
141
+ declare function OPTIONS<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
61
142
 
62
- declare function PATCH<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor?: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
143
+ declare function PATCH<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
144
+ declare function PATCH<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
145
+ declare function PATCH<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
63
146
 
64
- declare function POST<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor?: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
147
+ declare function POST<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
148
+ declare function POST<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
149
+ declare function POST<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
65
150
 
66
- declare function PUT<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor?: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
151
+ declare function PUT<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
152
+ declare function PUT<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
153
+ declare function PUT<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(r: string, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<HTTPContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
67
154
 
68
155
  /**
69
156
  * Method Decorator
@@ -78,5 +165,20 @@ declare function ServiceAction<ClassPrototype extends Controller, Method, DTOCon
78
165
  * @constructor
79
166
  */
80
167
  declare function ServiceAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(pattern: ActionPattern, dtoConstructor: DTOConstructor): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
168
+ /**
169
+ * Method Decorator
170
+ * @param pattern
171
+ * @param actionOptions
172
+ * @constructor
173
+ */
174
+ declare function ServiceAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(pattern: ActionPattern, actionOptions: ActionOptions<ServiceContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
175
+ /**
176
+ * Method Decorator
177
+ * @param pattern
178
+ * @param dtoConstructor
179
+ * @param actionOptions
180
+ * @constructor
181
+ */
182
+ declare function ServiceAction<ClassPrototype extends Controller, Method, DTOConstructor extends typeof DTO = typeof DTO>(pattern: ActionPattern, dtoConstructor: DTOConstructor, actionOptions: ActionOptions<ServiceContext>): MethodDecorator<ClassPrototype, Method, ControllerProperty<ClassPrototype>>;
81
183
 
82
184
  export { CLIAction, DELETE, GET, HEAD, HTTPAction, OPTIONS, PATCH, POST, PUT, ServiceAction };
@@ -58,7 +58,11 @@ import "../src/lib/base/internal/CamelCase.mjs";
58
58
 
59
59
  import "../src/lib/helpers/NoCase.mjs";
60
60
 
61
- import "../src/lib/base/internal/FlexibleDTO.mjs";
61
+ import "../src/lib/base/internal/StringifyPattern.mjs";
62
+
63
+ import "../vendor/Package.64.mjs";
64
+
65
+ import "../src/lib/base/internal/ActionOptions.mjs";
62
66
 
63
67
  import "../vendor/Package.1.mjs";
64
68
 
@@ -90,4 +94,10 @@ import "../src/constants/DTOMetadataKey.mjs";
90
94
 
91
95
  import "../src/lib/helpers/ObjectPrototype.mjs";
92
96
 
97
+ import "../src/decorators/dto/Expect.mjs";
98
+
99
+ import "../src/lib/base/internal/GetActionDTOAndOptions.mjs";
100
+
101
+ import "../src/lib/base/internal/FlexibleDTO.mjs";
102
+
93
103
  import "../src/decorators/dto/IndexSignature.mjs";
package/decorator/di.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import '../vendor/TypeDef.2.js';
2
2
  import { B as BaseObject, L as LifetimeType, I as IBaseObjectConstructor } from '../vendor/TypeDef.3.js';
3
- import { C as ClassDecorator, P as PropertyDecorator } from '../vendor/TypeDef.12.js';
3
+ import { C as ClassDecorator, P as PropertyDecorator } from '../vendor/TypeDef.11.js';
4
4
  import { S as Schema } from '../vendor/TypeDef.5.js';
5
- import '../vendor/TypeDef.11.js';
5
+ import '../vendor/TypeDef.9.js';
6
6
 
7
7
  /**
8
8
  * Class Decorator
@@ -1,8 +1,8 @@
1
1
  import '../vendor/TypeDef.2.js';
2
2
  import { D as DTO, S as Schema } from '../vendor/TypeDef.5.js';
3
- import { C as ClassDecorator, P as PropertyDecorator } from '../vendor/TypeDef.12.js';
4
- import { M as MethodDecorator } from '../vendor/TypeDef.10.js';
5
- import '../vendor/TypeDef.11.js';
3
+ import { C as ClassDecorator, P as PropertyDecorator } from '../vendor/TypeDef.11.js';
4
+ import { M as MethodDecorator } from '../vendor/TypeDef.8.js';
5
+ import '../vendor/TypeDef.9.js';
6
6
 
7
7
  /**
8
8
  * Class Decorator
@@ -1,6 +1,6 @@
1
1
  import '../vendor/TypeDef.2.js';
2
2
  import { C as ColumnOptions, l as SimpleColumnType, m as ColumnCommonOptions, n as SpatialColumnType, o as SpatialColumnOptions, W as WithLengthColumnType, p as WithWidthColumnType, q as WithPrecisionColumnType, P as PrimaryGeneratedColumnType, r as ColumnType, V as ValueTransformer, J as JoinColumnOptions, s as JoinTableOptions, t as JoinTableMultipleColumnsOptions, u as ObjectType, v as RelationOptions, S as SelectQueryBuilder, a as DataSource, w as OnDeleteType, x as TreeType, y as ClosureTreeOptions, z as DeferrableType } from '../vendor/TypeDef.4.js';
3
- import { E as EntityOptions, I as IndexOptions } from '../vendor/TypeDef.13.js';
3
+ import { E as EntityOptions, I as IndexOptions } from '../vendor/TypeDef.12.js';
4
4
  import 'fs';
5
5
  import 'tls';
6
6
  import 'net';