@rentman/rm-core 1.0.34 → 1.1.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 +66 -0
- package/dist/dist/classes/ApiFormatter.d.ts +37 -37
- package/dist/dist/classes/ApiRequestService.d.ts +18 -17
- package/dist/dist/classes/ApiResponseProcessor.d.ts +33 -31
- package/dist/dist/classes/BatchStatus.d.ts +18 -18
- package/dist/dist/classes/ChangesCompilation.d.ts +26 -0
- package/dist/dist/classes/ChangesProcessor.d.ts +34 -41
- package/dist/dist/classes/CollectionCache.d.ts +33 -40
- package/dist/dist/classes/CollectionEntryService.d.ts +26 -23
- package/dist/dist/classes/CollectionHandler.d.ts +49 -64
- package/dist/dist/classes/CollectionMatcher.d.ts +28 -0
- package/dist/dist/classes/CollectionResourceService.d.ts +5 -5
- package/dist/dist/classes/ColumnCache.d.ts +18 -18
- package/dist/dist/classes/ColumnExpansion.d.ts +14 -16
- package/dist/dist/classes/ColumnHandler.d.ts +16 -17
- package/dist/dist/classes/ColumnInfo.d.ts +12 -0
- package/dist/dist/classes/ColumnSet.d.ts +34 -54
- package/dist/dist/classes/ColumnUtil.d.ts +79 -81
- package/dist/dist/classes/CreateRequest.d.ts +20 -20
- package/dist/dist/classes/ItemAdministrator.d.ts +99 -114
- package/dist/dist/classes/ItemCache.d.ts +25 -22
- package/dist/dist/classes/ItemEntryService.d.ts +18 -51
- package/dist/dist/classes/ItemHandler.d.ts +57 -82
- package/dist/dist/classes/ItemRequestService.d.ts +22 -28
- package/dist/dist/classes/ItemResourceService.d.ts +7 -7
- package/dist/dist/classes/KeyService.d.ts +25 -28
- package/dist/dist/classes/LocalCache.d.ts +48 -66
- package/dist/dist/classes/LockService.d.ts +23 -23
- package/dist/dist/classes/{ModuleChangesCompiler.d.ts → ModuleChangesCompilation.d.ts} +19 -22
- package/dist/dist/classes/QueryMatcher.d.ts +14 -14
- package/dist/dist/classes/QueryParser.d.ts +16 -16
- package/dist/dist/classes/QueryService.d.ts +19 -19
- package/dist/dist/classes/RequestColumnExpansion.d.ts +9 -9
- package/dist/dist/classes/SocketMessageHandler.d.ts +32 -32
- package/dist/dist/classes/Util.d.ts +25 -25
- package/dist/dist/classes/index.d.ts +34 -32
- package/dist/dist/constants.d.ts +15 -10
- package/dist/dist/factories/ApiResponseProcessorFactory.d.ts +6 -6
- package/dist/dist/factories/BatchStatusFactory.d.ts +9 -8
- package/dist/dist/factories/ChangesCompilationFactory.d.ts +8 -0
- package/dist/dist/factories/ChangesProcessorFactory.d.ts +18 -23
- package/dist/dist/factories/CollectionCacheFactory.d.ts +7 -7
- package/dist/dist/factories/CollectionEntryFactory.d.ts +14 -14
- package/dist/dist/factories/CollectionMatcherFactory.d.ts +7 -0
- package/dist/dist/factories/CollectionResourceFactory.d.ts +16 -16
- package/dist/dist/factories/ColumnExpansionFactory.d.ts +8 -9
- package/dist/dist/factories/ColumnInfoFactory.d.ts +6 -0
- package/dist/dist/factories/ColumnSetFactory.d.ts +11 -7
- package/dist/dist/factories/CreateRequestFactory.d.ts +10 -10
- package/dist/dist/factories/ItemCacheFactory.d.ts +7 -8
- package/dist/dist/factories/ItemEntryFactory.d.ts +19 -5
- package/dist/dist/factories/ItemResourceFactory.d.ts +14 -16
- package/dist/dist/factories/LocalCacheFactory.d.ts +16 -25
- package/dist/dist/factories/ModuleChangesCompilationFactory.d.ts +5 -0
- package/dist/dist/factories/QueryMatcherFactory.d.ts +7 -6
- package/dist/dist/factories/QueryParserFactory.d.ts +5 -5
- package/dist/dist/factories/RequestColumnExpansionFactory.d.ts +6 -6
- package/dist/dist/factories/index.d.ts +20 -18
- package/dist/dist/index.d.ts +7 -7
- package/dist/dist/interfaces/ApiRequestServiceInterface.d.ts +11 -10
- package/dist/dist/interfaces/AuthInterface.d.ts +9 -9
- package/dist/dist/interfaces/ErrorHandlerInterface.d.ts +4 -4
- package/dist/dist/interfaces/LocalCacheManagerInterface.d.ts +5 -5
- package/dist/dist/interfaces/PromiseInterface.d.ts +11 -11
- package/dist/dist/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/dist/interfaces/index.d.ts +6 -6
- package/dist/dist/main.d.ts +46 -44
- package/dist/dist/models/CollectionEditResource.d.ts +21 -20
- package/dist/dist/models/CollectionEntry.d.ts +60 -57
- package/dist/dist/models/CollectionResource.d.ts +36 -37
- package/dist/dist/models/CollectionViewResource.d.ts +5 -13
- package/dist/dist/models/EditResource.d.ts +22 -25
- package/dist/dist/models/ItemEntry.d.ts +62 -18
- package/dist/dist/models/ItemResource.d.ts +16 -15
- package/dist/dist/models/ViewResource.d.ts +4 -6
- package/dist/dist/models/index.d.ts +8 -8
- package/dist/dist/types/ItemTypesCollection.d.ts +87 -49
- package/dist/dist/types/index.d.ts +1 -0
- package/dist/rm-core.js +6678 -6531
- package/dist/rm-core.min.js +1 -1
- package/package.json +2 -2
- package/readme.md +15 -15
- package/dist/dist/classes/ChangesCompiler.d.ts +0 -33
- package/dist/dist/factories/ChangesCompilerFactory.d.ts +0 -7
- package/dist/dist/factories/ModuleChangesCompilerFactory.d.ts +0 -7
package/changelog.md
CHANGED
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
#Changelog
|
|
2
2
|
Contains new features, breaking changes and their reasoning
|
|
3
3
|
|
|
4
|
+
## v1.1.1
|
|
5
|
+
- Fixed an issue where changes wouldn't be detected.
|
|
6
|
+
- **Breaking:** Removed the `_hasChanges` function in the `localCache` class. If you want to force changes detection,
|
|
7
|
+
call `detectChanges` instead. Otherwise, rely on the `hasChanges` variable.
|
|
8
|
+
- **Breaking:** Removed the `enableWatcher` and `disableWatcher` functions. Use `enableChangesWatcher` and
|
|
9
|
+
`disableChangesWatcher` instead.
|
|
10
|
+
|
|
11
|
+
## v1.1.0
|
|
12
|
+
### Development
|
|
13
|
+
|
|
14
|
+
#### Strict TypeScript compilation
|
|
15
|
+
Added the following TypeScript compiler options:
|
|
16
|
+
- noImplicitThis
|
|
17
|
+
- noImplicitReturns
|
|
18
|
+
- strictNullChecks
|
|
19
|
+
- noUnusedLocals
|
|
20
|
+
- noUnusedParameters
|
|
21
|
+
|
|
22
|
+
I would advise enabling these for all TypeScript projects from now on.
|
|
23
|
+
|
|
24
|
+
#### Ordered imports and dependencies
|
|
25
|
+
Imports are now ordered alphabetically and grouped by folder. Added a TSLint option to enforce this.
|
|
26
|
+
Please note that this also applies for imports from the folder the file is currently in.
|
|
27
|
+
For example, in `models/ItemResource.ts`, `itemEntry` should be imported like so:
|
|
28
|
+
`import { ItemEntry } from '../models';`
|
|
29
|
+
|
|
30
|
+
Also, factory and class dependencies should be ordered alphabetically as well. This will make it easier to add and
|
|
31
|
+
remove dependencies in the future.
|
|
32
|
+
|
|
33
|
+
### Breaking changes
|
|
34
|
+
|
|
35
|
+
- Renamed `changesCompiler` to `changesCompilation`, `changesCompilerFactory` to `changesCompilationFactory`,
|
|
36
|
+
`moduleChangesCompiler` to `moduleChangesCompilation` and `moduleChangesCompilerFactory` to
|
|
37
|
+
`moduleChangesCompilationFactory`.
|
|
38
|
+
- Removed the `allLinks` parameter from the `query` function definition in the `ApiRequestServiceInterface`. This is
|
|
39
|
+
no longer supported in the back-end.
|
|
40
|
+
|
|
41
|
+
#### Item and collection entries
|
|
42
|
+
- Moved *all* functions that handle item entries from the `ItemEntryService` to the `ItemEntry` class.
|
|
43
|
+
- Added the following functions to `ItemEntryService`:
|
|
44
|
+
- `createLocalConversionMap`;
|
|
45
|
+
- `expandLocalConversionMap`;
|
|
46
|
+
- `expandConversionMap`;
|
|
47
|
+
- `batchExpandConversionMap`;
|
|
48
|
+
- `batchClone`.
|
|
49
|
+
- Cloning of item entries now works slightly differently. The function will attempt to generate a new
|
|
50
|
+
item ID, and update the conversion map accordingly, but will respect the item ID that is already there.
|
|
51
|
+
|
|
52
|
+
#### Rework item caching
|
|
53
|
+
Newly created item entries and collection entries are no longer added to the global *or* local cache by default.
|
|
54
|
+
All entries are added to the global cache on save. Item entries are added to the local cache when resources are created
|
|
55
|
+
using the item administrator or when resources are created when adding the items to a collection.
|
|
56
|
+
|
|
57
|
+
> This will increase reliability by ensuring the global cache is no longer 'polluted' with local items. Also, this will
|
|
58
|
+
> allow for the creation item and collection entries without caching them directly. This is required for the copying and
|
|
59
|
+
> pasting of items.
|
|
60
|
+
|
|
61
|
+
Other changes:
|
|
62
|
+
|
|
63
|
+
- Moved `saveLocal` to `ItemAdministrator`;
|
|
64
|
+
- `ItemAdministrator.fetchTitle` should now be called instead of `ItemHandler.fetchTitle`;
|
|
65
|
+
- The `ItemAdministrator` collection matching functions (`addToCollections`, `removeFromCollections`) should now be
|
|
66
|
+
called instead of those in the `CollectionHandler`. The `CollectionHandler` should only be used to reflect changes
|
|
67
|
+
already on the backend. (Use `getCollectionMatcher`.)
|
|
68
|
+
|
|
69
|
+
|
|
4
70
|
##v1.0.33
|
|
5
71
|
- Really fix types path
|
|
6
72
|
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/// <reference types="moment" />
|
|
2
|
-
import * as moment from 'moment';
|
|
3
|
-
export declare class ApiFormatter {
|
|
4
|
-
MOMENT_INVALID: string;
|
|
5
|
-
SERVER_DATETIME_FORMAT: string;
|
|
6
|
-
SERVER_TIME_FORMAT: string;
|
|
7
|
-
SERVER_DATE_FORMAT: string;
|
|
8
|
-
constructor();
|
|
9
|
-
formatResponse(fields: any, columns: any): void;
|
|
10
|
-
expandResponse(current: any, expanded: any, columns: any): void;
|
|
11
|
-
formatRequest(initial: any, modified: any, columns: any): {};
|
|
12
|
-
hasChanges(initial: any, modified: any, columns: any): boolean;
|
|
13
|
-
getChanges(initial: any, modified: any, columns: any):
|
|
14
|
-
copyFields(source: any, destination: any, columns: any): any;
|
|
15
|
-
shallowCopyFields(shallowSource: any, deepSource: any, destination: any, columns: any): any;
|
|
16
|
-
setDefaultValues(destination: any, columns: any): any;
|
|
17
|
-
compareFields(columnType: any, first: any, second: any): any;
|
|
18
|
-
compareFloats(a: any, b: any): boolean;
|
|
19
|
-
compareMomentObjects(first: any, second: any): any;
|
|
20
|
-
compareDurations(first: any, second: any): boolean;
|
|
21
|
-
formatResponseValue(columnType: any, value: any): any;
|
|
22
|
-
formatRequestValue(columnType: any, value: any): any;
|
|
23
|
-
formatResponseDate(value: any): moment.Moment;
|
|
24
|
-
formatResponseDuration(value: any): moment.Duration;
|
|
25
|
-
formatResponseColor(value: any): any;
|
|
26
|
-
formatRequestDateTime(value: any): any;
|
|
27
|
-
formatRequestDate(value: any): any;
|
|
28
|
-
formatRequestDuration(value: any): any;
|
|
29
|
-
formatRequestColor(value: any): any;
|
|
30
|
-
getDefaultValue(columnType: any): false |
|
|
31
|
-
isDefaultValue(columnType: any, value: any): any;
|
|
32
|
-
clone(columnType: any, value: any): any;
|
|
33
|
-
getCloneFunction(columnType: any): (date: any) => any;
|
|
34
|
-
cloneDuration(duration: any): moment.Duration;
|
|
35
|
-
cloneDate(date: any): any;
|
|
36
|
-
identity(input: any): any;
|
|
37
|
-
}
|
|
1
|
+
/// <reference types="moment" />
|
|
2
|
+
import * as moment from 'moment';
|
|
3
|
+
export declare class ApiFormatter {
|
|
4
|
+
MOMENT_INVALID: string;
|
|
5
|
+
SERVER_DATETIME_FORMAT: string;
|
|
6
|
+
SERVER_TIME_FORMAT: string;
|
|
7
|
+
SERVER_DATE_FORMAT: string;
|
|
8
|
+
constructor();
|
|
9
|
+
formatResponse(fields: any, columns: any): void;
|
|
10
|
+
expandResponse(current: any, expanded: any, columns: any): void;
|
|
11
|
+
formatRequest(initial: any, modified: any, columns: any): {};
|
|
12
|
+
hasChanges(initial: any, modified: any, columns: any): boolean;
|
|
13
|
+
getChanges(initial: any, modified: any, columns: any): object[];
|
|
14
|
+
copyFields(source: any, destination: any, columns: any): any;
|
|
15
|
+
shallowCopyFields(shallowSource: any, deepSource: any, destination: any, columns: any): any;
|
|
16
|
+
setDefaultValues(destination: any, columns: any): any;
|
|
17
|
+
compareFields(columnType: any, first: any, second: any): any;
|
|
18
|
+
compareFloats(a: any, b: any): boolean;
|
|
19
|
+
compareMomentObjects(first: any, second: any): any;
|
|
20
|
+
compareDurations(first: any, second: any): boolean;
|
|
21
|
+
formatResponseValue(columnType: any, value: any): any;
|
|
22
|
+
formatRequestValue(columnType: any, value: any): any;
|
|
23
|
+
formatResponseDate(value: any): moment.Moment;
|
|
24
|
+
formatResponseDuration(value: any): moment.Duration;
|
|
25
|
+
formatResponseColor(value: any): any;
|
|
26
|
+
formatRequestDateTime(value: any): any;
|
|
27
|
+
formatRequestDate(value: any): any;
|
|
28
|
+
formatRequestDuration(value: any): any;
|
|
29
|
+
formatRequestColor(value: any): any;
|
|
30
|
+
getDefaultValue(columnType: any): false | "" | 0 | moment.Moment | moment.Duration | "0" | "#000000" | null;
|
|
31
|
+
isDefaultValue(columnType: any, value: any): any;
|
|
32
|
+
clone(columnType: any, value: any): any;
|
|
33
|
+
getCloneFunction(columnType: any): (date: any) => any;
|
|
34
|
+
cloneDuration(duration: any): moment.Duration;
|
|
35
|
+
cloneDate(date: any): any;
|
|
36
|
+
identity(input: any): any;
|
|
37
|
+
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
private
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { ApiResponseProcessor } from '../classes';
|
|
2
|
+
import { ApiResponseProcessorFactory } from '../factories';
|
|
3
|
+
import { ApiRequestServiceInterface } from '../interfaces';
|
|
4
|
+
import { ItemId, ItemType } from '../types';
|
|
5
|
+
export declare class ApiRequestService {
|
|
6
|
+
private externalApiRequestService;
|
|
7
|
+
private apiResponseProcessorFactory;
|
|
8
|
+
constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
|
|
9
|
+
template(itemType: ItemType, params: any): Promise<ApiResponseProcessor>;
|
|
10
|
+
create(itemType: ItemType, itemId: ItemId, values: any, parentType?: ItemType, parentId?: ItemId): Promise<ApiResponseProcessor>;
|
|
11
|
+
delete(itemType: ItemType, itemIds: ItemId[]): Promise<ApiResponseProcessor>;
|
|
12
|
+
updateItems(itemType: ItemType, items: object, columns: any): Promise<ApiResponseProcessor>;
|
|
13
|
+
requestSkeleton(params: any, requestCanceler?: Promise<any>): Promise<ApiResponseProcessor>;
|
|
14
|
+
moveItems(parentType: ItemType, parentId: ItemId, items: object): Promise<ApiResponseProcessor>;
|
|
15
|
+
columns(itemType: ItemType, columns: object, params?: any): Promise<ApiResponseProcessor>;
|
|
16
|
+
query(itemType: ItemType, query: object, columns: object, limit?: object): Promise<ApiResponseProcessor>;
|
|
17
|
+
processResponse(request: any): Promise<ApiResponseProcessor>;
|
|
18
|
+
}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare class ApiResponseProcessor {
|
|
4
|
-
apiFormatter: ApiFormatter;
|
|
5
|
-
response: any;
|
|
6
|
-
columns: ItemTypeMap;
|
|
7
|
-
items: ItemTypeMap;
|
|
8
|
-
links: ItemTypeMap;
|
|
9
|
-
cacheable: boolean;
|
|
10
|
-
map: any;
|
|
11
|
-
columnIndexMap: any;
|
|
12
|
-
columnMap: any;
|
|
13
|
-
constructor(apiFormatter: ApiFormatter, response: any);
|
|
14
|
-
createColumnMaps(): void;
|
|
15
|
-
fetchValue(itemType: any, itemId: any, columnId: any): any;
|
|
16
|
-
fetchDerivedObject(itemType: any, itemId: any, rootColumns: any): {};
|
|
17
|
-
fetchDerivedValues(value: any, column: any, destination: any): void;
|
|
18
|
-
fetchObject(itemType: any, itemId: any, includeLinks?: boolean): any;
|
|
19
|
-
fetchObjectArray(itemType: any, includeLinks: any, idArray: any): any;
|
|
20
|
-
fetchObjectMap(itemType: any, columnId: any, includeLinks: any, returnKeys: any): {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { ApiFormatter } from '../classes';
|
|
2
|
+
import { ItemTypeMap } from '../types';
|
|
3
|
+
export declare class ApiResponseProcessor {
|
|
4
|
+
apiFormatter: ApiFormatter;
|
|
5
|
+
response: any;
|
|
6
|
+
columns: ItemTypeMap;
|
|
7
|
+
items: ItemTypeMap;
|
|
8
|
+
links: ItemTypeMap;
|
|
9
|
+
cacheable: boolean;
|
|
10
|
+
map: any;
|
|
11
|
+
columnIndexMap: any;
|
|
12
|
+
columnMap: any;
|
|
13
|
+
constructor(apiFormatter: ApiFormatter, response: any);
|
|
14
|
+
createColumnMaps(): void;
|
|
15
|
+
fetchValue(itemType: any, itemId: any, columnId: any): any;
|
|
16
|
+
fetchDerivedObject(itemType: any, itemId: any, rootColumns: any): {};
|
|
17
|
+
fetchDerivedValues(value: any, column: any, destination: any): void;
|
|
18
|
+
fetchObject(itemType: any, itemId: any, includeLinks?: boolean): any;
|
|
19
|
+
fetchObjectArray(itemType: any, includeLinks: any, idArray: any): any;
|
|
20
|
+
fetchObjectMap(itemType: any, columnId: any, includeLinks: any, returnKeys: any): {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
};
|
|
23
|
+
fetchFieldMap(itemType: any, columnId: any): {};
|
|
24
|
+
fetchColumnArray(itemType: any): any[];
|
|
25
|
+
fetchColumnObject(itemType: any): any;
|
|
26
|
+
fetchColumnsObject(): any;
|
|
27
|
+
createResource(itemType: any, id: any): {
|
|
28
|
+
object: any;
|
|
29
|
+
links: any;
|
|
30
|
+
};
|
|
31
|
+
hasItems(itemType: any): boolean;
|
|
32
|
+
getIdArray(itemType: any): string[];
|
|
33
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ENTRY_STATUS } from
|
|
2
|
-
import { PromiseInterface } from '../interfaces';
|
|
3
|
-
import { ItemEntry } from
|
|
4
|
-
import { EntryStatus, ItemEntryEntryStatusMap } from '../types
|
|
5
|
-
export declare class BatchStatus {
|
|
6
|
-
private promiseService;
|
|
7
|
-
getItemId: (itemEntry: ItemEntry) =>
|
|
8
|
-
getPromise: (itemEntry: ItemEntry) => Promise<ItemEntry>;
|
|
9
|
-
entries: ItemEntryEntryStatusMap;
|
|
10
|
-
constructor(promiseService: PromiseInterface, getItemId: (itemEntry: ItemEntry) =>
|
|
11
|
-
add(entryStatus: EntryStatus<ItemEntry>): void;
|
|
12
|
-
hasEntries(statusArray: ENTRY_STATUS[]): boolean;
|
|
13
|
-
hasRequests(): boolean;
|
|
14
|
-
forEachEntry(statusArray: ENTRY_STATUS[], callback: (itemEntry: ItemEntry) => void): void;
|
|
15
|
-
getPromises(): Promise<ItemEntry[]>;
|
|
16
|
-
getRequestIds(): number[];
|
|
17
|
-
getArray(): ItemEntry[];
|
|
18
|
-
}
|
|
1
|
+
import { ENTRY_STATUS } from '../constants';
|
|
2
|
+
import { PromiseInterface } from '../interfaces';
|
|
3
|
+
import { ItemEntry } from '../models';
|
|
4
|
+
import { EntryStatus, ItemEntryEntryStatusMap, ItemId } from '../types';
|
|
5
|
+
export declare class BatchStatus {
|
|
6
|
+
private promiseService;
|
|
7
|
+
getItemId: (itemEntry: ItemEntry) => ItemId;
|
|
8
|
+
getPromise: (itemEntry: ItemEntry) => Promise<ItemEntry>;
|
|
9
|
+
entries: ItemEntryEntryStatusMap;
|
|
10
|
+
constructor(promiseService: PromiseInterface, getItemId: (itemEntry: ItemEntry) => ItemId, getPromise: (itemEntry: ItemEntry) => Promise<ItemEntry>);
|
|
11
|
+
add(entryStatus: EntryStatus<ItemEntry>): void;
|
|
12
|
+
hasEntries(statusArray: ENTRY_STATUS[]): boolean;
|
|
13
|
+
hasRequests(): boolean;
|
|
14
|
+
forEachEntry(statusArray: ENTRY_STATUS[], callback: (itemEntry: ItemEntry) => void): void;
|
|
15
|
+
getPromises(): Promise<ItemEntry[]>;
|
|
16
|
+
getRequestIds(): number[];
|
|
17
|
+
getArray(): ItemEntry[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CollectionCache } from '../classes';
|
|
2
|
+
import { CollectionCacheFactory } from '../factories';
|
|
3
|
+
import { CollectionEntry, ItemEntry } from '../models';
|
|
4
|
+
import { EntryParent } from '../types';
|
|
5
|
+
export declare class ChangesCompilation {
|
|
6
|
+
private collectionCacheFactory;
|
|
7
|
+
singleItems: ItemEntry[];
|
|
8
|
+
compilation: {
|
|
9
|
+
create: {};
|
|
10
|
+
delete: {};
|
|
11
|
+
update: {};
|
|
12
|
+
move: {};
|
|
13
|
+
};
|
|
14
|
+
collections: CollectionCache;
|
|
15
|
+
private moveArray;
|
|
16
|
+
private deleteMap;
|
|
17
|
+
constructor(collectionCacheFactory: CollectionCacheFactory, singleItems: ItemEntry[], collectionEntries: CollectionEntry[]);
|
|
18
|
+
getDefaultParent(): EntryParent;
|
|
19
|
+
addMoveEntry(itemEntry: any): void;
|
|
20
|
+
addDeleteEntry(itemEntry: any, parentId: any, parentType: any): void;
|
|
21
|
+
addUpdateEntry(itemEntry: any): void;
|
|
22
|
+
addCreateEntry(itemEntry: any): void;
|
|
23
|
+
postProcess(): void;
|
|
24
|
+
private processSingleItems();
|
|
25
|
+
private processCollections(collectionEntries);
|
|
26
|
+
}
|
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
private
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private
|
|
34
|
-
|
|
35
|
-
private executeMoveRequests(compilation, conversionMap);
|
|
36
|
-
private processMoveResponse(response, compilationEntries);
|
|
37
|
-
private addCollectionMapEntry(collectionMap, parentId, itemEntry, value);
|
|
38
|
-
private forEachCollection(collectionMap, method);
|
|
39
|
-
private onItemsCreated(conversionMap, singleItems, collections);
|
|
40
|
-
private executeRequests(changes, parameters, breakupByParent, onAfterCreateCallback);
|
|
41
|
-
}
|
|
1
|
+
import { ApiFormatter, CollectionEntryService, CollectionHandler, ItemHandler } from '../classes';
|
|
2
|
+
import { ChangesCompilationFactory, ColumnExpansionFactory, CreateRequestFactory, RequestColumnExpansionFactory } from '../factories';
|
|
3
|
+
import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseInterface } from '../interfaces';
|
|
4
|
+
export declare class ChangesProcessor {
|
|
5
|
+
private apiRequestService;
|
|
6
|
+
private itemHandler;
|
|
7
|
+
private errorHandler;
|
|
8
|
+
private collectionHandler;
|
|
9
|
+
private changesCompilationFactory;
|
|
10
|
+
private createRequestFactory;
|
|
11
|
+
private columnExpansionFactory;
|
|
12
|
+
private requestColumnExpansionFactory;
|
|
13
|
+
private collectionEntryService;
|
|
14
|
+
private apiFormatter;
|
|
15
|
+
private promiseService;
|
|
16
|
+
constructor(apiRequestService: ApiRequestServiceInterface, itemHandler: ItemHandler, errorHandler: ErrorHandlerInterface, collectionHandler: CollectionHandler, changesCompilationFactory: ChangesCompilationFactory, createRequestFactory: CreateRequestFactory, columnExpansionFactory: ColumnExpansionFactory, requestColumnExpansionFactory: RequestColumnExpansionFactory, collectionEntryService: CollectionEntryService, apiFormatter: ApiFormatter, promiseService: PromiseInterface);
|
|
17
|
+
getItemTypeUpdatePriority(itemType: any): 0 | 1 | 2;
|
|
18
|
+
buildMoveRequest(compilationEntries: any): {};
|
|
19
|
+
getMapValue(itemType: any, itemId: any, map: any): any;
|
|
20
|
+
execute(singleItems: any, collections: any, breakupByParent?: boolean, parameters?: any, onAfterCreateCallback?: any): Promise<any>;
|
|
21
|
+
private executeCreateRequests(changesCompilation, parameters, conversionMap, breakupByParent, onAfterCreateCallback);
|
|
22
|
+
private executeCreateRequest(requestResource, conversionMap);
|
|
23
|
+
private prioritizeUpdateRequests(compilation, parameters);
|
|
24
|
+
private executeUpdateRequests(itemTypes, compilation, parameters);
|
|
25
|
+
private executeUpdateRequest(itemType, itemEntries, parameterMap);
|
|
26
|
+
private executeDeleteRequests(compilation);
|
|
27
|
+
private executeDeleteRequest(itemType, itemEntries);
|
|
28
|
+
private executeMoveRequests(compilation, conversionMap);
|
|
29
|
+
private processMoveResponse(compilationEntries);
|
|
30
|
+
private addCollectionMapEntry(collectionMap, parentId, itemEntry, value);
|
|
31
|
+
private forEachCollection(collectionMap, method);
|
|
32
|
+
private onItemsCreated(conversionMap, singleItems, collections);
|
|
33
|
+
private executeRequests(changesCompilation, parameters, breakupByParent, onAfterCreateCallback);
|
|
34
|
+
}
|
|
@@ -1,40 +1,33 @@
|
|
|
1
|
-
import { QueryMatcherFactory } from
|
|
2
|
-
import { CollectionEntry, CollectionResource } from
|
|
3
|
-
import { CollectionEntryItemTypeMap } from '../types
|
|
4
|
-
export declare class CollectionCache {
|
|
5
|
-
private queryMatcherFactory;
|
|
6
|
-
entries: CollectionEntryItemTypeMap;
|
|
7
|
-
constructor(queryMatcherFactory: QueryMatcherFactory);
|
|
8
|
-
contains(collectionEntry: CollectionEntry): boolean;
|
|
9
|
-
some(callback: (entry: CollectionEntry) => void): boolean;
|
|
10
|
-
forEach(callback: (entry: CollectionEntry) => void): void;
|
|
11
|
-
toArray(): CollectionEntry[];
|
|
12
|
-
add(collectionEntry: CollectionEntry): CollectionEntry;
|
|
13
|
-
clear(collectionEntry?: CollectionEntry): boolean;
|
|
14
|
-
getByItemType(itemType: string): CollectionEntry[];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
* @param {String
|
|
22
|
-
* @
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
notfitting: any[];
|
|
35
|
-
maybe: any[];
|
|
36
|
-
};
|
|
37
|
-
getByQuery(itemType: any, query: any): CollectionEntry;
|
|
38
|
-
getByKey(itemType: any, entryKey: any): CollectionEntry[];
|
|
39
|
-
getResourceByKey(itemType: any, resourceKey: any): any[];
|
|
40
|
-
}
|
|
1
|
+
import { QueryMatcherFactory } from '../factories';
|
|
2
|
+
import { CollectionEntry, CollectionResource } from '../models';
|
|
3
|
+
import { CollectionEntryItemTypeMap, CollectionMatchResult, EntryParentNull, FieldMap, ItemType } from '../types';
|
|
4
|
+
export declare class CollectionCache {
|
|
5
|
+
private queryMatcherFactory;
|
|
6
|
+
entries: CollectionEntryItemTypeMap;
|
|
7
|
+
constructor(queryMatcherFactory: QueryMatcherFactory);
|
|
8
|
+
contains(collectionEntry: CollectionEntry): boolean;
|
|
9
|
+
some(callback: (entry: CollectionEntry) => void): boolean;
|
|
10
|
+
forEach(callback: (entry: CollectionEntry) => void): void;
|
|
11
|
+
toArray(): CollectionEntry[];
|
|
12
|
+
add(collectionEntry: CollectionEntry): CollectionEntry;
|
|
13
|
+
clear(collectionEntry?: CollectionEntry): boolean;
|
|
14
|
+
getByItemType(itemType: string): CollectionEntry[];
|
|
15
|
+
matchParent(collectionEntry: CollectionEntry, itemType: string, itemId: any): boolean;
|
|
16
|
+
getByParent(parentType: any, parentId: any, itemType: any): CollectionEntry | null;
|
|
17
|
+
getResourceByParent(parentType: any, parentId: any, itemType: any): CollectionResource | null;
|
|
18
|
+
getCollectionsByParent(parentType: any, parentId: any): CollectionEntry[];
|
|
19
|
+
/**
|
|
20
|
+
* Only resources
|
|
21
|
+
* @param {String} itemType
|
|
22
|
+
* @param {String|Integer} itemId
|
|
23
|
+
* @returns {Object} Array of collections.
|
|
24
|
+
*/
|
|
25
|
+
getByContainingItem(itemType: any, itemId: any): CollectionEntry[];
|
|
26
|
+
/**
|
|
27
|
+
* Returns an array of collections the item 'belongs' in.
|
|
28
|
+
*/
|
|
29
|
+
getByFittingItem(itemType: ItemType, fields: FieldMap, parent: EntryParentNull): CollectionMatchResult;
|
|
30
|
+
getByQuery(itemType: any, query: any): CollectionEntry | null;
|
|
31
|
+
getByKey(itemType: any, entryKey: any): CollectionEntry[];
|
|
32
|
+
getResourceByKey(itemType: any, resourceKey: any): CollectionResource[];
|
|
33
|
+
}
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
private
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { QueryService } from '../classes';
|
|
2
|
+
import { QueryParserFactory } from '../factories';
|
|
3
|
+
import { ItemEntry } from '../models';
|
|
4
|
+
import { ItemId } from '../types';
|
|
5
|
+
export declare class CollectionEntryService {
|
|
6
|
+
private queryParserFactory;
|
|
7
|
+
private queryService;
|
|
8
|
+
constructor(queryParserFactory: QueryParserFactory, queryService: QueryService);
|
|
9
|
+
cloneOptions(options: any, parent: any): any;
|
|
10
|
+
cloneQueryParams(parameters: any): {};
|
|
11
|
+
processOptions(options: any): any;
|
|
12
|
+
createQuery(options: any): {
|
|
13
|
+
object: any;
|
|
14
|
+
string: any;
|
|
15
|
+
};
|
|
16
|
+
getIdArray(itemEntries: ItemEntry[], accumulator: any): ItemId[];
|
|
17
|
+
/**
|
|
18
|
+
* @param {ItemEntry[]} itemEntries
|
|
19
|
+
* @param {(itemEntry: ItemEntry) => boolean} callback
|
|
20
|
+
* @returns {ItemEntry[]}
|
|
21
|
+
*
|
|
22
|
+
* filter an array according to the callback function. Return the entries that failed the condition
|
|
23
|
+
* Replace the given array with the entries that didn't fail the condition.
|
|
24
|
+
*/
|
|
25
|
+
filterArray(itemEntries: ItemEntry[], callback: (itemEntry: ItemEntry) => boolean): ItemEntry[];
|
|
26
|
+
}
|