@rentman/rm-core 6.3.10 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/changelog.md +801 -797
  2. package/dist/rm-core.js +9781 -9800
  3. package/dist/rm-core.min.js +2 -2
  4. package/dist/types/classes/ApiFormatter.d.ts +65 -65
  5. package/dist/types/classes/ApiRequestService.d.ts +20 -20
  6. package/dist/types/classes/ApiResponseProcessor.d.ts +31 -31
  7. package/dist/types/classes/ChangesCompilation.d.ts +34 -34
  8. package/dist/types/classes/ChangesDelta.d.ts +61 -61
  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 +26 -26
  12. package/dist/types/classes/CollectionMatcherBase.d.ts +21 -21
  13. package/dist/types/classes/CollectionMatcherCachedCollectionProcessor.d.ts +31 -31
  14. package/dist/types/classes/CollectionResourceService.d.ts +7 -7
  15. package/dist/types/classes/ColumnCache.d.ts +21 -21
  16. package/dist/types/classes/ColumnExpansion.d.ts +22 -22
  17. package/dist/types/classes/ColumnHandler.d.ts +21 -21
  18. package/dist/types/classes/ColumnInfo.d.ts +14 -14
  19. package/dist/types/classes/ColumnSet.d.ts +38 -38
  20. package/dist/types/classes/ColumnSubsetCache.d.ts +10 -10
  21. package/dist/types/classes/ColumnUtil.d.ts +99 -99
  22. package/dist/types/classes/ConversionMapService.d.ts +27 -27
  23. package/dist/types/classes/CreateRequest.d.ts +19 -19
  24. package/dist/types/classes/CreatedChangesDelta.d.ts +16 -16
  25. package/dist/types/classes/InternalChangesDelta.d.ts +39 -39
  26. package/dist/types/classes/ItemCache.d.ts +29 -29
  27. package/dist/types/classes/ItemCreateService.d.ts +24 -24
  28. package/dist/types/classes/ItemEntryService.d.ts +34 -34
  29. package/dist/types/classes/KeyService.d.ts +17 -17
  30. package/dist/types/classes/LockService.d.ts +32 -32
  31. package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -18
  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 +18 -18
  37. package/dist/types/classes/QueryParser.d.ts +24 -24
  38. package/dist/types/classes/QueryParserBase.d.ts +29 -29
  39. package/dist/types/classes/QueryParserIdUpdater.d.ts +16 -16
  40. package/dist/types/classes/QueryService.d.ts +18 -18
  41. package/dist/types/classes/RequestBuffer.d.ts +28 -28
  42. package/dist/types/classes/RequestBufferManager.d.ts +25 -25
  43. package/dist/types/classes/RequestColumnExpansion.d.ts +15 -15
  44. package/dist/types/classes/SocketMessageHandler.d.ts +39 -39
  45. package/dist/types/classes/TemplateCache.d.ts +66 -66
  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 +74 -74
  49. package/dist/types/classes/cache/CollectionMatcherCachedQueryProcessor.d.ts +35 -35
  50. package/dist/types/classes/cache/ItemHandlerBase.d.ts +105 -105
  51. package/dist/types/classes/cache/server/ServerCache.d.ts +82 -82
  52. package/dist/types/classes/cache/server/ServerCachedQueryHandler.d.ts +34 -34
  53. package/dist/types/classes/cache/server/ServerItemHandler.d.ts +52 -52
  54. package/dist/types/classes/cache/transaction/TransactionCache.d.ts +324 -331
  55. package/dist/types/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +23 -23
  56. package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +28 -28
  57. package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +24 -24
  58. package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +90 -90
  59. package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +34 -34
  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 +8 -8
  71. package/dist/types/factories/ColumnInfoFactory.d.ts +7 -7
  72. package/dist/types/factories/ColumnSetFactory.d.ts +19 -19
  73. package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +7 -7
  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 +7 -7
  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 +10 -10
  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 +11 -11
  88. package/dist/types/interfaces/AuthInterface.d.ts +9 -9
  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 +27 -26
  97. package/dist/types/interfaces/index.d.ts +11 -11
  98. package/dist/types/models/CollectionEntry.d.ts +23 -23
  99. package/dist/types/models/CollectionOptions.d.ts +18 -18
  100. package/dist/types/models/CollectionResource.d.ts +72 -72
  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 +84 -84
  104. package/dist/types/models/Template.d.ts +11 -11
  105. package/dist/types/models/index.d.ts +7 -7
  106. package/dist/types/types/ItemTypesCollection.d.ts +262 -262
  107. package/dist/types/types/PromiseInterface.d.ts +2 -2
  108. package/dist/types/types/index.d.ts +2 -2
  109. package/package.json +36 -36
  110. package/readme.md +15 -15
