@elsikora/cladi 1.0.1
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 +21 -0
- package/README.md +325 -0
- package/dist/cjs/domain/enum/index.d.ts +3 -0
- package/dist/cjs/domain/enum/index.d.ts.map +1 -0
- package/dist/cjs/domain/enum/logger-log-level.enum.d.ts +11 -0
- package/dist/cjs/domain/enum/logger-log-level.enum.d.ts.map +1 -0
- package/dist/cjs/domain/enum/logger-log-level.enum.js +14 -0
- package/dist/cjs/domain/enum/logger-log-level.enum.js.map +1 -0
- package/dist/cjs/domain/enum/service-token.enum.d.ts +10 -0
- package/dist/cjs/domain/enum/service-token.enum.d.ts.map +1 -0
- package/dist/cjs/domain/enum/service-token.enum.js +13 -0
- package/dist/cjs/domain/enum/service-token.enum.js.map +1 -0
- package/dist/cjs/domain/index.d.ts +3 -0
- package/dist/cjs/domain/index.d.ts.map +1 -0
- package/dist/cjs/domain/interface/container.interface.d.ts +55 -0
- package/dist/cjs/domain/interface/container.interface.d.ts.map +1 -0
- package/dist/cjs/domain/interface/error.interface.d.ts +18 -0
- package/dist/cjs/domain/interface/error.interface.d.ts.map +1 -0
- package/dist/cjs/domain/interface/factory.interface.d.ts +19 -0
- package/dist/cjs/domain/interface/factory.interface.d.ts.map +1 -0
- package/dist/cjs/domain/interface/index.d.ts +6 -0
- package/dist/cjs/domain/interface/index.d.ts.map +1 -0
- package/dist/cjs/domain/interface/logger/index.d.ts +3 -0
- package/dist/cjs/domain/interface/logger/index.d.ts.map +1 -0
- package/dist/cjs/domain/interface/logger/interface.d.ts +37 -0
- package/dist/cjs/domain/interface/logger/interface.d.ts.map +1 -0
- package/dist/cjs/domain/interface/logger/method-options.interface.d.ts +14 -0
- package/dist/cjs/domain/interface/logger/method-options.interface.d.ts.map +1 -0
- package/dist/cjs/domain/interface/registry.interface.d.ts +54 -0
- package/dist/cjs/domain/interface/registry.interface.d.ts.map +1 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/infrastructure/class/base/container.class.d.ts +67 -0
- package/dist/cjs/infrastructure/class/base/container.class.d.ts.map +1 -0
- package/dist/cjs/infrastructure/class/base/container.class.js +193 -0
- package/dist/cjs/infrastructure/class/base/container.class.js.map +1 -0
- package/dist/cjs/infrastructure/class/base/error.class.d.ts +18 -0
- package/dist/cjs/infrastructure/class/base/error.class.d.ts.map +1 -0
- package/dist/cjs/infrastructure/class/base/error.class.js +30 -0
- package/dist/cjs/infrastructure/class/base/error.class.js.map +1 -0
- package/dist/cjs/infrastructure/class/base/factory.class.d.ts +38 -0
- package/dist/cjs/infrastructure/class/base/factory.class.d.ts.map +1 -0
- package/dist/cjs/infrastructure/class/base/factory.class.js +79 -0
- package/dist/cjs/infrastructure/class/base/factory.class.js.map +1 -0
- package/dist/cjs/infrastructure/class/base/index.d.ts +5 -0
- package/dist/cjs/infrastructure/class/base/index.d.ts.map +1 -0
- package/dist/cjs/infrastructure/class/base/registry.class.d.ts +73 -0
- package/dist/cjs/infrastructure/class/base/registry.class.d.ts.map +1 -0
- package/dist/cjs/infrastructure/class/base/registry.class.js +221 -0
- package/dist/cjs/infrastructure/class/base/registry.class.js.map +1 -0
- package/dist/cjs/infrastructure/constant/console-logger-default-options.constant.d.ts +6 -0
- package/dist/cjs/infrastructure/constant/console-logger-default-options.constant.d.ts.map +1 -0
- package/dist/cjs/infrastructure/constant/console-logger-default-options.constant.js +12 -0
- package/dist/cjs/infrastructure/constant/console-logger-default-options.constant.js.map +1 -0
- package/dist/cjs/infrastructure/constant/index.d.ts +2 -0
- package/dist/cjs/infrastructure/constant/index.d.ts.map +1 -0
- package/dist/cjs/infrastructure/factory/core.factory.d.ts +51 -0
- package/dist/cjs/infrastructure/factory/core.factory.d.ts.map +1 -0
- package/dist/cjs/infrastructure/factory/core.factory.js +85 -0
- package/dist/cjs/infrastructure/factory/core.factory.js.map +1 -0
- package/dist/cjs/infrastructure/factory/index.d.ts +2 -0
- package/dist/cjs/infrastructure/factory/index.d.ts.map +1 -0
- package/dist/cjs/infrastructure/index.d.ts +6 -0
- package/dist/cjs/infrastructure/index.d.ts.map +1 -0
- package/dist/cjs/infrastructure/interface/base/container-options.interface.d.ts +11 -0
- package/dist/cjs/infrastructure/interface/base/container-options.interface.d.ts.map +1 -0
- package/dist/cjs/infrastructure/interface/base/error-options.interface.d.ts +22 -0
- package/dist/cjs/infrastructure/interface/base/error-options.interface.d.ts.map +1 -0
- package/dist/cjs/infrastructure/interface/base/factory-options.interface.d.ts +21 -0
- package/dist/cjs/infrastructure/interface/base/factory-options.interface.d.ts.map +1 -0
- package/dist/cjs/infrastructure/interface/base/index.d.ts +5 -0
- package/dist/cjs/infrastructure/interface/base/index.d.ts.map +1 -0
- package/dist/cjs/infrastructure/interface/base/registry-options.interface.d.ts +11 -0
- package/dist/cjs/infrastructure/interface/base/registry-options.interface.d.ts.map +1 -0
- package/dist/cjs/infrastructure/interface/console-logger-options.interface.d.ts +15 -0
- package/dist/cjs/infrastructure/interface/console-logger-options.interface.d.ts.map +1 -0
- package/dist/cjs/infrastructure/interface/core-factory-options.interface.d.ts +11 -0
- package/dist/cjs/infrastructure/interface/core-factory-options.interface.d.ts.map +1 -0
- package/dist/cjs/infrastructure/interface/index.d.ts +4 -0
- package/dist/cjs/infrastructure/interface/index.d.ts.map +1 -0
- package/dist/cjs/infrastructure/service/console-logger.service.d.ts +71 -0
- package/dist/cjs/infrastructure/service/console-logger.service.d.ts.map +1 -0
- package/dist/cjs/infrastructure/service/console-logger.service.js +130 -0
- package/dist/cjs/infrastructure/service/console-logger.service.js.map +1 -0
- package/dist/cjs/infrastructure/service/index.d.ts +2 -0
- package/dist/cjs/infrastructure/service/index.d.ts.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/presentation/utility/create/container.utility.d.ts +9 -0
- package/dist/cjs/presentation/utility/create/container.utility.d.ts.map +1 -0
- package/dist/cjs/presentation/utility/create/container.utility.js +18 -0
- package/dist/cjs/presentation/utility/create/container.utility.js.map +1 -0
- package/dist/cjs/presentation/utility/create/factory.utility.d.ts +10 -0
- package/dist/cjs/presentation/utility/create/factory.utility.d.ts.map +1 -0
- package/dist/cjs/presentation/utility/create/factory.utility.js +19 -0
- package/dist/cjs/presentation/utility/create/factory.utility.js.map +1 -0
- package/dist/cjs/presentation/utility/create/index.d.ts +5 -0
- package/dist/cjs/presentation/utility/create/index.d.ts.map +1 -0
- package/dist/cjs/presentation/utility/create/logger.utility.d.ts +9 -0
- package/dist/cjs/presentation/utility/create/logger.utility.d.ts.map +1 -0
- package/dist/cjs/presentation/utility/create/logger.utility.js +16 -0
- package/dist/cjs/presentation/utility/create/logger.utility.js.map +1 -0
- package/dist/cjs/presentation/utility/create/registry.utility.d.ts +12 -0
- package/dist/cjs/presentation/utility/create/registry.utility.d.ts.map +1 -0
- package/dist/cjs/presentation/utility/create/registry.utility.js +19 -0
- package/dist/cjs/presentation/utility/create/registry.utility.js.map +1 -0
- package/dist/esm/domain/enum/index.d.ts +3 -0
- package/dist/esm/domain/enum/index.d.ts.map +1 -0
- package/dist/esm/domain/enum/logger-log-level.enum.d.ts +11 -0
- package/dist/esm/domain/enum/logger-log-level.enum.d.ts.map +1 -0
- package/dist/esm/domain/enum/logger-log-level.enum.js +14 -0
- package/dist/esm/domain/enum/logger-log-level.enum.js.map +1 -0
- package/dist/esm/domain/enum/service-token.enum.d.ts +10 -0
- package/dist/esm/domain/enum/service-token.enum.d.ts.map +1 -0
- package/dist/esm/domain/enum/service-token.enum.js +13 -0
- package/dist/esm/domain/enum/service-token.enum.js.map +1 -0
- package/dist/esm/domain/index.d.ts +3 -0
- package/dist/esm/domain/index.d.ts.map +1 -0
- package/dist/esm/domain/interface/container.interface.d.ts +55 -0
- package/dist/esm/domain/interface/container.interface.d.ts.map +1 -0
- package/dist/esm/domain/interface/error.interface.d.ts +18 -0
- package/dist/esm/domain/interface/error.interface.d.ts.map +1 -0
- package/dist/esm/domain/interface/factory.interface.d.ts +19 -0
- package/dist/esm/domain/interface/factory.interface.d.ts.map +1 -0
- package/dist/esm/domain/interface/index.d.ts +6 -0
- package/dist/esm/domain/interface/index.d.ts.map +1 -0
- package/dist/esm/domain/interface/logger/index.d.ts +3 -0
- package/dist/esm/domain/interface/logger/index.d.ts.map +1 -0
- package/dist/esm/domain/interface/logger/interface.d.ts +37 -0
- package/dist/esm/domain/interface/logger/interface.d.ts.map +1 -0
- package/dist/esm/domain/interface/logger/method-options.interface.d.ts +14 -0
- package/dist/esm/domain/interface/logger/method-options.interface.d.ts.map +1 -0
- package/dist/esm/domain/interface/registry.interface.d.ts +54 -0
- package/dist/esm/domain/interface/registry.interface.d.ts.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/infrastructure/class/base/container.class.d.ts +67 -0
- package/dist/esm/infrastructure/class/base/container.class.d.ts.map +1 -0
- package/dist/esm/infrastructure/class/base/container.class.js +191 -0
- package/dist/esm/infrastructure/class/base/container.class.js.map +1 -0
- package/dist/esm/infrastructure/class/base/error.class.d.ts +18 -0
- package/dist/esm/infrastructure/class/base/error.class.d.ts.map +1 -0
- package/dist/esm/infrastructure/class/base/error.class.js +28 -0
- package/dist/esm/infrastructure/class/base/error.class.js.map +1 -0
- package/dist/esm/infrastructure/class/base/factory.class.d.ts +38 -0
- package/dist/esm/infrastructure/class/base/factory.class.d.ts.map +1 -0
- package/dist/esm/infrastructure/class/base/factory.class.js +77 -0
- package/dist/esm/infrastructure/class/base/factory.class.js.map +1 -0
- package/dist/esm/infrastructure/class/base/index.d.ts +5 -0
- package/dist/esm/infrastructure/class/base/index.d.ts.map +1 -0
- package/dist/esm/infrastructure/class/base/registry.class.d.ts +73 -0
- package/dist/esm/infrastructure/class/base/registry.class.d.ts.map +1 -0
- package/dist/esm/infrastructure/class/base/registry.class.js +219 -0
- package/dist/esm/infrastructure/class/base/registry.class.js.map +1 -0
- package/dist/esm/infrastructure/constant/console-logger-default-options.constant.d.ts +6 -0
- package/dist/esm/infrastructure/constant/console-logger-default-options.constant.d.ts.map +1 -0
- package/dist/esm/infrastructure/constant/console-logger-default-options.constant.js +10 -0
- package/dist/esm/infrastructure/constant/console-logger-default-options.constant.js.map +1 -0
- package/dist/esm/infrastructure/constant/index.d.ts +2 -0
- package/dist/esm/infrastructure/constant/index.d.ts.map +1 -0
- package/dist/esm/infrastructure/factory/core.factory.d.ts +51 -0
- package/dist/esm/infrastructure/factory/core.factory.d.ts.map +1 -0
- package/dist/esm/infrastructure/factory/core.factory.js +83 -0
- package/dist/esm/infrastructure/factory/core.factory.js.map +1 -0
- package/dist/esm/infrastructure/factory/index.d.ts +2 -0
- package/dist/esm/infrastructure/factory/index.d.ts.map +1 -0
- package/dist/esm/infrastructure/index.d.ts +6 -0
- package/dist/esm/infrastructure/index.d.ts.map +1 -0
- package/dist/esm/infrastructure/interface/base/container-options.interface.d.ts +11 -0
- package/dist/esm/infrastructure/interface/base/container-options.interface.d.ts.map +1 -0
- package/dist/esm/infrastructure/interface/base/error-options.interface.d.ts +22 -0
- package/dist/esm/infrastructure/interface/base/error-options.interface.d.ts.map +1 -0
- package/dist/esm/infrastructure/interface/base/factory-options.interface.d.ts +21 -0
- package/dist/esm/infrastructure/interface/base/factory-options.interface.d.ts.map +1 -0
- package/dist/esm/infrastructure/interface/base/index.d.ts +5 -0
- package/dist/esm/infrastructure/interface/base/index.d.ts.map +1 -0
- package/dist/esm/infrastructure/interface/base/registry-options.interface.d.ts +11 -0
- package/dist/esm/infrastructure/interface/base/registry-options.interface.d.ts.map +1 -0
- package/dist/esm/infrastructure/interface/console-logger-options.interface.d.ts +15 -0
- package/dist/esm/infrastructure/interface/console-logger-options.interface.d.ts.map +1 -0
- package/dist/esm/infrastructure/interface/core-factory-options.interface.d.ts +11 -0
- package/dist/esm/infrastructure/interface/core-factory-options.interface.d.ts.map +1 -0
- package/dist/esm/infrastructure/interface/index.d.ts +4 -0
- package/dist/esm/infrastructure/interface/index.d.ts.map +1 -0
- package/dist/esm/infrastructure/service/console-logger.service.d.ts +71 -0
- package/dist/esm/infrastructure/service/console-logger.service.d.ts.map +1 -0
- package/dist/esm/infrastructure/service/console-logger.service.js +128 -0
- package/dist/esm/infrastructure/service/console-logger.service.js.map +1 -0
- package/dist/esm/infrastructure/service/index.d.ts +2 -0
- package/dist/esm/infrastructure/service/index.d.ts.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/presentation/utility/create/container.utility.d.ts +9 -0
- package/dist/esm/presentation/utility/create/container.utility.d.ts.map +1 -0
- package/dist/esm/presentation/utility/create/container.utility.js +16 -0
- package/dist/esm/presentation/utility/create/container.utility.js.map +1 -0
- package/dist/esm/presentation/utility/create/factory.utility.d.ts +10 -0
- package/dist/esm/presentation/utility/create/factory.utility.d.ts.map +1 -0
- package/dist/esm/presentation/utility/create/factory.utility.js +17 -0
- package/dist/esm/presentation/utility/create/factory.utility.js.map +1 -0
- package/dist/esm/presentation/utility/create/index.d.ts +5 -0
- package/dist/esm/presentation/utility/create/index.d.ts.map +1 -0
- package/dist/esm/presentation/utility/create/logger.utility.d.ts +9 -0
- package/dist/esm/presentation/utility/create/logger.utility.d.ts.map +1 -0
- package/dist/esm/presentation/utility/create/logger.utility.js +14 -0
- package/dist/esm/presentation/utility/create/logger.utility.js.map +1 -0
- package/dist/esm/presentation/utility/create/registry.utility.d.ts +12 -0
- package/dist/esm/presentation/utility/create/registry.utility.d.ts.map +1 -0
- package/dist/esm/presentation/utility/create/registry.utility.js +17 -0
- package/dist/esm/presentation/utility/create/registry.utility.js.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { IRegistry } from '../../../src/domain/interface/registry.interface';
|
|
2
|
+
import type { IBaseRegistryOptions } from '../../../src/infrastructure/interface/base/index';
|
|
3
|
+
/**
|
|
4
|
+
* Generic registry implementation that stores items by name.
|
|
5
|
+
* @template T The type of items stored in the registry.
|
|
6
|
+
*/
|
|
7
|
+
export declare class BaseRegistry<T extends {
|
|
8
|
+
name: string;
|
|
9
|
+
}> implements IRegistry<T> {
|
|
10
|
+
private readonly CACHE;
|
|
11
|
+
private readonly ITEMS;
|
|
12
|
+
private readonly LOGGER;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new registry instance.
|
|
15
|
+
* @param {IBaseRegistryOptions} options Registry creation options including logger.
|
|
16
|
+
*/
|
|
17
|
+
constructor(options: IBaseRegistryOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Clear the registry.
|
|
20
|
+
*/
|
|
21
|
+
clear(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Get a single item from the registry by name.
|
|
24
|
+
* @param {string} name The name of the item to get.
|
|
25
|
+
* @returns {T | undefined} The item or undefined if it doesn't exist.
|
|
26
|
+
*/
|
|
27
|
+
get(name: string): T | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Get all items from the registry.
|
|
30
|
+
* @returns {Array<T>} An array of all items.
|
|
31
|
+
*/
|
|
32
|
+
getAll(): Array<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Get multiple items from the registry by their names.
|
|
35
|
+
* @param {Array<string>} names The names of the items to get.
|
|
36
|
+
* @returns {Array<T>} An array of items.
|
|
37
|
+
*/
|
|
38
|
+
getMany(names: Array<string>): Array<T>;
|
|
39
|
+
/**
|
|
40
|
+
* Check if an item exists in the registry by name.
|
|
41
|
+
* @param {string} name The name of the item to check.
|
|
42
|
+
* @returns {boolean} True if the item exists, false otherwise.
|
|
43
|
+
*/
|
|
44
|
+
has(name: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Register a single item in the registry.
|
|
47
|
+
* @param {T} item The item to register.
|
|
48
|
+
* @throws ValidationError if the item is invalid.
|
|
49
|
+
*/
|
|
50
|
+
register(item: T): void;
|
|
51
|
+
/**
|
|
52
|
+
* Register multiple items in the registry.
|
|
53
|
+
* @param {Array<T>} items The items to register.
|
|
54
|
+
* @throws ValidationError if any item is invalid.
|
|
55
|
+
*/
|
|
56
|
+
registerMany(items: Array<T>): void;
|
|
57
|
+
/**
|
|
58
|
+
* Unregister a single item from the registry by name.
|
|
59
|
+
* @param {string} name The name of the item to unregister.
|
|
60
|
+
*/
|
|
61
|
+
unregister(name: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Unregister multiple items from the registry by their names.
|
|
64
|
+
* @param {Array<string>} names The names of the items to unregister.
|
|
65
|
+
*/
|
|
66
|
+
unregisterMany(names: Array<string>): void;
|
|
67
|
+
/**
|
|
68
|
+
* Clear the cache for a specific query or all caches if no query is provided.
|
|
69
|
+
* @param {string} [cacheKey] Optional cache key to clear. If not provided, all caches are cleared.
|
|
70
|
+
*/
|
|
71
|
+
private clearCache;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=registry.class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.class.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/class/base/registry.class.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAM3E;;;GAGG;AACH,qBAAa,YAAY,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;IAC5E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwB;IAE9C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IAEvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IAEjC;;;OAGG;gBACS,OAAO,EAAE,oBAAoB;IAMzC;;OAEG;IACI,KAAK,IAAI,IAAI;IASpB;;;;OAIG;IACI,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAoBvC;;;OAGG;IACI,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC;IAoBzB;;;;OAIG;IACI,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAkC9C;;;;OAIG;IACI,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAcjC;;;;OAIG;IACI,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAwB9B;;;;OAIG;IACI,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI;IAwB1C;;;OAGG;IACI,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAqBrC;;;OAGG;IACI,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAwBjD;;;OAGG;IACH,OAAO,CAAC,UAAU;CASlB"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { ConsoleLoggerService } from '../../service/console-logger.service.js';
|
|
2
|
+
import { BaseError } from './error.class.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Generic registry implementation that stores items by name.
|
|
6
|
+
* @template T The type of items stored in the registry.
|
|
7
|
+
*/
|
|
8
|
+
class BaseRegistry {
|
|
9
|
+
CACHE;
|
|
10
|
+
ITEMS;
|
|
11
|
+
LOGGER;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new registry instance.
|
|
14
|
+
* @param {IBaseRegistryOptions} options Registry creation options including logger.
|
|
15
|
+
*/
|
|
16
|
+
constructor(options) {
|
|
17
|
+
this.ITEMS = new Map();
|
|
18
|
+
this.CACHE = new Map();
|
|
19
|
+
this.LOGGER = options.logger ?? new ConsoleLoggerService();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Clear the registry.
|
|
23
|
+
*/
|
|
24
|
+
clear() {
|
|
25
|
+
this.LOGGER.debug("Clearing registry", { source: "Registry" });
|
|
26
|
+
this.ITEMS.clear();
|
|
27
|
+
this.clearCache();
|
|
28
|
+
this.LOGGER.debug("Registry cleared", { source: "Registry" });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get a single item from the registry by name.
|
|
32
|
+
* @param {string} name The name of the item to get.
|
|
33
|
+
* @returns {T | undefined} The item or undefined if it doesn't exist.
|
|
34
|
+
*/
|
|
35
|
+
get(name) {
|
|
36
|
+
this.LOGGER.debug(`Getting item with name: ${name}`, { source: "Registry" });
|
|
37
|
+
if (!name) {
|
|
38
|
+
this.LOGGER.warn("Attempted to get item with empty name", { source: "Registry" });
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
const item = this.ITEMS.get(name);
|
|
42
|
+
if (item) {
|
|
43
|
+
this.LOGGER.debug(`Item found: ${name}`, { source: "Registry" });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.LOGGER.debug(`Item not found: ${name}`, { source: "Registry" });
|
|
47
|
+
}
|
|
48
|
+
return item;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get all items from the registry.
|
|
52
|
+
* @returns {Array<T>} An array of all items.
|
|
53
|
+
*/
|
|
54
|
+
getAll() {
|
|
55
|
+
this.LOGGER.debug("Getting all items", { source: "Registry" });
|
|
56
|
+
const cacheKey = "getAll";
|
|
57
|
+
const cachedResult = this.CACHE.get(cacheKey);
|
|
58
|
+
if (cachedResult) {
|
|
59
|
+
this.LOGGER.debug("Cache hit for getAll query", { source: "Registry" });
|
|
60
|
+
return cachedResult;
|
|
61
|
+
}
|
|
62
|
+
const result = [...this.ITEMS.values()];
|
|
63
|
+
this.CACHE.set(cacheKey, result);
|
|
64
|
+
this.LOGGER.debug(`Cached result for getAll query with ${String(result.length)} items`, { source: "Registry" });
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get multiple items from the registry by their names.
|
|
69
|
+
* @param {Array<string>} names The names of the items to get.
|
|
70
|
+
* @returns {Array<T>} An array of items.
|
|
71
|
+
*/
|
|
72
|
+
getMany(names) {
|
|
73
|
+
if (!names) {
|
|
74
|
+
throw new BaseError("Names cannot be null or undefined", {
|
|
75
|
+
code: "REGISTRY_NAMES_NOT_NULL_OR_UNDEFINED",
|
|
76
|
+
source: "Registry",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (!Array.isArray(names)) {
|
|
80
|
+
throw new BaseError("Names must be an array", {
|
|
81
|
+
code: "REGISTRY_NAMES_NOT_ARRAY",
|
|
82
|
+
source: "Registry",
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
this.LOGGER.debug(`Getting ${String(names.length)} items by name`, { source: "Registry" });
|
|
86
|
+
const cacheKey = `getMany:${names.join(",")}`;
|
|
87
|
+
const cachedResult = this.CACHE.get(cacheKey);
|
|
88
|
+
if (cachedResult) {
|
|
89
|
+
this.LOGGER.debug(`Cache hit for query: ${cacheKey}`, { source: "Registry" });
|
|
90
|
+
return cachedResult;
|
|
91
|
+
}
|
|
92
|
+
const result = names.map((name) => this.get(name)).filter((item) => item !== undefined);
|
|
93
|
+
this.CACHE.set(cacheKey, result);
|
|
94
|
+
this.LOGGER.debug(`Cached result for query: ${cacheKey}`, { source: "Registry" });
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Check if an item exists in the registry by name.
|
|
99
|
+
* @param {string} name The name of the item to check.
|
|
100
|
+
* @returns {boolean} True if the item exists, false otherwise.
|
|
101
|
+
*/
|
|
102
|
+
has(name) {
|
|
103
|
+
this.LOGGER.debug(`Checking if item exists: ${name}`, { source: "Registry" });
|
|
104
|
+
if (!name) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
const isExisting = this.ITEMS.has(name);
|
|
108
|
+
this.LOGGER.debug(`Item ${isExisting ? "exists" : "does not exist"}: ${name}`, { source: "Registry" });
|
|
109
|
+
return isExisting;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Register a single item in the registry.
|
|
113
|
+
* @param {T} item The item to register.
|
|
114
|
+
* @throws ValidationError if the item is invalid.
|
|
115
|
+
*/
|
|
116
|
+
register(item) {
|
|
117
|
+
if (!item) {
|
|
118
|
+
throw new BaseError("Item cannot be null or undefined", {
|
|
119
|
+
code: "REGISTRY_ITEM_NOT_NULL_OR_UNDEFINED",
|
|
120
|
+
source: "Registry",
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
this.LOGGER.debug(`Registering item with name: ${item.name}`, { source: "Registry" });
|
|
124
|
+
if (this.has(item.name)) {
|
|
125
|
+
throw new BaseError("Item already exists in registry", {
|
|
126
|
+
code: "REGISTRY_ITEM_ALREADY_EXISTS",
|
|
127
|
+
source: "Registry",
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
this.ITEMS.set(item.name, item);
|
|
131
|
+
this.clearCache();
|
|
132
|
+
this.LOGGER.debug(`Item registered successfully: ${item.name}`, { source: "Registry" });
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Register multiple items in the registry.
|
|
136
|
+
* @param {Array<T>} items The items to register.
|
|
137
|
+
* @throws ValidationError if any item is invalid.
|
|
138
|
+
*/
|
|
139
|
+
registerMany(items) {
|
|
140
|
+
if (!items) {
|
|
141
|
+
throw new BaseError("Items cannot be null or undefined", {
|
|
142
|
+
code: "REGISTRY_ITEMS_NOT_NULL_OR_UNDEFINED",
|
|
143
|
+
source: "Registry",
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (!Array.isArray(items)) {
|
|
147
|
+
throw new BaseError("Items must be an array", {
|
|
148
|
+
code: "REGISTRY_ITEMS_NOT_ARRAY",
|
|
149
|
+
source: "Registry",
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
this.LOGGER.debug(`Registering ${String(items.length)} items`, { source: "Registry" });
|
|
153
|
+
for (const item of items) {
|
|
154
|
+
this.register(item);
|
|
155
|
+
}
|
|
156
|
+
this.LOGGER.debug(`${String(items.length)} items registered successfully`, { source: "Registry" });
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Unregister a single item from the registry by name.
|
|
160
|
+
* @param {string} name The name of the item to unregister.
|
|
161
|
+
*/
|
|
162
|
+
unregister(name) {
|
|
163
|
+
this.LOGGER.debug(`Unregistering item with name: ${name}`, { source: "Registry" });
|
|
164
|
+
if (!name) {
|
|
165
|
+
throw new BaseError("Name cannot be empty", {
|
|
166
|
+
code: "REGISTRY_NAME_NOT_EMPTY",
|
|
167
|
+
source: "Registry",
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
const wasDeleted = this.ITEMS.delete(name);
|
|
171
|
+
this.clearCache();
|
|
172
|
+
if (wasDeleted) {
|
|
173
|
+
this.LOGGER.debug(`Item unregistered successfully: ${name}`, { source: "Registry" });
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
this.LOGGER.debug(`Item not found for unregistering: ${name}`, { source: "Registry" });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Unregister multiple items from the registry by their names.
|
|
181
|
+
* @param {Array<string>} names The names of the items to unregister.
|
|
182
|
+
*/
|
|
183
|
+
unregisterMany(names) {
|
|
184
|
+
if (!names) {
|
|
185
|
+
throw new BaseError("Names cannot be null or undefined", {
|
|
186
|
+
code: "REGISTRY_NAMES_NOT_NULL_OR_UNDEFINED",
|
|
187
|
+
source: "Registry",
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
if (!Array.isArray(names)) {
|
|
191
|
+
throw new BaseError("Names must be an array", {
|
|
192
|
+
code: "REGISTRY_NAMES_NOT_ARRAY",
|
|
193
|
+
source: "Registry",
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
this.LOGGER.debug(`Unregistering ${String(names.length)} items`, { source: "Registry" });
|
|
197
|
+
for (const name of names) {
|
|
198
|
+
this.unregister(name);
|
|
199
|
+
}
|
|
200
|
+
this.LOGGER.debug(`${String(names.length)} items unregistered`, { source: "Registry" });
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Clear the cache for a specific query or all caches if no query is provided.
|
|
204
|
+
* @param {string} [cacheKey] Optional cache key to clear. If not provided, all caches are cleared.
|
|
205
|
+
*/
|
|
206
|
+
clearCache(cacheKey) {
|
|
207
|
+
if (cacheKey) {
|
|
208
|
+
this.CACHE.delete(cacheKey);
|
|
209
|
+
this.LOGGER.debug(`Cache cleared for key: ${cacheKey}`, { source: "Registry" });
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
this.CACHE.clear();
|
|
213
|
+
this.LOGGER.debug("All caches cleared", { source: "Registry" });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export { BaseRegistry };
|
|
219
|
+
//# sourceMappingURL=registry.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.class.js","sources":["../../../../../../src/infrastructure/class/base/registry.class.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAQA;;;AAGG;MACU,YAAY,CAAA;AACP,IAAA,KAAK;AAEL,IAAA,KAAK;AAEL,IAAA,MAAM;AAEvB;;;AAGG;AACH,IAAA,WAAA,CAAY,OAA6B,EAAA;AACxC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAa;AACjC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAoB;QACxC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,oBAAoB,EAAE;;AAG3D;;AAEG;IACI,KAAK,GAAA;AACX,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAE9D,QAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;QAClB,IAAI,CAAC,UAAU,EAAE;AAEjB,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,C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,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA,MAAA,CAAQ,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAExF,QAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AACzB,YAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;;QAGtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAG,EAAA,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA,mBAAA,CAAqB,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;;AAGxF;;;AAGG;AACK,IAAA,UAAU,CAAC,QAAiB,EAAA;QACnC,IAAI,QAAQ,EAAE;AACb,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC3B,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAA0B,uBAAA,EAAA,QAAQ,CAAE,CAAA,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;;aACzE;AACN,YAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AAClB,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;;;AAGjE;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IConsoleLoggerOptions } from '../../src/infrastructure/interface/index';
|
|
2
|
+
/**
|
|
3
|
+
* The default options for the console logger.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CONSOLE_LOGGER_DEFAULT_OPTIONS: IConsoleLoggerOptions;
|
|
6
|
+
//# sourceMappingURL=console-logger-default-options.constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console-logger-default-options.constant.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/constant/console-logger-default-options.constant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIvE;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,qBAAuD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ELoggerLogLevel } from '../../domain/enum/logger-log-level.enum.js';
|
|
2
|
+
import '../../domain/enum/service-token.enum.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The default options for the console logger.
|
|
6
|
+
*/
|
|
7
|
+
const CONSOLE_LOGGER_DEFAULT_OPTIONS = { level: ELoggerLogLevel.INFO };
|
|
8
|
+
|
|
9
|
+
export { CONSOLE_LOGGER_DEFAULT_OPTIONS };
|
|
10
|
+
//# sourceMappingURL=console-logger-default-options.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console-logger-default-options.constant.js","sources":["../../../../../src/infrastructure/constant/console-logger-default-options.constant.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAIA;;AAEG;AACU,MAAA,8BAA8B,GAA0B,EAAE,KAAK,EAAE,eAAe,CAAC,IAAI;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/constant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { IContainer, IFactory, ILogger, IRegistry } from '../../src/domain/interface/index';
|
|
2
|
+
import type { IBaseContainerOptions, IBaseFactoryOptions, IBaseRegistryOptions, IConsoleLoggerOptions } from '../../src/infrastructure/index';
|
|
3
|
+
import type { ICoreFactoryOptions } from '../../src/infrastructure/interface/core-factory-options.interface';
|
|
4
|
+
/**
|
|
5
|
+
* Factory for creating infrastructure components.
|
|
6
|
+
* Provides methods to create instances of Registry, Factory, Container, and Logger.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CoreFactory {
|
|
9
|
+
private static instance;
|
|
10
|
+
private readonly LOGGER;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new infrastructure factory.
|
|
13
|
+
* @param {ICoreFactoryOptions} options - The options to use for the factory.
|
|
14
|
+
*/
|
|
15
|
+
constructor(options: ICoreFactoryOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Gets the singleton instance of the InfrastructureFactory.
|
|
18
|
+
* @param {ICoreFactoryOptions} options - The options to use for the factory.
|
|
19
|
+
* @returns {CoreFactory} The singleton instance.
|
|
20
|
+
*/
|
|
21
|
+
static getInstance(options: ICoreFactoryOptions): CoreFactory;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new container instance.
|
|
24
|
+
* @param {IBaseContainerOptions} options - The options to use for the container.
|
|
25
|
+
* @returns {IContainer} A new container instance.
|
|
26
|
+
*/
|
|
27
|
+
createContainer(options: IBaseContainerOptions): IContainer;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new factory instance.
|
|
30
|
+
* @template T The type of items created by the factory.
|
|
31
|
+
* @param {IBaseFactoryOptions<T>} options Factory creation options.
|
|
32
|
+
* @returns {IFactory<T>} A new factory instance.
|
|
33
|
+
*/
|
|
34
|
+
createFactory<T>(options: IBaseFactoryOptions<T>): IFactory<T>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new logger instance.
|
|
37
|
+
* @param {IConsoleLoggerOptions} options - The options to use for the logger.
|
|
38
|
+
* @returns {ILogger} A new logger instance.
|
|
39
|
+
*/
|
|
40
|
+
createLogger(options: IConsoleLoggerOptions): ILogger;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new registry instance.
|
|
43
|
+
* @template T The type of items stored in the registry (must have a name property).
|
|
44
|
+
* @param {IBaseRegistryOptions} options - The options to use for the registry.
|
|
45
|
+
* @returns {IRegistry<T>} A new registry instance.
|
|
46
|
+
*/
|
|
47
|
+
createRegistry<T extends {
|
|
48
|
+
name: string;
|
|
49
|
+
}>(options: IBaseRegistryOptions): IRegistry<T>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=core.factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.factory.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/factory/core.factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACrI,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAIpG;;;GAGG;AACH,qBAAa,WAAW;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IAEjC;;;OAGG;gBACS,OAAO,EAAE,mBAAmB;IAIxC;;;;OAIG;WACW,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW;IAQpE;;;;OAIG;IACI,eAAe,CAAC,OAAO,EAAE,qBAAqB,GAAG,UAAU;IAUlE;;;;;OAKG;IACI,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IAUrE;;;;OAIG;IACI,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO;IAa5D;;;;;OAKG;IACI,cAAc,CAAC,CAAC,SAAS;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAAC,CAAC,CAAC;CAS9F"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { BaseContainer } from '../class/base/container.class.js';
|
|
2
|
+
import { BaseFactory } from '../class/base/factory.class.js';
|
|
3
|
+
import { BaseRegistry } from '../class/base/registry.class.js';
|
|
4
|
+
import { ConsoleLoggerService } from '../service/console-logger.service.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Factory for creating infrastructure components.
|
|
8
|
+
* Provides methods to create instances of Registry, Factory, Container, and Logger.
|
|
9
|
+
*/
|
|
10
|
+
class CoreFactory {
|
|
11
|
+
static instance;
|
|
12
|
+
LOGGER;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new infrastructure factory.
|
|
15
|
+
* @param {ICoreFactoryOptions} options - The options to use for the factory.
|
|
16
|
+
*/
|
|
17
|
+
constructor(options) {
|
|
18
|
+
this.LOGGER = options.logger ?? new ConsoleLoggerService();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Gets the singleton instance of the InfrastructureFactory.
|
|
22
|
+
* @param {ICoreFactoryOptions} options - The options to use for the factory.
|
|
23
|
+
* @returns {CoreFactory} The singleton instance.
|
|
24
|
+
*/
|
|
25
|
+
static getInstance(options) {
|
|
26
|
+
if (!CoreFactory.instance) {
|
|
27
|
+
CoreFactory.instance = new CoreFactory(options);
|
|
28
|
+
}
|
|
29
|
+
return CoreFactory.instance;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new container instance.
|
|
33
|
+
* @param {IBaseContainerOptions} options - The options to use for the container.
|
|
34
|
+
* @returns {IContainer} A new container instance.
|
|
35
|
+
*/
|
|
36
|
+
createContainer(options) {
|
|
37
|
+
this.LOGGER?.debug("Creating new container instance", { source: "InfrastructureFactory" });
|
|
38
|
+
const container = new BaseContainer(options);
|
|
39
|
+
this.LOGGER?.debug("Container instance created", { source: "InfrastructureFactory" });
|
|
40
|
+
return container;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a new factory instance.
|
|
44
|
+
* @template T The type of items created by the factory.
|
|
45
|
+
* @param {IBaseFactoryOptions<T>} options Factory creation options.
|
|
46
|
+
* @returns {IFactory<T>} A new factory instance.
|
|
47
|
+
*/
|
|
48
|
+
createFactory(options) {
|
|
49
|
+
this.LOGGER?.debug("Creating new factory instance", { source: "InfrastructureFactory" });
|
|
50
|
+
const factory = new BaseFactory(options);
|
|
51
|
+
this.LOGGER?.debug("Factory instance created", { source: "InfrastructureFactory" });
|
|
52
|
+
return factory;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Creates a new logger instance.
|
|
56
|
+
* @param {IConsoleLoggerOptions} options - The options to use for the logger.
|
|
57
|
+
* @returns {ILogger} A new logger instance.
|
|
58
|
+
*/
|
|
59
|
+
createLogger(options) {
|
|
60
|
+
this.LOGGER?.debug("Creating new logger instance", {
|
|
61
|
+
context: { level: options.level, loggerSource: options.source },
|
|
62
|
+
source: "InfrastructureFactory",
|
|
63
|
+
});
|
|
64
|
+
const logger = new ConsoleLoggerService(options);
|
|
65
|
+
this.LOGGER?.debug("Logger instance created", { source: "InfrastructureFactory" });
|
|
66
|
+
return logger;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Creates a new registry instance.
|
|
70
|
+
* @template T The type of items stored in the registry (must have a name property).
|
|
71
|
+
* @param {IBaseRegistryOptions} options - The options to use for the registry.
|
|
72
|
+
* @returns {IRegistry<T>} A new registry instance.
|
|
73
|
+
*/
|
|
74
|
+
createRegistry(options) {
|
|
75
|
+
this.LOGGER?.debug("Creating new registry instance", { source: "InfrastructureFactory" });
|
|
76
|
+
const registry = new BaseRegistry(options);
|
|
77
|
+
this.LOGGER?.debug("Registry instance created", { source: "InfrastructureFactory" });
|
|
78
|
+
return registry;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { CoreFactory };
|
|
83
|
+
//# sourceMappingURL=core.factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.factory.js","sources":["../../../../../src/infrastructure/factory/core.factory.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAMA;;;AAGG;MACU,WAAW,CAAA;IACf,OAAO,QAAQ;AAEN,IAAA,MAAM;AAEvB;;;AAGG;AACH,IAAA,WAAA,CAAY,OAA4B,EAAA;QACvC,IAAI,CAAC,MAAM,GAAG,OAAO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oBAAoB,CAAC,OAAO,CAAC;AAEzD,QAAA,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,yBAAyB,EAAE,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;AAElF,QAAA,OAAO,MAAM;;AAGd;;;;;AAKG;AACI,IAAA,cAAc,CAA6B,OAA6B,EAAA;AAC9E,QAAA,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,gCAAgC,EAAE,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;AAEzF,QAAA,MAAM,QAAQ,GAAiB,IAAI,YAAY,CAAI,OAAO,CAAC;AAE3D,QAAA,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;AAEpF,QAAA,OAAO,QAAQ;;AAEhB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/factory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,mBAAmB,aAAa,CAAC;AACjC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ILogger } from '../../../src/domain/interface/index';
|
|
2
|
+
/**
|
|
3
|
+
* The options for the base container.
|
|
4
|
+
*/
|
|
5
|
+
export interface IBaseContainerOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The logger to use for the container.
|
|
8
|
+
*/
|
|
9
|
+
logger?: ILogger;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=container-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-options.interface.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/interface/base/container-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base options interface.
|
|
3
|
+
*/
|
|
4
|
+
export interface IBaseErrorOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Original error that caused this error, if any.
|
|
7
|
+
*/
|
|
8
|
+
cause?: Error;
|
|
9
|
+
/**
|
|
10
|
+
* Error code for programmatic handling.
|
|
11
|
+
*/
|
|
12
|
+
code: string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional context about the error.
|
|
15
|
+
*/
|
|
16
|
+
context?: Record<string, unknown>;
|
|
17
|
+
/**
|
|
18
|
+
* Source identifier (e.g. "[AuthService]", "[UserRepository]").
|
|
19
|
+
*/
|
|
20
|
+
source?: string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=error-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-options.interface.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/interface/base/error-options.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IRegistry } from '../../../src/domain/interface/index';
|
|
2
|
+
import type { ILogger } from '../../../src/domain/interface/logger/interface';
|
|
3
|
+
/**
|
|
4
|
+
* Base factory creation options.
|
|
5
|
+
* @template T The type of items in the registry and created by the factory.
|
|
6
|
+
*/
|
|
7
|
+
export interface IBaseFactoryOptions<T> {
|
|
8
|
+
/**
|
|
9
|
+
* The logger to use for logging.
|
|
10
|
+
*/
|
|
11
|
+
logger?: ILogger;
|
|
12
|
+
/**
|
|
13
|
+
* The registry to use for creating items.
|
|
14
|
+
*/
|
|
15
|
+
registry: IRegistry<T>;
|
|
16
|
+
/**
|
|
17
|
+
* The transformer to use for creating items.
|
|
18
|
+
*/
|
|
19
|
+
transformer?: (template: T) => T;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=factory-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-options.interface.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/interface/base/factory-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;CACjC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { IBaseContainerOptions } from "./container-options.interface";
|
|
2
|
+
export type { IBaseErrorOptions } from "./error-options.interface";
|
|
3
|
+
export type { IBaseFactoryOptions } from "./factory-options.interface";
|
|
4
|
+
export type { IBaseRegistryOptions } from "./registry-options.interface";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/interface/base/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ILogger } from '../../../src/domain/interface/logger/interface';
|
|
2
|
+
/**
|
|
3
|
+
* Base registry creation options.
|
|
4
|
+
*/
|
|
5
|
+
export interface IBaseRegistryOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The logger to use for logging.
|
|
8
|
+
*/
|
|
9
|
+
logger?: ILogger;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=registry-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-options.interface.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/interface/base/registry-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ELoggerLogLevel } from '../../src/domain/enum/index';
|
|
2
|
+
/**
|
|
3
|
+
* The options for the console logger.
|
|
4
|
+
*/
|
|
5
|
+
export interface IConsoleLoggerOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The log level to use.
|
|
8
|
+
*/
|
|
9
|
+
level: ELoggerLogLevel;
|
|
10
|
+
/**
|
|
11
|
+
* The source to use for the logger.
|
|
12
|
+
*/
|
|
13
|
+
source?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=console-logger-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console-logger-options.interface.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/interface/console-logger-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ILogger } from '../../src/domain/interface/index';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the CoreFactory.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICoreFactoryOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The logger to use for the factory.
|
|
8
|
+
*/
|
|
9
|
+
logger?: ILogger;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=core-factory-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-factory-options.interface.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/interface/core-factory-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB"}
|