@fjell/core 4.4.49 → 4.4.51

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 (58) hide show
  1. package/dist/event/emitter.d.ts +140 -0
  2. package/dist/event/events.d.ts +81 -0
  3. package/dist/event/index.d.ts +38 -0
  4. package/dist/event/matching.d.ts +54 -0
  5. package/dist/event/subscription.d.ts +74 -0
  6. package/dist/event/types.d.ts +186 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.js +272 -0
  9. package/package.json +3 -3
  10. package/src/AItemService.ts +0 -38
  11. package/src/Coordinate.ts +0 -35
  12. package/src/dictionary.ts +0 -84
  13. package/src/errors/ActionError.ts +0 -69
  14. package/src/errors/BusinessLogicError.ts +0 -24
  15. package/src/errors/DuplicateError.ts +0 -57
  16. package/src/errors/NotFoundError.ts +0 -24
  17. package/src/errors/PermissionError.ts +0 -31
  18. package/src/errors/ValidationError.ts +0 -27
  19. package/src/errors/index.ts +0 -7
  20. package/src/index.ts +0 -66
  21. package/src/item/IFactory.ts +0 -122
  22. package/src/item/IQFactory.ts +0 -163
  23. package/src/item/IQUtils.ts +0 -392
  24. package/src/item/IUtils.ts +0 -40
  25. package/src/item/ItemQuery.ts +0 -88
  26. package/src/items.ts +0 -120
  27. package/src/key/KUtils.ts +0 -484
  28. package/src/keys.ts +0 -95
  29. package/src/logger.ts +0 -5
  30. package/src/operations/OperationContext.ts +0 -12
  31. package/src/operations/Operations.ts +0 -357
  32. package/src/operations/contained.ts +0 -134
  33. package/src/operations/errorEnhancer.ts +0 -204
  34. package/src/operations/index.ts +0 -2
  35. package/src/operations/methods.ts +0 -363
  36. package/src/operations/primary.ts +0 -101
  37. package/src/operations/specialized.ts +0 -71
  38. package/src/operations/wrappers/createActionWrapper.ts +0 -108
  39. package/src/operations/wrappers/createAllActionWrapper.ts +0 -109
  40. package/src/operations/wrappers/createAllFacetWrapper.ts +0 -98
  41. package/src/operations/wrappers/createAllWrapper.ts +0 -103
  42. package/src/operations/wrappers/createCreateWrapper.ts +0 -117
  43. package/src/operations/wrappers/createFacetWrapper.ts +0 -97
  44. package/src/operations/wrappers/createFindOneWrapper.ts +0 -105
  45. package/src/operations/wrappers/createFindWrapper.ts +0 -105
  46. package/src/operations/wrappers/createGetWrapper.ts +0 -96
  47. package/src/operations/wrappers/createOneWrapper.ts +0 -128
  48. package/src/operations/wrappers/createRemoveWrapper.ts +0 -91
  49. package/src/operations/wrappers/createUpdateWrapper.ts +0 -106
  50. package/src/operations/wrappers/createUpsertWrapper.ts +0 -108
  51. package/src/operations/wrappers/index.ts +0 -39
  52. package/src/operations/wrappers/types.ts +0 -63
  53. package/src/validation/ItemValidator.ts +0 -131
  54. package/src/validation/KeyValidator.ts +0 -365
  55. package/src/validation/LocationValidator.ts +0 -136
  56. package/src/validation/QueryValidator.ts +0 -250
  57. package/src/validation/index.ts +0 -32
  58. package/src/validation/types.ts +0 -45
