@mahameru/diatrema 0.0.1 → 0.0.3

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 (101) hide show
  1. package/diatrema-Bk12jngx.d.ts +93 -0
  2. package/diatrema-CyKJKZv_.d.cts +93 -0
  3. package/diatrema.cjs +70 -52
  4. package/diatrema.cjs.map +1 -1
  5. package/diatrema.d.cts +6 -72
  6. package/diatrema.d.ts +4 -71
  7. package/diatrema.js +70 -52
  8. package/diatrema.js.map +1 -1
  9. package/helpers.cjs +2 -18
  10. package/helpers.cjs.map +1 -1
  11. package/helpers.d.cts +1 -6
  12. package/helpers.d.ts +1 -6
  13. package/helpers.js +1 -16
  14. package/helpers.js.map +1 -1
  15. package/index.cjs +4 -18
  16. package/index.cjs.map +1 -1
  17. package/index.d.cts +4 -13
  18. package/index.d.ts +4 -13
  19. package/index.js +2 -9
  20. package/index.js.map +1 -1
  21. package/logger.cjs +10 -5
  22. package/logger.cjs.map +1 -1
  23. package/logger.d.cts +1 -1
  24. package/logger.d.ts +1 -1
  25. package/logger.js +10 -5
  26. package/logger.js.map +1 -1
  27. package/mahameru-plugin.cjs +109 -0
  28. package/mahameru-plugin.cjs.map +1 -0
  29. package/mahameru-plugin.d.cts +4 -0
  30. package/mahameru-plugin.d.ts +4 -0
  31. package/mahameru-plugin.js +85 -0
  32. package/mahameru-plugin.js.map +1 -0
  33. package/package.json +4 -3
  34. package/scripts/preinstall.cjs +10 -0
  35. package/scripts/preinstall.cjs.map +1 -0
  36. package/scripts/preinstall.d.cts +2 -0
  37. package/scripts/preinstall.d.ts +2 -0
  38. package/scripts/preinstall.js +9 -9
  39. package/scripts/preinstall.js.map +1 -0
  40. package/types.cjs +0 -23
  41. package/types.cjs.map +1 -1
  42. package/types.d.cts +5 -3
  43. package/types.d.ts +5 -3
  44. package/types.js +0 -15
  45. package/types.js.map +1 -1
  46. package/container-error.cjs +0 -45
  47. package/container-error.cjs.map +0 -1
  48. package/container-error.d.cts +0 -7
  49. package/container-error.d.ts +0 -7
  50. package/container-error.js +0 -22
  51. package/container-error.js.map +0 -1
  52. package/container.cjs +0 -318
  53. package/container.cjs.map +0 -1
  54. package/container.d.cts +0 -60
  55. package/container.d.ts +0 -60
  56. package/container.js +0 -285
  57. package/container.js.map +0 -1
  58. package/http-server-error.cjs +0 -44
  59. package/http-server-error.cjs.map +0 -1
  60. package/http-server-error.d.cts +0 -7
  61. package/http-server-error.d.ts +0 -7
  62. package/http-server-error.js +0 -21
  63. package/http-server-error.js.map +0 -1
  64. package/http-server.cjs +0 -382
  65. package/http-server.cjs.map +0 -1
  66. package/http-server.d.cts +0 -81
  67. package/http-server.d.ts +0 -81
  68. package/http-server.js +0 -359
  69. package/http-server.js.map +0 -1
  70. package/mahameru-request.cjs +0 -79
  71. package/mahameru-request.cjs.map +0 -1
  72. package/mahameru-request.d.cts +0 -3
  73. package/mahameru-request.d.ts +0 -3
  74. package/mahameru-request.js +0 -56
  75. package/mahameru-request.js.map +0 -1
  76. package/mahameru-response.cjs +0 -71
  77. package/mahameru-response.cjs.map +0 -1
  78. package/mahameru-response.d.cts +0 -17
  79. package/mahameru-response.d.ts +0 -17
  80. package/mahameru-response.js +0 -48
  81. package/mahameru-response.js.map +0 -1
  82. package/mahameru-server-error.cjs +0 -54
  83. package/mahameru-server-error.cjs.map +0 -1
  84. package/mahameru-server-error.d.cts +0 -19
  85. package/mahameru-server-error.d.ts +0 -19
  86. package/mahameru-server-error.js +0 -31
  87. package/mahameru-server-error.js.map +0 -1
  88. package/module-error.cjs +0 -46
  89. package/module-error.cjs.map +0 -1
  90. package/module-error.d.cts +0 -12
  91. package/module-error.d.ts +0 -12
  92. package/module-error.js +0 -23
  93. package/module-error.js.map +0 -1
  94. package/route.cjs +0 -128
  95. package/route.cjs.map +0 -1
  96. package/route.d.cts +0 -46
  97. package/route.d.ts +0 -46
  98. package/route.js +0 -105
  99. package/route.js.map +0 -1
  100. package/types-BmFqDpSs.d.ts +0 -113
  101. package/types-Cd6Gkoxx.d.cts +0 -113
