@adaas/a-concept 0.1.58 → 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/LICENSE +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +441 -351
- package/dist/index.d.ts +441 -351
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/global/A-Component/A-Component.meta.ts +1 -1
- package/src/global/A-Context/A-Context.class.ts +99 -19
- package/src/global/A-Error/A_Error.class.ts +8 -5
- package/src/global/A-Feature/A-Feature-Extend.decorator.ts +18 -3
- package/src/global/A-Meta/A-Meta.class.ts +16 -1
- package/src/global/A-Meta/A-Meta.decorator.ts +25 -0
- package/src/global/A-Meta/A-Meta.types.ts +14 -1
- package/src/global/A-Scope/A-Scope.class.ts +22 -4
- package/src/global/ASEID/ASEID.class.ts +8 -0
- package/src/helpers/A_Identity.helper.ts +18 -0
- package/src/index.ts +1 -0
- package/tests/A-Feature.test.ts +92 -0
- package/tests/A-Meta.test.ts +39 -0
- package/tests/ASEID.test.ts +35 -0
package/tests/ASEID.test.ts
CHANGED
|
@@ -22,6 +22,41 @@ describe('ASEID Tests', () => {
|
|
|
22
22
|
expect(aseid.version).toBe('v1');
|
|
23
23
|
expect(aseid.shard).toBe('shard1');
|
|
24
24
|
expect(aseid.toString()).toBe('my-concept@my-scope:my-entity:shard1.123@v1');
|
|
25
|
+
});
|
|
26
|
+
it('Should allow to create a new ASEID and use hash for identity', async () => {
|
|
27
|
+
const aseid1 = new ASEID({
|
|
28
|
+
concept: 'my-concept',
|
|
29
|
+
scope: 'my-scope',
|
|
30
|
+
entity: 'my-entity',
|
|
31
|
+
id: '123',
|
|
32
|
+
version: 'v1',
|
|
33
|
+
shard: 'shard1'
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const aseid2 = new ASEID({
|
|
37
|
+
concept: 'my-concept',
|
|
38
|
+
scope: 'my-scope',
|
|
39
|
+
entity: 'my-entity',
|
|
40
|
+
id: '123',
|
|
41
|
+
version: 'v1',
|
|
42
|
+
shard: 'shard1'
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const aseid3 = new ASEID({
|
|
46
|
+
concept: 'my-concept',
|
|
47
|
+
scope: 'my-scope',
|
|
48
|
+
entity: 'my-entity',
|
|
49
|
+
id: '124',
|
|
50
|
+
version: 'v1',
|
|
51
|
+
shard: 'shard1'
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
expect(aseid1.hash).toBeDefined();
|
|
55
|
+
expect(aseid2.hash).toBeDefined();
|
|
56
|
+
expect(aseid3.hash).toBeDefined();
|
|
57
|
+
|
|
58
|
+
expect(aseid1.hash).not.toBe(aseid3.hash);
|
|
59
|
+
expect(aseid1.hash).toBe(aseid2.hash);
|
|
25
60
|
});
|
|
26
61
|
it('Should allow to create a new ASEID object with required parameters only', async () => {
|
|
27
62
|
const aseid = new ASEID({
|