@rentman/rm-core 1.5.7-1 → 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 +0 -6
- package/dist/rm-core.js +11 -14
- package/dist/rm-core.min.js +1 -1
- package/dist/src/classes/CollectionHandler.d.ts +2 -2
- package/dist/src/classes/ItemAdministrator.d.ts +10 -52
- package/dist/src/classes/LocalCache.d.ts +4 -12
- package/dist/src/classes/Util.d.ts +1 -1
- package/dist/src/models/CollectionEditResource.d.ts +2 -2
- package/dist/src/models/CollectionResource.d.ts +2 -2
- package/dist/src/models/ItemResource.d.ts +1 -1
- package/dist/src/types/ItemTypesCollection.d.ts +8 -8
- package/package.json +1 -1
|
@@ -36,8 +36,8 @@ export declare class CollectionHandler {
|
|
|
36
36
|
*/
|
|
37
37
|
addToCollections<T extends CollectionResource = CollectionViewResource>(collectionMap: any, updateInitial: boolean, resultResource?: T | null): T['items'];
|
|
38
38
|
batchExpand(parentType: ItemType, itemType: ItemType, collections: CollectionResourceParentIdMap, newColumns: ApiRequestColumn[]): PromiseInterface<CollectionResourceParentIdMap>;
|
|
39
|
-
batchExtend
|
|
40
|
-
batchFetch(parentType: ItemType, parentIdArray: ItemId[]
|
|
39
|
+
batchExtend(parentType: ItemType, itemType: ItemType, options: CollectionEntryOptions, queryCallback: QueryCallback, collections: CollectionResourceParentIdMap, returnAllItems?: boolean): PromiseInterface<ItemResourceItemIdMap>;
|
|
40
|
+
batchFetch(parentType: ItemType, parentIdArray: ItemId[], itemType: ItemType, options: CollectionEntryOptions, itemCache: ItemCache, localCollectionCache: CollectionCache, deferredCollectionCache: CollectionCache): PromiseInterface<CollectionEntryParentIdMap>;
|
|
41
41
|
handleBatchResponse(batchStatus: BatchStatus<CollectionEntry>, itemEntryCompound: {
|
|
42
42
|
columns: ColumnSet;
|
|
43
43
|
columnExpansion?: ColumnExpansion;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CollectionCache, CollectionHandler, CollectionMatcher, ItemCache, ItemHandler, ItemRequestService, KeyService, LocalCache,
|
|
1
|
+
import { CollectionCache, CollectionHandler, CollectionMatcher, ItemCache, ItemHandler, ItemRequestService, KeyService, LocalCache, QueryService } from '../classes';
|
|
2
2
|
import { CollectionMatcherFactory, ColumnSetFactory, LocalCacheFactory, ModuleChangesCompilationFactory } from '../factories';
|
|
3
3
|
import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEditResource, CollectionEntry, CollectionResource, CollectionResourceOptionsInterface, CollectionViewResource, EditResource, ItemEntry, ItemResource, ItemResourceOptionsInterface, ViewResource } from '../models';
|
|
5
|
-
import { ApiQuery, CollectionDefinition, CollectionOptionsInterface, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemOptionsInterface, ItemResourcesItemTypeMap, ItemType, LinkCollectionDefinition, LinkedItemEntryMap, LocalCacheCallbackCondition, OnSaveCallback, PromiseInterface } from '../types';
|
|
5
|
+
import { ApiQuery, CollectionDefinition, CollectionOptionsInterface, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemOptionsInterface, ItemResourcesItemTypeMap, ItemType, LinkCollectionDefinition, LinkedItemEntryMap, LocalCacheCallbackCondition, OnSaveCallback, PromiseInterface, TemplateItemResourceMap } from '../types';
|
|
6
6
|
export declare class ItemAdministrator {
|
|
7
7
|
private apiRequestService;
|
|
8
8
|
private authInterface;
|
|
@@ -33,14 +33,8 @@ export declare class ItemAdministrator {
|
|
|
33
33
|
linked: ItemResourcesItemTypeMap;
|
|
34
34
|
}>;
|
|
35
35
|
getNewResource(itemType: ItemType, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource>;
|
|
36
|
-
getDuplicateById(itemType: ItemType, duplicateId: ItemId, options
|
|
37
|
-
|
|
38
|
-
}, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource>;
|
|
39
|
-
getDuplicateById(itemType: ItemType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ViewResource>;
|
|
40
|
-
getItemByState(itemType: ItemType, stateKey: ItemId | string, options: ItemOptionsInterface & {
|
|
41
|
-
edit: true;
|
|
42
|
-
}, isRoot?: boolean): PromiseInterface<EditResource>;
|
|
43
|
-
getItemByState(itemType: ItemType, stateKey: ItemId | string, options: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<ViewResource>;
|
|
36
|
+
getDuplicateById(itemType: ItemType, duplicateId: ItemId, options?: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource | TemplateItemResourceMap>;
|
|
37
|
+
getItemByState(itemType: ItemType, stateKey: ItemId | string, options?: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<ItemResource>;
|
|
44
38
|
getCollectionDef(itemType: ItemType, options: CollectionOptionsInterface): CollectionDefinition;
|
|
45
39
|
getLinkCollectionsDef(linkType: ItemType, linkIdArray: ItemId[] | (() => ItemId[]), itemType: ItemType, linkField: string, options: CollectionOptionsInterface): LinkCollectionDefinition;
|
|
46
40
|
getCollection(itemType: ItemType, options: CollectionOptionsInterface & {
|
|
@@ -59,48 +53,18 @@ export declare class ItemAdministrator {
|
|
|
59
53
|
* @deprecated, use `parent` in options
|
|
60
54
|
*/
|
|
61
55
|
getLinkCollection(linkType: ItemType, linkId: ItemId, itemType: ItemType, options?: CollectionOptionsInterface): PromiseInterface<CollectionResource>;
|
|
62
|
-
getLinkCollections(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemType, options: CollectionOptionsInterface
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<EditResource>>>;
|
|
66
|
-
getLinkCollections(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemType, options: CollectionOptionsInterface & {
|
|
67
|
-
editCollection: true;
|
|
68
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ViewResource>>>;
|
|
69
|
-
getLinkCollections(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemType, options: CollectionOptionsInterface & {
|
|
70
|
-
editItems: true;
|
|
71
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<EditResource>>>;
|
|
72
|
-
getLinkCollections(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemType, options: CollectionOptionsInterface): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ViewResource>>>;
|
|
73
|
-
getLinkCollectionsFromDef(definition: LinkCollectionDefinition): PromiseInterface<CollectionResourceParentIdMap>;
|
|
74
|
-
getAllLinkCollections(linkType: ItemType, itemType: ItemType, options: CollectionOptionsInterface & {
|
|
75
|
-
editItems: true;
|
|
76
|
-
editCollection: true;
|
|
77
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<EditResource>>>;
|
|
78
|
-
getAllLinkCollections(linkType: ItemType, itemType: ItemType, options: CollectionOptionsInterface & {
|
|
79
|
-
editCollection: true;
|
|
80
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ViewResource>>>;
|
|
81
|
-
getAllLinkCollections(linkType: ItemType, itemType: ItemType, options: CollectionOptionsInterface & {
|
|
82
|
-
editItems: true;
|
|
83
|
-
}): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<EditResource>>>;
|
|
84
|
-
getAllLinkCollections(linkType: ItemType, itemType: ItemType, options: CollectionOptionsInterface): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ViewResource>>>;
|
|
56
|
+
getLinkCollections(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemType, options: CollectionOptionsInterface): PromiseInterface<CollectionResourceParentIdMap>;
|
|
57
|
+
getLinkCollectionsFromDef(definition: any): PromiseInterface<CollectionResourceParentIdMap>;
|
|
58
|
+
getAllLinkCollections(linkType: ItemType, itemType: ItemType, options: CollectionOptionsInterface): PromiseInterface<CollectionResourceParentIdMap>;
|
|
85
59
|
cloneItem(itemResource: ItemResource, options: ItemOptionsInterface & {
|
|
86
60
|
edit: true;
|
|
87
61
|
}): EditResource;
|
|
88
62
|
cloneItem(itemResource: ItemResource, options: ItemOptionsInterface): ViewResource;
|
|
89
|
-
cloneCollection(collectionResource: CollectionResource, options: CollectionOptionsInterface & {
|
|
90
|
-
editItems: true;
|
|
91
|
-
editCollection: true;
|
|
92
|
-
}, conversionMap: ItemIdConversionMap): CollectionEditResource<EditResource>;
|
|
93
|
-
cloneCollection(collectionResource: CollectionResource, options: CollectionOptionsInterface & {
|
|
94
|
-
editItems: true;
|
|
95
|
-
}, conversionMap: ItemIdConversionMap): CollectionViewResource<EditResource>;
|
|
96
|
-
cloneCollection(collectionResource: CollectionResource, options: CollectionOptionsInterface & {
|
|
97
|
-
editCollection: true;
|
|
98
|
-
}, conversionMap: ItemIdConversionMap): CollectionEditResource<ViewResource>;
|
|
99
63
|
cloneCollection(collectionResource: CollectionResource, options: CollectionOptionsInterface, conversionMap: ItemIdConversionMap): CollectionViewResource<ViewResource>;
|
|
100
64
|
saveCurrentLocalCache(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakupByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): PromiseInterface<ItemIdConversionMap>;
|
|
101
65
|
getCurrentCollections(): CollectionCache;
|
|
102
66
|
getCurrentItems(): ItemCache;
|
|
103
|
-
getModuleChanges(localCache?: LocalCache): ModuleChangesCompilationResult;
|
|
67
|
+
getModuleChanges(localCache?: LocalCache): import("./ModuleChangesCompilation").ModuleChangesCompilationResult;
|
|
104
68
|
addSingleItem(itemEntry: ItemEntry, options: ItemResourceOptionsInterface & {
|
|
105
69
|
edit: true;
|
|
106
70
|
}, isRoot?: boolean, localCache?: LocalCache): EditResource;
|
|
@@ -121,14 +85,8 @@ export declare class ItemAdministrator {
|
|
|
121
85
|
}): CollectionEditResource<ViewResource>;
|
|
122
86
|
addCollection(collectionEntry: CollectionEntry, options: CollectionResourceOptionsInterface): CollectionViewResource<ViewResource>;
|
|
123
87
|
private createItemResources;
|
|
124
|
-
processLinkedItems(linkedEntries: LinkedItemEntryMap[], options: ItemOptionsInterface
|
|
125
|
-
|
|
126
|
-
}, addToCollections: boolean): ItemResourcesItemTypeMap<EditResource>;
|
|
127
|
-
processLinkedItems(linkedEntries: LinkedItemEntryMap[], options: ItemOptionsInterface, addToCollections: boolean): ItemResourcesItemTypeMap<ViewResource>;
|
|
128
|
-
expandProcessLinkedItems(linkedEntries: LinkedItemEntryMap[], options: ItemOptionsInterface & {
|
|
129
|
-
edit: true;
|
|
130
|
-
}): PromiseInterface<ItemResourcesItemTypeMap<EditResource>>;
|
|
131
|
-
expandProcessLinkedItems(linkedEntries: LinkedItemEntryMap[], options: ItemOptionsInterface): PromiseInterface<ItemResourcesItemTypeMap<ViewResource>>;
|
|
88
|
+
processLinkedItems(linkedEntries: LinkedItemEntryMap[], options: ItemOptionsInterface, addToCollections?: boolean): ItemResourcesItemTypeMap;
|
|
89
|
+
expandProcessLinkedItems(linkedEntries: LinkedItemEntryMap[], options: ItemOptionsInterface): PromiseInterface<ItemResourcesItemTypeMap>;
|
|
132
90
|
private constructOnItemsExpanded;
|
|
133
91
|
private expandAddToCollections;
|
|
134
92
|
private getColumnSuperset;
|
|
@@ -2,7 +2,7 @@ import { CollectionCache, ItemCache, LockService } from '../classes';
|
|
|
2
2
|
import { ChangesProcessorFactory, CollectionCacheFactory, CollectionResourceFactory, ItemCacheFactory, ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEditResource, CollectionEntry, CollectionResource, CollectionResourceOptionsInterface, CollectionViewResource, EditResource, ItemEntry, ItemResource, ViewResource } from '../models';
|
|
5
|
-
import { CollectionEntryParentIdMap,
|
|
5
|
+
import { CollectionEntryParentIdMap, CreateRequestParameterMap, ItemIdConversionMap, ItemOptionsInterface, LocalCacheCallbackCondition, OnSaveCallback, PromiseInterface } from '../types';
|
|
6
6
|
export declare class LocalCache {
|
|
7
7
|
private errorHandler;
|
|
8
8
|
private lockService;
|
|
@@ -42,17 +42,9 @@ export declare class LocalCache {
|
|
|
42
42
|
editItems: true;
|
|
43
43
|
}): CollectionViewResource<EditResource>;
|
|
44
44
|
createCollectionResource(collectionEntry: CollectionEntry, resourceOptions: CollectionResourceOptionsInterface): CollectionViewResource<ViewResource>;
|
|
45
|
-
createCollectionResources(collectionEntries: CollectionEntryParentIdMap, resourceOptions: CollectionResourceOptionsInterface
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}): CollectionResourceParentIdMap<CollectionEditResource<EditResource>>;
|
|
49
|
-
createCollectionResources(collectionEntries: CollectionEntryParentIdMap, resourceOptions: CollectionResourceOptionsInterface & {
|
|
50
|
-
editCollection: true;
|
|
51
|
-
}): CollectionResourceParentIdMap<CollectionEditResource<ViewResource>>;
|
|
52
|
-
createCollectionResources(collectionEntries: CollectionEntryParentIdMap, resourceOptions: CollectionResourceOptionsInterface & {
|
|
53
|
-
editItems: true;
|
|
54
|
-
}): CollectionResourceParentIdMap<CollectionViewResource<EditResource>>;
|
|
55
|
-
createCollectionResources(collectionEntries: CollectionEntryParentIdMap, resourceOptions: CollectionResourceOptionsInterface): CollectionResourceParentIdMap<CollectionViewResource<ViewResource>>;
|
|
45
|
+
createCollectionResources(collectionEntries: CollectionEntryParentIdMap, resourceOptions: CollectionResourceOptionsInterface): {
|
|
46
|
+
[parentId: string]: CollectionResource;
|
|
47
|
+
};
|
|
56
48
|
clearItem(itemResource: ItemResource): void;
|
|
57
49
|
clearItemEntry(itemEntry: ItemEntry): void;
|
|
58
50
|
clearCollection(collectionResource: CollectionResource): void;
|
|
@@ -18,7 +18,7 @@ export declare function isString(value: any): boolean;
|
|
|
18
18
|
export declare function isNumber(value: any): boolean;
|
|
19
19
|
export declare function isDate(value: any): boolean;
|
|
20
20
|
export declare const isArray: (arg: any) => arg is any[];
|
|
21
|
-
export declare function isFunction
|
|
21
|
+
export declare function isFunction(value: any): boolean;
|
|
22
22
|
export declare function isRegExp(value: any): boolean;
|
|
23
23
|
export declare function isBoolean(value: any): boolean;
|
|
24
24
|
export declare function isElement(node: any): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LocalCache } from '../classes';
|
|
2
2
|
import { CollectionResourceFactory } from '../factories';
|
|
3
|
-
import { CollectionEntry, CollectionResource, CollectionResourceOptions,
|
|
3
|
+
import { CollectionEntry, CollectionResource, CollectionResourceOptions, EditResource, ViewResource } from '../models';
|
|
4
4
|
import { FieldMap, ItemId, ItemIdConversionMap, PromiseInterface } from '../types';
|
|
5
|
-
export declare class CollectionEditResource<T extends
|
|
5
|
+
export declare class CollectionEditResource<T extends ViewResource | EditResource = ViewResource> extends CollectionResource<T> {
|
|
6
6
|
private factory;
|
|
7
7
|
constructor(factory: CollectionResourceFactory, collectionEntry: CollectionEntry, options: CollectionResourceOptions, localCache: LocalCache);
|
|
8
8
|
save(): PromiseInterface<ItemIdConversionMap>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LocalCache } from '../classes';
|
|
2
2
|
import { ItemResourceFactory } from '../factories';
|
|
3
|
-
import { CollectionResourceOptions,
|
|
3
|
+
import { CollectionResourceOptions, EditResource, ItemEntry, ViewResource } from '../models';
|
|
4
4
|
import { ItemResourceItemIdMap, PromiseInterface, QueryCallback, ResponseColumnMap } from '../types';
|
|
5
5
|
import { CollectionEntry } from './CollectionEntry';
|
|
6
|
-
export declare
|
|
6
|
+
export declare class CollectionResource<T extends ViewResource | EditResource = ViewResource> {
|
|
7
7
|
private itemResourceFactory;
|
|
8
8
|
entry: CollectionEntry;
|
|
9
9
|
options: CollectionResourceOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ItemEntry, ItemResourceOptions } from '../models';
|
|
2
2
|
import { FieldMap, ResponseColumn } from '../types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare class ItemResource {
|
|
4
4
|
entry: ItemEntry;
|
|
5
5
|
options: ItemResourceOptions;
|
|
6
6
|
protected readonly _isNew: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiResponseProcessor, CollectionMatcher, ColumnSet, LocalCache, RequestColumnExpansion } from '../classes';
|
|
2
2
|
import { ENTRY_STATUS } from '../constants';
|
|
3
|
-
import { CollectionEntry, CollectionEntryOptions, CollectionEntryOptionsInterface, CollectionResource, CollectionResourceOptions, CollectionResourceOptionsInterface,
|
|
3
|
+
import { CollectionEntry, CollectionEntryOptions, CollectionEntryOptionsInterface, CollectionResource, CollectionResourceOptions, CollectionResourceOptionsInterface, EditResource, ItemEntry, ItemEntryOptionsInterface, ItemResource, ItemResourceOptionsInterface, ViewResource } from '../models';
|
|
4
4
|
export declare type EntryParent = {
|
|
5
5
|
itemType: string;
|
|
6
6
|
itemId: number;
|
|
@@ -85,10 +85,10 @@ export interface FunctionChangesResolveSocketMessage extends SocketMessage {
|
|
|
85
85
|
[key: string]: any;
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
export declare type ItemResourceItemIdMap<T extends
|
|
88
|
+
export declare type ItemResourceItemIdMap<T extends ViewResource | EditResource = ViewResource> = {
|
|
89
89
|
[itemId: number]: T;
|
|
90
90
|
};
|
|
91
|
-
export declare type ItemResourcesItemTypeMap<T extends
|
|
91
|
+
export declare type ItemResourcesItemTypeMap<T extends ViewResource | EditResource = ViewResource> = {
|
|
92
92
|
[itemType: string]: T[];
|
|
93
93
|
};
|
|
94
94
|
export declare type ItemId = number;
|
|
@@ -129,8 +129,8 @@ export declare type QueryCallback = (queryParams: QueryParams) => QueryParams;
|
|
|
129
129
|
export declare type CollectionEntryParentIdMap = {
|
|
130
130
|
[parentId: number]: CollectionEntry;
|
|
131
131
|
};
|
|
132
|
-
export declare type CollectionResourceParentIdMap
|
|
133
|
-
[parentId: number]:
|
|
132
|
+
export declare type CollectionResourceParentIdMap = {
|
|
133
|
+
[parentId: number]: CollectionResource;
|
|
134
134
|
};
|
|
135
135
|
export declare type CollectionMatchResult = {
|
|
136
136
|
fitting: CollectionEntry[];
|
|
@@ -138,7 +138,7 @@ export declare type CollectionMatchResult = {
|
|
|
138
138
|
maybe: CollectionEntry[];
|
|
139
139
|
};
|
|
140
140
|
export interface ExtendedCollectionMatchResult extends CollectionMatchResult {
|
|
141
|
-
collection:
|
|
141
|
+
collection: CollectionResource;
|
|
142
142
|
}
|
|
143
143
|
export interface GroupedExtendedCollectionMatchResult {
|
|
144
144
|
[collectionId: number]: ExtendedCollectionMatchResult;
|
|
@@ -167,8 +167,8 @@ export declare type RootColumnMap = {
|
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
169
|
export declare type ApiResponse = ApiResponseProcessor;
|
|
170
|
-
export declare type TemplateItemResourceMap
|
|
171
|
-
main:
|
|
170
|
+
export declare type TemplateItemResourceMap = {
|
|
171
|
+
main: ItemResource;
|
|
172
172
|
linked: ItemResourcesItemTypeMap;
|
|
173
173
|
};
|
|
174
174
|
export declare type TemplateItemEntryMap = {
|