@rentman/rm-core 10.0.4 → 10.0.6

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 (130) hide show
  1. package/changelog.md +1397 -1386
  2. package/dist/rm-core.js +996 -959
  3. package/dist/rm-core.min.js +1 -1
  4. package/dist/types/classes/ApiFormatter.d.ts +79 -79
  5. package/dist/types/classes/ApiRequestService.d.ts +18 -18
  6. package/dist/types/classes/ApiResponseProcessor.d.ts +29 -29
  7. package/dist/types/classes/BusinessLogicManager/BusinessLogicManager.d.ts +98 -98
  8. package/dist/types/classes/BusinessLogicManager/BusinessLogicRule.d.ts +94 -94
  9. package/dist/types/classes/BusinessLogicManager/Customfield/CustomFieldTypeBusinessLogicRule.d.ts +18 -18
  10. package/dist/types/classes/BusinessLogicManager/Documents/DocumentTemplateBusinessLogicRule.d.ts +25 -25
  11. package/dist/types/classes/BusinessLogicManager/Exemplaar/ExemplaarAanschafdatumBusinessLogicRule.d.ts +14 -14
  12. package/dist/types/classes/BusinessLogicManager/Factuur/FactuurBetalingsconditieBusinessLogicRule.d.ts +20 -20
  13. package/dist/types/classes/BusinessLogicManager/Factuur/FactuurDatumBusinessLogicRule.d.ts +19 -19
  14. package/dist/types/classes/BusinessLogicManager/Factuur/FactuurNumberseriesBusinessLogicRule.d.ts +14 -14
  15. package/dist/types/classes/BusinessLogicManager/Functie/FunctieNaaminternBusinessLogicRule.d.ts +18 -18
  16. package/dist/types/classes/BusinessLogicManager/Functie/FunctieTwowayBusinessLogicRule.d.ts +14 -14
  17. package/dist/types/classes/BusinessLogicManager/Materiaal/MateriaalTelexemplarenBusinessLogicRule.d.ts +15 -15
  18. package/dist/types/classes/BusinessLogicManager/Materiaal/MateriaalTypeBusinessLogicRule.d.ts +18 -18
  19. package/dist/types/classes/BusinessLogicManager/Materiaal/MateriaalVerhuurBusinessLogicRule.d.ts +18 -18
  20. package/dist/types/classes/BusinessLogicManager/Materiaal/SurfaceArticleSizeBusinessLogicRule.d.ts +19 -19
  21. package/dist/types/classes/BusinessLogicManager/OfferteContract/OfferteContractDatumBusinessLogicRule.d.ts +26 -26
  22. package/dist/types/classes/BusinessLogicManager/PlanningPersoneelTransport/PlanningPersoneelTransportBusinessLogicRule.d.ts +29 -29
  23. package/dist/types/classes/BusinessLogicManager/Project/ProjectClientNoteBusinessLogicRule.d.ts +23 -23
  24. package/dist/types/classes/BusinessLogicManager/Reparatie/ReparatieExemplaarBusinessLogicRule.d.ts +14 -14
  25. package/dist/types/classes/BusinessLogicManager/Rol/RolDocumentAccessBusinessLogicRule.d.ts +18 -18
  26. package/dist/types/classes/BusinessLogicManager/Rol/RolEditOwnDataBusinessLogicRule.d.ts +18 -18
  27. package/dist/types/classes/BusinessLogicManager/Rol/RolFileAccessBusinessLogicRule.d.ts +18 -18
  28. package/dist/types/classes/BusinessLogicManager/Rol/RolPersoneelsplannerToegangBusinessLogicRule.d.ts +18 -18
  29. package/dist/types/classes/BusinessLogicManager/Rol/RolProjectenBewerkenBusinessLogicRule.d.ts +18 -18
  30. package/dist/types/classes/BusinessLogicManager/Rol/RolProjectenToegangBusinessLogicRule.d.ts +18 -18
  31. package/dist/types/classes/CacheSyncer.d.ts +70 -70
  32. package/dist/types/classes/ChangesCompilation.d.ts +33 -33
  33. package/dist/types/classes/ChangesDelta.d.ts +65 -62
  34. package/dist/types/classes/ChangesDeltaBase.d.ts +79 -79
  35. package/dist/types/classes/ChangesProcessor.d.ts +40 -40
  36. package/dist/types/classes/CollectionEntryService.d.ts +24 -24
  37. package/dist/types/classes/CollectionResourceService.d.ts +6 -6
  38. package/dist/types/classes/ColumnCache.d.ts +19 -19
  39. package/dist/types/classes/ColumnExpansion.d.ts +19 -19
  40. package/dist/types/classes/ColumnHandler.d.ts +20 -20
  41. package/dist/types/classes/ColumnInfo.d.ts +15 -15
  42. package/dist/types/classes/ColumnSet.d.ts +37 -37
  43. package/dist/types/classes/ColumnSubsetCache.d.ts +14 -14
  44. package/dist/types/classes/ColumnUtil.d.ts +108 -108
  45. package/dist/types/classes/ConversionMapService.d.ts +25 -25
  46. package/dist/types/classes/CreateRequest.d.ts +17 -17
  47. package/dist/types/classes/CreatedChangesDelta.d.ts +17 -17
  48. package/dist/types/classes/InternalChangesDelta.d.ts +44 -44
  49. package/dist/types/classes/ItemCache.d.ts +27 -27
  50. package/dist/types/classes/ItemCreateService.d.ts +18 -18
  51. package/dist/types/classes/ItemEntryService.d.ts +32 -32
  52. package/dist/types/classes/KeyService.d.ts +18 -18
  53. package/dist/types/classes/LockService.d.ts +28 -29
  54. package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -18
  55. package/dist/types/classes/ParentChangesDelta.d.ts +41 -39
  56. package/dist/types/classes/QueryColumnExtractor.d.ts +18 -18
  57. package/dist/types/classes/QueryContainsLocalIdParser.d.ts +17 -17
  58. package/dist/types/classes/QueryLinkedToParser.d.ts +17 -17
  59. package/dist/types/classes/QueryLocallyMatchableParser.d.ts +20 -20
  60. package/dist/types/classes/QueryMatcher.d.ts +24 -24
  61. package/dist/types/classes/QueryParser.d.ts +25 -25
  62. package/dist/types/classes/QueryParserBase.d.ts +20 -20
  63. package/dist/types/classes/QueryParserIdUpdater.d.ts +17 -17
  64. package/dist/types/classes/QueryService.d.ts +12 -12
  65. package/dist/types/classes/RequestBuffer.d.ts +24 -24
  66. package/dist/types/classes/RequestBufferManager.d.ts +32 -32
  67. package/dist/types/classes/RequestColumnExpansion.d.ts +15 -15
  68. package/dist/types/classes/SocketMessageHandler.d.ts +34 -34
  69. package/dist/types/classes/TemplateCache.d.ts +62 -62
  70. package/dist/types/classes/Util.d.ts +28 -28
  71. package/dist/types/classes/cache/AbstractCache.d.ts +86 -86
  72. package/dist/types/classes/cache/CachedQueryHandlerBase.d.ts +68 -68
  73. package/dist/types/classes/cache/ItemHandlerBase.d.ts +102 -102
  74. package/dist/types/classes/cache/server/ServerCache.d.ts +78 -78
  75. package/dist/types/classes/cache/server/ServerCachedQueryHandler.d.ts +25 -25
  76. package/dist/types/classes/cache/server/ServerItemHandler.d.ts +43 -43
  77. package/dist/types/classes/cache/transaction/TransactionCache.d.ts +318 -318
  78. package/dist/types/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +37 -37
  79. package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +24 -24
  80. package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +21 -21
  81. package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +90 -90
  82. package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +33 -33
  83. package/dist/types/constants.d.ts +7 -7
  84. package/dist/types/core.d.ts +48 -48
  85. package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
  86. package/dist/types/factories/CacheSyncerFactory.d.ts +10 -10
  87. package/dist/types/factories/ChangesCompilationFactory.d.ts +5 -5
  88. package/dist/types/factories/ChangesDeltaFactory.d.ts +13 -13
  89. package/dist/types/factories/ChangesProcessorFactory.d.ts +13 -13
  90. package/dist/types/factories/CollectionEntryFactory.d.ts +11 -11
  91. package/dist/types/factories/CollectionResourceFactory.d.ts +18 -18
  92. package/dist/types/factories/ColumnExpansionFactory.d.ts +7 -7
  93. package/dist/types/factories/ColumnInfoFactory.d.ts +7 -7
  94. package/dist/types/factories/ColumnSetFactory.d.ts +18 -18
  95. package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +8 -8
  96. package/dist/types/factories/CreateRequestFactory.d.ts +9 -9
  97. package/dist/types/factories/ItemCacheFactory.d.ts +6 -6
  98. package/dist/types/factories/ItemEntryFactory.d.ts +12 -12
  99. package/dist/types/factories/ItemResourceFactory.d.ts +11 -11
  100. package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +4 -4
  101. package/dist/types/factories/QueryMatcherFactory.d.ts +7 -7
  102. package/dist/types/factories/QueryParserFactory.d.ts +5 -5
  103. package/dist/types/factories/RequestColumnExpansionFactory.d.ts +8 -8
  104. package/dist/types/factories/TemplateFactory.d.ts +8 -8
  105. package/dist/types/factories/TransactionCacheFactory.d.ts +13 -13
  106. package/dist/types/index.d.ts +1 -1
  107. package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +38 -38
  108. package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +12 -12
  109. package/dist/types/interfaces/AuthInterface.d.ts +10 -10
  110. package/dist/types/interfaces/ErrorHandlerInterface.d.ts +6 -6
  111. package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  112. package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  113. package/dist/types/interfaces/PromiseLibraryInterface.d.ts +33 -33
  114. package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +5 -5
  115. package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
  116. package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +17 -17
  117. package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +22 -22
  118. package/dist/types/internal.d.ts +128 -128
  119. package/dist/types/models/CachedQueryItem.d.ts +19 -19
  120. package/dist/types/models/CollectionEntry.d.ts +21 -21
  121. package/dist/types/models/CollectionOptions.d.ts +44 -44
  122. package/dist/types/models/CollectionResource.d.ts +87 -87
  123. package/dist/types/models/ItemEntry.d.ts +18 -18
  124. package/dist/types/models/ItemEntryOptions.d.ts +8 -8
  125. package/dist/types/models/ItemResource.d.ts +90 -90
  126. package/dist/types/models/Template.d.ts +11 -11
  127. package/dist/types/types/ItemTypesCollection.d.ts +345 -345
  128. package/dist/types/types/PromiseInterface.d.ts +2 -2
  129. package/package.json +50 -50
  130. package/readme.md +16 -16
