@toa.io/cli 0.24.0-alpha.12 → 0.24.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/cli",
3
- "version": "0.24.0-alpha.12",
3
+ "version": "0.24.0-alpha.14",
4
4
  "description": "Toa CLI",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -22,15 +22,16 @@
22
22
  "@toa.io/runtime": "*"
23
23
  },
24
24
  "dependencies": {
25
- "@toa.io/console": "0.24.0-alpha.12",
26
- "@toa.io/generic": "0.24.0-alpha.12",
27
- "@toa.io/kubernetes": "0.24.0-alpha.12",
28
- "@toa.io/norm": "0.24.0-alpha.12",
29
- "@toa.io/yaml": "0.24.0-alpha.12",
25
+ "@toa.io/console": "0.24.0-alpha.14",
26
+ "@toa.io/generic": "0.24.0-alpha.14",
27
+ "@toa.io/kubernetes": "0.24.0-alpha.14",
28
+ "@toa.io/norm": "0.24.0-alpha.14",
29
+ "@toa.io/operations": "0.24.0-alpha.14",
30
+ "@toa.io/yaml": "0.24.0-alpha.14",
30
31
  "dotenv": "16.1.1",
31
32
  "find-up": "5.0.0",
32
33
  "paseto": "3.1.4",
33
34
  "yargs": "17.6.2"
34
35
  },
35
- "gitHead": "cf9fb7440e4f300b4b89c187d8082d7e7e99ec10"
36
+ "gitHead": "ffa777fa0c5fd43bad15a9f94b1fa74c486ec172"
36
37
  }
@@ -1,11 +1,12 @@
1
1
  'use strict'
2
2
 
3
3
  const { context: find } = require('../util/find')
4
- const operations = require('./operations')
4
+ const { deployment: { Factory } } = require('@toa.io/operations')
5
5
 
6
6
  const build = async (argv) => {
7
7
  const path = find(argv.path)
8
- const registry = await operations.registry(path)
8
+ const factory = await Factory.create(path, argv.environment)
9
+ const registry = factory.registry()
9
10
 
10
11
  await registry.build()
11
12
  }
@@ -1,9 +1,9 @@
1
1
  'use strict'
2
2
 
3
+ const { deployment: { Factory } } = require('@toa.io/operations')
3
4
  const { secrets } = require('@toa.io/kubernetes')
4
5
  const { context: find } = require('../util/find')
5
6
  const { promptSecrets } = require('./env')
6
- const operations = require('./operations')
7
7
 
8
8
  const conceal = async (argv) => {
9
9
  if (argv.interactive) await concealValues(argv)
@@ -28,7 +28,8 @@ async function concealValue (argv) {
28
28
 
29
29
  async function concealValues (argv) {
30
30
  const path = find(argv.path)
31
- const operator = await operations.operator(path, argv.environment)
31
+ const factory = await Factory.create(path, argv.environment)
32
+ const operator = factory.operator()
32
33
  const variables = operator.variables()
33
34
  const values = await promptSecrets(variables)
34
35
  const groups = groupValues(values)
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const operations = require('./operations')
3
+ const { deployment: { Factory } } = require('@toa.io/operations')
4
4
  const { context: find } = require('../util/find')
5
5
 
6
6
  /**
@@ -9,7 +9,8 @@ const { context: find } = require('../util/find')
9
9
  */
10
10
  const deploy = async (argv) => {
11
11
  const path = find(argv.path)
12
- const operator = await operations.operator(path, argv.environment)
12
+ const factory = await Factory.create(path, argv.environment)
13
+ const operator = factory.operator()
13
14
 
14
15
  if (argv.dry === true) {
15
16
  const options = {}
@@ -4,14 +4,15 @@ const { join } = require('node:path')
4
4
  const readline = require('node:readline/promises')
5
5
  const { stdin: input, stdout: output } = require('node:process')
6
6
  const dotenv = require('dotenv')
7
+ const { deployment: { Factory } } = require('@toa.io/operations')
7
8
  const { file } = require('@toa.io/filesystem')
8
- const operations = require('./operations')
9
9
  const { context: find } = require('../util/find')
10
10
 
11
11
  async function env (argv) {
12
12
  const path = find(argv.path)
13
13
  const filepath = join(path, argv.as)
14
- const operator = await operations.operator(path, argv.environment)
14
+ const factory = await Factory.create(path, argv.environment)
15
+ const operator = factory.operator()
15
16
  const variables = operator.variables()
16
17
  const currentValues = await read(filepath)
17
18
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  const { console } = require('@toa.io/console')
4
4
  const { context: find } = require('../../util/find')
5
- const operations = require('../operations')
5
+ const { deployment: { Factory } } = require('@toa.io/operations')
6
6
 
7
7
  /**
8
8
  * @param {{ path: string, target: string, environment?: string }} argv
@@ -10,7 +10,8 @@ const operations = require('../operations')
10
10
  */
11
11
  const dump = async (argv) => {
12
12
  const path = find(argv.path)
13
- const operator = await operations.operator(path, argv.environment)
13
+ const factory = await Factory.create(path, argv.environment)
14
+ const operator = factory.operator()
14
15
  const target = await operator.export(argv.target)
15
16
 
16
17
  console.log(target)
@@ -2,11 +2,12 @@
2
2
 
3
3
  const { console } = require('@toa.io/console')
4
4
  const { context: find } = require('../../util/find')
5
- const operations = require('../operations')
5
+ const { deployment: { Factory } } = require('@toa.io/operations')
6
6
 
7
7
  const prepare = async (argv) => {
8
8
  const path = find(argv.path)
9
- const operator = await operations.operator(path, argv.environment)
9
+ const factory = await Factory.create(path, argv.environment)
10
+ const operator = factory.operator()
10
11
  const target = await operator.prepare(argv.target)
11
12
 
12
13
  console.log(target)
@@ -1,11 +1,12 @@
1
1
  'use strict'
2
2
 
3
- const operations = require('./operations')
3
+ const { deployment: { Factory } } = require('@toa.io/operations')
4
4
  const { context: find } = require('../util/find')
5
5
 
6
6
  const push = async (argv) => {
7
7
  const path = find(argv.path)
8
- const registry = await operations.registry(path)
8
+ const factory = await Factory.create(path)
9
+ const registry = factory.registry()
9
10
 
10
11
  await registry.push()
11
12
  }
@@ -1,7 +0,0 @@
1
- 'use strict'
2
-
3
- const { operator } = require('./operator')
4
- const { registry } = require('./registry')
5
-
6
- exports.operator = operator
7
- exports.registry = registry
@@ -1,13 +0,0 @@
1
- 'use strict'
2
-
3
- const { context: load } = require('@toa.io/norm')
4
- const { deployment: { Factory } } = require('@toa.io/operations')
5
-
6
- async function operator (path, environment) {
7
- const context = await load(path, environment)
8
- const factory = new Factory(context)
9
-
10
- return factory.operator()
11
- }
12
-
13
- exports.operator = operator
@@ -1,13 +0,0 @@
1
- 'use strict'
2
-
3
- const { context: load } = require('@toa.io/norm')
4
- const { deployment: { Factory } } = require('@toa.io/operations')
5
-
6
- async function registry (path) {
7
- const context = await load(path)
8
- const factory = new Factory(context)
9
-
10
- return factory.registry()
11
- }
12
-
13
- exports.registry = registry