@rentman/rm-core 1.0.34 → 1.1.0

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.
Files changed (85) hide show
  1. package/changelog.md +131 -72
  2. package/dist/dist/classes/ApiFormatter.d.ts +37 -37
  3. package/dist/dist/classes/ApiRequestService.d.ts +18 -17
  4. package/dist/dist/classes/ApiResponseProcessor.d.ts +33 -31
  5. package/dist/dist/classes/BatchStatus.d.ts +18 -18
  6. package/dist/dist/classes/ChangesCompilation.d.ts +26 -0
  7. package/dist/dist/classes/ChangesProcessor.d.ts +34 -41
  8. package/dist/dist/classes/CollectionCache.d.ts +33 -40
  9. package/dist/dist/classes/CollectionEntryService.d.ts +26 -23
  10. package/dist/dist/classes/CollectionHandler.d.ts +49 -64
  11. package/dist/dist/classes/CollectionMatcher.d.ts +28 -0
  12. package/dist/dist/classes/CollectionResourceService.d.ts +5 -5
  13. package/dist/dist/classes/ColumnCache.d.ts +18 -18
  14. package/dist/dist/classes/ColumnExpansion.d.ts +14 -16
  15. package/dist/dist/classes/ColumnHandler.d.ts +16 -17
  16. package/dist/dist/classes/ColumnInfo.d.ts +12 -0
  17. package/dist/dist/classes/ColumnSet.d.ts +34 -54
  18. package/dist/dist/classes/ColumnUtil.d.ts +79 -81
  19. package/dist/dist/classes/CreateRequest.d.ts +20 -20
  20. package/dist/dist/classes/ItemAdministrator.d.ts +99 -114
  21. package/dist/dist/classes/ItemCache.d.ts +25 -22
  22. package/dist/dist/classes/ItemEntryService.d.ts +18 -51
  23. package/dist/dist/classes/ItemHandler.d.ts +57 -82
  24. package/dist/dist/classes/ItemRequestService.d.ts +22 -28
  25. package/dist/dist/classes/ItemResourceService.d.ts +7 -7
  26. package/dist/dist/classes/KeyService.d.ts +25 -28
  27. package/dist/dist/classes/LocalCache.d.ts +57 -66
  28. package/dist/dist/classes/LockService.d.ts +23 -23
  29. package/dist/dist/classes/{ModuleChangesCompiler.d.ts → ModuleChangesCompilation.d.ts} +19 -22
  30. package/dist/dist/classes/QueryMatcher.d.ts +14 -14
  31. package/dist/dist/classes/QueryParser.d.ts +16 -16
  32. package/dist/dist/classes/QueryService.d.ts +19 -19
  33. package/dist/dist/classes/RequestColumnExpansion.d.ts +9 -9
  34. package/dist/dist/classes/SocketMessageHandler.d.ts +32 -32
  35. package/dist/dist/classes/Util.d.ts +25 -25
  36. package/dist/dist/classes/index.d.ts +34 -32
  37. package/dist/dist/constants.d.ts +15 -10
  38. package/dist/dist/factories/ApiResponseProcessorFactory.d.ts +6 -6
  39. package/dist/dist/factories/BatchStatusFactory.d.ts +9 -8
  40. package/dist/dist/factories/ChangesCompilationFactory.d.ts +8 -0
  41. package/dist/dist/factories/ChangesProcessorFactory.d.ts +18 -23
  42. package/dist/dist/factories/CollectionCacheFactory.d.ts +7 -7
  43. package/dist/dist/factories/CollectionEntryFactory.d.ts +14 -14
  44. package/dist/dist/factories/CollectionMatcherFactory.d.ts +7 -0
  45. package/dist/dist/factories/CollectionResourceFactory.d.ts +16 -16
  46. package/dist/dist/factories/ColumnExpansionFactory.d.ts +8 -9
  47. package/dist/dist/factories/ColumnInfoFactory.d.ts +6 -0
  48. package/dist/dist/factories/ColumnSetFactory.d.ts +11 -7
  49. package/dist/dist/factories/CreateRequestFactory.d.ts +10 -10
  50. package/dist/dist/factories/ItemCacheFactory.d.ts +7 -8
  51. package/dist/dist/factories/ItemEntryFactory.d.ts +19 -5
  52. package/dist/dist/factories/ItemResourceFactory.d.ts +14 -16
  53. package/dist/dist/factories/LocalCacheFactory.d.ts +16 -25
  54. package/dist/dist/factories/ModuleChangesCompilationFactory.d.ts +5 -0
  55. package/dist/dist/factories/QueryMatcherFactory.d.ts +7 -6
  56. package/dist/dist/factories/QueryParserFactory.d.ts +5 -5
  57. package/dist/dist/factories/RequestColumnExpansionFactory.d.ts +6 -6
  58. package/dist/dist/factories/index.d.ts +20 -18
  59. package/dist/dist/index.d.ts +7 -7
  60. package/dist/dist/interfaces/ApiRequestServiceInterface.d.ts +11 -10
  61. package/dist/dist/interfaces/AuthInterface.d.ts +9 -9
  62. package/dist/dist/interfaces/ErrorHandlerInterface.d.ts +4 -4
  63. package/dist/dist/interfaces/LocalCacheManagerInterface.d.ts +5 -5
  64. package/dist/dist/interfaces/PromiseInterface.d.ts +11 -11
  65. package/dist/dist/interfaces/SocketMessageInterface.d.ts +3 -3
  66. package/dist/dist/interfaces/index.d.ts +6 -6
  67. package/dist/dist/main.d.ts +46 -44
  68. package/dist/dist/models/CollectionEditResource.d.ts +21 -20
  69. package/dist/dist/models/CollectionEntry.d.ts +60 -57
  70. package/dist/dist/models/CollectionResource.d.ts +36 -37
  71. package/dist/dist/models/CollectionViewResource.d.ts +5 -13
  72. package/dist/dist/models/EditResource.d.ts +22 -25
  73. package/dist/dist/models/ItemEntry.d.ts +62 -18
  74. package/dist/dist/models/ItemResource.d.ts +16 -15
  75. package/dist/dist/models/ViewResource.d.ts +4 -6
  76. package/dist/dist/models/index.d.ts +8 -8
  77. package/dist/dist/types/ItemTypesCollection.d.ts +87 -49
  78. package/dist/dist/types/index.d.ts +1 -0
  79. package/dist/rm-core.js +6697 -6531
  80. package/dist/rm-core.min.js +1 -1
  81. package/package.json +35 -35
  82. package/readme.md +15 -15
  83. package/dist/dist/classes/ChangesCompiler.d.ts +0 -33
  84. package/dist/dist/factories/ChangesCompilerFactory.d.ts +0 -7
  85. package/dist/dist/factories/ModuleChangesCompilerFactory.d.ts +0 -7