@@ -1,79 +1,79 @@
1
- import { ApiEnumApiType, ApiEnumItemType, ApiFields, ResponseColumn } from '@rentman/backend-types';
2
- import moment from 'moment';
3
- import { ApiEnumApiTypeToTsTypeMap, ColumnInfo, FieldMap, ItemTypeColumnIds } from '../internal';
4
- declare type GetChangesResult<ItemTypeType extends ApiEnumItemType = any, ColumnId extends keyof ApiFields[ItemTypeType] = any> = {
5
- oldValue: FieldMap<ItemTypeType, [ColumnId]>[ColumnId];
6
- newValue: FieldMap<ItemTypeType, [ColumnId]>[ColumnId];
7
- column: ResponseColumn<ItemTypeType, ColumnId>;
8
- };
9
- /**
10
- * @description
11
- * A service which provides functions to transform data that comes from/goes to the API
12
- *
13
- * @warning
14
- * The code in these functions can be *very hot* on large databases, therefore performance must be kept in mind.
15
- * This is also the reason why all column types are written out instead of using the enum
16
- */
17
- export declare class ApiFormatter {
18
- MOMENT_INVALID: string;
19
- SERVER_DATETIME_FORMAT: string;
20
- SERVER_TIME_FORMAT: string;
21
- SERVER_DATE_FORMAT: string;
22
- constructor();
23
- /**
24
- * @description
25
- * Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
26
- *
27
- * ----
28
- * @remarks
29
- * Currently only used for Moment objects
30
- */
31
- isExpensiveFormat(columnType: ApiEnumApiType): boolean;
32
- /**
33
- * @description
34
- * Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same and the parent transaction
35
- * copied over the field (leaving user changes intact)
36
- *
37
- * We have to check the parent transaction because on a child transaction initial/modified can be equal (the copied field of the parent)
38
- * and will then incorrectly be overwritten by applyChangesFromParent
39
- *
40
- * Note: parentChanges can be undefined for local items
41
- */
42
- mergeCopyFields<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(parentChanges: FieldMap<ItemTypeType, ColumnIds> | undefined, changes: FieldMap<ItemTypeType, ColumnIds>, initial: FieldMap<ItemTypeType, ColumnIds>, newInitial: FieldMap<ItemTypeType, ColumnIds>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType, ColumnIds>;
43
- formatRequest<ItemTypeType extends ApiEnumItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): {
44
- [columnId: string]: any;
45
- };
46
- formatRequestLocal<ItemTypeType extends ApiEnumItemType>(fields: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): {
47
- [columnId: string]: any;
48
- };
49
- hasChanges<ItemTypeType extends ApiEnumItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[], includeReadOnlyColumns?: boolean, forceCompare?: boolean): boolean;
50
- getChanges<ItemTypeType extends ApiEnumItemType = any, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(initial: FieldMap<ItemTypeType, ColumnIds>, modified: FieldMap<ItemTypeType, ColumnIds>, columns: ColumnInfo<ItemTypeType, ColumnIds[number]>[]): GetChangesResult<ItemTypeType, ColumnIds[number]>[];
51
- copyFields<ItemTypeType extends ApiEnumItemType = any, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(source: FieldMap<ItemTypeType, ColumnIds>, destination: Partial<FieldMap<ItemTypeType>>, columns: ColumnInfo<ItemTypeType, ColumnIds[number]>[]): FieldMap<ItemTypeType, ColumnIds>;
52
- shallowCopyFields<ItemTypeType extends ApiEnumItemType>(shallowSource: FieldMap<ItemTypeType>, deepSource: FieldMap<ItemTypeType>, destination: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType>;
53
- setDefaultValues<ItemTypeType extends ApiEnumItemType = any>(destination: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType>;
54
- /**
55
- * @description
56
- * Compares the given fields, returns `true` when the fields are equal
57
- */
58
- compareFields<ColumnType extends ApiEnumApiType>(columnType: ColumnType, first?: ApiEnumApiTypeToTsTypeMap[ColumnType], second?: ApiEnumApiTypeToTsTypeMap[ColumnType]): boolean;
59
- compareFloats(a: number, b: number): boolean;
60
- compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
61
- compareDurations(first: moment.Duration, second: moment.Duration): boolean;
62
- formatResponseValue(columnType: string, value: any): any;
63
- formatRequestValue(columnType: string, value: any): any;
64
- formatResponseDate(value: null | any): moment.Moment;
65
- formatResponseDuration(value: null | number): moment.Duration;
66
- formatResponseColor(value: string): string;
67
- formatRequestDateTime(value: moment.Moment): string | null;
68
- formatRequestDate(value: moment.Moment): string | null;
69
- formatRequestDuration(value: moment.Duration): number;
70
- formatRequestColor(value: string): string;
71
- getDefaultValue(columnType: ApiEnumApiType): any;
72
- isDefaultValue(columnType: ApiEnumApiType, value: any): boolean;
73
- clone(columnType: string, value: any): any;
74
- getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
75
- cloneDuration(duration: moment.Duration): moment.Duration;
76
- cloneDate(date: moment.Moment): moment.Moment;
77
- identity<T>(input: T): T;
78
- }
79
- export {};
1
+ import { ApiEnumApiType, ApiEnumItemType, ApiFields, ResponseColumn } from '@rentman/backend-types';
2
+ import moment from 'moment';
3
+ import { ApiEnumApiTypeToTsTypeMap, ColumnInfo, FieldMap, ItemTypeColumnIds } from '../internal';
4
+ declare type GetChangesResult<ItemTypeType extends ApiEnumItemType = any, ColumnId extends keyof ApiFields[ItemTypeType] = any> = {
5
+ oldValue: FieldMap<ItemTypeType, [ColumnId]>[ColumnId];
6
+ newValue: FieldMap<ItemTypeType, [ColumnId]>[ColumnId];
7
+ column: ResponseColumn<ItemTypeType, ColumnId>;
8
+ };
9
+ /**
10
+ * @description
11
+ * A service which provides functions to transform data that comes from/goes to the API
12
+ *
13
+ * @warning
14
+ * The code in these functions can be *very hot* on large databases, therefore performance must be kept in mind.
15
+ * This is also the reason why all column types are written out instead of using the enum
16
+ */
17
+ export declare class ApiFormatter {
18
+ MOMENT_INVALID: string;
19
+ SERVER_DATETIME_FORMAT: string;
20
+ SERVER_TIME_FORMAT: string;
21
+ SERVER_DATE_FORMAT: string;
22
+ constructor();
23
+ /**
24
+ * @description
25
+ * Returns if a column type is an 'expensive' type, meaning that the action to format the field takes significant CPU time
26
+ *
27
+ * ----
28
+ * @remarks
29
+ * Currently only used for Moment objects
30
+ */
31
+ isExpensiveFormat(columnType: ApiEnumApiType): boolean;
32
+ /**
33
+ * @description
34
+ * Overwrites the values in 'changes' if the values in 'initial' and 'changes' are the same and the parent transaction
35
+ * copied over the field (leaving user changes intact)
36
+ *
37
+ * We have to check the parent transaction because on a child transaction initial/modified can be equal (the copied field of the parent)
38
+ * and will then incorrectly be overwritten by applyChangesFromParent
39
+ *
40
+ * Note: parentChanges can be undefined for local items
41
+ */
42
+ mergeCopyFields<ItemTypeType extends ApiEnumItemType, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(parentChanges: FieldMap<ItemTypeType, ColumnIds> | undefined, changes: FieldMap<ItemTypeType, ColumnIds>, initial: FieldMap<ItemTypeType, ColumnIds>, newInitial: FieldMap<ItemTypeType, ColumnIds>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType, ColumnIds>;
43
+ formatRequest<ItemTypeType extends ApiEnumItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): {
44
+ [columnId: string]: any;
45
+ };
46
+ formatRequestLocal<ItemTypeType extends ApiEnumItemType>(fields: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): {
47
+ [columnId: string]: any;
48
+ };
49
+ hasChanges<ItemTypeType extends ApiEnumItemType>(initial: FieldMap<ItemTypeType>, modified: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[], includeReadOnlyColumns?: boolean, forceCompare?: boolean): boolean;
50
+ getChanges<ItemTypeType extends ApiEnumItemType = any, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(initial: FieldMap<ItemTypeType, ColumnIds>, modified: FieldMap<ItemTypeType, ColumnIds>, columns: ColumnInfo<ItemTypeType, ColumnIds[number]>[]): GetChangesResult<ItemTypeType, ColumnIds[number]>[];
51
+ copyFields<ItemTypeType extends ApiEnumItemType = any, ColumnIds extends ItemTypeColumnIds<ItemTypeType> = any>(source: FieldMap<ItemTypeType, ColumnIds>, destination: Partial<FieldMap<ItemTypeType>>, columns: ColumnInfo<ItemTypeType, ColumnIds[number]>[]): FieldMap<ItemTypeType, ColumnIds>;
52
+ shallowCopyFields<ItemTypeType extends ApiEnumItemType>(shallowSource: FieldMap<ItemTypeType>, deepSource: FieldMap<ItemTypeType>, destination: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType>;
53
+ setDefaultValues<ItemTypeType extends ApiEnumItemType = any>(destination: FieldMap<ItemTypeType>, columns: ColumnInfo<ItemTypeType>[]): FieldMap<ItemTypeType>;
54
+ /**
55
+ * @description
56
+ * Compares the given fields, returns `true` when the fields are equal
57
+ */
58
+ compareFields<ColumnType extends ApiEnumApiType>(columnType: ColumnType, first?: ApiEnumApiTypeToTsTypeMap[ColumnType], second?: ApiEnumApiTypeToTsTypeMap[ColumnType]): boolean;
59
+ compareFloats(a: number, b: number): boolean;
60
+ compareMomentObjects(first: moment.Moment, second: moment.Moment): boolean;
61
+ compareDurations(first: moment.Duration, second: moment.Duration): boolean;
62
+ formatResponseValue(columnType: string, value: any): any;
63
+ formatRequestValue(columnType: string, value: any): any;
64
+ formatResponseDate(value: null | any): moment.Moment;
65
+ formatResponseDuration(value: null | number): moment.Duration;
66
+ formatResponseColor(value: string): string;
67
+ formatRequestDateTime(value: moment.Moment): string | null;
68
+ formatRequestDate(value: moment.Moment): string | null;
69
+ formatRequestDuration(value: moment.Duration): number;
70
+ formatRequestColor(value: string): string;
71
+ getDefaultValue(columnType: ApiEnumApiType): any;
72
+ isDefaultValue(columnType: ApiEnumApiType, value: any): boolean;
73
+ clone(columnType: string, value: any): any;
74
+ getCloneFunction(columnType: string): ((duration: moment.Duration) => moment.Duration) | ((date: moment.Moment) => moment.Moment);
75
+ cloneDuration(duration: moment.Duration): moment.Duration;
76
+ cloneDate(date: moment.Moment): moment.Moment;
77
+ identity<T>(input: T): T;
78
+ }
79
+ export {};
@@ -1,18 +1,18 @@
1
- import { ApiEnumItemType, ApiQuery, ItemId } from '@rentman/backend-types';
2
- import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ApiRequestServiceInterface, ApiResponseProcessor, ApiResponseProcessorFactory, PromiseInterface } from '../internal';
3
- export declare class ApiRequestService {
4
- private externalApiRequestService;
5
- private apiResponseProcessorFactory;
6
- constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
7
- template(itemType: ApiEnumItemType, params: any): PromiseInterface<ApiResponseProcessor>;
8
- create(itemType: ApiEnumItemType, itemId: ItemId, values: any, parentType?: ApiEnumItemType, parentId?: ItemId): PromiseInterface<ApiResponseProcessor>;
9
- delete(itemType: ApiEnumItemType, itemIds: ItemId[]): PromiseInterface<ApiResponseProcessor>;
10
- updateItems(itemType: ApiEnumItemType, items: ApiRequestItemMap, columns: any): PromiseInterface<ApiResponseProcessor>;
11
- requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<ApiResponseProcessor>;
12
- moveItems(parentType: ApiEnumItemType, parentId: ItemId, items: {
13
- [itemType: string]: ItemId[];
14
- }): PromiseInterface<ApiResponseProcessor>;
15
- columns(itemType: ApiEnumItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<ApiResponseProcessor>;
16
- query<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery<ItemTypeType>, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<ApiResponseProcessor>;
17
- processResponse(request: any): PromiseInterface<ApiResponseProcessor>;
18
- }
1
+ import { ApiEnumItemType, ApiQuery, ItemId } from '@rentman/backend-types';
2
+ import { ApiRequestColumnMap, ApiRequestItemMap, ApiRequestLimit, ApiRequestServiceInterface, ApiResponseProcessor, ApiResponseProcessorFactory, PromiseInterface } from '../internal';
3
+ export declare class ApiRequestService {
4
+ private externalApiRequestService;
5
+ private apiResponseProcessorFactory;
6
+ constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
7
+ template(itemType: ApiEnumItemType, params: any): PromiseInterface<ApiResponseProcessor>;
8
+ create(itemType: ApiEnumItemType, itemId: ItemId, values: any, parentType?: ApiEnumItemType, parentId?: ItemId): PromiseInterface<ApiResponseProcessor>;
9
+ delete(itemType: ApiEnumItemType, itemIds: ItemId[]): PromiseInterface<ApiResponseProcessor>;
10
+ updateItems(itemType: ApiEnumItemType, items: ApiRequestItemMap, columns: any): PromiseInterface<ApiResponseProcessor>;
11
+ requestSkeleton(params: any, requestCanceler?: PromiseInterface<any>): PromiseInterface<ApiResponseProcessor>;
12
+ moveItems(parentType: ApiEnumItemType, parentId: ItemId, items: {
13
+ [itemType: string]: ItemId[];
14
+ }): PromiseInterface<ApiResponseProcessor>;
15
+ columns(itemType: ApiEnumItemType, columns: ApiRequestColumnMap, params?: any): PromiseInterface<ApiResponseProcessor>;
16
+ query<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery<ItemTypeType>, columns: ApiRequestColumnMap, limit?: ApiRequestLimit): PromiseInterface<ApiResponseProcessor>;
17
+ processResponse(request: any): PromiseInterface<ApiResponseProcessor>;
18
+ }
@@ -1,29 +1,29 @@
1
- import { ApiEnumItemType, ItemId, ResponseColumn } from '@rentman/backend-types';
2
- import { ApiFormatter, ApiResponse, ColumnInfo, FieldMap, ItemTypeMap, ResponseColumnItemTypeMap, ResponseColumnMap } from '../internal';
3
- export declare class ApiResponseProcessor<RequestItemType extends ApiEnumItemType = any> {
4
- apiFormatter: ApiFormatter;
5
- response: ApiResponse;
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: ApiResponse);
19
- fetchColumnObject(itemType: ApiEnumItemType): ResponseColumnMap;
20
- fetchValue(itemType: ApiEnumItemType, itemId: ItemId, columnId: string): any;
21
- fetchColumnArray(itemType: ApiEnumItemType): ResponseColumn[];
22
- fetchDerivedObject(itemType: ApiEnumItemType, itemId: ItemId, rootColumns: ColumnInfo[]): {};
23
- fetchDerivedValues(value: any, column: ColumnInfo, destination: any): void;
24
- fetchObject<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: string | ItemId): FieldMap<ItemTypeType> | undefined;
25
- fetchObjectArray<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, idArray?: ItemId[] | null): FieldMap<ItemTypeType>[];
26
- fetchColumnsObject(): ResponseColumnItemTypeMap;
27
- private addLazyFormattingFunction;
28
- private createColumnMaps;
29
- }
1
+ import { ApiEnumItemType, ItemId, ResponseColumn } from '@rentman/backend-types';
2
+ import { ApiFormatter, ApiResponse, ColumnInfo, FieldMap, ItemTypeMap, ResponseColumnItemTypeMap, ResponseColumnMap } from '../internal';
3
+ export declare class ApiResponseProcessor<RequestItemType extends ApiEnumItemType = any> {
4
+ apiFormatter: ApiFormatter;
5
+ response: ApiResponse;
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: ApiResponse);
19
+ fetchColumnObject(itemType: ApiEnumItemType): ResponseColumnMap;
20
+ fetchValue(itemType: ApiEnumItemType, itemId: ItemId, columnId: string): any;
21
+ fetchColumnArray(itemType: ApiEnumItemType): ResponseColumn[];
22
+ fetchDerivedObject(itemType: ApiEnumItemType, itemId: ItemId, rootColumns: ColumnInfo[]): {};
23
+ fetchDerivedValues(value: any, column: ColumnInfo, destination: any): void;
24
+ fetchObject<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: string | ItemId): FieldMap<ItemTypeType> | undefined;
25
+ fetchObjectArray<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, idArray?: ItemId[] | null): FieldMap<ItemTypeType>[];
26
+ fetchColumnsObject(): ResponseColumnItemTypeMap;
27
+ private addLazyFormattingFunction;
28
+ private createColumnMaps;
29
+ }
@@ -1,98 +1,98 @@
1
- import { ApiModuleFunctionLocalsGetLocals } from '@rentman/backend-types';
2
- import { ChangesDeltaFactory } from '../../factories/ChangesDeltaFactory';
3
- import { ErrorHandlerInterface } from '../../interfaces/ErrorHandlerInterface';
4
- import { PromiseLibraryInterface } from '../../interfaces/PromiseLibraryInterface';
5
- import { PromiseInterface } from '../../types/PromiseInterface';
6
- import { ApiFormatter } from '../ApiFormatter';
7
- import { TransactionCache } from '../cache/transaction/TransactionCache';
8
- import { ChangesDelta } from '../ChangesDelta';
9
- import { CustomFieldTypeBusinessLogicRule } from './Customfield/CustomFieldTypeBusinessLogicRule';
10
- import { DocumentTemplateBusinessLogicRule } from './Documents/DocumentTemplateBusinessLogicRule';
11
- import { ExemplaarAanschafdatumBusinessLogicRule } from './Exemplaar/ExemplaarAanschafdatumBusinessLogicRule';
12
- import { FactuurBetalingsconditieBusinessLogicRule } from './Factuur/FactuurBetalingsconditieBusinessLogicRule';
13
- import { FactuurDatumBusinessLogicRule } from './Factuur/FactuurDatumBusinessLogicRule';
14
- import { FactuurNumberseriesBusinessLogicRule } from './Factuur/FactuurNumberseriesBusinessLogicRule';
15
- import { FunctieNaaminternBusinessLogicRule } from './Functie/FunctieNaaminternBusinessLogicRule';
16
- import { FunctieTwowayBusinessLogicRule } from './Functie/FunctieTwowayBusinessLogicRule';
17
- import { MateriaalTelexemplarenBusinessLogicRule } from './Materiaal/MateriaalTelexemplarenBusinessLogicRule';
18
- import { MateriaalTypeBusinessLogicRule } from './Materiaal/MateriaalTypeBusinessLogicRule';
19
- import { MateriaalVerhuurBusinessLogicRule } from './Materiaal/MateriaalVerhuurBusinessLogicRule';
20
- import { SurfaceArticleSizeBusinessLogicRule } from './Materiaal/SurfaceArticleSizeBusinessLogicRule';
21
- import { OfferteContractDatumBusinessLogicRule } from './OfferteContract/OfferteContractDatumBusinessLogicRule';
22
- import { PlanningPersoneelTransportBusinessLogicRule } from './PlanningPersoneelTransport/PlanningPersoneelTransportBusinessLogicRule';
23
- import { ProjectClientNoteBusinessLogicRule } from './Project/ProjectClientNoteBusinessLogicRule';
24
- import { ReparatieAanschafdatumBusinessLogicRule } from './Reparatie/ReparatieExemplaarBusinessLogicRule';
25
- import { RolDocumentAccessBusinessLogicRule } from './Rol/RolDocumentAccessBusinessLogicRule';
26
- import { RolEditOwnDataBusinessLogicRule } from './Rol/RolEditOwnDataBusinessLogicRule';
27
- import { RolFileAccessBusinessLogicRule } from './Rol/RolFileAccessBusinessLogicRule';
28
- import { RolPersoneelsplannerToegangBusinessLogicRule } from './Rol/RolPersoneelsplannerToegangBusinessLogicRule';
29
- import { RolProjectenBewerkenBusinessLogicRule } from './Rol/RolProjectenBewerkenBusinessLogicRule';
30
- import { RolProjectenToegangBusinessLogicRule } from './Rol/RolProjectenToegangBusinessLogicRule';
31
- /**
32
- * @description
33
- * The BusinessLogicManager is responsible for calling all business rules with a ChangesDelta and storing their results for the {@link BusinessLogicRule business logic phases}.
34
- */
35
- export declare class BusinessLogicManager {
36
- private apiFormatter;
37
- private changesDeltaFactory;
38
- private errorHandler;
39
- private promiseLibrary;
40
- private locals;
41
- /**
42
- * @description
43
- * The business rules are stored in a map so that the core-consumer can overwrite the {@link BusinessLogicRule.confirmFn confirmFn} to show a confirmation
44
- *
45
- * @remark
46
- * This property is intentionally not typed so that the keys can be inferred
47
- *
48
- * @private
49
- */
50
- allBusinessRules: {
51
- FunctieTwowayBusinessLogicRule: FunctieTwowayBusinessLogicRule;
52
- FunctieNaaminternBusinessLogicRule: FunctieNaaminternBusinessLogicRule;
53
- CustomFieldTypeBusinessLogicRule: CustomFieldTypeBusinessLogicRule;
54
- RolDocumentAccessBusinessLogicRule: RolDocumentAccessBusinessLogicRule;
55
- RolEditOwnDataBusinessLogicRule: RolEditOwnDataBusinessLogicRule;
56
- RolFileAccessBusinessLogicRule: RolFileAccessBusinessLogicRule;
57
- RolPersoneelsplannerToegangBusinessLogicRule: RolPersoneelsplannerToegangBusinessLogicRule;
58
- RolProjectenBewerkenBusinessLogicRule: RolProjectenBewerkenBusinessLogicRule;
59
- RolProjectenToegangBusinessLogicRule: RolProjectenToegangBusinessLogicRule;
60
- ExemplaarAanschafdatumBusinessLogicRule: ExemplaarAanschafdatumBusinessLogicRule;
61
- ReparatieAanschafdatumBusinessLogicRule: ReparatieAanschafdatumBusinessLogicRule;
62
- MateriaalVerhuurBusinessLogicRule: MateriaalVerhuurBusinessLogicRule;
63
- MateriaalTypeBusinessLogicRule: MateriaalTypeBusinessLogicRule;
64
- SurfaceArticleSizeBusinessLogicRule: SurfaceArticleSizeBusinessLogicRule;
65
- MateriaalTelexemplarenBusinessLogicRule: MateriaalTelexemplarenBusinessLogicRule;
66
- PlanningPersoneelTransportBusinessLogicRule: PlanningPersoneelTransportBusinessLogicRule;
67
- ProjectClientNoteBusinessLogicRule: ProjectClientNoteBusinessLogicRule;
68
- FactuurNumberseriesBusinessLogicRule: FactuurNumberseriesBusinessLogicRule;
69
- FactuurBetalingsconditieBusinessLogicRule: FactuurBetalingsconditieBusinessLogicRule;
70
- FactuurDatumBusinessLogicRule: FactuurDatumBusinessLogicRule;
71
- OfferteContractDatumBusinessLogicRule: OfferteContractDatumBusinessLogicRule;
72
- DocumentTemplateBusinessLogicRule: DocumentTemplateBusinessLogicRule;
73
- };
74
- constructor(apiFormatter: ApiFormatter, changesDeltaFactory: ChangesDeltaFactory, errorHandler: ErrorHandlerInterface, promiseLibrary: PromiseLibraryInterface, locals: ApiModuleFunctionLocalsGetLocals);
75
- /**
76
- * @description
77
- * Handles the business logic for a given ChangesDelta. It will provide a *new* ChangesDelta on which the business rules can apply their data, so that
78
- * if new changes are made on *only those new changes* the business logic can be run again.
79
- *
80
- * example:
81
- * - `Functie.twoway` changes the `Functie.afstand` field
82
- * - In a second iteration (recursive call) the `Functie.afstand` field updates `Functie.prijs`
83
- * (by doing `Functie.afstand` * `Functie.kilometerprijs`)
84
- * - In a third iteration (2nd recursive call) the `Functie.kilometerprijs` has no business logic, so the function
85
- * exits early (`rulesToRun.size === 0`) and the recursion ends
86
- *
87
- * @param transaction The transaction the ChangesDelta will be applied on
88
- * @param changesDelta The source ChangesDelta which contains the changes the rules should be checked on
89
- *
90
- * @private should only be called by the core
91
- */
92
- handleBusinessLogic(transaction: TransactionCache, changesDelta: ChangesDelta): PromiseInterface<ChangesDelta>;
93
- private waitForRuleApplication;
94
- private waitForRuleDependencies;
95
- private waitForRuleDependency;
96
- private extractRulesToRun;
97
- private extractRuleToRun;
98
- }
1
+ import { ApiModuleFunctionLocalsGetLocals } from '@rentman/backend-types';
2
+ import { ChangesDeltaFactory } from '../../factories/ChangesDeltaFactory';
3
+ import { ErrorHandlerInterface } from '../../interfaces/ErrorHandlerInterface';
4
+ import { PromiseLibraryInterface } from '../../interfaces/PromiseLibraryInterface';
5
+ import { PromiseInterface } from '../../types/PromiseInterface';
6
+ import { ApiFormatter } from '../ApiFormatter';
7
+ import { TransactionCache } from '../cache/transaction/TransactionCache';
8
+ import { ChangesDelta } from '../ChangesDelta';
9
+ import { CustomFieldTypeBusinessLogicRule } from './Customfield/CustomFieldTypeBusinessLogicRule';
10
+ import { DocumentTemplateBusinessLogicRule } from './Documents/DocumentTemplateBusinessLogicRule';
11
+ import { ExemplaarAanschafdatumBusinessLogicRule } from './Exemplaar/ExemplaarAanschafdatumBusinessLogicRule';
12
+ import { FactuurBetalingsconditieBusinessLogicRule } from './Factuur/FactuurBetalingsconditieBusinessLogicRule';
13
+ import { FactuurDatumBusinessLogicRule } from './Factuur/FactuurDatumBusinessLogicRule';
14
+ import { FactuurNumberseriesBusinessLogicRule } from './Factuur/FactuurNumberseriesBusinessLogicRule';
15
+ import { FunctieNaaminternBusinessLogicRule } from './Functie/FunctieNaaminternBusinessLogicRule';
16
+ import { FunctieTwowayBusinessLogicRule } from './Functie/FunctieTwowayBusinessLogicRule';
17
+ import { MateriaalTelexemplarenBusinessLogicRule } from './Materiaal/MateriaalTelexemplarenBusinessLogicRule';
18
+ import { MateriaalTypeBusinessLogicRule } from './Materiaal/MateriaalTypeBusinessLogicRule';
19
+ import { MateriaalVerhuurBusinessLogicRule } from './Materiaal/MateriaalVerhuurBusinessLogicRule';
20
+ import { SurfaceArticleSizeBusinessLogicRule } from './Materiaal/SurfaceArticleSizeBusinessLogicRule';
21
+ import { OfferteContractDatumBusinessLogicRule } from './OfferteContract/OfferteContractDatumBusinessLogicRule';
22
+ import { PlanningPersoneelTransportBusinessLogicRule } from './PlanningPersoneelTransport/PlanningPersoneelTransportBusinessLogicRule';
23
+ import { ProjectClientNoteBusinessLogicRule } from './Project/ProjectClientNoteBusinessLogicRule';
24
+ import { ReparatieAanschafdatumBusinessLogicRule } from './Reparatie/ReparatieExemplaarBusinessLogicRule';
25
+ import { RolDocumentAccessBusinessLogicRule } from './Rol/RolDocumentAccessBusinessLogicRule';
26
+ import { RolEditOwnDataBusinessLogicRule } from './Rol/RolEditOwnDataBusinessLogicRule';
27
+ import { RolFileAccessBusinessLogicRule } from './Rol/RolFileAccessBusinessLogicRule';
28
+ import { RolPersoneelsplannerToegangBusinessLogicRule } from './Rol/RolPersoneelsplannerToegangBusinessLogicRule';
29
+ import { RolProjectenBewerkenBusinessLogicRule } from './Rol/RolProjectenBewerkenBusinessLogicRule';
30
+ import { RolProjectenToegangBusinessLogicRule } from './Rol/RolProjectenToegangBusinessLogicRule';
31
+ /**
32
+ * @description
33
+ * The BusinessLogicManager is responsible for calling all business rules with a ChangesDelta and storing their results for the {@link BusinessLogicRule business logic phases}.
34
+ */
35
+ export declare class BusinessLogicManager {
36
+ private apiFormatter;
37
+ private changesDeltaFactory;
38
+ private errorHandler;
39
+ private promiseLibrary;
40
+ private locals;
41
+ /**
42
+ * @description
43
+ * The business rules are stored in a map so that the core-consumer can overwrite the {@link BusinessLogicRule.confirmFn confirmFn} to show a confirmation
44
+ *
45
+ * @remark
46
+ * This property is intentionally not typed so that the keys can be inferred
47
+ *
48
+ * @private
49
+ */
50
+ allBusinessRules: {
51
+ FunctieTwowayBusinessLogicRule: FunctieTwowayBusinessLogicRule;
52
+ FunctieNaaminternBusinessLogicRule: FunctieNaaminternBusinessLogicRule;
53
+ CustomFieldTypeBusinessLogicRule: CustomFieldTypeBusinessLogicRule;
54
+ RolDocumentAccessBusinessLogicRule: RolDocumentAccessBusinessLogicRule;
55
+ RolEditOwnDataBusinessLogicRule: RolEditOwnDataBusinessLogicRule;
56
+ RolFileAccessBusinessLogicRule: RolFileAccessBusinessLogicRule;
57
+ RolPersoneelsplannerToegangBusinessLogicRule: RolPersoneelsplannerToegangBusinessLogicRule;
58
+ RolProjectenBewerkenBusinessLogicRule: RolProjectenBewerkenBusinessLogicRule;
59
+ RolProjectenToegangBusinessLogicRule: RolProjectenToegangBusinessLogicRule;
60
+ ExemplaarAanschafdatumBusinessLogicRule: ExemplaarAanschafdatumBusinessLogicRule;
61
+ ReparatieAanschafdatumBusinessLogicRule: ReparatieAanschafdatumBusinessLogicRule;
62
+ MateriaalVerhuurBusinessLogicRule: MateriaalVerhuurBusinessLogicRule;
63
+ MateriaalTypeBusinessLogicRule: MateriaalTypeBusinessLogicRule;
64
+ SurfaceArticleSizeBusinessLogicRule: SurfaceArticleSizeBusinessLogicRule;
65
+ MateriaalTelexemplarenBusinessLogicRule: MateriaalTelexemplarenBusinessLogicRule;
66
+ PlanningPersoneelTransportBusinessLogicRule: PlanningPersoneelTransportBusinessLogicRule;
67
+ ProjectClientNoteBusinessLogicRule: ProjectClientNoteBusinessLogicRule;
68
+ FactuurNumberseriesBusinessLogicRule: FactuurNumberseriesBusinessLogicRule;
69
+ FactuurBetalingsconditieBusinessLogicRule: FactuurBetalingsconditieBusinessLogicRule;
70
+ FactuurDatumBusinessLogicRule: FactuurDatumBusinessLogicRule;
71
+ OfferteContractDatumBusinessLogicRule: OfferteContractDatumBusinessLogicRule;
72
+ DocumentTemplateBusinessLogicRule: DocumentTemplateBusinessLogicRule;
73
+ };
74
+ constructor(apiFormatter: ApiFormatter, changesDeltaFactory: ChangesDeltaFactory, errorHandler: ErrorHandlerInterface, promiseLibrary: PromiseLibraryInterface, locals: ApiModuleFunctionLocalsGetLocals);
75
+ /**
76
+ * @description
77
+ * Handles the business logic for a given ChangesDelta. It will provide a *new* ChangesDelta on which the business rules can apply their data, so that
78
+ * if new changes are made on *only those new changes* the business logic can be run again.
79
+ *
80
+ * example:
81
+ * - `Functie.twoway` changes the `Functie.afstand` field
82
+ * - In a second iteration (recursive call) the `Functie.afstand` field updates `Functie.prijs`
83
+ * (by doing `Functie.afstand` * `Functie.kilometerprijs`)
84
+ * - In a third iteration (2nd recursive call) the `Functie.kilometerprijs` has no business logic, so the function
85
+ * exits early (`rulesToRun.size === 0`) and the recursion ends
86
+ *
87
+ * @param transaction The transaction the ChangesDelta will be applied on
88
+ * @param changesDelta The source ChangesDelta which contains the changes the rules should be checked on
89
+ *
90
+ * @private should only be called by the core
91
+ */
92
+ handleBusinessLogic(transaction: TransactionCache, changesDelta: ChangesDelta): PromiseInterface<ChangesDelta>;
93
+ private waitForRuleApplication;
94
+ private waitForRuleDependencies;
95
+ private waitForRuleDependency;
96
+ private extractRulesToRun;
97
+ private extractRuleToRun;
98
+ }