@travetto/model 3.0.0-rc.10 → 3.0.0-rc.11

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/README.md CHANGED
@@ -388,8 +388,6 @@ Usage: model:export [options] [provider] [models...]
388
388
  Options:
389
389
  -e, --env <env> Application environment
390
390
  -h, --help display help for command
391
-
392
- 
393
391
  ```
394
392
 
395
393
  ## CLI - model:install
@@ -405,6 +403,4 @@ Usage: model:install [options] [provider] [models...]
405
403
  Options:
406
404
  -e, --env <env> Application environment
407
405
  -h, --help display help for command
408
-
409
- 
410
406
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model",
3
- "version": "3.0.0-rc.10",
3
+ "version": "3.0.0-rc.11",
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.0.0-rc.10",
30
- "@travetto/di": "^3.0.0-rc.10",
31
- "@travetto/registry": "^3.0.0-rc.10",
32
- "@travetto/schema": "^3.0.0-rc.10"
29
+ "@travetto/config": "^3.0.0-rc.11",
30
+ "@travetto/di": "^3.0.0-rc.11",
31
+ "@travetto/registry": "^3.0.0-rc.11",
32
+ "@travetto/schema": "^3.0.0-rc.11"
33
33
  },
34
34
  "peerDependencies": {
35
- "@travetto/cli": "^3.0.0-rc.8",
36
- "@travetto/test": "^3.0.0-rc.11"
35
+ "@travetto/cli": "^3.0.0-rc.9",
36
+ "@travetto/test": "^3.0.0-rc.12"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@travetto/cli": {
@@ -3,6 +3,8 @@ import { Class, ExecUtil } from '@travetto/base';
3
3
  import { GlobalTerminal } from '@travetto/terminal';
4
4
  import { ModelRegistry } from '@travetto/model';
5
5
  import { InjectableConfig, DependencyRegistry } from '@travetto/di';
6
+ import { RootRegistry } from '@travetto/registry';
7
+
6
8
  import { ModelStorageSupportTarget } from '@travetto/model/src/internal/service/common';
7
9
 
8
10
  import type { ModelStorageSupport } from '../../src/service/storage';
@@ -15,6 +17,10 @@ type CandidateNames = { providers: string[], models: string[] };
15
17
  */
16
18
  export class ModelCandidateUtil {
17
19
 
20
+ static async export(op: keyof ModelStorageSupport): Promise<{ models: string[], providers: string[] }> {
21
+ return { models: await this.getModelNames(), providers: await this.getProviderNames(op) };
22
+ }
23
+
18
24
  /**
19
25
  * Get all models
20
26
  */
@@ -64,8 +70,10 @@ export class ModelCandidateUtil {
64
70
  * @returns
65
71
  */
66
72
  static async getCandidates(op: keyof ModelStorageSupport): Promise<CandidateNames> {
67
- const main = RootIndex.resolveFileImport('@travetto/model/support/main.candidate.ts');
68
- return GlobalTerminal.withWaiting('Resolving', ExecUtil.worker<CandidateNames>(main, [op]).message);
73
+ return GlobalTerminal.withWaiting('Resolving', ExecUtil.worker<CandidateNames>(
74
+ RootIndex.resolveFileImport('@travetto/cli/support/cli.ts'),
75
+ ['main', '@travetto/model/support/bin/candidate.ts', op]
76
+ ).message);
69
77
  }
70
78
 
71
79
  /**
@@ -80,4 +88,12 @@ export class ModelCandidateUtil {
80
88
  models: await this.#getModels(models)
81
89
  };
82
90
  }
91
+ }
92
+
93
+ /**
94
+ * Handles direct invocation
95
+ */
96
+ export async function main(op: keyof ModelStorageSupport): Promise<{ models: string[], providers: string[] }> {
97
+ await RootRegistry.init();
98
+ return await ModelCandidateUtil.export(op);
83
99
  }
@@ -1,16 +0,0 @@
1
- import { RootRegistry } from '@travetto/registry';
2
-
3
- import type { ModelStorageSupport } from '../src/service/storage';
4
- import { ModelCandidateUtil } from './bin/candidate';
5
-
6
- /**
7
- * Handles direct invocation
8
- */
9
- export async function main(op: keyof ModelStorageSupport): Promise<{ models: string[], providers: string[] }> {
10
- await RootRegistry.init();
11
-
12
- return {
13
- models: await ModelCandidateUtil.getModelNames(),
14
- providers: await ModelCandidateUtil.getProviderNames(op)
15
- };
16
- }