@rentman/rm-core 4.0.1 → 4.0.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 (109) hide show
  1. package/changelog.md +692 -685
  2. package/dist/rm-core.js +9521 -9468
  3. package/dist/rm-core.min.js +2 -2
  4. package/dist/types/classes/ApiFormatter.d.ts +55 -55
  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 +59 -59
  9. package/dist/types/classes/ChangesDeltaBase.d.ts +50 -50
  10. package/dist/types/classes/ChangesProcessor.d.ts +47 -47
  11. package/dist/types/classes/CollectionCache.d.ts +38 -38
  12. package/dist/types/classes/CollectionEntryService.d.ts +25 -25
  13. package/dist/types/classes/CollectionMatcher.d.ts +9 -9
  14. package/dist/types/classes/CollectionMatcherBase.d.ts +26 -26
  15. package/dist/types/classes/CollectionResourceService.d.ts +6 -6
  16. package/dist/types/classes/ColumnCache.d.ts +21 -21
  17. package/dist/types/classes/ColumnExpansion.d.ts +22 -22
  18. package/dist/types/classes/ColumnHandler.d.ts +21 -21
  19. package/dist/types/classes/ColumnInfo.d.ts +14 -14
  20. package/dist/types/classes/ColumnSet.d.ts +39 -39
  21. package/dist/types/classes/ColumnSubsetCache.d.ts +8 -8
  22. package/dist/types/classes/ColumnUtil.d.ts +99 -99
  23. package/dist/types/classes/ConversionMapService.d.ts +27 -27
  24. package/dist/types/classes/CreateRequest.d.ts +19 -19
  25. package/dist/types/classes/CreatedChangesDelta.d.ts +15 -15
  26. package/dist/types/classes/InternalChangesDelta.d.ts +39 -39
  27. package/dist/types/classes/ItemCache.d.ts +29 -29
  28. package/dist/types/classes/ItemCreateService.d.ts +24 -24
  29. package/dist/types/classes/ItemEntryService.d.ts +34 -34
  30. package/dist/types/classes/KeyService.d.ts +16 -16
  31. package/dist/types/classes/LockService.d.ts +32 -32
  32. package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -18
  33. package/dist/types/classes/QueryColumnExtractor.d.ts +20 -20
  34. package/dist/types/classes/QueryLocalLinkedToParser.d.ts +17 -0
  35. package/dist/types/classes/QueryMatcher.d.ts +14 -14
  36. package/dist/types/classes/QueryParser.d.ts +25 -25
  37. package/dist/types/classes/QueryParserBase.d.ts +29 -29
  38. package/dist/types/classes/QueryService.d.ts +17 -14
  39. package/dist/types/classes/RequestBuffer.d.ts +28 -28
  40. package/dist/types/classes/RequestBufferManager.d.ts +24 -24
  41. package/dist/types/classes/RequestColumnExpansion.d.ts +15 -15
  42. package/dist/types/classes/SocketMessageHandler.d.ts +31 -31
  43. package/dist/types/classes/TemplateCache.d.ts +66 -66
  44. package/dist/types/classes/Util.d.ts +30 -30
  45. package/dist/types/classes/cache/AbstractCache.d.ts +101 -101
  46. package/dist/types/classes/cache/CollectionHandlerBase.d.ts +68 -68
  47. package/dist/types/classes/cache/CollectionMatcherCacheProcessor.d.ts +26 -26
  48. package/dist/types/classes/cache/ItemHandlerBase.d.ts +95 -95
  49. package/dist/types/classes/cache/server/ServerCache.d.ts +83 -83
  50. package/dist/types/classes/cache/server/ServerCollectionHandler.d.ts +44 -44
  51. package/dist/types/classes/cache/server/ServerItemHandler.d.ts +51 -51
  52. package/dist/types/classes/cache/transaction/TransactionCache.d.ts +336 -336
  53. package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +62 -62
  54. package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +24 -24
  55. package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +90 -90
  56. package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +28 -28
  57. package/dist/types/classes/index.d.ts +46 -46
  58. package/dist/types/constants.d.ts +7 -7
  59. package/dist/types/core.d.ts +52 -52
  60. package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
  61. package/dist/types/factories/ChangesCompilationFactory.d.ts +6 -6
  62. package/dist/types/factories/ChangesDeltaFactory.d.ts +11 -11
  63. package/dist/types/factories/ChangesProcessorFactory.d.ts +22 -22
  64. package/dist/types/factories/CollectionCacheFactory.d.ts +8 -8
  65. package/dist/types/factories/CollectionEntryFactory.d.ts +11 -11
  66. package/dist/types/factories/CollectionMatcherFactory.d.ts +9 -9
  67. package/dist/types/factories/CollectionResourceFactory.d.ts +16 -16
  68. package/dist/types/factories/ColumnExpansionFactory.d.ts +8 -8
  69. package/dist/types/factories/ColumnInfoFactory.d.ts +7 -7
  70. package/dist/types/factories/ColumnSetFactory.d.ts +19 -19
  71. package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +6 -6
  72. package/dist/types/factories/CreateRequestFactory.d.ts +11 -11
  73. package/dist/types/factories/ItemCacheFactory.d.ts +8 -8
  74. package/dist/types/factories/ItemEntryFactory.d.ts +15 -15
  75. package/dist/types/factories/ItemResourceFactory.d.ts +14 -14
  76. package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +5 -5
  77. package/dist/types/factories/QueryMatcherFactory.d.ts +7 -7
  78. package/dist/types/factories/QueryParserFactory.d.ts +6 -6
  79. package/dist/types/factories/RequestColumnExpansionFactory.d.ts +6 -6
  80. package/dist/types/factories/TemplateFactory.d.ts +10 -10
  81. package/dist/types/factories/TransactionCacheFactory.d.ts +15 -15
  82. package/dist/types/factories/index.d.ts +22 -22
  83. package/dist/types/index.d.ts +7 -7
  84. package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +44 -44
  85. package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +11 -11
  86. package/dist/types/interfaces/AuthInterface.d.ts +9 -9
  87. package/dist/types/interfaces/ErrorHandlerInterface.d.ts +5 -5
  88. package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  89. package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  90. package/dist/types/interfaces/PromiseLibraryInterface.d.ts +25 -25
  91. package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +7 -7
  92. package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
  93. package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +21 -20
  94. package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +26 -26
  95. package/dist/types/interfaces/index.d.ts +11 -11
  96. package/dist/types/models/CollectionEntry.d.ts +27 -27
  97. package/dist/types/models/CollectionEntryOptions.d.ts +13 -13
  98. package/dist/types/models/CollectionResource.d.ts +63 -63
  99. package/dist/types/models/CollectionResourceOptions.d.ts +23 -23
  100. package/dist/types/models/ItemEntry.d.ts +19 -19
  101. package/dist/types/models/ItemEntryOptions.d.ts +8 -8
  102. package/dist/types/models/ItemResource.d.ts +84 -84
  103. package/dist/types/models/Template.d.ts +11 -11
  104. package/dist/types/models/index.d.ts +8 -8
  105. package/dist/types/types/ItemTypesCollection.d.ts +263 -263
  106. package/dist/types/types/PromiseInterface.d.ts +2 -2
  107. package/dist/types/types/index.d.ts +2 -2
  108. package/package.json +36 -36
  109. package/readme.md +15 -15