package/src/key/KUtils.ts DELETED
@@ -1,484 +0,0 @@
1
- /* eslint-disable no-undefined */
2
- import {
3
- ComKey,
4
- LocKey,
5
- LocKeyArray,
6
- PriKey
7
- } from "../keys";
8
-
9
- import LibLogger from "../logger";
10
-
11
- const logger = LibLogger.get('KUtils');
12
-
13
- // Normalize a key value to string for consistent comparison and hashing
14
- const normalizeKeyValue = (value: string | number): string => {
15
- return String(value);
16
- };
17
-
18
- // Normalized hash function for Dictionary that converts pk/lk values to strings
19
- export const createNormalizedHashFunction = <T>() => {
20
- return (key: T): string => {
21
- if (typeof key === 'object' && key !== null) {
22
- // Create a normalized version of the key with string values
23
- const normalizedKey = JSON.parse(JSON.stringify(key));
24
-
25
- // Normalize pk values
26
- if ('pk' in normalizedKey && (normalizedKey.pk !== undefined && normalizedKey.pk !== null)) {
27
- normalizedKey.pk = normalizeKeyValue(normalizedKey.pk);
28
- }
29
-
30
- // Normalize lk values
31
- if ('lk' in normalizedKey && (normalizedKey.lk !== undefined && normalizedKey.lk !== null)) {
32
- normalizedKey.lk = normalizeKeyValue(normalizedKey.lk);
33
- }
34
-
35
- // Normalize loc array lk values
36
- if ('loc' in normalizedKey && Array.isArray(normalizedKey.loc)) {
37
- normalizedKey.loc = normalizedKey.loc.map((locItem: any) => {
38
- if (locItem && 'lk' in locItem && (locItem.lk !== undefined && locItem.lk !== null)) {
39
- return { ...locItem, lk: normalizeKeyValue(locItem.lk) };
40
- }
41
- return locItem;
42
- });
43
- }
44
-
45
- return JSON.stringify(normalizedKey);
46
- }
47
- return JSON.stringify(key);
48
- };
49
- };
50
-
51
- // Normalized comparison functions
52
- export const isPriKeyEqualNormalized = <
53
- S extends string,
54
- >(a: PriKey<S>, b: PriKey<S>): boolean => {
55
- logger.trace('isPriKeyEqualNormalized', { a, b });
56
- return a && b &&
57
- normalizeKeyValue(a.pk) === normalizeKeyValue(b.pk) &&
58
- a.kt === b.kt;
59
- };
60
-
61
- export const isLocKeyEqualNormalized = <
62
- L1 extends string,
63
- L2 extends string = never,
64
- L3 extends string = never,
65
- L4 extends string = never,
66
- L5 extends string = never
67
- >(a: LocKey<L1 | L2 | L3 | L4 | L5>, b: LocKey<L1 | L2 | L3 | L4 | L5>): boolean => {
68
- logger.trace('isLocKeyEqualNormalized', { a, b });
69
- return a && b &&
70
- normalizeKeyValue(a.lk) === normalizeKeyValue(b.lk) &&
71
- a.kt === b.kt;
72
- };
73
-
74
- export const isComKeyEqualNormalized = <
75
- S extends string,
76
- L1 extends string = never,
77
- L2 extends string = never,
78
- L3 extends string = never,
79
- L4 extends string = never,
80
- L5 extends string = never
81
- >(a: ComKey<S, L1, L2, L3, L4, L5>, b: ComKey<S, L1, L2, L3, L4, L5>): boolean => {
82
- logger.trace('isComKeyEqualNormalized', { a, b });
83
- if (a && b && isPriKeyEqualNormalized({ kt: a.kt, pk: a.pk } as PriKey<S>, { kt: b.kt, pk: b.pk } as PriKey<S>)) {
84
- if (a.loc.length === b.loc.length) {
85
- for (let i = 0; i < a.loc.length; i++) {
86
- if (!isLocKeyEqualNormalized<L1, L2, L3, L4, L5>(a.loc[i], b.loc[i])) {
87
- return false;
88
- }
89
- }
90
- return true;
91
- } else {
92
- return false;
93
- }
94
- } else {
95
- return false;
96
- }
97
- };
98
-
99
- export const isItemKeyEqualNormalized = <
100
- S extends string,
101
- L1 extends string = never,
102
- L2 extends string = never,
103
- L3 extends string = never,
104
- L4 extends string = never,
105
- L5 extends string = never
106
- >(a: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, b: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>): boolean => {
107
- logger.trace('isItemKeyEqualNormalized', { a, b });
108
- if (isComKey(a) && isComKey(b)) {
109
- return isComKeyEqualNormalized(a as ComKey<S, L1, L2, L3, L4, L5>, b as ComKey<S, L1, L2, L3, L4, L5>);
110
- } else if (isPriKey(a) && isPriKey(b)) {
111
- if (isComKey(a) || isComKey(b)) {
112
- return false;
113
- } else {
114
- return isPriKeyEqualNormalized(a as PriKey<S>, b as PriKey<S>);
115
- }
116
- } else {
117
- return false;
118
- }
119
- };
120
-
121
- // Original comparison functions (kept for backward compatibility)
122
- export const isItemKeyEqual = <
123
- S extends string,
124
- L1 extends string = never,
125
- L2 extends string = never,
126
- L3 extends string = never,
127
- L4 extends string = never,
128
- L5 extends string = never
129
- >(a: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, b: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>): boolean => {
130
- logger.trace('isKeyEqual', { a, b });
131
- if (isComKey(a) && isComKey(b)) {
132
- return isComKeyEqual(a as ComKey<S, L1, L2, L3, L4, L5>, b as ComKey<S, L1, L2, L3, L4, L5>);
133
- } else if (isPriKey(a) && isPriKey(b)) {
134
- if (isComKey(a) || isComKey(b)) {
135
- return false;
136
- } else {
137
- return isPriKeyEqual(a as PriKey<S>, b as PriKey<S>);
138
- }
139
- } else {
140
- return false;
141
- }
142
- };
143
-
144
- export const isPriKeyEqual = <
145
- S extends string,
146
- >(a: PriKey<S>, b: PriKey<S>): boolean => {
147
- logger.trace('isPriKeyEqual', { a, b });
148
- return a && b && a.pk === b.pk && a.kt === b.kt;
149
- }
150
-
151
- export const isLocKeyEqual = <
152
- L1 extends string,
153
- L2 extends string = never,
154
- L3 extends string = never,
155
- L4 extends string = never,
156
- L5 extends string = never
157
- >(a: LocKey<L1 | L2 | L3 | L4 | L5>, b: LocKey<L1 | L2 | L3 | L4 | L5>): boolean => {
158
- logger.trace('isLocKeyEqual', { a, b });
159
- return a && b && a.lk === b.lk && a.kt === b.kt;
160
- }
161
-
162
- export const isComKeyEqual = <
163
- S extends string,
164
- L1 extends string = never,
165
- L2 extends string = never,
166
- L3 extends string = never,
167
- L4 extends string = never,
168
- L5 extends string = never
169
- >(a: ComKey<S, L1, L2, L3, L4, L5>, b: ComKey<S, L1, L2, L3, L4, L5>): boolean => {
170
- logger.trace('isComKeyEqual', { a, b });
171
- if (a && b && isPriKeyEqual({ kt: a.kt, pk: a.pk } as PriKey<S>, { kt: b.kt, pk: b.pk } as PriKey<S>)) {
172
- if (a.loc.length === b.loc.length) {
173
- for (let i = 0; i < a.loc.length; i++) {
174
- if (!isLocKeyEqual<L1, L2, L3, L4, L5>(a.loc[i], b.loc[i])) {
175
- return false;
176
- }
177
- }
178
- return true;
179
- } else {
180
- return false;
181
- }
182
- } else {
183
- return false;
184
- }
185
- }
186
-
187
- export const isItemKey = (key: any): boolean => {
188
- logger.trace('isItemKey', { key });
189
- return key !== undefined && (isComKey(key) || isPriKey(key));
190
- }
191
-
192
- export const isComKey = (key: any): boolean => {
193
- logger.trace('isComKey', { key });
194
- return key !== undefined &&
195
- (key.pk !== undefined && key.kt !== undefined) && (key.loc !== undefined && Array.isArray(key.loc));
196
- }
197
-
198
- export const isPriKey = (key: any): boolean => {
199
- logger.trace('isPriKey', { key });
200
- return key !== undefined &&
201
- (key.pk !== undefined && key.kt !== undefined) && (key.loc === undefined);
202
- }
203
-
204
- export const isLocKey = (key: any): boolean => {
205
- logger.trace('isLocKey', { key });
206
- return key !== undefined && (key.lk !== undefined && key.kt !== undefined);
207
- }
208
-
209
- export const generateKeyArray = <
210
- S extends string,
211
- L1 extends string = never,
212
- L2 extends string = never,
213
- L3 extends string = never,
214
- L4 extends string = never,
215
- L5 extends string = never,
216
- >(key: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S> | LocKeyArray<L1, L2, L3, L4, L5> | []):
217
- Array<PriKey<S> | LocKey<L1 | L2 | L3 | L4 | L5>> => {
218
- logger.trace('generateKeyArray', { key });
219
- const keys: Array<PriKey<S> | LocKey<L1 | L2 | L3 | L4 | L5>> = [];
220
-
221
- if (isComKey(key) || isPriKey(key)) {
222
- // console.log('it is an item key');
223
- if (isComKey(key)) {
224
- // console.log('it is a composite key');
225
- const comKey = key as ComKey<S, L1, L2, L3, L4, L5>;
226
- keys.push({ pk: comKey.pk, kt: comKey.kt });
227
- for (let i = 0; i < comKey.loc.length; i++) {
228
- keys.push(comKey.loc[i]);
229
- }
230
- } else {
231
- keys.push(key as PriKey<S>);
232
- }
233
- } else {
234
- // console.log('is is an array, length: ' + key.length);
235
- const locKeys = key as LocKey<L1 | L2 | L3 | L4 | L5>[];
236
- for (let i = 0; i < locKeys.length; i++) {
237
- // console.log('Pushing a key');
238
- keys.push(locKeys[i]);
239
- }
240
- }
241
- return keys;
242
- }
243
-
244
- // TODO: Exactly the same as in ContainedItemLib
245
- export const constructPriKey = <S extends string>(
246
- pk: string | number | PriKey<S>,
247
- kt: S,
248
- ) => {
249
- logger.trace('constructPriKey', { pk, kt });
250
- let pri: PriKey<S>;
251
- if (typeof pk === 'string' || typeof pk === 'number') {
252
- pri = { kt: kt as S, pk: pk };
253
- } else {
254
- pri = pk;
255
- }
256
- return pri;
257
- }
258
-
259
- // TODO: Exactly the same as in ContainedItemLib
260
- export const cPK = constructPriKey;
261
-
262
- export const toKeyTypeArray = <
263
- S extends string,
264
- L1 extends string = never,
265
- L2 extends string = never,
266
- L3 extends string = never,
267
- L4 extends string = never,
268
- L5 extends string = never
269
- >(ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>):
270
- string[] => {
271
- logger.trace('toKeyTypeArray', { ik });
272
- if (isComKey(ik)) {
273
- const ck = ik as ComKey<S, L1, L2, L3, L4, L5>;
274
- return [ck.kt, ...ck.loc.map((l: LocKey<L1 | L2 | L3 | L4 | L5>) => l.kt)];
275
- } else {
276
- return [(ik as PriKey<S>).kt];
277
- }
278
- }
279
-
280
- /**
281
- * Extracts key type arrays from any key type (PriKey, ComKey, or LocKeyArray)
282
- * This is useful for cache invalidation and registry lookups
283
- */
284
- export const extractKeyTypeArray = <
285
- S extends string,
286
- L1 extends string = never,
287
- L2 extends string = never,
288
- L3 extends string = never,
289
- L4 extends string = never,
290
- L5 extends string = never
291
- >(key: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S> | LocKeyArray<L1, L2, L3, L4, L5>):
292
- string[] => {
293
- logger.trace('extractKeyTypeArray', { key });
294
-
295
- if (isComKey(key)) {
296
- const ck = key as ComKey<S, L1, L2, L3, L4, L5>;
297
- return [ck.kt, ...ck.loc.map((l: LocKey<L1 | L2 | L3 | L4 | L5>) => l.kt)];
298
- } else if (isPriKey(key)) {
299
- return [(key as PriKey<S>).kt];
300
- } else if (Array.isArray(key)) {
301
- // This is a LocKeyArray
302
- return key.map(locKey => locKey.kt);
303
- } else {
304
- logger.warning('extractKeyTypeArray: Unknown key type', { key });
305
- return [];
306
- }
307
- }
308
-
309
- export const abbrevIK = <
310
- S extends string,
311
- L1 extends string = never,
312
- L2 extends string = never,
313
- L3 extends string = never,
314
- L4 extends string = never,
315
- L5 extends string = never
316
- >(ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>): string => {
317
- logger.trace('abbrevIK', { ik });
318
- if (ik) {
319
- if (isComKey(ik)) {
320
- const ck = ik as ComKey<S, L1, L2, L3, L4, L5>;
321
- return `${ck.kt}:${ck.pk}:${ck.loc.map((l: LocKey<L1 | L2 | L3 | L4 | L5>) => `${l.kt}:${l.lk}`).join(',')}`;
322
- } else {
323
- return `${(ik as PriKey<S>).kt}:${(ik as PriKey<S>).pk}`;
324
- }
325
- } else {
326
- return 'null IK';
327
- }
328
- }
329
-
330
- export const abbrevLKA = <
331
- L1 extends string,
332
- L2 extends string = never,
333
- L3 extends string = never,
334
- L4 extends string = never,
335
- L5 extends string = never
336
- >(keyArray: Array<LocKey<L1 | L2 | L3 | L4 | L5>> | null): string => {
337
- logger.trace('abbrevLKA', { keyArray });
338
- if (keyArray === undefined || keyArray === null) {
339
- return 'null LKA';
340
- } else {
341
- return keyArray.map(key => {
342
- if (key) {
343
- return `${key.kt}:${key.lk}`;
344
- } else {
345
- return key;
346
- }
347
- }).join(',');
348
- }
349
- }
350
-
351
- export const primaryType = <
352
- S extends string,
353
- L1 extends string = never,
354
- L2 extends string = never,
355
- L3 extends string = never,
356
- L4 extends string = never,
357
- L5 extends string = never
358
- >(ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>): string => {
359
- logger.trace('primaryType', { ik });
360
- if (isComKey(ik)) {
361
- return (ik as ComKey<S, L1, L2, L3, L4, L5>).kt;
362
- } else {
363
- return (ik as PriKey<S>).kt;
364
- }
365
- }
366
-
367
- /**
368
- *
369
- * @param ik ItemKey to be used as a basis for a location
370
- * @returns
371
- */
372
- export const itemKeyToLocKeyArray =
373
- <
374
- S extends string,
375
- L1 extends string = never,
376
- L2 extends string = never,
377
- L3 extends string = never,
378
- L4 extends string = never,
379
- L5 extends string = never
380
- >(ik: PriKey<S> | ComKey<S, L1, L2, L3, L4, L5>): LocKeyArray<S, L1, L2, L3, L4> => {
381
- logger.trace('itemKeyToLocKeyArray', { ik: abbrevIK(ik) });
382
- let lka: Array<LocKey<L1 | L2 | L3 | L4 | L5>> = [];
383
- if (isComKey(ik)) {
384
- const ck = ik as ComKey<S, L1, L2, L3, L4, L5>;
385
- // For composite keys, return only the parent location keys (ck.loc)
386
- // Location arrays are ordered child-to-parent per KTA hierarchy: ['child', 'parent', 'grandparent']
387
- // This is used for aggregation queries where we want to find sibling items at the same location
388
- lka = [...ck.loc];
389
- } else {
390
- const pk = ik as PriKey<S>;
391
- lka = [{ kt: pk.kt, lk: pk.pk } as unknown as LocKey<L1 | L2 | L3 | L4 | L5>];
392
- }
393
- logger.trace('itemKeyToLocKeyArray Results', { ik: abbrevIK(ik), lka: abbrevLKA(lka) });
394
- return lka as LocKeyArray<S, L1, L2, L3, L4>;
395
- }
396
-
397
- export const ikToLKA = itemKeyToLocKeyArray;
398
-
399
- /**
400
- * Sometimes you need to take a location key array and convert it to the item key that points to the containing item.
401
- * @param lka A location key array
402
- * @returns An item key corresponding to the containing item this location refers to.
403
- */
404
- export const locKeyArrayToItemKey =
405
- <
406
- L1 extends string,
407
- L2 extends string = never,
408
- L3 extends string = never,
409
- L4 extends string = never,
410
- L5 extends string = never
411
- >(lka: LocKeyArray<L1, L2, L3, L4, L5>):
412
- PriKey<L1> | ComKey<L1, L2, L3, L4, L5> => {
413
- logger.trace('locKeyArrayToItemKey', { lka: abbrevLKA(lka as Array<LocKey<L1 | L2 | L3 | L4 | L5>>) });
414
-
415
- if (lka && lka.length === 1) {
416
- const priKey = cPK(lka[0].lk, lka[0].kt);
417
- return priKey as PriKey<L1>;
418
- } else if (lka && lka.length > 1 && lka[0] !== undefined) {
419
- const locs = lka.slice(1);
420
- const priKey = cPK(lka[0].lk, lka[0].kt);
421
- const comKey = { kt: priKey.kt, pk: priKey.pk, loc: locs as unknown as LocKeyArray<L2, L3, L4, L5> };
422
- return comKey as ComKey<L1, L2, L3, L4, L5>;
423
- } else {
424
- throw new Error('locKeyArrayToItemKey: lka is undefined or empty');
425
- }
426
- }
427
-
428
- // TODO: This is annoying that we have to check for '' and 'null'
429
- export const isValidPriKey = <S extends string>(key: PriKey<S>): boolean => {
430
- const valid = (key !== undefined && key !== null)
431
- && (key.pk !== undefined && key.pk !== null && key.pk !== '' && key.pk !== 'null')
432
- && (key.kt !== undefined && key.kt !== null && key.kt !== '' && key.kt !== 'null');
433
- return valid;
434
- }
435
-
436
- // TODO: This is annoying that we have to check for '' and 'null'
437
- export const isValidLocKey = <
438
- L1 extends string,
439
- L2 extends string = never,
440
- L3 extends string = never,
441
- L4 extends string = never,
442
- L5 extends string = never
443
- >(key: LocKey<L1 | L2 | L3 | L4 | L5>): boolean => {
444
- const valid = (key !== undefined && key !== null)
445
- && (key.lk !== undefined && key.lk !== null && key.lk !== '' && key.lk !== 'null')
446
- && (key.kt !== undefined && key.kt !== null && key.kt !== '' && key.kt !== 'null');
447
- return valid;
448
- }
449
-
450
- export const isValidLocKeyArray = <
451
- L1 extends string,
452
- L2 extends string = never,
453
- L3 extends string = never,
454
- L4 extends string = never,
455
- L5 extends string = never
456
- >(keyArray: Array<LocKey<L1 | L2 | L3 | L4 | L5>>): boolean => {
457
- return (keyArray !== undefined && keyArray !== null) && keyArray.every(isValidLocKey);
458
- }
459
-
460
- export const isValidComKey = <
461
- S extends string,
462
- L1 extends string = never,
463
- L2 extends string = never,
464
- L3 extends string = never,
465
- L4 extends string = never,
466
- L5 extends string = never
467
- >(key: ComKey<S, L1, L2, L3, L4, L5>): boolean => {
468
- return (key !== undefined
469
- && key !== null) && isValidPriKey(key) && isValidLocKeyArray(key.loc as Array<LocKey<L1 | L2 | L3 | L4 | L5>>);
470
- }
471
-
472
- export const isValidItemKey = <
473
- S extends string,
474
- L1 extends string = never,
475
- L2 extends string = never,
476
- L3 extends string = never,
477
- L4 extends string = never,
478
- L5 extends string = never
479
- >(key: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>): boolean => {
480
- return (isComKey(key) &&
481
- isValidComKey(key as ComKey<S, L1, L2, L3, L4, L5>)) || (isPriKey(key) && isValidPriKey(key as PriKey<S>));
482
- }
483
-
484
- export const lkaToIK = locKeyArrayToItemKey;
package/src/keys.ts DELETED
@@ -1,95 +0,0 @@
1
-
2
- export type UUID = `${string}-${string}-${string}-${string}-${string}`;
3
-
4
- export interface ComKey<
5
- S extends string,
6
- L1 extends string = never,
7
- L2 extends string = never,
8
- L3 extends string = never,
9
- L4 extends string = never,
10
- L5 extends string = never
11
- > {
12
- readonly kt: S,
13
- readonly pk: UUID | string | number,
14
- readonly loc: LocKeyArray<L1, L2, L3, L4, L5>
15
- };
16
-
17
- export interface PriKey<
18
- S extends string,
19
- > {
20
- readonly kt: S,
21
- readonly pk: UUID | string | number,
22
- };
23
-
24
- export interface LocKey<
25
- L extends string
26
- > {
27
- readonly kt: L,
28
- readonly lk: UUID | string | number
29
- };
30
- export type LocKeyArray<
31
- L1 extends string = never,
32
- L2 extends string = never,
33
- L3 extends string = never,
34
- L4 extends string = never,
35
- L5 extends string = never
36
- > =
37
- ([L5] extends [never] ?
38
- ([L4] extends [never] ?
39
- ([L3] extends [never] ?
40
- ([L2] extends [never] ?
41
- ([L1] extends [never] ?
42
- [] | never :
43
- [LocKey<L1>]) :
44
- [LocKey<L1>, LocKey<L2>]) :
45
- [LocKey<L1>, LocKey<L2>, LocKey<L3>]) :
46
- [LocKey<L1>, LocKey<L2>, LocKey<L3>, LocKey<L4>]) :
47
- [LocKey<L1>, LocKey<L2>, LocKey<L3>, LocKey<L4>, LocKey<L5>]);
48
-
49
- export type ItemTypeArray<
50
- S extends string,
51
- L1 extends string = never,
52
- L2 extends string = never,
53
- L3 extends string = never,
54
- L4 extends string = never,
55
- L5 extends string = never,
56
- > =
57
- ([L5] extends [never] ?
58
- ([L4] extends [never] ?
59
- ([L3] extends [never] ?
60
- ([L2] extends [never] ?
61
- ([L1] extends [never] ?
62
- [S] :
63
- [S, L1]) :
64
- [S, L1, L2]) :
65
- [S, L1, L2, L3]) :
66
- [S, L1, L2, L3, L4]) :
67
- [S, L1, L2, L3, L4, L5]);
68
-
69
- export type AllItemTypeArrays<
70
- S extends string,
71
- L1 extends string = never,
72
- L2 extends string = never,
73
- L3 extends string = never,
74
- L4 extends string = never,
75
- L5 extends string = never,
76
- > = readonly [S] |
77
- readonly [S, L1] |
78
- readonly [S, L1, L2] |
79
- readonly [S, L1, L2, L3] |
80
- readonly [S, L1, L2, L3, L4] |
81
- readonly [S, L1, L2, L3, L4, L5];
82
-
83
- export type AllLocTypeArrays<
84
- L1 extends string = never,
85
- L2 extends string = never,
86
- L3 extends string = never,
87
- L4 extends string = never,
88
- L5 extends string = never,
89
- > = readonly [] |
90
- readonly [L1] |
91
- readonly [L1, L2] |
92
- readonly [L1, L2, L3] |
93
- readonly [L1, L2, L3, L4] |
94
- readonly [L1, L2, L3, L4, L5];
95
-
package/src/logger.ts DELETED
@@ -1,5 +0,0 @@
1
- import Logging from '@fjell/logging';
2
-
3
- const LibLogger = Logging.getLogger('@fjell/core');
4
-
5
- export default LibLogger;
@@ -1,12 +0,0 @@
1
- import { ComKey, LocKeyArray, PriKey } from '../keys';
2
- import type { ErrorInfo } from '../errors/ActionError';
3
-
4
- export interface OperationContext {
5
- itemType: string;
6
- operationType: ErrorInfo['operation']['type'];
7
- operationName: string;
8
- params: Record<string, any>;
9
- key?: PriKey<any> | ComKey<any, any, any, any, any, any>;
10
- locations?: LocKeyArray<any, any, any, any, any>;
11
- }
12
-