@travetto/model-firestore 8.0.0-alpha.13 → 8.0.0-alpha.14

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 (2) hide show
  1. package/package.json +2 -2
  2. package/src/service.ts +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-firestore",
3
- "version": "8.0.0-alpha.13",
3
+ "version": "8.0.0-alpha.14",
4
4
  "description": "Firestore backing for the travetto model module.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/firestore": "^8.3.0",
29
29
  "@travetto/config": "^8.0.0-alpha.12",
30
30
  "@travetto/model": "^8.0.0-alpha.12",
31
- "@travetto/model-indexed": "^8.0.0-alpha.13",
31
+ "@travetto/model-indexed": "^8.0.0-alpha.14",
32
32
  "@travetto/runtime": "^8.0.0-alpha.11"
33
33
  },
34
34
  "peerDependencies": {
package/src/service.ts CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  type ModelIndexedSupport, type KeyedIndexSelection, type KeyedIndexBody, type ModelPageOptions, ModelIndexedUtil,
11
11
  type SingleItemIndex, type SortedIndexSelection, type ModelPageResult, type SortedIndex, type FullKeyedIndexBody,
12
- type FullKeyedIndexWithPartialBody, ModelIndexedComputedIndex
12
+ type FullKeyedIndexWithPartialBody, ModelIndexedComputedIndex, warnIfIndexedUniqueIndex, warnIfNonIndexedIndex
13
13
  } from '@travetto/model-indexed';
14
14
 
15
15
  import type { FirestoreModelConfig } from './config.ts';
@@ -119,7 +119,12 @@ export class FirestoreModelService implements ModelCrudSupport, ModelStorageSupp
119
119
  }
120
120
 
121
121
  // Storage
122
- async createStorage(): Promise<void> { }
122
+ async createStorage(): Promise<void> {
123
+ for (const cls of ModelRegistryIndex.getClasses()) {
124
+ warnIfIndexedUniqueIndex(this, cls, ModelRegistryIndex.getIndices(cls));
125
+ warnIfNonIndexedIndex(this, cls, ModelRegistryIndex.getIndices(cls));
126
+ }
127
+ }
123
128
  async deleteStorage(): Promise<void> { }
124
129
 
125
130
  async deleteModel<T extends ModelType>(cls: Class<T>): Promise<void> {