@elysiumjs/mnemosyne 0.1.0 → 0.1.2

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.
@@ -1,549 +0,0 @@
1
- TN:
2
- SF:../core/dist/index.js
3
- FNF:226
4
- FNH:36
5
- DA:1,0
6
- DA:2,0
7
- DA:3,0
8
- DA:4,0
9
- DA:5,0
10
- DA:6,0
11
- DA:7,0
12
- DA:8,0
13
- DA:9,0
14
- DA:10,0
15
- DA:11,0
16
- DA:12,0
17
- DA:13,0
18
- DA:14,0
19
- DA:15,0
20
- DA:16,0
21
- DA:17,0
22
- DA:18,0
23
- DA:19,1221
24
- LF:19
25
- LH:1
26
- end_of_record
27
- TN:
28
- SF:src/cache.ts
29
- FNF:8
30
- FNH:7
31
- DA:17,73
32
- DA:18,96
33
- DA:19,56
34
- DA:20,76
35
- DA:22,82
36
- DA:121,79
37
- DA:122,60
38
- DA:123,30
39
- DA:124,36
40
- DA:125,28
41
- DA:126,48
42
- DA:127,12
43
- DA:128,6
44
- DA:129,10
45
- DA:131,56
46
- DA:133,30
47
- DA:134,17
48
- DA:135,38
49
- DA:136,162
50
- DA:137,86
51
- DA:139,41
52
- DA:140,62
53
- DA:141,42
54
- DA:142,48
55
- DA:143,40
56
- DA:144,42
57
- DA:145,24
58
- DA:146,18
59
- DA:147,22
60
- DA:149,76
61
- DA:150,13
62
- DA:152,34
63
- DA:154,8
64
- DA:157,56
65
- DA:158,32
66
- DA:159,34
67
- DA:165,48
68
- DA:170,41
69
- DA:177,29
70
- DA:178,116
71
- DA:179,63
72
- DA:186,29
73
- DA:187,55
74
- DA:189,27
75
- DA:195,21
76
- DA:196,51
77
- DA:197,68
78
- DA:198,46
79
- DA:199,50
80
- DA:200,4
81
- DA:201,12
82
- DA:202,9
83
- DA:204,63
84
- DA:211,22
85
- DA:212,53
86
- DA:213,190
87
- DA:214,9
88
- DA:216,46
89
- DA:218,1
90
- LF:59
91
- LH:59
92
- end_of_record
93
- TN:
94
- SF:src/database.ts
95
- FNF:9
96
- FNH:7
97
- DA:18,55
98
- DA:20,32
99
- DA:29,0
100
- DA:30,0
101
- DA:31,0
102
- DA:32,1
103
- DA:45,16
104
- DA:56,12
105
- DA:57,31
106
- DA:70,24
107
- DA:71,30
108
- DA:72,62
109
- DA:73,18
110
- DA:74,4
111
- DA:76,53
112
- DA:77,40
113
- DA:79,14
114
- DA:80,101
115
- DA:81,8
116
- DA:82,20
117
- DA:83,4
118
- DA:85,32
119
- DA:99,20
120
- DA:100,53
121
- DA:101,39
122
- DA:103,87
123
- DA:104,20
124
- DA:105,4
125
- DA:107,60
126
- DA:108,49
127
- DA:117,12
128
- DA:118,52
129
- DA:126,8
130
- DA:127,37
131
- DA:136,12
132
- DA:137,58
133
- DA:138,32
134
- DA:139,63
135
- DA:148,24
136
- DA:149,58
137
- DA:151,1
138
- LF:41
139
- LH:38
140
- end_of_record
141
- TN:
142
- SF:src/keyv-redis.ts
143
- FNF:29
144
- FNH:20
145
- DA:34,1
146
- DA:36,27
147
- DA:68,10
148
- DA:69,24
149
- DA:71,95
150
- DA:72,115
151
- DA:73,12
152
- DA:75,80
153
- DA:76,76
154
- DA:77,128
155
- DA:78,112
156
- DA:79,92
157
- DA:80,142
158
- DA:82,69
159
- DA:83,79
160
- DA:84,16
161
- DA:87,22
162
- DA:88,49
163
- DA:94,20
164
- DA:95,28
165
- DA:96,66
166
- DA:97,102
167
- DA:98,86
168
- DA:99,114
169
- DA:100,46
170
- DA:101,50
171
- DA:102,0
172
- DA:103,0
173
- DA:104,0
174
- DA:105,0
175
- DA:106,0
176
- DA:107,0
177
- DA:108,0
178
- DA:109,0
179
- DA:110,33
180
- DA:116,35
181
- DA:117,61
182
- DA:120,25
183
- DA:121,106
184
- DA:122,90
185
- DA:124,93
186
- DA:127,49
187
- DA:128,106
188
- DA:130,31
189
- DA:131,98
190
- DA:132,14
191
- DA:133,53
192
- DA:137,35
193
- DA:139,42
194
- DA:141,97
195
- DA:142,138
196
- DA:143,35
197
- DA:145,130
198
- DA:146,31
199
- DA:148,117
200
- DA:150,9
201
- DA:152,64
202
- DA:155,28
203
- DA:156,106
204
- DA:158,81
205
- DA:159,69
206
- DA:160,31
207
- DA:162,49
208
- DA:165,21
209
- DA:166,22
210
- DA:167,114
211
- DA:168,46
212
- DA:169,13
213
- DA:170,13
214
- DA:172,46
215
- DA:173,90
216
- DA:174,178
217
- DA:175,64
218
- DA:177,24
219
- DA:178,114
220
- DA:179,34
221
- DA:180,36
222
- DA:181,32
223
- DA:182,36
224
- DA:183,62
225
- DA:184,34
226
- DA:185,32
227
- DA:186,22
228
- DA:189,78
229
- DA:190,76
230
- DA:192,56
231
- DA:193,17
232
- DA:194,9
233
- DA:196,33
234
- DA:197,77
235
- DA:198,9
236
- DA:200,67
237
- DA:201,31
238
- DA:203,41
239
- DA:204,42
240
- DA:205,0
241
- DA:206,0
242
- DA:207,0
243
- DA:208,0
244
- DA:209,0
245
- DA:210,0
246
- DA:211,0
247
- DA:212,0
248
- DA:213,0
249
- DA:214,0
250
- DA:215,0
251
- DA:216,0
252
- DA:217,0
253
- DA:218,0
254
- DA:219,0
255
- DA:220,0
256
- DA:221,0
257
- DA:222,37
258
- DA:225,31
259
- DA:226,52
260
- DA:227,14
261
- DA:228,9
262
- DA:230,144
263
- DA:231,102
264
- DA:233,0
265
- DA:234,0
266
- DA:235,0
267
- DA:236,0
268
- DA:237,0
269
- DA:238,0
270
- DA:239,0
271
- DA:240,0
272
- DA:241,0
273
- DA:242,0
274
- DA:243,0
275
- DA:244,0
276
- DA:245,0
277
- DA:246,0
278
- DA:247,0
279
- DA:248,0
280
- DA:249,0
281
- DA:250,0
282
- DA:251,0
283
- DA:252,0
284
- DA:253,0
285
- DA:254,0
286
- DA:255,0
287
- DA:256,0
288
- DA:257,0
289
- DA:258,0
290
- DA:259,0
291
- DA:260,0
292
- DA:261,0
293
- DA:262,0
294
- DA:263,0
295
- DA:264,0
296
- DA:265,0
297
- DA:266,0
298
- DA:267,0
299
- DA:268,0
300
- DA:269,0
301
- DA:270,0
302
- DA:271,0
303
- DA:272,0
304
- DA:273,0
305
- DA:274,0
306
- DA:275,0
307
- DA:276,0
308
- DA:277,0
309
- DA:278,0
310
- DA:279,0
311
- DA:280,0
312
- DA:281,0
313
- DA:282,0
314
- DA:283,0
315
- DA:284,0
316
- DA:285,0
317
- DA:286,0
318
- DA:287,0
319
- DA:288,0
320
- DA:289,0
321
- DA:290,0
322
- DA:291,31
323
- DA:300,59
324
- DA:301,148
325
- DA:310,0
326
- DA:311,91
327
- DA:313,1
328
- LF:183
329
- LH:99
330
- end_of_record
331
- TN:
332
- SF:src/model.ts
333
- FNF:10
334
- FNH:5
335
- DA:18,46
336
- DA:19,27
337
- DA:21,65
338
- DA:30,36
339
- DA:31,11
340
- DA:32,27
341
- DA:33,3
342
- DA:34,74
343
- DA:36,24
344
- DA:38,34
345
- DA:39,70
346
- DA:40,13
347
- DA:41,4
348
- DA:43,54
349
- DA:45,27
350
- DA:46,66
351
- DA:47,4
352
- DA:49,69
353
- DA:50,66
354
- DA:51,2
355
- DA:52,2
356
- DA:54,29
357
- DA:63,37
358
- DA:64,34
359
- DA:65,15
360
- DA:66,22
361
- DA:67,13
362
- DA:68,40
363
- DA:69,15
364
- DA:70,22
365
- DA:71,16
366
- DA:72,23
367
- DA:73,14
368
- DA:74,28
369
- DA:75,13
370
- DA:76,24
371
- DA:77,13
372
- DA:78,9
373
- DA:79,40
374
- DA:80,8
375
- DA:81,12
376
- DA:82,17
377
- DA:83,9
378
- DA:84,45
379
- DA:85,8
380
- DA:86,12
381
- DA:87,15
382
- DA:88,22
383
- DA:89,15
384
- DA:90,15
385
- DA:92,2
386
- DA:106,29
387
- DA:107,22
388
- DA:108,18
389
- DA:109,18
390
- DA:110,28
391
- DA:111,6
392
- DA:112,110
393
- DA:114,40
394
- DA:118,72
395
- DA:123,72
396
- DA:128,75
397
- DA:134,25
398
- DA:136,137
399
- DA:137,39
400
- DA:138,7
401
- DA:140,34
402
- DA:141,54
403
- DA:142,36
404
- DA:143,48
405
- DA:144,27
406
- DA:145,58
407
- DA:146,11
408
- DA:147,60
409
- DA:148,7
410
- DA:149,7
411
- DA:151,44
412
- DA:157,66
413
- DA:162,58
414
- DA:167,168
415
- DA:172,168
416
- DA:177,168
417
- DA:185,50
418
- DA:186,6
419
- DA:188,19
420
- LF:85
421
- LH:85
422
- end_of_record
423
- TN:
424
- SF:src/repository.ts
425
- FNF:4
426
- FNH:3
427
- DA:30,34
428
- DA:31,14
429
- DA:32,26
430
- DA:33,6
431
- DA:38,40
432
- DA:42,50
433
- DA:49,57
434
- DA:54,22
435
- DA:55,126
436
- DA:134,6
437
- DA:136,19
438
- LF:11
439
- LH:11
440
- end_of_record
441
- TN:
442
- SF:src/tenancy.ts
443
- FNF:10
444
- FNH:0
445
- DA:18,78
446
- DA:101,42
447
- DA:116,0
448
- DA:117,0
449
- DA:118,0
450
- DA:119,0
451
- DA:120,0
452
- DA:121,0
453
- DA:122,50
454
- DA:134,0
455
- DA:135,26
456
- DA:143,0
457
- DA:144,22
458
- DA:156,0
459
- DA:157,0
460
- DA:158,0
461
- DA:159,0
462
- DA:160,0
463
- DA:161,41
464
- DA:171,0
465
- DA:172,0
466
- DA:173,0
467
- DA:174,0
468
- DA:175,56
469
- DA:203,102
470
- DA:207,50
471
- DA:212,42
472
- DA:217,0
473
- DA:218,0
474
- DA:219,0
475
- DA:220,0
476
- DA:221,0
477
- DA:222,0
478
- DA:223,0
479
- DA:224,0
480
- DA:225,0
481
- DA:226,0
482
- DA:227,0
483
- DA:228,0
484
- DA:229,0
485
- DA:230,0
486
- DA:231,0
487
- DA:232,0
488
- DA:233,0
489
- DA:234,0
490
- DA:235,0
491
- DA:236,38
492
- DA:245,0
493
- DA:246,0
494
- DA:247,0
495
- DA:248,0
496
- DA:249,0
497
- DA:250,0
498
- DA:251,0
499
- DA:252,0
500
- DA:253,0
501
- DA:254,0
502
- DA:255,0
503
- DA:256,0
504
- DA:257,0
505
- DA:258,0
506
- DA:259,0
507
- DA:260,0
508
- DA:261,0
509
- DA:262,0
510
- DA:263,0
511
- DA:264,0
512
- DA:265,0
513
- DA:266,0
514
- DA:267,0
515
- DA:268,0
516
- DA:269,0
517
- DA:270,0
518
- DA:271,0
519
- DA:272,0
520
- DA:273,0
521
- DA:274,0
522
- DA:275,48
523
- DA:277,2
524
- DA:283,126
525
- DA:289,126
526
- DA:290,42
527
- DA:291,1
528
- LF:83
529
- LH:17
530
- end_of_record
531
- TN:
532
- SF:tests/setup.ts
533
- FNF:3
534
- FNH:1
535
- DA:15,0
536
- DA:16,0
537
- DA:17,0
538
- DA:18,0
539
- DA:19,0
540
- DA:20,0
541
- DA:21,0
542
- DA:22,30
543
- DA:23,47
544
- DA:24,19
545
- DA:25,2
546
- DA:26,2
547
- LF:12
548
- LH:5
549
- end_of_record
package/dist/cache.d.ts DELETED
@@ -1,113 +0,0 @@
1
- /**
2
- * Interface for a cache storage.
3
- * @author Axel Nana <axel.nana@workbud.com>
4
- */
5
- export interface CacheInterface {
6
- /**
7
- * Retrieves the cached data for a given key.
8
- * @typeParam T The type of the cached data.
9
- *
10
- * @param key The key of the cached data.
11
- */
12
- get<T>(key: string): Promise<T | undefined>;
13
- /**
14
- * Retrieves the cached data for a given list of keys.
15
- * @typeParam T The type of the cached data.
16
- *
17
- * @param keys The list of cached data keys.
18
- */
19
- mget<T>(keys: string[]): Promise<Array<T | undefined>>;
20
- /**
21
- * Gets the TTL of the cached data with the given key.
22
- * @param key The key of the cached data.
23
- * @returns The TTL of the cached data, or `undefined` if the data does not exist.
24
- */
25
- ttl(key: string): Promise<number | undefined>;
26
- /**
27
- * Caches data under the given key and an optional TTL.
28
- * @typeParam T The type of the data to cache.
29
- *
30
- * @param key The key of the cached data.
31
- * @param data The data to cache.
32
- * @param ttl The optional TTL of the cached data. If not defined, the data is cached forever.
33
- * @returns The cached data.
34
- */
35
- set<T>(key: string, data: T, ttl?: number): Promise<T>;
36
- /**
37
- * Caches data under the given list of keys and an optional TTL.
38
- * @typeParam T The type of the data to cache.
39
- *
40
- * @param data The list of data to cache.
41
- * @returns The list of cached data.
42
- */
43
- mset<T>(data: Array<{
44
- key: string;
45
- value: T;
46
- ttl?: number;
47
- }>): Promise<Array<{
48
- key: string;
49
- value: T;
50
- ttl?: number;
51
- }>>;
52
- /**
53
- * Deletes the cached data with the given key.
54
- * @typeParam T The type of the data to cache.
55
- *
56
- * @param key The key of the cached data.
57
- * @returns `true` if the data was deleted, `false` otherwise.
58
- */
59
- del(key: string): Promise<boolean>;
60
- /**
61
- * Deletes the cached data with the given list of keys.
62
- * @typeParam T The type of the data to cache.
63
- *
64
- * @param keys The list of cached data keys.
65
- * @returns `true` if the data was deleted, `false` otherwise.
66
- */
67
- mdel(keys: string[]): Promise<boolean>;
68
- /**
69
- * Deletes all cached data.
70
- * @returns `true` if the data was deleted, `false` otherwise.
71
- */
72
- clear(): Promise<boolean>;
73
- /**
74
- * Creates a sub-cache with the given tags.
75
- * @param tags The list of tags for the sub-cache.
76
- */
77
- tags(...tags: string[]): Omit<CacheInterface, 'tags'>;
78
- }
79
- export declare abstract class Cache {
80
- #private;
81
- /**
82
- * A weak cache storage for simple non-intrusive caching of data.
83
- * @author Axel Nana <axel.nana@workbud.com>
84
- */
85
- static readonly weak: {
86
- /**
87
- * INTERNAL USAGE ONLY.
88
- * @private
89
- */
90
- map: WeakMap<object, unknown>;
91
- /**
92
- * Gets the cached data for a given context.
93
- * @param ctx The cache context.
94
- * @returns The cached data.
95
- */
96
- get<T extends object>(ctx: object): T;
97
- /**
98
- * Deletes the cached data for a given context.
99
- * @param ctx The cache context.
100
- */
101
- del(ctx: object): void;
102
- };
103
- /**
104
- * Redis-based cache storage.
105
- * @author Axel Nana <axel.nana@workbud.com>
106
- */
107
- static get redis(): CacheInterface;
108
- /**
109
- * Memory-based cache storage.
110
- * @author Axel Nana <axel.nana@workbud.com>
111
- */
112
- static get memory(): CacheInterface;
113
- }
@@ -1,82 +0,0 @@
1
- import type { CacheInterface } from './cache';
2
- import type { DatabaseCacheConfig, DatabaseDriver } from './interfaces';
3
- /**
4
- * Creates a cache storage instance tagged for database use.
5
- * Drivers can use this to build their cache backends.
6
- * @author Axel Nana <axel.nana@workbud.com>
7
- * @param config The database cache configuration.
8
- * @returns A cache interface tagged with 'database'.
9
- */
10
- export declare const createDatabaseCacheStorage: (config: DatabaseCacheConfig) => Omit<CacheInterface, "tags">;
11
- /**
12
- * Abstract database manager.
13
- *
14
- * Manages named database connections using a driver. Connections are
15
- * registered in the service container and can be retrieved by name.
16
- *
17
- * @author Axel Nana <axel.nana@workbud.com>
18
- * @template TConnection The connection type managed by the driver.
19
- * @template TConnectionConfig The configuration used to create a connection.
20
- */
21
- export declare abstract class AbstractDatabase<TConnection, TConnectionConfig> {
22
- /**
23
- * The database driver used to create and manage connections.
24
- */
25
- protected abstract driver: DatabaseDriver<TConnection, TConnectionConfig>;
26
- /**
27
- * Creates a service name for a database connection.
28
- * @param name The name of the connection.
29
- * @returns A service name for the connection.
30
- */
31
- private getConnectionName;
32
- /**
33
- * Retrieves the connection with the given name.
34
- *
35
- * For the default connection, checks the async context for a
36
- * transaction handle (`db:tx`) before falling back to the service container.
37
- *
38
- * @author Axel Nana <axel.nana@workbud.com>
39
- * @param name The connection name.
40
- * @returns The connection with the given name.
41
- */
42
- getConnection(name?: string): TConnection;
43
- /**
44
- * Creates and registers a new connection.
45
- *
46
- * This will make the registered connection available for dependency injection with
47
- * the key `db.connection.{name}`, where `{name}` is replaced with the given name.
48
- *
49
- * @author Axel Nana <axel.nana@workbud.com>
50
- * @param name The connection name.
51
- * @param config The connection configuration.
52
- * @returns The newly created and registered connection.
53
- */
54
- registerConnection(name: string, config: TConnectionConfig): TConnection;
55
- /**
56
- * Checks if a connection with the given name exists.
57
- * @author Axel Nana <axel.nana@workbud.com>
58
- * @param name The name of the connection to check.
59
- * @returns `true` if the connection exists, `false` otherwise.
60
- */
61
- connectionExists(name: string): boolean;
62
- /**
63
- * Retrieves the default connection.
64
- * @author Axel Nana <axel.nana@workbud.com>
65
- * @returns The default connection.
66
- */
67
- getDefaultConnection(): TConnection;
68
- /**
69
- * Sets the default connection.
70
- * @author Axel Nana <axel.nana@workbud.com>
71
- * @param name The name of the connection to set as default.
72
- * @returns The default connection.
73
- */
74
- setDefaultConnection(name: string): TConnection;
75
- /**
76
- * Returns the raw underlying client for the given connection.
77
- * @author Axel Nana <axel.nana@workbud.com>
78
- * @param name The connection name.
79
- * @returns The raw client instance.
80
- */
81
- getRawClient(name?: string): unknown;
82
- }