@@ -1,65 +1,65 @@
1
- import moment from 'moment';
2
- import { ColumnInfo } from '../classes';
3
- import { ColumnIdTypeMap, FieldMap, ItemType, ResponseColumn } from '../types';
4
- declare type GetChangesResult<Fields extends FieldMap, key extends keyof Fields = string> = {
5
- oldValue: Fields[key];
6
- newValue: Fields[key];
7
- column: ResponseColumn;
8
- };
9
- export declare class ApiFormatter {
10
- MOMENT_INVALID: string;
11
- SERVER_DATETIME_FORMAT: string;
12
- SERVER_TIME_FORMAT: string;
13
- SERVER_DATE_FORMAT: string;
14
- constructor();
15
- /**
16
- * @description
17
- * Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
18
- *
19
- * ----
20
- * @remarks
21
- * Currently only used for Moment objects
22
- */
23
- isExpensiveFormat(columnType: string): boolean;
24
- /**
25
- * @description
26
- * Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same (leaving user changes intact)
27
- */
28
- mergeCopyFields<ItemTypeType extends ItemType, Fields extends ColumnIdTypeMap>(initial: FieldMap<ItemTypeType, Fields>, changes: FieldMap<ItemTypeType, Fields>, newInitial: FieldMap<ItemTypeType, Fields>, columns: Array<ColumnInfo<ItemTypeType>>): FieldMap<ItemTypeType, Fields>;
29
- formatRequest<Fields extends FieldMap>(initial: Fields, modified: Fields, columns: Array<ColumnInfo<any>>): {
30
- [columnId: string]: any;
31
- };
32
- formatRequestLocal<Fields extends FieldMap>(fields: Fields, columns: Array<ColumnInfo<any>>): {
33
- [columnId: string]: any;
34
- };
35
- hasChanges(initial: FieldMap, modified: FieldMap, columns: Array<ColumnInfo<any>>, includeReadOnlyColumns?: boolean): boolean;
36
- getChanges<Fields extends FieldMap>(initial: Fields, modified: Fields, columns: Array<ColumnInfo<any>>): Array<GetChangesResult<Fields> | undefined>;
37
- copyFields<Fields extends FieldMap>(source: Fields, destination: Fields, columns: Array<ColumnInfo<any>>): Fields;
38
- shallowCopyFields<Fields extends FieldMap>(shallowSource: Fields, deepSource: Fields, destination: Fields, columns: Array<ColumnInfo<any>>): Fields;
39
- setDefaultValues<ItemTypeType extends ItemType = any>(destination: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<ItemTypeType>>): FieldMap<ItemTypeType>;
40
- /**
41
- * @description
42
- * Compares the given fields, returns `true` when the fields are equal
43
- */
44
- compareFields(columnType: string, first?: any, second?: any): boolean;
45
- compareFloats(a: number, b: number): boolean;
46
- compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
47
- compareDurations(first: moment.Duration, second: moment.Duration): boolean;
48
- formatResponseValue(columnType: string, value: any): any;
49
- formatRequestValue(columnType: string, value: any): any;
50
- formatResponseDate(value: null | any): moment.Moment;
51
- formatResponseDuration(value: null | number): moment.Duration;
52
- formatResponseColor(value: string): string;
53
- formatRequestDateTime(value: moment.Moment): string | null;
54
- formatRequestDate(value: moment.Moment): string | null;
55
- formatRequestDuration(value: moment.Duration): number;
56
- formatRequestColor(value: string): string;
57
- getDefaultValue(columnType: string): any;
58
- isDefaultValue(columnType: string, value: any): boolean;
59
- clone(columnType: string, value: any): any;
60
- getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
61
- cloneDuration(duration: moment.Duration): moment.Duration;
62
- cloneDate(date: moment.Moment): moment.Moment;
63
- identity<T>(input: T): T;
64
- }
65
- export {};
1
+ import moment from 'moment';
2
+ import { ColumnInfo } from '../classes';
3
+ import { ColumnIdTypeMap, FieldMap, ItemType, ResponseColumn } from '../types';
4
+ declare type GetChangesResult<Fields extends FieldMap, key extends keyof Fields = string> = {
5
+ oldValue: Fields[key];
6
+ newValue: Fields[key];
7
+ column: ResponseColumn;
8
+ };
9
+ export declare class ApiFormatter {
10
+ MOMENT_INVALID: string;
11
+ SERVER_DATETIME_FORMAT: string;
12
+ SERVER_TIME_FORMAT: string;
13
+ SERVER_DATE_FORMAT: string;
14
+ constructor();
15
+ /**
16
+ * @description
17
+ * Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
18
+ *
19
+ * ----
20
+ * @remarks
21
+ * Currently only used for Moment objects
22
+ */
23
+ isExpensiveFormat(columnType: string): boolean;
24
+ /**
25
+ * @description
26
+ * Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same (leaving user changes intact)
27
+ */
28
+ mergeCopyFields<ItemTypeType extends ItemType, Fields extends ColumnIdTypeMap>(initial: FieldMap<ItemTypeType, Fields>, changes: FieldMap<ItemTypeType, Fields>, newInitial: FieldMap<ItemTypeType, Fields>, columns: Array<ColumnInfo<ItemTypeType>>): FieldMap<ItemTypeType, Fields>;
29
+ formatRequest<Fields extends FieldMap>(initial: Fields, modified: Fields, columns: Array<ColumnInfo<any>>): {
30
+ [columnId: string]: any;
31
+ };
32
+ formatRequestLocal<Fields extends FieldMap>(fields: Fields, columns: Array<ColumnInfo<any>>): {
33
+ [columnId: string]: any;
34
+ };
35
+ hasChanges(initial: FieldMap, modified: FieldMap, columns: Array<ColumnInfo<any>>, includeReadOnlyColumns?: boolean): boolean;
36
+ getChanges<Fields extends FieldMap>(initial: Fields, modified: Fields, columns: Array<ColumnInfo<any>>): Array<GetChangesResult<Fields> | undefined>;
37
+ copyFields<Fields extends FieldMap>(source: Fields, destination: Fields, columns: Array<ColumnInfo<any>>): Fields;
38
+ shallowCopyFields<Fields extends FieldMap>(shallowSource: Fields, deepSource: Fields, destination: Fields, columns: Array<ColumnInfo<any>>): Fields;
39
+ setDefaultValues<ItemTypeType extends ItemType = any>(destination: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<ItemTypeType>>): FieldMap<ItemTypeType>;
40
+ /**
41
+ * @description
42
+ * Compares the given fields, returns `true` when the fields are equal
43
+ */
44
+ compareFields(columnType: string, first?: any, second?: any): boolean;
45
+ compareFloats(a: number, b: number): boolean;
46
+ compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
47
+ compareDurations(first: moment.Duration, second: moment.Duration): boolean;
48
+ formatResponseValue(columnType: string, value: any): any;
49
+ formatRequestValue(columnType: string, value: any): any;
50
+ formatResponseDate(value: null | any): moment.Moment;
51
+ formatResponseDuration(value: null | number): moment.Duration;
52
+ formatResponseColor(value: string): string;
53
+ formatRequestDateTime(value: moment.Moment): string | null;
54
+ formatRequestDate(value: moment.Moment): string | null;
55
+ formatRequestDuration(value: moment.Duration): number;
56
+ formatRequestColor(value: string): string;
57
+ getDefaultValue(columnType: string): any;
58
+ isDefaultValue(columnType: string, value: any): boolean;
59
+ clone(columnType: string, value: any): any;
60
+ getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
61
+ cloneDuration(duration: moment.Duration): moment.Duration;
62
+ cloneDate(date: moment.Moment): moment.Moment;
63
+ identity<T>(input: T): T;
64
+ }
65
+ export {};
@@ -1,20 +1,20 @@
1
- import { ApiResponseProcessor } from '../classes';
2
- import { ApiResponseProcessorFactory } from '../factories';
3
- import { ApiRequestServiceInterface } from '../interfaces';
4
- import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ItemId, ItemType, PromiseInterface } from '../types';
5
- export declare class ApiRequestService {
6
- private externalApiRequestService;
7
- private apiResponseProcessorFactory;
8
- constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
9
- template(itemType: ItemType, params: any): PromiseInterface<ApiResponseProcessor>;
10
- create(itemType: ItemType, itemId: ItemId, values: any, parentType?: ItemType, parentId?: ItemId): PromiseInterface<ApiResponseProcessor>;
11
- delete(itemType: ItemType, itemIds: ItemId[]): PromiseInterface<ApiResponseProcessor>;
12
- updateItems(itemType: ItemType, items: ApiRequestItemMap, columns: any): PromiseInterface<ApiResponseProcessor>;
13
- requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<ApiResponseProcessor>;
14
- moveItems(parentType: ItemType, parentId: ItemId, items: {
15
- [itemType: string]: ItemId[];
16
- }): PromiseInterface<ApiResponseProcessor>;
17
- columns(itemType: ItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<ApiResponseProcessor>;
18
- query(itemType: ItemType, query: any, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<ApiResponseProcessor>;
19
- processResponse(request: any): PromiseInterface<ApiResponseProcessor>;
20
- }
1
+ import { ApiResponseProcessor } from '../classes';
2
+ import { ApiResponseProcessorFactory } from '../factories';
3
+ import { ApiRequestServiceInterface } from '../interfaces';
4
+ import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ItemId, ItemType, PromiseInterface } from '../types';
5
+ export declare class ApiRequestService {
6
+ private externalApiRequestService;
7
+ private apiResponseProcessorFactory;
8
+ constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
9
+ template(itemType: ItemType, params: any): PromiseInterface<ApiResponseProcessor>;
10
+ create(itemType: ItemType, itemId: ItemId, values: any, parentType?: ItemType, parentId?: ItemId): PromiseInterface<ApiResponseProcessor>;
11
+ delete(itemType: ItemType, itemIds: ItemId[]): PromiseInterface<ApiResponseProcessor>;
12
+ updateItems(itemType: ItemType, items: ApiRequestItemMap, columns: any): PromiseInterface<ApiResponseProcessor>;
13
+ requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<ApiResponseProcessor>;
14
+ moveItems(parentType: ItemType, parentId: ItemId, items: {
15
+ [itemType: string]: ItemId[];
16
+ }): PromiseInterface<ApiResponseProcessor>;
17
+ columns(itemType: ItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<ApiResponseProcessor>;
18
+ query(itemType: ItemType, query: any, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<ApiResponseProcessor>;
19
+ processResponse(request: any): PromiseInterface<ApiResponseProcessor>;
20
+ }
@@ -1,31 +1,31 @@
1
- import { ApiFormatter } from '../classes';
2
- import { ColumnIdTypeMap, FieldMap, ItemId, ItemType, ItemTypeMap, ResponseColumn } from '../types';
3
- export declare class ApiResponseProcessor<RequestItemType extends ItemType = any> {
4
- apiFormatter: ApiFormatter;
5
- response: any;
6
- itemType: RequestItemType;
7
- columns: ItemTypeMap<ResponseColumn[]>;
8
- links: ItemTypeMap<ItemId[]>;
9
- cacheable: boolean;
10
- map: any;
11
- items: any;
12
- columnIndexMap: {
13
- [itemType: string]: {
14
- [columnId: string]: number;
15
- };
16
- };
17
- columnMap: any;
18
- constructor(apiFormatter: ApiFormatter, response: any);
19
- fetchColumnObject(itemType: ItemType): ResponseColumn;
20
- fetchValue(itemType: ItemType, itemId: ItemId, columnId: string): any;
21
- fetchColumnArray(itemType: ItemType): ResponseColumn[];
22
- fetchDerivedObject(itemType: ItemType, itemId: ItemId, rootColumns: ResponseColumn[]): {};
23
- fetchDerivedValues(value: any, column: ResponseColumn, destination: any): void;
24
- fetchObject<Fields extends ColumnIdTypeMap, ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: string | ItemId): FieldMap<ItemTypeType, Fields> | undefined;
25
- fetchObjectArray<ItemTypeType extends ItemType>(itemType: ItemTypeType, idArray?: ItemId[] | null): Array<FieldMap<ItemTypeType>>;
26
- fetchColumnsObject(): {
27
- [itemType: string]: ResponseColumn;
28
- };
29
- private addLazyFormattingFunction;
30
- private createColumnMaps;
31
- }
1
+ import { ApiFormatter } from '../classes';
2
+ import { ColumnIdTypeMap, FieldMap, ItemId, ItemType, ItemTypeMap, ResponseColumn } from '../types';
3
+ export declare class ApiResponseProcessor<RequestItemType extends ItemType = any> {
4
+ apiFormatter: ApiFormatter;
5
+ response: any;
6
+ itemType: RequestItemType;
7
+ columns: ItemTypeMap<ResponseColumn[]>;
8
+ links: ItemTypeMap<ItemId[]>;
9
+ cacheable: boolean;
10
+ map: any;
11
+ items: any;
12
+ columnIndexMap: {
13
+ [itemType: string]: {
14
+ [columnId: string]: number;
15
+ };
16
+ };
17
+ columnMap: any;
18
+ constructor(apiFormatter: ApiFormatter, response: any);
19
+ fetchColumnObject(itemType: ItemType): ResponseColumn;
20
+ fetchValue(itemType: ItemType, itemId: ItemId, columnId: string): any;
21
+ fetchColumnArray(itemType: ItemType): ResponseColumn[];
22
+ fetchDerivedObject(itemType: ItemType, itemId: ItemId, rootColumns: ResponseColumn[]): {};
23
+ fetchDerivedValues(value: any, column: ResponseColumn, destination: any): void;
24
+ fetchObject<Fields extends ColumnIdTypeMap, ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: string | ItemId): FieldMap<ItemTypeType, Fields> | undefined;
25
+ fetchObjectArray<ItemTypeType extends ItemType>(itemType: ItemTypeType, idArray?: ItemId[] | null): Array<FieldMap<ItemTypeType>>;
26
+ fetchColumnsObject(): {
27
+ [itemType: string]: ResponseColumn;
28
+ };
29
+ private addLazyFormattingFunction;
30
+ private createColumnMaps;
31
+ }
@@ -1,34 +1,34 @@
1
- import { ItemEntry } from '../models';
2
- import { ItemEntryMap, ItemMap, ItemType } from '../types';
3
- import { TransactionCache } from './cache/transaction/TransactionCache';
4
- import { InternalCreateDelta } from './InternalChangesDelta';
5
- export declare type CreateCompilation = {
6
- [parentType: string]: {
7
- [parentId: number]: ItemMap<InternalCreateDelta>;
8
- };
9
- };
10
- export declare type DeleteCompilation = {
11
- [itemType: string]: Array<ItemEntry<ItemType>>;
12
- };
13
- export declare type UpdateCompilation = ItemEntryMap<ItemType>;
14
- export declare type MoveCompilation = {
15
- [parentType: string]: {
16
- [parentId: number]: ItemEntry[];
17
- };
18
- };
19
- export declare class ChangesCompilation {
20
- private transaction;
21
- compilation: {
22
- create: CreateCompilation;
23
- delete: DeleteCompilation;
24
- update: UpdateCompilation;
25
- move: MoveCompilation;
26
- };
27
- constructor(transaction: TransactionCache);
28
- private processDelta;
29
- private getDefaultParent;
30
- private addMoveEntry;
31
- private addDeleteEntry;
32
- private addUpdateEntry;
33
- private addCreateEntry;
34
- }
1
+ import { ItemEntry } from '../models';
2
+ import { ItemEntryMap, ItemMap, ItemType } from '../types';
3
+ import { TransactionCache } from './cache/transaction/TransactionCache';
4
+ import { InternalCreateDelta } from './InternalChangesDelta';
5
+ export declare type CreateCompilation = {
6
+ [parentType: string]: {
7
+ [parentId: number]: ItemMap<InternalCreateDelta>;
8
+ };
9
+ };
10
+ export declare type DeleteCompilation = {
11
+ [itemType: string]: Array<ItemEntry<ItemType>>;
12
+ };
13
+ export declare type UpdateCompilation = ItemEntryMap<ItemType>;
14
+ export declare type MoveCompilation = {
15
+ [parentType: string]: {
16
+ [parentId: number]: ItemEntry[];
17
+ };
18
+ };
19
+ export declare class ChangesCompilation {
20
+ private transaction;
21
+ compilation: {
22
+ create: CreateCompilation;
23
+ delete: DeleteCompilation;
24
+ update: UpdateCompilation;
25
+ move: MoveCompilation;
26
+ };
27
+ constructor(transaction: TransactionCache);
28
+ private processDelta;
29
+ private getDefaultParent;
30
+ private addMoveEntry;
31
+ private addDeleteEntry;
32
+ private addUpdateEntry;
33
+ private addCreateEntry;
34
+ }
@@ -1,61 +1,61 @@
1
- import { ErrorHandlerInterface } from '../interfaces';
2
- import { ItemEntry } from '../models';
3
- import { EntryParent, EntryParentNull, FieldMap, ItemId, ItemType, PromiseInterface } from '../types';
4
- import { ChangesDeltaBase } from './ChangesDeltaBase';
5
- import { ColumnSet } from './ColumnSet';
6
- import { CreatedChangesDelta } from './CreatedChangesDelta';
7
- import { ItemCreateService } from './ItemCreateService';
8
- import { ItemEntryService } from './ItemEntryService';
9
- /**
10
- * @description
11
- * ChangesDelta used to apply changes from outside of the core to a transaction
12
- *
13
- * ----------
14
- *
15
- * The difference between {@link InternalChangesDelta InternalChangesDelta} and {@link ChangesDelta ChangesDelta} is that the ChangesDelta
16
- * assumes 'created' values have no itemEntries yet.
17
- *
18
- * Use this when calling {@link TransactionCache.applyChangesDelta applyChangesDelta}
19
- */
20
- export declare class ChangesDelta extends ChangesDeltaBase {
21
- private errorHandler;
22
- private itemCreateService;
23
- created: CreatedChangesDelta;
24
- constructor(errorHandler: ErrorHandlerInterface, itemCreateService: ItemCreateService, itemEntryService: ItemEntryService);
25
- /**
26
- * @description
27
- * Fetches a template for the passed itemType and processes the passed values and sets the item to be created when the delta is applied
28
- *
29
- * @remark
30
- * - If the values don't contain an `id` a new one will be generated
31
- * - If you want to set a parent set the proper field, you can't pass it as a separate object
32
- */
33
- setItemCreated<ItemTypeType extends ItemType, Fields extends FieldMap<ItemTypeType>>(itemType: ItemTypeType, values: Fields): PromiseInterface<this>;
34
- /**
35
- * @description
36
- * Fetches a template for the passed itemType and processes the passed values and sets the items to be created when the delta is applied
37
- *
38
- * @remark
39
- * - If the values don't contain an `id` a new one will be generated
40
- * - If you want to set a parent set the proper field, you can't pass it as a separate object
41
- */
42
- setItemsCreated<ItemTypeType extends ItemType, Fields extends FieldMap<ItemTypeType>>(itemType: ItemTypeType, valuesArray: Fields[]): PromiseInterface<this>;
43
- /**
44
- * @description
45
- * Will create an {@link ItemEntry ItemEntry} when the delta is applied
46
- * Does not always mean the item is local, just that it isn't cached yet
47
- *
48
- * @remark
49
- * If you're calling this from the frontend you probably want to call `setItemCreated`, which will fetch a template and process the values for you
50
- * If you don't, you have to make sure the values are all correct and all template items are processed
51
- *
52
- * @internal
53
- */
54
- _setItemCreated<ItemTypeType extends ItemType, Fields extends FieldMap<ItemTypeType>>(itemId: ItemId, fields: Fields, columns: ColumnSet<ItemTypeType>, parent?: EntryParentNull): this;
55
- /**
56
- * @description
57
- * Convenience function to assign the proper parent fields, will call {@link ChangesDeltaBase.setItemUpdated setItemUpdated} internally
58
- */
59
- setItemMoved(entry: ItemEntry, to: EntryParent): this;
60
- isEmpty(): boolean;
61
- }
1
+ import { ErrorHandlerInterface } from '../interfaces';
2
+ import { ItemEntry } from '../models';
3
+ import { EntryParent, EntryParentNull, FieldMap, ItemId, ItemType, PromiseInterface } from '../types';
4
+ import { ChangesDeltaBase } from './ChangesDeltaBase';
5
+ import { ColumnSet } from './ColumnSet';
6
+ import { CreatedChangesDelta } from './CreatedChangesDelta';
7
+ import { ItemCreateService } from './ItemCreateService';
8
+ import { ItemEntryService } from './ItemEntryService';
9
+ /**
10
+ * @description
11
+ * ChangesDelta used to apply changes from outside of the core to a transaction
12
+ *
13
+ * ----------
14
+ *
15
+ * The difference between {@link InternalChangesDelta InternalChangesDelta} and {@link ChangesDelta ChangesDelta} is that the ChangesDelta
16
+ * assumes 'created' values have no itemEntries yet.
17
+ *
18
+ * Use this when calling {@link TransactionCache.applyChangesDelta applyChangesDelta}
19
+ */
20
+ export declare class ChangesDelta extends ChangesDeltaBase {
21
+ private errorHandler;
22
+ private itemCreateService;
23
+ created: CreatedChangesDelta;
24
+ constructor(errorHandler: ErrorHandlerInterface, itemCreateService: ItemCreateService, itemEntryService: ItemEntryService);
25
+ /**
26
+ * @description
27
+ * Fetches a template for the passed itemType and processes the passed values and sets the item to be created when the delta is applied
28
+ *
29
+ * @remark
30
+ * - If the values don't contain an `id` a new one will be generated
31
+ * - If you want to set a parent set the proper field, you can't pass it as a separate object
32
+ */
33
+ setItemCreated<ItemTypeType extends ItemType, Fields extends FieldMap<ItemTypeType>>(itemType: ItemTypeType, values: Fields): PromiseInterface<this>;
34
+ /**
35
+ * @description
36
+ * Fetches a template for the passed itemType and processes the passed values and sets the items to be created when the delta is applied
37
+ *
38
+ * @remark
39
+ * - If the values don't contain an `id` a new one will be generated
40
+ * - If you want to set a parent set the proper field, you can't pass it as a separate object
41
+ */
42
+ setItemsCreated<ItemTypeType extends ItemType, Fields extends FieldMap<ItemTypeType>>(itemType: ItemTypeType, valuesArray: Fields[]): PromiseInterface<this>;
43
+ /**
44
+ * @description
45
+ * Will create an {@link ItemEntry ItemEntry} when the delta is applied
46
+ * Does not always mean the item is local, just that it isn't cached yet
47
+ *
48
+ * @remark
49
+ * If you're calling this from the frontend you probably want to call `setItemCreated`, which will fetch a template and process the values for you
50
+ * If you don't, you have to make sure the values are all correct and all template items are processed
51
+ *
52
+ * @internal
53
+ */
54
+ _setItemCreated<ItemTypeType extends ItemType, Fields extends FieldMap<ItemTypeType>>(itemId: ItemId, fields: Fields, columns: ColumnSet<ItemTypeType>, parent?: EntryParentNull): this;
55
+ /**
56
+ * @description
57
+ * Convenience function to assign the proper parent fields, will call {@link ChangesDeltaBase.setItemUpdated setItemUpdated} internally
58
+ */
59
+ setItemMoved(entry: ItemEntry, to: EntryParent): this;
60
+ isEmpty(): boolean;
61
+ }
@@ -1,51 +1,51 @@
1
- import { ItemEntry } from '../models';
2
- import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType } from '../types';
3
- import { ItemEntryService } from './ItemEntryService';
4
- export declare type ChangesDeltaResult = {
5
- rollback: () => void;
6
- created: ItemEntry[];
7
- };
8
- /**
9
- * @remark
10
- * We explicitly keep track of the new parent, so we can set an item to moved if it isn't null (Needed for linkTo request)
11
- */
12
- export declare type ChangesDeltaItemUpdateDelta<ItemTypeType extends ItemType = any> = {
13
- entry: ItemEntry<ItemTypeType>;
14
- changes: {
15
- expandedColumns: ColumnExpansionResult<ItemTypeType> | null;
16
- fields: FieldMap<ItemTypeType>;
17
- parent: EntryParentNull;
18
- };
19
- };
20
- export declare type ChangesDeltaItemDeleteDelta = ItemEntry[];
21
- export declare abstract class ChangesDeltaBase {
22
- protected itemEntryService: ItemEntryService;
23
- updated: {
24
- [itemEntryId: number]: ChangesDeltaItemUpdateDelta;
25
- };
26
- deleted: {
27
- [itemType: string]: ChangesDeltaItemDeleteDelta;
28
- };
29
- itemIdConversionMap: ItemIdConversionMap;
30
- /**
31
- * @private
32
- */
33
- _queryResults: {
34
- [itemType: string]: {
35
- [queryString: string]: ItemId[];
36
- };
37
- };
38
- protected constructor(itemEntryService: ItemEntryService);
39
- /**
40
- * @description
41
- * Adds a hint for the {@link CollectionMatcherBase CollectionMatcherBase] to the ChangesDelta, when the CollectionMatcher encounters a collection
42
- * with the exact query, it will use the hint instead of running the matcher
43
- *
44
- * @private
45
- */
46
- _setQueryResult(itemType: ItemType, queryString: string, itemIds: ItemId[]): void;
47
- setItemUpdated<ItemEntryType extends ItemEntry>(entry: ItemEntryType, fields: FieldMap<ItemEntryType['itemType']>, columnExpansionResult?: ColumnExpansionResult<ItemEntryType['itemType']> | null, parent?: EntryParentNull): this;
48
- setItemDeleted(deleted: ItemEntry): this;
49
- setItemsDeleted(deleted: ItemEntry[]): this;
50
- isEmpty(): boolean;
51
- }
1
+ import { ItemEntry } from '../models';
2
+ import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType } from '../types';
3
+ import { ItemEntryService } from './ItemEntryService';
4
+ export declare type ChangesDeltaResult = {
5
+ rollback: () => void;
6
+ created: ItemEntry[];
7
+ };
8
+ /**
9
+ * @remark
10
+ * We explicitly keep track of the new parent, so we can set an item to moved if it isn't null (Needed for linkTo request)
11
+ */
12
+ export declare type ChangesDeltaItemUpdateDelta<ItemTypeType extends ItemType = any> = {
13
+ entry: ItemEntry<ItemTypeType>;
14
+ changes: {
15
+ expandedColumns: ColumnExpansionResult<ItemTypeType> | null;
16
+ fields: FieldMap<ItemTypeType>;
17
+ parent: EntryParentNull;
18
+ };
19
+ };
20
+ export declare type ChangesDeltaItemDeleteDelta = ItemEntry[];
21
+ export declare abstract class ChangesDeltaBase {
22
+ protected itemEntryService: ItemEntryService;
23
+ updated: {
24
+ [itemEntryId: number]: ChangesDeltaItemUpdateDelta;
25
+ };
26
+ deleted: {
27
+ [itemType: string]: ChangesDeltaItemDeleteDelta;
28
+ };
29
+ itemIdConversionMap: ItemIdConversionMap;
30
+ /**
31
+ * @private
32
+ */
33
+ _queryResults: {
34
+ [itemType: string]: {
35
+ [queryString: string]: ItemId[];
36
+ };
37
+ };
38
+ protected constructor(itemEntryService: ItemEntryService);
39
+ /**
40
+ * @description
41
+ * Adds a hint for the {@link CollectionMatcherBase CollectionMatcherBase] to the ChangesDelta, when the CollectionMatcher encounters a collection
42
+ * with the exact query, it will use the hint instead of running the matcher
43
+ *
44
+ * @private
45
+ */
46
+ _setQueryResult(itemType: ItemType, queryString: string, itemIds: ItemId[]): void;
47
+ setItemUpdated<ItemEntryType extends ItemEntry>(entry: ItemEntryType, fields: FieldMap<ItemEntryType['itemType']>, columnExpansionResult?: ColumnExpansionResult<ItemEntryType['itemType']> | null, parent?: EntryParentNull): this;
48
+ setItemDeleted(deleted: ItemEntry): this;
49
+ setItemsDeleted(deleted: ItemEntry[]): this;
50
+ isEmpty(): boolean;
51
+ }
@@ -1,47 +1,47 @@
1
- import { ApiRequestService, CollectionEntryService, ItemEntryService } from '../classes';
2
- import { ChangesCompilationFactory, ColumnExpansionFactory, CreateRequestFactory, RequestColumnExpansionFactory } from '../factories';
3
- import { ChangesDeltaFactory } from '../factories/ChangesDeltaFactory';
4
- import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
5
- import { ItemIdConversionMap, PromiseInterface } from '../types';
6
- import { TransactionCache } from './cache/transaction/TransactionCache';
7
- export declare type OnAfterCreateCallback = (conversionMap: ItemIdConversionMap) => void;
8
- /**
9
- * @description
10
- * Executes the changes from a specific {@link TransactionCache transaction} and returns a {@link ChangesDelta ChangesDelta}
11
- */
12
- export declare class ChangesProcessor {
13
- private changesDeltaFactory;
14
- private apiRequestService;
15
- private changesCompilationFactory;
16
- private columnExpansionFactory;
17
- private createRequestFactory;
18
- private errorHandler;
19
- private promiseService;
20
- private requestColumnExpansionFactory;
21
- private collectionEntryService;
22
- private itemEntryService;
23
- private transaction;
24
- private breakUpByParent?;
25
- private onAfterCreateCallback?;
26
- private itemIdConversionMap;
27
- private serverCache;
28
- constructor(changesDeltaFactory: ChangesDeltaFactory, apiRequestService: ApiRequestService, changesCompilationFactory: ChangesCompilationFactory, columnExpansionFactory: ColumnExpansionFactory, createRequestFactory: CreateRequestFactory, errorHandler: ErrorHandlerInterface, promiseService: PromiseLibraryInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory, collectionEntryService: CollectionEntryService, itemEntryService: ItemEntryService, transaction: TransactionCache, breakUpByParent?: boolean | undefined, onAfterCreateCallback?: OnAfterCreateCallback | undefined);
29
- /**
30
- * @description
31
- * Executes the requests in the order of:
32
- * 1. create
33
- * 2. move
34
- * 3. delete
35
- * 4. update
36
- */
37
- execute(): PromiseInterface<ItemIdConversionMap>;
38
- private buildMoveRequest;
39
- private getMapValue;
40
- private executeCreateRequests;
41
- private executeCreateRequest;
42
- private executeUpdateRequests;
43
- private executeUpdateRequest;
44
- private executeDeleteRequests;
45
- private executeDeleteRequest;
46
- private executeMoveRequests;
47
- }
1
+ import { ApiRequestService, CollectionEntryService, ItemEntryService } from '../classes';
2
+ import { ChangesCompilationFactory, ColumnExpansionFactory, CreateRequestFactory, RequestColumnExpansionFactory } from '../factories';
3
+ import { ChangesDeltaFactory } from '../factories/ChangesDeltaFactory';
4
+ import { ErrorHandlerInterface, PromiseLibraryInterface } from '../interfaces';
5
+ import { ItemIdConversionMap, PromiseInterface } from '../types';
6
+ import { TransactionCache } from './cache/transaction/TransactionCache';
7
+ export declare type OnAfterCreateCallback = (conversionMap: ItemIdConversionMap) => void;
8
+ /**
9
+ * @description
10
+ * Executes the changes from a specific {@link TransactionCache transaction} and returns a {@link ChangesDelta ChangesDelta}
11
+ */
12
+ export declare class ChangesProcessor {
13
+ private changesDeltaFactory;
14
+ private apiRequestService;
15
+ private changesCompilationFactory;
16
+ private columnExpansionFactory;
17
+ private createRequestFactory;
18
+ private errorHandler;
19
+ private promiseService;
20
+ private requestColumnExpansionFactory;
21
+ private collectionEntryService;
22
+ private itemEntryService;
23
+ private transaction;
24
+ private breakUpByParent?;
25
+ private onAfterCreateCallback?;
26
+ private itemIdConversionMap;
27
+ private serverCache;
28
+ constructor(changesDeltaFactory: ChangesDeltaFactory, apiRequestService: ApiRequestService, changesCompilationFactory: ChangesCompilationFactory, columnExpansionFactory: ColumnExpansionFactory, createRequestFactory: CreateRequestFactory, errorHandler: ErrorHandlerInterface, promiseService: PromiseLibraryInterface, requestColumnExpansionFactory: RequestColumnExpansionFactory, collectionEntryService: CollectionEntryService, itemEntryService: ItemEntryService, transaction: TransactionCache, breakUpByParent?: boolean | undefined, onAfterCreateCallback?: OnAfterCreateCallback | undefined);
29
+ /**
30
+ * @description
31
+ * Executes the requests in the order of:
32
+ * 1. create
33
+ * 2. move
34
+ * 3. delete
35
+ * 4. update
36
+ */
37
+ execute(): PromiseInterface<ItemIdConversionMap>;
38
+ private buildMoveRequest;
39
+ private getMapValue;
40
+ private executeCreateRequests;
41
+ private executeCreateRequest;
42
+ private executeUpdateRequests;
43
+ private executeUpdateRequest;
44
+ private executeDeleteRequests;
45
+ private executeDeleteRequest;
46
+ private executeMoveRequests;
47
+ }