@@ -1,55 +1,55 @@
1
- import moment from 'moment';
2
- import { ColumnInfo } from '../classes';
3
- import { FieldMap, ItemType } from '../types';
4
- export declare class ApiFormatter {
5
- MOMENT_INVALID: string;
6
- SERVER_DATETIME_FORMAT: string;
7
- SERVER_TIME_FORMAT: string;
8
- SERVER_DATE_FORMAT: string;
9
- constructor();
10
- /**
11
- * @description
12
- * Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
13
- *
14
- * ----
15
- * @remarks
16
- * Currently only used for Moment objects
17
- */
18
- isExpensiveFormat(columnType: string): boolean;
19
- /**
20
- * @description
21
- * Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same (leaving user changes intact)
22
- */
23
- mergeCopyFields<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, changes: FieldMap<ItemTypeType>, newInitial: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<ItemTypeType>>): FieldMap<ItemTypeType>;
24
- formatRequest<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
25
- formatRequestLocal<ItemTypeType extends ItemType>(fields: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
26
- hasChanges(initial: FieldMap, modified: FieldMap, columns: Array<ColumnInfo<any>>, includeReadOnlyColumns?: boolean): boolean;
27
- getChanges<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
28
- copyFields<ItemTypeType extends ItemType>(source: FieldMap<ItemTypeType>, destination: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
29
- shallowCopyFields(shallowSource: FieldMap, deepSource: FieldMap, destination: FieldMap, columns: Array<ColumnInfo<any>>): FieldMap;
30
- setDefaultValues(destination: FieldMap, columns: Array<ColumnInfo<any>>): FieldMap;
31
- /**
32
- * @description
33
- * Compares the given fields, returns `true` when the fields are equal
34
- */
35
- compareFields(columnType: string, first?: any, second?: any): boolean;
36
- compareFloats(a: number, b: number): boolean;
37
- compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
38
- compareDurations(first: moment.Duration, second: moment.Duration): boolean;
39
- formatResponseValue(columnType: string, value: any): any;
40
- formatRequestValue(columnType: string, value: any): any;
41
- formatResponseDate(value: null | any): moment.Moment;
42
- formatResponseDuration(value: null | number): moment.Duration;
43
- formatResponseColor(value: string): string;
44
- formatRequestDateTime(value: moment.Moment): string | null;
45
- formatRequestDate(value: moment.Moment): string | null;
46
- formatRequestDuration(value: moment.Duration): number;
47
- formatRequestColor(value: string): string;
48
- getDefaultValue(columnType: string): any;
49
- isDefaultValue(columnType: string, value: any): boolean;
50
- clone(columnType: string, value: any): any;
51
- getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
52
- cloneDuration(duration: moment.Duration): moment.Duration;
53
- cloneDate(date: moment.Moment): moment.Moment;
54
- identity<T>(input: T): T;
55
- }
1
+ import moment from 'moment';
2
+ import { ColumnInfo } from '../classes';
3
+ import { FieldMap, ItemType } from '../types';
4
+ export declare class ApiFormatter {
5
+ MOMENT_INVALID: string;
6
+ SERVER_DATETIME_FORMAT: string;
7
+ SERVER_TIME_FORMAT: string;
8
+ SERVER_DATE_FORMAT: string;
9
+ constructor();
10
+ /**
11
+ * @description
12
+ * Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
13
+ *
14
+ * ----
15
+ * @remarks
16
+ * Currently only used for Moment objects
17
+ */
18
+ isExpensiveFormat(columnType: string): boolean;
19
+ /**
20
+ * @description
21
+ * Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same (leaving user changes intact)
22
+ */
23
+ mergeCopyFields<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, changes: FieldMap<ItemTypeType>, newInitial: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<ItemTypeType>>): FieldMap<ItemTypeType>;
24
+ formatRequest<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
25
+ formatRequestLocal<ItemTypeType extends ItemType>(fields: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
26
+ hasChanges(initial: FieldMap, modified: FieldMap, columns: Array<ColumnInfo<any>>, includeReadOnlyColumns?: boolean): boolean;
27
+ getChanges<ItemTypeType extends ItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
28
+ copyFields<ItemTypeType extends ItemType>(source: FieldMap<ItemTypeType>, destination: FieldMap<ItemTypeType>, columns: Array<ColumnInfo<any>>): FieldMap<ItemTypeType>;
29
+ shallowCopyFields(shallowSource: FieldMap, deepSource: FieldMap, destination: FieldMap, columns: Array<ColumnInfo<any>>): FieldMap;
30
+ setDefaultValues(destination: FieldMap, columns: Array<ColumnInfo<any>>): FieldMap;
31
+ /**
32
+ * @description
33
+ * Compares the given fields, returns `true` when the fields are equal
34
+ */
35
+ compareFields(columnType: string, first?: any, second?: any): boolean;
36
+ compareFloats(a: number, b: number): boolean;
37
+ compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
38
+ compareDurations(first: moment.Duration, second: moment.Duration): boolean;
39
+ formatResponseValue(columnType: string, value: any): any;
40
+ formatRequestValue(columnType: string, value: any): any;
41
+ formatResponseDate(value: null | any): moment.Moment;
42
+ formatResponseDuration(value: null | number): moment.Duration;
43
+ formatResponseColor(value: string): string;
44
+ formatRequestDateTime(value: moment.Moment): string | null;
45
+ formatRequestDate(value: moment.Moment): string | null;
46
+ formatRequestDuration(value: moment.Duration): number;
47
+ formatRequestColor(value: string): string;
48
+ getDefaultValue(columnType: string): any;
49
+ isDefaultValue(columnType: string, value: any): boolean;
50
+ clone(columnType: string, value: any): any;
51
+ getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
52
+ cloneDuration(duration: moment.Duration): moment.Duration;
53
+ cloneDate(date: moment.Moment): moment.Moment;
54
+ identity<T>(input: T): T;
55
+ }
@@ -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 { FieldMap, ItemId, ItemType, ItemTypeMap, ResponseColumn } from '../types';
3
- export declare class ApiResponseProcessor {
4
- apiFormatter: ApiFormatter;
5
- response: any;
6
- itemType: ItemType;
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<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: string | ItemId, includeLinks?: boolean): FieldMap<ItemTypeType> | undefined;
25
- fetchObjectArray<ItemTypeType extends ItemType>(itemType: ItemTypeType, includeLinks?: boolean, 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 { FieldMap, ItemId, ItemType, ItemTypeMap, ResponseColumn } from '../types';
3
+ export declare class ApiResponseProcessor {
4
+ apiFormatter: ApiFormatter;
5
+ response: any;
6
+ itemType: ItemType;
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<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: string | ItemId, includeLinks?: boolean): FieldMap<ItemTypeType> | undefined;
25
+ fetchObjectArray<ItemTypeType extends ItemType>(itemType: ItemTypeType, includeLinks?: boolean, 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,59 +1,59 @@
1
- import { ItemEntry } from '../models';
2
- import { EntryParent, EntryParentNull, FieldMap, ItemId, ItemType, PromiseInterface } from '../types';
3
- import { ChangesDeltaBase } from './ChangesDeltaBase';
4
- import { ColumnSet } from './ColumnSet';
5
- import { CreatedChangesDelta } from './CreatedChangesDelta';
6
- import { ItemCreateService } from './ItemCreateService';
7
- import { ItemEntryService } from './ItemEntryService';
8
- /**
9
- * @description
10
- * ChangesDelta used to apply changes from outside of the core to a transaction
11
- *
12
- * ----------
13
- *
14
- * The difference between {@link InternalChangesDelta InternalChangesDelta} and {@link ChangesDelta ChangesDelta} is that the ChangesDelta
15
- * assumes 'created' values have no itemEntries yet.
16
- *
17
- * Use this when calling {@link TransactionCache.applyChangesDelta applyChangesDelta}
18
- */
19
- export declare class ChangesDelta extends ChangesDeltaBase {
20
- private itemCreateService;
21
- created: CreatedChangesDelta;
22
- constructor(itemCreateService: ItemCreateService, itemEntryService: ItemEntryService);
23
- /**
24
- * @description
25
- * Fetches a template for the passed itemType and processes the passed values and sets the item to be created when the delta is applied
26
- *
27
- * @remark
28
- * - If the values don't contain an `id` a new one will be generated
29
- * - If you want to set a parent set the proper field, you can't pass it as a separate object
30
- */
31
- setItemCreated<ItemTypeType extends ItemType>(itemType: ItemTypeType, values: FieldMap<ItemTypeType>): PromiseInterface<void>;
32
- /**
33
- * @description
34
- * Fetches a template for the passed itemType and processes the passed values and sets the items to be created when the delta is applied
35
- *
36
- * @remark
37
- * - If the values don't contain an `id` a new one will be generated
38
- * - If you want to set a parent set the proper field, you can't pass it as a separate object
39
- */
40
- setItemsCreated<ItemTypeType extends ItemType>(itemType: ItemTypeType, valuesArray: Array<FieldMap<ItemTypeType>>): PromiseInterface<void>;
41
- /**
42
- * @description
43
- * Will create an {@link ItemEntry ItemEntry} when the delta is applied
44
- * Does not always mean the item is local, just that it isn't cached yet
45
- *
46
- * @remark
47
- * 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
48
- * If you don't, you have to make sure the values are all correct and all template items are processed
49
- *
50
- * @internal
51
- */
52
- _setItemCreated<ItemTypeType extends ItemType>(itemId: ItemId, fields: FieldMap<ItemTypeType>, columns: ColumnSet<ItemTypeType>, parent?: EntryParentNull): void;
53
- /**
54
- * @description
55
- * Convenience function to assign the proper parent fields, will call {@link ChangesDeltaBase.setItemUpdated setItemUpdated} internally
56
- */
57
- setItemMoved(entry: ItemEntry, to: EntryParent): void;
58
- isEmpty(): boolean;
59
- }
1
+ import { ItemEntry } from '../models';
2
+ import { EntryParent, EntryParentNull, FieldMap, ItemId, ItemType, PromiseInterface } from '../types';
3
+ import { ChangesDeltaBase } from './ChangesDeltaBase';
4
+ import { ColumnSet } from './ColumnSet';
5
+ import { CreatedChangesDelta } from './CreatedChangesDelta';
6
+ import { ItemCreateService } from './ItemCreateService';
7
+ import { ItemEntryService } from './ItemEntryService';
8
+ /**
9
+ * @description
10
+ * ChangesDelta used to apply changes from outside of the core to a transaction
11
+ *
12
+ * ----------
13
+ *
14
+ * The difference between {@link InternalChangesDelta InternalChangesDelta} and {@link ChangesDelta ChangesDelta} is that the ChangesDelta
15
+ * assumes 'created' values have no itemEntries yet.
16
+ *
17
+ * Use this when calling {@link TransactionCache.applyChangesDelta applyChangesDelta}
18
+ */
19
+ export declare class ChangesDelta extends ChangesDeltaBase {
20
+ private itemCreateService;
21
+ created: CreatedChangesDelta;
22
+ constructor(itemCreateService: ItemCreateService, itemEntryService: ItemEntryService);
23
+ /**
24
+ * @description
25
+ * Fetches a template for the passed itemType and processes the passed values and sets the item to be created when the delta is applied
26
+ *
27
+ * @remark
28
+ * - If the values don't contain an `id` a new one will be generated
29
+ * - If you want to set a parent set the proper field, you can't pass it as a separate object
30
+ */
31
+ setItemCreated<ItemTypeType extends ItemType>(itemType: ItemTypeType, values: FieldMap<ItemTypeType>): PromiseInterface<void>;
32
+ /**
33
+ * @description
34
+ * Fetches a template for the passed itemType and processes the passed values and sets the items to be created when the delta is applied
35
+ *
36
+ * @remark
37
+ * - If the values don't contain an `id` a new one will be generated
38
+ * - If you want to set a parent set the proper field, you can't pass it as a separate object
39
+ */
40
+ setItemsCreated<ItemTypeType extends ItemType>(itemType: ItemTypeType, valuesArray: Array<FieldMap<ItemTypeType>>): PromiseInterface<void>;
41
+ /**
42
+ * @description
43
+ * Will create an {@link ItemEntry ItemEntry} when the delta is applied
44
+ * Does not always mean the item is local, just that it isn't cached yet
45
+ *
46
+ * @remark
47
+ * 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
48
+ * If you don't, you have to make sure the values are all correct and all template items are processed
49
+ *
50
+ * @internal
51
+ */
52
+ _setItemCreated<ItemTypeType extends ItemType>(itemId: ItemId, fields: FieldMap<ItemTypeType>, columns: ColumnSet<ItemTypeType>, parent?: EntryParentNull): void;
53
+ /**
54
+ * @description
55
+ * Convenience function to assign the proper parent fields, will call {@link ChangesDeltaBase.setItemUpdated setItemUpdated} internally
56
+ */
57
+ setItemMoved(entry: ItemEntry, to: EntryParent): void;
58
+ isEmpty(): boolean;
59
+ }
@@ -1,50 +1,50 @@
1
- import { ItemEntry } from '../models';
2
- import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemId, 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
- /**
30
- * @private
31
- */
32
- _queryResults: {
33
- [itemType: string]: {
34
- [queryString: string]: ItemId[];
35
- };
36
- };
37
- protected constructor(itemEntryService: ItemEntryService);
38
- /**
39
- * @description
40
- * Adds a hint for the {@link CollectionMatcherBase CollectionMatcherBase] to the ChangesDelta, when the CollectionMatcher encounters a collection
41
- * with the exact query, it will use the hint instead of running the matcher
42
- *
43
- * @private
44
- */
45
- _setQueryResult(itemType: ItemType, queryString: string, itemIds: ItemId[]): void;
46
- setItemUpdated<ItemEntryType extends ItemEntry>(entry: ItemEntryType, fields: FieldMap<ItemEntryType['itemType']>, columnExpansionResult?: ColumnExpansionResult<ItemEntryType['itemType']> | null, parent?: EntryParentNull): void;
47
- setItemDeleted(deleted: ItemEntry): void;
48
- setItemsDeleted(deleted: ItemEntry[]): void;
49
- isEmpty(): boolean;
50
- }
1
+ import { ItemEntry } from '../models';
2
+ import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemId, 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
+ /**
30
+ * @private
31
+ */
32
+ _queryResults: {
33
+ [itemType: string]: {
34
+ [queryString: string]: ItemId[];
35
+ };
36
+ };
37
+ protected constructor(itemEntryService: ItemEntryService);
38
+ /**
39
+ * @description
40
+ * Adds a hint for the {@link CollectionMatcherBase CollectionMatcherBase] to the ChangesDelta, when the CollectionMatcher encounters a collection
41
+ * with the exact query, it will use the hint instead of running the matcher
42
+ *
43
+ * @private
44
+ */
45
+ _setQueryResult(itemType: ItemType, queryString: string, itemIds: ItemId[]): void;
46
+ setItemUpdated<ItemEntryType extends ItemEntry>(entry: ItemEntryType, fields: FieldMap<ItemEntryType['itemType']>, columnExpansionResult?: ColumnExpansionResult<ItemEntryType['itemType']> | null, parent?: EntryParentNull): void;
47
+ setItemDeleted(deleted: ItemEntry): void;
48
+ setItemsDeleted(deleted: ItemEntry[]): void;
49
+ isEmpty(): boolean;
50
+ }
@@ -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
+ }