tscommons-esm-models 0.1.7 → 1.0.0
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/classes/first-class-cache.d.mts +2 -1
- package/dist/classes/first-class-cache.mjs +2 -2
- package/dist/classes/first-class-cache.mjs.map +1 -1
- package/dist/classes/generic-field-model-cache.d.mts +2 -1
- package/dist/classes/generic-field-model-cache.mjs +3 -3
- package/dist/classes/generic-field-model-cache.mjs.map +1 -1
- package/dist/classes/generic-second-class-field-model-cache.d.mts +3 -2
- package/dist/classes/generic-second-class-field-model-cache.mjs +4 -4
- package/dist/classes/generic-second-class-field-model-cache.mjs.map +1 -1
- package/dist/classes/second-class-cache.d.mts +2 -1
- package/dist/classes/second-class-cache.mjs +2 -2
- package/dist/classes/second-class-cache.mjs.map +1 -1
- package/dist/classes/uniquely-identified-cache.d.mts +4 -3
- package/dist/classes/uniquely-identified-cache.mjs +8 -8
- package/dist/classes/uniquely-identified-cache.mjs.map +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.mjs +11 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { CommonsFixedDuration } from 'tscommons-esm-core';
|
|
1
2
|
import { ICommonsFirstClass } from '../interfaces/icommons-first-class.mjs';
|
|
2
3
|
import { CommonsGenericFieldModelCache } from './generic-field-model-cache.mjs';
|
|
3
4
|
export declare class CommonsFirstClassCache<ModelI extends ICommonsFirstClass> extends CommonsGenericFieldModelCache<ModelI, number> {
|
|
4
|
-
constructor(getRemote: (id: number) => Promise<ModelI | undefined>, listRemoteIds?: () => Promise<number[]>, listRemotes?: () => Promise<ModelI[]>,
|
|
5
|
+
constructor(getRemote: (id: number) => Promise<ModelI | undefined>, listRemoteIds?: () => Promise<number[]>, listRemotes?: () => Promise<ModelI[]>, maxAge?: CommonsFixedDuration);
|
|
5
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommonsGenericFieldModelCache } from './generic-field-model-cache.mjs';
|
|
2
2
|
export class CommonsFirstClassCache extends CommonsGenericFieldModelCache {
|
|
3
|
-
constructor(getRemote, listRemoteIds, listRemotes,
|
|
4
|
-
super('id', getRemote, listRemoteIds, listRemotes,
|
|
3
|
+
constructor(getRemote, listRemoteIds, listRemotes, maxAge) {
|
|
4
|
+
super('id', getRemote, listRemoteIds, listRemotes, maxAge);
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=first-class-cache.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"first-class-cache.mjs","sourceRoot":"","sources":["../../src/classes/first-class-cache.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"first-class-cache.mjs","sourceRoot":"","sources":["../../src/classes/first-class-cache.mts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,MAAM,OAAO,sBAEX,SAAQ,6BAGT;IACA,YACE,SAAoD,EACpD,aAAuC,EACvC,WAAqC,EACrC,MAA6B;QAE9B,KAAK,CACH,IAAI,EACJ,SAAS,EACT,aAAa,EACb,WAAW,EACX,MAAM,CACP,CAAC;IACH,CAAC;CACD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommonsFixedDuration } from 'tscommons-esm-core';
|
|
1
2
|
import { ICommonsModel } from '../interfaces/icommons-model.mjs';
|
|
2
3
|
export declare abstract class CommonsGenericFieldModelCache<ModelI extends ICommonsModel, IdT> {
|
|
3
4
|
private idField;
|
|
@@ -6,7 +7,7 @@ export declare abstract class CommonsGenericFieldModelCache<ModelI extends IComm
|
|
|
6
7
|
private listRemotes?;
|
|
7
8
|
private getCache;
|
|
8
9
|
private listCache;
|
|
9
|
-
constructor(idField: string, getRemote: (id: IdT) => Promise<ModelI | undefined>, listRemoteIds?: (() => Promise<IdT[]>) | undefined, listRemotes?: (() => Promise<ModelI[]>) | undefined,
|
|
10
|
+
constructor(idField: string, getRemote: (id: IdT) => Promise<ModelI | undefined>, listRemoteIds?: (() => Promise<IdT[]>) | undefined, listRemotes?: (() => Promise<ModelI[]>) | undefined, maxAge?: CommonsFixedDuration);
|
|
10
11
|
get(id: IdT): Promise<ModelI | undefined>;
|
|
11
12
|
getFromCacheOnly(id: IdT): ModelI | undefined;
|
|
12
13
|
appendToCacheOnly(data: ModelI, resetListIfNew?: boolean): void;
|
|
@@ -6,7 +6,7 @@ export class CommonsGenericFieldModelCache {
|
|
|
6
6
|
listRemotes;
|
|
7
7
|
getCache;
|
|
8
8
|
listCache;
|
|
9
|
-
constructor(idField, getRemote, listRemoteIds, listRemotes,
|
|
9
|
+
constructor(idField, getRemote, listRemoteIds, listRemotes, maxAge) {
|
|
10
10
|
this.idField = idField;
|
|
11
11
|
this.getRemote = getRemote;
|
|
12
12
|
this.listRemoteIds = listRemoteIds;
|
|
@@ -16,10 +16,10 @@ export class CommonsGenericFieldModelCache {
|
|
|
16
16
|
// This cache is linked to the Model IDs, so generation of new ids is not applicable.
|
|
17
17
|
this.getCache = new CommonsCache(() => {
|
|
18
18
|
throw new Error('NA');
|
|
19
|
-
},
|
|
19
|
+
}, maxAge);
|
|
20
20
|
this.listCache = new CommonsCache(() => {
|
|
21
21
|
throw new Error('NA');
|
|
22
|
-
},
|
|
22
|
+
}, maxAge);
|
|
23
23
|
}
|
|
24
24
|
async get(id) {
|
|
25
25
|
const match = this.getCache.getById(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-field-model-cache.mjs","sourceRoot":"","sources":["../../src/classes/generic-field-model-cache.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"generic-field-model-cache.mjs","sourceRoot":"","sources":["../../src/classes/generic-field-model-cache.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAwB,MAAM,oBAAoB,CAAC;AAIxE,MAAM,OAAgB,6BAA6B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AC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,yCAAyC;IACzE,CAAC;CACD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommonsFixedDuration } from 'tscommons-esm-core';
|
|
1
2
|
import { ICommonsFirstClass } from '../interfaces/icommons-first-class.mjs';
|
|
2
3
|
import { ICommonsSecondClass } from '../interfaces/icommons-second-class.mjs';
|
|
3
4
|
export declare abstract class CommonsGenericSecondClassFieldModelCache<ModelI extends ICommonsSecondClass<FirstClassI>, FirstClassI extends ICommonsFirstClass, IdT> {
|
|
@@ -5,9 +6,9 @@ export declare abstract class CommonsGenericSecondClassFieldModelCache<ModelI ex
|
|
|
5
6
|
private getRemote;
|
|
6
7
|
private listRemoteIds?;
|
|
7
8
|
private listRemotes?;
|
|
8
|
-
private
|
|
9
|
+
private maxAge?;
|
|
9
10
|
private caches;
|
|
10
|
-
constructor(idField: string, getRemote: (firstClass: FirstClassI, id: IdT) => Promise<ModelI | undefined>, listRemoteIds?: ((firstClass: FirstClassI) => Promise<IdT[]>) | undefined, listRemotes?: ((firstClass: FirstClassI) => Promise<ModelI[]>) | undefined,
|
|
11
|
+
constructor(idField: string, getRemote: (firstClass: FirstClassI, id: IdT) => Promise<ModelI | undefined>, listRemoteIds?: ((firstClass: FirstClassI) => Promise<IdT[]>) | undefined, listRemotes?: ((firstClass: FirstClassI) => Promise<ModelI[]>) | undefined, maxAge?: CommonsFixedDuration | undefined);
|
|
11
12
|
private ensureCacheForFirstClass;
|
|
12
13
|
get(firstClass: FirstClassI, id: IdT): Promise<ModelI | undefined>;
|
|
13
14
|
getFromCacheOnly(firstClass: FirstClassI, id: IdT): ModelI | undefined;
|
|
@@ -11,14 +11,14 @@ export class CommonsGenericSecondClassFieldModelCache {
|
|
|
11
11
|
getRemote;
|
|
12
12
|
listRemoteIds;
|
|
13
13
|
listRemotes;
|
|
14
|
-
|
|
14
|
+
maxAge;
|
|
15
15
|
caches;
|
|
16
|
-
constructor(idField, getRemote, listRemoteIds, listRemotes,
|
|
16
|
+
constructor(idField, getRemote, listRemoteIds, listRemotes, maxAge) {
|
|
17
17
|
this.idField = idField;
|
|
18
18
|
this.getRemote = getRemote;
|
|
19
19
|
this.listRemoteIds = listRemoteIds;
|
|
20
20
|
this.listRemotes = listRemotes;
|
|
21
|
-
this.
|
|
21
|
+
this.maxAge = maxAge;
|
|
22
22
|
if (!this.listRemoteIds && !this.listRemotes)
|
|
23
23
|
throw new Error('Either listRemoteIds or listRemotes must be specified');
|
|
24
24
|
this.caches = new Map();
|
|
@@ -31,7 +31,7 @@ export class CommonsGenericSecondClassFieldModelCache {
|
|
|
31
31
|
this.caches.set(firstClass.id, {
|
|
32
32
|
cache: new CommonsCache(() => {
|
|
33
33
|
throw new Error('NA');
|
|
34
|
-
}, this.
|
|
34
|
+
}, this.maxAge),
|
|
35
35
|
ids: [],
|
|
36
36
|
populated: EPopulated.NO
|
|
37
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-second-class-field-model-cache.mjs","sourceRoot":"","sources":["../../src/classes/generic-second-class-field-model-cache.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"generic-second-class-field-model-cache.mjs","sourceRoot":"","sources":["../../src/classes/generic-second-class-field-model-cache.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAwB,MAAM,oBAAoB,CAAC;AAKxE,IAAK,UAIJ;AAJD,WAAK,UAAU;IACb,uBAAS,CAAA;IACT,iCAAmB,CAAA;IACnB,2BAAa,CAAA;AACf,CAAC,EAJI,UAAU,KAAV,UAAU,QAId;AAQD,uIAAuI;AAEvI,MAAM,OAAgB,wCAAwC;IAQnD;IACA;IACA;IACA;IACA;IAPF,MAAM,CAAmC;IAEjD,YACU,OAAe,EACf,SAA0E,EAC1E,aAA2D,EAC3D,WAA4D,EAC5D,MAA6B;QAJ7B,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,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,OAAO;QACb,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { CommonsFixedDuration } from 'tscommons-esm-core';
|
|
1
2
|
import { ICommonsFirstClass } from '../interfaces/icommons-first-class.mjs';
|
|
2
3
|
import { ICommonsSecondClass } from '../interfaces/icommons-second-class.mjs';
|
|
3
4
|
import { CommonsGenericSecondClassFieldModelCache } from './generic-second-class-field-model-cache.mjs';
|
|
4
5
|
export declare class CommonsSecondClassCache<ModelI extends ICommonsSecondClass<FirstClassI>, FirstClassI extends ICommonsFirstClass> extends CommonsGenericSecondClassFieldModelCache<ModelI, FirstClassI, number> {
|
|
5
|
-
constructor(getRemote: (firstClass: FirstClassI, id: number) => Promise<ModelI | undefined>, listRemoteIds?: (firstClass: FirstClassI) => Promise<number[]>, listRemotes?: (firstClass: FirstClassI) => Promise<ModelI[]>,
|
|
6
|
+
constructor(getRemote: (firstClass: FirstClassI, id: number) => Promise<ModelI | undefined>, listRemoteIds?: (firstClass: FirstClassI) => Promise<number[]>, listRemotes?: (firstClass: FirstClassI) => Promise<ModelI[]>, maxAge?: CommonsFixedDuration);
|
|
6
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommonsGenericSecondClassFieldModelCache } from './generic-second-class-field-model-cache.mjs';
|
|
2
2
|
export class CommonsSecondClassCache extends CommonsGenericSecondClassFieldModelCache {
|
|
3
|
-
constructor(getRemote, listRemoteIds, listRemotes,
|
|
4
|
-
super('id', getRemote, listRemoteIds, listRemotes,
|
|
3
|
+
constructor(getRemote, listRemoteIds, listRemotes, maxAge) {
|
|
4
|
+
super('id', getRemote, listRemoteIds, listRemotes, maxAge);
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=second-class-cache.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"second-class-cache.mjs","sourceRoot":"","sources":["../../src/classes/second-class-cache.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"second-class-cache.mjs","sourceRoot":"","sources":["../../src/classes/second-class-cache.mts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wCAAwC,EAAE,MAAM,8CAA8C,CAAC;AAExG,MAAM,OAAO,uBAGX,SAAQ,wCAIT;IACA,YACE,SAA6E,EAC7E,aAA8D,EAC9D,WAA4D,EAC5D,MAA6B;QAE9B,KAAK,CACH,IAAI,EACJ,SAAS,EACT,aAAa,EACb,WAAW,EACX,MAAM,CACP,CAAC;IACH,CAAC;CACD"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { CommonsFixedDuration } from 'tscommons-esm-core';
|
|
1
2
|
import { ICommonsUniquelyIdentified } from '../interfaces/icommons-uniquely-identified.mjs';
|
|
2
3
|
import { ICommonsFirstClass } from '../interfaces/icommons-first-class.mjs';
|
|
3
4
|
import { ICommonsSecondClass } from '../interfaces/icommons-second-class.mjs';
|
|
4
5
|
import { ICommonsModel } from '../interfaces/icommons-model.mjs';
|
|
5
6
|
import { CommonsGenericFieldModelCache } from './generic-field-model-cache.mjs';
|
|
6
7
|
export declare class CommonsUniquelyIdentifiedCache<ModelI extends ICommonsModel & ICommonsUniquelyIdentified> extends CommonsGenericFieldModelCache<ModelI, string> {
|
|
7
|
-
constructor(getRemote: (id: string) => Promise<ModelI | undefined>,
|
|
8
|
+
constructor(getRemote: (id: string) => Promise<ModelI | undefined>, maxAge?: CommonsFixedDuration);
|
|
8
9
|
}
|
|
9
10
|
export declare class CommonsUniquelyIdentifiedFirstClassCache<ModelI extends ICommonsFirstClass & ICommonsUniquelyIdentified> {
|
|
10
11
|
private idCache;
|
|
11
12
|
private uidCache;
|
|
12
|
-
constructor(getRemoteById: (id: number) => Promise<ModelI | undefined>, getRemoteByUid: (uid: string) => Promise<ModelI | undefined>, listRemoteIds?: () => Promise<number[]>, listRemotes?: () => Promise<ModelI[]>,
|
|
13
|
+
constructor(getRemoteById: (id: number) => Promise<ModelI | undefined>, getRemoteByUid: (uid: string) => Promise<ModelI | undefined>, listRemoteIds?: () => Promise<number[]>, listRemotes?: () => Promise<ModelI[]>, maxAge?: CommonsFixedDuration);
|
|
13
14
|
getById(id: number): Promise<ModelI | undefined>;
|
|
14
15
|
getByUid(uid: string): Promise<ModelI | undefined>;
|
|
15
16
|
getFromCacheOnlyById(id: number): ModelI | undefined;
|
|
@@ -23,7 +24,7 @@ export declare class CommonsUniquelyIdentifiedFirstClassCache<ModelI extends ICo
|
|
|
23
24
|
export declare class CommonsUniquelyIdentifiedSecondClassCache<ModelI extends ICommonsSecondClass<FirstClassI> & ICommonsUniquelyIdentified, FirstClassI extends ICommonsFirstClass> {
|
|
24
25
|
private idCache;
|
|
25
26
|
private uidCache;
|
|
26
|
-
constructor(getRemoteById: (firstClass: FirstClassI, id: number) => Promise<ModelI | undefined>, getRemoteByUid: (uid: string) => Promise<ModelI | undefined>, listRemoteIds?: (firstClass: FirstClassI) => Promise<number[]>, listRemotes?: (firstClass: FirstClassI) => Promise<ModelI[]>,
|
|
27
|
+
constructor(getRemoteById: (firstClass: FirstClassI, id: number) => Promise<ModelI | undefined>, getRemoteByUid: (uid: string) => Promise<ModelI | undefined>, listRemoteIds?: (firstClass: FirstClassI) => Promise<number[]>, listRemotes?: (firstClass: FirstClassI) => Promise<ModelI[]>, maxAge?: CommonsFixedDuration);
|
|
27
28
|
getById(firstClass: FirstClassI, id: number): Promise<ModelI | undefined>;
|
|
28
29
|
getByUid(uid: string): Promise<ModelI | undefined>;
|
|
29
30
|
getFromCacheOnlyById(firstClass: FirstClassI, id: number): ModelI | undefined;
|
|
@@ -2,20 +2,20 @@ import { CommonsFirstClassCache } from './first-class-cache.mjs';
|
|
|
2
2
|
import { CommonsSecondClassCache } from './second-class-cache.mjs';
|
|
3
3
|
import { CommonsGenericFieldModelCache } from './generic-field-model-cache.mjs';
|
|
4
4
|
export class CommonsUniquelyIdentifiedCache extends CommonsGenericFieldModelCache {
|
|
5
|
-
constructor(getRemote,
|
|
5
|
+
constructor(getRemote, maxAge) {
|
|
6
6
|
super('id', getRemote, () => {
|
|
7
7
|
throw new Error('listRemoteIds is not applicable for CommonsUniquelyIdentifiedCache');
|
|
8
8
|
}, () => {
|
|
9
9
|
throw new Error('listRemotes is not applicable for CommonsUniquelyIdentifiedCache');
|
|
10
|
-
},
|
|
10
|
+
}, maxAge);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
export class CommonsUniquelyIdentifiedFirstClassCache {
|
|
14
14
|
idCache;
|
|
15
15
|
uidCache;
|
|
16
|
-
constructor(getRemoteById, getRemoteByUid, listRemoteIds, listRemotes,
|
|
17
|
-
this.idCache = new CommonsFirstClassCache(getRemoteById, listRemoteIds, listRemotes,
|
|
18
|
-
this.uidCache = new CommonsUniquelyIdentifiedCache(getRemoteByUid,
|
|
16
|
+
constructor(getRemoteById, getRemoteByUid, listRemoteIds, listRemotes, maxAge) {
|
|
17
|
+
this.idCache = new CommonsFirstClassCache(getRemoteById, listRemoteIds, listRemotes, maxAge);
|
|
18
|
+
this.uidCache = new CommonsUniquelyIdentifiedCache(getRemoteByUid, maxAge);
|
|
19
19
|
}
|
|
20
20
|
async getById(id) {
|
|
21
21
|
const item = await this.idCache.get(id);
|
|
@@ -77,9 +77,9 @@ export class CommonsUniquelyIdentifiedFirstClassCache {
|
|
|
77
77
|
export class CommonsUniquelyIdentifiedSecondClassCache {
|
|
78
78
|
idCache;
|
|
79
79
|
uidCache;
|
|
80
|
-
constructor(getRemoteById, getRemoteByUid, listRemoteIds, listRemotes,
|
|
81
|
-
this.idCache = new CommonsSecondClassCache(getRemoteById, listRemoteIds, listRemotes,
|
|
82
|
-
this.uidCache = new CommonsUniquelyIdentifiedCache(getRemoteByUid,
|
|
80
|
+
constructor(getRemoteById, getRemoteByUid, listRemoteIds, listRemotes, maxAge) {
|
|
81
|
+
this.idCache = new CommonsSecondClassCache(getRemoteById, listRemoteIds, listRemotes, maxAge);
|
|
82
|
+
this.uidCache = new CommonsUniquelyIdentifiedCache(getRemoteByUid, maxAge);
|
|
83
83
|
}
|
|
84
84
|
async getById(firstClass, id) {
|
|
85
85
|
const item = await this.idCache.get(firstClass, id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniquely-identified-cache.mjs","sourceRoot":"","sources":["../../src/classes/uniquely-identified-cache.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uniquely-identified-cache.mjs","sourceRoot":"","sources":["../../src/classes/uniquely-identified-cache.mts"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,MAAM,OAAO,8BAEX,SAAQ,6BAGT;IACA,YACE,SAAoD,EACpD,MAA6B;QAE9B,KAAK,CACH,IAAI,EACJ,SAAS,EACT,GAAsB,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;QACvF,CAAC,EACD,GAAsB,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACrF,CAAC,EACD,MAAM,CACP,CAAC;IACH,CAAC;CACD;AAED,MAAM,OAAO,wCAAwC;IAG5C,OAAO,CAAiC;IACxC,QAAQ,CAAyC;IAEzD,YACE,aAAwD,EACxD,cAA0D,EAC1D,aAAuC,EACvC,WAAqC,EACrC,MAA6B;QAE9B,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAsB,CACvC,aAAa,EACb,aAAa,EACb,WAAW,EACX,MAAM,CACP,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,8BAA8B,CAChD,cAAc,EACd,MAAM,CACP,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,EAAU;QAC9B,MAAM,IAAI,GAAqB,MAAM,IAAI,CAAC,OAAO,CA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@@
|
|
|
1
|
-
import { ECommonsMoveDirection, toECommonsMoveDirection, fromECommonsMoveDirection, isECommonsMoveDirection, keyToECommonsMoveDirection, ECOMMONS_MOVE_DIRECTIONS } from './enums/ecommons-move-direction.mjs';
|
|
2
|
-
import { CommonsUniquelyIdentifiedCache, CommonsUniquelyIdentifiedFirstClassCache, CommonsUniquelyIdentifiedSecondClassCache } from './classes/uniquely-identified-cache.mjs';
|
|
3
1
|
import { CommonsGenericSecondClassFieldModelCache } from './classes/generic-second-class-field-model-cache.mjs';
|
|
2
|
+
import { CommonsSecondClassCache } from './classes/second-class-cache.mjs';
|
|
4
3
|
import { CommonsGenericFieldModelCache } from './classes/generic-field-model-cache.mjs';
|
|
4
|
+
import { CommonsUniquelyIdentifiedCache, CommonsUniquelyIdentifiedFirstClassCache, CommonsUniquelyIdentifiedSecondClassCache } from './classes/uniquely-identified-cache.mjs';
|
|
5
5
|
import { CommonsFirstClassCache } from './classes/first-class-cache.mjs';
|
|
6
|
-
import {
|
|
7
|
-
import { ICommonsOrientatedOrdered, isICommonsOrientatedOrdered } from './interfaces/icommons-orientated-ordered.mjs';
|
|
8
|
-
import { ICommonsMultiSecondClass, isICommonsMultiSecondClass } from './interfaces/icommons-multi-second-class.mjs';
|
|
9
|
-
import { ICommonsM2MLink, isICommonsM2MLink } from './interfaces/icommons-m2m-link.mjs';
|
|
10
|
-
import { ICommonsOrdered, isICommonsOrdered } from './interfaces/icommons-ordered.mjs';
|
|
11
|
-
import { ICommonsUniquelyIdentified, isICommonsUniquelyIdentified, ICommonsUniquelyIdentifiedBase62, isICommonsUniquelyIdentifiedBase62, ICommonsUniquelyIdentifiedBase62Long, isICommonsUniquelyIdentifiedBase62Long } from './interfaces/icommons-uniquely-identified.mjs';
|
|
6
|
+
import { ECommonsMoveDirection, toECommonsMoveDirection, fromECommonsMoveDirection, isECommonsMoveDirection, keyToECommonsMoveDirection, ECOMMONS_MOVE_DIRECTIONS } from './enums/ecommons-move-direction.mjs';
|
|
12
7
|
import { ICommonsFirstClass, isICommonsFirstClass } from './interfaces/icommons-first-class.mjs';
|
|
13
|
-
import {
|
|
14
|
-
import { ICommonsTree, isICommonsTree } from './interfaces/icommons-tree.mjs';
|
|
8
|
+
import { ICommonsUniquelyIdentified, isICommonsUniquelyIdentified, ICommonsUniquelyIdentifiedBase62, isICommonsUniquelyIdentifiedBase62, ICommonsUniquelyIdentifiedBase62Long, isICommonsUniquelyIdentifiedBase62Long } from './interfaces/icommons-uniquely-identified.mjs';
|
|
15
9
|
import { ICommonsSecondClass, isICommonsSecondClass } from './interfaces/icommons-second-class.mjs';
|
|
10
|
+
import { ICommonsMultiSecondClass, isICommonsMultiSecondClass } from './interfaces/icommons-multi-second-class.mjs';
|
|
16
11
|
import { ICommonsModel, isICommonsModel } from './interfaces/icommons-model.mjs';
|
|
12
|
+
import { ICommonsM2MLink, isICommonsM2MLink } from './interfaces/icommons-m2m-link.mjs';
|
|
13
|
+
import { ICommonsOrientatedOrdered, isICommonsOrientatedOrdered } from './interfaces/icommons-orientated-ordered.mjs';
|
|
14
|
+
import { ICommonsHierarchy, isICommonsHierarchy } from './interfaces/icommons-hierarchy.mjs';
|
|
17
15
|
import { ICommonsOrderable } from './interfaces/icommons-orderable.mjs';
|
|
18
16
|
import { ICommonsRelation, isICommonsRelation } from './interfaces/icommons-relation.mjs';
|
|
19
|
-
|
|
17
|
+
import { ICommonsTree, isICommonsTree } from './interfaces/icommons-tree.mjs';
|
|
18
|
+
import { ICommonsOrdered, isICommonsOrdered } from './interfaces/icommons-ordered.mjs';
|
|
19
|
+
export { CommonsGenericSecondClassFieldModelCache, CommonsSecondClassCache, CommonsGenericFieldModelCache, CommonsUniquelyIdentifiedCache, CommonsUniquelyIdentifiedFirstClassCache, CommonsUniquelyIdentifiedSecondClassCache, CommonsFirstClassCache, ECommonsMoveDirection, toECommonsMoveDirection, fromECommonsMoveDirection, isECommonsMoveDirection, keyToECommonsMoveDirection, ECOMMONS_MOVE_DIRECTIONS, ICommonsFirstClass, isICommonsFirstClass, ICommonsUniquelyIdentified, isICommonsUniquelyIdentified, ICommonsUniquelyIdentifiedBase62, isICommonsUniquelyIdentifiedBase62, ICommonsUniquelyIdentifiedBase62Long, isICommonsUniquelyIdentifiedBase62Long, ICommonsSecondClass, isICommonsSecondClass, ICommonsMultiSecondClass, isICommonsMultiSecondClass, ICommonsModel, isICommonsModel, ICommonsM2MLink, isICommonsM2MLink, ICommonsOrientatedOrdered, isICommonsOrientatedOrdered, ICommonsHierarchy, isICommonsHierarchy, ICommonsOrderable, ICommonsRelation, isICommonsRelation, ICommonsTree, isICommonsTree, ICommonsOrdered, isICommonsOrdered };
|
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ECommonsMoveDirection, toECommonsMoveDirection, fromECommonsMoveDirection, isECommonsMoveDirection, keyToECommonsMoveDirection, ECOMMONS_MOVE_DIRECTIONS } from './enums/ecommons-move-direction.mjs';
|
|
2
|
-
import { CommonsUniquelyIdentifiedCache, CommonsUniquelyIdentifiedFirstClassCache, CommonsUniquelyIdentifiedSecondClassCache } from './classes/uniquely-identified-cache.mjs';
|
|
3
1
|
import { CommonsGenericSecondClassFieldModelCache } from './classes/generic-second-class-field-model-cache.mjs';
|
|
2
|
+
import { CommonsSecondClassCache } from './classes/second-class-cache.mjs';
|
|
4
3
|
import { CommonsGenericFieldModelCache } from './classes/generic-field-model-cache.mjs';
|
|
4
|
+
import { CommonsUniquelyIdentifiedCache, CommonsUniquelyIdentifiedFirstClassCache, CommonsUniquelyIdentifiedSecondClassCache } from './classes/uniquely-identified-cache.mjs';
|
|
5
5
|
import { CommonsFirstClassCache } from './classes/first-class-cache.mjs';
|
|
6
|
-
import {
|
|
7
|
-
import { isICommonsOrientatedOrdered } from './interfaces/icommons-orientated-ordered.mjs';
|
|
8
|
-
import { isICommonsMultiSecondClass } from './interfaces/icommons-multi-second-class.mjs';
|
|
9
|
-
import { isICommonsM2MLink } from './interfaces/icommons-m2m-link.mjs';
|
|
10
|
-
import { isICommonsOrdered } from './interfaces/icommons-ordered.mjs';
|
|
11
|
-
import { isICommonsUniquelyIdentified, isICommonsUniquelyIdentifiedBase62, isICommonsUniquelyIdentifiedBase62Long } from './interfaces/icommons-uniquely-identified.mjs';
|
|
6
|
+
import { ECommonsMoveDirection, toECommonsMoveDirection, fromECommonsMoveDirection, isECommonsMoveDirection, keyToECommonsMoveDirection, ECOMMONS_MOVE_DIRECTIONS } from './enums/ecommons-move-direction.mjs';
|
|
12
7
|
import { isICommonsFirstClass } from './interfaces/icommons-first-class.mjs';
|
|
13
|
-
import {
|
|
14
|
-
import { isICommonsTree } from './interfaces/icommons-tree.mjs';
|
|
8
|
+
import { isICommonsUniquelyIdentified, isICommonsUniquelyIdentifiedBase62, isICommonsUniquelyIdentifiedBase62Long } from './interfaces/icommons-uniquely-identified.mjs';
|
|
15
9
|
import { isICommonsSecondClass } from './interfaces/icommons-second-class.mjs';
|
|
10
|
+
import { isICommonsMultiSecondClass } from './interfaces/icommons-multi-second-class.mjs';
|
|
16
11
|
import { isICommonsModel } from './interfaces/icommons-model.mjs';
|
|
12
|
+
import { isICommonsM2MLink } from './interfaces/icommons-m2m-link.mjs';
|
|
13
|
+
import { isICommonsOrientatedOrdered } from './interfaces/icommons-orientated-ordered.mjs';
|
|
14
|
+
import { isICommonsHierarchy } from './interfaces/icommons-hierarchy.mjs';
|
|
17
15
|
import { isICommonsRelation } from './interfaces/icommons-relation.mjs';
|
|
18
|
-
|
|
16
|
+
import { isICommonsTree } from './interfaces/icommons-tree.mjs';
|
|
17
|
+
import { isICommonsOrdered } from './interfaces/icommons-ordered.mjs';
|
|
18
|
+
export { CommonsGenericSecondClassFieldModelCache, CommonsSecondClassCache, CommonsGenericFieldModelCache, CommonsUniquelyIdentifiedCache, CommonsUniquelyIdentifiedFirstClassCache, CommonsUniquelyIdentifiedSecondClassCache, CommonsFirstClassCache, ECommonsMoveDirection, toECommonsMoveDirection, fromECommonsMoveDirection, isECommonsMoveDirection, keyToECommonsMoveDirection, ECOMMONS_MOVE_DIRECTIONS, isICommonsFirstClass, isICommonsUniquelyIdentified, isICommonsUniquelyIdentifiedBase62, isICommonsUniquelyIdentifiedBase62Long, isICommonsSecondClass, isICommonsMultiSecondClass, isICommonsModel, isICommonsM2MLink, isICommonsOrientatedOrdered, isICommonsHierarchy, isICommonsRelation, isICommonsTree, isICommonsOrdered };
|
|
19
19
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,sDAAsD,CAAC;AAChH,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,wCAAwC,EAAE,yCAAyC,EAAE,MAAM,yCAAyC,CAAC;AAC9K,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAsB,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AACjG,OAAO,EAEL,4BAA4B,EAE5B,kCAAkC,EAElC,sCAAsC,EACvC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAuB,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAA4B,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AACpH,OAAO,EAAiB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAmB,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAA6B,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AACtH,OAAO,EAAqB,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE7F,OAAO,EAAoB,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EAAgB,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAmB,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EACN,wCAAwC,EACxC,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,wCAAwC,EACxC,yCAAyC,EACzC,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EAExB,oBAAoB,EAEpB,4BAA4B,EAE5B,kCAAkC,EAElC,sCAAsC,EAEtC,qBAAqB,EAErB,0BAA0B,EAE1B,eAAe,EAEf,iBAAiB,EAEjB,2BAA2B,EAE3B,mBAAmB,EAGnB,kBAAkB,EAElB,cAAc,EAEd,iBAAiB,EACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tscommons-esm-models",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"tsc": "./node_modules/typescript/bin/tsc",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"dist/**/*"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"tscommons-esm-core": "^0.
|
|
28
|
+
"tscommons-esm-core": "^0.6.0"
|
|
29
29
|
}
|
|
30
30
|
}
|