@rentman/rm-core 4.0.3 → 4.0.4
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.
- package/changelog.md +695 -692
- package/dist/rm-core.js +9496 -9488
- package/dist/rm-core.min.js +2 -2
- package/dist/types/classes/ApiFormatter.d.ts +55 -55
- package/dist/types/classes/ApiRequestService.d.ts +20 -20
- package/dist/types/classes/ApiResponseProcessor.d.ts +31 -31
- package/dist/types/classes/ChangesCompilation.d.ts +34 -34
- package/dist/types/classes/ChangesDelta.d.ts +59 -59
- package/dist/types/classes/ChangesDeltaBase.d.ts +50 -50
- package/dist/types/classes/ChangesProcessor.d.ts +47 -47
- package/dist/types/classes/CollectionCache.d.ts +38 -38
- package/dist/types/classes/CollectionEntryService.d.ts +25 -25
- package/dist/types/classes/CollectionMatcher.d.ts +9 -9
- package/dist/types/classes/CollectionMatcherBase.d.ts +26 -26
- package/dist/types/classes/CollectionResourceService.d.ts +6 -6
- package/dist/types/classes/ColumnCache.d.ts +21 -21
- package/dist/types/classes/ColumnExpansion.d.ts +22 -22
- package/dist/types/classes/ColumnHandler.d.ts +21 -21
- package/dist/types/classes/ColumnInfo.d.ts +14 -14
- package/dist/types/classes/ColumnSet.d.ts +39 -39
- package/dist/types/classes/ColumnSubsetCache.d.ts +8 -8
- package/dist/types/classes/ColumnUtil.d.ts +99 -99
- package/dist/types/classes/ConversionMapService.d.ts +27 -27
- package/dist/types/classes/CreateRequest.d.ts +19 -19
- package/dist/types/classes/CreatedChangesDelta.d.ts +15 -15
- package/dist/types/classes/InternalChangesDelta.d.ts +39 -39
- package/dist/types/classes/ItemCache.d.ts +29 -29
- package/dist/types/classes/ItemCreateService.d.ts +24 -24
- package/dist/types/classes/ItemEntryService.d.ts +34 -34
- package/dist/types/classes/KeyService.d.ts +16 -16
- package/dist/types/classes/LockService.d.ts +32 -32
- package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -18
- package/dist/types/classes/QueryColumnExtractor.d.ts +20 -20
- package/dist/types/classes/QueryLocalLinkedToParser.d.ts +17 -17
- package/dist/types/classes/QueryMatcher.d.ts +14 -14
- package/dist/types/classes/QueryParser.d.ts +25 -25
- package/dist/types/classes/QueryParserBase.d.ts +29 -29
- package/dist/types/classes/QueryService.d.ts +17 -17
- package/dist/types/classes/RequestBuffer.d.ts +28 -28
- package/dist/types/classes/RequestBufferManager.d.ts +24 -24
- package/dist/types/classes/RequestColumnExpansion.d.ts +15 -15
- package/dist/types/classes/SocketMessageHandler.d.ts +31 -31
- package/dist/types/classes/TemplateCache.d.ts +66 -66
- package/dist/types/classes/Util.d.ts +30 -30
- package/dist/types/classes/cache/AbstractCache.d.ts +101 -101
- package/dist/types/classes/cache/CollectionHandlerBase.d.ts +68 -68
- package/dist/types/classes/cache/CollectionMatcherCacheProcessor.d.ts +26 -26
- package/dist/types/classes/cache/ItemHandlerBase.d.ts +95 -95
- package/dist/types/classes/cache/server/ServerCache.d.ts +83 -83
- package/dist/types/classes/cache/server/ServerCollectionHandler.d.ts +44 -44
- package/dist/types/classes/cache/server/ServerItemHandler.d.ts +51 -51
- package/dist/types/classes/cache/transaction/TransactionCache.d.ts +336 -336
- package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +62 -62
- package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +24 -24
- package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +90 -90
- package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +28 -28
- package/dist/types/classes/index.d.ts +46 -46
- package/dist/types/constants.d.ts +7 -7
- package/dist/types/core.d.ts +52 -52
- package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
- package/dist/types/factories/ChangesCompilationFactory.d.ts +6 -6
- package/dist/types/factories/ChangesDeltaFactory.d.ts +11 -11
- package/dist/types/factories/ChangesProcessorFactory.d.ts +22 -22
- package/dist/types/factories/CollectionCacheFactory.d.ts +8 -8
- package/dist/types/factories/CollectionEntryFactory.d.ts +11 -11
- package/dist/types/factories/CollectionMatcherFactory.d.ts +9 -9
- package/dist/types/factories/CollectionResourceFactory.d.ts +16 -16
- package/dist/types/factories/ColumnExpansionFactory.d.ts +8 -8
- package/dist/types/factories/ColumnInfoFactory.d.ts +7 -7
- package/dist/types/factories/ColumnSetFactory.d.ts +19 -19
- package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +6 -6
- package/dist/types/factories/CreateRequestFactory.d.ts +11 -11
- package/dist/types/factories/ItemCacheFactory.d.ts +8 -8
- package/dist/types/factories/ItemEntryFactory.d.ts +15 -15
- package/dist/types/factories/ItemResourceFactory.d.ts +14 -14
- package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +5 -5
- package/dist/types/factories/QueryMatcherFactory.d.ts +7 -7
- package/dist/types/factories/QueryParserFactory.d.ts +6 -6
- package/dist/types/factories/RequestColumnExpansionFactory.d.ts +6 -6
- package/dist/types/factories/TemplateFactory.d.ts +10 -10
- package/dist/types/factories/TransactionCacheFactory.d.ts +15 -15
- package/dist/types/factories/index.d.ts +22 -22
- package/dist/types/index.d.ts +7 -7
- package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +44 -44
- package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +11 -11
- package/dist/types/interfaces/AuthInterface.d.ts +9 -9
- package/dist/types/interfaces/ErrorHandlerInterface.d.ts +5 -5
- package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
- package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
- package/dist/types/interfaces/PromiseLibraryInterface.d.ts +25 -25
- package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +7 -7
- package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +21 -21
- package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +26 -26
- package/dist/types/interfaces/index.d.ts +11 -11
- package/dist/types/models/CollectionEntry.d.ts +27 -27
- package/dist/types/models/CollectionEntryOptions.d.ts +13 -13
- package/dist/types/models/CollectionResource.d.ts +63 -63
- package/dist/types/models/CollectionResourceOptions.d.ts +23 -23
- package/dist/types/models/ItemEntry.d.ts +19 -19
- package/dist/types/models/ItemEntryOptions.d.ts +8 -8
- package/dist/types/models/ItemResource.d.ts +84 -84
- package/dist/types/models/Template.d.ts +11 -11
- package/dist/types/models/index.d.ts +8 -8
- package/dist/types/types/ItemTypesCollection.d.ts +263 -263
- package/dist/types/types/PromiseInterface.d.ts +2 -2
- package/dist/types/types/index.d.ts +2 -2
- package/package.json +36 -36
- package/readme.md +15 -15
|
@@ -1,263 +1,263 @@
|
|
|
1
|
-
import { ApiResponseProcessor, CollectionMatcher, ColumnSet, RequestColumnExpansion } from '../classes';
|
|
2
|
-
import { CollectionEntry, CollectionEntryOptions, CollectionEntryOptionsInterface, CollectionResource, CollectionResourceOptions, CollectionResourceOptionsInterface, ItemEntry, ItemEntryOptionsInterface, ItemResource } from '../models';
|
|
3
|
-
export declare type EntryParent = {
|
|
4
|
-
itemType: string;
|
|
5
|
-
itemId: number;
|
|
6
|
-
};
|
|
7
|
-
export declare type EntryParentNull = EntryParent | null;
|
|
8
|
-
/**
|
|
9
|
-
* @description
|
|
10
|
-
* Used for fields that belong to a specific itemType
|
|
11
|
-
*/
|
|
12
|
-
export declare type FieldMap<_ItemTypeType extends ItemType = any> = {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
};
|
|
15
|
-
export declare type ItemOptionsInterface = ItemEntryOptionsInterface;
|
|
16
|
-
export declare type CollectionOptionsInterface<ItemTypeType extends ItemType = any> = CollectionEntryOptionsInterface & CollectionResourceOptionsInterface<ItemTypeType>;
|
|
17
|
-
export interface CollectionDefinition<ItemTypeType extends ItemType = any> {
|
|
18
|
-
itemType: ItemTypeType;
|
|
19
|
-
options: {
|
|
20
|
-
entry: CollectionEntryOptions;
|
|
21
|
-
resource: CollectionResourceOptions<ItemTypeType>;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export interface LinkCollectionDefinition<ItemTypeType extends ItemType = any> extends CollectionDefinition<ItemTypeType> {
|
|
25
|
-
linkField: string;
|
|
26
|
-
}
|
|
27
|
-
export declare enum StateKeyType {
|
|
28
|
-
New = "new",
|
|
29
|
-
Duplicate = "duplicate"
|
|
30
|
-
}
|
|
31
|
-
export declare type StateKey = {
|
|
32
|
-
type: StateKeyType;
|
|
33
|
-
template?: string;
|
|
34
|
-
itemId?: number;
|
|
35
|
-
};
|
|
36
|
-
export declare type SocketMessageType = 'event' | 'notification';
|
|
37
|
-
export interface SocketMessage {
|
|
38
|
-
header: {
|
|
39
|
-
domain: string;
|
|
40
|
-
account: string;
|
|
41
|
-
sender: {
|
|
42
|
-
displayname: string;
|
|
43
|
-
itemType: 'Medewerker';
|
|
44
|
-
itemId: ItemId;
|
|
45
|
-
authorized: boolean;
|
|
46
|
-
session: string;
|
|
47
|
-
};
|
|
48
|
-
messageId: {
|
|
49
|
-
Id: string;
|
|
50
|
-
sequence: number;
|
|
51
|
-
batch: number;
|
|
52
|
-
request: number;
|
|
53
|
-
};
|
|
54
|
-
sent: string;
|
|
55
|
-
forceEvaluate: boolean;
|
|
56
|
-
};
|
|
57
|
-
body: any;
|
|
58
|
-
messageType: SocketMessageType;
|
|
59
|
-
}
|
|
60
|
-
export interface SocketMessageCreate extends SocketMessage {
|
|
61
|
-
body: {
|
|
62
|
-
eventType: 'create';
|
|
63
|
-
columns: ResponseColumnItemTypeMap;
|
|
64
|
-
itemType: ItemType;
|
|
65
|
-
items: {
|
|
66
|
-
[itemType: string]: {
|
|
67
|
-
[itemId: number]: {
|
|
68
|
-
parent: null | EntryParent;
|
|
69
|
-
values: FieldMap;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
export interface SocketMessageUpdate extends SocketMessage {
|
|
76
|
-
body: {
|
|
77
|
-
eventType: 'update';
|
|
78
|
-
columns: ResponseColumnItemTypeMap;
|
|
79
|
-
itemType: ItemType;
|
|
80
|
-
items: {
|
|
81
|
-
[itemType: string]: {
|
|
82
|
-
[itemId: number]: {
|
|
83
|
-
parent: null | EntryParent;
|
|
84
|
-
values: FieldMap;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
export interface SocketMessageLinkTo extends SocketMessage {
|
|
91
|
-
body: {
|
|
92
|
-
eventType: 'linkto';
|
|
93
|
-
columns: ResponseColumnItemTypeMap;
|
|
94
|
-
itemType: ItemType;
|
|
95
|
-
items: {
|
|
96
|
-
[itemType: string]: {
|
|
97
|
-
[itemId: number]: {
|
|
98
|
-
parent: null | EntryParent;
|
|
99
|
-
values: FieldMap;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
export interface SocketMessageDelete extends SocketMessage {
|
|
106
|
-
body: {
|
|
107
|
-
eventType: 'delete';
|
|
108
|
-
itemType: ItemType;
|
|
109
|
-
items: ItemId[];
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
export interface FunctionChangesResolveSocketMessage extends SocketMessage {
|
|
113
|
-
body: {
|
|
114
|
-
itemType: 'FunctionChangesResolve';
|
|
115
|
-
[key: string]: any;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
export declare type ItemResourceItemIdMap<T extends ItemResource<any> = ItemResource<any>> = {
|
|
119
|
-
[itemId: number]: T;
|
|
120
|
-
};
|
|
121
|
-
export declare type ItemResourcesItemTypeMap<T extends ItemResource<any> = ItemResource<any>> = {
|
|
122
|
-
[itemType: string]: T[];
|
|
123
|
-
};
|
|
124
|
-
export declare type ItemId = number;
|
|
125
|
-
export declare type ItemType = string;
|
|
126
|
-
export declare type ItemMap<T> = {
|
|
127
|
-
[itemType: string]: {
|
|
128
|
-
[itemId: string]: T;
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
export declare type ItemEntryMap<ItemTypeType extends ItemType> = ItemMap<ItemEntry<ItemTypeType>>;
|
|
132
|
-
export declare type ItemEntryParentIdMap<ItemTypeType extends ItemType> = {
|
|
133
|
-
[parentId: number]: Array<ItemEntry<ItemTypeType>>;
|
|
134
|
-
};
|
|
135
|
-
export declare type ConversionMap = {
|
|
136
|
-
[itemId: number]: number;
|
|
137
|
-
};
|
|
138
|
-
export declare type ItemIdConversionMap = {
|
|
139
|
-
[itemType: string]: ConversionMap;
|
|
140
|
-
};
|
|
141
|
-
export declare type CreateRequestParameterMap<T = any> = ItemMap<T>;
|
|
142
|
-
export declare type ItemError = {
|
|
143
|
-
message: string;
|
|
144
|
-
};
|
|
145
|
-
export declare type QueryParams = any;
|
|
146
|
-
export declare type CollectionQuery = {
|
|
147
|
-
object: object;
|
|
148
|
-
string: string;
|
|
149
|
-
};
|
|
150
|
-
export declare type QueryCallback = (queryParams: QueryParams) => QueryParams;
|
|
151
|
-
export declare type CollectionEntryParentIdMap<ItemTypeType extends ItemType> = {
|
|
152
|
-
[parentId: number]: CollectionEntry<ItemTypeType>;
|
|
153
|
-
};
|
|
154
|
-
export declare type CollectionResourceParentIdMap<ItemTypeType extends ItemType = any> = {
|
|
155
|
-
[parentId: number]: CollectionResource<ItemTypeType>;
|
|
156
|
-
};
|
|
157
|
-
export declare type CollectionMatchResult<ItemTypeType extends ItemType> = {
|
|
158
|
-
fitting: Array<CollectionEntry<ItemTypeType>>;
|
|
159
|
-
notfitting: Array<CollectionEntry<ItemTypeType>>;
|
|
160
|
-
maybe: Array<CollectionEntry<ItemTypeType>>;
|
|
161
|
-
};
|
|
162
|
-
export interface ExtendedCollectionMatchResult<ItemTypeType extends ItemType> extends CollectionMatchResult<ItemTypeType> {
|
|
163
|
-
collection: CollectionEntry<ItemTypeType>;
|
|
164
|
-
}
|
|
165
|
-
export interface GroupedExtendedCollectionMatchResult<ItemTypeType extends ItemType> {
|
|
166
|
-
[collectionId: number]: ExtendedCollectionMatchResult<ItemTypeType>;
|
|
167
|
-
}
|
|
168
|
-
export declare type ResponseColumn = any;
|
|
169
|
-
export declare type ResponseColumnMap = {
|
|
170
|
-
[columnId: string]: ResponseColumn;
|
|
171
|
-
};
|
|
172
|
-
export declare type ResponseColumnItemTypeMap = {
|
|
173
|
-
[itemType: string]: ResponseColumnMap;
|
|
174
|
-
};
|
|
175
|
-
export declare type ColumnExpansionResult<ItemTypeType extends ItemType = any> = {
|
|
176
|
-
merged: ColumnSet<ItemTypeType>;
|
|
177
|
-
difference: ColumnSet<ItemTypeType>;
|
|
178
|
-
};
|
|
179
|
-
export declare type RootColumnMap = {
|
|
180
|
-
[columnId: string]: {
|
|
181
|
-
apiColumn: ResponseColumn;
|
|
182
|
-
children: RootColumnMap;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
export declare type ApiResponse = ApiResponseProcessor;
|
|
186
|
-
export declare type TemplateItemResourceMap<T extends ItemResource<any>> = {
|
|
187
|
-
main: T;
|
|
188
|
-
linked: ItemResourcesItemTypeMap;
|
|
189
|
-
};
|
|
190
|
-
export declare type ItemTypeMap<T = any> = {
|
|
191
|
-
[itemType: string]: T;
|
|
192
|
-
};
|
|
193
|
-
export declare type ApiQuery = any;
|
|
194
|
-
export declare type ApiRequestItemValues = {
|
|
195
|
-
values?: any;
|
|
196
|
-
links?: {
|
|
197
|
-
[itemType: string]: ItemId[];
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
export declare type ApiRequestItemMap = {
|
|
201
|
-
[itemType: string]: {
|
|
202
|
-
[itemId: number]: ApiRequestItemValues;
|
|
203
|
-
};
|
|
204
|
-
};
|
|
205
|
-
export declare type ApiRequestColumn = string | {
|
|
206
|
-
[columnId: string]: ApiRequestColumn[];
|
|
207
|
-
};
|
|
208
|
-
export declare type ApiRequestColumns = ApiRequestColumn[] | true;
|
|
209
|
-
export declare type ApiRequestColumnMap = {
|
|
210
|
-
[itemType: string]: ApiRequestColumns;
|
|
211
|
-
};
|
|
212
|
-
export declare type ApiRequestLimit = {
|
|
213
|
-
field: string;
|
|
214
|
-
limit: number;
|
|
215
|
-
offset?: number;
|
|
216
|
-
order?: 'desc' | 'asc';
|
|
217
|
-
};
|
|
218
|
-
export declare type ApiRequestMoveItems = {
|
|
219
|
-
[itemType: string]: ItemId[];
|
|
220
|
-
};
|
|
221
|
-
export declare type CreateRequestEntry<ItemTypeType extends ItemType> = {
|
|
222
|
-
request: {
|
|
223
|
-
requestType: 'create';
|
|
224
|
-
itemType?: ItemTypeType;
|
|
225
|
-
parentType?: ItemType;
|
|
226
|
-
parentId?: {
|
|
227
|
-
[itemId: string]: ItemId;
|
|
228
|
-
};
|
|
229
|
-
items: ApiRequestItemMap;
|
|
230
|
-
columns: ApiRequestColumnMap;
|
|
231
|
-
};
|
|
232
|
-
columns: RequestColumnExpansion;
|
|
233
|
-
items: ItemEntryMap<ItemTypeType>;
|
|
234
|
-
collections: CollectionMatcher;
|
|
235
|
-
};
|
|
236
|
-
export declare enum ApiLinkTreeType {
|
|
237
|
-
ITEMTABLE = "itemtable",
|
|
238
|
-
DIRECT = "direct"
|
|
239
|
-
}
|
|
240
|
-
export declare type ApiLinkTreeEntry = {
|
|
241
|
-
type: ApiLinkTreeType.ITEMTABLE;
|
|
242
|
-
} | {
|
|
243
|
-
type: ApiLinkTreeType.DIRECT;
|
|
244
|
-
field: string;
|
|
245
|
-
};
|
|
246
|
-
export declare type ApiLinkTree = {
|
|
247
|
-
[itemType: string]: {
|
|
248
|
-
[childType: string]: ApiLinkTreeEntry;
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
/**
|
|
252
|
-
* @description
|
|
253
|
-
* Callback to determine if an item should be included in the create delta, return `false` to exclude the item
|
|
254
|
-
*/
|
|
255
|
-
export declare type FilterItemEntryCallback = <ItemTypeType extends ItemType>(itemType: ItemTypeType, fields: FieldMap<ItemTypeType>) => boolean;
|
|
256
|
-
export declare type ModifyFieldsCallback = <ItemTypeType extends ItemType>(itemType: ItemTypeType, fields: FieldMap<ItemTypeType>, itemIdConversionMap?: ItemIdConversionMap) => void;
|
|
257
|
-
/**
|
|
258
|
-
* @description
|
|
259
|
-
* Returns 'false' if the field changed
|
|
260
|
-
*/
|
|
261
|
-
export declare type CompareFieldCallback<ItemTypeType extends ItemType = any> = (field: keyof FieldMap<ItemTypeType>) => boolean;
|
|
262
|
-
export declare type FieldChangeCallback<ItemTypeType extends ItemType = any> = (itemEntry: ItemEntry<ItemTypeType>, compareField: CompareFieldCallback, fields: FieldMap<ItemTypeType>, isCalledAfterSocketUpdate: boolean, previous: FieldMap<ItemTypeType>) => void;
|
|
263
|
-
export declare type DeregFunction = () => void;
|
|
1
|
+
import { ApiResponseProcessor, CollectionMatcher, ColumnSet, RequestColumnExpansion } from '../classes';
|
|
2
|
+
import { CollectionEntry, CollectionEntryOptions, CollectionEntryOptionsInterface, CollectionResource, CollectionResourceOptions, CollectionResourceOptionsInterface, ItemEntry, ItemEntryOptionsInterface, ItemResource } from '../models';
|
|
3
|
+
export declare type EntryParent = {
|
|
4
|
+
itemType: string;
|
|
5
|
+
itemId: number;
|
|
6
|
+
};
|
|
7
|
+
export declare type EntryParentNull = EntryParent | null;
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Used for fields that belong to a specific itemType
|
|
11
|
+
*/
|
|
12
|
+
export declare type FieldMap<_ItemTypeType extends ItemType = any> = {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
export declare type ItemOptionsInterface = ItemEntryOptionsInterface;
|
|
16
|
+
export declare type CollectionOptionsInterface<ItemTypeType extends ItemType = any> = CollectionEntryOptionsInterface & CollectionResourceOptionsInterface<ItemTypeType>;
|
|
17
|
+
export interface CollectionDefinition<ItemTypeType extends ItemType = any> {
|
|
18
|
+
itemType: ItemTypeType;
|
|
19
|
+
options: {
|
|
20
|
+
entry: CollectionEntryOptions;
|
|
21
|
+
resource: CollectionResourceOptions<ItemTypeType>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface LinkCollectionDefinition<ItemTypeType extends ItemType = any> extends CollectionDefinition<ItemTypeType> {
|
|
25
|
+
linkField: string;
|
|
26
|
+
}
|
|
27
|
+
export declare enum StateKeyType {
|
|
28
|
+
New = "new",
|
|
29
|
+
Duplicate = "duplicate"
|
|
30
|
+
}
|
|
31
|
+
export declare type StateKey = {
|
|
32
|
+
type: StateKeyType;
|
|
33
|
+
template?: string;
|
|
34
|
+
itemId?: number;
|
|
35
|
+
};
|
|
36
|
+
export declare type SocketMessageType = 'event' | 'notification';
|
|
37
|
+
export interface SocketMessage {
|
|
38
|
+
header: {
|
|
39
|
+
domain: string;
|
|
40
|
+
account: string;
|
|
41
|
+
sender: {
|
|
42
|
+
displayname: string;
|
|
43
|
+
itemType: 'Medewerker';
|
|
44
|
+
itemId: ItemId;
|
|
45
|
+
authorized: boolean;
|
|
46
|
+
session: string;
|
|
47
|
+
};
|
|
48
|
+
messageId: {
|
|
49
|
+
Id: string;
|
|
50
|
+
sequence: number;
|
|
51
|
+
batch: number;
|
|
52
|
+
request: number;
|
|
53
|
+
};
|
|
54
|
+
sent: string;
|
|
55
|
+
forceEvaluate: boolean;
|
|
56
|
+
};
|
|
57
|
+
body: any;
|
|
58
|
+
messageType: SocketMessageType;
|
|
59
|
+
}
|
|
60
|
+
export interface SocketMessageCreate extends SocketMessage {
|
|
61
|
+
body: {
|
|
62
|
+
eventType: 'create';
|
|
63
|
+
columns: ResponseColumnItemTypeMap;
|
|
64
|
+
itemType: ItemType;
|
|
65
|
+
items: {
|
|
66
|
+
[itemType: string]: {
|
|
67
|
+
[itemId: number]: {
|
|
68
|
+
parent: null | EntryParent;
|
|
69
|
+
values: FieldMap;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export interface SocketMessageUpdate extends SocketMessage {
|
|
76
|
+
body: {
|
|
77
|
+
eventType: 'update';
|
|
78
|
+
columns: ResponseColumnItemTypeMap;
|
|
79
|
+
itemType: ItemType;
|
|
80
|
+
items: {
|
|
81
|
+
[itemType: string]: {
|
|
82
|
+
[itemId: number]: {
|
|
83
|
+
parent: null | EntryParent;
|
|
84
|
+
values: FieldMap;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export interface SocketMessageLinkTo extends SocketMessage {
|
|
91
|
+
body: {
|
|
92
|
+
eventType: 'linkto';
|
|
93
|
+
columns: ResponseColumnItemTypeMap;
|
|
94
|
+
itemType: ItemType;
|
|
95
|
+
items: {
|
|
96
|
+
[itemType: string]: {
|
|
97
|
+
[itemId: number]: {
|
|
98
|
+
parent: null | EntryParent;
|
|
99
|
+
values: FieldMap;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export interface SocketMessageDelete extends SocketMessage {
|
|
106
|
+
body: {
|
|
107
|
+
eventType: 'delete';
|
|
108
|
+
itemType: ItemType;
|
|
109
|
+
items: ItemId[];
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface FunctionChangesResolveSocketMessage extends SocketMessage {
|
|
113
|
+
body: {
|
|
114
|
+
itemType: 'FunctionChangesResolve';
|
|
115
|
+
[key: string]: any;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export declare type ItemResourceItemIdMap<T extends ItemResource<any> = ItemResource<any>> = {
|
|
119
|
+
[itemId: number]: T;
|
|
120
|
+
};
|
|
121
|
+
export declare type ItemResourcesItemTypeMap<T extends ItemResource<any> = ItemResource<any>> = {
|
|
122
|
+
[itemType: string]: T[];
|
|
123
|
+
};
|
|
124
|
+
export declare type ItemId = number;
|
|
125
|
+
export declare type ItemType = string;
|
|
126
|
+
export declare type ItemMap<T> = {
|
|
127
|
+
[itemType: string]: {
|
|
128
|
+
[itemId: string]: T;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export declare type ItemEntryMap<ItemTypeType extends ItemType> = ItemMap<ItemEntry<ItemTypeType>>;
|
|
132
|
+
export declare type ItemEntryParentIdMap<ItemTypeType extends ItemType> = {
|
|
133
|
+
[parentId: number]: Array<ItemEntry<ItemTypeType>>;
|
|
134
|
+
};
|
|
135
|
+
export declare type ConversionMap = {
|
|
136
|
+
[itemId: number]: number;
|
|
137
|
+
};
|
|
138
|
+
export declare type ItemIdConversionMap = {
|
|
139
|
+
[itemType: string]: ConversionMap;
|
|
140
|
+
};
|
|
141
|
+
export declare type CreateRequestParameterMap<T = any> = ItemMap<T>;
|
|
142
|
+
export declare type ItemError = {
|
|
143
|
+
message: string;
|
|
144
|
+
};
|
|
145
|
+
export declare type QueryParams = any;
|
|
146
|
+
export declare type CollectionQuery = {
|
|
147
|
+
object: object;
|
|
148
|
+
string: string;
|
|
149
|
+
};
|
|
150
|
+
export declare type QueryCallback = (queryParams: QueryParams) => QueryParams;
|
|
151
|
+
export declare type CollectionEntryParentIdMap<ItemTypeType extends ItemType> = {
|
|
152
|
+
[parentId: number]: CollectionEntry<ItemTypeType>;
|
|
153
|
+
};
|
|
154
|
+
export declare type CollectionResourceParentIdMap<ItemTypeType extends ItemType = any> = {
|
|
155
|
+
[parentId: number]: CollectionResource<ItemTypeType>;
|
|
156
|
+
};
|
|
157
|
+
export declare type CollectionMatchResult<ItemTypeType extends ItemType> = {
|
|
158
|
+
fitting: Array<CollectionEntry<ItemTypeType>>;
|
|
159
|
+
notfitting: Array<CollectionEntry<ItemTypeType>>;
|
|
160
|
+
maybe: Array<CollectionEntry<ItemTypeType>>;
|
|
161
|
+
};
|
|
162
|
+
export interface ExtendedCollectionMatchResult<ItemTypeType extends ItemType> extends CollectionMatchResult<ItemTypeType> {
|
|
163
|
+
collection: CollectionEntry<ItemTypeType>;
|
|
164
|
+
}
|
|
165
|
+
export interface GroupedExtendedCollectionMatchResult<ItemTypeType extends ItemType> {
|
|
166
|
+
[collectionId: number]: ExtendedCollectionMatchResult<ItemTypeType>;
|
|
167
|
+
}
|
|
168
|
+
export declare type ResponseColumn = any;
|
|
169
|
+
export declare type ResponseColumnMap = {
|
|
170
|
+
[columnId: string]: ResponseColumn;
|
|
171
|
+
};
|
|
172
|
+
export declare type ResponseColumnItemTypeMap = {
|
|
173
|
+
[itemType: string]: ResponseColumnMap;
|
|
174
|
+
};
|
|
175
|
+
export declare type ColumnExpansionResult<ItemTypeType extends ItemType = any> = {
|
|
176
|
+
merged: ColumnSet<ItemTypeType>;
|
|
177
|
+
difference: ColumnSet<ItemTypeType>;
|
|
178
|
+
};
|
|
179
|
+
export declare type RootColumnMap = {
|
|
180
|
+
[columnId: string]: {
|
|
181
|
+
apiColumn: ResponseColumn;
|
|
182
|
+
children: RootColumnMap;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
export declare type ApiResponse = ApiResponseProcessor;
|
|
186
|
+
export declare type TemplateItemResourceMap<T extends ItemResource<any>> = {
|
|
187
|
+
main: T;
|
|
188
|
+
linked: ItemResourcesItemTypeMap;
|
|
189
|
+
};
|
|
190
|
+
export declare type ItemTypeMap<T = any> = {
|
|
191
|
+
[itemType: string]: T;
|
|
192
|
+
};
|
|
193
|
+
export declare type ApiQuery = any;
|
|
194
|
+
export declare type ApiRequestItemValues = {
|
|
195
|
+
values?: any;
|
|
196
|
+
links?: {
|
|
197
|
+
[itemType: string]: ItemId[];
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
export declare type ApiRequestItemMap = {
|
|
201
|
+
[itemType: string]: {
|
|
202
|
+
[itemId: number]: ApiRequestItemValues;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
export declare type ApiRequestColumn = string | {
|
|
206
|
+
[columnId: string]: ApiRequestColumn[];
|
|
207
|
+
};
|
|
208
|
+
export declare type ApiRequestColumns = ApiRequestColumn[] | true;
|
|
209
|
+
export declare type ApiRequestColumnMap = {
|
|
210
|
+
[itemType: string]: ApiRequestColumns;
|
|
211
|
+
};
|
|
212
|
+
export declare type ApiRequestLimit = {
|
|
213
|
+
field: string;
|
|
214
|
+
limit: number;
|
|
215
|
+
offset?: number;
|
|
216
|
+
order?: 'desc' | 'asc';
|
|
217
|
+
};
|
|
218
|
+
export declare type ApiRequestMoveItems = {
|
|
219
|
+
[itemType: string]: ItemId[];
|
|
220
|
+
};
|
|
221
|
+
export declare type CreateRequestEntry<ItemTypeType extends ItemType> = {
|
|
222
|
+
request: {
|
|
223
|
+
requestType: 'create';
|
|
224
|
+
itemType?: ItemTypeType;
|
|
225
|
+
parentType?: ItemType;
|
|
226
|
+
parentId?: {
|
|
227
|
+
[itemId: string]: ItemId;
|
|
228
|
+
};
|
|
229
|
+
items: ApiRequestItemMap;
|
|
230
|
+
columns: ApiRequestColumnMap;
|
|
231
|
+
};
|
|
232
|
+
columns: RequestColumnExpansion;
|
|
233
|
+
items: ItemEntryMap<ItemTypeType>;
|
|
234
|
+
collections: CollectionMatcher;
|
|
235
|
+
};
|
|
236
|
+
export declare enum ApiLinkTreeType {
|
|
237
|
+
ITEMTABLE = "itemtable",
|
|
238
|
+
DIRECT = "direct"
|
|
239
|
+
}
|
|
240
|
+
export declare type ApiLinkTreeEntry = {
|
|
241
|
+
type: ApiLinkTreeType.ITEMTABLE;
|
|
242
|
+
} | {
|
|
243
|
+
type: ApiLinkTreeType.DIRECT;
|
|
244
|
+
field: string;
|
|
245
|
+
};
|
|
246
|
+
export declare type ApiLinkTree = {
|
|
247
|
+
[itemType: string]: {
|
|
248
|
+
[childType: string]: ApiLinkTreeEntry;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* @description
|
|
253
|
+
* Callback to determine if an item should be included in the create delta, return `false` to exclude the item
|
|
254
|
+
*/
|
|
255
|
+
export declare type FilterItemEntryCallback = <ItemTypeType extends ItemType>(itemType: ItemTypeType, fields: FieldMap<ItemTypeType>) => boolean;
|
|
256
|
+
export declare type ModifyFieldsCallback = <ItemTypeType extends ItemType>(itemType: ItemTypeType, fields: FieldMap<ItemTypeType>, itemIdConversionMap?: ItemIdConversionMap) => void;
|
|
257
|
+
/**
|
|
258
|
+
* @description
|
|
259
|
+
* Returns 'false' if the field changed
|
|
260
|
+
*/
|
|
261
|
+
export declare type CompareFieldCallback<ItemTypeType extends ItemType = any> = (field: keyof FieldMap<ItemTypeType>) => boolean;
|
|
262
|
+
export declare type FieldChangeCallback<ItemTypeType extends ItemType = any> = (itemEntry: ItemEntry<ItemTypeType>, compareField: CompareFieldCallback, fields: FieldMap<ItemTypeType>, isCalledAfterSocketUpdate: boolean, previous: FieldMap<ItemTypeType>) => void;
|
|
263
|
+
export declare type DeregFunction = () => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export interface PromiseInterface<T> extends Promise<T> {
|
|
2
|
-
}
|
|
1
|
+
export interface PromiseInterface<T> extends Promise<T> {
|
|
2
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './ItemTypesCollection';
|
|
2
|
-
export * from './PromiseInterface';
|
|
1
|
+
export * from './ItemTypesCollection';
|
|
2
|
+
export * from './PromiseInterface';
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@rentman/rm-core",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"description": "Rentman core functionalities",
|
|
5
|
-
"main": "./dist/rm-core.js",
|
|
6
|
-
"types": "./dist/types/index.d.ts",
|
|
7
|
-
"dependencies": {},
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/rentmanpublic/frontend-core"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@types/moment": "^2.13.0",
|
|
14
|
-
"@types/q": "^1.5.0",
|
|
15
|
-
"clean-webpack-plugin": "^0.1.19",
|
|
16
|
-
"ts-loader": "^6.2.1",
|
|
17
|
-
"tslint": "5.19.0",
|
|
18
|
-
"typescript": "^3.7.2",
|
|
19
|
-
"typescript-tslint-plugin": "^0.5.5",
|
|
20
|
-
"uglifyjs-webpack-plugin": "^1.2.5",
|
|
21
|
-
"webpack": "4.41.2",
|
|
22
|
-
"webpack-cli": "3.3.6",
|
|
23
|
-
"webpack-merge": "^4.1.4"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"dist"
|
|
27
|
-
],
|
|
28
|
-
"scripts": {
|
|
29
|
-
"prepublishOnly": "npm run bundle",
|
|
30
|
-
"bundle-dev": "webpack --config webpack.dev.js",
|
|
31
|
-
"bundle": "webpack --config webpack.prod.js",
|
|
32
|
-
"type-check": "tsc --noEmit"
|
|
33
|
-
},
|
|
34
|
-
"author": "Martijn Welker <martijn@rentman.nl>",
|
|
35
|
-
"license": "UNLICENSED"
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@rentman/rm-core",
|
|
3
|
+
"version": "4.0.4",
|
|
4
|
+
"description": "Rentman core functionalities",
|
|
5
|
+
"main": "./dist/rm-core.js",
|
|
6
|
+
"types": "./dist/types/index.d.ts",
|
|
7
|
+
"dependencies": {},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/rentmanpublic/frontend-core"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@types/moment": "^2.13.0",
|
|
14
|
+
"@types/q": "^1.5.0",
|
|
15
|
+
"clean-webpack-plugin": "^0.1.19",
|
|
16
|
+
"ts-loader": "^6.2.1",
|
|
17
|
+
"tslint": "5.19.0",
|
|
18
|
+
"typescript": "^3.7.2",
|
|
19
|
+
"typescript-tslint-plugin": "^0.5.5",
|
|
20
|
+
"uglifyjs-webpack-plugin": "^1.2.5",
|
|
21
|
+
"webpack": "4.41.2",
|
|
22
|
+
"webpack-cli": "3.3.6",
|
|
23
|
+
"webpack-merge": "^4.1.4"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"prepublishOnly": "npm run bundle",
|
|
30
|
+
"bundle-dev": "webpack --config webpack.dev.js",
|
|
31
|
+
"bundle": "webpack --config webpack.prod.js",
|
|
32
|
+
"type-check": "tsc --noEmit"
|
|
33
|
+
},
|
|
34
|
+
"author": "Martijn Welker <martijn@rentman.nl>",
|
|
35
|
+
"license": "UNLICENSED"
|
|
36
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
# Running a local test version
|
|
2
|
-
1. Make changes
|
|
3
|
-
2. run `npm run bundle-dev`
|
|
4
|
-
3. copy `dist` folder to
|
|
5
|
-
- Frontend: `<project>/bower_components/rentman-rm-core/`
|
|
6
|
-
- App: `<project>/node_modules/@rentman/rm-core/`
|
|
7
|
-
|
|
8
|
-
# Publishing your local version
|
|
9
|
-
|
|
10
|
-
(You have to be logged in as rentman-user on npm, run `npm whoami` to see who you are logged in as)
|
|
11
|
-
|
|
12
|
-
1. Make changes
|
|
13
|
-
2. Report changes in changelog
|
|
14
|
-
3. Update version in package.json and main.ts
|
|
15
|
-
4. Commit, tag and push changes
|
|
1
|
+
# Running a local test version
|
|
2
|
+
1. Make changes
|
|
3
|
+
2. run `npm run bundle-dev`
|
|
4
|
+
3. copy `dist` folder to
|
|
5
|
+
- Frontend: `<project>/bower_components/rentman-rm-core/`
|
|
6
|
+
- App: `<project>/node_modules/@rentman/rm-core/`
|
|
7
|
+
|
|
8
|
+
# Publishing your local version
|
|
9
|
+
|
|
10
|
+
(You have to be logged in as rentman-user on npm, run `npm whoami` to see who you are logged in as)
|
|
11
|
+
|
|
12
|
+
1. Make changes
|
|
13
|
+
2. Report changes in changelog
|
|
14
|
+
3. Update version in package.json and main.ts
|
|
15
|
+
4. Commit, tag and push changes
|
|
16
16
|
5. run `npm publish`
|