@rentman/rm-core 1.5.6 → 1.5.7
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 +413 -389
- package/dist/rm-core.js +7210 -7288
- 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 +41 -33
- package/dist/src/classes/BatchStatus.d.ts +27 -27
- 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 +37 -37
- package/dist/src/classes/CollectionEntryService.d.ts +23 -26
- package/dist/src/classes/CollectionHandler.d.ts +57 -57
- package/dist/src/classes/CollectionMatcher.d.ts +41 -30
- package/dist/src/classes/CollectionResourceService.d.ts +6 -5
- package/dist/src/classes/ColumnCache.d.ts +21 -21
- package/dist/src/classes/ColumnExpansion.d.ts +19 -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 +46 -46
- package/dist/src/classes/ColumnSubsetCache.d.ts +8 -8
- package/dist/src/classes/ColumnUtil.d.ts +97 -83
- package/dist/src/classes/CreateRequest.d.ts +20 -20
- package/dist/src/classes/ItemAdministrator.d.ts +119 -70
- package/dist/src/classes/ItemCache.d.ts +23 -23
- package/dist/src/classes/ItemEntryService.d.ts +24 -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 +67 -51
- package/dist/src/classes/LockService.d.ts +32 -23
- 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 +17 -16
- package/dist/src/classes/QueryService.d.ts +8 -19
- package/dist/src/classes/RequestColumnExpansion.d.ts +14 -12
- package/dist/src/classes/SocketMessageHandler.d.ts +41 -41
- package/dist/src/classes/Util.d.ts +28 -27
- package/dist/src/classes/index.d.ts +34 -34
- 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 +8 -8
- package/dist/src/factories/ChangesCompilationFactory.d.ts +9 -9
- package/dist/src/factories/ChangesProcessorFactory.d.ts +18 -18
- package/dist/src/factories/CollectionCacheFactory.d.ts +7 -7
- package/dist/src/factories/CollectionEntryFactory.d.ts +21 -21
- package/dist/src/factories/CollectionMatcherFactory.d.ts +7 -7
- package/dist/src/factories/CollectionResourceFactory.d.ts +23 -13
- package/dist/src/factories/ColumnExpansionFactory.d.ts +8 -8
- package/dist/src/factories/ColumnInfoFactory.d.ts +6 -6
- package/dist/src/factories/ColumnSetFactory.d.ts +11 -11
- 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 +19 -19
- package/dist/src/factories/ItemResourceFactory.d.ts +20 -14
- package/dist/src/factories/LocalCacheFactory.d.ts +15 -15
- package/dist/src/factories/ModuleChangesCompilationFactory.d.ts +5 -5
- package/dist/src/factories/QueryMatcherFactory.d.ts +7 -7
- package/dist/src/factories/QueryParserFactory.d.ts +6 -5
- 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 +22 -22
- 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/LocalCacheManagerInterface.d.ts +6 -6
- package/dist/src/interfaces/PromiseLibraryInterface.d.ts +25 -15
- package/dist/src/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/src/interfaces/index.d.ts +6 -6
- package/dist/src/models/CollectionEditResource.d.ts +15 -15
- package/dist/src/models/CollectionEntry.d.ts +81 -67
- package/dist/src/models/CollectionEntryOptions.d.ts +12 -20
- package/dist/src/models/CollectionResource.d.ts +40 -40
- package/dist/src/models/CollectionResourceOptions.d.ts +23 -38
- package/dist/src/models/CollectionViewResource.d.ts +6 -6
- package/dist/src/models/EditResource.d.ts +18 -18
- package/dist/src/models/ItemEntry.d.ts +73 -71
- package/dist/src/models/ItemEntryOptions.d.ts +11 -18
- package/dist/src/models/ItemResource.d.ts +23 -23
- package/dist/src/models/ItemResourceOptions.d.ts +9 -13
- package/dist/src/models/Template.d.ts +11 -11
- package/dist/src/models/ViewResource.d.ts +4 -4
- package/dist/src/models/index.d.ts +13 -13
- package/dist/src/types/ItemTypesCollection.d.ts +227 -234
- package/dist/src/types/PromiseInterface.d.ts +2 -2
- package/dist/src/types/index.d.ts +2 -2
- package/package.json +35 -35
- package/readme.md +15 -15
|
@@ -1,67 +1,81 @@
|
|
|
1
|
-
import { ColumnExpansion, ColumnInfo, ColumnSet, ItemCache } from '../classes';
|
|
2
|
-
import { CollectionEntryFactory } from '../factories';
|
|
3
|
-
import { CollectionEntryOptions, CollectionResource, ItemEntry,
|
|
4
|
-
import {
|
|
5
|
-
export declare class CollectionEntry {
|
|
6
|
-
private factory;
|
|
7
|
-
itemType: ItemType;
|
|
8
|
-
options: CollectionEntryOptions;
|
|
9
|
-
id: number;
|
|
10
|
-
query:
|
|
11
|
-
columns: ColumnSet;
|
|
12
|
-
templateColumns: ColumnSet | null;
|
|
13
|
-
parent: EntryParentNull;
|
|
14
|
-
initial: ItemEntry[];
|
|
15
|
-
items: ItemEntry[];
|
|
16
|
-
resources:
|
|
17
|
-
deferred: any;
|
|
18
|
-
promise: PromiseInterface<
|
|
19
|
-
reloadQueued: boolean;
|
|
20
|
-
hasEditResources: boolean;
|
|
21
|
-
hasItemEditResources: boolean;
|
|
22
|
-
constructor(factory: CollectionEntryFactory, itemType: ItemType, options: CollectionEntryOptions);
|
|
23
|
-
defer(): this;
|
|
24
|
-
isDeferred(): boolean;
|
|
25
|
-
_resolve(): this;
|
|
26
|
-
resolve(itemEntryCompound: {
|
|
27
|
-
columns: ColumnSet;
|
|
28
|
-
initial: ItemEntry[];
|
|
29
|
-
modified?: ItemEntry[];
|
|
30
|
-
}): this;
|
|
31
|
-
isLocal(): boolean;
|
|
32
|
-
matchParent(itemType: ItemType, itemId: ItemId): boolean;
|
|
33
|
-
forEach(callback: (itemEntry: ItemEntry) => void): void;
|
|
34
|
-
getItemById(itemId:
|
|
35
|
-
getIdArray(accumulator?: ItemId[]): ItemId[];
|
|
36
|
-
createItems(valuesArray: FieldMap[]): PromiseInterface<ItemEntry[]>;
|
|
37
|
-
resolveDerivedValues(itemEntries: ItemEntry[], localItemCache: ItemCache): PromiseInterface<ItemEntry[]>;
|
|
38
|
-
addItems(itemEntries: ItemEntry[], resultResource
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
import { ColumnExpansion, ColumnInfo, ColumnSet, ItemCache } from '../classes';
|
|
2
|
+
import { CollectionEntryFactory } from '../factories';
|
|
3
|
+
import { CollectionEditResource, CollectionEntryOptions, CollectionResource, CollectionViewResource, ItemEntry, ViewResource } from '../models';
|
|
4
|
+
import { ApiRequestColumns, CollectionQuery, ConversionMap, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType, PromiseInterface, QueryCallback } from '../types';
|
|
5
|
+
export declare class CollectionEntry {
|
|
6
|
+
private factory;
|
|
7
|
+
itemType: ItemType;
|
|
8
|
+
options: CollectionEntryOptions;
|
|
9
|
+
id: number;
|
|
10
|
+
query: CollectionQuery;
|
|
11
|
+
columns: ColumnSet;
|
|
12
|
+
templateColumns: ColumnSet | null;
|
|
13
|
+
parent: EntryParentNull;
|
|
14
|
+
initial: ItemEntry[];
|
|
15
|
+
items: ItemEntry[];
|
|
16
|
+
resources: Array<CollectionViewResource | CollectionEditResource>;
|
|
17
|
+
deferred: any;
|
|
18
|
+
promise: PromiseInterface<this>;
|
|
19
|
+
reloadQueued: boolean;
|
|
20
|
+
hasEditResources: boolean;
|
|
21
|
+
hasItemEditResources: boolean;
|
|
22
|
+
constructor(factory: CollectionEntryFactory, itemType: ItemType, options: CollectionEntryOptions);
|
|
23
|
+
defer(): this;
|
|
24
|
+
isDeferred(): boolean;
|
|
25
|
+
_resolve(): this;
|
|
26
|
+
resolve(itemEntryCompound: {
|
|
27
|
+
columns: ColumnSet;
|
|
28
|
+
initial: ItemEntry[];
|
|
29
|
+
modified?: ItemEntry[];
|
|
30
|
+
}): this;
|
|
31
|
+
isLocal(): boolean;
|
|
32
|
+
matchParent(itemType: ItemType, itemId: ItemId): boolean;
|
|
33
|
+
forEach(callback: (itemEntry: ItemEntry) => void): void;
|
|
34
|
+
getItemById(itemId: ItemId): ItemEntry | undefined;
|
|
35
|
+
getIdArray(accumulator?: ItemId[]): ItemId[];
|
|
36
|
+
createItems(valuesArray: FieldMap[]): PromiseInterface<ItemEntry[]>;
|
|
37
|
+
resolveDerivedValues(itemEntries: ItemEntry[], localItemCache: ItemCache): PromiseInterface<ItemEntry[]>;
|
|
38
|
+
addItems<U extends CollectionResource>(itemEntries: ItemEntry[], resultResource: U, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): U['items'];
|
|
39
|
+
addItems(itemEntries: ItemEntry[], resultResource?: null, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): null;
|
|
40
|
+
addItems<U extends CollectionResource>(itemEntries: ItemEntry[], resultResource?: U | null, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): U['items'] | null;
|
|
41
|
+
private handleAddedItemCallbacks;
|
|
42
|
+
removeItems<U extends CollectionResource>(idArray: ItemId[], resultResource: U, updateInitial?: boolean, callOnRemove?: boolean): U['items'];
|
|
43
|
+
removeItems(idArray: ItemId[], resultResource?: null, updateInitial?: boolean, callOnRemove?: boolean): null;
|
|
44
|
+
removeItems<U extends CollectionResource>(idArray: ItemId[], resultResource?: U | null, updateInitial?: boolean, callOnRemove?: boolean): U['items'] | null;
|
|
45
|
+
clear<U extends CollectionResource>(resultResource: U, updateInitial?: boolean, callOnRemove?: boolean): U['items'];
|
|
46
|
+
clear(resultResource?: null, updateInitial?: boolean, callOnRemove?: boolean): null;
|
|
47
|
+
handleRemovedItems<U extends CollectionResource>(filterFunction: (itemEntry: ItemEntry) => boolean, resultResource: U, updateInitial?: boolean, callOnRemove?: boolean): U['items'];
|
|
48
|
+
handleRemovedItems(filterFunction: (itemEntry: ItemEntry) => boolean, resultResource?: null, updateInitial?: boolean, callOnRemove?: boolean): null;
|
|
49
|
+
handleRemovedItems<U extends CollectionResource>(filterFunction: (itemEntry: ItemEntry) => boolean, resultResource?: U | null, updateInitial?: boolean, callOnRemove?: boolean): U['items'] | null;
|
|
50
|
+
private handleRemovedItemCallbacks;
|
|
51
|
+
private createBatchStatus;
|
|
52
|
+
private expandLocal;
|
|
53
|
+
private expandRemote;
|
|
54
|
+
expand(newColumns: ApiRequestColumns, localItemCache: ItemCache): PromiseInterface<this>;
|
|
55
|
+
extendQuery(callback?: QueryCallback): CollectionQuery;
|
|
56
|
+
extend<U extends CollectionResource>(queryCallback: QueryCallback, collectionResource?: U, callOnAdd?: boolean, updateInitial?: boolean): PromiseInterface<U['items']>;
|
|
57
|
+
extend(queryCallback: QueryCallback, collectionResource?: null, callOnAdd?: boolean, updateInitial?: boolean): PromiseInterface<null>;
|
|
58
|
+
queueReload(): void;
|
|
59
|
+
expandColumns(columnExpansion: ColumnExpansion): void;
|
|
60
|
+
expandRequestColumns(requestColumns: ApiRequestColumns): void;
|
|
61
|
+
getAddedItems(returnItemIds: true): ItemId[];
|
|
62
|
+
getAddedItems(returnItemIds?: boolean): ItemEntry[];
|
|
63
|
+
getRemovedItems(returnItemIds: true): ItemId[];
|
|
64
|
+
getRemovedItems(returnItemIds?: boolean): ItemEntry[];
|
|
65
|
+
getUpdatedItems(): ItemEntry[];
|
|
66
|
+
hasAddedItems(): boolean;
|
|
67
|
+
hasRemovedItems(): boolean;
|
|
68
|
+
hasUpdatedItems(): boolean;
|
|
69
|
+
getCurrentResource<T extends CollectionViewResource = CollectionViewResource<ViewResource>>(): T;
|
|
70
|
+
clearResources(isSubtabChange?: boolean): void;
|
|
71
|
+
/**
|
|
72
|
+
* @description
|
|
73
|
+
* this doesn't revert updates
|
|
74
|
+
*/
|
|
75
|
+
revertChanges(): void;
|
|
76
|
+
onItemsCreated(conversionMap: ConversionMap): void;
|
|
77
|
+
getUpdatedItemColumns(conversionMap: ItemIdConversionMap): {
|
|
78
|
+
[columnId: string]: ColumnInfo;
|
|
79
|
+
};
|
|
80
|
+
clone(parent: EntryParentNull, conversionMap?: ItemIdConversionMap): CollectionEntry;
|
|
81
|
+
}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { ApiQuery, ApiRequestColumns, ApiRequestLimit, EntryParentNull
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
query: any;
|
|
14
|
-
queryParams: any;
|
|
15
|
-
parent: any;
|
|
16
|
-
deferRequest: any;
|
|
17
|
-
limit: any;
|
|
18
|
-
entryKey: any;
|
|
19
|
-
constructor(values: CollectionEntryOptionsInterface);
|
|
20
|
-
}
|
|
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,40 +1,40 @@
|
|
|
1
|
-
import { LocalCache } from '../classes';
|
|
2
|
-
import { ItemResourceFactory } from '../factories';
|
|
3
|
-
import { CollectionResourceOptions, ItemEntry,
|
|
4
|
-
import { ItemResourceItemIdMap, PromiseInterface } from '../types';
|
|
5
|
-
import { CollectionEntry } from './CollectionEntry';
|
|
6
|
-
export declare class CollectionResource {
|
|
7
|
-
private itemResourceFactory;
|
|
8
|
-
entry: CollectionEntry;
|
|
9
|
-
options: CollectionResourceOptions;
|
|
10
|
-
localCache: LocalCache;
|
|
11
|
-
items:
|
|
12
|
-
itemIdMap: ItemResourceItemIdMap
|
|
13
|
-
columns:
|
|
14
|
-
constructor(itemResourceFactory: ItemResourceFactory, entry: CollectionEntry, options: CollectionResourceOptions, localCache: LocalCache);
|
|
15
|
-
getItemById(itemId: number):
|
|
16
|
-
rebuildMap(): void;
|
|
17
|
-
addItemResources(itemEntries: ItemEntry[]):
|
|
18
|
-
/**
|
|
19
|
-
* @param itemEntries
|
|
20
|
-
* @returns {ItemResource[]}
|
|
21
|
-
*
|
|
22
|
-
* Returns the Itemresources that where removed Collection.
|
|
23
|
-
* Filters on ItemResource.entry === ItemEntry
|
|
24
|
-
*/
|
|
25
|
-
removeItemResources(itemEntries: ItemEntry[]):
|
|
26
|
-
callOnAdd(itemResources:
|
|
27
|
-
callOnRemove(itemResources:
|
|
28
|
-
forEach(callback: (itemResource:
|
|
29
|
-
filter(callback: (itemResource:
|
|
30
|
-
first(callback: (itemResource:
|
|
31
|
-
some(callback: (itemResource:
|
|
32
|
-
groupBy(argument: string | ((itemResource:
|
|
33
|
-
[key: string]:
|
|
34
|
-
};
|
|
35
|
-
map<
|
|
36
|
-
reduce<
|
|
37
|
-
extend(queryCallback:
|
|
38
|
-
deactivate(): void;
|
|
39
|
-
clearResource(): void;
|
|
40
|
-
}
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { ItemResourceFactory } from '../factories';
|
|
3
|
+
import { CollectionResourceOptions, EditResource, ItemEntry, ViewResource } from '../models';
|
|
4
|
+
import { ItemResourceItemIdMap, PromiseInterface, QueryCallback, ResponseColumnMap } from '../types';
|
|
5
|
+
import { CollectionEntry } from './CollectionEntry';
|
|
6
|
+
export declare class CollectionResource<T extends ViewResource | EditResource = ViewResource> {
|
|
7
|
+
private itemResourceFactory;
|
|
8
|
+
entry: CollectionEntry;
|
|
9
|
+
options: CollectionResourceOptions;
|
|
10
|
+
localCache: LocalCache;
|
|
11
|
+
items: T[];
|
|
12
|
+
itemIdMap: ItemResourceItemIdMap<T>;
|
|
13
|
+
columns: ResponseColumnMap;
|
|
14
|
+
constructor(itemResourceFactory: ItemResourceFactory, entry: CollectionEntry, options: CollectionResourceOptions, localCache: LocalCache);
|
|
15
|
+
getItemById(itemId: number): T;
|
|
16
|
+
rebuildMap(): void;
|
|
17
|
+
addItemResources(itemEntries: ItemEntry[]): T[];
|
|
18
|
+
/**
|
|
19
|
+
* @param itemEntries
|
|
20
|
+
* @returns {ItemResource[]}
|
|
21
|
+
*
|
|
22
|
+
* Returns the Itemresources that where removed Collection.
|
|
23
|
+
* Filters on ItemResource.entry === ItemEntry
|
|
24
|
+
*/
|
|
25
|
+
removeItemResources(itemEntries: ItemEntry[]): T[];
|
|
26
|
+
callOnAdd(itemResources: this['items']): void;
|
|
27
|
+
callOnRemove(itemResources: this['items']): void;
|
|
28
|
+
forEach(callback: (itemResource: T) => void): void;
|
|
29
|
+
filter(callback: (itemResource: T) => boolean): T[];
|
|
30
|
+
first(callback: (itemResource: T) => boolean): T | null;
|
|
31
|
+
some(callback: (itemResource: T) => boolean): boolean;
|
|
32
|
+
groupBy(argument: string | ((itemResource: T) => string | null)): {
|
|
33
|
+
[key: string]: T[];
|
|
34
|
+
};
|
|
35
|
+
map<U>(argument: string | ((itemResource: T) => U)): U[];
|
|
36
|
+
reduce<U>(callback: (itemResource: T, value: U) => U, value: U): U;
|
|
37
|
+
extend(queryCallback: QueryCallback, returnAllItems?: boolean, callOnAdd?: boolean): PromiseInterface<this['items']>;
|
|
38
|
+
deactivate(): void;
|
|
39
|
+
clearResource(): void;
|
|
40
|
+
}
|
|
@@ -1,38 +1,23 @@
|
|
|
1
|
-
import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
2
|
-
import {
|
|
3
|
-
export declare type CollectionResourceCallback = (itemResources: ItemResource[], collectionResource: CollectionResource) => void;
|
|
4
|
-
export declare type CollectionResourceInitialCallback = (itemEntries: ItemEntry[], collectionEntry: CollectionEntry) => void;
|
|
5
|
-
export declare type OnItemsCreatedCallback = (conversionMap:
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
editCollection: any;
|
|
25
|
-
modInstant: any;
|
|
26
|
-
enableSave: any;
|
|
27
|
-
onItemsCreated: any;
|
|
28
|
-
onChange: any;
|
|
29
|
-
onAdd: any;
|
|
30
|
-
onRemove: any;
|
|
31
|
-
onAddInitial: any;
|
|
32
|
-
onRemoveInitial: any;
|
|
33
|
-
resourceKey: any;
|
|
34
|
-
clearOnTabChange: any;
|
|
35
|
-
clearOnSubTabChange: any;
|
|
36
|
-
custom: any;
|
|
37
|
-
constructor(values: CollectionResourceOptionsInterface);
|
|
38
|
-
}
|
|
1
|
+
import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
2
|
+
import { ConversionMap, OnChangeFunction } from '../types';
|
|
3
|
+
export declare type CollectionResourceCallback = (itemResources: ItemResource[], collectionResource: CollectionResource) => void;
|
|
4
|
+
export declare type CollectionResourceInitialCallback = (itemEntries: ItemEntry[], collectionEntry: CollectionEntry) => void;
|
|
5
|
+
export declare type OnItemsCreatedCallback = (conversionMap: ConversionMap) => void;
|
|
6
|
+
export declare type CollectionResourceOptionsInterface = Partial<CollectionResourceOptions>;
|
|
7
|
+
export declare class CollectionResourceOptions {
|
|
8
|
+
editItems: boolean;
|
|
9
|
+
editCollection: boolean;
|
|
10
|
+
modInstant: boolean;
|
|
11
|
+
enableSave: boolean;
|
|
12
|
+
onItemsCreated: OnItemsCreatedCallback;
|
|
13
|
+
onChange: OnChangeFunction;
|
|
14
|
+
onAdd: CollectionResourceCallback;
|
|
15
|
+
onRemove: CollectionResourceCallback;
|
|
16
|
+
onAddInitial: CollectionResourceInitialCallback;
|
|
17
|
+
onRemoveInitial: CollectionResourceInitialCallback;
|
|
18
|
+
resourceKey: string | null;
|
|
19
|
+
clearOnTabChange: boolean;
|
|
20
|
+
clearOnSubTabChange: boolean;
|
|
21
|
+
custom: any;
|
|
22
|
+
constructor(values: CollectionResourceOptionsInterface);
|
|
23
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LocalCache } from '../classes';
|
|
2
|
-
import { ItemResourceFactory } from '../factories';
|
|
3
|
-
import { CollectionEntry, CollectionResource, CollectionResourceOptions } from '../models';
|
|
4
|
-
export declare class CollectionViewResource extends CollectionResource {
|
|
5
|
-
constructor(itemResourceFactory: ItemResourceFactory, collectionEntry: CollectionEntry, options: CollectionResourceOptions, localCache: LocalCache);
|
|
6
|
-
}
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { ItemResourceFactory } from '../factories';
|
|
3
|
+
import { CollectionEntry, CollectionResource, CollectionResourceOptions, EditResource, ViewResource } from '../models';
|
|
4
|
+
export declare class CollectionViewResource<T extends EditResource | ViewResource = ViewResource> extends CollectionResource<T> {
|
|
5
|
+
constructor(itemResourceFactory: ItemResourceFactory, collectionEntry: CollectionEntry, options: CollectionResourceOptions, localCache: LocalCache);
|
|
6
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ItemResourceFactory } from '../factories';
|
|
2
|
-
import { ItemEntry, ItemResource, ItemResourceOptions } from '../models';
|
|
3
|
-
import { FieldMap, PromiseInterface } from '../types';
|
|
4
|
-
export declare class EditResource extends ItemResource {
|
|
5
|
-
private factory;
|
|
6
|
-
localCopies: FieldMap[];
|
|
7
|
-
transactions: number;
|
|
8
|
-
constructor(factory: ItemResourceFactory, entry: ItemEntry, options: ItemResourceOptions, isNew?: boolean);
|
|
9
|
-
isNew(): boolean;
|
|
10
|
-
start(): this;
|
|
11
|
-
rollback(): this;
|
|
12
|
-
commit(callOnChange?: boolean): this;
|
|
13
|
-
getLocalCopy(): FieldMap | null;
|
|
14
|
-
copyFields(destination?: FieldMap): FieldMap;
|
|
15
|
-
setFields(values: FieldMap, callOnChange?: boolean): this;
|
|
16
|
-
callOnChange(previous
|
|
17
|
-
save(parameters?: any): PromiseInterface<this>;
|
|
18
|
-
}
|
|
1
|
+
import { ItemResourceFactory } from '../factories';
|
|
2
|
+
import { ItemEntry, ItemResource, ItemResourceOptions } from '../models';
|
|
3
|
+
import { FieldMap, PromiseInterface } from '../types';
|
|
4
|
+
export declare class EditResource extends ItemResource {
|
|
5
|
+
private factory;
|
|
6
|
+
localCopies: FieldMap[];
|
|
7
|
+
transactions: number;
|
|
8
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry, options: ItemResourceOptions, isNew?: boolean);
|
|
9
|
+
isNew(): boolean;
|
|
10
|
+
start(): this;
|
|
11
|
+
rollback(): this;
|
|
12
|
+
commit(callOnChange?: boolean): this;
|
|
13
|
+
getLocalCopy(): FieldMap | null;
|
|
14
|
+
copyFields(destination?: FieldMap): FieldMap;
|
|
15
|
+
setFields(values: FieldMap, callOnChange?: boolean): this;
|
|
16
|
+
callOnChange(previous?: FieldMap): this;
|
|
17
|
+
save(parameters?: any): PromiseInterface<this>;
|
|
18
|
+
}
|
|
@@ -1,71 +1,73 @@
|
|
|
1
|
-
import { ColumnSet } from '../classes';
|
|
2
|
-
import { ItemEntryFactory } from '../factories';
|
|
3
|
-
import { ItemResource } from '../models';
|
|
4
|
-
import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemError, ItemId, ItemIdConversionMap, ItemType } from '../types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
import { ColumnSet } from '../classes';
|
|
2
|
+
import { ItemEntryFactory } from '../factories';
|
|
3
|
+
import { ItemResource } from '../models';
|
|
4
|
+
import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemError, ItemId, ItemIdConversionMap, ItemType, PromiseInterface } from '../types';
|
|
5
|
+
import { Deferred } from '../interfaces';
|
|
6
|
+
export declare class ItemEntry {
|
|
7
|
+
private factory;
|
|
8
|
+
itemType: string;
|
|
9
|
+
itemId: ItemId;
|
|
10
|
+
columns: ColumnSet;
|
|
11
|
+
id: number;
|
|
12
|
+
reloadQueued: boolean;
|
|
13
|
+
deferRequest: boolean;
|
|
14
|
+
deferred?: Deferred<this>;
|
|
15
|
+
parent: EntryParentNull;
|
|
16
|
+
initial: FieldMap;
|
|
17
|
+
modified: FieldMap;
|
|
18
|
+
derived: FieldMap;
|
|
19
|
+
resources: ItemResource[];
|
|
20
|
+
constructor(factory: ItemEntryFactory, itemType: string, itemId: ItemId, columns: ColumnSet);
|
|
21
|
+
queueReload(): this;
|
|
22
|
+
defer(deferRequest?: boolean): this;
|
|
23
|
+
getPromise(): PromiseInterface<this>;
|
|
24
|
+
resolve(): this;
|
|
25
|
+
resolveDeferred(initial: FieldMap, derived: FieldMap, columns: ColumnSet): this;
|
|
26
|
+
isDeferred(): boolean;
|
|
27
|
+
reject(error?: ItemError): this;
|
|
28
|
+
setFields(initial: FieldMap, derived: FieldMap): this;
|
|
29
|
+
setLocalFields(initialValues: FieldMap, conversionMap: ItemIdConversionMap, columns?: ColumnSet): this;
|
|
30
|
+
clone(conversionMap?: ItemIdConversionMap): ItemEntry;
|
|
31
|
+
resetDerived(columnIds: string[]): this;
|
|
32
|
+
clearResources(): this;
|
|
33
|
+
deactivateResources(): this;
|
|
34
|
+
getFields(): FieldMap;
|
|
35
|
+
expand(main: FieldMap, derived: FieldMap, columnExpansionResult: ColumnExpansionResult): this;
|
|
36
|
+
expandLocal(columnExpansionResult: ColumnExpansionResult): this;
|
|
37
|
+
private setLocalValues;
|
|
38
|
+
/**
|
|
39
|
+
* This function assumes the initial, modified, derived properties are already set. It will update the values
|
|
40
|
+
* themselves to preserve references in existing item resources.
|
|
41
|
+
*/
|
|
42
|
+
updateFields(fields: FieldMap, derived?: FieldMap | null, overwrite?: boolean): this;
|
|
43
|
+
private updateItemValues;
|
|
44
|
+
updateItemFields(conversionMap: ItemIdConversionMap, columns?: ColumnSet): this;
|
|
45
|
+
formatRequest(): FieldMap;
|
|
46
|
+
setDisplayName(): this;
|
|
47
|
+
getDisplayName(): string;
|
|
48
|
+
/**
|
|
49
|
+
* @param {Boolean} returnAll Returns all initial values if true
|
|
50
|
+
* @returns {Object}
|
|
51
|
+
*/
|
|
52
|
+
getChanges(returnAll?: boolean): FieldMap;
|
|
53
|
+
isLocal(): boolean;
|
|
54
|
+
isLockable(): boolean;
|
|
55
|
+
hasChanges(): boolean;
|
|
56
|
+
resetModified(): this;
|
|
57
|
+
setInitial(values: FieldMap, enableCallbacks?: boolean): this;
|
|
58
|
+
/**
|
|
59
|
+
* Does a shallow copy of values!
|
|
60
|
+
*/
|
|
61
|
+
setModified(values?: FieldMap): this;
|
|
62
|
+
setDerived(values: FieldMap): this;
|
|
63
|
+
setParent(parentType: ItemType, parentId: ItemId): this;
|
|
64
|
+
callOnChange(previous?: FieldMap): this;
|
|
65
|
+
toJSON(): {
|
|
66
|
+
id: number;
|
|
67
|
+
parent: EntryParentNull;
|
|
68
|
+
initial: FieldMap;
|
|
69
|
+
modified: FieldMap;
|
|
70
|
+
derived: FieldMap;
|
|
71
|
+
columns: ColumnSet;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { ApiRequestColumnMap, ApiRequestColumns, EntryParentNull
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
parent: any;
|
|
13
|
-
templateOptions: any;
|
|
14
|
-
templateColumns: any;
|
|
15
|
-
deferRequest: any;
|
|
16
|
-
isDuplicate: any;
|
|
17
|
-
constructor(values: ItemEntryOptionsInterface);
|
|
18
|
-
}
|
|
1
|
+
import { ApiRequestColumnMap, ApiRequestColumns, EntryParentNull } from '../types';
|
|
2
|
+
export declare type ItemEntryOptionsInterface = Partial<ItemEntryOptions>;
|
|
3
|
+
export declare class ItemEntryOptions {
|
|
4
|
+
columns: ApiRequestColumns;
|
|
5
|
+
parent: EntryParentNull;
|
|
6
|
+
templateOptions: any;
|
|
7
|
+
templateColumns: ApiRequestColumnMap;
|
|
8
|
+
deferRequest: boolean;
|
|
9
|
+
isDuplicate: boolean;
|
|
10
|
+
constructor(values: ItemEntryOptionsInterface);
|
|
11
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ItemEntry, ItemResourceOptions } from '../models';
|
|
2
|
-
import { FieldMap, ResponseColumn } from '../types';
|
|
3
|
-
export declare class ItemResource {
|
|
4
|
-
entry: ItemEntry;
|
|
5
|
-
options: ItemResourceOptions;
|
|
6
|
-
protected readonly _isNew: boolean;
|
|
7
|
-
columns: {
|
|
8
|
-
[columnId: string]: ResponseColumn;
|
|
9
|
-
};
|
|
10
|
-
fields: FieldMap;
|
|
11
|
-
derived: FieldMap;
|
|
12
|
-
constructor(entry: ItemEntry, options: ItemResourceOptions, _isNew?: boolean);
|
|
13
|
-
isNew(): boolean;
|
|
14
|
-
isLocal(): boolean;
|
|
15
|
-
clearResource(): void;
|
|
16
|
-
deactivate(): void;
|
|
17
|
-
toJSON(): {
|
|
18
|
-
columns: string[];
|
|
19
|
-
fields: FieldMap;
|
|
20
|
-
derived: FieldMap;
|
|
21
|
-
entry: ItemEntry;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
1
|
+
import { ItemEntry, ItemResourceOptions } from '../models';
|
|
2
|
+
import { FieldMap, ResponseColumn } from '../types';
|
|
3
|
+
export declare class ItemResource {
|
|
4
|
+
entry: ItemEntry;
|
|
5
|
+
options: ItemResourceOptions;
|
|
6
|
+
protected readonly _isNew: boolean;
|
|
7
|
+
columns: {
|
|
8
|
+
[columnId: string]: ResponseColumn;
|
|
9
|
+
};
|
|
10
|
+
fields: FieldMap;
|
|
11
|
+
derived: FieldMap;
|
|
12
|
+
constructor(entry: ItemEntry, options: ItemResourceOptions, _isNew?: boolean);
|
|
13
|
+
isNew(): boolean;
|
|
14
|
+
isLocal(): boolean;
|
|
15
|
+
clearResource(): void;
|
|
16
|
+
deactivate(): void;
|
|
17
|
+
toJSON(): {
|
|
18
|
+
columns: string[];
|
|
19
|
+
fields: FieldMap;
|
|
20
|
+
derived: FieldMap;
|
|
21
|
+
entry: ItemEntry;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { ItemEntry } from '../models';
|
|
2
|
-
import {
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
onChange: any;
|
|
11
|
-
onDeactivate: any;
|
|
12
|
-
constructor(values: ItemResourceOptionsInterface);
|
|
13
|
-
}
|
|
1
|
+
import { ItemEntry } from '../models';
|
|
2
|
+
import { OnChangeFunction } from '../types';
|
|
3
|
+
export declare type ItemResourceOptionsInterface = Partial<ItemResourceOptions>;
|
|
4
|
+
export declare class ItemResourceOptions {
|
|
5
|
+
edit: boolean;
|
|
6
|
+
onChange: OnChangeFunction;
|
|
7
|
+
onDeactivate: (itemEntry: ItemEntry) => void;
|
|
8
|
+
constructor(values: ItemResourceOptionsInterface);
|
|
9
|
+
}
|