@rentman/rm-core 8.0.0 → 8.0.1-2

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 (110) hide show
  1. package/changelog.md +875 -865
  2. package/dist/rm-core.js +10027 -10055
  3. package/dist/rm-core.min.js +2 -2
  4. package/dist/types/classes/ApiFormatter.d.ts +66 -66
  5. package/dist/types/classes/ApiRequestService.d.ts +21 -21
  6. package/dist/types/classes/ApiResponseProcessor.d.ts +30 -30
  7. package/dist/types/classes/ChangesCompilation.d.ts +36 -36
  8. package/dist/types/classes/ChangesDelta.d.ts +62 -62
  9. package/dist/types/classes/ChangesDeltaBase.d.ts +51 -51
  10. package/dist/types/classes/ChangesProcessor.d.ts +47 -47
  11. package/dist/types/classes/CollectionEntryService.d.ts +27 -27
  12. package/dist/types/classes/CollectionMatcherBase.d.ts +22 -22
  13. package/dist/types/classes/CollectionMatcherCachedCollectionProcessor.d.ts +32 -32
  14. package/dist/types/classes/CollectionResourceService.d.ts +7 -7
  15. package/dist/types/classes/ColumnCache.d.ts +22 -22
  16. package/dist/types/classes/ColumnExpansion.d.ts +23 -23
  17. package/dist/types/classes/ColumnHandler.d.ts +22 -22
  18. package/dist/types/classes/ColumnInfo.d.ts +14 -14
  19. package/dist/types/classes/ColumnSet.d.ts +39 -39
  20. package/dist/types/classes/ColumnSubsetCache.d.ts +15 -15
  21. package/dist/types/classes/ColumnUtil.d.ts +101 -101
  22. package/dist/types/classes/ConversionMapService.d.ts +28 -28
  23. package/dist/types/classes/CreateRequest.d.ts +20 -20
  24. package/dist/types/classes/CreatedChangesDelta.d.ts +17 -17
  25. package/dist/types/classes/InternalChangesDelta.d.ts +40 -40
  26. package/dist/types/classes/ItemCache.d.ts +30 -30
  27. package/dist/types/classes/ItemCreateService.d.ts +25 -25
  28. package/dist/types/classes/ItemEntryService.d.ts +35 -35
  29. package/dist/types/classes/KeyService.d.ts +18 -18
  30. package/dist/types/classes/LockService.d.ts +32 -32
  31. package/dist/types/classes/ModuleChangesCompilation.d.ts +19 -19
  32. package/dist/types/classes/QueryColumnExtractor.d.ts +20 -20
  33. package/dist/types/classes/QueryContainsLocalIdParser.d.ts +17 -17
  34. package/dist/types/classes/QueryLinkedToParser.d.ts +16 -16
  35. package/dist/types/classes/QueryLocallyMatchableParser.d.ts +19 -19
  36. package/dist/types/classes/QueryMatcher.d.ts +19 -19
  37. package/dist/types/classes/QueryParser.d.ts +26 -26
  38. package/dist/types/classes/QueryParserBase.d.ts +20 -20
  39. package/dist/types/classes/QueryParserIdUpdater.d.ts +16 -16
  40. package/dist/types/classes/QueryService.d.ts +13 -13
  41. package/dist/types/classes/RequestBuffer.d.ts +29 -29
  42. package/dist/types/classes/RequestBufferManager.d.ts +26 -26
  43. package/dist/types/classes/RequestColumnExpansion.d.ts +16 -16
  44. package/dist/types/classes/SocketMessageHandler.d.ts +43 -43
  45. package/dist/types/classes/TemplateCache.d.ts +67 -67
  46. package/dist/types/classes/Util.d.ts +31 -31
  47. package/dist/types/classes/cache/AbstractCache.d.ts +103 -103
  48. package/dist/types/classes/cache/CachedQueryHandlerBase.d.ts +75 -75
  49. package/dist/types/classes/cache/CollectionMatcherCachedQueryProcessor.d.ts +36 -36
  50. package/dist/types/classes/cache/ItemHandlerBase.d.ts +108 -108
  51. package/dist/types/classes/cache/server/ServerCache.d.ts +83 -83
  52. package/dist/types/classes/cache/server/ServerCachedQueryHandler.d.ts +34 -34
  53. package/dist/types/classes/cache/server/ServerItemHandler.d.ts +53 -53
  54. package/dist/types/classes/cache/transaction/TransactionCache.d.ts +325 -325
  55. package/dist/types/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +23 -23
  56. package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +29 -29
  57. package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +24 -24
  58. package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +94 -94
  59. package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +35 -35
  60. package/dist/types/classes/index.d.ts +46 -46
  61. package/dist/types/constants.d.ts +7 -7
  62. package/dist/types/core.d.ts +51 -51
  63. package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
  64. package/dist/types/factories/ChangesCompilationFactory.d.ts +6 -6
  65. package/dist/types/factories/ChangesDeltaFactory.d.ts +13 -13
  66. package/dist/types/factories/ChangesProcessorFactory.d.ts +22 -22
  67. package/dist/types/factories/CollectionEntryFactory.d.ts +14 -14
  68. package/dist/types/factories/CollectionMatcherFactory.d.ts +19 -19
  69. package/dist/types/factories/CollectionResourceFactory.d.ts +22 -22
  70. package/dist/types/factories/ColumnExpansionFactory.d.ts +9 -9
  71. package/dist/types/factories/ColumnInfoFactory.d.ts +8 -8
  72. package/dist/types/factories/ColumnSetFactory.d.ts +20 -20
  73. package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +9 -9
  74. package/dist/types/factories/CreateRequestFactory.d.ts +11 -11
  75. package/dist/types/factories/ItemCacheFactory.d.ts +8 -8
  76. package/dist/types/factories/ItemEntryFactory.d.ts +15 -15
  77. package/dist/types/factories/ItemResourceFactory.d.ts +14 -14
  78. package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +5 -5
  79. package/dist/types/factories/QueryMatcherFactory.d.ts +8 -8
  80. package/dist/types/factories/QueryParserFactory.d.ts +6 -6
  81. package/dist/types/factories/RequestColumnExpansionFactory.d.ts +6 -6
  82. package/dist/types/factories/TemplateFactory.d.ts +11 -11
  83. package/dist/types/factories/TransactionCacheFactory.d.ts +15 -15
  84. package/dist/types/factories/index.d.ts +21 -21
  85. package/dist/types/index.d.ts +7 -7
  86. package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +43 -43
  87. package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +12 -12
  88. package/dist/types/interfaces/AuthInterface.d.ts +10 -10
  89. package/dist/types/interfaces/ErrorHandlerInterface.d.ts +5 -5
  90. package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  91. package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  92. package/dist/types/interfaces/PromiseLibraryInterface.d.ts +25 -25
  93. package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +7 -7
  94. package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
  95. package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +20 -20
  96. package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +26 -26
  97. package/dist/types/interfaces/index.d.ts +11 -11
  98. package/dist/types/models/CollectionEntry.d.ts +24 -24
  99. package/dist/types/models/CollectionOptions.d.ts +24 -24
  100. package/dist/types/models/CollectionResource.d.ts +78 -78
  101. package/dist/types/models/ItemEntry.d.ts +19 -19
  102. package/dist/types/models/ItemEntryOptions.d.ts +8 -8
  103. package/dist/types/models/ItemResource.d.ts +88 -88
  104. package/dist/types/models/Template.d.ts +12 -12
  105. package/dist/types/models/index.d.ts +7 -7
  106. package/dist/types/types/ItemTypesCollection.d.ts +345 -345
  107. package/dist/types/types/PromiseInterface.d.ts +2 -2
  108. package/dist/types/types/index.d.ts +2 -2
  109. package/package.json +38 -38
  110. package/readme.md +15 -15
