@travetto/model-file 5.0.17 → 5.1.0

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 +7 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-file",
3
- "version": "5.0.17",
3
+ "version": "5.1.0",
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": "^5.0.16",
29
- "@travetto/di": "^5.0.16",
30
- "@travetto/model": "^5.0.17",
31
- "@travetto/schema": "^5.0.16"
28
+ "@travetto/config": "^5.1.0",
29
+ "@travetto/di": "^5.1.0",
30
+ "@travetto/model": "^5.1.0",
31
+ "@travetto/schema": "^5.1.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@travetto/cli": "^5.0.19",
35
- "@travetto/test": "^5.0.18"
34
+ "@travetto/cli": "^5.1.0",
35
+ "@travetto/test": "^5.1.0"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "@travetto/cli": {
package/src/service.ts CHANGED
@@ -43,7 +43,8 @@ const exists = (f: string): Promise<boolean> => fs.stat(f).then(() => true, () =
43
43
  @Injectable()
44
44
  export class FileModelService implements ModelCrudSupport, ModelBlobSupport, ModelExpirySupport, ModelStorageSupport {
45
45
 
46
- private static async * scanFolder(folder: string, suffix: string): AsyncGenerator<[id: string, field: string]> {
46
+ /** @private */
47
+ static async * scanFolder(folder: string, suffix: string): AsyncGenerator<[id: string, field: string]> {
47
48
  for (const sub of await fs.readdir(folder)) {
48
49
  for (const file of await fs.readdir(path.resolve(folder, sub))) {
49
50
  if (file.endsWith(suffix)) {
@@ -54,15 +55,16 @@ export class FileModelService implements ModelCrudSupport, ModelBlobSupport, Mod
54
55
  }
55
56
 
56
57
  idSource = ModelCrudUtil.uuidSource();
58
+ config: FileModelConfig;
57
59
 
58
- get client(): string {
59
- return this.config.folder;
60
- }
60
+ constructor(config: FileModelConfig) { this.config = config; }
61
61
 
62
62
  /**
63
63
  * The root location for all activity
64
64
  */
65
- constructor(public readonly config: FileModelConfig) { }
65
+ get client(): string {
66
+ return this.config.folder;
67
+ }
66
68
 
67
69
  async #resolveName<T extends ModelType>(cls: Class<T> | string, suffix?: Suffix, id?: string): Promise<string> {
68
70
  const name = typeof cls === 'string' ? cls : ModelRegistry.getStore(cls);