@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.
Files changed (85) hide show
  1. package/changelog.md +66 -0
  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 +48 -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 +6678 -6531
  80. package/dist/rm-core.min.js +1 -1
  81. package/package.json +2 -2
  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,114 +1,99 @@
1
- import { ColumnSetFactory, LocalCacheFactory, ModuleChangesCompilerFactory } from "../factories";
2
- import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface } from '../interfaces';
3
- import { CollectionResource, ItemEntry, ItemResource } from '../models';
4
- import { CollectionEntryParentIdMap, CollectionResourceParentIdMap, ItemResourceItemTypeMap, TemplateResponseItemEntryMap } from '../types/ItemTypesCollection';
5
- import { CollectionCache } from './CollectionCache';
6
- import { CollectionEntryService } from "./CollectionEntryService";
7
- import { CollectionHandler } from "./CollectionHandler";
8
- import { CollectionResourceService } from './CollectionResourceService';
9
- import { ItemCache } from './ItemCache';
10
- import { ItemEntryService } from './ItemEntryService';
11
- import { ItemHandler } from './ItemHandler';
12
- import { ItemRequestService } from "./ItemRequestService";
13
- import { KeyService } from "./KeyService";
14
- import { LocalCache } from "./LocalCache";
15
- import { QueryService } from "./QueryService";
16
- export declare class ItemAdministrator {
17
- private apiRequestService;
18
- private localCacheManager;
19
- private authInterface;
20
- private errorHandler;
21
- private itemHandler;
22
- private collectionHandler;
23
- private columnSetFactory;
24
- private itemRequestService;
25
- private localCacheFactory;
26
- private moduleChangesCompilerFactory;
27
- private collectionEntryService;
28
- private collectionResourceService;
29
- private itemEntryService;
30
- private keyService;
31
- private queryService;
32
- constructor(apiRequestService: ApiRequestServiceInterface, localCacheManager: LocalCacheManagerInterface, authInterface: AuthInterface, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, collectionHandler: CollectionHandler, columnSetFactory: ColumnSetFactory, itemRequestService: ItemRequestService, localCacheFactory: LocalCacheFactory, moduleChangesCompilerFactory: ModuleChangesCompilerFactory, collectionEntryService: CollectionEntryService, collectionResourceService: CollectionResourceService, itemEntryService: ItemEntryService, keyService: KeyService, queryService: QueryService);
33
- getItemDefinition(itemType: string, itemId: any, options: any): {
34
- itemType: string;
35
- options: any;
36
- itemId: any;
37
- };
38
- createCollectionMap(itemEntries: any[], addToTab: boolean): {};
39
- /**
40
- *
41
- * @param {string} itemType
42
- * @param {number} itemId
43
- * @param options
44
- * @returns {Promise<ItemResource>}
45
- *
46
- * I expect not a template request from itemhandler.fetchItem because addSingleItem does not handle the
47
- * TemplateResponseItemEntryMap
48
- */
49
- getItemById(itemType: string, itemId: number, options: any): Promise<ItemResource>;
50
- getItemsById(itemType: string, itemIds: number[], options: any): Promise<ItemResource[]>;
51
- getItemsByQuery(itemType: string, query: any, options: any): Promise<ItemResource[]>;
52
- getDuplicateById(itemType: string, duplicateId: number, options: any): Promise<any>;
53
- /**
54
- * The return value is depended on the return links boolean. true returns the TemplateResponseItemEntryMap.
55
- * The type has to be asserted at use since you only know the type of the return value when the function is called
56
- *
57
- * @param {string} itemType
58
- * @param options
59
- * @param {boolean} returnLinks
60
- * @param {boolean} isRoot
61
- * @returns {Promise<ItemResource> | Promise<TemplateResponseItemEntryMap>}
62
- */
63
- getNewResource(itemType: string, options: any, returnLinks: boolean, isRoot: boolean): Promise<ItemResource> | Promise<TemplateResponseItemEntryMap>;
64
- getCollectionDef(itemType: string, options: any): {
65
- itemType: string;
66
- options: {
67
- entry: any;
68
- resource: any;
69
- };
70
- };
71
- getLinkCollectionsDef(linkType: string, linkIdArray: number[], itemType: string, linkField: string, options: any): {
72
- itemType: string;
73
- linkType: string;
74
- linkIdArray: number[];
75
- linkField: string;
76
- options: {
77
- entry: any;
78
- resource: any;
79
- };
80
- };
81
- getCollection(itemType: string, options: any): Promise<CollectionResource>;
82
- getCollectionFromDef(definition: any): Promise<CollectionResource>;
83
- getLinkCollection(linkType: string, linkId: number, itemType: string, options: any): Promise<CollectionResource>;
84
- getLinkCollections(linkType: string, linkIdArray: number[], itemType: string, options: any): Promise<CollectionResourceParentIdMap>;
85
- getLinkCollectionsFromDef(definition: any): Promise<CollectionResourceParentIdMap>;
86
- getAllLinkCollections(linkType: string, itemType: string, options: any): Promise<CollectionEntryParentIdMap>;
87
- getItemByDef(definition: any, isRoot: boolean): Promise<any>;
88
- cloneItem(newItemId: number, itemResource: any, options: any): ItemResource;
89
- cloneCollection(collectionResource: any, options: any, conversionMap: any): CollectionResource;
90
- saveCurrentLocalCache(closeTab: boolean, parameters: any, breakupByParent: boolean, onAfterCreateCallback: any, keepTabHeading?: boolean): any;
91
- getCurrentCollections(): CollectionCache;
92
- getCurrentItems(): ItemCache;
93
- getCurrentChanges(): {
94
- itemType: string;
95
- itemId: number;
96
- items: any;
97
- };
98
- addSingleItem(itemEntry: ItemEntry, options: any, isRoot?: boolean): ItemResource;
99
- addSingleItems(itemEntries: ItemEntry[], options: any): ItemResource[];
100
- addCollection(collectionEntry: any, resourceOptions: any, processOptions?: any): CollectionResource;
101
- addCollections(collectionEntries: CollectionEntryParentIdMap, resourceOptions: any): CollectionResourceParentIdMap;
102
- processLinkedItems(linkedEntries: any[], options: any, addToCollections: boolean): ItemResourceItemTypeMap;
103
- getLocalCache(): LocalCache;
104
- resetLocalCache(): void;
105
- addToCollections(itemEntries: any[], resultCollectionResource: any): ItemResource[];
106
- removeFromCollections(itemEntries: any[], resultCollectionResource: any): any;
107
- updateItemIdMap(collectionMap: any, conversionMap: any): void;
108
- createCollectionResource(collectionEntry: any, resourceOptions: any, processOptions?: any): CollectionResource;
109
- createItemResource(itemEntry: any, options: any, isRoot: boolean): ItemResource;
110
- createItemResources(itemEntries: any[], options: any): ItemResource[];
111
- onBeforeSave(key: string, callback: any): () => void;
112
- onSaveSuccess(key: string, callback: any): () => void;
113
- onSaveWithoutClosing(key: string, callback: any): () => void;
114
- }
1
+ import { CollectionCache, CollectionEntryService, CollectionHandler, CollectionMatcher, CollectionResourceService, ItemCache, ItemEntryService, ItemHandler, ItemRequestService, KeyService, LocalCache, QueryService } from '../classes';
2
+ import { CollectionMatcherFactory, ColumnSetFactory, LocalCacheFactory, ModuleChangesCompilationFactory } from '../factories';
3
+ import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, LocalCacheManagerInterface, PromiseInterface } from '../interfaces';
4
+ import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
5
+ import { CollectionEntryParentIdMap, CollectionResourceParentIdMap, ItemId, ItemResourceItemTypeMap, ItemType, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types';
6
+ export declare class ItemAdministrator {
7
+ private apiRequestService;
8
+ private authInterface;
9
+ private collectionEntryService;
10
+ private collectionHandler;
11
+ private collectionMatcherFactory;
12
+ private collectionResourceService;
13
+ private columnSetFactory;
14
+ private errorHandler;
15
+ private itemEntryService;
16
+ private itemHandler;
17
+ private itemRequestService;
18
+ private keyService;
19
+ private localCacheFactory;
20
+ private localCacheManager;
21
+ private moduleChangesCompilationFactory;
22
+ private promiseInterface;
23
+ private queryService;
24
+ constructor(apiRequestService: ApiRequestServiceInterface, authInterface: AuthInterface, collectionEntryService: CollectionEntryService, collectionHandler: CollectionHandler, collectionMatcherFactory: CollectionMatcherFactory, collectionResourceService: CollectionResourceService, columnSetFactory: ColumnSetFactory, errorHandler: ErrorHandlerInterface, itemEntryService: ItemEntryService, itemHandler: ItemHandler, itemRequestService: ItemRequestService, keyService: KeyService, localCacheFactory: LocalCacheFactory, localCacheManager: LocalCacheManagerInterface, moduleChangesCompilationFactory: ModuleChangesCompilationFactory, promiseInterface: PromiseInterface, queryService: QueryService);
25
+ getItemDefinition(itemType: ItemType, itemId: any, options: any): {
26
+ itemType: string;
27
+ options: any;
28
+ itemId: any;
29
+ };
30
+ getCollectionMatcher(itemEntries: ItemEntry[], addToTab: boolean): CollectionMatcher;
31
+ fetchTitle(itemType: any, itemId: any, deferRequest: any): Promise<any>;
32
+ getItemById(itemType: ItemType, itemId: ItemId, options: any): Promise<ItemResource>;
33
+ getItemsById(itemType: string, itemIds: number[], options: any): Promise<ItemResource[]>;
34
+ getItemsByQuery(itemType: string, query: any, options: any): Promise<ItemResource[]>;
35
+ getDuplicateById(itemType: string, duplicateId: number, options: any): Promise<any>;
36
+ /**
37
+ * The return value is depended on the return links boolean. true returns the TemplateResponseItemEntryMap.
38
+ * The type has to be asserted at use since you only know the type of the return value when the function is called
39
+ *
40
+ * @param {string} itemType
41
+ * @param options
42
+ * @param {boolean} returnLinks
43
+ * @param {boolean} isRoot
44
+ * @returns {Promise<ItemResource> | Promise<TemplateResponseItemEntryMap>}
45
+ */
46
+ getNewResource(itemType: string, options?: any, returnLinks?: boolean, isRoot?: boolean): Promise<ItemResource> | Promise<TemplateResponseItemEntryMap>;
47
+ getCollectionDef(itemType: string, options: any): {
48
+ itemType: string;
49
+ options: {
50
+ entry: any;
51
+ resource: any;
52
+ };
53
+ };
54
+ getLinkCollectionsDef(linkType: string, linkIdArray: number[], itemType: string, linkField: string, options: any): {
55
+ itemType: string;
56
+ linkType: string;
57
+ linkIdArray: number[];
58
+ linkField: string;
59
+ options: {
60
+ entry: any;
61
+ resource: any;
62
+ };
63
+ };
64
+ getCollection(itemType: string, options: any): Promise<CollectionResource>;
65
+ getCollectionFromDef(definition: any): Promise<CollectionResource>;
66
+ /**
67
+ * @deprecated, use `parent` in options
68
+ */
69
+ getLinkCollection(linkType: string, linkId: number, itemType: string, options: any): Promise<CollectionResource>;
70
+ getLinkCollections(linkType: string, linkIdArray: number[], itemType: string, options: any): Promise<CollectionResourceParentIdMap>;
71
+ getLinkCollectionsFromDef(definition: any): Promise<CollectionResourceParentIdMap>;
72
+ getAllLinkCollections(linkType: string, itemType: string, options: any): Promise<CollectionEntryParentIdMap>;
73
+ getItemByDef(definition: any, isRoot: boolean): Promise<any>;
74
+ cloneItem(itemResource: ItemResource, options: any): ItemResource;
75
+ cloneCollection(collectionResource: CollectionResource, options: any, conversionMap: any): CollectionResource;
76
+ saveCurrentLocalCache(closeTab: boolean, parameters: any, breakupByParent: boolean | undefined, onAfterCreateCallback: any): any;
77
+ getCurrentCollections(): CollectionCache;
78
+ getCurrentItems(): ItemCache;
79
+ getCurrentChanges(): {
80
+ itemType: string;
81
+ itemId: number;
82
+ items: any;
83
+ };
84
+ addSingleItem(itemEntry: ItemEntry, options: any, isRoot?: boolean, localCache?: LocalCache): ItemResource;
85
+ addSingleItems(itemEntries: ItemEntry[], options: any): ItemResource[];
86
+ addCollection(collectionEntry: CollectionEntry, options: any): CollectionResource;
87
+ processLinkedItems(linkedEntries: TemplateResponseLinkedItemEntryMap[], options: any, addToCollections: boolean): ItemResourceItemTypeMap;
88
+ getLocalCache(): LocalCache;
89
+ resetLocalCache(): void;
90
+ addToCollections(itemEntries: ItemEntry[], resultCollectionResource?: CollectionResource): ItemResource[] | null;
91
+ removeFromCollections(itemEntries: ItemEntry[], resultCollectionResource?: CollectionResource): ItemResource[] | null;
92
+ saveLocal(itemResource: ItemResource): Promise<any>;
93
+ updateItemIdMap(collectionMap: any, conversionMap: any): void;
94
+ createCollectionResource(collectionEntry: any, resourceOptions: any, processOptions?: boolean): CollectionResource;
95
+ createItemResource(itemEntry: any, options: any, isRoot: boolean): ItemResource;
96
+ onBeforeSave(key: string, callback: any): () => boolean;
97
+ onSaveSuccess(key: string, callback: any): () => boolean;
98
+ onSaveWithoutClosing(key: string, callback: any): () => boolean;
99
+ }
@@ -1,22 +1,25 @@
1
- import { QueryMatcherFactory } from "../factories";
2
- import { ItemEntry } from "../models";
3
- import { ItemEntryService } from "./ItemEntryService";
4
- export declare class ItemCache {
5
- private queryMatcherFactory;
6
- private itemEntryService;
7
- entries: {};
8
- constructor(queryMatcherFactory: QueryMatcherFactory, itemEntryService: ItemEntryService);
9
- some(callback: (itemEntry) => boolean): boolean;
10
- getByItemType(itemType: any): any[];
11
- getByQuery(itemType: any, query: any): any[];
12
- getLocalByQuery(itemType: any, query: any): any[];
13
- forEach(callback: any): void;
14
- toArray(): any[];
15
- add(itemEntry: ItemEntry): ItemEntry;
16
- get(itemType: any, itemId: any): any;
17
- getByParent(parentType: any, parentId: any, itemType: any): any[];
18
- contains(itemType: any, itemId: any): boolean;
19
- updateItemId(itemEntry: ItemEntry, oldItemId: any): ItemEntry;
20
- clear(itemEntry: ItemEntry): boolean;
21
- matchQuery(itemEntry: ItemEntry, query: any): boolean;
22
- }
1
+ import { QueryMatcherFactory } from '../factories';
2
+ import { ItemEntry } from '../models';
3
+ import { ItemId, ItemType } from '../types';
4
+ export declare class ItemCache {
5
+ private queryMatcherFactory;
6
+ entries: {
7
+ [itemType: string]: {
8
+ [itemId: number]: ItemEntry;
9
+ };
10
+ };
11
+ constructor(queryMatcherFactory: QueryMatcherFactory);
12
+ some(callback: (itemEntry: ItemEntry) => boolean): boolean;
13
+ getByItemType(itemType: ItemType): ItemEntry[];
14
+ getByQuery(itemType: ItemType, query: any): ItemEntry[];
15
+ getLocalByQuery(itemType: ItemType, query: any): ItemEntry[];
16
+ forEach(callback: (itemEntry: ItemEntry) => void): void;
17
+ toArray(): ItemEntry[];
18
+ add(itemEntry: ItemEntry): ItemEntry;
19
+ get(itemType: ItemType, itemId: ItemId | string): any;
20
+ contains(itemType: ItemType, itemId: ItemId | string): boolean;
21
+ getByParent(parentType: ItemType, parentId: ItemId, itemType: ItemType): ItemEntry[];
22
+ updateItemId(itemEntry: ItemEntry, oldItemId: any): ItemEntry;
23
+ clear(itemEntry: ItemEntry): boolean;
24
+ matchQuery(itemEntry: ItemEntry, query: any): boolean;
25
+ }
@@ -1,51 +1,18 @@
1
- import { PromiseInterface } from '../interfaces';
2
- import { ItemEntry } from '../models/';
3
- import { ApiFormatter } from './ApiFormatter';
4
- import { KeyService } from './KeyService';
5
- export declare class ItemEntryService {
6
- private apiFormatter;
7
- private keyService;
8
- private promiseService;
9
- undefinedItemError: string;
10
- ALL_PERMISSIONS: number;
11
- constructor(apiFormatter: ApiFormatter, keyService: KeyService, promiseService: PromiseInterface);
12
- resetDerived(itemEntry: any, columnIds: any): void;
13
- defer(itemEntry: ItemEntry, deferRequest: any): ItemEntry;
14
- resolve(itemEntry: any): ItemEntry;
15
- reject(itemEntry: any, error?: string): ItemEntry;
16
- clearResources(itemEntry: any): void;
17
- deactivateResources(itemEntry: any): void;
18
- getFields(itemEntry: any): any;
19
- expand(entry: any, main: any, derived: any, expandResource: any): any;
20
- processOptions(options: any): any;
21
- getConversionValue(itemType: any, itemId: any, map: any): any;
22
- updateFields(entry: any, source: any, overwrite?: boolean): any;
23
- updateItemValue(entry: any, fields: any, apiColumn: any, conversionMap: any): void;
24
- updateItemFields(entry: any, conversionMap: any): void;
25
- process(entry: any): any;
26
- formatRequest(entry: any): {};
27
- setDisplayName(entry: any): void;
28
- getDisplayName(entry: any): any;
29
- getFullName(firstName: any, infix: any, lastName: any): any;
30
- getTitleField(itemType: any): "serienummer" | "nummer" | "friendlyname" | "naamintern" | "omschrijving" | "code" | "naam" | "displayname";
31
- /**
32
- *
33
- * @param {Object} entry
34
- * @param {Boolean} returnAll Returns all initial values if true
35
- * @returns {Object}
36
- */
37
- getChanges(entry: any, returnAll: any): any[];
38
- isLocal(entry: any): boolean;
39
- isLockable(entry: any): boolean;
40
- hasChanges(entry: any): boolean;
41
- resetModified(entry: any): void;
42
- setInitial(entry: any, values: any, enableCallbacks?: any): any;
43
- /**
44
- * Does a shallow copy of values!
45
- */
46
- setModified(entry: any, values?: any): any;
47
- setDerived(entry: any, values: any): any;
48
- processLocal(entry: any, initial: any, modified: any, derived: any, conversionMap: any): any;
49
- setParent(entry: any, parentType: any, parentId: any): any;
50
- callOnChange(entry: any, previous: any): void;
51
- }
1
+ import { KeyService } from '../classes';
2
+ import { ItemEntry } from '../models';
3
+ import { ApiResponse, ItemId, ItemIdConversionMap, ItemType } from '../types';
4
+ export declare class ItemEntryService {
5
+ private keyService;
6
+ undefinedItemError: string;
7
+ ALL_PERMISSIONS: number;
8
+ constructor(keyService: KeyService);
9
+ processOptions(options: any): any;
10
+ createLocalConversionMap(itemType: ItemType, itemId: ItemId, doExtend: boolean | undefined, apiResponse: ApiResponse): ItemIdConversionMap;
11
+ expandLocalConversionMap(parentType: ItemType, parentId: ItemId, apiResponse: ApiResponse, conversionMap: ItemIdConversionMap): void;
12
+ expandConversionMap(itemEntry: ItemEntry, conversionMap: ItemIdConversionMap, newItemId?: ItemId): any;
13
+ batchExpandConversionMap(itemEntries: ItemEntry[], conversionMap: ItemIdConversionMap): ItemIdConversionMap;
14
+ getConversionValue(itemType: any, itemId: any, map: any): any;
15
+ batchClone(itemEntries: ItemEntry[], conversionMap?: ItemIdConversionMap): ItemEntry[];
16
+ getFullName(firstName: any, infix: any, lastName: any): any;
17
+ getTitleField(itemType: any): "serienummer" | "nummer" | "friendlyname" | "naamintern" | "omschrijving" | "code" | "naam" | "displayname";
18
+ }
@@ -1,82 +1,57 @@
1
- import { ENTRY_STATUS } from "../constants";
2
- import { BatchStatusFactory, ColumnExpansionFactory, ColumnSetFactory, ItemCacheFactory, ItemEntryFactory } from "../factories";
3
- import { ApiRequestServiceInterface, AuthInterface, ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
- import { ItemEntry } from "../models";
5
- import { ApiTemplateItemTypeMap, EntryStatus, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types/ItemTypesCollection';
6
- import { ApiFormatter } from "./ApiFormatter";
7
- import { ApiResponseProcessor } from './ApiResponseProcessor';
8
- import { BatchStatus } from './BatchStatus';
9
- import { ColumnHandler } from './ColumnHandler';
10
- import { ColumnUtil } from './ColumnUtil';
11
- import { ItemCache } from "./ItemCache";
12
- import { ItemEntryService } from "./ItemEntryService";
13
- import { KeyService } from "./KeyService";
14
- export declare class ItemHandler {
15
- private apiRequestService;
16
- private authInterface;
17
- private errorHandler;
18
- private itemEntryFactory;
19
- private columnHandler;
20
- private itemCacheFactory;
21
- private batchStatusFactory;
22
- private columnExpansionFactory;
23
- private columnSetFactory;
24
- private itemEntryService;
25
- private apiFormatter;
26
- private keyService;
27
- private promiseService;
28
- private columnUtil;
29
- entries: ItemCache;
30
- templates: ApiTemplateItemTypeMap;
31
- constructor(apiRequestService: ApiRequestServiceInterface, authInterface: AuthInterface, errorHandler: ErrorHandlerInterface, itemEntryFactory: ItemEntryFactory, columnHandler: ColumnHandler, itemCacheFactory: ItemCacheFactory, batchStatusFactory: BatchStatusFactory, columnExpansionFactory: ColumnExpansionFactory, columnSetFactory: ColumnSetFactory, itemEntryService: ItemEntryService, apiFormatter: ApiFormatter, keyService: KeyService, promiseService: PromiseInterface, columnUtil: ColumnUtil);
32
- getItemId(itemEntry: ItemEntry): number;
33
- getPromise(itemEntry: ItemEntry): any;
34
- fetchItem(itemType: string, itemId: number, options: any): Promise<ItemEntry | TemplateResponseItemEntryMap>;
35
- /**
36
- *
37
- * @param itemType
38
- * @param itemIds
39
- * @param options
40
- * @returns {Promise<ItemEntry[]>}
41
- *
42
- * For every itemid find the status of the ItemEntry and resolve the promises so the result is
43
- * a usable ItemEntry
44
- */
45
- fetchItems(itemType: any, itemIds: any, options: any): Promise<ItemEntry[]>;
46
- resolveCached(itemEntry: ItemEntry, status: ENTRY_STATUS, options: any): Promise<ItemEntry>;
47
- resolveLocal(itemEntry: ItemEntry, parent: any, template: any): TemplateResponseItemEntryMap;
48
- resolveExpansion(itemEntry: any, columnExpansion: any, response: any): ItemEntry;
49
- resolveRemote(itemEntry: any, columnInfo: any, response: any): ItemEntry;
50
- fetchTemplate(itemType: string, templateOptions?: any, templateColumns?: any): Promise<any>;
51
- getEntryStatus(itemType: string, itemId: number, options: any): EntryStatus<ItemEntry>;
52
- getCachedEntryStatus(itemEntry: ItemEntry, options: any): ENTRY_STATUS;
53
- createDeferredEntry(itemType: string, itemId: number, requestColumns: any, deferRequest: any): ItemEntry;
54
- createEntryStub(itemType: string, itemId: number): ItemEntry;
55
- createEntry(itemId: number, initial: any, derived: any, columnInfo: any): ItemEntry;
56
- resolveDeferredEntry(itemEntry: any, initial: any, derived: any, columns: any): ItemEntry;
57
- /**
58
- *
59
- * @param itemType
60
- * @param {BatchStatus} batchStatus
61
- * @param requestColumns
62
- * @param resolved
63
- * @returns {ItemEntry[]}
64
- *
65
- * for every type of entry status there is in this batch request make sure the entries get resolved.
66
- * then return a array of the resulting ItemEntryArray
67
- */
68
- batchResolve(itemType: any, batchStatus: BatchStatus, requestColumns: any, resolved: any): ItemEntry[] | Promise<any>;
69
- cloneItem(newItemId: any, itemEntry: any, conversionMap?: any): any;
70
- createConversionMap(itemType: string, itemId: number, extend: boolean, response: any): {
71
- [x: string]: {
72
- [x: number]: number;
73
- };
74
- };
75
- createLocalEntries(parentType: string, localParentId: number, template: any, conversionMap: any): TemplateResponseLinkedItemEntryMap[];
76
- createLocalEntry(itemId: number, template: any, modified: any, derived: any, parent?: any): ItemEntry;
77
- extendConversionMap(conversionMap: any, links: any, apiResponse: any): void;
78
- fetchTitle(itemType: string, itemId: number, deferRequest?: boolean): Promise<any>;
79
- requestItem(itemType: string, itemId: number | number[], columns: any): Promise<ApiResponseProcessor>;
80
- updateItemId(itemEntry: any, itemId: any): ItemEntry;
81
- private setCreator(itemEntry);
82
- }
1
+ import { ApiResponseProcessor, BatchStatus, ColumnHandler, ColumnUtil, ItemCache, ItemEntryService, KeyService } from '../classes';
2
+ import { ENTRY_STATUS } from '../constants';
3
+ import { BatchStatusFactory, ColumnExpansionFactory, ColumnSetFactory, ItemCacheFactory, ItemEntryFactory } from '../factories';
4
+ import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseInterface } from '../interfaces';
5
+ import { ItemEntry } from '../models';
6
+ import { ApiTemplateItemTypeMap, EntryStatus, ItemId, ItemIdConversionMap, ItemType, TemplateResponseItemEntryMap, TemplateResponseLinkedItemEntryMap } from '../types';
7
+ export declare class ItemHandler {
8
+ private apiRequestService;
9
+ private errorHandler;
10
+ private itemEntryFactory;
11
+ private columnHandler;
12
+ private itemCacheFactory;
13
+ private batchStatusFactory;
14
+ private columnExpansionFactory;
15
+ private columnSetFactory;
16
+ private itemEntryService;
17
+ private keyService;
18
+ private promiseService;
19
+ private columnUtil;
20
+ entries: ItemCache;
21
+ templates: ApiTemplateItemTypeMap;
22
+ constructor(apiRequestService: ApiRequestServiceInterface, errorHandler: ErrorHandlerInterface, itemEntryFactory: ItemEntryFactory, columnHandler: ColumnHandler, itemCacheFactory: ItemCacheFactory, batchStatusFactory: BatchStatusFactory, columnExpansionFactory: ColumnExpansionFactory, columnSetFactory: ColumnSetFactory, itemEntryService: ItemEntryService, keyService: KeyService, promiseService: PromiseInterface, columnUtil: ColumnUtil);
23
+ fetchItem(itemType: ItemType, itemId: ItemId, options: any, localItemCache: ItemCache): Promise<ItemEntry | TemplateResponseItemEntryMap>;
24
+ /**
25
+ *
26
+ * @param itemType
27
+ * @param itemIds
28
+ * @param options
29
+ * @returns {Promise<ItemEntry[]>}
30
+ *
31
+ * For every itemid find the status of the ItemEntry and resolve the promises so the result is
32
+ * a usable ItemEntry
33
+ */
34
+ fetchItems(itemType: any, itemIds: any, options: any, localItemCache: ItemCache): Promise<ItemEntry[]>;
35
+ resolveCached(itemEntry: ItemEntry, status: ENTRY_STATUS, options: any): Promise<ItemEntry>;
36
+ resolveLocal(itemEntry: ItemEntry, parent: any, template: any, localItemCache: ItemCache): TemplateResponseItemEntryMap;
37
+ resolveExpansion(itemEntry: any, columnExpansion: any, response: any): ItemEntry;
38
+ resolveRemote(itemEntry: any, columnInfo: any, response: any): any;
39
+ fetchTemplate(itemType: string, templateOptions?: any, templateColumns?: any): Promise<any>;
40
+ getEntryStatus(itemType: ItemType, itemId: ItemId, options: any, localItemCache: ItemCache): EntryStatus<ItemEntry>;
41
+ getCachedEntryStatus(itemEntry: ItemEntry, options: any): ENTRY_STATUS;
42
+ /**
43
+ *
44
+ * @param itemType
45
+ * @param {BatchStatus} batchStatus
46
+ * @param requestColumns
47
+ * @param resolved
48
+ * @returns {ItemEntry[]}
49
+ *
50
+ * for every type of entry status there is in this batch request make sure the entries get resolved.
51
+ * then return a array of the resulting ItemEntryArray
52
+ */
53
+ batchResolve(itemType: any, batchStatus: BatchStatus, requestColumns: any, resolved: any, localItemCache: ItemCache): ItemEntry[] | Promise<any>;
54
+ createLocalEntries(parentType: ItemType, localParentId: ItemId, template: any, itemIdConversion: ItemIdConversionMap, localItemCache: ItemCache): TemplateResponseLinkedItemEntryMap[];
55
+ fetchTitle(itemType: ItemType, itemId: ItemId, deferRequest: boolean | undefined, localItemCache: ItemCache): Promise<any>;
56
+ requestItems(itemType: string, itemIds: ItemId[], columns: any): Promise<ApiResponseProcessor>;
57
+ }
@@ -1,28 +1,22 @@
1
- import { ColumnExpansionFactory, ColumnSetFactory } from "../factories";
2
- import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseInterface } from '../interfaces';
3
- import { CollectionEntry, ItemEntry } from "../models";
4
- import { ApiResponseProcessor } from './ApiResponseProcessor';
5
- import { ColumnExpansion } from "./ColumnExpansion";
6
- import { ColumnHandler } from "./ColumnHandler";
7
- import { ItemEntryService } from "./ItemEntryService";
8
- import { ItemHandler } from "./ItemHandler";
9
- import { QueryService } from "./QueryService";
10
- export declare class ItemRequestService {
11
- private apiRequestService;
12
- private errorHandler;
13
- private itemHandler;
14
- private columnHandler;
15
- private columnExpansionFactory;
16
- private columnSetFactory;
17
- private itemEntryService;
18
- private queryService;
19
- private promiseService;
20
- constructor(apiRequestService: ApiRequestServiceInterface, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, columnHandler: ColumnHandler, columnExpansionFactory: ColumnExpansionFactory, columnSetFactory: ColumnSetFactory, itemEntryService: ItemEntryService, queryService: QueryService, promiseService: PromiseInterface);
21
- requestItem(itemType: any, itemId: any, columns: any): Promise<ApiResponseProcessor>;
22
- requestItems(collectionEntry: CollectionEntry, query?: any, columns?: any): Promise<ApiResponseProcessor>;
23
- requestLinkItems(parentType: any, parentIdArray: any, itemType: any, query: any, columns: any): Promise<ApiResponseProcessor>;
24
- processExpansion(requestColumns: any, response: any, itemType: string, itemEntries: ItemEntry[]): ColumnExpansion;
25
- processResponse(response: any, idArray: any, parent: any, columnInfo: any, columnExpansion?: any): Promise<ItemEntry[]>;
26
- handleCachedItem(itemEntry: any, response: any, columnExpansion: ColumnExpansion): any;
27
- processLinkResponse(response: any, parentType: any, parentIdArray: any, itemType: any, options: any): Promise<any>;
28
- }
1
+ import { ApiResponseProcessor, ColumnExpansion, ItemHandler, QueryService } from '../classes';
2
+ import { ColumnExpansionFactory, ColumnSetFactory, ItemEntryFactory } from '../factories';
3
+ import { ApiRequestServiceInterface, ErrorHandlerInterface, PromiseInterface } from '../interfaces';
4
+ import { CollectionEntry, ItemEntry } from '../models';
5
+ export declare class ItemRequestService {
6
+ private apiRequestService;
7
+ private errorHandler;
8
+ private itemHandler;
9
+ private columnExpansionFactory;
10
+ private columnSetFactory;
11
+ private itemEntryFactory;
12
+ private queryService;
13
+ private promiseService;
14
+ constructor(apiRequestService: ApiRequestServiceInterface, errorHandler: ErrorHandlerInterface, itemHandler: ItemHandler, columnExpansionFactory: ColumnExpansionFactory, columnSetFactory: ColumnSetFactory, itemEntryFactory: ItemEntryFactory, queryService: QueryService, promiseService: PromiseInterface);
15
+ requestItem(itemType: any, itemId: any, columns: any): Promise<ApiResponseProcessor>;
16
+ requestItems(collectionEntry: CollectionEntry, query?: any, columns?: any): Promise<ApiResponseProcessor>;
17
+ requestLinkItems(parentType: any, parentIdArray: any, itemType: any, query: any, columns: any): Promise<ApiResponseProcessor>;
18
+ processExpansion(requestColumns: any, response: any, itemType: string, itemEntries: ItemEntry[]): ColumnExpansion;
19
+ processResponse(response: any, idArray: any, parent: any, columnInfo: any, columnExpansion?: any): Promise<ItemEntry[]>;
20
+ handleCachedItem(itemEntry: any, response: any, columnExpansion: ColumnExpansion): any;
21
+ processLinkResponse(response: any, parentType: any, parentIdArray: any, itemType: any, options: any): Promise<any>;
22
+ }
@@ -1,7 +1,7 @@
1
- import { EditResource } from '../models';
2
- export declare class ItemResourceService {
3
- constructor();
4
- processOptions(options: any): any;
5
- compareOptions(first: any, second: any): boolean;
6
- isNewResource(resource: EditResource): boolean;
7
- }
1
+ import { EditResource } from '../models';
2
+ export declare class ItemResourceService {
3
+ constructor();
4
+ processOptions(options: any): any;
5
+ compareOptions(first: any, second: any): boolean;
6
+ isNewResource(resource: EditResource): boolean;
7
+ }
@@ -1,28 +1,25 @@
1
- export declare class KeyService {
2
- NEW_PREFIX: string;
3
- DUPLICATE_PREFIX: string;
4
- NEW_KEYWORD: string;
5
- DUPLICATE_KEYWORD: string;
6
- seperator: string;
7
- constructor();
8
- getSingleKey(itemType: string, itemId: number | string): string;
9
- getCollectionCacheKey(parentType: string, parentId: number, childType: string): string;
10
- getCssKey(): any;
11
- parseStateKey(stateKey: string): {
12
- type: string;
13
- template: string;
14
- itemId?: undefined;
15
- } | {
16
- type: string;
17
- itemId: string;
18
- template?: undefined;
19
- };
20
- getDuplicateStateKey(itemId: string | number): string;
21
- getNewStateKey(templateType: string): string;
22
- getLocalId(): number;
23
- getLocalDuplicateId(): number;
24
- getRandomString(): string;
25
- isLocalId(itemId: number | string): boolean;
26
- isNewId(itemId: number | string): boolean;
27
- isDuplicateId(itemId: number | string): boolean;
28
- }
1
+ import { ItemId } from '../types';
2
+ export declare class KeyService {
3
+ separator: string;
4
+ constructor();
5
+ getSingleKey(itemType: string, itemId: number | string): string;
6
+ getCollectionCacheKey(parentType: string, parentId: number, childType: string): string;
7
+ getCssKey(): any;
8
+ parseStateKey(stateKey: string): {
9
+ type: string;
10
+ template: string;
11
+ itemId?: undefined;
12
+ } | {
13
+ type: string;
14
+ itemId: string;
15
+ template?: undefined;
16
+ } | null;
17
+ getDuplicateStateKey(itemId: string | number): string;
18
+ getNewStateKey(templateType: string): string;
19
+ getLocalId(): ItemId;
20
+ getLocalDuplicateId(): ItemId;
21
+ getRandomString(): string;
22
+ isLocalId(itemId: ItemId | string): boolean;
23
+ isNewId(itemId: ItemId | string): boolean;
24
+ isDuplicateId(itemId: ItemId | string): boolean;
25
+ }