@rentman/rm-core 1.7.5 → 1.8.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/changelog.md +11 -0
- package/dist/rm-core.js +8479 -7672
- package/dist/rm-core.min.js +1 -1
- package/dist/src/classes/ApiFormatter.d.ts +39 -39
- package/dist/src/classes/ApiRequestService.d.ts +20 -20
- package/dist/src/classes/ApiResponseProcessor.d.ts +39 -39
- package/dist/src/classes/BatchStatus.d.ts +28 -28
- package/dist/src/classes/ChangesCompilation.d.ts +51 -51
- package/dist/src/classes/ChangesProcessor.d.ts +33 -33
- package/dist/src/classes/CollectionCache.d.ts +32 -34
- package/dist/src/classes/CollectionEntryService.d.ts +22 -23
- package/dist/src/classes/CollectionHandler.d.ts +54 -54
- package/dist/src/classes/CollectionMatcher.d.ts +42 -42
- package/dist/src/classes/CollectionResourceService.d.ts +6 -6
- package/dist/src/classes/ColumnCache.d.ts +21 -21
- package/dist/src/classes/ColumnExpansion.d.ts +18 -18
- package/dist/src/classes/ColumnHandler.d.ts +21 -21
- package/dist/src/classes/ColumnInfo.d.ts +14 -14
- package/dist/src/classes/ColumnSet.d.ts +39 -39
- package/dist/src/classes/ColumnSubsetCache.d.ts +8 -8
- package/dist/src/classes/ColumnUtil.d.ts +88 -89
- package/dist/src/classes/CreateRequest.d.ts +20 -20
- package/dist/src/classes/ItemAdministrator.d.ts +234 -238
- package/dist/src/classes/ItemCache.d.ts +23 -23
- package/dist/src/classes/ItemEntryService.d.ts +23 -24
- package/dist/src/classes/ItemHandler.d.ts +60 -60
- package/dist/src/classes/ItemRequestService.d.ts +23 -23
- package/dist/src/classes/KeyService.d.ts +16 -16
- package/dist/src/classes/LocalCache.d.ts +112 -97
- package/dist/src/classes/LocalCacheEventHandler.d.ts +19 -0
- package/dist/src/classes/LockService.d.ts +32 -32
- package/dist/src/classes/ModuleChangesCompilation.d.ts +21 -21
- package/dist/src/classes/QueryMatcher.d.ts +14 -14
- package/dist/src/classes/QueryParser.d.ts +34 -34
- package/dist/src/classes/QueryService.d.ts +14 -14
- package/dist/src/classes/RequestColumnExpansion.d.ts +14 -14
- package/dist/src/classes/SocketMessageHandler.d.ts +41 -41
- package/dist/src/classes/Util.d.ts +28 -28
- package/dist/src/classes/index.d.ts +35 -35
- package/dist/src/constants.d.ts +18 -18
- package/dist/src/core.d.ts +48 -48
- package/dist/src/factories/ApiResponseProcessorFactory.d.ts +6 -6
- package/dist/src/factories/BatchStatusFactory.d.ts +9 -9
- package/dist/src/factories/ChangesCompilationFactory.d.ts +10 -10
- package/dist/src/factories/CollectionCacheFactory.d.ts +7 -8
- package/dist/src/factories/CollectionEntryFactory.d.ts +23 -23
- package/dist/src/factories/CollectionMatcherFactory.d.ts +8 -8
- package/dist/src/factories/CollectionResourceFactory.d.ts +32 -33
- package/dist/src/factories/ColumnExpansionFactory.d.ts +8 -8
- package/dist/src/factories/ColumnInfoFactory.d.ts +7 -7
- package/dist/src/factories/ColumnSetFactory.d.ts +17 -17
- package/dist/src/factories/ColumnSubsetCacheFactory.d.ts +6 -6
- package/dist/src/factories/CreateRequestFactory.d.ts +11 -11
- package/dist/src/factories/ItemCacheFactory.d.ts +7 -7
- package/dist/src/factories/ItemEntryFactory.d.ts +21 -21
- package/dist/src/factories/ItemResourceFactory.d.ts +28 -29
- package/dist/src/factories/LocalCacheFactory.d.ts +16 -16
- package/dist/src/factories/ModuleChangesCompilationFactory.d.ts +6 -6
- package/dist/src/factories/QueryMatcherFactory.d.ts +7 -7
- package/dist/src/factories/QueryParserFactory.d.ts +6 -6
- package/dist/src/factories/RequestColumnExpansionFactory.d.ts +6 -6
- package/dist/src/factories/TemplateFactory.d.ts +10 -10
- package/dist/src/factories/index.d.ts +21 -21
- package/dist/src/index.d.ts +7 -7
- package/dist/src/interfaces/ApiRequestServiceInterface.d.ts +11 -11
- package/dist/src/interfaces/AuthInterface.d.ts +9 -9
- package/dist/src/interfaces/ErrorHandlerInterface.d.ts +5 -5
- package/dist/src/interfaces/ExceptionHandlerInterface.d.ts +3 -3
- package/dist/src/interfaces/LocalCacheManagerInterface.d.ts +5 -5
- package/dist/src/interfaces/PromiseLibraryInterface.d.ts +25 -25
- package/dist/src/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/src/interfaces/index.d.ts +7 -7
- package/dist/src/models/CollectionEditResource.d.ts +14 -14
- package/dist/src/models/CollectionEntry.d.ts +87 -82
- package/dist/src/models/CollectionEntryOptions.d.ts +12 -12
- package/dist/src/models/CollectionResource.d.ts +52 -41
- package/dist/src/models/CollectionResourceOptions.d.ts +22 -22
- package/dist/src/models/CollectionViewResource.d.ts +7 -7
- package/dist/src/models/EditResource.d.ts +18 -18
- package/dist/src/models/ItemEntry.d.ts +76 -70
- package/dist/src/models/ItemEntryOptions.d.ts +10 -11
- package/dist/src/models/ItemResource.d.ts +45 -27
- package/dist/src/models/ItemResourceOptions.d.ts +9 -9
- package/dist/src/models/LocalViewResource.d.ts +7 -7
- package/dist/src/models/RemoteViewResource.d.ts +7 -7
- package/dist/src/models/Template.d.ts +11 -11
- package/dist/src/models/ViewResource.d.ts +8 -8
- package/dist/src/models/index.d.ts +15 -15
- package/dist/src/types/ItemTypesCollection.d.ts +197 -213
- package/dist/src/types/PromiseInterface.d.ts +2 -2
- package/dist/src/types/index.d.ts +2 -2
- package/package.json +1 -1
- package/readme.md +15 -15
- package/dist/src/classes/ResourceCache.d.ts +0 -25
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface ExceptionHandlerInterface {
|
|
2
|
-
(exception: any): void;
|
|
3
|
-
}
|
|
1
|
+
export interface ExceptionHandlerInterface {
|
|
2
|
+
(exception: any): void;
|
|
3
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LocalCache } from '../classes';
|
|
2
|
-
export interface LocalCacheManagerInterface {
|
|
3
|
-
getCurrentLocalCache(userId: string): LocalCache;
|
|
4
|
-
getAllLocalCaches(): LocalCache[];
|
|
5
|
-
}
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
export interface LocalCacheManagerInterface {
|
|
3
|
+
getCurrentLocalCache(userId: string): LocalCache;
|
|
4
|
+
getAllLocalCaches(): LocalCache[];
|
|
5
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { PromiseInterface } from '../types';
|
|
2
|
-
export interface Deferred<T> {
|
|
3
|
-
resolve(value?: T | PromiseInterface<T>): void;
|
|
4
|
-
reject(reason?: any): void;
|
|
5
|
-
promise: PromiseInterface<T>;
|
|
6
|
-
}
|
|
7
|
-
export interface PromiseLibraryInterface {
|
|
8
|
-
all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>, T9 | PromiseInterface<T9>, T10 | PromiseInterface<T10>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
|
|
9
|
-
all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>, T9 | PromiseInterface<T9>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
|
|
10
|
-
all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8]>;
|
|
11
|
-
all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7]>;
|
|
12
|
-
all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>]): PromiseInterface<[T1, T2, T3, T4, T5, T6]>;
|
|
13
|
-
all<T1, T2, T3, T4, T5>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>]): PromiseInterface<[T1, T2, T3, T4, T5]>;
|
|
14
|
-
all<T1, T2, T3, T4>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>]): PromiseInterface<[T1, T2, T3, T4]>;
|
|
15
|
-
all<T1, T2, T3>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>]): PromiseInterface<[T1, T2, T3]>;
|
|
16
|
-
all<T1, T2>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>]): PromiseInterface<[T1, T2]>;
|
|
17
|
-
all<TAll>(promises: Array<TAll | PromiseInterface<TAll>>): PromiseInterface<TAll[]>;
|
|
18
|
-
all(iterable: Array<PromiseInterface<any> | any>): PromiseInterface<any[]>;
|
|
19
|
-
all<T>(promises: {
|
|
20
|
-
[K in keyof T]: (PromiseInterface<T[K]> | T[K] | null);
|
|
21
|
-
}): PromiseInterface<T>;
|
|
22
|
-
when<T>(value?: PromiseInterface<T> | T): PromiseInterface<T>;
|
|
23
|
-
reject(value?: any): PromiseInterface<any>;
|
|
24
|
-
defer<T>(): Deferred<T>;
|
|
25
|
-
}
|
|
1
|
+
import { PromiseInterface } from '../types';
|
|
2
|
+
export interface Deferred<T> {
|
|
3
|
+
resolve(value?: T | PromiseInterface<T>): void;
|
|
4
|
+
reject(reason?: any): void;
|
|
5
|
+
promise: PromiseInterface<T>;
|
|
6
|
+
}
|
|
7
|
+
export interface PromiseLibraryInterface {
|
|
8
|
+
all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>, T9 | PromiseInterface<T9>, T10 | PromiseInterface<T10>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
|
|
9
|
+
all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>, T9 | PromiseInterface<T9>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
|
|
10
|
+
all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>, T8 | PromiseInterface<T8>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7, T8]>;
|
|
11
|
+
all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>, T7 | PromiseInterface<T7>]): PromiseInterface<[T1, T2, T3, T4, T5, T6, T7]>;
|
|
12
|
+
all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>, T6 | PromiseInterface<T6>]): PromiseInterface<[T1, T2, T3, T4, T5, T6]>;
|
|
13
|
+
all<T1, T2, T3, T4, T5>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>, T5 | PromiseInterface<T5>]): PromiseInterface<[T1, T2, T3, T4, T5]>;
|
|
14
|
+
all<T1, T2, T3, T4>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>, T4 | PromiseInterface<T4>]): PromiseInterface<[T1, T2, T3, T4]>;
|
|
15
|
+
all<T1, T2, T3>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>, T3 | PromiseInterface<T3>]): PromiseInterface<[T1, T2, T3]>;
|
|
16
|
+
all<T1, T2>(values: [T1 | PromiseInterface<T1>, T2 | PromiseInterface<T2>]): PromiseInterface<[T1, T2]>;
|
|
17
|
+
all<TAll>(promises: Array<TAll | PromiseInterface<TAll>>): PromiseInterface<TAll[]>;
|
|
18
|
+
all(iterable: Array<PromiseInterface<any> | any>): PromiseInterface<any[]>;
|
|
19
|
+
all<T>(promises: {
|
|
20
|
+
[K in keyof T]: (PromiseInterface<T[K]> | T[K] | null);
|
|
21
|
+
}): PromiseInterface<T>;
|
|
22
|
+
when<T>(value?: PromiseInterface<T> | T): PromiseInterface<T>;
|
|
23
|
+
reject(value?: any): PromiseInterface<any>;
|
|
24
|
+
defer<T>(): Deferred<T>;
|
|
25
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface SocketMessageInterface {
|
|
2
|
-
on(event: string, messageHandler: (message: any) => void): () => boolean;
|
|
3
|
-
}
|
|
1
|
+
export interface SocketMessageInterface {
|
|
2
|
+
on(event: string, messageHandler: (message: any) => void): () => boolean;
|
|
3
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './PromiseLibraryInterface';
|
|
2
|
-
export * from './LocalCacheManagerInterface';
|
|
3
|
-
export * from './ErrorHandlerInterface';
|
|
4
|
-
export * from './ExceptionHandlerInterface';
|
|
5
|
-
export * from './AuthInterface';
|
|
6
|
-
export * from './ApiRequestServiceInterface';
|
|
7
|
-
export * from './SocketMessageInterface';
|
|
1
|
+
export * from './PromiseLibraryInterface';
|
|
2
|
+
export * from './LocalCacheManagerInterface';
|
|
3
|
+
export * from './ErrorHandlerInterface';
|
|
4
|
+
export * from './ExceptionHandlerInterface';
|
|
5
|
+
export * from './AuthInterface';
|
|
6
|
+
export * from './ApiRequestServiceInterface';
|
|
7
|
+
export * from './SocketMessageInterface';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { LocalCache } from '../classes';
|
|
2
|
-
import { CollectionResourceFactory } from '../factories';
|
|
3
|
-
import { CollectionEntry, CollectionResource, CollectionResourceOptions, ItemResource, LocalViewResource } from '../models';
|
|
4
|
-
import { FieldMap, ItemId, ItemIdConversionMap, ItemType, PromiseInterface } from '../types';
|
|
5
|
-
export declare class CollectionEditResource<ItemTypeType extends ItemType = any, T extends ItemResource<ItemTypeType> = LocalViewResource<ItemTypeType>> extends CollectionResource<ItemTypeType, T> {
|
|
6
|
-
constructor(factory: CollectionResourceFactory, collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>,
|
|
7
|
-
save(): PromiseInterface<ItemIdConversionMap>;
|
|
8
|
-
moveItems(idArray: ItemId[], destination: CollectionResource<ItemTypeType>, enableCallbacks?: boolean): T[];
|
|
9
|
-
removeItems(idArray: ItemId[], callOnRemove?: boolean): PromiseInterface<T[]>;
|
|
10
|
-
removeItem(itemId: ItemId, callOnRemove?: boolean): PromiseInterface<T>;
|
|
11
|
-
addItems(valuesArray: Array<FieldMap<ItemTypeType>>, callOnAdd?: boolean, callOnActivate?: boolean): PromiseInterface<T[]>;
|
|
12
|
-
addItem(values: FieldMap<ItemTypeType>, callOnAdd?: boolean, callOnActivate?: boolean): PromiseInterface<T>;
|
|
13
|
-
clear(enableCallbacks: boolean): this["items"];
|
|
14
|
-
}
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { CollectionResourceFactory } from '../factories';
|
|
3
|
+
import { CollectionEntry, CollectionResource, CollectionResourceOptions, ItemResource, LocalViewResource } from '../models';
|
|
4
|
+
import { FieldMap, ItemId, ItemIdConversionMap, ItemType, PromiseInterface } from '../types';
|
|
5
|
+
export declare class CollectionEditResource<ItemTypeType extends ItemType = any, T extends ItemResource<ItemTypeType> = LocalViewResource<ItemTypeType>> extends CollectionResource<ItemTypeType, T> {
|
|
6
|
+
constructor(factory: CollectionResourceFactory, collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>, localCache: LocalCache | null);
|
|
7
|
+
save(): PromiseInterface<ItemIdConversionMap>;
|
|
8
|
+
moveItems(idArray: ItemId[], destination: CollectionResource<ItemTypeType>, enableCallbacks?: boolean): T[];
|
|
9
|
+
removeItems(idArray: ItemId[], callOnRemove?: boolean): PromiseInterface<T[]>;
|
|
10
|
+
removeItem(itemId: ItemId, callOnRemove?: boolean): PromiseInterface<T>;
|
|
11
|
+
addItems(valuesArray: Array<FieldMap<ItemTypeType>>, callOnAdd?: boolean, callOnActivate?: boolean): PromiseInterface<T[]>;
|
|
12
|
+
addItem(values: FieldMap<ItemTypeType>, callOnAdd?: boolean, callOnActivate?: boolean): PromiseInterface<T>;
|
|
13
|
+
clear(enableCallbacks: boolean): this["items"];
|
|
14
|
+
}
|
|
@@ -1,82 +1,87 @@
|
|
|
1
|
-
import { ColumnExpansion, ColumnInfo, ColumnSet, ItemCache } from '../classes';
|
|
2
|
-
import { CollectionEntryFactory } from '../factories';
|
|
3
|
-
import { Deferred } from '../interfaces';
|
|
4
|
-
import { CollectionEntryOptions, CollectionResource, ItemEntry } from '../models';
|
|
5
|
-
import { ApiRequestColumns, CollectionQuery, ConversionMap, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType, PromiseInterface, QueryCallback } from '../types';
|
|
6
|
-
export declare class CollectionEntry<ItemTypeType extends ItemType = any> {
|
|
7
|
-
private factory;
|
|
8
|
-
itemType: ItemTypeType;
|
|
9
|
-
options: CollectionEntryOptions;
|
|
10
|
-
id: number;
|
|
11
|
-
parent: EntryParentNull;
|
|
12
|
-
query: CollectionQuery;
|
|
13
|
-
columns: ColumnSet<ItemTypeType>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
deferred?: Deferred<this>;
|
|
18
|
-
promise: PromiseInterface<this>;
|
|
19
|
-
reloadQueued: boolean;
|
|
20
|
-
hasEditResources: boolean;
|
|
21
|
-
hasItemEditResources: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
addItems<U extends CollectionResource<ItemTypeType>>(itemEntries: Array<ItemEntry<ItemTypeType>>, resultResource
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
removeItems<U extends CollectionResource<ItemTypeType>>(idArray: ItemId[], resultResource
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
handleRemovedItems<U extends CollectionResource<ItemTypeType>>(filterFunction: (itemEntry: this['items'][0]) => boolean, resultResource
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
private
|
|
54
|
-
private
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
1
|
+
import { ColumnExpansion, ColumnInfo, ColumnSet, ItemCache } from '../classes';
|
|
2
|
+
import { CollectionEntryFactory } from '../factories';
|
|
3
|
+
import { Deferred } from '../interfaces';
|
|
4
|
+
import { CollectionEntryOptions, CollectionResource, ItemEntry } from '../models';
|
|
5
|
+
import { ApiRequestColumns, CollectionQuery, ConversionMap, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType, PromiseInterface, QueryCallback } from '../types';
|
|
6
|
+
export declare class CollectionEntry<ItemTypeType extends ItemType = any> {
|
|
7
|
+
private factory;
|
|
8
|
+
itemType: ItemTypeType;
|
|
9
|
+
options: CollectionEntryOptions;
|
|
10
|
+
id: number;
|
|
11
|
+
parent: EntryParentNull;
|
|
12
|
+
query: CollectionQuery;
|
|
13
|
+
columns: ColumnSet<ItemTypeType>;
|
|
14
|
+
initial: Array<ItemEntry<ItemTypeType>>;
|
|
15
|
+
items: Array<ItemEntry<ItemTypeType>>;
|
|
16
|
+
resources: Array<CollectionResource<ItemTypeType>>;
|
|
17
|
+
deferred?: Deferred<this>;
|
|
18
|
+
promise: PromiseInterface<this>;
|
|
19
|
+
reloadQueued: boolean;
|
|
20
|
+
hasEditResources: boolean;
|
|
21
|
+
hasItemEditResources: boolean;
|
|
22
|
+
private templateColumns;
|
|
23
|
+
constructor(factory: CollectionEntryFactory, itemType: ItemTypeType, options: CollectionEntryOptions);
|
|
24
|
+
clearResource(resource: CollectionResource): void;
|
|
25
|
+
clearResources(): void;
|
|
26
|
+
defer(): this;
|
|
27
|
+
isDeferred(): boolean;
|
|
28
|
+
_resolve(): this;
|
|
29
|
+
resolve(itemEntryCompound: {
|
|
30
|
+
columns: ColumnSet<ItemTypeType>;
|
|
31
|
+
initial: Array<ItemEntry<ItemTypeType>>;
|
|
32
|
+
modified?: Array<ItemEntry<ItemTypeType>>;
|
|
33
|
+
}): this;
|
|
34
|
+
isLocal(): boolean;
|
|
35
|
+
matchParent(itemType: ItemType, itemId: ItemId): boolean;
|
|
36
|
+
forEach(callback: (itemEntry: this['items'][0]) => void): void;
|
|
37
|
+
getItemById(itemId: ItemId): this['items'][0] | undefined;
|
|
38
|
+
getIdArray(accumulator?: ItemId[]): ItemId[];
|
|
39
|
+
createItems(valuesArray: Array<FieldMap<ItemTypeType>>): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
|
|
40
|
+
resolveDerivedValues(itemEntries: Array<ItemEntry<ItemTypeType>>, localItemCache: ItemCache): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
|
|
41
|
+
addItems<U extends CollectionResource<ItemTypeType>>(itemEntries: Array<ItemEntry<ItemTypeType>>, resultResource: U, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): U['items'];
|
|
42
|
+
addItems(itemEntries: Array<ItemEntry<ItemTypeType>>, resultResource?: null, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): null;
|
|
43
|
+
addItems<U extends CollectionResource<ItemTypeType>>(itemEntries: Array<ItemEntry<ItemTypeType>>, resultResource?: U | null, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): U['items'] | null;
|
|
44
|
+
private handleAddedItemCallbacks;
|
|
45
|
+
removeItems<U extends CollectionResource<ItemTypeType>>(idArray: ItemId[], resultResource: U, updateInitial?: boolean, callOnRemove?: boolean): U['items'];
|
|
46
|
+
removeItems(idArray: ItemId[], resultResource?: null, updateInitial?: boolean, callOnRemove?: boolean): null;
|
|
47
|
+
removeItems<U extends CollectionResource<ItemTypeType>>(idArray: ItemId[], resultResource?: U | null, updateInitial?: boolean, callOnRemove?: boolean): U['items'] | null;
|
|
48
|
+
clear<U extends CollectionResource<ItemTypeType>>(resultResource: U, updateInitial?: boolean, callOnRemove?: boolean): U['items'];
|
|
49
|
+
clear(resultResource?: null, updateInitial?: boolean, callOnRemove?: boolean): null;
|
|
50
|
+
handleRemovedItems<U extends CollectionResource<ItemTypeType>>(filterFunction: (itemEntry: this['items'][0]) => boolean, resultResource: U, updateInitial?: boolean, callOnRemove?: boolean): U['items'];
|
|
51
|
+
handleRemovedItems(filterFunction: (itemEntry: this['items'][0]) => boolean, resultResource?: null, updateInitial?: boolean, callOnRemove?: boolean): null;
|
|
52
|
+
handleRemovedItems<U extends CollectionResource<ItemTypeType>>(filterFunction: (itemEntry: this['items'][0]) => boolean, resultResource?: U | null, updateInitial?: boolean, callOnRemove?: boolean): U['items'] | null;
|
|
53
|
+
private handleRemovedItemCallbacks;
|
|
54
|
+
private createBatchStatus;
|
|
55
|
+
private expandLocal;
|
|
56
|
+
private expandRemote;
|
|
57
|
+
expand(newColumns: ApiRequestColumns, localItemCache: ItemCache): PromiseInterface<this>;
|
|
58
|
+
extendQuery(callback?: QueryCallback): CollectionQuery;
|
|
59
|
+
extend<U extends CollectionResource<ItemTypeType>>(queryCallback: QueryCallback, collectionResource?: U, callOnAdd?: boolean): PromiseInterface<U['items']>;
|
|
60
|
+
extend(queryCallback: QueryCallback, collectionResource?: null, callOnAdd?: boolean): PromiseInterface<null>;
|
|
61
|
+
queueReload(): void;
|
|
62
|
+
expandColumns(columnExpansion: ColumnExpansion<ItemTypeType>): void;
|
|
63
|
+
expandRequestColumns(requestColumns: ApiRequestColumns): void;
|
|
64
|
+
getAddedItems(returnItemIds: true): ItemId[];
|
|
65
|
+
getAddedItems(returnItemIds?: boolean): Array<ItemEntry<ItemTypeType>>;
|
|
66
|
+
getRemovedItems(returnItemIds: true): ItemId[];
|
|
67
|
+
getRemovedItems(returnItemIds?: boolean): Array<ItemEntry<ItemTypeType>>;
|
|
68
|
+
getUpdatedItems(): Array<ItemEntry<ItemTypeType>>;
|
|
69
|
+
hasAddedItems(): boolean;
|
|
70
|
+
hasRemovedItems(): boolean;
|
|
71
|
+
hasUpdatedItems(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @description
|
|
74
|
+
* Reverts added and removed items
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* - Doesn't revert changes on the items themselves
|
|
78
|
+
*/
|
|
79
|
+
revertChanges(): void;
|
|
80
|
+
onItemsCreated(conversionMap: ConversionMap): void;
|
|
81
|
+
private onAddInitial;
|
|
82
|
+
private onRemoveInitial;
|
|
83
|
+
getUpdatedItemColumns(conversionMap: ItemIdConversionMap): {
|
|
84
|
+
[columnId: string]: ColumnInfo<ItemTypeType>;
|
|
85
|
+
};
|
|
86
|
+
clone(parent: EntryParentNull, conversionMap?: ItemIdConversionMap): CollectionEntry<ItemTypeType>;
|
|
87
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ApiQuery, ApiRequestColumns, ApiRequestLimit, EntryParentNull } from '../types';
|
|
2
|
-
export declare type CollectionEntryOptionsInterface = Partial<CollectionEntryOptions>;
|
|
3
|
-
export declare class CollectionEntryOptions {
|
|
4
|
-
columns: ApiRequestColumns;
|
|
5
|
-
query: ApiQuery | null;
|
|
6
|
-
queryParams: any;
|
|
7
|
-
parent: EntryParentNull;
|
|
8
|
-
deferRequest: boolean;
|
|
9
|
-
limit: ApiRequestLimit | null;
|
|
10
|
-
entryKey: string | null;
|
|
11
|
-
constructor(values: CollectionEntryOptionsInterface);
|
|
12
|
-
}
|
|
1
|
+
import { ApiQuery, ApiRequestColumns, ApiRequestLimit, EntryParentNull } from '../types';
|
|
2
|
+
export declare type CollectionEntryOptionsInterface = Partial<CollectionEntryOptions>;
|
|
3
|
+
export declare class CollectionEntryOptions {
|
|
4
|
+
columns: ApiRequestColumns;
|
|
5
|
+
query: ApiQuery | null;
|
|
6
|
+
queryParams: any;
|
|
7
|
+
parent: EntryParentNull;
|
|
8
|
+
deferRequest: boolean;
|
|
9
|
+
limit: ApiRequestLimit | null;
|
|
10
|
+
entryKey: string | null;
|
|
11
|
+
constructor(values: CollectionEntryOptionsInterface);
|
|
12
|
+
}
|
|
@@ -1,41 +1,52 @@
|
|
|
1
|
-
import { LocalCache } from '../classes';
|
|
2
|
-
import { CollectionResourceFactory } from '../factories';
|
|
3
|
-
import { CollectionEntry, CollectionResourceOptions, ItemEntry, ItemResource, LocalViewResource } from '../models';
|
|
4
|
-
import { ItemResourceItemIdMap, ItemType, PromiseInterface, QueryCallback,
|
|
5
|
-
export declare abstract class CollectionResource<ItemTypeType extends ItemType = any, T extends ItemResource<ItemTypeType> = LocalViewResource<ItemTypeType>> {
|
|
6
|
-
protected factory: CollectionResourceFactory;
|
|
7
|
-
entry: CollectionEntry<ItemTypeType>;
|
|
8
|
-
options: CollectionResourceOptions<ItemTypeType>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
getItemById(itemId: number): T;
|
|
17
|
-
rebuildMap(): void;
|
|
18
|
-
addItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>): T[];
|
|
19
|
-
/**
|
|
20
|
-
* @
|
|
21
|
-
* @
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { CollectionResourceFactory } from '../factories';
|
|
3
|
+
import { CollectionEntry, CollectionResourceOptions, ItemEntry, ItemResource, LocalViewResource } from '../models';
|
|
4
|
+
import { ItemResourceItemIdMap, ItemType, PromiseInterface, QueryCallback, ResponseColumnItemTypeMap } from '../types';
|
|
5
|
+
export declare abstract class CollectionResource<ItemTypeType extends ItemType = any, T extends ItemResource<ItemTypeType> = LocalViewResource<ItemTypeType>> {
|
|
6
|
+
protected factory: CollectionResourceFactory;
|
|
7
|
+
entry: CollectionEntry<ItemTypeType>;
|
|
8
|
+
options: CollectionResourceOptions<ItemTypeType>;
|
|
9
|
+
localCache: LocalCache | null;
|
|
10
|
+
items: T[];
|
|
11
|
+
columns: ResponseColumnItemTypeMap;
|
|
12
|
+
protected itemIdMap: ItemResourceItemIdMap<T>;
|
|
13
|
+
private readonly onChange;
|
|
14
|
+
protected constructor(factory: CollectionResourceFactory, entry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>, localCache: LocalCache | null);
|
|
15
|
+
onConstruct(): void;
|
|
16
|
+
getItemById(itemId: number): T;
|
|
17
|
+
rebuildMap(): void;
|
|
18
|
+
addItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>): T[];
|
|
19
|
+
/**
|
|
20
|
+
* @description
|
|
21
|
+
* Returns the {@link ItemResource ItemResources} that where removed from the {@link CollectionResource collection}.
|
|
22
|
+
* Filters on {@link ItemResource ItemResource}.{@link ItemEntry entry} === {@link ItemEntry entry}
|
|
23
|
+
*/
|
|
24
|
+
removeItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>): T[];
|
|
25
|
+
callOnAdd(itemResources: T[]): void;
|
|
26
|
+
callOnRemove(itemResources: T[]): void;
|
|
27
|
+
forEach(callback: (itemResource: T) => void): void;
|
|
28
|
+
filter(callback: (itemResource: T) => boolean): T[];
|
|
29
|
+
first(callback: (itemResource: T) => boolean): T | null;
|
|
30
|
+
some(callback: (itemResource: T) => boolean): boolean;
|
|
31
|
+
groupBy(argument: string | ((itemResource: T) => string | null)): {
|
|
32
|
+
[key: string]: T[];
|
|
33
|
+
};
|
|
34
|
+
map<U>(argument: string | ((itemResource: T) => U)): U[];
|
|
35
|
+
reduce<U>(callback: (itemResource: T, value: U) => U, value: U): U;
|
|
36
|
+
extend(queryCallback: QueryCallback, returnAllItems?: boolean, callOnAdd?: boolean): PromiseInterface<T[]>;
|
|
37
|
+
/**
|
|
38
|
+
* @description
|
|
39
|
+
* Removes the reference to the {@link CollectionResource CollectionResource} from the {@link CollectionEntry CollectionEntry}
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* - Doesn't revert changes on the items themselves
|
|
43
|
+
*/
|
|
44
|
+
clearResource(clearItems?: boolean): void;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* - Does *not* clear resources
|
|
50
|
+
*/
|
|
51
|
+
deactivate(): void;
|
|
52
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
2
|
-
import { ConversionMap, ItemType, OnChangeFunction } from '../types';
|
|
3
|
-
export declare type CollectionResourceCallback<ItemTypeType extends ItemType> = (itemResources: Array<ItemResource<ItemTypeType>>, collectionResource: CollectionResource<ItemTypeType>) => void;
|
|
4
|
-
export declare type CollectionResourceInitialCallback<ItemTypeType extends ItemType> = (itemEntries: Array<ItemEntry<ItemTypeType>>, collectionEntry: CollectionEntry<ItemTypeType>) => void;
|
|
5
|
-
export declare type OnItemsCreatedCallback = (conversionMap: ConversionMap) => void;
|
|
6
|
-
export declare type CollectionResourceOptionsInterface<ItemTypeType extends ItemType> = Partial<CollectionResourceOptions<ItemTypeType>>;
|
|
7
|
-
export declare class CollectionResourceOptions<ItemTypeType extends ItemType> {
|
|
8
|
-
editItems: boolean;
|
|
9
|
-
remoteItems: boolean;
|
|
10
|
-
editCollection: boolean;
|
|
11
|
-
modInstant: boolean;
|
|
12
|
-
enableSave: boolean;
|
|
13
|
-
onItemsCreated: OnItemsCreatedCallback;
|
|
14
|
-
onChange: OnChangeFunction;
|
|
15
|
-
onAdd: CollectionResourceCallback<ItemTypeType>;
|
|
16
|
-
onRemove: CollectionResourceCallback<ItemTypeType>;
|
|
17
|
-
onAddInitial: CollectionResourceInitialCallback<ItemTypeType>;
|
|
18
|
-
onRemoveInitial: CollectionResourceInitialCallback<ItemTypeType>;
|
|
19
|
-
resourceKey: string | null;
|
|
20
|
-
custom: any;
|
|
21
|
-
constructor(values: CollectionResourceOptionsInterface<ItemTypeType>);
|
|
22
|
-
}
|
|
1
|
+
import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
2
|
+
import { ConversionMap, ItemType, OnChangeFunction } from '../types';
|
|
3
|
+
export declare type CollectionResourceCallback<ItemTypeType extends ItemType> = (itemResources: Array<ItemResource<ItemTypeType>>, collectionResource: CollectionResource<ItemTypeType>) => void;
|
|
4
|
+
export declare type CollectionResourceInitialCallback<ItemTypeType extends ItemType> = (itemEntries: Array<ItemEntry<ItemTypeType>>, collectionEntry: CollectionEntry<ItemTypeType>) => void;
|
|
5
|
+
export declare type OnItemsCreatedCallback = (conversionMap: ConversionMap) => void;
|
|
6
|
+
export declare type CollectionResourceOptionsInterface<ItemTypeType extends ItemType> = Partial<CollectionResourceOptions<ItemTypeType>>;
|
|
7
|
+
export declare class CollectionResourceOptions<ItemTypeType extends ItemType> {
|
|
8
|
+
editItems: boolean;
|
|
9
|
+
remoteItems: boolean;
|
|
10
|
+
editCollection: boolean;
|
|
11
|
+
modInstant: boolean;
|
|
12
|
+
enableSave: boolean;
|
|
13
|
+
onItemsCreated: OnItemsCreatedCallback;
|
|
14
|
+
onChange: OnChangeFunction;
|
|
15
|
+
onAdd: CollectionResourceCallback<ItemTypeType>;
|
|
16
|
+
onRemove: CollectionResourceCallback<ItemTypeType>;
|
|
17
|
+
onAddInitial: CollectionResourceInitialCallback<ItemTypeType>;
|
|
18
|
+
onRemoveInitial: CollectionResourceInitialCallback<ItemTypeType>;
|
|
19
|
+
resourceKey: string | null;
|
|
20
|
+
custom: any;
|
|
21
|
+
constructor(values: CollectionResourceOptionsInterface<ItemTypeType>);
|
|
22
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LocalCache } from '../classes';
|
|
2
|
-
import { CollectionResourceFactory } from '../factories';
|
|
3
|
-
import { CollectionEntry, CollectionResource, CollectionResourceOptions, ItemResource, LocalViewResource } from '../models';
|
|
4
|
-
import { ItemType } from '../types';
|
|
5
|
-
export declare class CollectionViewResource<ItemTypeType extends ItemType = any, T extends ItemResource<ItemTypeType> = LocalViewResource<ItemTypeType>> extends CollectionResource<ItemTypeType, T> {
|
|
6
|
-
constructor(collectionResourceFactory: CollectionResourceFactory, collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>,
|
|
7
|
-
}
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { CollectionResourceFactory } from '../factories';
|
|
3
|
+
import { CollectionEntry, CollectionResource, CollectionResourceOptions, ItemResource, LocalViewResource } from '../models';
|
|
4
|
+
import { ItemType } from '../types';
|
|
5
|
+
export declare class CollectionViewResource<ItemTypeType extends ItemType = any, T extends ItemResource<ItemTypeType> = LocalViewResource<ItemTypeType>> extends CollectionResource<ItemTypeType, T> {
|
|
6
|
+
constructor(collectionResourceFactory: CollectionResourceFactory, collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>, localCache: LocalCache | null);
|
|
7
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { LocalCache } from '../classes';
|
|
2
|
-
import { ItemResourceFactory } from '../factories';
|
|
3
|
-
import { ItemEntry, ItemResource, ItemResourceOptions } from '../models';
|
|
4
|
-
import { FieldMap, ItemType, PromiseInterface } from '../types';
|
|
5
|
-
export declare class EditResource<ItemTypeType extends ItemType = any> extends ItemResource<ItemTypeType> {
|
|
6
|
-
protected localCopies: Array<FieldMap<ItemTypeType>>;
|
|
7
|
-
protected transactions: number;
|
|
8
|
-
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions, isNew: boolean, localCache: LocalCache | null);
|
|
9
|
-
isNew(): boolean;
|
|
10
|
-
start(): this;
|
|
11
|
-
rollback(): this;
|
|
12
|
-
commit(callOnChange?: boolean): this;
|
|
13
|
-
getLocalCopy(): FieldMap<ItemTypeType> | null;
|
|
14
|
-
copyFields(destination?: FieldMap<ItemTypeType>): FieldMap<ItemTypeType>;
|
|
15
|
-
setFields(values: FieldMap<ItemTypeType>, callOnChange?: boolean): this;
|
|
16
|
-
callOnChange(previous?: FieldMap<ItemTypeType>): this;
|
|
17
|
-
save(parameters?: any): PromiseInterface<this>;
|
|
18
|
-
}
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { ItemResourceFactory } from '../factories';
|
|
3
|
+
import { ItemEntry, ItemResource, ItemResourceOptions } from '../models';
|
|
4
|
+
import { FieldMap, ItemType, PromiseInterface } from '../types';
|
|
5
|
+
export declare class EditResource<ItemTypeType extends ItemType = any> extends ItemResource<ItemTypeType> {
|
|
6
|
+
protected localCopies: Array<FieldMap<ItemTypeType>>;
|
|
7
|
+
protected transactions: number;
|
|
8
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions, isNew: boolean, localCache: LocalCache | null);
|
|
9
|
+
isNew(): boolean;
|
|
10
|
+
start(): this;
|
|
11
|
+
rollback(): this;
|
|
12
|
+
commit(callOnChange?: boolean): this;
|
|
13
|
+
getLocalCopy(): FieldMap<ItemTypeType> | null;
|
|
14
|
+
copyFields(destination?: FieldMap<ItemTypeType>): FieldMap<ItemTypeType>;
|
|
15
|
+
setFields(values: FieldMap<ItemTypeType>, callOnChange?: boolean): this;
|
|
16
|
+
callOnChange(previous?: FieldMap<ItemTypeType>): this;
|
|
17
|
+
save(parameters?: any): PromiseInterface<this>;
|
|
18
|
+
}
|