@travetto/model-redis 8.0.0-alpha.13 → 8.0.0-alpha.15
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/package.json +5 -5
- package/src/service.ts +7 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-redis",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Redis backing for the travetto model module.",
|
|
6
6
|
"keywords": [
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@redis/client": "^5.11.0",
|
|
30
|
-
"@travetto/config": "^8.0.0-alpha.
|
|
31
|
-
"@travetto/model": "^8.0.0-alpha.
|
|
32
|
-
"@travetto/model-indexed": "^8.0.0-alpha.
|
|
30
|
+
"@travetto/config": "^8.0.0-alpha.13",
|
|
31
|
+
"@travetto/model": "^8.0.0-alpha.13",
|
|
32
|
+
"@travetto/model-indexed": "^8.0.0-alpha.15"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@travetto/cli": "^8.0.0-alpha.
|
|
35
|
+
"@travetto/cli": "^8.0.0-alpha.18"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"@travetto/cli": {
|
package/src/service.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type ModelIndexedSupport, type KeyedIndexSelection, type KeyedIndexBody, type ModelPageOptions, ModelIndexedUtil,
|
|
11
11
|
type SingleItemIndex, type SortedIndexSelection, type ModelPageResult, type SortedIndex, isModelIndexedIndex,
|
|
12
12
|
type FullKeyedIndexWithPartialBody, type FullKeyedIndexBody, ModelIndexedComputedIndex,
|
|
13
|
+
warnIfIndexedUniqueIndex, warnIfNonIndexedIndex,
|
|
13
14
|
} from '@travetto/model-indexed';
|
|
14
15
|
|
|
15
16
|
import { Injectable, PostConstruct } from '@travetto/di';
|
|
@@ -250,11 +251,8 @@ export class RedisModelService implements ModelCrudSupport, ModelExpirySupport,
|
|
|
250
251
|
await ModelStorageUtil.storageInitialization(this);
|
|
251
252
|
ShutdownManager.signal.addEventListener('abort', () => this.client.close());
|
|
252
253
|
for (const cls of ModelRegistryIndex.getClasses()) {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
console.warn('Non-indexed indices are not supported in redis for', { cls: cls.Ⲑid, idx: idx.name });
|
|
256
|
-
}
|
|
257
|
-
}
|
|
254
|
+
warnIfIndexedUniqueIndex(this, cls, ModelRegistryIndex.getIndices(cls));
|
|
255
|
+
warnIfNonIndexedIndex(this, cls, ModelRegistryIndex.getIndices(cls));
|
|
258
256
|
}
|
|
259
257
|
}
|
|
260
258
|
|
|
@@ -328,7 +326,10 @@ export class RedisModelService implements ModelCrudSupport, ModelExpirySupport,
|
|
|
328
326
|
|
|
329
327
|
// Storage
|
|
330
328
|
async createStorage(): Promise<void> {
|
|
331
|
-
|
|
329
|
+
for (const cls of ModelRegistryIndex.getClasses()) {
|
|
330
|
+
warnIfIndexedUniqueIndex(this, cls, ModelRegistryIndex.getIndices(cls));
|
|
331
|
+
warnIfNonIndexedIndex(this, cls, ModelRegistryIndex.getIndices(cls));
|
|
332
|
+
}
|
|
332
333
|
}
|
|
333
334
|
|
|
334
335
|
async deleteStorage(): Promise<void> {
|