@@ -1,75 +1,75 @@
1
- import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
2
- import { RequestColumnExpansionFactory } from '../../factories';
3
- import { PromiseLibraryInterface } from '../../interfaces';
4
- import { ItemEntry } from '../../models';
5
- import { CollectionOptions } from '../../models/CollectionOptions';
6
- import { ApiQuery, ApiRequestColumns, CollectionQuery, ParentIdMap, PromiseInterface } from '../../types';
7
- import { CollectionEntryService } from '../CollectionEntryService';
8
- import { ColumnSubsetCache } from '../ColumnSubsetCache';
9
- import { ColumnUtil } from '../ColumnUtil';
10
- import { AbstractCache } from './AbstractCache';
11
- export declare type CachedQueryItem<ItemTypeType extends ApiEnumItemType = any> = {
12
- itemType: ItemTypeType;
13
- query: CollectionQuery;
14
- items: Array<ItemEntry<ItemTypeType>>;
15
- requestColumns: ApiRequestColumns;
16
- promise: PromiseInterface<CachedQueryItem<ItemTypeType>>;
17
- resolve: () => void;
18
- reject: (reason: string) => void;
19
- };
20
- export declare abstract class CachedQueryHandlerBase {
21
- protected collectionEntryService: CollectionEntryService;
22
- protected columnUtil: ColumnUtil;
23
- protected requestColumnExpansionFactory: RequestColumnExpansionFactory;
24
- protected promiseService: PromiseLibraryInterface;
25
- protected transaction: AbstractCache;
26
- /**
27
- * @description
28
- * Items (per ItemType) that fit in a query
29
- *
30
- * @remark
31
- * Contains the requestColumns so that new items can include these columns (saving requests when they match)
32
- */
33
- cachedQueries: {
34
- [itemType: string]: {
35
- [queryString: string]: CachedQueryItem;
36
- };
37
- };
38
- protected constructor(collectionEntryService: CollectionEntryService, columnUtil: ColumnUtil, requestColumnExpansionFactory: RequestColumnExpansionFactory, promiseService: PromiseLibraryInterface, transaction: AbstractCache);
39
- setCachedQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery, itemEntries: Array<ItemEntry<ItemTypeType>>, requestColumns: ApiRequestColumns): CachedQueryItem<ItemTypeType>;
40
- getCachedQueryItems<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, queryString: string): undefined | Array<ItemEntry<ItemTypeType>>;
41
- getCachedQueryObjectsByItemType(itemType: ApiEnumItemType): CachedQueryItem[];
42
- initCachedQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery, requestColumns: ApiRequestColumns): CachedQueryItem<ItemTypeType>;
43
- /**
44
- * @description
45
- * Fetches a {@link CollectionEntry CollectionEntry} with the given options
46
- */
47
- abstract __fetchCachedQueryItem<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptions): PromiseInterface<CachedQueryItem<ItemTypeType>>;
48
- /**
49
- * @description
50
- * Fetches collections linked to the passed parents
51
- */
52
- abstract __fetchItemEntriesByQueryData<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptions<ItemTypeType>, columnSubsetCache: ColumnSubsetCache<ItemTypeType>, collectionQuery: CollectionQuery): PromiseInterface<CachedQueryItem<ItemTypeType>>;
53
- /**
54
- * @description
55
- * Fetches collections linked to the passed parents
56
- */
57
- abstract __fetchLinkedCachedQueryItems<ItemTypeType extends ApiEnumItemType>(parentType: ApiEnumItemType, parentIdArray: ItemId[] | (() => ItemId[]), itemType: ItemTypeType, options: CollectionOptions): PromiseInterface<ParentIdMap<CachedQueryItem<ItemTypeType>>>;
58
- /**
59
- * @description
60
- * Adds the passed {@link ItemEntry ItemEntries} to the Transaction's query cache,
61
- * will skip the ItemEntry if the `skipEntryFilterFn` callback returns `true`
62
- */
63
- protected __addItemEntriesToCachedQueries<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery, itemEntries: Array<ItemEntry<ItemTypeType>>, skipEntryFilterFn: (temEntry: ItemEntry) => boolean): void;
64
- /**
65
- * @description
66
- * Removes the passed {@link ItemId ItemIds} from the Transaction's query cache
67
- */
68
- __removeItemEntriesFromCachedQueries<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery, itemEntries: Array<ItemEntry<ItemTypeType>>): Array<ItemEntry<ItemTypeType>>;
69
- /**
70
- * @description
71
- * Expands the option's {@link CollectionOptions.columns columns} with the columns required for the {@link CollectionMatcherCachedCollectionProcessor CollectionMatcher} to function.
72
- * Data fetched for a parent transaction might also fit in a child transaction, so those {@link CollectionOptions.queryColumns queryColumns} should also be taken into account
73
- */
74
- expandColumnsWithQueryColumns(itemType: ApiEnumItemType, options: CollectionOptions, query: ApiQuery): void;
75
- }
1
+ import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
2
+ import { RequestColumnExpansionFactory } from '../../factories';
3
+ import { PromiseLibraryInterface } from '../../interfaces';
4
+ import { ItemEntry } from '../../models';
5
+ import { CollectionOptions } from '../../models/CollectionOptions';
6
+ import { ApiQuery, ApiRequestColumns, CollectionQuery, ParentIdMap, PromiseInterface } from '../../types';
7
+ import { CollectionEntryService } from '../CollectionEntryService';
8
+ import { ColumnSubsetCache } from '../ColumnSubsetCache';
9
+ import { ColumnUtil } from '../ColumnUtil';
10
+ import { AbstractCache } from './AbstractCache';
11
+ export declare type CachedQueryItem<ItemTypeType extends ApiEnumItemType = any> = {
12
+ itemType: ItemTypeType;
13
+ query: CollectionQuery;
14
+ items: Array<ItemEntry<ItemTypeType>>;
15
+ requestColumns: ApiRequestColumns;
16
+ promise: PromiseInterface<CachedQueryItem<ItemTypeType>>;
17
+ resolve: () => void;
18
+ reject: (reason: string) => void;
19
+ };
20
+ export declare abstract class CachedQueryHandlerBase {
21
+ protected collectionEntryService: CollectionEntryService;
22
+ protected columnUtil: ColumnUtil;
23
+ protected requestColumnExpansionFactory: RequestColumnExpansionFactory;
24
+ protected promiseService: PromiseLibraryInterface;
25
+ protected transaction: AbstractCache;
26
+ /**
27
+ * @description
28
+ * Items (per ItemType) that fit in a query
29
+ *
30
+ * @remark
31
+ * Contains the requestColumns so that new items can include these columns (saving requests when they match)
32
+ */
33
+ cachedQueries: {
34
+ [itemType: string]: {
35
+ [queryString: string]: CachedQueryItem;
36
+ };
37
+ };
38
+ protected constructor(collectionEntryService: CollectionEntryService, columnUtil: ColumnUtil, requestColumnExpansionFactory: RequestColumnExpansionFactory, promiseService: PromiseLibraryInterface, transaction: AbstractCache);
39
+ setCachedQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery, itemEntries: Array<ItemEntry<ItemTypeType>>, requestColumns: ApiRequestColumns): CachedQueryItem<ItemTypeType>;
40
+ getCachedQueryItems<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, queryString: string): undefined | Array<ItemEntry<ItemTypeType>>;
41
+ getCachedQueryObjectsByItemType(itemType: ApiEnumItemType): CachedQueryItem[];
42
+ initCachedQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery, requestColumns: ApiRequestColumns): CachedQueryItem<ItemTypeType>;
43
+ /**
44
+ * @description
45
+ * Fetches a {@link CollectionEntry CollectionEntry} with the given options
46
+ */
47
+ abstract __fetchCachedQueryItem<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptions): PromiseInterface<CachedQueryItem<ItemTypeType>>;
48
+ /**
49
+ * @description
50
+ * Fetches collections linked to the passed parents
51
+ */
52
+ abstract __fetchItemEntriesByQueryData<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptions<ItemTypeType>, columnSubsetCache: ColumnSubsetCache<ItemTypeType>, collectionQuery: CollectionQuery): PromiseInterface<CachedQueryItem<ItemTypeType>>;
53
+ /**
54
+ * @description
55
+ * Fetches collections linked to the passed parents
56
+ */
57
+ abstract __fetchLinkedCachedQueryItems<ItemTypeType extends ApiEnumItemType>(parentType: ApiEnumItemType, parentIdArray: ItemId[] | (() => ItemId[]), itemType: ItemTypeType, options: CollectionOptions): PromiseInterface<ParentIdMap<CachedQueryItem<ItemTypeType>>>;
58
+ /**
59
+ * @description
60
+ * Adds the passed {@link ItemEntry ItemEntries} to the Transaction's query cache,
61
+ * will skip the ItemEntry if the `skipEntryFilterFn` callback returns `true`
62
+ */
63
+ protected __addItemEntriesToCachedQueries<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery, itemEntries: Array<ItemEntry<ItemTypeType>>, skipEntryFilterFn: (temEntry: ItemEntry) => boolean): void;
64
+ /**
65
+ * @description
66
+ * Removes the passed {@link ItemId ItemIds} from the Transaction's query cache
67
+ */
68
+ __removeItemEntriesFromCachedQueries<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery, itemEntries: Array<ItemEntry<ItemTypeType>>): Array<ItemEntry<ItemTypeType>>;
69
+ /**
70
+ * @description
71
+ * Expands the option's {@link CollectionOptions.columns columns} with the columns required for the {@link CollectionMatcherCachedCollectionProcessor CollectionMatcher} to function.
72
+ * Data fetched for a parent transaction might also fit in a child transaction, so those {@link CollectionOptions.queryColumns queryColumns} should also be taken into account
73
+ */
74
+ expandColumnsWithQueryColumns(itemType: ApiEnumItemType, options: CollectionOptions, query: ApiQuery): void;
75
+ }
@@ -1,36 +1,36 @@
1
- import { ApiEnumItemType } from '@rentman/backend-types';
2
- import { QueryMatcherFactory } from '../../factories';
3
- import { PromiseLibraryInterface } from '../../interfaces';
4
- import { ItemEntry } from '../../models';
5
- import { CollectionQuery, PromiseInterface } from '../../types';
6
- import { ApiRequestService } from '../ApiRequestService';
7
- import { ChangesDeltaBase } from '../ChangesDeltaBase';
8
- import { CollectionMatcherBase, CollectionMatcherMatches } from '../CollectionMatcherBase';
9
- import { QueryService } from '../QueryService';
10
- import { AbstractCache } from './AbstractCache';
11
- import { CachedQueryItem } from './CachedQueryHandlerBase';
12
- export declare type GroupedCollectionMatcherResult<ItemTypeType extends ApiEnumItemType> = {
13
- fitting: Array<ItemEntry<ItemTypeType>>;
14
- notFitting: Array<ItemEntry<ItemTypeType>>;
15
- maybe: Array<ItemEntry<ItemTypeType>>;
16
- };
17
- /**
18
- * @description
19
- * Processes all cached queries and adds/removes item entries that do/don't fit the query
20
- */
21
- export declare class CollectionMatcherCachedQueryProcessor extends CollectionMatcherBase {
22
- private apiRequestService;
23
- private promiseService;
24
- private getQueries;
25
- protected map: {
26
- [itemTypeAndQueryString: string]: {
27
- itemType: ApiEnumItemType;
28
- query: CollectionQuery;
29
- matches: CollectionMatcherMatches;
30
- cachedQuery: CachedQueryItem;
31
- };
32
- };
33
- constructor(apiRequestService: ApiRequestService, promiseService: PromiseLibraryInterface, queryService: QueryService, queryMatcherFactory: QueryMatcherFactory, transaction: AbstractCache, getQueries: <ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType) => Array<CachedQueryItem<ItemTypeType>>);
34
- __removeFromAndAddToCachedQueries(_isCalledAfterSocketUpdate?: boolean, changesDelta?: ChangesDeltaBase): PromiseInterface<void[]>;
35
- protected _expand<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, matchFunction: (itemType: ItemTypeType, parsedQuery: CollectionQuery) => boolean | 'maybe'): this;
36
- }
1
+ import { ApiEnumItemType } from '@rentman/backend-types';
2
+ import { QueryMatcherFactory } from '../../factories';
3
+ import { PromiseLibraryInterface } from '../../interfaces';
4
+ import { ItemEntry } from '../../models';
5
+ import { CollectionQuery, PromiseInterface } from '../../types';
6
+ import { ApiRequestService } from '../ApiRequestService';
7
+ import { ChangesDeltaBase } from '../ChangesDeltaBase';
8
+ import { CollectionMatcherBase, CollectionMatcherMatches } from '../CollectionMatcherBase';
9
+ import { QueryService } from '../QueryService';
10
+ import { AbstractCache } from './AbstractCache';
11
+ import { CachedQueryItem } from './CachedQueryHandlerBase';
12
+ export declare type GroupedCollectionMatcherResult<ItemTypeType extends ApiEnumItemType> = {
13
+ fitting: Array<ItemEntry<ItemTypeType>>;
14
+ notFitting: Array<ItemEntry<ItemTypeType>>;
15
+ maybe: Array<ItemEntry<ItemTypeType>>;
16
+ };
17
+ /**
18
+ * @description
19
+ * Processes all cached queries and adds/removes item entries that do/don't fit the query
20
+ */
21
+ export declare class CollectionMatcherCachedQueryProcessor extends CollectionMatcherBase {
22
+ private apiRequestService;
23
+ private promiseService;
24
+ private getQueries;
25
+ protected map: {
26
+ [itemTypeAndQueryString: string]: {
27
+ itemType: ApiEnumItemType;
28
+ query: CollectionQuery;
29
+ matches: CollectionMatcherMatches;
30
+ cachedQuery: CachedQueryItem;
31
+ };
32
+ };
33
+ constructor(apiRequestService: ApiRequestService, promiseService: PromiseLibraryInterface, queryService: QueryService, queryMatcherFactory: QueryMatcherFactory, transaction: AbstractCache, getQueries: <ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType) => Array<CachedQueryItem<ItemTypeType>>);
34
+ __removeFromAndAddToCachedQueries(_isCalledAfterSocketUpdate?: boolean, changesDelta?: ChangesDeltaBase): PromiseInterface<void[]>;
35
+ protected _expand<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, matchFunction: (itemType: ItemTypeType, parsedQuery: CollectionQuery) => boolean | 'maybe'): this;
36
+ }
@@ -1,108 +1,108 @@
1
- import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
2
- import { ItemCacheFactory, ItemEntryFactory, RequestColumnExpansionFactory } from '../../factories';
3
- import { ErrorHandlerInterface, PromiseLibraryInterface } from '../../interfaces';
4
- import { ItemEntry, ItemEntryOptions } from '../../models';
5
- import { ApiQuery, ApiRequestColumns, FieldMap, PromiseInterface } from '../../types';
6
- import { ApiFormatter } from '../ApiFormatter';
7
- import { ChangesDeltaBase, ChangesDeltaItemUpdateDelta } from '../ChangesDeltaBase';
8
- import { ColumnInfo } from '../ColumnInfo';
9
- import { ColumnUtil } from '../ColumnUtil';
10
- import { ChangesDeltaItemCreateDelta } from '../CreatedChangesDelta';
11
- import { ItemCache } from '../ItemCache';
12
- import { AbstractCache } from './AbstractCache';
13
- import { ServerItemEntryChanges } from './server/ServerItemHandler';
14
- import { TransactionItemEntryChanges } from './transaction/TransactionItemHandler';
15
- export declare enum ItemCacheStatus {
16
- CACHED = "cached",
17
- NOT_CACHED = "not_cached",
18
- NO_CHANGES = "no_changes"
19
- }
20
- export declare type ProcessItemEntryChangesResult<ItemTypeType extends ApiEnumItemType> = {
21
- status: ItemCacheStatus.NO_CHANGES | ItemCacheStatus.NOT_CACHED;
22
- previous: null;
23
- } | {
24
- status: ItemCacheStatus.CACHED;
25
- previous: FieldMap<ItemTypeType>;
26
- };
27
- export declare abstract class ItemHandlerBase {
28
- protected columnUtil: ColumnUtil;
29
- protected apiFormatter: ApiFormatter;
30
- protected itemEntryFactory: ItemEntryFactory;
31
- protected promiseService: PromiseLibraryInterface;
32
- protected errorHandler: ErrorHandlerInterface;
33
- protected requestColumnExpansionFactory: RequestColumnExpansionFactory;
34
- protected transaction: AbstractCache;
35
- readonly entries: ItemCache;
36
- abstract itemChanges: {
37
- [itemEntryId: string]: ServerItemEntryChanges | TransactionItemEntryChanges;
38
- };
39
- protected constructor(columnUtil: ColumnUtil, apiFormatter: ApiFormatter, itemEntryFactory: ItemEntryFactory, promiseService: PromiseLibraryInterface, errorHandler: ErrorHandlerInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory, itemCacheFactory: ItemCacheFactory, transaction: AbstractCache);
40
- /**
41
- * @description
42
- * Copies the passed ItemEntryChanges into a format the implementing ItemHandler can put in his ItemChanges
43
- * @param itemEntryChanges
44
- * @param entry
45
- */
46
- abstract copyTransactionItemEntryChanges(itemEntryChanges: TransactionItemEntryChanges, entry: ItemEntry): any;
47
- /**
48
- * @description
49
- * Fetches the ItemEntries for the given query, does not look in the cache, since we don't know which ItemIds belong to the query !
50
- */
51
- abstract fetchItemEntriesByQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery, entryOptions: ItemEntryOptions): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
52
- /**
53
- * @description
54
- * Fetches the ItemEntries for the given ItemIds
55
- */
56
- abstract fetchItemEntries<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemEntryOptions): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
57
- /**
58
- * @description
59
- * Fetches an ItemEntry with the given itemId
60
- */
61
- abstract fetchItemEntry<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemEntryOptions): PromiseInterface<ItemEntry<ItemTypeType>>;
62
- /**
63
- * @description
64
- * Processes the passed {@link ChangesDeltaItemUpdateDelta update delta} on the transaction, if there are no {@link TransactionItemHandler.itemChanges itemChanges} the new values will not be processed
65
- */
66
- abstract processItemEntryChanges<ItemTypeType extends ApiEnumItemType>(itemEntryChangesTuple: ChangesDeltaItemUpdateDelta<ItemTypeType>, forceOverwrite: boolean, updateInitial: boolean, isCalledAfterSocketUpdate: boolean, createItemChangesIfNoneExist: boolean): ProcessItemEntryChangesResult<ItemTypeType>;
67
- /**
68
- * @description
69
- * Traverses the column path and returns the fields of the derived item, returns undefined if the item isn't found
70
- *
71
- * ---------------------
72
- *
73
- * @remark
74
- * Assumes the derived item's values are already cached
75
- */
76
- getDerivedValues(itemEntry: ItemEntry, columnPath: string[]): Readonly<FieldMap> | undefined;
77
- /**
78
- * @description
79
- * Returns the value of the columnPath, or undefined when the path couldn't be traversed
80
- *
81
- * @param itemEntry The root entry to start the path from
82
- * @param columnPath Can either be an array of columnIds (['column', 'column2']) or a config column string ('column>column2')
83
- */
84
- getDerivedValue<T extends any = any>(itemEntry: ItemEntry, columnPath: string[] | string): T | undefined;
85
- /**
86
- * @description
87
- * Clears the entry from this transaction, removing it from the {@link ItemCache ItemCache} and removing all changes
88
- */
89
- clearItemEntry(entry: ItemEntry): void;
90
- /**
91
- * @description
92
- * Recursively fetches derived values as separate requests, instead of as columns of a primary item
93
- * Can be used when derived values of a local item have to be fetched, since a local item can't be used as root item of a query
94
- */
95
- fetchDerivedValuesByColumn<ItemTypeType extends ApiEnumItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, rootColumn: ColumnInfo<ItemTypeType>, changesDelta?: ChangesDeltaBase): PromiseInterface<void | Array<ItemEntry<ItemTypeType>>>;
96
- resolveDerivedValues<ItemTypeType extends ApiEnumItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, columns: Array<ColumnInfo<ItemTypeType>>, changesDelta?: ChangesDeltaBase): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
97
- /**
98
- * @description
99
- * Creates a new {@link ItemEntry ItemEntry} from the passed {@link ChangesDeltaItemCreateDelta ChangesDeltaItemCreateDelta} and stores it in this transaction's {@link ItemCache ItemCache}
100
- */
101
- createItemEntry(createTuple: ChangesDeltaItemCreateDelta): ItemEntry;
102
- /**
103
- * @description
104
- * Gets the value of the given column, will look into the current delta before attempting to read itemChanges
105
- */
106
- protected getItemIdByColumn<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, column: ColumnInfo<ItemTypeType>, changesDelta?: ChangesDeltaBase): ItemId;
107
- expandColumnsWithCachedQueryColumns(itemType: ApiEnumItemType, requestColumns?: ApiRequestColumns): ApiRequestColumns;
108
- }
1
+ import { ApiEnumItemType, ItemId } from '@rentman/backend-types';
2
+ import { ItemCacheFactory, ItemEntryFactory, RequestColumnExpansionFactory } from '../../factories';
3
+ import { ErrorHandlerInterface, PromiseLibraryInterface } from '../../interfaces';
4
+ import { ItemEntry, ItemEntryOptions } from '../../models';
5
+ import { ApiQuery, ApiRequestColumns, FieldMap, PromiseInterface } from '../../types';
6
+ import { ApiFormatter } from '../ApiFormatter';
7
+ import { ChangesDeltaBase, ChangesDeltaItemUpdateDelta } from '../ChangesDeltaBase';
8
+ import { ColumnInfo } from '../ColumnInfo';
9
+ import { ColumnUtil } from '../ColumnUtil';
10
+ import { ChangesDeltaItemCreateDelta } from '../CreatedChangesDelta';
11
+ import { ItemCache } from '../ItemCache';
12
+ import { AbstractCache } from './AbstractCache';
13
+ import { ServerItemEntryChanges } from './server/ServerItemHandler';
14
+ import { TransactionItemEntryChanges } from './transaction/TransactionItemHandler';
15
+ export declare enum ItemCacheStatus {
16
+ CACHED = "cached",
17
+ NOT_CACHED = "not_cached",
18
+ NO_CHANGES = "no_changes"
19
+ }
20
+ export declare type ProcessItemEntryChangesResult<ItemTypeType extends ApiEnumItemType> = {
21
+ status: ItemCacheStatus.NO_CHANGES | ItemCacheStatus.NOT_CACHED;
22
+ previous: null;
23
+ } | {
24
+ status: ItemCacheStatus.CACHED;
25
+ previous: FieldMap<ItemTypeType>;
26
+ };
27
+ export declare abstract class ItemHandlerBase {
28
+ protected columnUtil: ColumnUtil;
29
+ protected apiFormatter: ApiFormatter;
30
+ protected itemEntryFactory: ItemEntryFactory;
31
+ protected promiseService: PromiseLibraryInterface;
32
+ protected errorHandler: ErrorHandlerInterface;
33
+ protected requestColumnExpansionFactory: RequestColumnExpansionFactory;
34
+ protected transaction: AbstractCache;
35
+ readonly entries: ItemCache;
36
+ abstract itemChanges: {
37
+ [itemEntryId: string]: ServerItemEntryChanges | TransactionItemEntryChanges;
38
+ };
39
+ protected constructor(columnUtil: ColumnUtil, apiFormatter: ApiFormatter, itemEntryFactory: ItemEntryFactory, promiseService: PromiseLibraryInterface, errorHandler: ErrorHandlerInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory, itemCacheFactory: ItemCacheFactory, transaction: AbstractCache);
40
+ /**
41
+ * @description
42
+ * Copies the passed ItemEntryChanges into a format the implementing ItemHandler can put in his ItemChanges
43
+ * @param itemEntryChanges
44
+ * @param entry
45
+ */
46
+ abstract copyTransactionItemEntryChanges(itemEntryChanges: TransactionItemEntryChanges, entry: ItemEntry): any;
47
+ /**
48
+ * @description
49
+ * Fetches the ItemEntries for the given query, does not look in the cache, since we don't know which ItemIds belong to the query !
50
+ */
51
+ abstract fetchItemEntriesByQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery, entryOptions: ItemEntryOptions): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
52
+ /**
53
+ * @description
54
+ * Fetches the ItemEntries for the given ItemIds
55
+ */
56
+ abstract fetchItemEntries<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemEntryOptions): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
57
+ /**
58
+ * @description
59
+ * Fetches an ItemEntry with the given itemId
60
+ */
61
+ abstract fetchItemEntry<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemEntryOptions): PromiseInterface<ItemEntry<ItemTypeType>>;
62
+ /**
63
+ * @description
64
+ * Processes the passed {@link ChangesDeltaItemUpdateDelta update delta} on the transaction, if there are no {@link TransactionItemHandler.itemChanges itemChanges} the new values will not be processed
65
+ */
66
+ abstract processItemEntryChanges<ItemTypeType extends ApiEnumItemType>(itemEntryChangesTuple: ChangesDeltaItemUpdateDelta<ItemTypeType>, forceOverwrite: boolean, updateInitial: boolean, isCalledAfterSocketUpdate: boolean, createItemChangesIfNoneExist: boolean): ProcessItemEntryChangesResult<ItemTypeType>;
67
+ /**
68
+ * @description
69
+ * Traverses the column path and returns the fields of the derived item, returns undefined if the item isn't found
70
+ *
71
+ * ---------------------
72
+ *
73
+ * @remark
74
+ * Assumes the derived item's values are already cached
75
+ */
76
+ getDerivedValues(itemEntry: ItemEntry, columnPath: string[]): Readonly<FieldMap> | undefined;
77
+ /**
78
+ * @description
79
+ * Returns the value of the columnPath, or undefined when the path couldn't be traversed
80
+ *
81
+ * @param itemEntry The root entry to start the path from
82
+ * @param columnPath Can either be an array of columnIds (['column', 'column2']) or a config column string ('column>column2')
83
+ */
84
+ getDerivedValue<T extends any = any>(itemEntry: ItemEntry, columnPath: string[] | string): T | undefined;
85
+ /**
86
+ * @description
87
+ * Clears the entry from this transaction, removing it from the {@link ItemCache ItemCache} and removing all changes
88
+ */
89
+ clearItemEntry(entry: ItemEntry): void;
90
+ /**
91
+ * @description
92
+ * Recursively fetches derived values as separate requests, instead of as columns of a primary item
93
+ * Can be used when derived values of a local item have to be fetched, since a local item can't be used as root item of a query
94
+ */
95
+ fetchDerivedValuesByColumn<ItemTypeType extends ApiEnumItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, rootColumn: ColumnInfo<ItemTypeType>, changesDelta?: ChangesDeltaBase): PromiseInterface<void | Array<ItemEntry<ItemTypeType>>>;
96
+ resolveDerivedValues<ItemTypeType extends ApiEnumItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, columns: Array<ColumnInfo<ItemTypeType>>, changesDelta?: ChangesDeltaBase): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
97
+ /**
98
+ * @description
99
+ * Creates a new {@link ItemEntry ItemEntry} from the passed {@link ChangesDeltaItemCreateDelta ChangesDeltaItemCreateDelta} and stores it in this transaction's {@link ItemCache ItemCache}
100
+ */
101
+ createItemEntry(createTuple: ChangesDeltaItemCreateDelta): ItemEntry;
102
+ /**
103
+ * @description
104
+ * Gets the value of the given column, will look into the current delta before attempting to read itemChanges
105
+ */
106
+ protected getItemIdByColumn<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, column: ColumnInfo<ItemTypeType>, changesDelta?: ChangesDeltaBase): ItemId;
107
+ expandColumnsWithCachedQueryColumns(itemType: ApiEnumItemType, requestColumns?: ApiRequestColumns): ApiRequestColumns;
108
+ }
@@ -1,83 +1,83 @@
1
- import { ApiEnumItemType } from '@rentman/backend-types';
2
- import { ChangesDelta, InternalChangesDelta, TransactionCache, TransactionValidatorFactory } from '../..';
3
- import { RmCore } from '../../../core';
4
- import { ServerCacheDependencyInterface } from '../../../interfaces/ServerCacheDependencyInterface';
5
- import { ItemEntry } from '../../../models';
6
- import { ApiRequestColumn, ApiRequestColumnMap, CollectionQuery, CollectionResourceParentIdMap, EntryParent, EntryParentNull, FieldMap, ItemIdConversionMap, PromiseInterface } from '../../../types';
7
- import { ApiResponseProcessor } from '../../ApiResponseProcessor';
8
- import { ChangesDeltaResult } from '../../ChangesDeltaBase';
9
- import { OnAfterCreateCallback } from '../../ChangesProcessor';
10
- import { AbstractCache } from '../AbstractCache';
11
- import { CachedQueryItem } from '../CachedQueryHandlerBase';
12
- import { ServerCachedQueryHandler } from './ServerCachedQueryHandler';
13
- import { ServerItemEntryChanges, ServerItemHandler } from './ServerItemHandler';
14
- /**
15
- * @description
16
- * The {@link ServerCache ServerCache} is responsible for keeping track of {@link ItemEntry ItemEntries} and {@link CollectionEntry CollectionEntries}
17
- * which are saved on the server.
18
- *
19
- * It's basically a local representation of the database
20
- */
21
- export declare class ServerCache extends AbstractCache {
22
- dependencies: ServerCacheDependencyInterface;
23
- readonly itemHandler: ServerItemHandler;
24
- readonly cachedQueryHandler: ServerCachedQueryHandler;
25
- parent: null;
26
- constructor(dependencies: ServerCacheDependencyInterface, core: RmCore);
27
- getServerCache(): ServerCache;
28
- createChild(id?: string, validatorFactory?: TransactionValidatorFactory): TransactionCache;
29
- expandCollectionResources<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, collections: CollectionResourceParentIdMap<ItemTypeType>, newRequestColumns: ApiRequestColumn[]): PromiseInterface<CollectionResourceParentIdMap>;
30
- processResponse(response: ApiResponseProcessor, requestColumnMap: ApiRequestColumnMap, isCalledAfterApiSave?: boolean, isCalledAfterSocketUpdate?: boolean, changesDelta?: ChangesDelta): PromiseInterface<ChangesDeltaResult>;
31
- /**
32
- * @description
33
- * Applies the changes of the changesDelta created by the API call ({@link ChangesProcessor ChangesProcessor}/{@link SocketMessageHandler SocketMessageHandler}, or manually through a module function) on all caches
34
- */
35
- applyChangesFromParent(internalChangesDelta: InternalChangesDelta, isCalledAfterApiSave?: boolean, isCalledAfterSocketUpdate?: boolean): PromiseInterface<void>;
36
- /**
37
- * @description
38
- * Gets the fields required to set the parent
39
- */
40
- getLinkFieldsByParent<ItemTypeType extends ApiEnumItemType>(parent: EntryParent, itemType: ItemTypeType): Partial<FieldMap<ItemTypeType>>;
41
- /**
42
- * @description
43
- * Gets the entry's parent
44
- *
45
- * @param itemEntry The entry to get the parent from
46
- * @param _fromInitial Unused parameter, there for alignment with {@link TransactionCache.getParent TransactionCache.getParent]
47
- * @param _providedFields Unused parameter, there for alignment with {@link TransactionCache.getParent TransactionCache.getParent]
48
- *
49
- * @remark
50
- * Use {@link CollectionResource.getParent CollectionResource.getParent} instead of {@link TransactionCache.getParent TransactionCache.getParent} if you're getting the parent in the onRemove callback
51
- */
52
- getParent<ItemTypeType extends ApiEnumItemType = any>(itemEntry: ItemEntry<ItemTypeType>, _fromInitial?: boolean, _providedFields?: FieldMap<ItemTypeType>): EntryParentNull;
53
- getItemChangesRecursively(itemEntryId: ItemEntry['id'], copyFields?: boolean): FieldMap;
54
- /**
55
- * @description
56
- * Only takes the local changes into account, used for saving
57
- */
58
- getLocalItemEntryChangesTuple(itemEntryId: ItemEntry['id']): {
59
- entry: ItemEntry;
60
- changes: ServerItemEntryChanges;
61
- };
62
- getCollectionChangesRecursively<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery): CachedQueryItem<ItemTypeType> | undefined;
63
- /**
64
- * @description
65
- * Invalidates the complete server cache, all items will be re-fetched whenever they are requested
66
- */
67
- invalidateCache(): void;
68
- /**
69
- * @description
70
- * Merges the passed changes from the child Transaction into this Transaction's own changes and then propagates
71
- * them to all child Transactions
72
- */
73
- applyChangesFromChild(transaction: TransactionCache, breakUpByParent?: boolean, onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<ItemIdConversionMap>;
74
- /**
75
- * @description
76
- * Applies changes to this transaction and its children
77
- * Differs from {@link TransactionCache.applyChangesDelta TransactionCache.applyChangesDelta} in the handling of deleted entries and the applyChangesFromParent call
78
- */
79
- applyChangesDelta(changesDelta: ChangesDelta, isCalledAfterApiSave?: boolean, isCalledAfterSocketUpdate?: boolean): PromiseInterface<ChangesDeltaResult>;
80
- getLocalItemEntry(itemEntryId: ItemEntry['id']): ItemEntry | undefined;
81
- getLocalItemEntryByItemId(itemType: ApiEnumItemType, itemId: ItemEntry['itemId']): ItemEntry | undefined;
82
- getChangesFromItemChanges<ItemTypeType extends ApiEnumItemType = any>(changesObject: ServerItemEntryChanges<ItemTypeType>): FieldMap<ItemTypeType>;
83
- }
1
+ import { ApiEnumItemType } from '@rentman/backend-types';
2
+ import { ChangesDelta, InternalChangesDelta, TransactionCache, TransactionValidatorFactory } from '../..';
3
+ import { RmCore } from '../../../core';
4
+ import { ServerCacheDependencyInterface } from '../../../interfaces/ServerCacheDependencyInterface';
5
+ import { ItemEntry } from '../../../models';
6
+ import { ApiRequestColumn, ApiRequestColumnMap, CollectionQuery, CollectionResourceParentIdMap, EntryParent, EntryParentNull, FieldMap, ItemIdConversionMap, PromiseInterface } from '../../../types';
7
+ import { ApiResponseProcessor } from '../../ApiResponseProcessor';
8
+ import { ChangesDeltaResult } from '../../ChangesDeltaBase';
9
+ import { OnAfterCreateCallback } from '../../ChangesProcessor';
10
+ import { AbstractCache } from '../AbstractCache';
11
+ import { CachedQueryItem } from '../CachedQueryHandlerBase';
12
+ import { ServerCachedQueryHandler } from './ServerCachedQueryHandler';
13
+ import { ServerItemEntryChanges, ServerItemHandler } from './ServerItemHandler';
14
+ /**
15
+ * @description
16
+ * The {@link ServerCache ServerCache} is responsible for keeping track of {@link ItemEntry ItemEntries} and {@link CollectionEntry CollectionEntries}
17
+ * which are saved on the server.
18
+ *
19
+ * It's basically a local representation of the database
20
+ */
21
+ export declare class ServerCache extends AbstractCache {
22
+ dependencies: ServerCacheDependencyInterface;
23
+ readonly itemHandler: ServerItemHandler;
24
+ readonly cachedQueryHandler: ServerCachedQueryHandler;
25
+ parent: null;
26
+ constructor(dependencies: ServerCacheDependencyInterface, core: RmCore);
27
+ getServerCache(): ServerCache;
28
+ createChild(id?: string, validatorFactory?: TransactionValidatorFactory): TransactionCache;
29
+ expandCollectionResources<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, collections: CollectionResourceParentIdMap<ItemTypeType>, newRequestColumns: ApiRequestColumn[]): PromiseInterface<CollectionResourceParentIdMap>;
30
+ processResponse(response: ApiResponseProcessor, requestColumnMap: ApiRequestColumnMap, isCalledAfterApiSave?: boolean, isCalledAfterSocketUpdate?: boolean, changesDelta?: ChangesDelta): PromiseInterface<ChangesDeltaResult>;
31
+ /**
32
+ * @description
33
+ * Applies the changes of the changesDelta created by the API call ({@link ChangesProcessor ChangesProcessor}/{@link SocketMessageHandler SocketMessageHandler}, or manually through a module function) on all caches
34
+ */
35
+ applyChangesFromParent(internalChangesDelta: InternalChangesDelta, isCalledAfterApiSave?: boolean, isCalledAfterSocketUpdate?: boolean): PromiseInterface<void>;
36
+ /**
37
+ * @description
38
+ * Gets the fields required to set the parent
39
+ */
40
+ getLinkFieldsByParent<ItemTypeType extends ApiEnumItemType>(parent: EntryParent, itemType: ItemTypeType): Partial<FieldMap<ItemTypeType>>;
41
+ /**
42
+ * @description
43
+ * Gets the entry's parent
44
+ *
45
+ * @param itemEntry The entry to get the parent from
46
+ * @param _fromInitial Unused parameter, there for alignment with {@link TransactionCache.getParent TransactionCache.getParent]
47
+ * @param _providedFields Unused parameter, there for alignment with {@link TransactionCache.getParent TransactionCache.getParent]
48
+ *
49
+ * @remark
50
+ * Use {@link CollectionResource.getParent CollectionResource.getParent} instead of {@link TransactionCache.getParent TransactionCache.getParent} if you're getting the parent in the onRemove callback
51
+ */
52
+ getParent<ItemTypeType extends ApiEnumItemType = any>(itemEntry: ItemEntry<ItemTypeType>, _fromInitial?: boolean, _providedFields?: FieldMap<ItemTypeType>): EntryParentNull;
53
+ getItemChangesRecursively(itemEntryId: ItemEntry['id'], copyFields?: boolean): FieldMap;
54
+ /**
55
+ * @description
56
+ * Only takes the local changes into account, used for saving
57
+ */
58
+ getLocalItemEntryChangesTuple(itemEntryId: ItemEntry['id']): {
59
+ entry: ItemEntry;
60
+ changes: ServerItemEntryChanges;
61
+ };
62
+ getCollectionChangesRecursively<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery): CachedQueryItem<ItemTypeType> | undefined;
63
+ /**
64
+ * @description
65
+ * Invalidates the complete server cache, all items will be re-fetched whenever they are requested
66
+ */
67
+ invalidateCache(): void;
68
+ /**
69
+ * @description
70
+ * Merges the passed changes from the child Transaction into this Transaction's own changes and then propagates
71
+ * them to all child Transactions
72
+ */
73
+ applyChangesFromChild(transaction: TransactionCache, breakUpByParent?: boolean, onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<ItemIdConversionMap>;
74
+ /**
75
+ * @description
76
+ * Applies changes to this transaction and its children
77
+ * Differs from {@link TransactionCache.applyChangesDelta TransactionCache.applyChangesDelta} in the handling of deleted entries and the applyChangesFromParent call
78
+ */
79
+ applyChangesDelta(changesDelta: ChangesDelta, isCalledAfterApiSave?: boolean, isCalledAfterSocketUpdate?: boolean): PromiseInterface<ChangesDeltaResult>;
80
+ getLocalItemEntry(itemEntryId: ItemEntry['id']): ItemEntry | undefined;
81
+ getLocalItemEntryByItemId(itemType: ApiEnumItemType, itemId: ItemEntry['itemId']): ItemEntry | undefined;
82
+ getChangesFromItemChanges<ItemTypeType extends ApiEnumItemType = any>(changesObject: ServerItemEntryChanges<ItemTypeType>): FieldMap<ItemTypeType>;
83
+ }