package/container.js DELETED
@@ -1,285 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- import path, { basename, dirname, join, relative, resolve } from "node:path";
4
- import { readdir } from "node:fs/promises";
5
- import { dynamicRequire, exists } from "./helpers.js";
6
- class Container {
7
- static {
8
- __name(this, "Container");
9
- }
10
- #initialized = false;
11
- classes = /* @__PURE__ */ new Map();
12
- _modules = /* @__PURE__ */ new Map();
13
- _errorHandler;
14
- _notFoundHandler;
15
- dependencies;
16
- _initiatorHandler;
17
- options;
18
- containerRegistry = /* @__PURE__ */ new Map();
19
- constructor(arg1, arg2) {
20
- if (typeof arg2 !== "undefined") {
21
- this.options = this.buildOptions(arg1);
22
- this.dependencies = arg2;
23
- } else {
24
- this.dependencies = arg1;
25
- this.options = this.buildOptions();
26
- }
27
- }
28
- get notFoundHandler() {
29
- return this._notFoundHandler;
30
- }
31
- getRouteItems() {
32
- return Array.from(this.containerRegistry.values()).filter((item) => item.type === "route").map((item) => item.item);
33
- }
34
- get middlewareHandler() {
35
- return this.containerRegistry.values().find((item) => item.type === "middleware")?.item;
36
- }
37
- get errorHandler() {
38
- return this._errorHandler;
39
- }
40
- get protectedRoutes() {
41
- return this.containerRegistry.values().find((item) => item.type === "protected-route")?.item || [];
42
- }
43
- get initialized() {
44
- return this.#initialized;
45
- }
46
- get mahameruContainer() {
47
- const camelCaseName = /* @__PURE__ */ __name((name) => name.charAt(0).toLowerCase() + name.slice(1), "camelCaseName");
48
- return new Proxy({}, {
49
- get: /* @__PURE__ */ __name((_target, prop) => {
50
- if (typeof prop !== "string")
51
- return void 0;
52
- for (const registry of this.containerRegistry.values()) {
53
- if (registry.type === "module-service" || registry.type === "module-controller" || registry.type === "instance") {
54
- const key = camelCaseName(registry.name);
55
- if (key === prop) {
56
- return registry.item;
57
- }
58
- }
59
- }
60
- return void 0;
61
- }, "get")
62
- });
63
- }
64
- async discover() {
65
- await this.loadRoutes();
66
- await this.loadInitiator();
67
- await this.loadModules();
68
- await this.loadMiddlewareHandler();
69
- await this.loadNotFoundHandlers();
70
- await this.loadErrorHandler();
71
- this.#initialized = true;
72
- }
73
- async loadRoutes(currentDir) {
74
- const baseDir = this.options.routesPath;
75
- if (!currentDir)
76
- currentDir = baseDir;
77
- const items = await readdir(currentDir, { withFileTypes: true }).catch((error) => {
78
- if (error.code === "ENOENT")
79
- return [];
80
- throw error;
81
- });
82
- for (const item of items) {
83
- const fullPath = join(currentDir, item.name);
84
- if (item.isDirectory()) {
85
- await this.loadRoutes(fullPath);
86
- continue;
87
- }
88
- if (!item.isFile() || !["route.js", "route.ts"].includes(item.name))
89
- continue;
90
- await this.loadSingleRoute(fullPath, currentDir, baseDir, { parentPath: item.parentPath, name: item.name });
91
- }
92
- }
93
- async loadSingleRoute(fullPath, currentDir, baseDir, item) {
94
- const relativePath = relative(baseDir, currentDir);
95
- let path2 = "/" + relativePath.replace(/\\/g, "/");
96
- path2 = path2.replace(/\/+/g, "/");
97
- if (path2.length > 1 && path2.endsWith("/"))
98
- path2 = path2.slice(0, -1);
99
- const paramNames = [];
100
- const paramMatches = path2.match(/\[([^\]]+)\]/g);
101
- if (paramMatches)
102
- paramMatches.forEach((match) => {
103
- paramNames.push(match.slice(1, -1));
104
- });
105
- const escaped = path2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
106
- const regexPattern = escaped.replace(/\\\[([^\\\]]+)\\\]/g, "([^/]+)");
107
- const regex = new RegExp(`^${regexPattern}$`);
108
- const pathFS = resolve(fullPath);
109
- const routeHandlers = await dynamicRequire(this.options.moduleType, fullPath, this.options.dev);
110
- if (routeHandlers) {
111
- this.containerRegistry.set(fullPath, {
112
- name: dirname(item.parentPath),
113
- path: fullPath,
114
- type: "route",
115
- item: {
116
- paramNames: [...paramNames],
117
- path: path2,
118
- pathFS,
119
- regex,
120
- routeHandlers
121
- }
122
- });
123
- return true;
124
- }
125
- return false;
126
- }
127
- async loadModules() {
128
- const items = await readdir(this.options.modulesPath, { withFileTypes: true }).catch((error) => {
129
- if (error.code === "ENOENT")
130
- return [];
131
- throw error;
132
- });
133
- for (const item of items) {
134
- if (!item.isDirectory())
135
- continue;
136
- const directory = item;
137
- let controllerPath;
138
- const controllerPathCandidate = [
139
- path.join(this.options.modulesPath, directory.name, `controller.js`),
140
- path.join(this.options.modulesPath, directory.name, `controller.ts`)
141
- ];
142
- for (const candidate of controllerPathCandidate) {
143
- if (await exists(candidate)) {
144
- controllerPath = candidate;
145
- break;
146
- }
147
- }
148
- if (controllerPath && await exists(controllerPath)) {
149
- const controllerModule = await dynamicRequire(this.options.moduleType, controllerPath, this.options.dev);
150
- if (controllerModule) {
151
- const { name, clazz } = this.getDefaultExportClass(controllerModule, controllerPath);
152
- const item2 = new clazz(this.mahameruContainer);
153
- const containerRegistryID = `${controllerPath}:${name}`;
154
- if (!this.containerRegistry.has(containerRegistryID))
155
- this.containerRegistry.set(containerRegistryID, {
156
- name,
157
- path: controllerPath,
158
- type: "module-controller",
159
- item: item2
160
- });
161
- }
162
- }
163
- let servicePath;
164
- const servicePathCandidate = [
165
- path.join(this.options.modulesPath, directory.name, `service.js`),
166
- path.join(this.options.modulesPath, directory.name, `service.ts`)
167
- ];
168
- for (const candidate of servicePathCandidate) {
169
- if (await exists(candidate)) {
170
- servicePath = candidate;
171
- break;
172
- }
173
- }
174
- if (servicePath && await exists(servicePath)) {
175
- const serviceModule = await dynamicRequire(this.options.moduleType, servicePath, this.options.dev);
176
- if (serviceModule) {
177
- const { name, clazz } = this.getDefaultExportClass(serviceModule, servicePath);
178
- const item2 = new clazz(this.mahameruContainer);
179
- const containerRegistryID = `${controllerPath}:${name}`;
180
- if (!this.containerRegistry.has(containerRegistryID))
181
- this.containerRegistry.set(containerRegistryID, {
182
- name,
183
- path: servicePath,
184
- type: "module-service",
185
- item: item2
186
- });
187
- }
188
- }
189
- }
190
- }
191
- async loadMiddlewareHandler() {
192
- const middlawareHandlerPath = join(this.options.appPath, "middleware.js");
193
- const result = await dynamicRequire(this.options.moduleType, middlawareHandlerPath, this.options.dev);
194
- let success = false;
195
- if (result?.default && !Array.isArray(result.default)) {
196
- this.containerRegistry.set(`${middlawareHandlerPath}:default`, {
197
- name: "default",
198
- path: middlawareHandlerPath,
199
- type: "middleware",
200
- item: result.default
201
- });
202
- success = true;
203
- }
204
- if (result?.protectedRoutes && Array.isArray(result.protectedRoutes)) {
205
- this.containerRegistry.set(`${middlawareHandlerPath}:protectedRoutes`, {
206
- name: "protectedRoutes",
207
- path: middlawareHandlerPath,
208
- type: "protected-route",
209
- item: result.protectedRoutes
210
- });
211
- success = true;
212
- }
213
- return success;
214
- }
215
- async loadNotFoundHandlers() {
216
- const notFoundHandlerPath = join(this.options.appPath, "routes", "not-found.js");
217
- this._notFoundHandler = await dynamicRequire(this.options.moduleType, notFoundHandlerPath, this.options.dev);
218
- }
219
- async loadErrorHandler() {
220
- const errorHandlerPath = join(this.options.appPath, "error.js");
221
- const result = await dynamicRequire(this.options.moduleType, errorHandlerPath, this.options.dev);
222
- this._errorHandler = result?.default;
223
- }
224
- async loadInitiator() {
225
- const initiatorPath = join(this.options.appPath, "initiator.js");
226
- const result = await dynamicRequire(this.options.moduleType, initiatorPath, this.options.dev);
227
- const handler = result?.default;
228
- if (handler) {
229
- this._initiatorHandler = handler;
230
- const instances = await this._initiatorHandler();
231
- Object.keys(instances).forEach((key) => {
232
- this.containerRegistry.set(`${initiatorPath}:${key}`, {
233
- name: key,
234
- path: initiatorPath,
235
- type: "instance",
236
- item: instances[key]
237
- });
238
- });
239
- }
240
- }
241
- async onFileChanged(filePath) {
242
- filePath = filePath.endsWith(".ts") ? filePath.replace(".ts", ".js") : filePath;
243
- if (filePath.includes("\\src\\"))
244
- filePath = filePath.replace("\\src\\", `\\.mahameru\\`);
245
- const found = this.containerRegistry.values().find((containerItem) => containerItem.path === filePath);
246
- if (found) {
247
- if (found.type === "route") {
248
- return await this.loadSingleRoute(filePath, dirname(filePath), this.options.routesPath, { parentPath: dirname(filePath), name: basename(filePath) });
249
- } else if (found.type === "middleware" || found.type === "protected-route") {
250
- return await this.loadMiddlewareHandler();
251
- }
252
- }
253
- return false;
254
- }
255
- getDefaultExportClass(module, filePath) {
256
- const defaultExportName = Object.keys(module).find((key) => key === "default");
257
- if (!defaultExportName)
258
- throw new this.dependencies.ModuleError(`Module in file '${filePath}' does not have a default export.`, { path: filePath, moduleName: Object.keys(module)[0] });
259
- return {
260
- name: module[defaultExportName].name,
261
- clazz: module[defaultExportName]
262
- };
263
- }
264
- buildOptions(initialOptions) {
265
- const appPath = join(process.cwd(), ".mahameru");
266
- const defaultOptions = {
267
- appPath,
268
- modulesPath: join(appPath, "modules"),
269
- moduleType: "esm",
270
- dev: initialOptions?.dev ? true : false,
271
- routesPath: join(appPath, "routes")
272
- };
273
- if (!initialOptions)
274
- return defaultOptions;
275
- return {
276
- ...defaultOptions,
277
- appPath,
278
- ...initialOptions
279
- };
280
- }
281
- }
282
- export {
283
- Container
284
- };
285
- //# sourceMappingURL=container.js.map
package/container.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/container.ts"],"sourcesContent":["import path, { basename, dirname, join, relative, resolve } from 'node:path';\nimport { readdir } from 'node:fs/promises';\n\nimport { dynamicRequire, exists } from './helpers';\nimport type { ContainerError } from './container-error';\nimport type { ClassConstructor, ContainerRegistry, ErrorHandler, HTTPMethod, InitiatorHandler, MahameruContainer, MahameruMiddleware, ProtectedRoute, RouteHandler, RouteItem } from './types';\nimport type { ModuleError } from './module-error';\n\n/**\n * Container options\n */\nexport type ContainerOptions = {\n modulesPath: string;\n routesPath: string;\n appPath: string;\n dev: boolean;\n moduleType: \"commonjs\" | \"esm\";\n}\n\nexport type ContainerDependencies = {\n dataSources?: Record<string, any>;\n ContainerError: typeof ContainerError;\n ModuleError: typeof ModuleError;\n}\n\nexport class Container {\n #initialized = false;\n protected classes = new Map<string, ClassConstructor>();\n protected _modules = new Map<ClassConstructor, any>();\n protected _errorHandler?: ErrorHandler;\n protected _notFoundHandler?: Record<HTTPMethod, RouteHandler>;\n protected dependencies: ContainerDependencies;\n protected _initiatorHandler?: InitiatorHandler;\n public readonly options: ContainerOptions;\n public containerRegistry: ContainerRegistry = new Map();\n\n constructor(dependencies: ContainerDependencies);\n constructor(initialOptions: Partial<ContainerOptions>, dependencies: ContainerDependencies);\n constructor(arg1: Partial<ContainerOptions> | ContainerDependencies, arg2?: ContainerDependencies) {\n if (typeof arg2 !== 'undefined') {\n this.options = this.buildOptions(arg1 as Partial<ContainerOptions>);\n this.dependencies = arg2;\n } else {\n this.dependencies = arg1 as ContainerDependencies;\n this.options = this.buildOptions();\n }\n }\n\n get notFoundHandler() {\n return this._notFoundHandler;\n }\n\n getRouteItems(): RouteItem[] {\n return Array.from(this.containerRegistry.values()).filter((item) => item.type === 'route').map((item) => item.item);\n }\n\n get middlewareHandler(): MahameruMiddleware | undefined {\n return this.containerRegistry.values().find((item) => item.type === 'middleware')?.item;\n }\n\n get errorHandler() {\n return this._errorHandler;\n }\n\n get protectedRoutes(): ProtectedRoute {\n return this.containerRegistry.values().find((item) => item.type === 'protected-route')?.item || [];\n }\n\n get initialized() {\n return this.#initialized;\n }\n\n get mahameruContainer(): MahameruContainer {\n const camelCaseName = (name: string) => name.charAt(0).toLowerCase() + name.slice(1);\n\n return new Proxy({} as Record<string, unknown>, {\n get: (_target, prop) => {\n if (typeof prop !== 'string')\n return undefined;\n\n for (const registry of this.containerRegistry.values()) {\n if (registry.type === 'module-service' || registry.type === 'module-controller' || registry.type === 'instance') {\n const key = camelCaseName(registry.name);\n\n if (key === prop) {\n return registry.item;\n }\n }\n }\n\n return undefined;\n }\n }) as MahameruContainer;\n\n\n // const instances = this.containerRegistry.values().find((item) => item.type === 'instance');\n\n // if (instances) {\n // (result as any) = {\n // ...result,\n // ...instances.item\n // };\n // }\n\n // return result;\n }\n\n async discover() {\n await this.loadRoutes();\n await this.loadInitiator();\n await this.loadModules();\n await this.loadMiddlewareHandler();\n await this.loadNotFoundHandlers();\n await this.loadErrorHandler();\n\n this.#initialized = true;\n }\n\n protected async loadRoutes(currentDir?: string) {\n const baseDir = this.options.routesPath;\n\n if (!currentDir)\n currentDir = baseDir;\n\n const items = await readdir(currentDir, { withFileTypes: true }).catch(error => {\n if (error.code === 'ENOENT')\n return [];\n\n throw error;\n });\n\n for (const item of items) {\n const fullPath = join(currentDir, item.name);\n\n if (item.isDirectory()) {\n await this.loadRoutes(fullPath);\n\n continue;\n }\n\n if (!item.isFile() || (!['route.js', 'route.ts'].includes(item.name)))\n continue;\n\n await this.loadSingleRoute(fullPath, currentDir, baseDir, { parentPath: item.parentPath, name: item.name })\n }\n }\n\n protected async loadSingleRoute(fullPath: string, currentDir: string, baseDir: string, item: { parentPath: string, name: string }): Promise<boolean> {\n const relativePath = relative(baseDir, currentDir);\n\n let path = '/' + relativePath.replace(/\\\\/g, '/');\n path = path.replace(/\\/+/g, '/');\n\n if (path.length > 1 && path.endsWith('/'))\n path = path.slice(0, -1);\n\n const paramNames: RouteItem['paramNames'] = [];\n const paramMatches = path.match(/\\[([^\\]]+)\\]/g);\n\n if (paramMatches)\n paramMatches.forEach((match) => {\n paramNames.push(match.slice(1, -1));\n });\n\n const escaped = path.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const regexPattern = escaped.replace(/\\\\\\[([^\\\\\\]]+)\\\\\\]/g, '([^/]+)');\n const regex = new RegExp(`^${regexPattern}$`);\n const pathFS = resolve(fullPath);\n const routeHandlers = await dynamicRequire<Record<HTTPMethod, RouteHandler>>(this.options.moduleType, fullPath, this.options.dev);\n\n if (routeHandlers) {\n this.containerRegistry.set(fullPath, {\n name: dirname(item.parentPath),\n path: fullPath,\n type: 'route',\n item: {\n paramNames: [...paramNames],\n path,\n pathFS,\n regex,\n routeHandlers\n }\n });\n\n return true;\n }\n\n return false;\n }\n\n protected async loadModules() {\n const items = await readdir(this.options.modulesPath, { withFileTypes: true }).catch(error => {\n if (error.code === 'ENOENT')\n return [];\n\n throw error;\n });\n\n for (const item of items) {\n if (!item.isDirectory())\n continue;\n\n const directory = item;\n\n let controllerPath;\n const controllerPathCandidate = [\n path.join(this.options.modulesPath, directory.name, `controller.js`),\n path.join(this.options.modulesPath, directory.name, `controller.ts`)\n ];\n\n for (const candidate of controllerPathCandidate) {\n if (await exists(candidate)) {\n controllerPath = candidate;\n break;\n }\n }\n\n if (controllerPath && await exists(controllerPath)) {\n const controllerModule = await dynamicRequire<Record<string, ClassConstructor>>(this.options.moduleType, controllerPath, this.options.dev);\n\n if (controllerModule) {\n const { name, clazz } = this.getDefaultExportClass(controllerModule, controllerPath);\n const item = new clazz(this.mahameruContainer);\n const containerRegistryID = `${controllerPath}:${name}`;\n\n if (!this.containerRegistry.has(containerRegistryID))\n this.containerRegistry.set(containerRegistryID, {\n name,\n path: controllerPath,\n type: 'module-controller',\n item\n })\n }\n }\n\n let servicePath;\n const servicePathCandidate = [\n path.join(this.options.modulesPath, directory.name, `service.js`),\n path.join(this.options.modulesPath, directory.name, `service.ts`)\n ];\n\n for (const candidate of servicePathCandidate) {\n if (await exists(candidate)) {\n servicePath = candidate;\n break;\n }\n }\n\n if (servicePath && await exists(servicePath)) {\n const serviceModule = await dynamicRequire<Record<string, ClassConstructor>>(this.options.moduleType, servicePath, this.options.dev);\n\n if (serviceModule) {\n const { name, clazz } = this.getDefaultExportClass(serviceModule, servicePath);\n const item = new clazz(this.mahameruContainer);\n const containerRegistryID = `${controllerPath}:${name}`;\n\n if (!this.containerRegistry.has(containerRegistryID))\n this.containerRegistry.set(containerRegistryID, {\n name,\n path: servicePath,\n type: 'module-service',\n item\n })\n }\n }\n }\n }\n\n protected async loadMiddlewareHandler(): Promise<boolean> {\n const middlawareHandlerPath = join(this.options.appPath, 'middleware.js');\n const result = await dynamicRequire<Record<'default' | 'protectedRoutes', MahameruMiddleware | ProtectedRoute>>(this.options.moduleType, middlawareHandlerPath, this.options.dev);\n let success = false;\n\n if (result?.default && !Array.isArray(result.default)) {\n this.containerRegistry.set(`${middlawareHandlerPath}:default`, {\n name: 'default',\n path: middlawareHandlerPath,\n type: 'middleware',\n item: result.default\n });\n\n success = true\n }\n\n if (result?.protectedRoutes && Array.isArray(result.protectedRoutes)) {\n this.containerRegistry.set(`${middlawareHandlerPath}:protectedRoutes`, {\n name: 'protectedRoutes',\n path: middlawareHandlerPath,\n type: 'protected-route',\n item: result.protectedRoutes\n });\n\n success = true\n }\n\n return success;\n }\n\n protected async loadNotFoundHandlers() {\n const notFoundHandlerPath = join(this.options.appPath, 'routes', 'not-found.js');\n\n this._notFoundHandler = await dynamicRequire<Record<HTTPMethod, RouteHandler>>(this.options.moduleType, notFoundHandlerPath, this.options.dev);\n }\n\n protected async loadErrorHandler() {\n const errorHandlerPath = join(this.options.appPath, 'error.js');\n const result = await dynamicRequire<Record<'default', ErrorHandler>>(this.options.moduleType, errorHandlerPath, this.options.dev);\n\n this._errorHandler = result?.default;\n }\n\n protected async loadInitiator() {\n const initiatorPath = join(this.options.appPath, 'initiator.js');\n const result = await dynamicRequire<Record<'default', InitiatorHandler>>(this.options.moduleType, initiatorPath, this.options.dev);\n const handler = result?.default;\n\n if (handler) {\n this._initiatorHandler = handler;\n const instances = await this._initiatorHandler();\n\n Object.keys(instances).forEach((key) => {\n this.containerRegistry.set(`${initiatorPath}:${key}`, {\n name: key,\n path: initiatorPath,\n type: 'instance',\n item: (instances as any)[key]\n })\n })\n }\n }\n\n public async onFileChanged(filePath: string): Promise<boolean> {\n filePath = filePath.endsWith('.ts') ? filePath.replace('.ts', '.js') : filePath;\n\n if (filePath.includes('\\\\src\\\\'))\n filePath = filePath.replace('\\\\src\\\\', `\\\\.mahameru\\\\`);\n\n const found = this.containerRegistry.values().find((containerItem) => containerItem.path === filePath);\n\n if (found) {\n if (found.type === 'route') {\n return await this.loadSingleRoute(filePath, dirname(filePath), this.options.routesPath, { parentPath: dirname(filePath), name: basename(filePath) });\n } else if (found.type === 'middleware' || found.type === 'protected-route') {\n return await this.loadMiddlewareHandler();\n }\n }\n\n return false;\n }\n\n protected getDefaultExportClass(module: Record<string, ClassConstructor<unknown>>, filePath: string) {\n const defaultExportName = Object.keys(module).find((key) => key === 'default');\n\n if (!defaultExportName)\n throw new this.dependencies.ModuleError(`Module in file '${filePath}' does not have a default export.`, { path: filePath, moduleName: Object.keys(module)[0] });\n\n return {\n name: module[defaultExportName].name,\n clazz: module[defaultExportName]\n };\n }\n\n protected buildOptions(initialOptions?: Partial<ContainerOptions>): ContainerOptions {\n const appPath = join(process.cwd(), '.mahameru');\n const defaultOptions: ContainerOptions = {\n appPath,\n modulesPath: join(appPath, 'modules'),\n moduleType: 'esm',\n dev: initialOptions?.dev ? true : false,\n routesPath: join(appPath, 'routes')\n };\n\n if (!initialOptions)\n return defaultOptions;\n\n return {\n ...defaultOptions,\n appPath,\n ...initialOptions\n };\n }\n}\n"],"mappings":";;AAAA,OAAO,QAAQ,UAAU,SAAS,MAAM,UAAU,eAAe;AACjE,SAAS,eAAe;AAExB,SAAS,gBAAgB,cAAc;AAsBhC,MAAM,UAAU;AAAA,EAzBvB,OAyBuB;AAAA;AAAA;AAAA,EACnB,eAAe;AAAA,EACL,UAAU,oBAAI,IAA8B;AAAA,EAC5C,WAAW,oBAAI,IAA2B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACM;AAAA,EACT,oBAAuC,oBAAI,IAAI;AAAA,EAItD,YAAY,MAAyD,MAA8B;AAC/F,QAAI,OAAO,SAAS,aAAa;AAC7B,WAAK,UAAU,KAAK,aAAa,IAAiC;AAClE,WAAK,eAAe;AAAA,IACxB,OAAO;AACH,WAAK,eAAe;AACpB,WAAK,UAAU,KAAK,aAAa;AAAA,IACrC;AAAA,EACJ;AAAA,EAEA,IAAI,kBAAkB;AAClB,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,gBAA6B;AACzB,WAAO,MAAM,KAAK,KAAK,kBAAkB,OAAO,CAAC,EAAE,OAA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QAAI,CAAC;AACD,aAAO;AAEX,WAAO;AAAA,MACH,GAAG;AAAA,MACH;AAAA,MACA,GAAG;AAAA,IACP;AAAA,EACJ;AACJ;","names":["path","item"]}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var http_server_error_exports = {};
21
- __export(http_server_error_exports, {
22
- HttpServerError: () => HttpServerError
23
- });
24
- module.exports = __toCommonJS(http_server_error_exports);
25
- class HttpServerError extends Error {
26
- static {
27
- __name(this, "HttpServerError");
28
- }
29
- statusCode = 500;
30
- details;
31
- constructor(details) {
32
- super("Internal Server Error");
33
- this.name = "HttpServerError";
34
- this.details = details;
35
- Object.setPrototypeOf(this, HttpServerError.prototype);
36
- if (Error.captureStackTrace)
37
- Error.captureStackTrace(this, HttpServerError);
38
- }
39
- }
40
- // Annotate the CommonJS export names for ESM import in node:
41
- 0 && (module.exports = {
42
- HttpServerError
43
- });
44
- //# sourceMappingURL=http-server-error.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/http-server-error.ts"],"sourcesContent":["export class HttpServerError extends Error {\n public readonly statusCode: number = 500;\n public readonly details?: string;\n\n constructor(details?: string) {\n super('Internal Server Error');\n this.name = 'HttpServerError';\n this.details = details;\n\n Object.setPrototypeOf(this, HttpServerError.prototype);\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, HttpServerError);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,wBAAwB,MAAM;AAAA,EAA3C,OAA2C;AAAA;AAAA;AAAA,EACvB,aAAqB;AAAA,EACrB;AAAA,EAEhB,YAAY,SAAkB;AAC1B,UAAM,uBAAuB;AAC7B,SAAK,OAAO;AACZ,SAAK,UAAU;AAEf,WAAO,eAAe,MAAM,gBAAgB,SAAS;AAErD,QAAI,MAAM;AACN,YAAM,kBAAkB,MAAM,eAAe;AAAA,EACrD;AACJ;","names":[]}
@@ -1,7 +0,0 @@
1
- declare class HttpServerError extends Error {
2
- readonly statusCode: number;
3
- readonly details?: string;
4
- constructor(details?: string);
5
- }
6
-
7
- export { HttpServerError };
@@ -1,7 +0,0 @@
1
- declare class HttpServerError extends Error {
2
- readonly statusCode: number;
3
- readonly details?: string;
4
- constructor(details?: string);
5
- }
6
-
7
- export { HttpServerError };
@@ -1,21 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- class HttpServerError extends Error {
4
- static {
5
- __name(this, "HttpServerError");
6
- }
7
- statusCode = 500;
8
- details;
9
- constructor(details) {
10
- super("Internal Server Error");
11
- this.name = "HttpServerError";
12
- this.details = details;
13
- Object.setPrototypeOf(this, HttpServerError.prototype);
14
- if (Error.captureStackTrace)
15
- Error.captureStackTrace(this, HttpServerError);
16
- }
17
- }
18
- export {
19
- HttpServerError
20
- };
21
- //# sourceMappingURL=http-server-error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/http-server-error.ts"],"sourcesContent":["export class HttpServerError extends Error {\n public readonly statusCode: number = 500;\n public readonly details?: string;\n\n constructor(details?: string) {\n super('Internal Server Error');\n this.name = 'HttpServerError';\n this.details = details;\n\n Object.setPrototypeOf(this, HttpServerError.prototype);\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, HttpServerError);\n }\n}\n"],"mappings":";;AAAO,MAAM,wBAAwB,MAAM;AAAA,EAA3C,OAA2C;AAAA;AAAA;AAAA,EACvB,aAAqB;AAAA,EACrB;AAAA,EAEhB,YAAY,SAAkB;AAC1B,UAAM,uBAAuB;AAC7B,SAAK,OAAO;AACZ,SAAK,UAAU;AAEf,WAAO,eAAe,MAAM,gBAAgB,SAAS;AAErD,QAAI,MAAM;AACN,YAAM,kBAAkB,MAAM,eAAe;AAAA,EACrD;AACJ;","names":[]}