@rentman/rm-core 1.1.11 → 1.1.13
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 +204 -186
- 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/ItemHandler.d.ts +1 -1
- 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 -16
- package/dist/dist/models/ItemEntry.d.ts +3 -9
- package/dist/dist/models/ItemResource.d.ts +2 -1
- package/dist/dist/models/ViewResource.d.ts +1 -1
- package/dist/dist/types/ItemTypesCollection.d.ts +16 -3
- package/dist/rm-core.js +3831 -3476
- package/dist/rm-core.min.js +1 -1
- package/package.json +1 -1
|
@@ -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,23 +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
|
-
transactions: number
|
|
13
|
-
constructor(
|
|
7
|
+
transactions: number;
|
|
8
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry, options: any, isNew?: boolean);
|
|
14
9
|
isNew(): boolean;
|
|
15
|
-
start():
|
|
16
|
-
rollback():
|
|
17
|
-
commit(initial?: boolean):
|
|
10
|
+
start(): this;
|
|
11
|
+
rollback(): this;
|
|
12
|
+
commit(initial?: boolean): this;
|
|
18
13
|
getLocalCopy(): FieldMap | null;
|
|
19
|
-
copyFields(destination?:
|
|
20
|
-
setFields(values:
|
|
21
|
-
callOnChange(previous:
|
|
22
|
-
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>;
|
|
23
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,12 +3,13 @@ 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
|
+
constructor(entry: ItemEntry, options: any, _isNew?: boolean);
|
|
12
13
|
isNew(): boolean;
|
|
13
14
|
isLocal(): boolean;
|
|
14
15
|
clearResource(): 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
|
};
|