@rentman/rm-core 1.6.13-3 → 1.7.1
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 +19 -1
- package/dist/rm-core.js +5177 -5512
- package/dist/rm-core.min.js +1 -1
- package/dist/src/classes/CollectionCache.d.ts +4 -7
- package/dist/src/classes/ColumnSet.d.ts +12 -5
- package/dist/src/classes/ItemAdministrator.d.ts +82 -85
- package/dist/src/classes/LocalCache.d.ts +34 -28
- package/dist/src/classes/ResourceCache.d.ts +25 -0
- package/dist/src/classes/index.d.ts +1 -1
- package/dist/src/core.d.ts +3 -3
- package/dist/src/factories/CollectionCacheFactory.d.ts +3 -2
- package/dist/src/factories/CollectionEntryFactory.d.ts +4 -3
- package/dist/src/factories/CollectionResourceFactory.d.ts +12 -11
- package/dist/src/factories/ColumnSetFactory.d.ts +0 -6
- package/dist/src/factories/ItemEntryFactory.d.ts +4 -3
- package/dist/src/factories/ItemResourceFactory.d.ts +11 -8
- package/dist/src/factories/LocalCacheFactory.d.ts +5 -5
- package/dist/src/factories/index.d.ts +0 -1
- package/dist/src/interfaces/LocalCacheManagerInterface.d.ts +0 -1
- package/dist/src/models/CollectionEditResource.d.ts +1 -1
- package/dist/src/models/CollectionEntry.d.ts +3 -5
- package/dist/src/models/CollectionResource.d.ts +5 -4
- package/dist/src/models/CollectionResourceOptions.d.ts +0 -2
- package/dist/src/models/CollectionViewResource.d.ts +1 -1
- package/dist/src/models/EditResource.d.ts +4 -4
- package/dist/src/models/ItemEntry.d.ts +2 -5
- package/dist/src/models/ItemResource.d.ts +7 -3
- package/dist/src/models/ItemResourceOptions.d.ts +0 -2
- package/dist/src/models/LocalViewResource.d.ts +3 -1
- package/dist/src/models/RemoteViewResource.d.ts +3 -1
- package/dist/src/models/ViewResource.d.ts +3 -1
- package/dist/src/types/ItemTypesCollection.d.ts +18 -1
- package/package.json +36 -35
- package/dist/src/classes/LocalCacheEventHandler.d.ts +0 -19
- package/dist/src/factories/ChangesProcessorFactory.d.ts +0 -18
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { KeyService, LocalCache } from '../classes';
|
|
2
|
-
import {
|
|
1
|
+
import { ChangesProcessor, KeyService, LocalCache, ResourceCache } from '../classes';
|
|
2
|
+
import { ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
|
-
import { CollectionEditResource, CollectionEntry, CollectionResourceOptionsInterface, CollectionViewResource, EditResource, LocalViewResource, RemoteViewResource } from '../models';
|
|
4
|
+
import { CollectionEditResource, CollectionEntry, CollectionResource, CollectionResourceOptionsInterface, CollectionViewResource, EditResource, LocalViewResource, RemoteViewResource } from '../models';
|
|
5
5
|
export declare class CollectionResourceFactory {
|
|
6
6
|
errorHandler: ErrorHandlerInterface;
|
|
7
7
|
exceptionHandler: ExceptionHandlerInterface;
|
|
8
8
|
itemResourceFactory: ItemResourceFactory;
|
|
9
|
-
|
|
9
|
+
changesProcessor: ChangesProcessor;
|
|
10
10
|
keyService: KeyService;
|
|
11
11
|
promiseService: PromiseLibraryInterface;
|
|
12
|
-
|
|
12
|
+
readonly cache: ResourceCache<CollectionResource>;
|
|
13
|
+
constructor(errorHandler: ErrorHandlerInterface, exceptionHandler: ExceptionHandlerInterface, itemResourceFactory: ItemResourceFactory, changesProcessor: ChangesProcessor, keyService: KeyService, promiseService: PromiseLibraryInterface);
|
|
13
14
|
construct(collectionEntry: CollectionEntry, options: CollectionResourceOptionsInterface & {
|
|
14
15
|
editItems: true;
|
|
15
16
|
editCollection: true;
|
|
16
|
-
}, localCache: LocalCache): CollectionEditResource<EditResource>;
|
|
17
|
+
}, level: number, localCache: LocalCache | null): CollectionEditResource<EditResource>;
|
|
17
18
|
construct(collectionEntry: CollectionEntry, options: CollectionResourceOptionsInterface & {
|
|
18
19
|
remoteItems: true;
|
|
19
20
|
editCollection: true;
|
|
20
|
-
}, localCache: LocalCache): CollectionEditResource<RemoteViewResource>;
|
|
21
|
+
}, level: number, localCache: LocalCache | null): CollectionEditResource<RemoteViewResource>;
|
|
21
22
|
construct(collectionEntry: CollectionEntry, options: CollectionResourceOptionsInterface & {
|
|
22
23
|
editCollection: true;
|
|
23
|
-
}, localCache: LocalCache): CollectionEditResource<LocalViewResource>;
|
|
24
|
+
}, level: number, localCache: LocalCache | null): CollectionEditResource<LocalViewResource>;
|
|
24
25
|
construct(collectionEntry: CollectionEntry, options: CollectionResourceOptionsInterface & {
|
|
25
26
|
editItems: true;
|
|
26
|
-
}, localCache: LocalCache): CollectionViewResource<EditResource>;
|
|
27
|
+
}, level: number, localCache: LocalCache | null): CollectionViewResource<EditResource>;
|
|
27
28
|
construct(collectionEntry: CollectionEntry, options: CollectionResourceOptionsInterface & {
|
|
28
29
|
remoteItems: true;
|
|
29
|
-
}, localCache: LocalCache): CollectionViewResource<RemoteViewResource>;
|
|
30
|
-
construct(collectionEntry: CollectionEntry, options: CollectionResourceOptionsInterface, localCache: LocalCache): CollectionViewResource<LocalViewResource>;
|
|
30
|
+
}, level: number, localCache: LocalCache | null): CollectionViewResource<RemoteViewResource>;
|
|
31
|
+
construct(collectionEntry: CollectionEntry, options: CollectionResourceOptionsInterface, level: number, localCache: LocalCache | null): CollectionViewResource<LocalViewResource>;
|
|
31
32
|
}
|
|
@@ -7,11 +7,5 @@ export declare class ColumnSetFactory {
|
|
|
7
7
|
private columnInfoFactory;
|
|
8
8
|
constructor(columnHandler: ColumnHandler, columnUtil: ColumnUtil, columnInfoFactory: ColumnInfoFactory);
|
|
9
9
|
constructStub(itemType: ItemType, requestColumns: ApiRequestColumns): ColumnSet;
|
|
10
|
-
resolveStub(columnSet: ColumnSet, responseColumns: ResponseColumnMap, enableCaching?: boolean, includeIdColumn?: boolean): ColumnSet;
|
|
11
10
|
construct(itemType: ItemType, requestColumns: ApiRequestColumns, responseColumns: ResponseColumnMap, enableCaching?: boolean, includeIdColumn?: boolean): ColumnSet;
|
|
12
|
-
constructFromResponse(itemType: ItemType, responseColumns: ResponseColumnMap, enableCaching?: boolean): ColumnSet;
|
|
13
|
-
private processResponseColumns;
|
|
14
|
-
private processRequestColumns;
|
|
15
|
-
private processColumnInfo;
|
|
16
|
-
private expandRootColumnMap;
|
|
17
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiFormatter, ColumnSet, ItemEntryService, KeyService } from '../classes';
|
|
2
|
-
import { ColumnSetFactory } from '../factories';
|
|
3
|
-
import {
|
|
2
|
+
import { ColumnSetFactory, ItemResourceFactory } from '../factories';
|
|
3
|
+
import { AuthInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
4
|
import { ItemEntry, Template } from '../models';
|
|
5
5
|
import { ApiRequestColumns, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType } from '../types';
|
|
6
6
|
export declare class ItemEntryFactory {
|
|
@@ -9,9 +9,10 @@ export declare class ItemEntryFactory {
|
|
|
9
9
|
columnSetFactory: ColumnSetFactory;
|
|
10
10
|
exceptionHandler: ExceptionHandlerInterface;
|
|
11
11
|
itemEntryService: ItemEntryService;
|
|
12
|
+
itemResourceFactory: ItemResourceFactory;
|
|
12
13
|
keyService: KeyService;
|
|
13
14
|
promiseService: PromiseLibraryInterface;
|
|
14
|
-
constructor(authInterface: AuthInterface, apiFormatter: ApiFormatter, columnSetFactory: ColumnSetFactory, exceptionHandler: ExceptionHandlerInterface, itemEntryService: ItemEntryService, keyService: KeyService, promiseService: PromiseLibraryInterface);
|
|
15
|
+
constructor(authInterface: AuthInterface, apiFormatter: ApiFormatter, columnSetFactory: ColumnSetFactory, exceptionHandler: ExceptionHandlerInterface, itemEntryService: ItemEntryService, itemResourceFactory: ItemResourceFactory, keyService: KeyService, promiseService: PromiseLibraryInterface);
|
|
15
16
|
constructStub(itemType: ItemType, itemId: ItemId, columnSetStub: ColumnSet): ItemEntry;
|
|
16
17
|
constructLocalLinked(itemType: ItemType, itemId: ItemId, initial: FieldMap, parent: EntryParentNull, columnSet: ColumnSet, conversionMap: ItemIdConversionMap): ItemEntry;
|
|
17
18
|
constructLocal(itemId: ItemId, template: Template, modified: FieldMap, derived: FieldMap, parent?: EntryParentNull, columnSet?: ColumnSet, conversionMap?: ItemIdConversionMap): ItemEntry;
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import { ApiFormatter, ChangesProcessor, LockService } from '../classes';
|
|
1
|
+
import { ApiFormatter, ChangesProcessor, LocalCache, LockService, ResourceCache } from '../classes';
|
|
2
2
|
import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
3
|
-
import { EditResource, ItemEntry, LocalViewResource, RemoteViewResource } from '../models';
|
|
3
|
+
import { EditResource, ItemEntry, ItemResource, LocalViewResource, RemoteViewResource } from '../models';
|
|
4
4
|
import { ItemOptionsInterface } from '../types';
|
|
5
|
+
export declare type ResourceConstructor<T extends ItemResource> = (itemEntry: ItemEntry) => T;
|
|
5
6
|
export declare class ItemResourceFactory {
|
|
6
7
|
apiFormatter: ApiFormatter;
|
|
7
8
|
lockService: LockService;
|
|
8
9
|
changesProcessor: ChangesProcessor;
|
|
9
10
|
errorHandler: ErrorHandlerInterface;
|
|
10
11
|
promiseService: PromiseLibraryInterface;
|
|
12
|
+
readonly cache: ResourceCache<ItemResource>;
|
|
11
13
|
constructor(apiFormatter: ApiFormatter, lockService: LockService, changesProcessor: ChangesProcessor, errorHandler: ErrorHandlerInterface, promiseService: PromiseLibraryInterface);
|
|
12
14
|
getConstructor(options: ItemOptionsInterface & {
|
|
13
15
|
edit: true;
|
|
14
|
-
}
|
|
16
|
+
}, level: number, localCache: LocalCache | null): ResourceConstructor<EditResource>;
|
|
15
17
|
getConstructor(options: ItemOptionsInterface & {
|
|
16
18
|
remote: true;
|
|
17
|
-
}
|
|
18
|
-
getConstructor(options: ItemOptionsInterface
|
|
19
|
+
}, level: number, localCache: LocalCache | null): ResourceConstructor<RemoteViewResource>;
|
|
20
|
+
getConstructor(options: ItemOptionsInterface, level: number, localCache: LocalCache | null): ResourceConstructor<LocalViewResource>;
|
|
19
21
|
construct(itemEntry: ItemEntry, options: ItemOptionsInterface & {
|
|
20
22
|
edit: true;
|
|
21
|
-
}, isNew?: boolean): EditResource;
|
|
23
|
+
}, level: number, localCache?: LocalCache | null, isNew?: boolean): EditResource;
|
|
22
24
|
construct(itemEntry: ItemEntry, options: ItemOptionsInterface & {
|
|
23
25
|
remote: true;
|
|
24
|
-
}, isNew?: boolean): LocalViewResource;
|
|
25
|
-
construct(itemEntry: ItemEntry, options: ItemOptionsInterface, isNew?: boolean): RemoteViewResource;
|
|
26
|
+
}, level: number, localCache?: LocalCache | null, isNew?: boolean): LocalViewResource;
|
|
27
|
+
construct(itemEntry: ItemEntry, options: ItemOptionsInterface, level: number, localCache?: LocalCache | null, isNew?: boolean): RemoteViewResource;
|
|
28
|
+
private constructWithOptions;
|
|
26
29
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LocalCache, LockService } from '../classes';
|
|
2
|
-
import {
|
|
1
|
+
import { ChangesProcessor, LocalCache, LockService } from '../classes';
|
|
2
|
+
import { CollectionCacheFactory, CollectionResourceFactory, ItemCacheFactory, ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
4
|
export declare class LocalCacheFactory {
|
|
5
|
-
private
|
|
5
|
+
private changesProcessor;
|
|
6
6
|
private collectionCacheFactory;
|
|
7
7
|
private collectionResourceFactory;
|
|
8
8
|
private errorHandler;
|
|
@@ -11,6 +11,6 @@ export declare class LocalCacheFactory {
|
|
|
11
11
|
private itemResourceFactory;
|
|
12
12
|
private lockService;
|
|
13
13
|
private promiseService;
|
|
14
|
-
constructor(
|
|
15
|
-
construct(id
|
|
14
|
+
constructor(changesProcessor: ChangesProcessor, collectionCacheFactory: CollectionCacheFactory, collectionResourceFactory: CollectionResourceFactory, errorHandler: ErrorHandlerInterface, exceptionHandler: ExceptionHandlerInterface, itemCacheFactory: ItemCacheFactory, itemResourceFactory: ItemResourceFactory, lockService: LockService, promiseService: PromiseLibraryInterface);
|
|
15
|
+
construct(id: string, defaultResourceLevel: number): LocalCache;
|
|
16
16
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './ApiResponseProcessorFactory';
|
|
2
2
|
export * from './BatchStatusFactory';
|
|
3
3
|
export * from './ChangesCompilationFactory';
|
|
4
|
-
export * from './ChangesProcessorFactory';
|
|
5
4
|
export * from './CollectionCacheFactory';
|
|
6
5
|
export * from './CollectionEntryFactory';
|
|
7
6
|
export * from './CollectionMatcherFactory';
|
|
@@ -3,7 +3,7 @@ import { CollectionResourceFactory } from '../factories';
|
|
|
3
3
|
import { CollectionEntry, CollectionResource, CollectionResourceOptions, ItemResource, LocalViewResource } from '../models';
|
|
4
4
|
import { FieldMap, ItemId, ItemIdConversionMap, PromiseInterface } from '../types';
|
|
5
5
|
export declare class CollectionEditResource<T extends ItemResource = LocalViewResource> extends CollectionResource<T> {
|
|
6
|
-
constructor(factory: CollectionResourceFactory, collectionEntry: CollectionEntry, options: CollectionResourceOptions, localCache: LocalCache);
|
|
6
|
+
constructor(factory: CollectionResourceFactory, collectionEntry: CollectionEntry, options: CollectionResourceOptions, level: number, localCache: LocalCache | null);
|
|
7
7
|
save(): PromiseInterface<ItemIdConversionMap>;
|
|
8
8
|
moveItems(idArray: ItemId[], destination: CollectionResource, enableCallbacks?: boolean): T[];
|
|
9
9
|
removeItems(idArray: ItemId[], callOnRemove?: boolean): PromiseInterface<T[]>;
|
|
@@ -8,19 +8,19 @@ export declare class CollectionEntry {
|
|
|
8
8
|
itemType: ItemType;
|
|
9
9
|
options: CollectionEntryOptions;
|
|
10
10
|
id: number;
|
|
11
|
+
parent: EntryParentNull;
|
|
11
12
|
query: CollectionQuery;
|
|
12
13
|
columns: ColumnSet;
|
|
13
|
-
templateColumns
|
|
14
|
-
parent: EntryParentNull;
|
|
14
|
+
private templateColumns;
|
|
15
15
|
initial: ItemEntry[];
|
|
16
16
|
items: ItemEntry[];
|
|
17
|
-
resources: CollectionResource[];
|
|
18
17
|
deferred?: Deferred<this>;
|
|
19
18
|
promise: PromiseInterface<this>;
|
|
20
19
|
reloadQueued: boolean;
|
|
21
20
|
hasEditResources: boolean;
|
|
22
21
|
hasItemEditResources: boolean;
|
|
23
22
|
constructor(factory: CollectionEntryFactory, itemType: ItemType, options: CollectionEntryOptions);
|
|
23
|
+
private getResources;
|
|
24
24
|
defer(): this;
|
|
25
25
|
isDeferred(): boolean;
|
|
26
26
|
_resolve(): this;
|
|
@@ -67,8 +67,6 @@ export declare class CollectionEntry {
|
|
|
67
67
|
hasAddedItems(): boolean;
|
|
68
68
|
hasRemovedItems(): boolean;
|
|
69
69
|
hasUpdatedItems(): boolean;
|
|
70
|
-
getCurrentResource<T extends CollectionResource>(): T;
|
|
71
|
-
clearResources(isSubtabChange?: boolean): void;
|
|
72
70
|
/**
|
|
73
71
|
* @description
|
|
74
72
|
* this doesn't revert updates
|
|
@@ -6,12 +6,13 @@ export declare abstract class CollectionResource<T extends ItemResource = LocalV
|
|
|
6
6
|
protected factory: CollectionResourceFactory;
|
|
7
7
|
entry: CollectionEntry;
|
|
8
8
|
options: CollectionResourceOptions;
|
|
9
|
-
|
|
9
|
+
level: number;
|
|
10
|
+
localCache: LocalCache | null;
|
|
10
11
|
items: T[];
|
|
11
|
-
itemIdMap: ItemResourceItemIdMap<T>;
|
|
12
12
|
columns: ResponseColumnMap;
|
|
13
|
+
protected itemIdMap: ItemResourceItemIdMap<T>;
|
|
13
14
|
private readonly onChange;
|
|
14
|
-
protected constructor(factory: CollectionResourceFactory, entry: CollectionEntry, options: CollectionResourceOptions, localCache: LocalCache);
|
|
15
|
+
protected constructor(factory: CollectionResourceFactory, entry: CollectionEntry, options: CollectionResourceOptions, level: number, localCache: LocalCache | null);
|
|
15
16
|
getItemById(itemId: number): T;
|
|
16
17
|
rebuildMap(): void;
|
|
17
18
|
addItemResources(itemEntries: ItemEntry[]): T[];
|
|
@@ -35,6 +36,6 @@ export declare abstract class CollectionResource<T extends ItemResource = LocalV
|
|
|
35
36
|
map<U>(argument: string | ((itemResource: T) => U)): U[];
|
|
36
37
|
reduce<U>(callback: (itemResource: T, value: U) => U, value: U): U;
|
|
37
38
|
extend(queryCallback: QueryCallback, returnAllItems?: boolean, callOnAdd?: boolean): PromiseInterface<T[]>;
|
|
38
|
-
deactivate(): void;
|
|
39
39
|
clearResource(): void;
|
|
40
|
+
deactivate(): void;
|
|
40
41
|
}
|
|
@@ -17,8 +17,6 @@ export declare class CollectionResourceOptions {
|
|
|
17
17
|
onAddInitial: CollectionResourceInitialCallback;
|
|
18
18
|
onRemoveInitial: CollectionResourceInitialCallback;
|
|
19
19
|
resourceKey: string | null;
|
|
20
|
-
clearOnTabChange: boolean;
|
|
21
|
-
clearOnSubTabChange: boolean;
|
|
22
20
|
custom: any;
|
|
23
21
|
constructor(values: CollectionResourceOptionsInterface);
|
|
24
22
|
}
|
|
@@ -2,5 +2,5 @@ import { LocalCache } from '../classes';
|
|
|
2
2
|
import { CollectionResourceFactory } from '../factories';
|
|
3
3
|
import { CollectionEntry, CollectionResource, CollectionResourceOptions, ItemResource, LocalViewResource } from '../models';
|
|
4
4
|
export declare class CollectionViewResource<T extends ItemResource = LocalViewResource> extends CollectionResource<T> {
|
|
5
|
-
constructor(collectionResourceFactory: CollectionResourceFactory, collectionEntry: CollectionEntry, options: CollectionResourceOptions, localCache: LocalCache);
|
|
5
|
+
constructor(collectionResourceFactory: CollectionResourceFactory, collectionEntry: CollectionEntry, options: CollectionResourceOptions, level: number, localCache: LocalCache | null);
|
|
6
6
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
1
2
|
import { ItemResourceFactory } from '../factories';
|
|
2
3
|
import { ItemEntry, ItemResource, ItemResourceOptions } from '../models';
|
|
3
4
|
import { FieldMap, PromiseInterface } from '../types';
|
|
4
5
|
export declare class EditResource extends ItemResource {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
constructor(factory: ItemResourceFactory, entry: ItemEntry, options: ItemResourceOptions, isNew?: boolean);
|
|
6
|
+
protected localCopies: FieldMap[];
|
|
7
|
+
protected transactions: number;
|
|
8
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry, options: ItemResourceOptions, isNew: boolean, localCache: LocalCache | null);
|
|
9
9
|
isNew(): boolean;
|
|
10
10
|
start(): this;
|
|
11
11
|
rollback(): this;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ColumnSet } from '../classes';
|
|
2
2
|
import { ItemEntryFactory } from '../factories';
|
|
3
|
-
import { ItemResource } from '../models';
|
|
4
|
-
import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemError, ItemId, ItemIdConversionMap, ItemType, PromiseInterface } from '../types';
|
|
5
3
|
import { Deferred } from '../interfaces';
|
|
4
|
+
import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemError, ItemId, ItemIdConversionMap, ItemType, PromiseInterface } from '../types';
|
|
6
5
|
export declare class ItemEntry {
|
|
7
6
|
private factory;
|
|
8
7
|
itemType: string;
|
|
@@ -16,8 +15,8 @@ export declare class ItemEntry {
|
|
|
16
15
|
initial: FieldMap;
|
|
17
16
|
modified: FieldMap;
|
|
18
17
|
derived: FieldMap;
|
|
19
|
-
resources: ItemResource[];
|
|
20
18
|
constructor(factory: ItemEntryFactory, itemType: string, itemId: ItemId, columns: ColumnSet);
|
|
19
|
+
private getResources;
|
|
21
20
|
queueReload(): this;
|
|
22
21
|
defer(deferRequest?: boolean): this;
|
|
23
22
|
getPromise(): PromiseInterface<this>;
|
|
@@ -29,8 +28,6 @@ export declare class ItemEntry {
|
|
|
29
28
|
setLocalFields(initialValues: FieldMap, conversionMap: ItemIdConversionMap, columns?: ColumnSet): this;
|
|
30
29
|
clone(conversionMap?: ItemIdConversionMap): ItemEntry;
|
|
31
30
|
resetDerived(columnIds: string[]): this;
|
|
32
|
-
clearResources(): this;
|
|
33
|
-
deactivateResources(): this;
|
|
34
31
|
getFields(): FieldMap;
|
|
35
32
|
expand(main: FieldMap, derived: FieldMap, columnExpansionResult: ColumnExpansionResult): this;
|
|
36
33
|
expandLocal(columnExpansionResult: ColumnExpansionResult): this;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { ItemResourceFactory } from '../factories';
|
|
1
3
|
import { ItemEntry, ItemResourceOptions } from '../models';
|
|
2
4
|
import { FieldMap, ResponseColumn } from '../types';
|
|
3
5
|
export declare abstract class ItemResource {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
protected readonly factory: ItemResourceFactory;
|
|
7
|
+
readonly entry: ItemEntry;
|
|
8
|
+
readonly options: ItemResourceOptions;
|
|
6
9
|
protected readonly _isNew: boolean;
|
|
10
|
+
protected readonly localCache: LocalCache | null;
|
|
7
11
|
columns: {
|
|
8
12
|
[columnId: string]: ResponseColumn;
|
|
9
13
|
};
|
|
10
14
|
fields: FieldMap;
|
|
11
15
|
derived: FieldMap;
|
|
12
|
-
protected constructor(entry: ItemEntry, options: ItemResourceOptions, _isNew
|
|
16
|
+
protected constructor(factory: ItemResourceFactory, entry: ItemEntry, options: ItemResourceOptions, _isNew: boolean, localCache: LocalCache | null);
|
|
13
17
|
isNew(): boolean;
|
|
14
18
|
isLocal(): boolean;
|
|
15
19
|
clearResource(): void;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ItemEntry } from '../models';
|
|
2
1
|
import { OnChangeFunction } from '../types';
|
|
3
2
|
export declare type ItemResourceOptionsInterface = Partial<ItemResourceOptions>;
|
|
4
3
|
export declare class ItemResourceOptions {
|
|
5
4
|
edit: boolean;
|
|
6
5
|
remote: boolean;
|
|
7
6
|
onChange: OnChangeFunction;
|
|
8
|
-
onDeactivate: (itemEntry: ItemEntry) => void;
|
|
9
7
|
constructor(values: ItemResourceOptionsInterface);
|
|
10
8
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { ItemResourceFactory } from '../factories';
|
|
1
3
|
import { ItemEntry, ItemResourceOptions, ViewResource } from '../models';
|
|
2
4
|
export declare class LocalViewResource extends ViewResource {
|
|
3
|
-
constructor(entry: ItemEntry, options: ItemResourceOptions, isNew
|
|
5
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry, options: ItemResourceOptions, isNew: boolean, localCache: LocalCache | null);
|
|
4
6
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { ItemResourceFactory } from '../factories';
|
|
1
3
|
import { ItemEntry, ItemResourceOptions, ViewResource } from '../models';
|
|
2
4
|
export declare class RemoteViewResource extends ViewResource {
|
|
3
|
-
constructor(entry: ItemEntry, options: ItemResourceOptions, isNew
|
|
5
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry, options: ItemResourceOptions, isNew: boolean, localCache: LocalCache | null);
|
|
4
6
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { LocalCache } from '../classes';
|
|
2
|
+
import { ItemResourceFactory } from '../factories';
|
|
1
3
|
import { ItemEntry, ItemResource, ItemResourceOptions } from '../models';
|
|
2
4
|
import { FieldMap } from '../types';
|
|
3
5
|
export declare abstract class ViewResource extends ItemResource {
|
|
4
6
|
fields: Readonly<FieldMap>;
|
|
5
|
-
protected constructor(entry: ItemEntry, options: ItemResourceOptions, isNew
|
|
7
|
+
protected constructor(factory: ItemResourceFactory, entry: ItemEntry, options: ItemResourceOptions, isNew: boolean, localCache: LocalCache | null);
|
|
6
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResponseProcessor, CollectionMatcher, ColumnSet, RequestColumnExpansion } from '../classes';
|
|
1
|
+
import { ApiResponseProcessor, CollectionMatcher, ColumnSet, LocalCache, RequestColumnExpansion } from '../classes';
|
|
2
2
|
import { ENTRY_STATUS } from '../constants';
|
|
3
3
|
import { CollectionEntry, CollectionEntryOptions, CollectionEntryOptionsInterface, CollectionResource, CollectionResourceOptions, CollectionResourceOptionsInterface, ItemEntry, ItemEntryOptionsInterface, ItemResource, ItemResourceOptionsInterface } from '../models';
|
|
4
4
|
export declare type EntryParent = {
|
|
@@ -31,6 +31,23 @@ export declare type StateKey = {
|
|
|
31
31
|
template?: string;
|
|
32
32
|
itemId?: number;
|
|
33
33
|
};
|
|
34
|
+
export declare type OnSaveCallback = (localCache: LocalCache, conversionMap: ItemIdConversionMap) => any;
|
|
35
|
+
export declare enum LocalCacheCallbackCondition {
|
|
36
|
+
Always = "always",
|
|
37
|
+
OnClose = "onClose",
|
|
38
|
+
SkipOnClose = "skipOnClose"
|
|
39
|
+
}
|
|
40
|
+
export declare type LocalCacheCallbacks<T> = {
|
|
41
|
+
always: {
|
|
42
|
+
[key: string]: T;
|
|
43
|
+
};
|
|
44
|
+
onClose: {
|
|
45
|
+
[key: string]: T;
|
|
46
|
+
};
|
|
47
|
+
skipOnClose: {
|
|
48
|
+
[key: string]: T;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
34
51
|
export declare type SocketMessageType = 'event' | 'notification';
|
|
35
52
|
export interface SocketMessage {
|
|
36
53
|
header: {
|
package/package.json
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@rentman/rm-core",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Rentman core functionalities",
|
|
5
|
-
"main": "./dist/rm-core.js",
|
|
6
|
-
"types": "./dist/src/index.d.ts",
|
|
7
|
-
"dependencies": {},
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/rentmanpublic/frontend-core"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@types/moment": "^2.13.0",
|
|
14
|
-
"@types/q": "^1.5.0",
|
|
15
|
-
"clean-webpack-plugin": "^0.1.19",
|
|
16
|
-
"ts-loader": "^4.4.1",
|
|
17
|
-
"tslint": "^5.12.1",
|
|
18
|
-
"typescript": "3.3.3",
|
|
19
|
-
"
|
|
20
|
-
"webpack": "^
|
|
21
|
-
"webpack
|
|
22
|
-
"webpack-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"bundle": "webpack --config webpack.
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@rentman/rm-core",
|
|
3
|
+
"version": "1.7.1",
|
|
4
|
+
"description": "Rentman core functionalities",
|
|
5
|
+
"main": "./dist/rm-core.js",
|
|
6
|
+
"types": "./dist/src/index.d.ts",
|
|
7
|
+
"dependencies": {},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/rentmanpublic/frontend-core"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@types/moment": "^2.13.0",
|
|
14
|
+
"@types/q": "^1.5.0",
|
|
15
|
+
"clean-webpack-plugin": "^0.1.19",
|
|
16
|
+
"ts-loader": "^4.4.1",
|
|
17
|
+
"tslint": "^5.12.1",
|
|
18
|
+
"typescript": "3.3.3",
|
|
19
|
+
"typescript-tslint-plugin": "^0.5.3",
|
|
20
|
+
"uglifyjs-webpack-plugin": "^1.2.5",
|
|
21
|
+
"webpack": "^4.16.3",
|
|
22
|
+
"webpack-cli": "^3.0.6",
|
|
23
|
+
"webpack-merge": "^4.1.3"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"prepublishOnly": "npm run bundle",
|
|
30
|
+
"bundle-dev": "webpack --config webpack.dev.js",
|
|
31
|
+
"bundle": "webpack --config webpack.prod.js",
|
|
32
|
+
"type-check": "tsc --noEmit"
|
|
33
|
+
},
|
|
34
|
+
"author": "Martijn Welker <martijn@rentman.nl>",
|
|
35
|
+
"license": "UNLICENSED"
|
|
36
|
+
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { LocalCache } from '../classes';
|
|
2
|
-
import { ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
3
|
-
import { ItemIdConversionMap, PromiseInterface } from '../types';
|
|
4
|
-
export declare type LocalCacheCallbackCondition = 'always' | 'onClose' | 'skipOnClose';
|
|
5
|
-
export declare type LocalCacheCallbackType = {
|
|
6
|
-
onBeforeSave: (localCache: LocalCache) => any;
|
|
7
|
-
onSaveSuccess: (localCache: LocalCache, conversionMap: ItemIdConversionMap) => any;
|
|
8
|
-
};
|
|
9
|
-
export declare class LocalCacheEventHandler {
|
|
10
|
-
private errorHandler;
|
|
11
|
-
private exceptionHandler;
|
|
12
|
-
private promiseService;
|
|
13
|
-
private callbacks;
|
|
14
|
-
constructor(errorHandler: ErrorHandlerInterface, exceptionHandler: ExceptionHandlerInterface, promiseService: PromiseLibraryInterface);
|
|
15
|
-
registerCallback<T extends keyof LocalCacheCallbackType>(type: T, key: string, callback: LocalCacheCallbackType[T], condition?: LocalCacheCallbackCondition, priority?: number): () => void;
|
|
16
|
-
executeCallbacks<T extends keyof LocalCacheCallbackType>(type: T, execute: (callback: LocalCacheCallbackType[T]) => any, closeTab: boolean): PromiseInterface<any>;
|
|
17
|
-
private getPriorityLevel;
|
|
18
|
-
private executeCallbacksPriorityLevel;
|
|
19
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ApiFormatter, ChangesProcessor, CollectionEntryService, CollectionHandler, ItemHandler } from '../classes';
|
|
2
|
-
import { ChangesCompilationFactory, ColumnExpansionFactory, CreateRequestFactory, RequestColumnExpansionFactory } from '../factories';
|
|
3
|
-
import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
|
|
4
|
-
export declare class ChangesProcessorFactory {
|
|
5
|
-
private apiFormatter;
|
|
6
|
-
private apiRequestService;
|
|
7
|
-
private changesCompilationFactory;
|
|
8
|
-
private collectionEntryService;
|
|
9
|
-
private collectionHandler;
|
|
10
|
-
private columnExpansionFactory;
|
|
11
|
-
private createRequestFactory;
|
|
12
|
-
private errorHandler;
|
|
13
|
-
private itemHandler;
|
|
14
|
-
private promiseService;
|
|
15
|
-
private requestColumnExpansionFactory;
|
|
16
|
-
constructor(apiFormatter: ApiFormatter, apiRequestService: ApiRequestServiceInterface, changesCompilationFactory: ChangesCompilationFactory, collectionEntryService: CollectionEntryService, collectionHandler: CollectionHandler, columnExpansionFactory: ColumnExpansionFactory, createRequestFactory: CreateRequestFactory, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, promiseService: PromiseLibraryInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory);
|
|
17
|
-
construct(): ChangesProcessor;
|
|
18
|
-
}
|