@travetto/model-file 6.0.1 → 7.0.0-rc.1

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 +7 -7
  2. package/src/service.ts +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-file",
3
- "version": "6.0.1",
3
+ "version": "7.0.0-rc.1",
4
4
  "description": "File system backing for the travetto model module.",
5
5
  "keywords": [
6
6
  "datastore",
@@ -25,14 +25,14 @@
25
25
  "directory": "module/model-file"
26
26
  },
27
27
  "dependencies": {
28
- "@travetto/config": "^6.0.1",
29
- "@travetto/di": "^6.0.1",
30
- "@travetto/model": "^6.0.1",
31
- "@travetto/schema": "^6.0.1"
28
+ "@travetto/config": "^7.0.0-rc.1",
29
+ "@travetto/di": "^7.0.0-rc.1",
30
+ "@travetto/model": "^7.0.0-rc.1",
31
+ "@travetto/schema": "^7.0.0-rc.1"
32
32
  },
33
33
  "peerDependencies": {
34
- "@travetto/cli": "^6.0.1",
35
- "@travetto/test": "^6.0.2"
34
+ "@travetto/cli": "^7.0.0-rc.1",
35
+ "@travetto/test": "^7.0.0-rc.1"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "@travetto/cli": {
package/src/service.ts CHANGED
@@ -9,7 +9,7 @@ import { Injectable } from '@travetto/di';
9
9
  import { Config } from '@travetto/config';
10
10
  import { Required } from '@travetto/schema';
11
11
  import {
12
- ModelCrudSupport, ModelExpirySupport, ModelStorageSupport, ModelType, ModelRegistry,
12
+ ModelCrudSupport, ModelExpirySupport, ModelStorageSupport, ModelType, ModelRegistryIndex,
13
13
  NotFoundError, OptionalId, ExistsError, ModelBlobSupport,
14
14
  ModelCrudUtil, ModelExpiryUtil, ModelBlobUtil
15
15
  } from '@travetto/model';
@@ -66,7 +66,7 @@ export class FileModelService implements ModelCrudSupport, ModelBlobSupport, Mod
66
66
  }
67
67
 
68
68
  async #resolveName<T extends ModelType>(cls: Class<T> | string, suffix?: Suffix, id?: string): Promise<string> {
69
- const name = typeof cls === 'string' ? cls : ModelRegistry.getStore(cls);
69
+ const name = typeof cls === 'string' ? cls : ModelRegistryIndex.getStoreName(cls);
70
70
  let resolved = path.resolve(this.config.folder, this.config.namespace, name);
71
71
  if (id) {
72
72
  resolved = path.resolve(resolved, id.replace(/^[/]/, '').substring(0, 3));
@@ -94,7 +94,7 @@ export class FileModelService implements ModelCrudSupport, ModelBlobSupport, Mod
94
94
  }
95
95
 
96
96
  checkExpiry<T extends ModelType>(cls: Class<T>, item: T): T {
97
- const { expiresAt } = ModelRegistry.get(cls);
97
+ const { expiresAt } = ModelRegistryIndex.getConfig(cls);
98
98
  if (expiresAt && ModelExpiryUtil.getExpiryState(cls, item).expired) {
99
99
  throw new NotFoundError(cls, item.id);
100
100
  }