@rentman/rm-core 12.1.2 → 12.1.3

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 (146) hide show
  1. package/changelog.md +1502 -1495
  2. package/dist/rm-core.js +831 -911
  3. package/dist/rm-core.min.js +1 -1
  4. package/dist/types/src/FieldLookupProxy.d.ts +4 -4
  5. package/dist/types/src/classes/ApiFormatter.d.ts +56 -76
  6. package/dist/types/src/classes/ApiRequestService.d.ts +18 -18
  7. package/dist/types/src/classes/ApiResponseProcessor.d.ts +29 -29
  8. package/dist/types/src/classes/BusinessLogicManager/BusinessLogicManager.d.ts +100 -100
  9. package/dist/types/src/classes/BusinessLogicManager/BusinessLogicRule.d.ts +93 -93
  10. package/dist/types/src/classes/BusinessLogicManager/Customfield/CustomFieldTypeBusinessLogicRule.d.ts +17 -17
  11. package/dist/types/src/classes/BusinessLogicManager/Documents/DocumentTemplateBusinessLogicRule.d.ts +24 -24
  12. package/dist/types/src/classes/BusinessLogicManager/Exemplaar/ExemplaarAanschafdatumBusinessLogicRule.d.ts +13 -13
  13. package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurBetalingsconditieBusinessLogicRule.d.ts +19 -19
  14. package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurDatumBusinessLogicRule.d.ts +18 -18
  15. package/dist/types/src/classes/BusinessLogicManager/Factuur/FactuurNumberseriesBusinessLogicRule.d.ts +13 -13
  16. package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieNaaminternBusinessLogicRule.d.ts +17 -17
  17. package/dist/types/src/classes/BusinessLogicManager/Functie/FunctieTwowayBusinessLogicRule.d.ts +13 -13
  18. package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalTelexemplarenBusinessLogicRule.d.ts +15 -15
  19. package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalTypeBusinessLogicRule.d.ts +17 -17
  20. package/dist/types/src/classes/BusinessLogicManager/Materiaal/MateriaalVerhuurBusinessLogicRule.d.ts +17 -17
  21. package/dist/types/src/classes/BusinessLogicManager/Materiaal/SurfaceArticleSizeBusinessLogicRule.d.ts +18 -18
  22. package/dist/types/src/classes/BusinessLogicManager/OfferteContract/OfferteContractDatumBusinessLogicRule.d.ts +25 -25
  23. package/dist/types/src/classes/BusinessLogicManager/PlanningPersoneelTransport/PlanningPersoneelTransportBusinessLogicRule.d.ts +28 -28
  24. package/dist/types/src/classes/BusinessLogicManager/Project/ProjectClientNoteBusinessLogicRule.d.ts +22 -22
  25. package/dist/types/src/classes/BusinessLogicManager/Reparatie/ReparatieExemplaarAantalBusinessLogicRule.d.ts +13 -13
  26. package/dist/types/src/classes/BusinessLogicManager/Reparatie/ReparatieExemplaarLocationBusinessLogicRule.d.ts +23 -23
  27. package/dist/types/src/classes/BusinessLogicManager/Rol/RolDocumentAccessBusinessLogicRule.d.ts +17 -17
  28. package/dist/types/src/classes/BusinessLogicManager/Rol/RolEditOwnDataBusinessLogicRule.d.ts +17 -17
  29. package/dist/types/src/classes/BusinessLogicManager/Rol/RolFileAccessBusinessLogicRule.d.ts +17 -17
  30. package/dist/types/src/classes/BusinessLogicManager/Rol/RolPersoneelsplannerToegangBusinessLogicRule.d.ts +17 -17
  31. package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenBewerkenBusinessLogicRule.d.ts +17 -17
  32. package/dist/types/src/classes/BusinessLogicManager/Rol/RolProjectenToegangBusinessLogicRule.d.ts +17 -17
  33. package/dist/types/src/classes/CacheSyncer.d.ts +71 -71
  34. package/dist/types/src/classes/ChangesCompilation.d.ts +33 -33
  35. package/dist/types/src/classes/ChangesDelta.d.ts +65 -65
  36. package/dist/types/src/classes/ChangesDeltaBase.d.ts +103 -88
  37. package/dist/types/src/classes/ChangesProcessor.d.ts +40 -40
  38. package/dist/types/src/classes/CollectionEntryService.d.ts +24 -24
  39. package/dist/types/src/classes/CollectionResourceService.d.ts +6 -6
  40. package/dist/types/src/classes/ColumnCache.d.ts +19 -19
  41. package/dist/types/src/classes/ColumnExpansion.d.ts +19 -19
  42. package/dist/types/src/classes/ColumnHandler.d.ts +20 -20
  43. package/dist/types/src/classes/ColumnInfo.d.ts +15 -15
  44. package/dist/types/src/classes/ColumnSet.d.ts +37 -37
  45. package/dist/types/src/classes/ColumnUtil.d.ts +108 -108
  46. package/dist/types/src/classes/ConversionMapService.d.ts +25 -25
  47. package/dist/types/src/classes/CreateRequest.d.ts +17 -17
  48. package/dist/types/src/classes/CreatedChangesDelta.d.ts +17 -17
  49. package/dist/types/src/classes/InternalChangesDelta.d.ts +44 -44
  50. package/dist/types/src/classes/ItemCache.d.ts +27 -27
  51. package/dist/types/src/classes/ItemCreateService.d.ts +18 -18
  52. package/dist/types/src/classes/ItemEntryService.d.ts +32 -32
  53. package/dist/types/src/classes/KeyService.d.ts +18 -18
  54. package/dist/types/src/classes/LockService.d.ts +28 -28
  55. package/dist/types/src/classes/ModuleChangesCompilation.d.ts +17 -17
  56. package/dist/types/src/classes/ParentChangesDelta.d.ts +41 -41
  57. package/dist/types/src/classes/QueryColumnExtractor.d.ts +18 -18
  58. package/dist/types/src/classes/QueryContainsLocalIdParser.d.ts +17 -17
  59. package/dist/types/src/classes/QueryLinkedToParser.d.ts +17 -17
  60. package/dist/types/src/classes/QueryLocallyMatchableParser.d.ts +20 -20
  61. package/dist/types/src/classes/QueryMatcher.d.ts +25 -25
  62. package/dist/types/src/classes/QueryParser.d.ts +25 -25
  63. package/dist/types/src/classes/QueryParserBase.d.ts +20 -20
  64. package/dist/types/src/classes/QueryParserIdUpdater.d.ts +17 -17
  65. package/dist/types/src/classes/QueryService.d.ts +12 -12
  66. package/dist/types/src/classes/RequestBuffer.d.ts +26 -26
  67. package/dist/types/src/classes/RequestBufferManager.d.ts +21 -21
  68. package/dist/types/src/classes/RequestColumnExpansion.d.ts +13 -13
  69. package/dist/types/src/classes/RequestColumnsOperationsCache.d.ts +46 -46
  70. package/dist/types/src/classes/SocketMessageHandler.d.ts +34 -34
  71. package/dist/types/src/classes/TemplateCache.d.ts +64 -64
  72. package/dist/types/src/classes/Util.d.ts +28 -28
  73. package/dist/types/src/classes/cache/AbstractCache.d.ts +85 -85
  74. package/dist/types/src/classes/cache/CachedQueryHandlerBase.d.ts +70 -70
  75. package/dist/types/src/classes/cache/ItemHandlerBase.d.ts +107 -107
  76. package/dist/types/src/classes/cache/server/ServerCache.d.ts +65 -65
  77. package/dist/types/src/classes/cache/server/ServerCachedQueryHandler.d.ts +27 -27
  78. package/dist/types/src/classes/cache/server/ServerItemHandler.d.ts +39 -39
  79. package/dist/types/src/classes/cache/transaction/TransactionCache.d.ts +298 -298
  80. package/dist/types/src/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +50 -50
  81. package/dist/types/src/classes/cache/transaction/TransactionCollectionHandler.d.ts +24 -24
  82. package/dist/types/src/classes/cache/transaction/TransactionEventHandler.d.ts +21 -21
  83. package/dist/types/src/classes/cache/transaction/TransactionItemHandler.d.ts +80 -80
  84. package/dist/types/src/classes/cache/transaction/TransactionValidator.d.ts +33 -33
  85. package/dist/types/src/constants.d.ts +7 -7
  86. package/dist/types/src/core.d.ts +48 -48
  87. package/dist/types/src/factories/ApiResponseProcessorFactory.d.ts +6 -6
  88. package/dist/types/src/factories/CacheSyncerFactory.d.ts +14 -14
  89. package/dist/types/src/factories/ChangesCompilationFactory.d.ts +5 -5
  90. package/dist/types/src/factories/ChangesDeltaFactory.d.ts +13 -13
  91. package/dist/types/src/factories/ChangesProcessorFactory.d.ts +13 -13
  92. package/dist/types/src/factories/CollectionEntryFactory.d.ts +11 -11
  93. package/dist/types/src/factories/CollectionResourceFactory.d.ts +18 -18
  94. package/dist/types/src/factories/ColumnExpansionFactory.d.ts +7 -7
  95. package/dist/types/src/factories/ColumnInfoFactory.d.ts +7 -7
  96. package/dist/types/src/factories/ColumnSetFactory.d.ts +18 -18
  97. package/dist/types/src/factories/CreateRequestFactory.d.ts +9 -9
  98. package/dist/types/src/factories/ItemCacheFactory.d.ts +6 -6
  99. package/dist/types/src/factories/ItemEntryFactory.d.ts +12 -12
  100. package/dist/types/src/factories/ItemResourceFactory.d.ts +11 -11
  101. package/dist/types/src/factories/ModuleChangesCompilationFactory.d.ts +6 -6
  102. package/dist/types/src/factories/QueryMatcherFactory.d.ts +8 -8
  103. package/dist/types/src/factories/QueryParserFactory.d.ts +5 -5
  104. package/dist/types/src/factories/RequestColumnExpansionFactory.d.ts +6 -6
  105. package/dist/types/src/factories/RequestColumnsOperationsCacheFactory.d.ts +8 -8
  106. package/dist/types/src/factories/TemplateFactory.d.ts +8 -8
  107. package/dist/types/src/factories/TransactionCacheFactory.d.ts +13 -13
  108. package/dist/types/src/index.d.ts +1 -1
  109. package/dist/types/src/interfaces/AbstractCacheDependencyInterface.d.ts +38 -38
  110. package/dist/types/src/interfaces/ApiRequestServiceInterface.d.ts +12 -12
  111. package/dist/types/src/interfaces/AuthInterface.d.ts +10 -10
  112. package/dist/types/src/interfaces/ErrorHandlerInterface.d.ts +6 -6
  113. package/dist/types/src/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  114. package/dist/types/src/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  115. package/dist/types/src/interfaces/PromiseLibraryInterface.d.ts +33 -33
  116. package/dist/types/src/interfaces/ServerCacheDependencyInterface.d.ts +5 -5
  117. package/dist/types/src/interfaces/SocketMessageInterface.d.ts +3 -3
  118. package/dist/types/src/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +17 -17
  119. package/dist/types/src/interfaces/TransactionItemHandlerDependencyInterface.d.ts +22 -22
  120. package/dist/types/src/internal.d.ts +128 -128
  121. package/dist/types/src/models/CachedQueryItem.d.ts +40 -40
  122. package/dist/types/src/models/CollectionEntry.d.ts +22 -22
  123. package/dist/types/src/models/CollectionOptions.d.ts +44 -44
  124. package/dist/types/src/models/CollectionResource.d.ts +87 -87
  125. package/dist/types/src/models/ItemEntry.d.ts +19 -19
  126. package/dist/types/src/models/ItemEntryOptions.d.ts +8 -8
  127. package/dist/types/src/models/ItemResource.d.ts +95 -95
  128. package/dist/types/src/models/Template.d.ts +11 -11
  129. package/dist/types/src/types/ItemTypesCollection.d.ts +361 -361
  130. package/dist/types/src/types/PromiseInterface.d.ts +2 -2
  131. package/dist/types/tests/integration/core.test.d.ts +1 -1
  132. package/dist/types/tests/integration/helpers/helpers.d.ts +32 -32
  133. package/dist/types/tests/integration/transactions/field_lookup.test.d.ts +1 -1
  134. package/dist/types/tests/integration/transactions/get_by.test.d.ts +1 -1
  135. package/dist/types/tests/integration/transactions/updates.test.d.ts +1 -1
  136. package/dist/types/tests/mocks/ApiMocked.d.ts +19 -19
  137. package/dist/types/tests/mocks/PromiseLibrary.mocked.d.ts +2 -2
  138. package/dist/types/tests/regression/RM4_17754.test.d.ts +1 -1
  139. package/dist/types/tests/regression/RM4_18216.test.d.ts +1 -1
  140. package/dist/types/tests/unit/query_contains_local_id_parser.test.d.ts +1 -1
  141. package/dist/types/tests/unit/query_linked_to_parser.test.d.ts +1 -1
  142. package/dist/types/tests/unit/query_matcher.test.d.ts +1 -1
  143. package/dist/types/tests/unit/query_parser_id_updater.test.d.ts +1 -1
  144. package/dist/types/tests/unit/query_service.test.d.ts +1 -1
  145. package/package.json +57 -57
  146. package/readme.md +16 -16
