@travetto/model 3.4.0-rc.7 → 3.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model",
3
- "version": "3.4.0-rc.7",
3
+ "version": "3.4.0",
4
4
  "description": "Datastore abstraction for core operations.",
5
5
  "keywords": [
6
6
  "datastore",
@@ -26,14 +26,14 @@
26
26
  "directory": "module/model"
27
27
  },
28
28
  "dependencies": {
29
- "@travetto/config": "^3.4.0-rc.6",
30
- "@travetto/di": "^3.4.0-rc.6",
31
- "@travetto/registry": "^3.4.0-rc.7",
32
- "@travetto/schema": "^3.4.0-rc.6"
29
+ "@travetto/config": "^3.4.0",
30
+ "@travetto/di": "^3.4.0",
31
+ "@travetto/registry": "^3.4.0",
32
+ "@travetto/schema": "^3.4.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "@travetto/cli": "^3.4.0-rc.7",
36
- "@travetto/test": "^3.4.0-rc.6"
35
+ "@travetto/cli": "^3.4.0",
36
+ "@travetto/test": "^3.4.0"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@travetto/cli": {
@@ -1,4 +1,4 @@
1
- import { ConsoleManager, GlobalEnvConfig } from '@travetto/base';
1
+ import { ConsoleManager, EnvInit } from '@travetto/base';
2
2
  import { CliValidationError, CliCommandShape, cliTpl } from '@travetto/cli';
3
3
  import { RootRegistry } from '@travetto/registry';
4
4
 
@@ -16,7 +16,7 @@ export abstract class BaseModelCommand implements CliCommandShape {
16
16
 
17
17
  abstract getOp(): keyof ModelStorageSupport;
18
18
 
19
- envInit(): GlobalEnvConfig {
19
+ envInit(): EnvInit {
20
20
  return { debug: false };
21
21
  }
22
22
 
@@ -40,7 +40,7 @@ export abstract class BaseModelCommand implements CliCommandShape {
40
40
  await RootRegistry.init();
41
41
 
42
42
  const candidates = await ModelCandidateUtil.export(this.getOp());
43
- if (!candidates.providers.includes(provider)) {
43
+ if (provider && !candidates.providers.includes(provider)) {
44
44
  return { message: `provider: ${provider} is not a valid provider`, source: 'arg' };
45
45
  }
46
46
  const badModel = models.find(x => x !== '*' && !candidates.models.includes(x));
@@ -42,7 +42,7 @@ export class ModelCandidateUtil {
42
42
  static async getProviders(op?: keyof ModelStorageSupport): Promise<InjectableConfig[]> {
43
43
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
44
44
  const types = DependencyRegistry.getCandidateTypes<ModelStorageSupport>(ModelStorageSupportTarget as unknown as Class<ModelStorageSupport>);
45
- return types.filter(x => !op || x.class.prototype[op]);
45
+ return types.filter(x => !op || x.class.prototype?.[op]);
46
46
  }
47
47
 
48
48
  /**
@@ -7,7 +7,7 @@ import { ModelCandidateUtil } from './bin/candidate';
7
7
  /**
8
8
  * Exports model schemas
9
9
  */
10
- @CliCommand({ fields: ['env', 'module'] })
10
+ @CliCommand({ addEnv: true, addModule: true })
11
11
  export class ModelExportCommand extends BaseModelCommand {
12
12
 
13
13
  getOp(): 'exportModel' { return 'exportModel'; }
@@ -7,7 +7,7 @@ import { ModelCandidateUtil } from './bin/candidate';
7
7
  /**
8
8
  * Installing models
9
9
  */
10
- @CliCommand({ fields: ['env', 'module'] })
10
+ @CliCommand({ addEnv: true, addModule: true })
11
11
  export class ModelInstallCommand extends BaseModelCommand {
12
12
 
13
13
  getOp(): 'createModel' { return 'createModel'; }
@@ -12,7 +12,7 @@ import { ModelStreamSupport } from '../../src/service/stream';
12
12
  @Suite()
13
13
  export abstract class ModelStreamSuite extends BaseModelSuite<ModelStreamSupport> {
14
14
 
15
- fixture = new TestFixtures(['@travetto/model#support/fixtures']);
15
+ fixture = new TestFixtures(['@travetto/model']);
16
16
 
17
17
  async getHash(stream: Readable): Promise<string> {
18
18
  const hash = crypto.createHash('sha1');