@@ -1,44 +1,46 @@
1
- import { ApiFormatter, ApiRequestService, CollectionEntryService, CollectionHandler, CollectionResourceService, ColumnCache, ColumnHandler, ColumnUtil, ItemAdministrator, ItemEntryService, ItemHandler, ItemRequestService, ItemResourceService, KeyService, LockService, QueryService, SocketMessageHandler } from './classes';
2
- import { ApiResponseProcessorFactory, BatchStatusFactory, ChangesCompilerFactory, ChangesProcessorFactory, CollectionCacheFactory, CollectionEntryFactory, CollectionResourceFactory, ColumnExpansionFactory, ColumnSetFactory, CreateRequestFactory, ItemCacheFactory, ItemEntryFactory, ItemResourceFactory, LocalCacheFactory, ModuleChangesCompilerFactory, QueryMatcherFactory, QueryParserFactory, RequestColumnExpansionFactory } from './factories';
3
- import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseInterface } from './interfaces';
4
- export declare class RmCore {
5
- version: string;
6
- apiFormatter: ApiFormatter;
7
- keyService: KeyService;
8
- queryService: QueryService;
9
- columnUtil: ColumnUtil;
10
- apiResponseProcessorFactory: ApiResponseProcessorFactory;
11
- itemEntryService: ItemEntryService;
12
- itemResourceService: ItemResourceService;
13
- itemAdministrator: ItemAdministrator;
14
- itemRequestService: ItemRequestService;
15
- columnCache: ColumnCache;
16
- columnHandler: ColumnHandler;
17
- itemEntryFactory: ItemEntryFactory;
18
- collectionEntryFactory: CollectionEntryFactory;
19
- collectionCacheFactory: CollectionCacheFactory;
20
- itemHandler: ItemHandler;
21
- collectionHandler: CollectionHandler;
22
- lockService: LockService;
23
- collectionEntryService: CollectionEntryService;
24
- collectionResourceService: CollectionResourceService;
25
- collectionResourceFactory: CollectionResourceFactory;
26
- queryMatcherFactory: QueryMatcherFactory;
27
- itemCacheFactory: ItemCacheFactory;
28
- requestColumnExpansionFactory: RequestColumnExpansionFactory;
29
- changesCompilerFactory: ChangesCompilerFactory;
30
- changesProcessorFactory: ChangesProcessorFactory;
31
- columnExpansionFactory: ColumnExpansionFactory;
32
- columnSetFactory: ColumnSetFactory;
33
- createRequestFactory: CreateRequestFactory;
34
- itemResourceFactory: ItemResourceFactory;
35
- localCacheFactory: LocalCacheFactory;
36
- moduleChangesCompilerFactory: ModuleChangesCompilerFactory;
37
- queryParserFactory: QueryParserFactory;
38
- batchStatusFactory: BatchStatusFactory;
39
- socketMessageHandler: SocketMessageHandler;
40
- apiRequestService: ApiRequestService;
41
- constructor(externalApiRequestService: ApiRequestServiceInterface, localCacheManager: LocalCacheManagerInterface, authInterface: AuthInterface, errorHandlerInterface: ErrorHandlerInterface, promiseInterface: PromiseInterface);
42
- }
43
- export declare function noop(): void;
44
- export declare function identity(value: any): any;
1
+ import { ApiFormatter, ApiRequestService, CollectionEntryService, CollectionHandler, CollectionResourceService, ColumnCache, ColumnHandler, ColumnUtil, ItemAdministrator, ItemEntryService, ItemHandler, ItemRequestService, ItemResourceService, KeyService, LockService, QueryService, SocketMessageHandler } from './classes';
2
+ import { ApiResponseProcessorFactory, BatchStatusFactory, ChangesCompilationFactory, ChangesProcessorFactory, CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, CollectionResourceFactory, ColumnExpansionFactory, ColumnInfoFactory, ColumnSetFactory, CreateRequestFactory, ItemCacheFactory, ItemEntryFactory, ItemResourceFactory, LocalCacheFactory, ModuleChangesCompilationFactory, QueryMatcherFactory, QueryParserFactory, RequestColumnExpansionFactory } from './factories';
3
+ import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseInterface } from './interfaces';
4
+ export declare class RmCore {
5
+ version: string;
6
+ apiFormatter: ApiFormatter;
7
+ keyService: KeyService;
8
+ queryService: QueryService;
9
+ columnUtil: ColumnUtil;
10
+ apiResponseProcessorFactory: ApiResponseProcessorFactory;
11
+ itemEntryService: ItemEntryService;
12
+ itemResourceService: ItemResourceService;
13
+ itemAdministrator: ItemAdministrator;
14
+ itemRequestService: ItemRequestService;
15
+ columnCache: ColumnCache;
16
+ columnHandler: ColumnHandler;
17
+ itemEntryFactory: ItemEntryFactory;
18
+ collectionEntryFactory: CollectionEntryFactory;
19
+ collectionCacheFactory: CollectionCacheFactory;
20
+ collectionMatcherFactory: CollectionMatcherFactory;
21
+ itemHandler: ItemHandler;
22
+ collectionHandler: CollectionHandler;
23
+ lockService: LockService;
24
+ collectionEntryService: CollectionEntryService;
25
+ collectionResourceService: CollectionResourceService;
26
+ collectionResourceFactory: CollectionResourceFactory;
27
+ queryMatcherFactory: QueryMatcherFactory;
28
+ itemCacheFactory: ItemCacheFactory;
29
+ requestColumnExpansionFactory: RequestColumnExpansionFactory;
30
+ changesCompilationFactory: ChangesCompilationFactory;
31
+ changesProcessorFactory: ChangesProcessorFactory;
32
+ columnExpansionFactory: ColumnExpansionFactory;
33
+ columnSetFactory: ColumnSetFactory;
34
+ columnInfoFactory: ColumnInfoFactory;
35
+ createRequestFactory: CreateRequestFactory;
36
+ itemResourceFactory: ItemResourceFactory;
37
+ localCacheFactory: LocalCacheFactory;
38
+ moduleChangesCompilationFactory: ModuleChangesCompilationFactory;
39
+ queryParserFactory: QueryParserFactory;
40
+ batchStatusFactory: BatchStatusFactory;
41
+ socketMessageHandler: SocketMessageHandler;
42
+ apiRequestService: ApiRequestService;
43
+ constructor(externalApiRequestService: ApiRequestServiceInterface, localCacheManager: LocalCacheManagerInterface, authInterface: AuthInterface, errorHandlerInterface: ErrorHandlerInterface, promiseInterface: PromiseInterface);
44
+ }
45
+ export declare function noop(): void;
46
+ export declare function identity(value: any): any;
@@ -1,20 +1,21 @@
1
- import { ItemHandler, KeyService } from "../classes";
2
- import { ChangesProcessorFactory, ItemResourceFactory } from '../factories';
3
- import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
- import { CollectionEntry } from './CollectionEntry';
5
- import { CollectionResource } from './CollectionResource';
6
- export declare class CollectionEditResource extends CollectionResource {
7
- private errorHandler;
8
- private itemHandler;
9
- private changesProcessorFactory;
10
- private keyService;
11
- private promiseService;
12
- constructor(errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, itemResourceFactory: ItemResourceFactory, changesProcessorFactory: ChangesProcessorFactory, keyService: KeyService, promiseService: PromiseInterface, collectionEntry: CollectionEntry, options: any);
13
- save(): Promise<any>;
14
- moveItems(idArray: any, destination: any, enableCallbacks: any): any;
15
- removeItems(idArray: any, enableCallbacks: any): Promise<any>;
16
- removeItem(itemId: any, enableCallbacks: any): Promise<any>;
17
- addItems(valuesArray: any, enableCallbacks?: boolean): Promise<any>;
18
- addItem(values: any, enableCallbacks: any): Promise<any>;
19
- clear(enableCallbacks: any): any;
20
- }
1
+ import { ItemHandler, KeyService } from '../classes';
2
+ import { ChangesProcessorFactory, ItemEntryFactory, ItemResourceFactory } from '../factories';
3
+ import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
+ import { CollectionEntry } from './CollectionEntry';
5
+ import { CollectionResource } from './CollectionResource';
6
+ export declare class CollectionEditResource extends CollectionResource {
7
+ private errorHandler;
8
+ private itemHandler;
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);
14
+ save(): Promise<any>;
15
+ moveItems(idArray: any, destination: any, enableCallbacks: any): any;
16
+ removeItems(idArray: any, enableCallbacks: any): Promise<any>;
17
+ removeItem(itemId: any, enableCallbacks: any): Promise<any>;
18
+ addItems(valuesArray: any, enableCallbacks?: boolean): Promise<any>;
19
+ addItem(values: any, enableCallbacks: any): Promise<any>;
20
+ clear(enableCallbacks: any): any;
21
+ }
@@ -1,57 +1,60 @@
1
- import { CollectionEntryService, ItemEntryService, ItemRequestService, KeyService, QueryService } from "../classes";
2
- import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
3
- import { CollectionResource } from "./CollectionResource";
4
- import { ItemEntry } from "./ItemEntry";
5
- import { ItemResource } from './ItemResource';
6
- export declare class CollectionEntry {
7
- private errorHandler;
8
- private collectionEntryService;
9
- private itemRequestService;
10
- private itemEntryService;
11
- private keyService;
12
- private queryService;
13
- private promiseService;
14
- itemType: string;
15
- options: any;
16
- id: number;
17
- query: any;
18
- columns: any;
19
- parent: null | {
20
- itemType: string;
21
- itemId: string;
22
- };
23
- initial: ItemEntry[];
24
- items: ItemEntry[];
25
- resources: CollectionResource[];
26
- deferred: any;
27
- promise: any;
28
- reloadQueued: boolean;
29
- constructor(errorHandler: ErrorHandlerInterface, collectionEntryService: CollectionEntryService, itemRequestService: ItemRequestService, itemEntryService: ItemEntryService, keyService: KeyService, queryService: QueryService, promiseService: PromiseInterface, itemType: string, options: any);
30
- isDeferred(): boolean;
31
- resolve(itemEntryResource: any): CollectionEntry;
32
- isLocal(): boolean;
33
- matchParent(itemType: any, itemId: any): boolean;
34
- forEach(callback: (itemEntry: ItemEntry) => void): void;
35
- getItemById(itemId: any): ItemEntry;
36
- getIdArray(accumulator?: any[]): number[];
37
- addItems(itemEntries: any, resultResource: any, updateInitial?: boolean, enableCallback?: boolean): ItemResource[];
38
- removeItems(idArray: any, resultResource: any, updateInitial: any, enableCallback?: any): any;
39
- clear(resultResource: any, updateInitial: any, enableCallback?: any): any;
40
- handleRemovedItems(filterFunction: any, resultResource: any, updateInitial: any, enableCallback?: boolean): any;
41
- expand(newColumns: any): any;
42
- extendQuery(callback: any): any;
43
- extend(queryCallback: any, collectionResource: any, enableCallback?: any, updateInitial?: any): Promise<any>;
44
- queueReload(): void;
45
- updateColumns(columnExpansion: any): void;
46
- getAddedItems(returnItemIds?: boolean): any[];
47
- getRemovedItems(returnItemIds?: boolean): any[];
48
- getUpdatedItems(): any[];
49
- hasAddedItems(): boolean;
50
- hasRemovedItems(): boolean;
51
- hasUpdatedItems(): boolean;
52
- getCurrentResource(): CollectionResource;
53
- clearResources(isSubtabChange?: boolean): void;
54
- revertChanges(): void;
55
- onItemsCreated(conversionMap: any): void;
56
- getUpdatedItemColumns(conversionMap: any): {};
57
- }
1
+ import { CollectionEntryService, ColumnInfo, ColumnSet, ItemEntryService, ItemRequestService, KeyService, QueryService } from '../classes';
2
+ import { CollectionEntryFactory } from '../factories';
3
+ import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
+ import { CollectionResource, ItemEntry, ItemResource } from '../models';
5
+ import { EntryParentNull, ItemId, ItemIdConversionMap, ItemType } from '../types';
6
+ export declare class CollectionEntry {
7
+ private collectionEntryFactory;
8
+ private collectionEntryService;
9
+ private errorHandler;
10
+ private itemEntryService;
11
+ private itemRequestService;
12
+ private keyService;
13
+ private promiseService;
14
+ private queryService;
15
+ itemType: ItemType;
16
+ options: any;
17
+ id: number;
18
+ query: any;
19
+ columns: ColumnSet;
20
+ parent: EntryParentNull;
21
+ initial: ItemEntry[];
22
+ items: ItemEntry[];
23
+ resources: CollectionResource[];
24
+ deferred: any;
25
+ promise: Promise<CollectionEntry>;
26
+ reloadQueued: boolean;
27
+ constructor(collectionEntryFactory: CollectionEntryFactory, collectionEntryService: CollectionEntryService, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemRequestService: ItemRequestService, keyService: KeyService, promiseService: PromiseInterface, queryService: QueryService, itemType: ItemType, options: any);
28
+ isDeferred(): boolean;
29
+ resolve(itemEntryCompound: any): CollectionEntry;
30
+ isLocal(): boolean;
31
+ matchParent(itemType: any, itemId: any): boolean;
32
+ forEach(callback: (itemEntry: ItemEntry) => void): void;
33
+ getItemById(itemId: any): ItemEntry | undefined;
34
+ getIdArray(accumulator?: never[]): ItemId[];
35
+ addItems(itemEntries: any, resultResource: any, updateInitial?: boolean, enableCallback?: boolean): ItemResource[] | null;
36
+ removeItems(idArray: any, resultResource: any, updateInitial: any, enableCallback?: any): any;
37
+ clear(resultResource: any, updateInitial: any, enableCallback?: any): any;
38
+ handleRemovedItems(filterFunction: any, resultResource: any, updateInitial: any, enableCallback?: boolean): any;
39
+ expand(newColumns: any): Promise<any>;
40
+ extendQuery(callback: any): any;
41
+ extend(queryCallback: any, collectionResource: any, enableCallback?: any, updateInitial?: any): Promise<any>;
42
+ queueReload(): void;
43
+ updateColumns(columnExpansion: any): void;
44
+ getAddedItems(returnItemIds?: boolean): (number | ItemEntry)[];
45
+ getRemovedItems(returnItemIds?: boolean): (number | ItemEntry)[];
46
+ getUpdatedItems(): ItemEntry[];
47
+ hasAddedItems(): boolean;
48
+ hasRemovedItems(): boolean;
49
+ hasUpdatedItems(): boolean;
50
+ getCurrentResource(): CollectionResource;
51
+ clearResources(isSubtabChange?: boolean): void;
52
+ revertChanges(): void;
53
+ onItemsCreated(conversionMap: any): void;
54
+ getUpdatedItemColumns(conversionMap: any): {
55
+ [columnId: string]: ColumnInfo;
56
+ };
57
+ clone(parent: any, conversionMap?: ItemIdConversionMap): CollectionEntry;
58
+ hasEditResources(): boolean;
59
+ hasItemEditResources(): boolean;
60
+ }
@@ -1,37 +1,36 @@
1
- import { ItemResourceFactory } from "../factories";
2
- import { ItemResourceItemIdMap } from '../types/ItemTypesCollection';
3
- import { CollectionEntry } from './CollectionEntry';
4
- import { ItemEntry } from "./ItemEntry";
5
- import { ItemResource } from "./ItemResource";
6
- export declare class CollectionResource {
7
- private itemResourceFactory;
8
- entry: CollectionEntry;
9
- options: any;
10
- items: ItemResource[];
11
- itemIdMap: ItemResourceItemIdMap;
12
- columns: any;
13
- constructor(itemResourceFactory: ItemResourceFactory, entry: CollectionEntry, options: any);
14
- getItemById(itemId: number): ItemResource;
15
- rebuildMap(): void;
16
- addItemResources(itemEntries: ItemEntry[]): ItemResource[];
17
- /**
18
- * @param itemEntries
19
- * @returns {ItemResource[]}
20
- *
21
- * Returns the Itemresources that where removed Collection.
22
- * Filters on ItemResource.entry === ItemEntry
23
- */
24
- removeItemResources(itemEntries: ItemEntry[]): ItemResource[];
25
- callOnAdd(itemResources: ItemResource[]): void;
26
- callOnRemove(itemResources: ItemResource[]): void;
27
- forEach(callback: (itemResource: ItemResource) => void): void;
28
- filter(callback: (itemResource: ItemResource) => boolean): any[];
29
- first(callback: (itemResource: ItemResource) => boolean): ItemResource;
30
- some(callback: (itemResource: ItemResource) => boolean): boolean;
31
- groupBy(argument: any): {};
32
- map(argument: any): any[];
33
- reduce<T>(callback: (itemResource: ItemResource, value: T) => T, value: T): T;
34
- extend(queryCallback: any, returnAllItems: any, enableCallbacks: any): Promise<ItemResource[]>;
35
- deactivate(): void;
36
- clearResource(): void;
37
- }
1
+ import { ItemResourceFactory } from '../factories';
2
+ import { ItemEntry, ItemResource } from '../models';
3
+ import { ItemResourceItemIdMap } from '../types';
4
+ import { CollectionEntry } from './CollectionEntry';
5
+ export declare class CollectionResource {
6
+ private itemResourceFactory;
7
+ entry: CollectionEntry;
8
+ options: any;
9
+ items: ItemResource[];
10
+ itemIdMap: ItemResourceItemIdMap;
11
+ columns: any;
12
+ constructor(itemResourceFactory: ItemResourceFactory, entry: CollectionEntry, options: any);
13
+ getItemById(itemId: number): ItemResource;
14
+ rebuildMap(): void;
15
+ addItemResources(itemEntries: ItemEntry[]): ItemResource[];
16
+ /**
17
+ * @param itemEntries
18
+ * @returns {ItemResource[]}
19
+ *
20
+ * Returns the Itemresources that where removed Collection.
21
+ * Filters on ItemResource.entry === ItemEntry
22
+ */
23
+ removeItemResources(itemEntries: ItemEntry[]): ItemResource[];
24
+ callOnAdd(itemResources: ItemResource[]): void;
25
+ callOnRemove(itemResources: ItemResource[]): void;
26
+ forEach(callback: (itemResource: ItemResource) => void): void;
27
+ filter(callback: (itemResource: ItemResource) => boolean): ItemResource[];
28
+ first(callback: (itemResource: ItemResource) => boolean): ItemResource | null;
29
+ some(callback: (itemResource: ItemResource) => boolean): boolean;
30
+ groupBy(argument: any): {};
31
+ map(argument: any): any[];
32
+ reduce<T>(callback: (itemResource: ItemResource, value: T) => T, value: T): T;
33
+ extend(queryCallback: any, returnAllItems: any, enableCallbacks: any): Promise<ItemResource[]>;
34
+ deactivate(): void;
35
+ clearResource(): void;
36
+ }
@@ -1,13 +1,5 @@
1
- import { ItemHandler, KeyService } from "../classes";
2
- import { ChangesProcessorFactory, ItemResourceFactory } from '../factories';
3
- import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
- import { CollectionEntry } from "./CollectionEntry";
5
- import { CollectionResource } from "./CollectionResource";
6
- export declare class CollectionViewResource extends CollectionResource {
7
- private errorHandler;
8
- private itemHandler;
9
- private changesProcessorFactory;
10
- private keyService;
11
- private promiseService;
12
- constructor(errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, itemResourceFactory: ItemResourceFactory, changesProcessorFactory: ChangesProcessorFactory, keyService: KeyService, promiseService: PromiseInterface, collectionEntry: CollectionEntry, options: any);
13
- }
1
+ import { ItemResourceFactory } from '../factories';
2
+ import { CollectionEntry, CollectionResource } from '../models';
3
+ export declare class CollectionViewResource extends CollectionResource {
4
+ constructor(itemResourceFactory: ItemResourceFactory, collectionEntry: CollectionEntry, options: any);
5
+ }
@@ -1,25 +1,22 @@
1
- import { ApiFormatter, ChangesProcessor, CollectionHandler, ItemEntryService, LockService } from '../classes';
2
- import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
3
- import { ItemEntry } from "./ItemEntry";
4
- import { ItemResource } from "./ItemResource";
5
- export declare class EditResource extends ItemResource {
6
- private apiFormatter;
7
- private lockService;
8
- private changesProcessor;
9
- private collectionHandler;
10
- private errorHandler;
11
- private promiseService;
12
- localCopies: any[];
13
- transactions: number;
14
- hasChanges: boolean;
15
- constructor(itemEntryService: ItemEntryService, entry: ItemEntry, options: any, apiFormatter: ApiFormatter, lockService: LockService, changesProcessor: ChangesProcessor, collectionHandler: CollectionHandler, errorHandler: ErrorHandlerInterface, promiseService: PromiseInterface);
16
- start(): void;
17
- rollback(): void;
18
- commit(initial: any): void;
19
- getLocalCopy(): any;
20
- copyFields(destination?: any): any;
21
- setFields(values: any, callOnChange: any): this;
22
- callOnChange(previous: any): void;
23
- save(parameters?: any): any;
24
- saveLocal(): Promise<any>;
25
- }
1
+ import { ApiFormatter, ChangesProcessor, LockService } from '../classes';
2
+ import { ErrorHandlerInterface, PromiseInterface } from '../interfaces';
3
+ import { FieldMap } from '../types';
4
+ import { ItemEntry, ItemResource } from './';
5
+ export declare class EditResource extends ItemResource {
6
+ private apiFormatter;
7
+ private lockService;
8
+ private changesProcessor;
9
+ private errorHandler;
10
+ private promiseService;
11
+ localCopies: FieldMap[];
12
+ transactions: number;
13
+ constructor(apiFormatter: ApiFormatter, lockService: LockService, changesProcessor: ChangesProcessor, errorHandler: ErrorHandlerInterface, promiseService: PromiseInterface, entry: ItemEntry, options: any);
14
+ start(): void;
15
+ rollback(): void;
16
+ commit(initial: any): void;
17
+ getLocalCopy(): FieldMap | null;
18
+ copyFields(destination?: any): any;
19
+ setFields(values: any, callOnChange: any): this;
20
+ callOnChange(previous: any): void;
21
+ save(parameters?: any): any;
22
+ }
@@ -1,18 +1,62 @@
1
- import { ItemResource } from "./ItemResource";
2
- export declare class ItemEntry {
3
- itemType: string;
4
- itemId: number;
5
- columns: any;
6
- initial: any;
7
- derived: {};
8
- resources: ItemResource[];
9
- id: number;
10
- modified: any;
11
- parent: null | {
12
- itemType: string;
13
- itemId: string;
14
- };
15
- deferRequest: boolean;
16
- deferred: any;
17
- constructor(itemType: string, itemId: number, columns?: any, initial?: any, derived?: {}, resources?: ItemResource[]);
18
- }
1
+ import { ApiFormatter, ColumnSet, ItemEntryService, KeyService } from '../classes';
2
+ import { ItemEntryFactory } from '../factories';
3
+ import { AuthInterface, PromiseInterface } from '../interfaces';
4
+ import { ItemResource } from '../models';
5
+ import { EntryParentNull, FieldMap, ItemId, ItemIdConversionMap } from '../types';
6
+ export declare class ItemEntry {
7
+ private promiseService;
8
+ private authInterface;
9
+ private itemEntryFactory;
10
+ private apiFormatter;
11
+ private itemEntryService;
12
+ private keyService;
13
+ itemType: string;
14
+ itemId: ItemId;
15
+ columns: ColumnSet;
16
+ id: number;
17
+ deferRequest: boolean;
18
+ deferred: any;
19
+ parent: EntryParentNull;
20
+ initial: FieldMap;
21
+ modified: FieldMap;
22
+ derived: FieldMap;
23
+ resources: ItemResource[];
24
+ constructor(promiseService: PromiseInterface, authInterface: AuthInterface, itemEntryFactory: ItemEntryFactory, apiFormatter: ApiFormatter, itemEntryService: ItemEntryService, keyService: KeyService, itemType: string, itemId: ItemId, columns: ColumnSet);
25
+ defer(deferRequest: any): this;
26
+ resolve(): this;
27
+ resolveDeferred(initial: any, derived: any, columns: any): this;
28
+ isDeferred(): boolean;
29
+ reject(error?: any): this;
30
+ process(initial: any, derived: any): this;
31
+ processLocal(initial: any, modified: any, derived: any, conversionMap: ItemIdConversionMap): this;
32
+ setCreator(): this;
33
+ clone(conversionMap?: ItemIdConversionMap): ItemEntry;
34
+ resetDerived(columnIds: any): this;
35
+ clearResources(): this;
36
+ deactivateResources(): this;
37
+ getFields(): FieldMap;
38
+ expand(main: any, derived: any, columnExpansionResult: any): this;
39
+ updateFields(source: any, overwrite?: boolean): this;
40
+ updateItemValue(fields: any, apiColumn: any, conversionMap: any): this;
41
+ updateItemFields(conversionMap: any): this;
42
+ formatRequest(): {};
43
+ setDisplayName(): this;
44
+ getDisplayName(): any;
45
+ /**
46
+ * @param {Boolean} returnAll Returns all initial values if true
47
+ * @returns {Object}
48
+ */
49
+ getChanges(returnAll?: boolean): object[];
50
+ isLocal(): boolean;
51
+ isLockable(): boolean;
52
+ hasChanges(): boolean;
53
+ resetModified(): this;
54
+ setInitial(values: any, enableCallbacks?: any): this;
55
+ /**
56
+ * Does a shallow copy of values!
57
+ */
58
+ setModified(values?: any): this;
59
+ setDerived(values: any): this;
60
+ setParent(parentType: any, parentId: any): this;
61
+ callOnChange(previous: any): this;
62
+ }
@@ -1,15 +1,16 @@
1
- import { ItemEntryService } from '../classes';
2
- import { ItemEntry } from "./ItemEntry";
3
- export declare class ItemResource {
4
- protected itemEntryService: ItemEntryService;
5
- entry: ItemEntry;
6
- options: any;
7
- derived: any;
8
- columns: any;
9
- fields: any;
10
- constructor(itemEntryService: ItemEntryService, entry: ItemEntry, options: any);
11
- isNewResource(resource: any): boolean;
12
- isLocal(): boolean;
13
- clearResource(): void;
14
- deactivate(): void;
15
- }
1
+ import { ItemEntry } from '../models';
2
+ import { FieldMap, ResponseColumn } from '../types';
3
+ export declare class ItemResource {
4
+ entry: ItemEntry;
5
+ options: any;
6
+ columns: {
7
+ [columnId: string]: ResponseColumn;
8
+ };
9
+ fields: FieldMap;
10
+ derived: FieldMap;
11
+ constructor(entry: ItemEntry, options: any);
12
+ isNewResource(resource: any): boolean;
13
+ isLocal(): boolean;
14
+ clearResource(): void;
15
+ deactivate(): void;
16
+ }
@@ -1,6 +1,4 @@
1
- import { ItemEntryService } from '../classes';
2
- import { ItemEntry } from "./ItemEntry";
3
- import { ItemResource } from "./ItemResource";
4
- export declare class ViewResource extends ItemResource {
5
- constructor(itemEntryService: ItemEntryService, entry: ItemEntry, options: any);
6
- }
1
+ import { ItemEntry, ItemResource } from '../models';
2
+ export declare class ViewResource extends ItemResource {
3
+ constructor(entry: ItemEntry, options: any);
4
+ }
@@ -1,8 +1,8 @@
1
- export * from './ViewResource';
2
- export * from './CollectionEditResource';
3
- export * from './CollectionEntry';
4
- export * from './CollectionResource';
5
- export * from './CollectionViewResource';
6
- export * from './ItemEntry';
7
- export * from './ItemResource';
8
- export * from './EditResource';
1
+ export * from './CollectionEntry';
2
+ export * from './CollectionResource';
3
+ export * from './CollectionViewResource';
4
+ export * from './CollectionEditResource';
5
+ export * from './ItemEntry';
6
+ export * from './ItemResource';
7
+ export * from './ViewResource';
8
+ export * from './EditResource';