@adaas/a-concept 0.1.59 → 0.1.60

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/dist/index.d.mts CHANGED
@@ -68,117 +68,38 @@ type A_TYPES__ExtractProperties<T, P extends A_TYPES__Paths<T>[]> = A_TYPES__Uni
68
68
  [K in keyof P]: P[K] extends string ? A_TYPES__ExtractNested<T, P[K]> : never;
69
69
  }[number]>;
70
70
 
71
- /**
72
- * A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc.
73
- *
74
- * [!] Meta can be different depending on the type of input data
75
- */
76
- declare class A_Meta<_StorageItems extends Record<string, any> = any, _SerializedType extends Record<string, any> = Record<string, any>> implements Iterable<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {
77
- protected meta: Map<keyof _StorageItems, _StorageItems[keyof _StorageItems]>;
78
- /**
79
- * Method to get the iterator for the meta object
80
- *
81
- * @returns
82
- */
83
- [Symbol.iterator](): Iterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
84
- /**
85
- * Allows to replicate received meta object by replacing internal meta to the received one
86
- *
87
- * @param meta
88
- * @returns
89
- */
90
- from(meta: A_Meta<_StorageItems>): A_Meta<_StorageItems>;
91
- /**
92
- * Method to set values in the map
93
- *
94
- * @param key
95
- * @param value
96
- */
97
- set<K extends keyof _StorageItems>(key: K, value: _StorageItems[K]): void;
98
- /**
99
- * Method to get values from the map
100
- *
101
- * @param key
102
- * @returns
103
- */
104
- get<K extends keyof _StorageItems>(key: K): _StorageItems[K] | undefined;
105
- /**
106
- * Method to delete values from the map
107
- *
108
- * @param key
109
- * @returns
110
- */
111
- delete(key: keyof _StorageItems): boolean;
112
- /**
113
- * Method to get the size of the map
114
- *
115
- * @returns
116
- */
117
- size(): number;
71
+ declare enum A_TYPES__ConceptAbstractions {
118
72
  /**
119
- * This method is needed to convert the key to a regular expression and cover cases like:
120
- *
121
- * simple * e.g. "a*" instead of "a.*"
122
- *
123
- * simple ? e.g. "a?" instead of "a."
124
- *
125
- * etc.
126
- *
127
- * @param key
128
- * @returns
73
+ * Run the concept.
129
74
  */
130
- private convertToRegExp;
75
+ Run = "run",
131
76
  /**
132
- * Method to find values in the map by name.
133
- *
134
- * Converts the Key in Map to a regular expression and then compares to the name
135
- *
136
- * @param name
137
- * @returns
77
+ * Build the concept.
138
78
  */
139
- find(name: string): [keyof _StorageItems, _StorageItems[keyof _StorageItems]][];
79
+ Build = "build",
140
80
  /**
141
- * Method to find values in the map by regular expression
142
- *
143
- * Compares Map Key to the input regular expression
144
- *
145
- * @param regex
146
- * @returns
81
+ * Publish the concept.
147
82
  */
148
- findByRegex(regex: RegExp): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
83
+ Publish = "publish",
149
84
  /**
150
- * Method to check if the map has a specific key
151
- *
152
- * @param key
153
- * @returns
85
+ * Deploy the concept.
154
86
  */
155
- has(key: keyof _StorageItems): boolean;
87
+ Deploy = "deploy",
156
88
  /**
157
- * Method to get the size of the map
158
- *
159
- * @returns
89
+ * Load the concept.
160
90
  */
161
- entries(): IterableIterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
91
+ Load = "load",
162
92
  /**
163
- * Method to clear the map
93
+ * Start the concept.
164
94
  */
165
- clear(): void;
166
- toArray(): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
167
- protected recursiveToJSON(value: any): any;
95
+ Start = "start",
168
96
  /**
169
- * Serializes the meta to a JSON object
170
- * Uses internal storage to convert to JSON
171
- *
172
- * @returns
97
+ * Stop the concept.
173
98
  */
174
- toJSON(): _SerializedType;
99
+ Stop = "stop"
175
100
  }
176
-
177
- declare enum A_TYPES__ContainerMetaKey {
178
- FEATURES = "a-container-features",
179
- INJECTIONS = "a-container-injections",
180
- ABSTRACTIONS = "a-container-abstractions",
181
- EXTENSIONS = "a-container-extensions"
101
+ declare enum A_TYPES__ConceptMetaKey {
102
+ LIFECYCLE = "a-component-extensions"
182
103
  }
183
104
 
184
105
  declare enum A_TYPES__A_Stage_Status {
@@ -442,6 +363,11 @@ declare class ASEID {
442
363
  * Get the shard of the ASEID (if any)
443
364
  */
444
365
  get shard(): string | undefined;
366
+ /**
367
+ * Get the hash of the ASEID, Unique identifier based on the ASEID string
368
+ * Useful when aseid details should not be exposed directly
369
+ */
370
+ get hash(): string;
445
371
  /**
446
372
  * get Internal Initializer based on the type of the parameter provided
447
373
  *
@@ -1025,6 +951,11 @@ declare class A_Error<_ConstructorType extends A_TYPES__Error_Init = A_TYPES__Er
1025
951
  */
1026
952
  error: Error);
1027
953
  constructor(
954
+ /**
955
+ * Original JS Error
956
+ */
957
+ error: unknown);
958
+ constructor(
1028
959
  /**
1029
960
  * Error message
1030
961
  */
@@ -1904,160 +1835,6 @@ type A_TYPES__FeatureExtendDecoratorMeta = {
1904
1835
  override: string;
1905
1836
  };
1906
1837
 
1907
- /**
1908
- * Container constructor type
1909
- * Uses the generic type T to specify the type of the container
1910
- */
1911
- type A_TYPES__Container_Constructor<T = A_Container> = new (...args: any[]) => T;
1912
- /**
1913
- * Container initialization type
1914
- */
1915
- type A_TYPES__Container_Init = {
1916
- /**
1917
- * The extra name for the container (optional)
1918
- */
1919
- name?: string;
1920
- } & A_TYPES__Scope_Init;
1921
- /**
1922
- * Container serialized type
1923
- */
1924
- type A_TYPES__Container_Serialized = {
1925
- /**
1926
- * The ASEID of the container
1927
- */
1928
- aseid: string;
1929
- };
1930
- /**
1931
- * Meta information stored in each Container
1932
- */
1933
- type A_TYPES__ContainerMeta = {
1934
- /**
1935
- * Extensions applied to the component per handler
1936
- */
1937
- [A_TYPES__ContainerMetaKey.EXTENSIONS]: A_Meta<{
1938
- /**
1939
- * Where Key the regexp for what to apply the extension
1940
- * A set of container names or a wildcard, or a regexp
1941
- *
1942
- *
1943
- * Where value is the extension instructions
1944
- */
1945
- [Key: string]: A_TYPES__FeatureExtendDecoratorMeta[];
1946
- }>;
1947
- [A_TYPES__ContainerMetaKey.FEATURES]: A_Meta<{
1948
- /**
1949
- * Where Key is the name of the feature
1950
- *
1951
- * Where value is the list of features
1952
- */
1953
- [Key: string]: A_TYPES__FeatureDefineDecoratorMeta;
1954
- }>;
1955
- [A_TYPES__ContainerMetaKey.ABSTRACTIONS]: A_Meta<{
1956
- /**
1957
- * Where Key the regexp for what to apply the extension
1958
- * A set of container names or a wildcard, or a regexp
1959
- *
1960
- *
1961
- * Where value is the extension instructions
1962
- */
1963
- [Key: string]: A_TYPES__ConceptAbstraction[];
1964
- }>;
1965
- [A_TYPES__ContainerMetaKey.INJECTIONS]: A_Meta<{
1966
- /**
1967
- * Where Key is the name of the injection
1968
- *
1969
- * Where value is the list of injections
1970
- */
1971
- [Key: string]: A_TYPES__A_InjectDecorator_Meta;
1972
- }>;
1973
- };
1974
- type A_TYPES__ContainerMetaExtension = A_TYPES__FeatureExtendDecoratorMeta;
1975
-
1976
- declare class A_Container {
1977
- /**
1978
- * Configuration of the container that will be used to run it.
1979
- */
1980
- protected readonly config: Partial<A_TYPES__Container_Init>;
1981
- /**
1982
- * Name of the container
1983
- */
1984
- get name(): string;
1985
- /**
1986
- * Returns the scope where the container is registered
1987
- */
1988
- get scope(): A_Scope;
1989
- /**
1990
- * This class should combine Components to achieve the goal withing Concept
1991
- *
1992
- * Container is a direct container that should be "run" to make Concept work.
1993
- * So because of that Container can be:
1994
- * - HTTP Server
1995
- * - BASH Script
1996
- * - Database Connection
1997
- * - Microservice
1998
- * - etc.
1999
- *
2000
- * @param config - Configuration of the container that will be used to run it.
2001
- */
2002
- constructor(
2003
- /**
2004
- * Configuration of the container that will be used to run it.
2005
- */
2006
- config?: Partial<A_TYPES__Container_Init>);
2007
- /**
2008
- * Calls the feature with the given name in the given scope
2009
- *
2010
- * [!] Note: This method creates a new instance of the feature every time it is called
2011
- *
2012
- * @param feature - the name of the feature to call
2013
- * @param scope - the scope in which to call the feature
2014
- * @returns - void
2015
- */
2016
- call(
2017
- /**
2018
- * Name of the feature to call
2019
- */
2020
- feature: string,
2021
- /**
2022
- * scope in which the feature will be executed
2023
- */
2024
- scope?: A_Scope): Promise<void>;
2025
- }
2026
-
2027
- declare enum A_TYPES__ConceptAbstractions {
2028
- /**
2029
- * Run the concept.
2030
- */
2031
- Run = "run",
2032
- /**
2033
- * Build the concept.
2034
- */
2035
- Build = "build",
2036
- /**
2037
- * Publish the concept.
2038
- */
2039
- Publish = "publish",
2040
- /**
2041
- * Deploy the concept.
2042
- */
2043
- Deploy = "deploy",
2044
- /**
2045
- * Load the concept.
2046
- */
2047
- Load = "load",
2048
- /**
2049
- * Start the concept.
2050
- */
2051
- Start = "start",
2052
- /**
2053
- * Stop the concept.
2054
- */
2055
- Stop = "stop"
2056
- }
2057
- declare enum A_TYPES__ConceptMetaKey {
2058
- LIFECYCLE = "a-component-extensions"
2059
- }
2060
-
2061
1838
  /**
2062
1839
  * A-Abstraction Extend decorator allows to extends behavior of each concept abstraction execution.
2063
1840
  * In case some components or containers requires to extend the behavior of the abstraction like 'start', 'build' or 'deploy'
@@ -2399,117 +2176,370 @@ declare class A_Fragment<_SerializedType extends A_TYPES__Fragment_Serialized =
2399
2176
  * fragment.set('userId', '12345');
2400
2177
  * ```
2401
2178
  */
2402
- constructor(params?: Partial<A_TYPES__Fragment_Init>);
2179
+ constructor(params?: Partial<A_TYPES__Fragment_Init>);
2180
+ /**
2181
+ * Gets the fragment's unique name/identifier.
2182
+ *
2183
+ * @returns The fragment name
2184
+ */
2185
+ get name(): string;
2186
+ /**
2187
+ * Serializes the fragment to a JSON-compatible object.
2188
+ *
2189
+ * This method combines the fragment's name with all meta data to create
2190
+ * a serializable representation. The return type is determined by the
2191
+ * _SerializedType generic parameter, allowing for custom serialization formats.
2192
+ *
2193
+ * @returns A serialized representation of the fragment
2194
+ *
2195
+ * @example
2196
+ * ```typescript
2197
+ * const fragment = new A_Fragment<{ userId: string, role: string }>({
2198
+ * name: 'UserFragment'
2199
+ * });
2200
+ * fragment.set('userId', '12345');
2201
+ * fragment.set('role', 'admin');
2202
+ *
2203
+ * const json = fragment.toJSON();
2204
+ * // Result: { name: 'UserFragment', userId: '12345', role: 'admin' }
2205
+ * ```
2206
+ */
2207
+ toJSON(): _SerializedType;
2208
+ }
2209
+
2210
+ /**
2211
+ * Fragment constructor type
2212
+ * Uses the generic type T to specify the type of the fragment
2213
+ */
2214
+ type A_TYPES__Fragment_Constructor<T = A_Fragment> = new (...args: any[]) => T;
2215
+ /**
2216
+ * Fragment initialization type
2217
+ */
2218
+ type A_TYPES__Fragment_Init = {
2219
+ name: string;
2220
+ };
2221
+ /**
2222
+ * Fragment serialized type
2223
+ */
2224
+ type A_TYPES__Fragment_Serialized = {
2225
+ /**
2226
+ * The Name of the fragment
2227
+ */
2228
+ name: string;
2229
+ };
2230
+
2231
+ /**
2232
+ * Concept constructor type
2233
+ * Uses the generic type T to specify the type of the concept
2234
+ */
2235
+ type A_TYPES__Concept_Constructor<T = A_Concept> = new (...args: any[]) => T;
2236
+ /**
2237
+ * Concept initialization type
2238
+ * Uses the generic type T to specify the type of containers that the concept will use
2239
+ */
2240
+ type A_TYPES__Concept_Init<T extends Array<A_Container>> = {
2241
+ /**
2242
+ * The name of the Concept
2243
+ * If name is not provided, will be used from environment variable A_CONCEPT_NAME
2244
+ *
2245
+ * By default, the name of the Concept is 'a-concept'
2246
+ *
2247
+ */
2248
+ name?: string;
2249
+ /**
2250
+ * A set of Context Fragments to register globally for the concept.
2251
+ * These fragments will be available in the global context.
2252
+ *
2253
+ */
2254
+ fragments?: Array<InstanceType<A_TYPES__Fragment_Constructor>>;
2255
+ /**
2256
+ * A set of Containers that the concept depends on.
2257
+ * These containers will create a new Container for the concept.
2258
+ */
2259
+ containers?: T;
2260
+ /**
2261
+ * A set of Entities that the concept can use.
2262
+ * These components will be used in the concept.
2263
+ */
2264
+ entities?: Array<InstanceType<A_TYPES__Entity_Constructor> | A_TYPES__Entity_Constructor>;
2265
+ /**
2266
+ * A set of Components available for all containers and fragments in the concept.
2267
+ * These components will be registered in the root scope of the concept.
2268
+ *
2269
+ * [!] Note that these components will be available in all containers and fragments in the concept.
2270
+ */
2271
+ components?: Array<A_TYPES__Component_Constructor>;
2272
+ };
2273
+ /**
2274
+ * Concept serialized type
2275
+ */
2276
+ type A_TYPES__Concept_Serialized = {};
2277
+ /**
2278
+ * Uses as a transfer object to pass configurations to Feature constructor
2279
+ */
2280
+ type A_TYPES__ConceptAbstractionMeta = {
2281
+ /**
2282
+ * The arguments that will be passed to the handler
2283
+ */
2284
+ args: A_TYPES__A_InjectDecorator_Meta;
2285
+ } & A_TYPES__FeatureExtendDecoratorMeta;
2286
+ /**
2287
+ * Uses to define the extension that will be applied to the Concept
2288
+ */
2289
+ type A_TYPES__ConceptAbstraction = A_TYPES__FeatureExtendDecoratorMeta;
2290
+
2291
+ declare enum A_TYPES__ContainerMetaKey {
2292
+ FEATURES = "a-container-features",
2293
+ INJECTIONS = "a-container-injections",
2294
+ ABSTRACTIONS = "a-container-abstractions",
2295
+ EXTENSIONS = "a-container-extensions"
2296
+ }
2297
+
2298
+ /**
2299
+ * Container constructor type
2300
+ * Uses the generic type T to specify the type of the container
2301
+ */
2302
+ type A_TYPES__Container_Constructor<T = A_Container> = new (...args: any[]) => T;
2303
+ /**
2304
+ * Container initialization type
2305
+ */
2306
+ type A_TYPES__Container_Init = {
2307
+ /**
2308
+ * The extra name for the container (optional)
2309
+ */
2310
+ name?: string;
2311
+ } & A_TYPES__Scope_Init;
2312
+ /**
2313
+ * Container serialized type
2314
+ */
2315
+ type A_TYPES__Container_Serialized = {
2316
+ /**
2317
+ * The ASEID of the container
2318
+ */
2319
+ aseid: string;
2320
+ };
2321
+ /**
2322
+ * Meta information stored in each Container
2323
+ */
2324
+ type A_TYPES__ContainerMeta = {
2325
+ /**
2326
+ * Extensions applied to the component per handler
2327
+ */
2328
+ [A_TYPES__ContainerMetaKey.EXTENSIONS]: A_Meta<{
2329
+ /**
2330
+ * Where Key the regexp for what to apply the extension
2331
+ * A set of container names or a wildcard, or a regexp
2332
+ *
2333
+ *
2334
+ * Where value is the extension instructions
2335
+ */
2336
+ [Key: string]: A_TYPES__FeatureExtendDecoratorMeta[];
2337
+ }>;
2338
+ [A_TYPES__ContainerMetaKey.FEATURES]: A_Meta<{
2339
+ /**
2340
+ * Where Key is the name of the feature
2341
+ *
2342
+ * Where value is the list of features
2343
+ */
2344
+ [Key: string]: A_TYPES__FeatureDefineDecoratorMeta;
2345
+ }>;
2346
+ [A_TYPES__ContainerMetaKey.ABSTRACTIONS]: A_Meta<{
2347
+ /**
2348
+ * Where Key the regexp for what to apply the extension
2349
+ * A set of container names or a wildcard, or a regexp
2350
+ *
2351
+ *
2352
+ * Where value is the extension instructions
2353
+ */
2354
+ [Key: string]: A_TYPES__ConceptAbstraction[];
2355
+ }>;
2356
+ [A_TYPES__ContainerMetaKey.INJECTIONS]: A_Meta<{
2357
+ /**
2358
+ * Where Key is the name of the injection
2359
+ *
2360
+ * Where value is the list of injections
2361
+ */
2362
+ [Key: string]: A_TYPES__A_InjectDecorator_Meta;
2363
+ }>;
2364
+ };
2365
+ type A_TYPES__ContainerMetaExtension = A_TYPES__FeatureExtendDecoratorMeta;
2366
+
2367
+ declare class A_Container {
2368
+ /**
2369
+ * Configuration of the container that will be used to run it.
2370
+ */
2371
+ protected readonly config: Partial<A_TYPES__Container_Init>;
2403
2372
  /**
2404
- * Gets the fragment's unique name/identifier.
2405
- *
2406
- * @returns The fragment name
2373
+ * Name of the container
2407
2374
  */
2408
2375
  get name(): string;
2409
2376
  /**
2410
- * Serializes the fragment to a JSON-compatible object.
2377
+ * Returns the scope where the container is registered
2378
+ */
2379
+ get scope(): A_Scope;
2380
+ /**
2381
+ * This class should combine Components to achieve the goal withing Concept
2411
2382
  *
2412
- * This method combines the fragment's name with all meta data to create
2413
- * a serializable representation. The return type is determined by the
2414
- * _SerializedType generic parameter, allowing for custom serialization formats.
2383
+ * Container is a direct container that should be "run" to make Concept work.
2384
+ * So because of that Container can be:
2385
+ * - HTTP Server
2386
+ * - BASH Script
2387
+ * - Database Connection
2388
+ * - Microservice
2389
+ * - etc.
2415
2390
  *
2416
- * @returns A serialized representation of the fragment
2391
+ * @param config - Configuration of the container that will be used to run it.
2392
+ */
2393
+ constructor(
2394
+ /**
2395
+ * Configuration of the container that will be used to run it.
2396
+ */
2397
+ config?: Partial<A_TYPES__Container_Init>);
2398
+ /**
2399
+ * Calls the feature with the given name in the given scope
2417
2400
  *
2418
- * @example
2419
- * ```typescript
2420
- * const fragment = new A_Fragment<{ userId: string, role: string }>({
2421
- * name: 'UserFragment'
2422
- * });
2423
- * fragment.set('userId', '12345');
2424
- * fragment.set('role', 'admin');
2401
+ * [!] Note: This method creates a new instance of the feature every time it is called
2425
2402
  *
2426
- * const json = fragment.toJSON();
2427
- * // Result: { name: 'UserFragment', userId: '12345', role: 'admin' }
2428
- * ```
2403
+ * @param feature - the name of the feature to call
2404
+ * @param scope - the scope in which to call the feature
2405
+ * @returns - void
2429
2406
  */
2430
- toJSON(): _SerializedType;
2407
+ call(
2408
+ /**
2409
+ * Name of the feature to call
2410
+ */
2411
+ feature: string,
2412
+ /**
2413
+ * scope in which the feature will be executed
2414
+ */
2415
+ scope?: A_Scope): Promise<void>;
2431
2416
  }
2432
2417
 
2433
2418
  /**
2434
- * Fragment constructor type
2435
- * Uses the generic type T to specify the type of the fragment
2419
+ * Meta constructor type
2436
2420
  */
2437
- type A_TYPES__Fragment_Constructor<T = A_Fragment> = new (...args: any[]) => T;
2421
+ type A_TYPES__Meta_Constructor<T = A_Meta> = new (...args: any[]) => T;
2438
2422
  /**
2439
- * Fragment initialization type
2423
+ * Components that can have Meta associated with them
2440
2424
  */
2441
- type A_TYPES__Fragment_Init = {
2442
- name: string;
2443
- };
2425
+ type A_TYPES__MetaLinkedComponents = A_Container | A_Component | A_Entity | A_Fragment;
2444
2426
  /**
2445
- * Fragment serialized type
2427
+ * Constructors of components that can have Meta associated with them
2446
2428
  */
2447
- type A_TYPES__Fragment_Serialized = {
2448
- /**
2449
- * The Name of the fragment
2450
- */
2451
- name: string;
2452
- };
2429
+ type A_TYPES__MetaLinkedComponentConstructors = new (...args: any[]) => any | A_TYPES__Container_Constructor | A_TYPES__Component_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Fragment_Constructor;
2453
2430
 
2454
2431
  /**
2455
- * Concept constructor type
2456
- * Uses the generic type T to specify the type of the concept
2457
- */
2458
- type A_TYPES__Concept_Constructor<T = A_Concept> = new (...args: any[]) => T;
2459
- /**
2460
- * Concept initialization type
2461
- * Uses the generic type T to specify the type of containers that the concept will use
2432
+ * A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc.
2433
+ *
2434
+ * [!] Meta can be different depending on the type of input data
2462
2435
  */
2463
- type A_TYPES__Concept_Init<T extends Array<A_Container>> = {
2436
+ declare class A_Meta<_StorageItems extends Record<any, any> = any, _SerializedType extends Record<string, any> = Record<string, any>> implements Iterable<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {
2464
2437
  /**
2465
- * The name of the Concept
2466
- * If name is not provided, will be used from environment variable A_CONCEPT_NAME
2438
+ * Allows to set a custom meta class for the Component or Container or Entity, or anything else.
2467
2439
  *
2468
- * By default, the name of the Concept is 'a-concept'
2440
+ * @param target
2441
+ * @returns
2442
+ */
2443
+ static Define<T extends A_Meta>(target: A_TYPES__Meta_Constructor<T>): (target: A_TYPES__MetaLinkedComponentConstructors) => A_TYPES__MetaLinkedComponentConstructors;
2444
+ protected meta: Map<keyof _StorageItems, _StorageItems[keyof _StorageItems]>;
2445
+ /**
2446
+ * Method to get the iterator for the meta object
2469
2447
  *
2448
+ * @returns
2470
2449
  */
2471
- name?: string;
2450
+ [Symbol.iterator](): Iterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
2472
2451
  /**
2473
- * A set of Context Fragments to register globally for the concept.
2474
- * These fragments will be available in the global context.
2452
+ * Allows to replicate received meta object by replacing internal meta to the received one
2475
2453
  *
2454
+ * @param meta
2455
+ * @returns
2476
2456
  */
2477
- fragments?: Array<InstanceType<A_TYPES__Fragment_Constructor>>;
2457
+ from(meta: A_Meta<_StorageItems>): A_Meta<_StorageItems>;
2478
2458
  /**
2479
- * A set of Containers that the concept depends on.
2480
- * These containers will create a new Container for the concept.
2459
+ * Method to set values in the map
2460
+ *
2461
+ * @param key
2462
+ * @param value
2481
2463
  */
2482
- containers?: T;
2464
+ set<K extends keyof _StorageItems>(key: K, value: _StorageItems[K]): void;
2483
2465
  /**
2484
- * A set of Entities that the concept can use.
2485
- * These components will be used in the concept.
2466
+ * Method to get values from the map
2467
+ *
2468
+ * @param key
2469
+ * @returns
2486
2470
  */
2487
- entities?: Array<InstanceType<A_TYPES__Entity_Constructor> | A_TYPES__Entity_Constructor>;
2471
+ get<K extends keyof _StorageItems>(key: K): _StorageItems[K] | undefined;
2488
2472
  /**
2489
- * A set of Components available for all containers and fragments in the concept.
2490
- * These components will be registered in the root scope of the concept.
2473
+ * Method to delete values from the map
2491
2474
  *
2492
- * [!] Note that these components will be available in all containers and fragments in the concept.
2475
+ * @param key
2476
+ * @returns
2493
2477
  */
2494
- components?: Array<A_TYPES__Component_Constructor>;
2495
- };
2496
- /**
2497
- * Concept serialized type
2498
- */
2499
- type A_TYPES__Concept_Serialized = {};
2500
- /**
2501
- * Uses as a transfer object to pass configurations to Feature constructor
2502
- */
2503
- type A_TYPES__ConceptAbstractionMeta = {
2478
+ delete(key: keyof _StorageItems): boolean;
2504
2479
  /**
2505
- * The arguments that will be passed to the handler
2480
+ * Method to get the size of the map
2481
+ *
2482
+ * @returns
2506
2483
  */
2507
- args: A_TYPES__A_InjectDecorator_Meta;
2508
- } & A_TYPES__FeatureExtendDecoratorMeta;
2509
- /**
2510
- * Uses to define the extension that will be applied to the Concept
2511
- */
2512
- type A_TYPES__ConceptAbstraction = A_TYPES__FeatureExtendDecoratorMeta;
2484
+ size(): number;
2485
+ /**
2486
+ * This method is needed to convert the key to a regular expression and cover cases like:
2487
+ *
2488
+ * simple * e.g. "a*" instead of "a.*"
2489
+ *
2490
+ * simple ? e.g. "a?" instead of "a."
2491
+ *
2492
+ * etc.
2493
+ *
2494
+ * @param key
2495
+ * @returns
2496
+ */
2497
+ private convertToRegExp;
2498
+ /**
2499
+ * Method to find values in the map by name.
2500
+ *
2501
+ * Converts the Key in Map to a regular expression and then compares to the name
2502
+ *
2503
+ * @param name
2504
+ * @returns
2505
+ */
2506
+ find(name: string): [keyof _StorageItems, _StorageItems[keyof _StorageItems]][];
2507
+ /**
2508
+ * Method to find values in the map by regular expression
2509
+ *
2510
+ * Compares Map Key to the input regular expression
2511
+ *
2512
+ * @param regex
2513
+ * @returns
2514
+ */
2515
+ findByRegex(regex: RegExp): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
2516
+ /**
2517
+ * Method to check if the map has a specific key
2518
+ *
2519
+ * @param key
2520
+ * @returns
2521
+ */
2522
+ has(key: keyof _StorageItems): boolean;
2523
+ /**
2524
+ * Method to get the size of the map
2525
+ *
2526
+ * @returns
2527
+ */
2528
+ entries(): IterableIterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
2529
+ /**
2530
+ * Method to clear the map
2531
+ */
2532
+ clear(): void;
2533
+ toArray(): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
2534
+ protected recursiveToJSON(value: any): any;
2535
+ /**
2536
+ * Serializes the meta to a JSON object
2537
+ * Uses internal storage to convert to JSON
2538
+ *
2539
+ * @returns
2540
+ */
2541
+ toJSON(): _SerializedType;
2542
+ }
2513
2543
 
2514
2544
  declare enum A_TYPES__ComponentMetaKey {
2515
2545
  EXTENSIONS = "a-component-extensions",
@@ -3182,6 +3212,19 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
3182
3212
  * Provide an entity constructor to resolve its instance or an array of instances from the scope
3183
3213
  */
3184
3214
  entity: A_TYPES__Entity_Constructor<T>,
3215
+ /**
3216
+ * Only Aseid Provided, in this case one entity will be returned
3217
+ */
3218
+ instructions: {
3219
+ query: {
3220
+ aseid: string | ASEID;
3221
+ };
3222
+ }): T | undefined;
3223
+ resolveFlat<T extends A_Entity>(
3224
+ /**
3225
+ * Provide an entity constructor to resolve its instance or an array of instances from the scope
3226
+ */
3227
+ entity: A_TYPES__Entity_Constructor<T>,
3185
3228
  /**
3186
3229
  * Provide optional instructions to find a specific entity or a set of entities
3187
3230
  */
@@ -3545,16 +3588,7 @@ type A_TYPES_ScopeDependentComponents = A_Component | A_Entity | A_Fragment | A_
3545
3588
  */
3546
3589
  type A_TYPES_ScopeIndependentComponents = A_Error | A_Scope | A_Caller;
3547
3590
 
3548
- /**
3549
- * Components that can have Meta associated with them
3550
- */
3551
- type A_TYPES__MetaLinkedComponents = A_Container | A_Component | A_Entity;
3552
- /**
3553
- * Constructors of components that can have Meta associated with them
3554
- */
3555
- type A_TYPES__MetaLinkedComponentConstructors = A_TYPES__Container_Constructor | A_TYPES__Component_Constructor | A_TYPES__Entity_Constructor;
3556
-
3557
- declare class A_ComponentMeta extends A_Meta<A_TYPES__ComponentMeta> {
3591
+ declare class A_ComponentMeta<T extends A_TYPES__ComponentMeta = A_TYPES__ComponentMeta> extends A_Meta<T> {
3558
3592
  /**
3559
3593
  * Allows to get all the injections for a given handler
3560
3594
  *
@@ -3686,6 +3720,7 @@ declare class A_Context {
3686
3720
  * Meta provides to store extra information about the class behavior and configuration.
3687
3721
  */
3688
3722
  protected _metaStorage: Map<A_TYPES__MetaLinkedComponentConstructors, A_Meta>;
3723
+ protected _globals: Map<string, any>;
3689
3724
  /**
3690
3725
  * Private constructor to enforce singleton pattern.
3691
3726
  *
@@ -3781,51 +3816,76 @@ declare class A_Context {
3781
3816
  *
3782
3817
  * @param container
3783
3818
  */
3784
- static meta(
3819
+ static meta<T extends A_ContainerMeta>(
3785
3820
  /**
3786
3821
  * Get meta for the specific container class by constructor.
3787
3822
  */
3788
- container: A_TYPES__Container_Constructor): A_ContainerMeta;
3789
- static meta(
3823
+ container: A_TYPES__Container_Constructor): T;
3824
+ static meta<T extends A_ContainerMeta>(
3790
3825
  /**
3791
3826
  * Get meta for the specific container instance.
3792
3827
  */
3793
- container: A_Container): A_ContainerMeta;
3794
- static meta(
3828
+ container: A_Container): T;
3829
+ static meta<T extends A_EntityMeta>(
3795
3830
  /**
3796
3831
  * Get meta for the specific entity class by constructor.
3797
3832
  */
3798
- entity: A_TYPES__Entity_Constructor): A_EntityMeta;
3799
- static meta(
3833
+ entity: A_TYPES__Entity_Constructor): T;
3834
+ static meta<T extends A_EntityMeta>(
3800
3835
  /**
3801
3836
  * Get meta for the specific entity instance.
3802
3837
  */
3803
- entity: A_Entity): A_EntityMeta;
3804
- static meta(
3838
+ entity: A_Entity): T;
3839
+ static meta<T extends A_ComponentMeta>(
3805
3840
  /**
3806
3841
  * Get meta for the specific component class by constructor.
3807
3842
  */
3808
- component: A_TYPES__Component_Constructor): A_ComponentMeta;
3809
- static meta(
3843
+ component: A_TYPES__Component_Constructor): T;
3844
+ static meta<T extends A_ComponentMeta>(
3810
3845
  /**
3811
3846
  * Get meta for the specific component instance.
3812
3847
  */
3813
- component: A_Component): A_ComponentMeta;
3814
- static meta(
3848
+ component: A_Component): T;
3849
+ static meta<T extends A_Meta>(
3850
+ /**
3851
+ * Get meta for the specific component class by constructor.
3852
+ */
3853
+ fragment: A_TYPES__Fragment_Constructor): T;
3854
+ static meta<T extends A_Meta>(
3855
+ /**
3856
+ * Get meta for the specific component instance.
3857
+ */
3858
+ fragment: A_Fragment): T;
3859
+ static meta<T extends A_ComponentMeta>(
3815
3860
  /**
3816
3861
  * Get meta for the specific component by its name.
3817
3862
  */
3818
- component: string): A_ComponentMeta;
3863
+ component: string): T;
3819
3864
  static meta(
3820
3865
  /**
3821
- * Get meta for the specific injectable target (class or instance).
3866
+ * Get meta for the specific meta linked component (class or instance).
3822
3867
  */
3823
- target: A_TYPES__InjectableTargets): A_ComponentMeta;
3868
+ target: A_TYPES__MetaLinkedComponentConstructors | A_TYPES__MetaLinkedComponents): A_ComponentMeta;
3869
+ static meta<T extends A_Meta>(
3870
+ /**
3871
+ * Get meta for the specific class or instance
3872
+ */
3873
+ constructor: new (...args: any[]) => any): T;
3824
3874
  static meta<T extends Record<string, any>>(
3825
3875
  /**
3826
3876
  * Get meta for the specific class or instance
3827
3877
  */
3828
3878
  constructor: new (...args: any[]) => any): A_Meta<T>;
3879
+ /**
3880
+ * Allows to set meta for the specific class or instance.
3881
+ *
3882
+ * @param param1
3883
+ * @param meta
3884
+ */
3885
+ static setMeta<T extends A_ContainerMeta, S extends A_Container>(param1: S, meta: T): any;
3886
+ static setMeta<T extends A_EntityMeta, S extends A_Entity>(param1: S, meta: T): any;
3887
+ static setMeta<T extends A_ComponentMeta, S extends A_Component>(param1: S, meta: T): any;
3888
+ static setMeta<T extends A_Meta>(param1: new (...args: any[]) => any, meta: T): any;
3829
3889
  /**
3830
3890
  *
3831
3891
  * This method allows to get the issuer of a specific scope.
@@ -4069,6 +4129,15 @@ declare class A_ScopeError extends A_Error {
4069
4129
  static readonly DeregistrationError = "A-Scope Deregistration Error";
4070
4130
  }
4071
4131
 
4132
+ /**
4133
+ *
4134
+ * This decorator should allow to set a default meta type for the class, this helps to avoid
4135
+ * the need to create custom meta classes for each class.
4136
+ *
4137
+ * @returns
4138
+ */
4139
+ declare function A_MetaDecorator<T extends A_Meta>(constructor: new (...args: any[]) => T): (target: A_TYPES__MetaLinkedComponentConstructors) => A_TYPES__MetaLinkedComponentConstructors;
4140
+
4072
4141
  /**
4073
4142
  * A-Dependency require decorator return type
4074
4143
  */
@@ -4390,6 +4459,14 @@ declare class A_IdentityHelper {
4390
4459
  * Remove leading zeros from a formatted number
4391
4460
  */
4392
4461
  static removeLeadingZeros(formattedNumber: any): string;
4462
+ /**
4463
+ * Generates a simple hash string from the input string.
4464
+ *
4465
+ *
4466
+ * @param input
4467
+ * @returns
4468
+ */
4469
+ static hashString(input: string): string;
4393
4470
  }
4394
4471
 
4395
4472
  declare class A_StepManagerError extends A_Error {
@@ -4586,4 +4663,4 @@ declare class A_TypeGuards {
4586
4663
  static isErrorSerializedType<T extends A_TYPES__Error_Serialized>(param: any): param is T;
4587
4664
  }
4588
4665
 
4589
- export { ASEID, ASEID_Error, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_CONSTANTS__ERROR_CODES, A_CONSTANTS__ERROR_DESCRIPTION, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_Concept, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_ContextError, A_Dependency, A_DependencyError, A_Dependency_Default, A_Dependency_Load, A_Dependency_Require, A_Entity, A_EntityError, A_EntityMeta, A_Error, A_Feature, A_FeatureError, A_Feature_Define, A_Feature_Extend, A_FormatterHelper, A_Fragment, type A_ID_TYPES__TimeId_Parts, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_Scope, A_ScopeError, A_Stage, A_StageError, A_StepManagerError, A_StepsManager, type A_TYPES_ScopeDependentComponents, type A_TYPES_ScopeIndependentComponents, type A_TYPES_StageExecutionBehavior, type A_TYPES__ASEID_Constructor, type A_TYPES__ASEID_ConstructorConfig, type A_TYPES__ASEID_JSON, type A_TYPES__A_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_FlatDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_ParentDecoratorReturn, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_EntityInjectionInstructions, type A_TYPES__A_InjectDecorator_EntityInjectionPagination, type A_TYPES__A_InjectDecorator_EntityInjectionQuery, type A_TYPES__A_InjectDecorator_Meta, type A_TYPES__A_StageStep, type A_TYPES__A_StageStepProcessingExtraParams, A_TYPES__A_Stage_Status, type A_TYPES__AbstractionAvailableComponents, type A_TYPES__AbstractionDecoratorConfig, type A_TYPES__AbstractionDecoratorDescriptor, type A_TYPES__Abstraction_Constructor, type A_TYPES__Abstraction_Init, type A_TYPES__Abstraction_Serialized, type A_TYPES__CallerComponent, type A_TYPES__Caller_Constructor, type A_TYPES__Caller_Init, type A_TYPES__Caller_Serialized, type A_TYPES__ComponentMeta, type A_TYPES__ComponentMetaExtension, A_TYPES__ComponentMetaKey, type A_TYPES__Component_Constructor, type A_TYPES__Component_Init, type A_TYPES__Component_Serialized, type A_TYPES__ConceptAbstraction, type A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptAbstractions, type A_TYPES__ConceptENVVariables, A_TYPES__ConceptMetaKey, type A_TYPES__Concept_Constructor, type A_TYPES__Concept_Init, type A_TYPES__Concept_Serialized, type A_TYPES__ContainerMeta, type A_TYPES__ContainerMetaExtension, A_TYPES__ContainerMetaKey, type A_TYPES__Container_Constructor, type A_TYPES__Container_Init, type A_TYPES__Container_Serialized, type A_TYPES__ContextEnvironment, type A_TYPES__DeepPartial, type A_TYPES__Dictionary, A_TYPES__EntityFeatures, type A_TYPES__EntityMeta, A_TYPES__EntityMetaKey, type A_TYPES__Entity_Constructor, type A_TYPES__Entity_Init, type A_TYPES__Entity_Serialized, type A_TYPES__Error_Constructor, type A_TYPES__Error_Init, type A_TYPES__Error_Serialized, type A_TYPES__ExtractNested, type A_TYPES__ExtractProperties, type A_TYPES__FeatureAvailableComponents, type A_TYPES__FeatureAvailableConstructors, type A_TYPES__FeatureDefineDecoratorConfig, type A_TYPES__FeatureDefineDecoratorDescriptor, type A_TYPES__FeatureDefineDecoratorMeta, type A_TYPES__FeatureDefineDecoratorTarget, type A_TYPES__FeatureDefineDecoratorTemplateItem, type A_TYPES__FeatureError_Init, type A_TYPES__FeatureExtendDecoratorConfig, type A_TYPES__FeatureExtendDecoratorDescriptor, type A_TYPES__FeatureExtendDecoratorMeta, type A_TYPES__FeatureExtendDecoratorScopeConfig, type A_TYPES__FeatureExtendDecoratorScopeItem, type A_TYPES__FeatureExtendDecoratorTarget, type A_TYPES__FeatureExtendableMeta, A_TYPES__FeatureState, type A_TYPES__Feature_Constructor, type A_TYPES__Feature_Init, type A_TYPES__Feature_InitWithComponent, type A_TYPES__Feature_InitWithTemplate, type A_TYPES__Feature_Serialized, type A_TYPES__Fragment_Constructor, type A_TYPES__Fragment_Init, type A_TYPES__Fragment_Serialized, type A_TYPES__IEntity, type A_TYPES__InjectableConstructors, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, type A_TYPES__NonObjectPaths, type A_TYPES__ObjectKeyEnum, type A_TYPES__Paths, type A_TYPES__PathsToObject, type A_TYPES__Required, type A_TYPES__ScopeConfig, type A_TYPES__ScopeLinkedComponents, type A_TYPES__ScopeLinkedConstructors, type A_TYPES__ScopeResolvableComponents, type A_TYPES__Scope_Constructor, type A_TYPES__Scope_Init, type A_TYPES__Scope_Serialized, type A_TYPES__Stage_Serialized, type A_TYPES__UnionToIntersection, A_TypeGuards };
4666
+ export { ASEID, ASEID_Error, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_CONSTANTS__ERROR_CODES, A_CONSTANTS__ERROR_DESCRIPTION, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_Concept, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_ContextError, A_Dependency, A_DependencyError, A_Dependency_Default, A_Dependency_Load, A_Dependency_Require, A_Entity, A_EntityError, A_EntityMeta, A_Error, A_Feature, A_FeatureError, A_Feature_Define, A_Feature_Extend, A_FormatterHelper, A_Fragment, type A_ID_TYPES__TimeId_Parts, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_MetaDecorator, A_Scope, A_ScopeError, A_Stage, A_StageError, A_StepManagerError, A_StepsManager, type A_TYPES_ScopeDependentComponents, type A_TYPES_ScopeIndependentComponents, type A_TYPES_StageExecutionBehavior, type A_TYPES__ASEID_Constructor, type A_TYPES__ASEID_ConstructorConfig, type A_TYPES__ASEID_JSON, type A_TYPES__A_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_FlatDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_ParentDecoratorReturn, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_EntityInjectionInstructions, type A_TYPES__A_InjectDecorator_EntityInjectionPagination, type A_TYPES__A_InjectDecorator_EntityInjectionQuery, type A_TYPES__A_InjectDecorator_Meta, type A_TYPES__A_StageStep, type A_TYPES__A_StageStepProcessingExtraParams, A_TYPES__A_Stage_Status, type A_TYPES__AbstractionAvailableComponents, type A_TYPES__AbstractionDecoratorConfig, type A_TYPES__AbstractionDecoratorDescriptor, type A_TYPES__Abstraction_Constructor, type A_TYPES__Abstraction_Init, type A_TYPES__Abstraction_Serialized, type A_TYPES__CallerComponent, type A_TYPES__Caller_Constructor, type A_TYPES__Caller_Init, type A_TYPES__Caller_Serialized, type A_TYPES__ComponentMeta, type A_TYPES__ComponentMetaExtension, A_TYPES__ComponentMetaKey, type A_TYPES__Component_Constructor, type A_TYPES__Component_Init, type A_TYPES__Component_Serialized, type A_TYPES__ConceptAbstraction, type A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptAbstractions, type A_TYPES__ConceptENVVariables, A_TYPES__ConceptMetaKey, type A_TYPES__Concept_Constructor, type A_TYPES__Concept_Init, type A_TYPES__Concept_Serialized, type A_TYPES__ContainerMeta, type A_TYPES__ContainerMetaExtension, A_TYPES__ContainerMetaKey, type A_TYPES__Container_Constructor, type A_TYPES__Container_Init, type A_TYPES__Container_Serialized, type A_TYPES__ContextEnvironment, type A_TYPES__DeepPartial, type A_TYPES__Dictionary, A_TYPES__EntityFeatures, type A_TYPES__EntityMeta, A_TYPES__EntityMetaKey, type A_TYPES__Entity_Constructor, type A_TYPES__Entity_Init, type A_TYPES__Entity_Serialized, type A_TYPES__Error_Constructor, type A_TYPES__Error_Init, type A_TYPES__Error_Serialized, type A_TYPES__ExtractNested, type A_TYPES__ExtractProperties, type A_TYPES__FeatureAvailableComponents, type A_TYPES__FeatureAvailableConstructors, type A_TYPES__FeatureDefineDecoratorConfig, type A_TYPES__FeatureDefineDecoratorDescriptor, type A_TYPES__FeatureDefineDecoratorMeta, type A_TYPES__FeatureDefineDecoratorTarget, type A_TYPES__FeatureDefineDecoratorTemplateItem, type A_TYPES__FeatureError_Init, type A_TYPES__FeatureExtendDecoratorConfig, type A_TYPES__FeatureExtendDecoratorDescriptor, type A_TYPES__FeatureExtendDecoratorMeta, type A_TYPES__FeatureExtendDecoratorScopeConfig, type A_TYPES__FeatureExtendDecoratorScopeItem, type A_TYPES__FeatureExtendDecoratorTarget, type A_TYPES__FeatureExtendableMeta, A_TYPES__FeatureState, type A_TYPES__Feature_Constructor, type A_TYPES__Feature_Init, type A_TYPES__Feature_InitWithComponent, type A_TYPES__Feature_InitWithTemplate, type A_TYPES__Feature_Serialized, type A_TYPES__Fragment_Constructor, type A_TYPES__Fragment_Init, type A_TYPES__Fragment_Serialized, type A_TYPES__IEntity, type A_TYPES__InjectableConstructors, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, type A_TYPES__Meta_Constructor, type A_TYPES__NonObjectPaths, type A_TYPES__ObjectKeyEnum, type A_TYPES__Paths, type A_TYPES__PathsToObject, type A_TYPES__Required, type A_TYPES__ScopeConfig, type A_TYPES__ScopeLinkedComponents, type A_TYPES__ScopeLinkedConstructors, type A_TYPES__ScopeResolvableComponents, type A_TYPES__Scope_Constructor, type A_TYPES__Scope_Init, type A_TYPES__Scope_Serialized, type A_TYPES__Stage_Serialized, type A_TYPES__UnionToIntersection, A_TypeGuards };