@adaas/a-concept 0.1.51 → 0.1.52
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.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/global/A-Entity/A-Entity.class.ts +21 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaas/a-concept",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.52",
|
|
4
4
|
"description": "A-Concept is a framework to build new Applications within or outside the ADAAS ecosystem. This framework is designed to be modular structure regardless environment and program goal.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -10,6 +10,7 @@ import { ASEID } from "../ASEID/ASEID.class";
|
|
|
10
10
|
import { A_IdentityHelper } from "@adaas/a-concept/helpers/A_Identity.helper";
|
|
11
11
|
import { A_EntityError } from "./A-Entity.error";
|
|
12
12
|
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
13
|
+
import { A_TYPES__ASEID_Constructor } from "../ASEID/ASEID.types";
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -239,6 +240,23 @@ export class A_Entity<
|
|
|
239
240
|
throw new A_EntityError(A_EntityError.ValidationError, 'Unable to determine A-Entity constructor initialization method. Please check the provided parameters.');
|
|
240
241
|
}
|
|
241
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Generates a new ASEID for the entity.
|
|
245
|
+
* It uses class definitions for concept, scope, and entity,
|
|
246
|
+
* and allows overriding any of these values.
|
|
247
|
+
*
|
|
248
|
+
* @param override
|
|
249
|
+
* @returns
|
|
250
|
+
*/
|
|
251
|
+
protected generateASEID(override?: Partial<A_TYPES__ASEID_Constructor>): ASEID {
|
|
252
|
+
return new ASEID({
|
|
253
|
+
concept: override?.concept || (this.constructor as typeof A_Entity).concept,
|
|
254
|
+
scope: override?.scope || (this.constructor as typeof A_Entity).scope,
|
|
255
|
+
entity: override?.entity || (this.constructor as typeof A_Entity).entity,
|
|
256
|
+
id: override?.id || A_IdentityHelper.generateTimeId()
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
242
260
|
|
|
243
261
|
/**
|
|
244
262
|
* Call a feature of the component with the provided scope
|
|
@@ -318,12 +336,8 @@ export class A_Entity<
|
|
|
318
336
|
* @returns
|
|
319
337
|
*/
|
|
320
338
|
fromUndefined(): void {
|
|
321
|
-
this.aseid =
|
|
322
|
-
|
|
323
|
-
scope: (this.constructor as typeof A_Entity).scope,
|
|
324
|
-
entity: (this.constructor as typeof A_Entity).entity,
|
|
325
|
-
id: A_IdentityHelper.generateTimeId()
|
|
326
|
-
});
|
|
339
|
+
this.aseid = this.generateASEID();
|
|
340
|
+
|
|
327
341
|
return;
|
|
328
342
|
}
|
|
329
343
|
|
|
@@ -336,12 +350,7 @@ export class A_Entity<
|
|
|
336
350
|
* @returns
|
|
337
351
|
*/
|
|
338
352
|
fromNew(newEntity: _ConstructorType): void {
|
|
339
|
-
this.aseid =
|
|
340
|
-
concept: (this.constructor as typeof A_Entity).concept,
|
|
341
|
-
scope: (this.constructor as typeof A_Entity).scope,
|
|
342
|
-
entity: (this.constructor as typeof A_Entity).entity,
|
|
343
|
-
id: A_IdentityHelper.generateTimeId()
|
|
344
|
-
});
|
|
353
|
+
this.aseid = this.generateASEID();
|
|
345
354
|
|
|
346
355
|
return;
|
|
347
356
|
}
|