@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,221 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var consoleLogger_service = require('../../service/console-logger.service.js');
|
|
4
|
+
var error_class = require('./error.class.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Generic registry implementation that stores items by name.
|
|
8
|
+
* @template T The type of items stored in the registry.
|
|
9
|
+
*/
|
|
10
|
+
class BaseRegistry {
|
|
11
|
+
CACHE;
|
|
12
|
+
ITEMS;
|
|
13
|
+
LOGGER;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new registry instance.
|
|
16
|
+
* @param {IBaseRegistryOptions} options Registry creation options including logger.
|
|
17
|
+
*/
|
|
18
|
+
constructor(options) {
|
|
19
|
+
this.ITEMS = new Map();
|
|
20
|
+
this.CACHE = new Map();
|
|
21
|
+
this.LOGGER = options.logger ?? new consoleLogger_service.ConsoleLoggerService();
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Clear the registry.
|
|
25
|
+
*/
|
|
26
|
+
clear() {
|
|
27
|
+
this.LOGGER.debug("Clearing registry", { source: "Registry" });
|
|
28
|
+
this.ITEMS.clear();
|
|
29
|
+
this.clearCache();
|
|
30
|
+
this.LOGGER.debug("Registry cleared", { source: "Registry" });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get a single item from the registry by name.
|
|
34
|
+
* @param {string} name The name of the item to get.
|
|
35
|
+
* @returns {T | undefined} The item or undefined if it doesn't exist.
|
|
36
|
+
*/
|
|
37
|
+
get(name) {
|
|
38
|
+
this.LOGGER.debug(`Getting item with name: ${name}`, { source: "Registry" });
|
|
39
|
+
if (!name) {
|
|
40
|
+
this.LOGGER.warn("Attempted to get item with empty name", { source: "Registry" });
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const item = this.ITEMS.get(name);
|
|
44
|
+
if (item) {
|
|
45
|
+
this.LOGGER.debug(`Item found: ${name}`, { source: "Registry" });
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.LOGGER.debug(`Item not found: ${name}`, { source: "Registry" });
|
|
49
|
+
}
|
|
50
|
+
return item;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get all items from the registry.
|
|
54
|
+
* @returns {Array<T>} An array of all items.
|
|
55
|
+
*/
|
|
56
|
+
getAll() {
|
|
57
|
+
this.LOGGER.debug("Getting all items", { source: "Registry" });
|
|
58
|
+
const cacheKey = "getAll";
|
|
59
|
+
const cachedResult = this.CACHE.get(cacheKey);
|
|
60
|
+
if (cachedResult) {
|
|
61
|
+
this.LOGGER.debug("Cache hit for getAll query", { source: "Registry" });
|
|
62
|
+
return cachedResult;
|
|
63
|
+
}
|
|
64
|
+
const result = [...this.ITEMS.values()];
|
|
65
|
+
this.CACHE.set(cacheKey, result);
|
|
66
|
+
this.LOGGER.debug(`Cached result for getAll query with ${String(result.length)} items`, { source: "Registry" });
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get multiple items from the registry by their names.
|
|
71
|
+
* @param {Array<string>} names The names of the items to get.
|
|
72
|
+
* @returns {Array<T>} An array of items.
|
|
73
|
+
*/
|
|
74
|
+
getMany(names) {
|
|
75
|
+
if (!names) {
|
|
76
|
+
throw new error_class.BaseError("Names cannot be null or undefined", {
|
|
77
|
+
code: "REGISTRY_NAMES_NOT_NULL_OR_UNDEFINED",
|
|
78
|
+
source: "Registry",
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
if (!Array.isArray(names)) {
|
|
82
|
+
throw new error_class.BaseError("Names must be an array", {
|
|
83
|
+
code: "REGISTRY_NAMES_NOT_ARRAY",
|
|
84
|
+
source: "Registry",
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
this.LOGGER.debug(`Getting ${String(names.length)} items by name`, { source: "Registry" });
|
|
88
|
+
const cacheKey = `getMany:${names.join(",")}`;
|
|
89
|
+
const cachedResult = this.CACHE.get(cacheKey);
|
|
90
|
+
if (cachedResult) {
|
|
91
|
+
this.LOGGER.debug(`Cache hit for query: ${cacheKey}`, { source: "Registry" });
|
|
92
|
+
return cachedResult;
|
|
93
|
+
}
|
|
94
|
+
const result = names.map((name) => this.get(name)).filter((item) => item !== undefined);
|
|
95
|
+
this.CACHE.set(cacheKey, result);
|
|
96
|
+
this.LOGGER.debug(`Cached result for query: ${cacheKey}`, { source: "Registry" });
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Check if an item exists in the registry by name.
|
|
101
|
+
* @param {string} name The name of the item to check.
|
|
102
|
+
* @returns {boolean} True if the item exists, false otherwise.
|
|
103
|
+
*/
|
|
104
|
+
has(name) {
|
|
105
|
+
this.LOGGER.debug(`Checking if item exists: ${name}`, { source: "Registry" });
|
|
106
|
+
if (!name) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
const isExisting = this.ITEMS.has(name);
|
|
110
|
+
this.LOGGER.debug(`Item ${isExisting ? "exists" : "does not exist"}: ${name}`, { source: "Registry" });
|
|
111
|
+
return isExisting;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Register a single item in the registry.
|
|
115
|
+
* @param {T} item The item to register.
|
|
116
|
+
* @throws ValidationError if the item is invalid.
|
|
117
|
+
*/
|
|
118
|
+
register(item) {
|
|
119
|
+
if (!item) {
|
|
120
|
+
throw new error_class.BaseError("Item cannot be null or undefined", {
|
|
121
|
+
code: "REGISTRY_ITEM_NOT_NULL_OR_UNDEFINED",
|
|
122
|
+
source: "Registry",
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
this.LOGGER.debug(`Registering item with name: ${item.name}`, { source: "Registry" });
|
|
126
|
+
if (this.has(item.name)) {
|
|
127
|
+
throw new error_class.BaseError("Item already exists in registry", {
|
|
128
|
+
code: "REGISTRY_ITEM_ALREADY_EXISTS",
|
|
129
|
+
source: "Registry",
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
this.ITEMS.set(item.name, item);
|
|
133
|
+
this.clearCache();
|
|
134
|
+
this.LOGGER.debug(`Item registered successfully: ${item.name}`, { source: "Registry" });
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Register multiple items in the registry.
|
|
138
|
+
* @param {Array<T>} items The items to register.
|
|
139
|
+
* @throws ValidationError if any item is invalid.
|
|
140
|
+
*/
|
|
141
|
+
registerMany(items) {
|
|
142
|
+
if (!items) {
|
|
143
|
+
throw new error_class.BaseError("Items cannot be null or undefined", {
|
|
144
|
+
code: "REGISTRY_ITEMS_NOT_NULL_OR_UNDEFINED",
|
|
145
|
+
source: "Registry",
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
if (!Array.isArray(items)) {
|
|
149
|
+
throw new error_class.BaseError("Items must be an array", {
|
|
150
|
+
code: "REGISTRY_ITEMS_NOT_ARRAY",
|
|
151
|
+
source: "Registry",
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
this.LOGGER.debug(`Registering ${String(items.length)} items`, { source: "Registry" });
|
|
155
|
+
for (const item of items) {
|
|
156
|
+
this.register(item);
|
|
157
|
+
}
|
|
158
|
+
this.LOGGER.debug(`${String(items.length)} items registered successfully`, { source: "Registry" });
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Unregister a single item from the registry by name.
|
|
162
|
+
* @param {string} name The name of the item to unregister.
|
|
163
|
+
*/
|
|
164
|
+
unregister(name) {
|
|
165
|
+
this.LOGGER.debug(`Unregistering item with name: ${name}`, { source: "Registry" });
|
|
166
|
+
if (!name) {
|
|
167
|
+
throw new error_class.BaseError("Name cannot be empty", {
|
|
168
|
+
code: "REGISTRY_NAME_NOT_EMPTY",
|
|
169
|
+
source: "Registry",
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
const wasDeleted = this.ITEMS.delete(name);
|
|
173
|
+
this.clearCache();
|
|
174
|
+
if (wasDeleted) {
|
|
175
|
+
this.LOGGER.debug(`Item unregistered successfully: ${name}`, { source: "Registry" });
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
this.LOGGER.debug(`Item not found for unregistering: ${name}`, { source: "Registry" });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Unregister multiple items from the registry by their names.
|
|
183
|
+
* @param {Array<string>} names The names of the items to unregister.
|
|
184
|
+
*/
|
|
185
|
+
unregisterMany(names) {
|
|
186
|
+
if (!names) {
|
|
187
|
+
throw new error_class.BaseError("Names cannot be null or undefined", {
|
|
188
|
+
code: "REGISTRY_NAMES_NOT_NULL_OR_UNDEFINED",
|
|
189
|
+
source: "Registry",
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
if (!Array.isArray(names)) {
|
|
193
|
+
throw new error_class.BaseError("Names must be an array", {
|
|
194
|
+
code: "REGISTRY_NAMES_NOT_ARRAY",
|
|
195
|
+
source: "Registry",
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
this.LOGGER.debug(`Unregistering ${String(names.length)} items`, { source: "Registry" });
|
|
199
|
+
for (const name of names) {
|
|
200
|
+
this.unregister(name);
|
|
201
|
+
}
|
|
202
|
+
this.LOGGER.debug(`${String(names.length)} items unregistered`, { source: "Registry" });
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Clear the cache for a specific query or all caches if no query is provided.
|
|
206
|
+
* @param {string} [cacheKey] Optional cache key to clear. If not provided, all caches are cleared.
|
|
207
|
+
*/
|
|
208
|
+
clearCache(cacheKey) {
|
|
209
|
+
if (cacheKey) {
|
|
210
|
+
this.CACHE.delete(cacheKey);
|
|
211
|
+
this.LOGGER.debug(`Cache cleared for key: ${cacheKey}`, { source: "Registry" });
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
this.CACHE.clear();
|
|
215
|
+
this.LOGGER.debug("All caches cleared", { source: "Registry" });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
exports.BaseRegistry = BaseRegistry;
|
|
221
|
+
//# 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":["ConsoleLoggerService","BaseError"],"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,IAAIA,0CAAoB,EAAE;;AAG3D;;AAEG;IACI,KAAK,GAAA;AACX,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAE9D,QA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AAI,EAAE,0BAA0B;AAChC,gBAAA,MAAM,EAAE,UAAU;AAClB,aAAA,CAAC;;QAGH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAiB,cAAA,EAAA,MAAM,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,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var loggerLogLevel_enum = require('../../domain/enum/logger-log-level.enum.js');
|
|
4
|
+
require('../../domain/enum/service-token.enum.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The default options for the console logger.
|
|
8
|
+
*/
|
|
9
|
+
const CONSOLE_LOGGER_DEFAULT_OPTIONS = { level: loggerLogLevel_enum.ELoggerLogLevel.INFO };
|
|
10
|
+
|
|
11
|
+
exports.CONSOLE_LOGGER_DEFAULT_OPTIONS = CONSOLE_LOGGER_DEFAULT_OPTIONS;
|
|
12
|
+
//# 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":["ELoggerLogLevel"],"mappings":";;;;;AAIA;;AAEG;AACU,MAAA,8BAA8B,GAA0B,EAAE,KAAK,EAAEA,mCAAe,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,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var container_class = require('../class/base/container.class.js');
|
|
4
|
+
var factory_class = require('../class/base/factory.class.js');
|
|
5
|
+
var registry_class = require('../class/base/registry.class.js');
|
|
6
|
+
var consoleLogger_service = require('../service/console-logger.service.js');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Factory for creating infrastructure components.
|
|
10
|
+
* Provides methods to create instances of Registry, Factory, Container, and Logger.
|
|
11
|
+
*/
|
|
12
|
+
class CoreFactory {
|
|
13
|
+
static instance;
|
|
14
|
+
LOGGER;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new infrastructure factory.
|
|
17
|
+
* @param {ICoreFactoryOptions} options - The options to use for the factory.
|
|
18
|
+
*/
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.LOGGER = options.logger ?? new consoleLogger_service.ConsoleLoggerService();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Gets the singleton instance of the InfrastructureFactory.
|
|
24
|
+
* @param {ICoreFactoryOptions} options - The options to use for the factory.
|
|
25
|
+
* @returns {CoreFactory} The singleton instance.
|
|
26
|
+
*/
|
|
27
|
+
static getInstance(options) {
|
|
28
|
+
if (!CoreFactory.instance) {
|
|
29
|
+
CoreFactory.instance = new CoreFactory(options);
|
|
30
|
+
}
|
|
31
|
+
return CoreFactory.instance;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new container instance.
|
|
35
|
+
* @param {IBaseContainerOptions} options - The options to use for the container.
|
|
36
|
+
* @returns {IContainer} A new container instance.
|
|
37
|
+
*/
|
|
38
|
+
createContainer(options) {
|
|
39
|
+
this.LOGGER?.debug("Creating new container instance", { source: "InfrastructureFactory" });
|
|
40
|
+
const container = new container_class.BaseContainer(options);
|
|
41
|
+
this.LOGGER?.debug("Container instance created", { source: "InfrastructureFactory" });
|
|
42
|
+
return container;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new factory instance.
|
|
46
|
+
* @template T The type of items created by the factory.
|
|
47
|
+
* @param {IBaseFactoryOptions<T>} options Factory creation options.
|
|
48
|
+
* @returns {IFactory<T>} A new factory instance.
|
|
49
|
+
*/
|
|
50
|
+
createFactory(options) {
|
|
51
|
+
this.LOGGER?.debug("Creating new factory instance", { source: "InfrastructureFactory" });
|
|
52
|
+
const factory = new factory_class.BaseFactory(options);
|
|
53
|
+
this.LOGGER?.debug("Factory instance created", { source: "InfrastructureFactory" });
|
|
54
|
+
return factory;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Creates a new logger instance.
|
|
58
|
+
* @param {IConsoleLoggerOptions} options - The options to use for the logger.
|
|
59
|
+
* @returns {ILogger} A new logger instance.
|
|
60
|
+
*/
|
|
61
|
+
createLogger(options) {
|
|
62
|
+
this.LOGGER?.debug("Creating new logger instance", {
|
|
63
|
+
context: { level: options.level, loggerSource: options.source },
|
|
64
|
+
source: "InfrastructureFactory",
|
|
65
|
+
});
|
|
66
|
+
const logger = new consoleLogger_service.ConsoleLoggerService(options);
|
|
67
|
+
this.LOGGER?.debug("Logger instance created", { source: "InfrastructureFactory" });
|
|
68
|
+
return logger;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Creates a new registry instance.
|
|
72
|
+
* @template T The type of items stored in the registry (must have a name property).
|
|
73
|
+
* @param {IBaseRegistryOptions} options - The options to use for the registry.
|
|
74
|
+
* @returns {IRegistry<T>} A new registry instance.
|
|
75
|
+
*/
|
|
76
|
+
createRegistry(options) {
|
|
77
|
+
this.LOGGER?.debug("Creating new registry instance", { source: "InfrastructureFactory" });
|
|
78
|
+
const registry = new registry_class.BaseRegistry(options);
|
|
79
|
+
this.LOGGER?.debug("Registry instance created", { source: "InfrastructureFactory" });
|
|
80
|
+
return registry;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
exports.CoreFactory = CoreFactory;
|
|
85
|
+
//# 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":["ConsoleLoggerService","BaseContainer","BaseFactory","BaseRegistry"],"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,CAAC,MAAM,IAAI,IAAIA,0CAAoB,EAAE;;AAG3D;;;;AAIG;IACI,OAAO,WAAW,CAAC,OAA4B,EAAA;AACrD,QAAA,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;YAC1B,WAAW,CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC;;QAGhD,OAAO,WAAW,CAAC,QAAQ;;AAG5B;;;;AAIG;AACI,IAAA,eAAe,CAAC,OAA8B,EAAA;AACpD,QAAA,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,iCAAiC,EAAE,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;AAE1F,QAAA,MAAM,SAAS,GAAe,IAAIC,6BAAa,CAAC,OAAO,CAAC;AAExD,QAAA,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,4BAA4B,EAAE,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;AAErF,QAAA,OAAO,SAAS;;AAGjB;;;;;AAKG;AACI,IAAA,aAAa,CAAI,OAA+B,EAAA;AACtD,QAAA,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,+BAA+B,EAAE,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;AAExF,QAAA,MAAM,OAAO,GAAgB,IAAIC,yBAAW,CAAI,OAAO,CAAC;AAExD,QAAA,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,0BAA0B,EAAE,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;AAEnF,QAAA,OAAO,OAAO;;AAGf;;;;AAIG;AACI,IAAA,YAAY,CAAC,OAA8B,EAAA;AACjD,QAAA,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,8BAA8B,EAAE;AAClD,YAAA,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE;AAC/D,YAAA,MAAM,EAAE,uBAAuB;AAC/B,SAAA,CAAC;AAEF,QAAA,MAAM,MAAM,GAAY,IAAIF,0CAAoB,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,IAAIG,2BAAY,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
|