@rentman/rm-core 1.1.10 → 1.1.12
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 +22 -0
- package/dist/dist/classes/ApiFormatter.d.ts +1 -1
- package/dist/dist/classes/ChangesProcessor.d.ts +2 -0
- package/dist/dist/classes/CollectionCache.d.ts +7 -3
- package/dist/dist/classes/ItemAdministrator.d.ts +6 -10
- package/dist/dist/classes/ItemResourceService.d.ts +0 -2
- package/dist/dist/classes/KeyService.d.ts +2 -10
- package/dist/dist/classes/LocalCache.d.ts +3 -3
- package/dist/dist/factories/CollectionEntryFactory.d.ts +8 -8
- package/dist/dist/factories/CollectionResourceFactory.d.ts +8 -8
- package/dist/dist/factories/ItemEntryFactory.d.ts +7 -7
- package/dist/dist/factories/ItemResourceFactory.d.ts +10 -9
- package/dist/dist/models/CollectionEditResource.d.ts +6 -14
- package/dist/dist/models/CollectionEntry.d.ts +12 -19
- package/dist/dist/models/EditResource.d.ts +11 -15
- package/dist/dist/models/ItemEntry.d.ts +3 -9
- package/dist/dist/models/ItemResource.d.ts +3 -2
- package/dist/dist/models/ViewResource.d.ts +1 -1
- package/dist/dist/types/ItemTypesCollection.d.ts +16 -3
- package/dist/rm-core.js +3837 -3481
- package/dist/rm-core.min.js +1 -1
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
#Changelog
|
|
2
2
|
Contains new features, breaking changes and their reasoning
|
|
3
3
|
|
|
4
|
+
##v1.12
|
|
5
|
+
- **Breaking:** `ItemResource.isNew` returns true *only* if the resource was created using
|
|
6
|
+
`ItemAdministrator.getNewResource` or `ItemAdministrator.getItemByDef`. This fixes an issue where items where removed
|
|
7
|
+
from the local cache inadvertently.
|
|
8
|
+
- The `start`, `commit` and `rollback` functions of `EditResource` now return the resource itself to facilitate chaining.
|
|
9
|
+
- When calling `CollectionEntry.revertChanges`, callbacks like `onAdd` / `onRemove` and `onActivate` / `onDeactivate`
|
|
10
|
+
are now respected. This fixes an issue where items where *not* removed from the local cache.
|
|
11
|
+
- When removing *local* items from collections, they are removed from `initial` as well as `modified`. This fixes an
|
|
12
|
+
issue where changes were being detected continuously.
|
|
13
|
+
- Updated the order of requests in `changesProcessor`. The `update` request is now executed before the `delete` request,
|
|
14
|
+
except when updating documents. This fixes several issues.
|
|
15
|
+
- `CollectionCache` now uses a map instead of an array to store collections. This fixes an issue where the same
|
|
16
|
+
collection was added multiple times.
|
|
17
|
+
- Updated all models to use dependency objects. This increases ease of debugging.
|
|
18
|
+
|
|
19
|
+
##v.1.11
|
|
20
|
+
- Fixed issue that occurs when saving when having an existing item refer to a newly created item.
|
|
21
|
+
- **Breaking:** Removed `ItemResourceService.isNewResource`.
|
|
22
|
+
- **Breaking:** Renamed `ItemResource.isNewResource` to `ItemResource.isNew`. Removed parameter.
|
|
23
|
+
- `ItemResource.isNew` is equivalent to `ItemResource.isLocal`, while `EditResource.isNew` checks also checks for
|
|
24
|
+
completed transactions.
|
|
25
|
+
|
|
4
26
|
##v.1.10
|
|
5
27
|
- Fixed issue where changes on different subtabs were not detected.
|
|
6
28
|
|
|
@@ -27,7 +27,7 @@ export declare class ApiFormatter {
|
|
|
27
27
|
formatRequestDate(value: any): any;
|
|
28
28
|
formatRequestDuration(value: any): any;
|
|
29
29
|
formatRequestColor(value: any): any;
|
|
30
|
-
getDefaultValue(columnType: any): false |
|
|
30
|
+
getDefaultValue(columnType: any): false | moment.Moment | 0 | moment.Duration | "" | "0" | "#000000" | null;
|
|
31
31
|
isDefaultValue(columnType: any, value: any): any;
|
|
32
32
|
clone(columnType: any, value: any): any;
|
|
33
33
|
getCloneFunction(columnType: any): (date: any) => any;
|
|
@@ -17,6 +17,8 @@ export declare class ChangesProcessor {
|
|
|
17
17
|
private promiseService;
|
|
18
18
|
constructor(apiRequestService: ApiRequestServiceInterface, itemHandler: ItemHandler, errorHandler: ErrorHandlerInterface, collectionHandler: CollectionHandler, changesCompilationFactory: ChangesCompilationFactory, createRequestFactory: CreateRequestFactory, columnExpansionFactory: ColumnExpansionFactory, requestColumnExpansionFactory: RequestColumnExpansionFactory, collectionEntryService: CollectionEntryService, apiFormatter: ApiFormatter, promiseService: PromiseInterface);
|
|
19
19
|
getItemTypeUpdatePriority(itemType: any): 0 | 1 | 2;
|
|
20
|
+
isDocumentItemType(itemType: any): boolean;
|
|
21
|
+
isDocumentUpdate(compilation: any): boolean;
|
|
20
22
|
buildMoveRequest(compilationEntries: any): {};
|
|
21
23
|
getMapValue(itemType: any, itemId: any, map: any): any;
|
|
22
24
|
private executeCreateRequests(changesCompilation, parameters, conversionMap, breakupByParent?, onAfterCreateCallback?);
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { QueryMatcherFactory } from '../factories';
|
|
2
2
|
import { CollectionEntry, CollectionResource } from '../models';
|
|
3
|
-
import {
|
|
3
|
+
import { CollectionMatchResult, EntryParentNull, FieldMap, ItemType } from '../types';
|
|
4
4
|
export declare class CollectionCache {
|
|
5
5
|
private queryMatcherFactory;
|
|
6
|
-
entries:
|
|
6
|
+
entries: {
|
|
7
|
+
[itemType: string]: {
|
|
8
|
+
[collectionEntryId: number]: CollectionEntry;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
7
11
|
constructor(queryMatcherFactory: QueryMatcherFactory);
|
|
8
12
|
contains(collectionEntry: CollectionEntry): boolean;
|
|
9
|
-
some(callback: (entry: CollectionEntry) =>
|
|
13
|
+
some(callback: (entry: CollectionEntry) => boolean): boolean;
|
|
10
14
|
forEach(callback: (entry: CollectionEntry) => void): void;
|
|
11
15
|
toArray(): CollectionEntry[];
|
|
12
16
|
add(collectionEntry: CollectionEntry): CollectionEntry;
|
|
@@ -2,7 +2,7 @@ import { CollectionCache, CollectionEntryService, CollectionHandler, CollectionM
|
|
|
2
2
|
import { CollectionMatcherFactory, ColumnSetFactory, LocalCacheFactory, ModuleChangesCompilationFactory } from '../factories';
|
|
3
3
|
import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
5
|
-
import { CollectionEntryParentIdMap, CollectionResourceParentIdMap, CreateRequestParameterMap, ItemId, ItemIdConversionMap, ItemResourceItemTypeMap, ItemType, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types';
|
|
5
|
+
import { CollectionEntryParentIdMap, CollectionResourceParentIdMap, CreateRequestParameterMap, ItemDefinition, ItemId, ItemIdConversionMap, ItemOptions, ItemResourceItemTypeMap, ItemType, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types';
|
|
6
6
|
export declare class ItemAdministrator {
|
|
7
7
|
private apiRequestService;
|
|
8
8
|
private authInterface;
|
|
@@ -22,11 +22,7 @@ export declare class ItemAdministrator {
|
|
|
22
22
|
private promiseInterface;
|
|
23
23
|
private queryService;
|
|
24
24
|
constructor(apiRequestService: ApiRequestServiceInterface, authInterface: AuthInterface, collectionEntryService: CollectionEntryService, collectionHandler: CollectionHandler, collectionMatcherFactory: CollectionMatcherFactory, collectionResourceService: CollectionResourceService, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemHandler: ItemHandler, itemRequestService: ItemRequestService, keyService: KeyService, localCacheFactory: LocalCacheFactory, localCacheManager: LocalCacheManagerInterface, moduleChangesCompilationFactory: ModuleChangesCompilationFactory, promiseInterface: PromiseInterface, queryService: QueryService);
|
|
25
|
-
getItemDefinition(itemType: ItemType,
|
|
26
|
-
itemType: string;
|
|
27
|
-
options: any;
|
|
28
|
-
itemId: any;
|
|
29
|
-
};
|
|
25
|
+
getItemDefinition(itemType: ItemType, stateKey: number | string, options: ItemOptions): ItemDefinition;
|
|
30
26
|
getCollectionMatcher(itemEntries: ItemEntry[], addToTab: boolean): CollectionMatcher;
|
|
31
27
|
fetchTitle(itemType: any, itemId: any, deferRequest: any): Promise<any>;
|
|
32
28
|
getItemById(itemType: ItemType, itemId: ItemId, options: any): Promise<ItemResource>;
|
|
@@ -70,7 +66,7 @@ export declare class ItemAdministrator {
|
|
|
70
66
|
getLinkCollections(linkType: string, linkIdArray: number[], itemType: string, options: any): Promise<CollectionResourceParentIdMap>;
|
|
71
67
|
getLinkCollectionsFromDef(definition: any): Promise<CollectionResourceParentIdMap>;
|
|
72
68
|
getAllLinkCollections(linkType: string, itemType: string, options: any): Promise<CollectionEntryParentIdMap>;
|
|
73
|
-
getItemByDef(definition:
|
|
69
|
+
getItemByDef(definition: ItemDefinition, isRoot?: boolean): Promise<any>;
|
|
74
70
|
cloneItem(itemResource: ItemResource, options: any): ItemResource;
|
|
75
71
|
cloneCollection(collectionResource: CollectionResource, options: any, conversionMap: any): CollectionResource;
|
|
76
72
|
saveCurrentLocalCache(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakupByParent?: boolean, onAfterCreateCallback?: (conversionMap: ItemIdConversionMap) => void): any;
|
|
@@ -81,10 +77,10 @@ export declare class ItemAdministrator {
|
|
|
81
77
|
itemId: number;
|
|
82
78
|
items: any;
|
|
83
79
|
};
|
|
84
|
-
addSingleItem(itemEntry: ItemEntry, options:
|
|
85
|
-
addSingleItems(itemEntries: ItemEntry[], options:
|
|
80
|
+
addSingleItem(itemEntry: ItemEntry, options: ItemOptions, isRoot?: boolean, localCache?: LocalCache): ItemResource;
|
|
81
|
+
addSingleItems(itemEntries: ItemEntry[], options: ItemOptions): ItemResource[];
|
|
86
82
|
addCollection(collectionEntry: CollectionEntry, options: any): CollectionResource;
|
|
87
|
-
processLinkedItems(linkedEntries: TemplateResponseLinkedItemEntryMap[], options:
|
|
83
|
+
processLinkedItems(linkedEntries: TemplateResponseLinkedItemEntryMap[], options: ItemOptions, addToCollections: boolean): ItemResourceItemTypeMap;
|
|
88
84
|
getLocalCache(): LocalCache;
|
|
89
85
|
resetLocalCache(): void;
|
|
90
86
|
addToCollections(itemEntries: ItemEntry[], resultCollectionResource?: CollectionResource): ItemResource[] | null;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import { ItemId } from '../types';
|
|
1
|
+
import { ItemId, StateKey } from '../types';
|
|
2
2
|
export declare class KeyService {
|
|
3
3
|
separator: string;
|
|
4
4
|
constructor();
|
|
5
5
|
getSingleKey(itemType: string, itemId: number | string): string;
|
|
6
6
|
getCollectionCacheKey(parentType: string, parentId: number, childType: string): string;
|
|
7
7
|
getCssKey(): any;
|
|
8
|
-
parseStateKey(stateKey: string):
|
|
9
|
-
type: string;
|
|
10
|
-
template: string;
|
|
11
|
-
itemId?: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
type: string;
|
|
14
|
-
itemId: string;
|
|
15
|
-
template?: undefined;
|
|
16
|
-
} | null;
|
|
8
|
+
parseStateKey(stateKey: string): StateKey | null;
|
|
17
9
|
getDuplicateStateKey(itemId: string | number): string;
|
|
18
10
|
getNewStateKey(templateType: string): string;
|
|
19
11
|
getLocalId(): ItemId;
|
|
@@ -2,7 +2,7 @@ import { CollectionCache, ItemCache, ItemResourceService, LockService } from '..
|
|
|
2
2
|
import { ChangesProcessorFactory, CollectionCacheFactory, CollectionResourceFactory, ItemCacheFactory, ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
5
|
-
import { CollectionEntryParentIdMap, CreateRequestParameterMap, ItemIdConversionMap } from '../types';
|
|
5
|
+
import { CollectionEntryParentIdMap, CreateRequestParameterMap, ItemIdConversionMap, ItemOptions } from '../types';
|
|
6
6
|
export declare class LocalCache {
|
|
7
7
|
private errorHandler;
|
|
8
8
|
private lockService;
|
|
@@ -27,8 +27,8 @@ export declare class LocalCache {
|
|
|
27
27
|
changesInterval: null | number;
|
|
28
28
|
hasChanges: boolean;
|
|
29
29
|
constructor(errorHandler: ErrorHandlerInterface, lockService: LockService, itemResourceFactory: ItemResourceFactory, collectionCacheFactory: CollectionCacheFactory, changesProcessorFactory: ChangesProcessorFactory, itemCacheFactory: ItemCacheFactory, collectionResourceFactory: CollectionResourceFactory, itemResourceService: ItemResourceService, promiseService: PromiseInterface, id?: string);
|
|
30
|
-
createItemResource(itemEntry: ItemEntry, options:
|
|
31
|
-
createItemResources(itemEntries: ItemEntry[], options:
|
|
30
|
+
createItemResource(itemEntry: ItemEntry, options: ItemOptions, isRoot?: boolean, isNew?: boolean): ItemResource;
|
|
31
|
+
createItemResources(itemEntries: ItemEntry[], options: ItemOptions): ItemResource[];
|
|
32
32
|
createCollectionResource(collectionEntry: CollectionEntry, resourceOptions: any): CollectionResource;
|
|
33
33
|
createCollectionResources(collectionEntries: CollectionEntryParentIdMap, resourceOptions: any): {};
|
|
34
34
|
clearItem(itemResource: ItemResource): void;
|
|
@@ -3,14 +3,14 @@ import { ColumnSetFactory } from '../factories';
|
|
|
3
3
|
import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEntry } from '../models/';
|
|
5
5
|
export declare class CollectionEntryFactory {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
collectionEntryService: CollectionEntryService;
|
|
7
|
+
columnSetFactory: ColumnSetFactory;
|
|
8
|
+
errorHandler: ErrorHandlerInterface;
|
|
9
|
+
itemEntryService: ItemEntryService;
|
|
10
|
+
itemRequestService: ItemRequestService;
|
|
11
|
+
keyService: KeyService;
|
|
12
|
+
promiseService: PromiseInterface;
|
|
13
|
+
queryService: QueryService;
|
|
14
14
|
constructor(collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService);
|
|
15
15
|
construct(itemType: string, options: any): CollectionEntry;
|
|
16
16
|
}
|
|
@@ -3,14 +3,14 @@ import { ChangesProcessorFactory, ItemEntryFactory, ItemResourceFactory } from '
|
|
|
3
3
|
import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
4
4
|
import { CollectionEntry, CollectionResource } from '../models';
|
|
5
5
|
export declare class CollectionResourceFactory {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
errorHandler: ErrorHandlerInterface;
|
|
7
|
+
itemEntryFactory: ItemEntryFactory;
|
|
8
|
+
itemHandler: ItemHandler;
|
|
9
|
+
itemResourceFactory: ItemResourceFactory;
|
|
10
|
+
changesProcessorFactory: ChangesProcessorFactory;
|
|
11
|
+
keyService: KeyService;
|
|
12
|
+
promiseService: PromiseInterface;
|
|
13
|
+
collectionResourceService: CollectionResourceService;
|
|
14
14
|
constructor(errorHandler: ErrorHandlerInterface, itemEntryFactory: ItemEntryFactory, itemHandler: ItemHandler, itemResourceFactory: ItemResourceFactory, changesProcessorFactory: ChangesProcessorFactory, keyService: KeyService, promiseService: PromiseInterface, collectionResourceService: CollectionResourceService);
|
|
15
15
|
construct(collectionEntry: CollectionEntry, options: any): CollectionResource;
|
|
16
16
|
}
|
|
@@ -4,13 +4,13 @@ import { AuthInterface, PromiseInterface } from '../interfaces';
|
|
|
4
4
|
import { ItemEntry } from '../models';
|
|
5
5
|
import { EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType, RequestColumns } from '../types';
|
|
6
6
|
export declare class ItemEntryFactory {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
constructor(authInterface: AuthInterface, apiFormatter: ApiFormatter, columnSetFactory: ColumnSetFactory, itemEntryService: ItemEntryService, keyService: KeyService,
|
|
7
|
+
authInterface: AuthInterface;
|
|
8
|
+
apiFormatter: ApiFormatter;
|
|
9
|
+
columnSetFactory: ColumnSetFactory;
|
|
10
|
+
itemEntryService: ItemEntryService;
|
|
11
|
+
keyService: KeyService;
|
|
12
|
+
promiseService: PromiseInterface;
|
|
13
|
+
constructor(authInterface: AuthInterface, apiFormatter: ApiFormatter, columnSetFactory: ColumnSetFactory, itemEntryService: ItemEntryService, keyService: KeyService, promiseService: PromiseInterface);
|
|
14
14
|
constructStub(itemType: ItemType, itemId: ItemId, columnSetStub: any): ItemEntry;
|
|
15
15
|
constructLocalLinked(itemType: ItemType, localItemId: ItemId, initial: FieldMap, parent: EntryParentNull, columnSet: ColumnSet, conversionMap: ItemIdConversionMap): ItemEntry;
|
|
16
16
|
constructLocal(itemId: ItemId, template: any, modified: FieldMap, derived: FieldMap, parent?: EntryParentNull, conversionMap?: any): ItemEntry;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ApiFormatter, ChangesProcessor, ItemResourceService, LockService } from '../classes';
|
|
2
2
|
import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
3
|
-
import {
|
|
3
|
+
import { ItemEntry, ItemResource } from '../models';
|
|
4
|
+
import { ItemOptions } from '../types';
|
|
4
5
|
export declare class ItemResourceFactory {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
itemResourceService: ItemResourceService;
|
|
7
|
+
apiFormatter: ApiFormatter;
|
|
8
|
+
lockService: LockService;
|
|
9
|
+
changesProcessor: ChangesProcessor;
|
|
10
|
+
errorHandler: ErrorHandlerInterface;
|
|
11
|
+
promiseService: PromiseInterface;
|
|
11
12
|
constructor(itemResourceService: ItemResourceService, apiFormatter: ApiFormatter, lockService: LockService, changesProcessor: ChangesProcessor, errorHandler: ErrorHandlerInterface, promiseService: PromiseInterface);
|
|
12
|
-
getConstructor(options:
|
|
13
|
-
construct(itemEntry: ItemEntry, options:
|
|
13
|
+
getConstructor(options: ItemOptions): (itemEntry: ItemEntry) => ItemResource;
|
|
14
|
+
construct(itemEntry: ItemEntry, options: ItemOptions, isNew?: boolean): ItemResource;
|
|
14
15
|
}
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
4
|
-
import { CollectionEntry } from './CollectionEntry';
|
|
5
|
-
import { CollectionResource } from './CollectionResource';
|
|
1
|
+
import { CollectionResourceFactory } from '../factories';
|
|
2
|
+
import { CollectionEntry, CollectionResource, ItemResource } from '../models';
|
|
6
3
|
export declare class CollectionEditResource extends CollectionResource {
|
|
7
|
-
private
|
|
8
|
-
|
|
9
|
-
private changesProcessorFactory;
|
|
10
|
-
private keyService;
|
|
11
|
-
private promiseService;
|
|
12
|
-
private itemEntryFactory;
|
|
13
|
-
constructor(errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, itemResourceFactory: ItemResourceFactory, changesProcessorFactory: ChangesProcessorFactory, keyService: KeyService, promiseService: PromiseInterface, itemEntryFactory: ItemEntryFactory, collectionEntry: CollectionEntry, options: any);
|
|
4
|
+
private factory;
|
|
5
|
+
constructor(factory: CollectionResourceFactory, collectionEntry: CollectionEntry, options: any);
|
|
14
6
|
save(): Promise<any>;
|
|
15
|
-
moveItems(idArray: any, destination: any, enableCallbacks: any):
|
|
7
|
+
moveItems(idArray: any, destination: any, enableCallbacks: any): ItemResource[];
|
|
16
8
|
removeItems(idArray: any, enableCallbacks: any): Promise<any>;
|
|
17
9
|
removeItem(itemId: any, enableCallbacks: any): Promise<any>;
|
|
18
10
|
addItems(valuesArray: any, enableCallbacks?: boolean): Promise<any>;
|
|
19
11
|
addItem(values: any, enableCallbacks: any): Promise<any>;
|
|
20
|
-
clear(enableCallbacks: any):
|
|
12
|
+
clear(enableCallbacks: any): ItemResource[] | null;
|
|
21
13
|
}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CollectionEntryFactory
|
|
3
|
-
import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
1
|
+
import { ColumnExpansion, ColumnInfo, ColumnSet } from '../classes';
|
|
2
|
+
import { CollectionEntryFactory } from '../factories';
|
|
4
3
|
import { CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
5
4
|
import { EntryParentNull, ItemId, ItemIdConversionMap, ItemType, RequestColumns } from '../types';
|
|
6
5
|
export declare class CollectionEntry {
|
|
7
|
-
private
|
|
8
|
-
private collectionEntryService;
|
|
9
|
-
private columnSetFactory;
|
|
10
|
-
private errorHandler;
|
|
11
|
-
private itemEntryService;
|
|
12
|
-
private itemRequestService;
|
|
13
|
-
private keyService;
|
|
14
|
-
private promiseService;
|
|
15
|
-
private queryService;
|
|
6
|
+
private factory;
|
|
16
7
|
itemType: ItemType;
|
|
17
8
|
options: any;
|
|
18
9
|
id: number;
|
|
@@ -27,21 +18,23 @@ export declare class CollectionEntry {
|
|
|
27
18
|
reloadQueued: boolean;
|
|
28
19
|
hasEditResources: boolean;
|
|
29
20
|
hasItemEditResources: boolean;
|
|
30
|
-
constructor(
|
|
21
|
+
constructor(factory: CollectionEntryFactory, itemType: ItemType, options: any);
|
|
31
22
|
isDeferred(): boolean;
|
|
32
23
|
resolve(itemEntryCompound: {
|
|
33
24
|
columns: ColumnSet;
|
|
34
25
|
items: ItemEntry[];
|
|
35
26
|
}): CollectionEntry;
|
|
36
27
|
isLocal(): boolean;
|
|
37
|
-
matchParent(itemType:
|
|
28
|
+
matchParent(itemType: ItemType, itemId: ItemId): boolean;
|
|
38
29
|
forEach(callback: (itemEntry: ItemEntry) => void): void;
|
|
39
30
|
getItemById(itemId: any): ItemEntry | undefined;
|
|
40
|
-
getIdArray(accumulator?:
|
|
41
|
-
addItems(itemEntries:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
getIdArray(accumulator?: ItemId[]): ItemId[];
|
|
32
|
+
addItems(itemEntries: ItemEntry[], resultResource?: CollectionResource | null, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): ItemResource[] | null;
|
|
33
|
+
private handleAddedItemCallbacks(entriesAddedToInitial, entriesAddedToModified, resultResource?, callOnAdd?, callOnActivate?);
|
|
34
|
+
removeItems(idArray: ItemId[], resultResource?: CollectionResource | null, updateInitial?: boolean, enableCallback?: boolean): ItemResource[] | null;
|
|
35
|
+
clear(resultResource?: CollectionResource | null, updateInitial?: boolean, enableCallback?: boolean): ItemResource[] | null;
|
|
36
|
+
handleRemovedItems(filterFunction: (itemEntry: ItemEntry) => boolean, resultResource?: CollectionResource | null, updateInitial?: boolean, enableCallback?: boolean): ItemResource[] | null;
|
|
37
|
+
private handleRemovedItemCallbacks(removedFromInitial, removedFromModified, resultResource?, callOnRemove?);
|
|
45
38
|
expand(newColumns: any): Promise<any>;
|
|
46
39
|
extendQuery(callback: any): any;
|
|
47
40
|
extend(queryCallback: any, collectionResource: any, callOnAdd?: any, updateInitial?: any): Promise<any>;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
1
|
+
import { ItemResourceFactory } from '../factories';
|
|
3
2
|
import { FieldMap } from '../types';
|
|
4
3
|
import { ItemEntry, ItemResource } from './';
|
|
5
4
|
export declare class EditResource extends ItemResource {
|
|
6
|
-
private
|
|
7
|
-
private lockService;
|
|
8
|
-
private changesProcessor;
|
|
9
|
-
private errorHandler;
|
|
10
|
-
private promiseService;
|
|
5
|
+
private factory;
|
|
11
6
|
localCopies: FieldMap[];
|
|
12
7
|
transactions: number;
|
|
13
|
-
constructor(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry, options: any, isNew?: boolean);
|
|
9
|
+
isNew(): boolean;
|
|
10
|
+
start(): this;
|
|
11
|
+
rollback(): this;
|
|
12
|
+
commit(initial?: boolean): this;
|
|
17
13
|
getLocalCopy(): FieldMap | null;
|
|
18
|
-
copyFields(destination?:
|
|
19
|
-
setFields(values:
|
|
20
|
-
callOnChange(previous:
|
|
21
|
-
save(parameters?: any):
|
|
14
|
+
copyFields(destination?: FieldMap): FieldMap;
|
|
15
|
+
setFields(values: FieldMap, callOnChange?: boolean): this;
|
|
16
|
+
callOnChange(previous: FieldMap): this;
|
|
17
|
+
save(parameters?: any): Promise<this>;
|
|
22
18
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColumnSet } from '../classes';
|
|
2
2
|
import { ItemEntryFactory } from '../factories';
|
|
3
|
-
import { AuthInterface, PromiseInterface } from '../interfaces';
|
|
4
3
|
import { ItemResource } from '../models';
|
|
5
4
|
import { EntryParentNull, FieldMap, ItemId, ItemIdConversionMap } from '../types';
|
|
6
5
|
export declare class ItemEntry {
|
|
7
|
-
private
|
|
8
|
-
private authInterface;
|
|
9
|
-
private itemEntryFactory;
|
|
10
|
-
private apiFormatter;
|
|
11
|
-
private itemEntryService;
|
|
12
|
-
private keyService;
|
|
6
|
+
private factory;
|
|
13
7
|
itemType: string;
|
|
14
8
|
itemId: ItemId;
|
|
15
9
|
columns: ColumnSet;
|
|
@@ -21,7 +15,7 @@ export declare class ItemEntry {
|
|
|
21
15
|
modified: FieldMap;
|
|
22
16
|
derived: FieldMap;
|
|
23
17
|
resources: ItemResource[];
|
|
24
|
-
constructor(
|
|
18
|
+
constructor(factory: ItemEntryFactory, itemType: string, itemId: ItemId, columns: ColumnSet);
|
|
25
19
|
defer(deferRequest: any): this;
|
|
26
20
|
resolve(): this;
|
|
27
21
|
resolveDeferred(initial: any, derived: any, columns: any): this;
|
|
@@ -3,13 +3,14 @@ import { FieldMap, ResponseColumn } from '../types';
|
|
|
3
3
|
export declare class ItemResource {
|
|
4
4
|
entry: ItemEntry;
|
|
5
5
|
options: any;
|
|
6
|
+
protected readonly _isNew: boolean;
|
|
6
7
|
columns: {
|
|
7
8
|
[columnId: string]: ResponseColumn;
|
|
8
9
|
};
|
|
9
10
|
fields: FieldMap;
|
|
10
11
|
derived: FieldMap;
|
|
11
|
-
constructor(entry: ItemEntry, options: any);
|
|
12
|
-
|
|
12
|
+
constructor(entry: ItemEntry, options: any, _isNew?: boolean);
|
|
13
|
+
isNew(): boolean;
|
|
13
14
|
isLocal(): boolean;
|
|
14
15
|
clearResource(): void;
|
|
15
16
|
deactivate(): void;
|
|
@@ -9,6 +9,22 @@ export declare type EntryParentNull = EntryParent | null;
|
|
|
9
9
|
export declare type FieldMap = {
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
};
|
|
12
|
+
export declare type ItemOptions = any;
|
|
13
|
+
export declare type ItemDefinition = {
|
|
14
|
+
itemType: ItemType;
|
|
15
|
+
itemId: ItemId;
|
|
16
|
+
options: ItemOptions;
|
|
17
|
+
isNew: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const enum StateKeyType {
|
|
20
|
+
New = 0,
|
|
21
|
+
Duplicate = 1,
|
|
22
|
+
}
|
|
23
|
+
export declare type StateKey = {
|
|
24
|
+
type: StateKeyType;
|
|
25
|
+
template?: string;
|
|
26
|
+
itemId?: string;
|
|
27
|
+
};
|
|
12
28
|
export declare type ItemResourceItemIdMap = {
|
|
13
29
|
[itemId: number]: ItemResource;
|
|
14
30
|
};
|
|
@@ -39,9 +55,6 @@ export declare type CollectionEntryBatchStatusMap = {
|
|
|
39
55
|
export declare type CollectionEntryParentIdMap = {
|
|
40
56
|
[parentId: number]: CollectionEntry;
|
|
41
57
|
};
|
|
42
|
-
export declare type CollectionEntryItemTypeMap = {
|
|
43
|
-
[itemType: string]: CollectionEntry[];
|
|
44
|
-
};
|
|
45
58
|
export declare type CollectionResourceParentIdMap = {
|
|
46
59
|
[parentId: number]: CollectionResource;
|
|
47
60
|
};
|