@@ -1,298 +1,298 @@
1
- import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
2
- import { AbstractCache, AbstractCacheDependencyInterface, ApiQuery, ApiRequestColumnArray, ApiRequestColumns, CachedQueryItem, CachedQueryItemTree, ChangesDelta, ChangesDeltaResult, ChildCollectionOptions, ChildCollectionResources, ChildCollectionResourcesNull, CollectionDefinition, CollectionOptionsInterface, CollectionQuery, CollectionResource, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, DeregFunction, FieldChangeCallback, InternalChangesDelta, ItemEntry, ItemEntryChangesTuple, ItemEntryOptions, ItemIdConversionMap, ItemOptionsInterface, ItemResource, ItemResourcesItemTypeMap, ItemTypeColumnIds, ItemTypeMap, LinkCollectionDefinition, ModuleChangesCompilationResult, OnAfterCreateCallback, ParentChangesDelta, ParentItemMap, PromiseInterface, RmCore, ServerCache, TransactionCacheCallbackCondition, TransactionCacheCallbackType, TransactionCachedQueryHandler, TransactionCollectionHandler, TransactionEventHandler, TransactionItemHandler, TransactionOptions, TransactionValidatorFactory } from '../../../internal';
3
- declare type ItemResourceLinks<ItemTypeType extends ApiEnumItemType> = {
4
- main: ItemResource<ItemTypeType>;
5
- linked: ItemResourcesItemTypeMap;
6
- };
7
- export declare enum TransactionErrorLevel {
8
- warning = "warning",
9
- error = "error"
10
- }
11
- export declare type UndoFunction = () => PromiseInterface<ChangesDeltaResult>;
12
- /**
13
- * @description
14
- * The {@link TransactionCache TransactionCache} is responsible for keeping track of newly created {@link ItemEntry ItemEntries}
15
- * and {@link CollectionEntry CollectionEntries}, and the changes of existing ItemEntries and CollectionEntries.
16
- *
17
- * The TransactionCache is also responsible for creating {@link ItemResource ItemResources}, which is a combination of an {@link ItemEntry ItemEntry} and the current transaction's changes on this ItemEntry
18
- */
19
- export declare class TransactionCache extends AbstractCache {
20
- /**
21
- * @description
22
- * For debugging purposes
23
- */
24
- id?: string | undefined;
25
- /**
26
- * @description
27
- * A map of all item errors, can be populated using {@link TransactionValidator.setGlobalError TransactionValidator.setGlobalError} and {@link TransactionValidator.setItemError TransactionValidator.setItemError}.
28
- * Contains a translation and level for every error
29
- */
30
- errors: {
31
- item: {
32
- [itemEntryId: string]: {
33
- [columnId: string]: {
34
- [errorKey: string]: {
35
- fieldString: string;
36
- string: string;
37
- level: TransactionErrorLevel;
38
- };
39
- };
40
- };
41
- };
42
- global: {
43
- [key: string]: {
44
- string: string;
45
- level: TransactionErrorLevel;
46
- };
47
- };
48
- };
49
- /**
50
- * @description
51
- * Stores the 'root' {@link ItemEntry ItemEntry}, this {@link ItemEntry ItemEntry} can be used as request parent to store the whole transaction at once
52
- */
53
- rootItem: ItemEntry | undefined;
54
- /**
55
- * @description
56
- * Stores additional request parameters for when the transaction is stored to the server
57
- */
58
- tabRequestParameters: {};
59
- /**
60
- * @description
61
- * Is true while the {@link TransactionCache TransactionCache} is applying changes to the parent (can either be through a merge or an Api save)
62
- */
63
- isSaving: boolean;
64
- /**
65
- * @description
66
- * Is true when the current transaction has:
67
- * - Newly created items
68
- * - Removed items (from collections)
69
- * - Changes on existing items
70
- */
71
- hasChanges: boolean;
72
- /**
73
- * @description
74
- * The transaction's parent
75
- */
76
- readonly parent: AbstractCache;
77
- readonly itemHandler: TransactionItemHandler;
78
- readonly cachedQueryHandler: TransactionCachedQueryHandler;
79
- readonly collectionHandler: TransactionCollectionHandler;
80
- readonly eventHandler: TransactionEventHandler;
81
- private readonly validator?;
82
- private readonly options;
83
- private historyStep;
84
- private undoDeltas;
85
- private appliedDeltas;
86
- private _isValid;
87
- constructor(dependencies: AbstractCacheDependencyInterface, core: RmCore, parent: AbstractCache,
88
- /**
89
- * @description
90
- * For debugging purposes
91
- */
92
- id?: string | undefined, validatorFactory?: TransactionValidatorFactory, options?: Partial<TransactionOptions>);
93
- get isValid(): boolean;
94
- undo(): ReturnType<UndoFunction>;
95
- redo(): ReturnType<TransactionCache['applyChangesDelta']>;
96
- createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: TransactionOptions): TransactionCache;
97
- destroy(): void;
98
- expandCollectionResource(collectionResource: CollectionResource, newColumns: ApiRequestColumns): PromiseInterface<void>;
99
- /**
100
- * @description
101
- * Expands the collection with the new request columns, assumes that all collections have the same itemType
102
- */
103
- expandCollectionResources<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, collections: CollectionResourceParentIdMap<ItemTypeType>, newColumns: ApiRequestColumnArray): PromiseInterface<CollectionResourceParentIdMap>;
104
- registerFieldChangeCallback<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, callback: FieldChangeCallback<ItemTypeType>): DeregFunction;
105
- createChangesDelta(): ChangesDelta;
106
- getFirstErrorString(): undefined | string;
107
- /**
108
- * @description
109
- * Should only be called by {@link TransactionValidator TransactionValidator}
110
- * @internal
111
- */
112
- _setGlobalError(key: string, isInvalid: boolean, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
113
- /**
114
- * @description
115
- * Should only be called by {@link TransactionValidator TransactionValidator}
116
- * @internal
117
- */
118
- _setItemError(itemEntryId: ItemEntry['id'], columnId: string, errorKey: string, isInvalid: boolean, fieldErrorTranslationFn: () => string, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
119
- /**
120
- * @internal
121
- */
122
- _setIsValid(): void;
123
- /**
124
- * @description
125
- * Merges the passed changes from the parent Transaction into this Transaction's own changes and then propagates
126
- * them to all child Transactions, this assumes that an action is already handled in a parent, so it does't handle created entries
127
- * and removes entries that were in {@link TransactionItemHandler.deletedItems deletedItems} since they are already deleted
128
- *
129
- * ------------------
130
- *
131
- * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
132
- * the change has already been processed, and applyChangesDelta will process the changes once you save the transaction
133
- *
134
- * ------------------
135
- * Use {@link TransactionCache.applyChangesDelta applyChangesDelta} if you want to apply changes from outside the core
136
- */
137
- applyChangesFromParent(parentChangesDelta: ParentChangesDelta, isCalledAfterSocketUpdate?: boolean, conversionMap?: ItemIdConversionMap): PromiseInterface<void>;
138
- /**
139
- * @description
140
- * Applies changes to this transaction and its children
141
- *
142
- * ------------------
143
- *
144
- * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
145
- * the change has already been processed, and applyChangesDelta will process the changes itself (result vs cause)
146
- */
147
- applyChangesDelta(changesDelta: ChangesDelta | InternalChangesDelta): PromiseInterface<ChangesDeltaResult>;
148
- getServerCache(): ServerCache;
149
- getCollectionChangesRecursively<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery): CachedQueryItem<ItemTypeType> | undefined;
150
- /**
151
- * @description
152
- * Removes the {@link CollectionResource CollectionResource} from the transaction, preventing the {@link CollectionResource.options.onAdd onAdd} and {@link CollectionResource.options.onRemove onRemove} callbacks from being called.
153
- * You should call this function when the resource is no longer needed
154
- *
155
- * @remark
156
- * Does not remove cached queries
157
- */
158
- clearCollectionResource(resource: CollectionResource): void;
159
- /**
160
- * @description
161
- * Returns whether or not the {@link TransactionCache.rootItem rootItem} is uses locks
162
- */
163
- isLockable(rootItem?: ItemEntry | undefined): rootItem is ItemEntry;
164
- /**
165
- * @description
166
- * Saves the transaction, this has a different effect depending on the transaction's parent.
167
- *
168
- * - If the parent is another {@link TransactionCache TransactionCache} it will merge the changes of the child transaction in the the parent transaction
169
- * - If the parent is the {@link ServerCache ServerCache} it will save the changes to the APi
170
- */
171
- save(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakUpByParent?: boolean, onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<void>;
172
- /**
173
- * Rejects when another user is holding the lock, as opposed to {@link LockService.fetchLock}.
174
- */
175
- fetchLock(): PromiseInterface<void>;
176
- detectChanges(force?: boolean): boolean;
177
- /**
178
- * @description
179
- * Removes an {@link ItemEntry ItemEntry} through an {@link ItemResource ItemResource} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
180
- */
181
- clearItem(itemResource: ItemResource<any>): void;
182
- /**
183
- * @description
184
- * Removes an {@link ItemEntry ItemEntry} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
185
- */
186
- clearItemEntry(itemEntry: ItemEntry): void;
187
- /**
188
- * @description
189
- * Adds a callback that will fire before the transaction is saved, rejecting this callback will prevent the transaction from saving
190
- */
191
- onBeforeSave(key: string, callback: TransactionCacheCallbackType['onBeforeSave'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
192
- /**
193
- * @description
194
- * Adds a callback that will fire when the transaction is saved successfully
195
- */
196
- onSaveSuccess(key: string, callback: TransactionCacheCallbackType['onSaveSuccess'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
197
- /**
198
- * @description
199
- * Returns a {@link ModuleChangesCompilationResult ModuleChangesCompilationResult} for the transaction
200
- */
201
- getModuleChanges(): ModuleChangesCompilationResult;
202
- /**
203
- * @description
204
- * Updates the passed map with the new {@link ConversionMap CconversionMap} values
205
- */
206
- updateItemIdMap(collectionMap: {
207
- [itemId: number]: any;
208
- }, conversionMap: ConversionMap): void;
209
- getAllLinkCollections<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
210
- getLinkCollectionsFromDef<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, linkIdArray: ItemId[], definition: LinkCollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
211
- /**
212
- * @deprecated Use the `children` collection option instead.
213
- */
214
- getLinkCollections<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
215
- getCollectionFromDef<ItemTypeType extends ApiEnumItemType>(definition: CollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType>>;
216
- getCollection<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = ItemTypeColumnIds<ItemTypeType>>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType, ColumnIds>>;
217
- getCollectionDef<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): CollectionDefinition<ItemTypeType>;
218
- getLinkCollectionsDef<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, linkField: string, options: CollectionOptionsInterface<ItemTypeType>): LinkCollectionDefinition<ItemTypeType>;
219
- /**
220
- * @deprecated
221
- * Use getItemById/getNewResourceWithId
222
- *
223
- * @remarks
224
- * stateKey can be a keyword or a local id (in case of a refresh)
225
- */
226
- getItemByState<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options?: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
227
- getDuplicateById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
228
- getDuplicateById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
229
- getNewResourceWithId<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: Partial<ItemEntryOptions>, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
230
- getNewResourceWithId<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: Partial<ItemEntryOptions>, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
231
- getNewResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
232
- getNewResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
233
- /**
234
- * @description
235
- * Fetches multiple items with their respective changes of the current {@link TransactionCache transaction}
236
- */
237
- getItemsByQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery, options?: Partial<ItemEntryOptions>): PromiseInterface<ItemResource<ItemTypeType>[]>;
238
- /**
239
- * @description
240
- * Fetches multiple items with their respective changes of the current {@link TransactionCache transaction}
241
- */
242
- getItemsById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemIds: ItemId[], options?: Partial<ItemEntryOptions>): PromiseInterface<ItemResource<ItemTypeType>[]>;
243
- /**
244
- * @description
245
- * Fetches the item with the changes of the current {@link TransactionCache transaction}
246
- *
247
- * @param isRoot Sets the item as the root item of the transaction, new items will be linked to this item (if there's a connection in the LinkTree)
248
- */
249
- getItemById<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = ItemTypeColumnIds<ItemTypeType>>(itemType: ItemTypeType, itemId: ItemId, options?: Partial<ItemEntryOptions>, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType, ColumnIds>>;
250
- /**
251
- * @description
252
- * Fetches the title of an item, does not create an {@link ItemResource ItemResource}
253
- */
254
- fetchTitle(itemType: ApiEnumItemType, itemId: ItemId): PromiseInterface<string>;
255
- /**
256
- * @description
257
- * Merges the passed child Transaction into this transaction and then propagates them to the other child transactions
258
- */
259
- applyChangesFromChild(childTransaction: TransactionCache, _breakUpByParent?: boolean, _onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<ItemIdConversionMap>;
260
- /**
261
- * @description
262
- * Gets an already cached {@link ItemEntry ItemEntry} and the changes of this specific transaction for that entry
263
- */
264
- getLocalItemEntryChangesTuple<ItemTypeType extends ApiEnumItemType>(itemEntryId: ItemEntry<ItemTypeType>['id']): ItemEntryChangesTuple<ItemTypeType>;
265
- /**
266
- * @description
267
- * Gets an ItemEntry from the cache, doesn't do a API request, used for saving
268
- */
269
- getLocalItemEntry(itemEntryId: ItemEntry['id']): ItemEntry | undefined;
270
- /**
271
- * @description
272
- * Gets an ItemEntry from the cache by ItemId
273
- */
274
- getLocalItemEntryByItemId(itemType: ApiEnumItemType, itemId: ItemEntry['itemId']): ItemEntry | undefined;
275
- /**
276
- * @description
277
- * Returns the complete {@link InternalChangesDelta InternalChangesDelta} of the TransactionCache, this only takes into account the end result (initial is compared to changes), so changing something and reverting it
278
- * won't be included
279
- */
280
- getDelta(): InternalChangesDelta;
281
- createItemResource<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, childCollectionMap?: ChildCollectionResourcesNull, isNew?: boolean): ItemResource<ItemTypeType>;
282
- createItemResources<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType>>(itemEntries: ItemEntry<ItemTypeType>[], childCollectionResourceMap?: ChildCollectionResourcesNull): ItemResource<ItemTypeType, ColumnIds>[];
283
- processLinkedItems<ItemTypeType extends ApiEnumItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>): ItemResourcesItemTypeMap<ItemResource<ItemTypeType>>;
284
- createCollectionResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>, initialEntries: ItemEntry<ItemTypeType>[], childCollectionResourceMap?: ParentItemMap<CollectionResource> | null): CollectionResource<ItemTypeType>;
285
- createChildCollectionResources(parentType: ApiEnumItemType, options: ChildCollectionOptions, cachedQueryItems: ParentItemMap<CachedQueryItemTree>): ChildCollectionResources;
286
- clearItemError(itemEntryId?: ItemEntry['id'], columnId?: string, errorKey?: string): void;
287
- private createChildCollectionResource;
288
- /**
289
- * @description
290
- * Fetches all required columns to match/fit in collections
291
- */
292
- private expandItemsFromDelta;
293
- private clearGlobalError;
294
- private handleRemovedItemEntry;
295
- private handleCascadingDeletes;
296
- private cascadeDeleteByItemType;
297
- }
298
- export {};
1
+ import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
2
+ import { AbstractCache, AbstractCacheDependencyInterface, ApiQuery, ApiRequestColumnArray, ApiRequestColumns, CachedQueryItem, CachedQueryItemTree, ChangesDelta, ChangesDeltaResult, ChildCollectionOptions, ChildCollectionResources, ChildCollectionResourcesNull, CollectionDefinition, CollectionOptionsInterface, CollectionQuery, CollectionResource, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, DeregFunction, FieldChangeCallback, InternalChangesDelta, ItemEntry, ItemEntryChangesTuple, ItemEntryOptions, ItemIdConversionMap, ItemOptionsInterface, ItemResource, ItemResourcesItemTypeMap, ItemTypeColumnIds, ItemTypeMap, LinkCollectionDefinition, ModuleChangesCompilationResult, OnAfterCreateCallback, ParentChangesDelta, ParentItemMap, PromiseInterface, RmCore, ServerCache, TransactionCacheCallbackCondition, TransactionCacheCallbackType, TransactionCachedQueryHandler, TransactionCollectionHandler, TransactionEventHandler, TransactionItemHandler, TransactionOptions, TransactionValidatorFactory } from '../../../internal';
3
+ declare type ItemResourceLinks<ItemTypeType extends ApiEnumItemType> = {
4
+ main: ItemResource<ItemTypeType>;
5
+ linked: ItemResourcesItemTypeMap;
6
+ };
7
+ export declare enum TransactionErrorLevel {
8
+ warning = "warning",
9
+ error = "error"
10
+ }
11
+ export declare type UndoFunction = () => PromiseInterface<ChangesDeltaResult>;
12
+ /**
13
+ * @description
14
+ * The {@link TransactionCache TransactionCache} is responsible for keeping track of newly created {@link ItemEntry ItemEntries}
15
+ * and {@link CollectionEntry CollectionEntries}, and the changes of existing ItemEntries and CollectionEntries.
16
+ *
17
+ * The TransactionCache is also responsible for creating {@link ItemResource ItemResources}, which is a combination of an {@link ItemEntry ItemEntry} and the current transaction's changes on this ItemEntry
18
+ */
19
+ export declare class TransactionCache extends AbstractCache {
20
+ /**
21
+ * @description
22
+ * For debugging purposes
23
+ */
24
+ id?: string | undefined;
25
+ /**
26
+ * @description
27
+ * A map of all item errors, can be populated using {@link TransactionValidator.setGlobalError TransactionValidator.setGlobalError} and {@link TransactionValidator.setItemError TransactionValidator.setItemError}.
28
+ * Contains a translation and level for every error
29
+ */
30
+ errors: {
31
+ item: {
32
+ [itemEntryId: string]: {
33
+ [columnId: string]: {
34
+ [errorKey: string]: {
35
+ fieldString: string;
36
+ string: string;
37
+ level: TransactionErrorLevel;
38
+ };
39
+ };
40
+ };
41
+ };
42
+ global: {
43
+ [key: string]: {
44
+ string: string;
45
+ level: TransactionErrorLevel;
46
+ };
47
+ };
48
+ };
49
+ /**
50
+ * @description
51
+ * Stores the 'root' {@link ItemEntry ItemEntry}, this {@link ItemEntry ItemEntry} can be used as request parent to store the whole transaction at once
52
+ */
53
+ rootItem: ItemEntry | undefined;
54
+ /**
55
+ * @description
56
+ * Stores additional request parameters for when the transaction is stored to the server
57
+ */
58
+ tabRequestParameters: {};
59
+ /**
60
+ * @description
61
+ * Is true while the {@link TransactionCache TransactionCache} is applying changes to the parent (can either be through a merge or an Api save)
62
+ */
63
+ isSaving: boolean;
64
+ /**
65
+ * @description
66
+ * Is true when the current transaction has:
67
+ * - Newly created items
68
+ * - Removed items (from collections)
69
+ * - Changes on existing items
70
+ */
71
+ hasChanges: boolean;
72
+ /**
73
+ * @description
74
+ * The transaction's parent
75
+ */
76
+ readonly parent: AbstractCache;
77
+ readonly itemHandler: TransactionItemHandler;
78
+ readonly cachedQueryHandler: TransactionCachedQueryHandler;
79
+ readonly collectionHandler: TransactionCollectionHandler;
80
+ readonly eventHandler: TransactionEventHandler;
81
+ private readonly validator?;
82
+ private readonly options;
83
+ private historyStep;
84
+ private undoDeltas;
85
+ private appliedDeltas;
86
+ private _isValid;
87
+ constructor(dependencies: AbstractCacheDependencyInterface, core: RmCore, parent: AbstractCache,
88
+ /**
89
+ * @description
90
+ * For debugging purposes
91
+ */
92
+ id?: string | undefined, validatorFactory?: TransactionValidatorFactory, options?: Partial<TransactionOptions>);
93
+ get isValid(): boolean;
94
+ undo(): ReturnType<UndoFunction>;
95
+ redo(): ReturnType<TransactionCache['applyChangesDelta']>;
96
+ createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: TransactionOptions): TransactionCache;
97
+ destroy(): void;
98
+ expandCollectionResource(collectionResource: CollectionResource, newColumns: ApiRequestColumns): PromiseInterface<void>;
99
+ /**
100
+ * @description
101
+ * Expands the collection with the new request columns, assumes that all collections have the same itemType
102
+ */
103
+ expandCollectionResources<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, collections: CollectionResourceParentIdMap<ItemTypeType>, newColumns: ApiRequestColumnArray): PromiseInterface<CollectionResourceParentIdMap>;
104
+ registerFieldChangeCallback<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, callback: FieldChangeCallback<ItemTypeType>): DeregFunction;
105
+ createChangesDelta(): ChangesDelta;
106
+ getFirstErrorString(): undefined | string;
107
+ /**
108
+ * @description
109
+ * Should only be called by {@link TransactionValidator TransactionValidator}
110
+ * @internal
111
+ */
112
+ _setGlobalError(key: string, isInvalid: boolean, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
113
+ /**
114
+ * @description
115
+ * Should only be called by {@link TransactionValidator TransactionValidator}
116
+ * @internal
117
+ */
118
+ _setItemError(itemEntryId: ItemEntry['id'], columnId: string, errorKey: string, isInvalid: boolean, fieldErrorTranslationFn: () => string, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
119
+ /**
120
+ * @internal
121
+ */
122
+ _setIsValid(): void;
123
+ /**
124
+ * @description
125
+ * Merges the passed changes from the parent Transaction into this Transaction's own changes and then propagates
126
+ * them to all child Transactions, this assumes that an action is already handled in a parent, so it does't handle created entries
127
+ * and removes entries that were in {@link TransactionItemHandler.deletedItems deletedItems} since they are already deleted
128
+ *
129
+ * ------------------
130
+ *
131
+ * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
132
+ * the change has already been processed, and applyChangesDelta will process the changes once you save the transaction
133
+ *
134
+ * ------------------
135
+ * Use {@link TransactionCache.applyChangesDelta applyChangesDelta} if you want to apply changes from outside the core
136
+ */
137
+ applyChangesFromParent(parentChangesDelta: ParentChangesDelta, isCalledAfterSocketUpdate?: boolean, conversionMap?: ItemIdConversionMap): PromiseInterface<void>;
138
+ /**
139
+ * @description
140
+ * Applies changes to this transaction and its children
141
+ *
142
+ * ------------------
143
+ *
144
+ * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
145
+ * the change has already been processed, and applyChangesDelta will process the changes itself (result vs cause)
146
+ */
147
+ applyChangesDelta(changesDelta: ChangesDelta | InternalChangesDelta): PromiseInterface<ChangesDeltaResult>;
148
+ getServerCache(): ServerCache;
149
+ getCollectionChangesRecursively<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery): CachedQueryItem<ItemTypeType> | undefined;
150
+ /**
151
+ * @description
152
+ * Removes the {@link CollectionResource CollectionResource} from the transaction, preventing the {@link CollectionResource.options.onAdd onAdd} and {@link CollectionResource.options.onRemove onRemove} callbacks from being called.
153
+ * You should call this function when the resource is no longer needed
154
+ *
155
+ * @remark
156
+ * Does not remove cached queries
157
+ */
158
+ clearCollectionResource(resource: CollectionResource): void;
159
+ /**
160
+ * @description
161
+ * Returns whether or not the {@link TransactionCache.rootItem rootItem} is uses locks
162
+ */
163
+ isLockable(rootItem?: ItemEntry | undefined): rootItem is ItemEntry;
164
+ /**
165
+ * @description
166
+ * Saves the transaction, this has a different effect depending on the transaction's parent.
167
+ *
168
+ * - If the parent is another {@link TransactionCache TransactionCache} it will merge the changes of the child transaction in the the parent transaction
169
+ * - If the parent is the {@link ServerCache ServerCache} it will save the changes to the APi
170
+ */
171
+ save(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakUpByParent?: boolean, onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<void>;
172
+ /**
173
+ * Rejects when another user is holding the lock, as opposed to {@link LockService.fetchLock}.
174
+ */
175
+ fetchLock(): PromiseInterface<void>;
176
+ detectChanges(force?: boolean): boolean;
177
+ /**
178
+ * @description
179
+ * Removes an {@link ItemEntry ItemEntry} through an {@link ItemResource ItemResource} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
180
+ */
181
+ clearItem(itemResource: ItemResource<any>): void;
182
+ /**
183
+ * @description
184
+ * Removes an {@link ItemEntry ItemEntry} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
185
+ */
186
+ clearItemEntry(itemEntry: ItemEntry): void;
187
+ /**
188
+ * @description
189
+ * Adds a callback that will fire before the transaction is saved, rejecting this callback will prevent the transaction from saving
190
+ */
191
+ onBeforeSave(key: string, callback: TransactionCacheCallbackType['onBeforeSave'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
192
+ /**
193
+ * @description
194
+ * Adds a callback that will fire when the transaction is saved successfully
195
+ */
196
+ onSaveSuccess(key: string, callback: TransactionCacheCallbackType['onSaveSuccess'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
197
+ /**
198
+ * @description
199
+ * Returns a {@link ModuleChangesCompilationResult ModuleChangesCompilationResult} for the transaction
200
+ */
201
+ getModuleChanges(): ModuleChangesCompilationResult;
202
+ /**
203
+ * @description
204
+ * Updates the passed map with the new {@link ConversionMap CconversionMap} values
205
+ */
206
+ updateItemIdMap(collectionMap: {
207
+ [itemId: number]: any;
208
+ }, conversionMap: ConversionMap): void;
209
+ getAllLinkCollections<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
210
+ getLinkCollectionsFromDef<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, linkIdArray: ItemId[], definition: LinkCollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
211
+ /**
212
+ * @deprecated Use the `children` collection option instead.
213
+ */
214
+ getLinkCollections<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
215
+ getCollectionFromDef<ItemTypeType extends ApiEnumItemType>(definition: CollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType>>;
216
+ getCollection<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = ItemTypeColumnIds<ItemTypeType>>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType, ColumnIds>>;
217
+ getCollectionDef<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): CollectionDefinition<ItemTypeType>;
218
+ getLinkCollectionsDef<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, linkField: string, options: CollectionOptionsInterface<ItemTypeType>): LinkCollectionDefinition<ItemTypeType>;
219
+ /**
220
+ * @deprecated
221
+ * Use getItemById/getNewResourceWithId
222
+ *
223
+ * @remarks
224
+ * stateKey can be a keyword or a local id (in case of a refresh)
225
+ */
226
+ getItemByState<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options?: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
227
+ getDuplicateById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
228
+ getDuplicateById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
229
+ getNewResourceWithId<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: Partial<ItemEntryOptions>, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
230
+ getNewResourceWithId<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: Partial<ItemEntryOptions>, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
231
+ getNewResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
232
+ getNewResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
233
+ /**
234
+ * @description
235
+ * Fetches multiple items with their respective changes of the current {@link TransactionCache transaction}
236
+ */
237
+ getItemsByQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery, options?: Partial<ItemEntryOptions>): PromiseInterface<ItemResource<ItemTypeType>[]>;
238
+ /**
239
+ * @description
240
+ * Fetches multiple items with their respective changes of the current {@link TransactionCache transaction}
241
+ */
242
+ getItemsById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemIds: ItemId[], options?: Partial<ItemEntryOptions>): PromiseInterface<ItemResource<ItemTypeType>[]>;
243
+ /**
244
+ * @description
245
+ * Fetches the item with the changes of the current {@link TransactionCache transaction}
246
+ *
247
+ * @param isRoot Sets the item as the root item of the transaction, new items will be linked to this item (if there's a connection in the LinkTree)
248
+ */
249
+ getItemById<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = ItemTypeColumnIds<ItemTypeType>>(itemType: ItemTypeType, itemId: ItemId, options?: Partial<ItemEntryOptions>, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType, ColumnIds>>;
250
+ /**
251
+ * @description
252
+ * Fetches the title of an item, does not create an {@link ItemResource ItemResource}
253
+ */
254
+ fetchTitle(itemType: ApiEnumItemType, itemId: ItemId): PromiseInterface<string>;
255
+ /**
256
+ * @description
257
+ * Merges the passed child Transaction into this transaction and then propagates them to the other child transactions
258
+ */
259
+ applyChangesFromChild(childTransaction: TransactionCache, _breakUpByParent?: boolean, _onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<ItemIdConversionMap>;
260
+ /**
261
+ * @description
262
+ * Gets an already cached {@link ItemEntry ItemEntry} and the changes of this specific transaction for that entry
263
+ */
264
+ getLocalItemEntryChangesTuple<ItemTypeType extends ApiEnumItemType>(itemEntryId: ItemEntry<ItemTypeType>['id']): ItemEntryChangesTuple<ItemTypeType>;
265
+ /**
266
+ * @description
267
+ * Gets an ItemEntry from the cache, doesn't do a API request, used for saving
268
+ */
269
+ getLocalItemEntry(itemEntryId: ItemEntry['id']): ItemEntry | undefined;
270
+ /**
271
+ * @description
272
+ * Gets an ItemEntry from the cache by ItemId
273
+ */
274
+ getLocalItemEntryByItemId(itemType: ApiEnumItemType, itemId: ItemEntry['itemId']): ItemEntry | undefined;
275
+ /**
276
+ * @description
277
+ * Returns the complete {@link InternalChangesDelta InternalChangesDelta} of the TransactionCache, this only takes into account the end result (initial is compared to changes), so changing something and reverting it
278
+ * won't be included
279
+ */
280
+ getDelta(): InternalChangesDelta;
281
+ createItemResource<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, childCollectionMap?: ChildCollectionResourcesNull, isNew?: boolean): ItemResource<ItemTypeType>;
282
+ createItemResources<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType>>(itemEntries: ItemEntry<ItemTypeType>[], childCollectionResourceMap?: ChildCollectionResourcesNull): ItemResource<ItemTypeType, ColumnIds>[];
283
+ processLinkedItems<ItemTypeType extends ApiEnumItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>): ItemResourcesItemTypeMap<ItemResource<ItemTypeType>>;
284
+ createCollectionResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>, initialEntries: ItemEntry<ItemTypeType>[], childCollectionResourceMap?: ParentItemMap<CollectionResource> | null): CollectionResource<ItemTypeType>;
285
+ createChildCollectionResources(parentType: ApiEnumItemType, options: ChildCollectionOptions, cachedQueryItems: ParentItemMap<CachedQueryItemTree>): ChildCollectionResources;
286
+ clearItemError(itemEntryId?: ItemEntry['id'], columnId?: string, errorKey?: string): void;
287
+ private createChildCollectionResource;
288
+ /**
289
+ * @description
290
+ * Fetches all required columns to match/fit in collections
291
+ */
292
+ private expandItemsFromDelta;
293
+ private clearGlobalError;
294
+ private handleRemovedItemEntry;
295
+ private handleCascadingDeletes;
296
+ private cascadeDeleteByItemType;
297
+ }
298
+ export {};