@vertesia/cli 1.3.0 → 1.4.0-dev.20260615.051508Z
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/lib/agent-context.d.ts +8 -2
- package/lib/agent-context.d.ts.map +1 -1
- package/lib/agent-context.js +9 -13
- package/lib/agent-context.js.map +1 -1
- package/lib/agents/index.d.ts +3 -0
- package/lib/agents/index.d.ts.map +1 -0
- package/lib/agents/index.js +555 -0
- package/lib/agents/index.js.map +1 -0
- package/lib/apps/commands.d.ts +25 -10
- package/lib/apps/commands.d.ts.map +1 -1
- package/lib/apps/commands.js +34 -26
- package/lib/apps/commands.js.map +1 -1
- package/lib/apps/index.d.ts +1 -1
- package/lib/apps/index.d.ts.map +1 -1
- package/lib/apps/index.js +40 -41
- package/lib/apps/index.js.map +1 -1
- package/lib/artifacts/commands.d.ts +13 -5
- package/lib/artifacts/commands.d.ts.map +1 -1
- package/lib/artifacts/commands.js +10 -10
- package/lib/artifacts/commands.js.map +1 -1
- package/lib/artifacts/index.d.ts +1 -1
- package/lib/artifacts/index.d.ts.map +1 -1
- package/lib/artifacts/index.js +22 -17
- package/lib/artifacts/index.js.map +1 -1
- package/lib/client.d.ts +2 -2
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +45 -21
- package/lib/client.js.map +1 -1
- package/lib/data/commands.d.ts +16 -3
- package/lib/data/commands.d.ts.map +1 -1
- package/lib/data/commands.js +36 -43
- package/lib/data/commands.js.map +1 -1
- package/lib/data/index.d.ts +1 -1
- package/lib/data/index.d.ts.map +1 -1
- package/lib/data/index.js +14 -15
- package/lib/data/index.js.map +1 -1
- package/lib/envs/index.d.ts +2 -2
- package/lib/envs/index.d.ts.map +1 -1
- package/lib/envs/index.js +12 -10
- package/lib/envs/index.js.map +1 -1
- package/lib/iam/commands.d.ts +15 -3
- package/lib/iam/commands.d.ts.map +1 -1
- package/lib/iam/commands.js +27 -9
- package/lib/iam/commands.js.map +1 -1
- package/lib/iam/index.d.ts +1 -1
- package/lib/iam/index.d.ts.map +1 -1
- package/lib/iam/index.js +2 -3
- package/lib/iam/index.js.map +1 -1
- package/lib/index.js +157 -122
- package/lib/index.js.map +1 -1
- package/lib/interactions/index.d.ts +2 -2
- package/lib/interactions/index.d.ts.map +1 -1
- package/lib/interactions/index.js +20 -14
- package/lib/interactions/index.js.map +1 -1
- package/lib/objects/commands.d.ts +49 -14
- package/lib/objects/commands.d.ts.map +1 -1
- package/lib/objects/commands.js +185 -32
- package/lib/objects/commands.js.map +1 -1
- package/lib/objects/index.d.ts +1 -1
- package/lib/objects/index.d.ts.map +1 -1
- package/lib/objects/index.js +46 -13
- package/lib/objects/index.js.map +1 -1
- package/lib/package.d.ts +7 -3
- package/lib/package.d.ts.map +1 -1
- package/lib/package.js +25 -13
- package/lib/package.js.map +1 -1
- package/lib/profiles/auth.d.ts +14 -0
- package/lib/profiles/auth.d.ts.map +1 -0
- package/lib/profiles/auth.js +65 -0
- package/lib/profiles/auth.js.map +1 -0
- package/lib/profiles/commands.d.ts +15 -4
- package/lib/profiles/commands.d.ts.map +1 -1
- package/lib/profiles/commands.js +384 -57
- package/lib/profiles/commands.js.map +1 -1
- package/lib/profiles/git.d.ts +9 -0
- package/lib/profiles/git.d.ts.map +1 -0
- package/lib/profiles/git.js +211 -0
- package/lib/profiles/git.js.map +1 -0
- package/lib/profiles/index.d.ts +17 -7
- package/lib/profiles/index.d.ts.map +1 -1
- package/lib/profiles/index.js +215 -66
- package/lib/profiles/index.js.map +1 -1
- package/lib/profiles/keyring.d.ts +23 -0
- package/lib/profiles/keyring.d.ts.map +1 -0
- package/lib/profiles/keyring.js +111 -0
- package/lib/profiles/keyring.js.map +1 -0
- package/lib/profiles/oauth.d.ts +17 -0
- package/lib/profiles/oauth.d.ts.map +1 -0
- package/lib/profiles/oauth.js +414 -0
- package/lib/profiles/oauth.js.map +1 -0
- package/lib/profiles/server/cors.d.ts +1 -1
- package/lib/profiles/server/cors.d.ts.map +1 -1
- package/lib/profiles/server/cors.js +1 -1
- package/lib/profiles/server/cors.js.map +1 -1
- package/lib/profiles/server/index.d.ts +9 -1
- package/lib/profiles/server/index.d.ts.map +1 -1
- package/lib/profiles/server/index.js +111 -47
- package/lib/profiles/server/index.js.map +1 -1
- package/lib/profiles/server/server.d.ts +1 -1
- package/lib/profiles/server/server.d.ts.map +1 -1
- package/lib/profiles/server/server.js +10 -13
- package/lib/profiles/server/server.js.map +1 -1
- package/lib/projects/index.d.ts +2 -1
- package/lib/projects/index.d.ts.map +1 -1
- package/lib/projects/index.js +53 -5
- package/lib/projects/index.js.map +1 -1
- package/lib/run/executor.d.ts +11 -7
- package/lib/run/executor.d.ts.map +1 -1
- package/lib/run/executor.js +30 -23
- package/lib/run/executor.js.map +1 -1
- package/lib/run/index.d.ts +14 -2
- package/lib/run/index.d.ts.map +1 -1
- package/lib/run/index.js +14 -12
- package/lib/run/index.js.map +1 -1
- package/lib/runs/index.d.ts +18 -2
- package/lib/runs/index.d.ts.map +1 -1
- package/lib/runs/index.js +9 -7
- package/lib/runs/index.js.map +1 -1
- package/lib/utils/console.d.ts +1 -1
- package/lib/utils/console.d.ts.map +1 -1
- package/lib/utils/console.js +24 -33
- package/lib/utils/console.js.map +1 -1
- package/lib/utils/options.d.ts +8 -0
- package/lib/utils/options.d.ts.map +1 -0
- package/lib/utils/options.js +19 -0
- package/lib/utils/options.js.map +1 -0
- package/lib/utils/stdio.js +3 -2
- package/lib/utils/stdio.js.map +1 -1
- package/lib/workflows/commands.d.ts +44 -13
- package/lib/workflows/commands.d.ts.map +1 -1
- package/lib/workflows/commands.js +69 -50
- package/lib/workflows/commands.js.map +1 -1
- package/lib/workflows/index.d.ts +1 -1
- package/lib/workflows/index.d.ts.map +1 -1
- package/lib/workflows/index.js +56 -56
- package/lib/workflows/index.js.map +1 -1
- package/lib/workflows/json-loader.d.ts +1 -1
- package/lib/workflows/json-loader.d.ts.map +1 -1
- package/lib/workflows/json-loader.js +5 -4
- package/lib/workflows/json-loader.js.map +1 -1
- package/lib/workflows/streams.d.ts +8 -1
- package/lib/workflows/streams.d.ts.map +1 -1
- package/lib/workflows/streams.js +107 -84
- package/lib/workflows/streams.js.map +1 -1
- package/lib/workflows/ts-loader.d.ts +1 -1
- package/lib/workflows/ts-loader.d.ts.map +1 -1
- package/lib/workflows/ts-loader.js +21 -20
- package/lib/workflows/ts-loader.js.map +1 -1
- package/lib/workflows/validation.d.ts +1 -1
- package/lib/workflows/validation.d.ts.map +1 -1
- package/lib/workflows/validation.js +11 -11
- package/lib/workflows/validation.js.map +1 -1
- package/package.json +21 -24
- package/bin/docker-credential-vertesia.js +0 -3
- package/lib/codegen/CodeBuilder.d.ts +0 -16
- package/lib/codegen/CodeBuilder.d.ts.map +0 -1
- package/lib/codegen/CodeBuilder.js +0 -99
- package/lib/codegen/CodeBuilder.js.map +0 -1
- package/lib/codegen/InteractionVersion.d.ts +0 -29
- package/lib/codegen/InteractionVersion.d.ts.map +0 -1
- package/lib/codegen/InteractionVersion.js +0 -80
- package/lib/codegen/InteractionVersion.js.map +0 -1
- package/lib/codegen/index.d.ts +0 -3
- package/lib/codegen/index.d.ts.map +0 -1
- package/lib/codegen/index.js +0 -30
- package/lib/codegen/index.js.map +0 -1
- package/lib/codegen/template.d.ts +0 -3
- package/lib/codegen/template.d.ts.map +0 -1
- package/lib/codegen/template.js +0 -28
- package/lib/codegen/template.js.map +0 -1
- package/lib/codegen/utils.d.ts +0 -2
- package/lib/codegen/utils.d.ts.map +0 -1
- package/lib/codegen/utils.js +0 -4
- package/lib/codegen/utils.js.map +0 -1
- package/lib/datagen/index.d.ts +0 -3
- package/lib/datagen/index.d.ts.map +0 -1
- package/lib/datagen/index.js +0 -81
- package/lib/datagen/index.js.map +0 -1
- package/lib/memory/index.d.ts +0 -3
- package/lib/memory/index.d.ts.map +0 -1
- package/lib/memory/index.js +0 -15
- package/lib/memory/index.js.map +0 -1
- package/lib/worker/commands.d.ts +0 -11
- package/lib/worker/commands.d.ts.map +0 -1
- package/lib/worker/commands.js +0 -173
- package/lib/worker/commands.js.map +0 -1
- package/lib/worker/connect.d.ts +0 -7
- package/lib/worker/connect.d.ts.map +0 -1
- package/lib/worker/connect.js +0 -68
- package/lib/worker/connect.js.map +0 -1
- package/lib/worker/docker-credential.d.ts +0 -2
- package/lib/worker/docker-credential.d.ts.map +0 -1
- package/lib/worker/docker-credential.js +0 -51
- package/lib/worker/docker-credential.js.map +0 -1
- package/lib/worker/docker.d.ts +0 -10
- package/lib/worker/docker.d.ts.map +0 -1
- package/lib/worker/docker.js +0 -93
- package/lib/worker/docker.js.map +0 -1
- package/lib/worker/index.d.ts +0 -3
- package/lib/worker/index.d.ts.map +0 -1
- package/lib/worker/index.js +0 -90
- package/lib/worker/index.js.map +0 -1
- package/lib/worker/project.d.ts +0 -58
- package/lib/worker/project.d.ts.map +0 -1
- package/lib/worker/project.js +0 -125
- package/lib/worker/project.js.map +0 -1
- package/lib/worker/refresh.d.ts +0 -6
- package/lib/worker/refresh.d.ts.map +0 -1
- package/lib/worker/refresh.js +0 -47
- package/lib/worker/refresh.js.map +0 -1
- package/lib/worker/registry.d.ts +0 -7
- package/lib/worker/registry.d.ts.map +0 -1
- package/lib/worker/registry.js +0 -47
- package/lib/worker/registry.js.map +0 -1
- package/lib/worker/version.d.ts +0 -2
- package/lib/worker/version.d.ts.map +0 -1
- package/lib/worker/version.js +0 -4
- package/lib/worker/version.js.map +0 -1
package/lib/index.js
CHANGED
|
@@ -1,84 +1,106 @@
|
|
|
1
|
-
import { setupMemoCommand } from '@vertesia/memory-cli';
|
|
2
1
|
import { Command } from 'commander';
|
|
2
|
+
import { registerAgentsCommand } from './agents/index.js';
|
|
3
3
|
import { registerAppsCommand } from './apps/index.js';
|
|
4
4
|
import { registerArtifactsCommand } from './artifacts/index.js';
|
|
5
|
-
import runExport from './codegen/index.js';
|
|
6
5
|
import { registerDataCommand } from './data/index.js';
|
|
7
|
-
import { genTestData } from './datagen/index.js';
|
|
8
|
-
import { registerIamCommand } from './iam/index.js';
|
|
9
6
|
import { listEnvironments } from './envs/index.js';
|
|
7
|
+
import { registerIamCommand } from './iam/index.js';
|
|
10
8
|
import { listInteractions } from './interactions/index.js';
|
|
11
|
-
import { getPublishMemoryAction } from './memory/index.js';
|
|
12
9
|
import { registerObjectsCommand } from './objects/index.js';
|
|
13
10
|
import { getVersion, upgrade } from './package.js';
|
|
14
|
-
import { createProfile, deleteProfile, listProfiles, showActiveAuthToken, showProfile, tryRefreshToken, updateCurrentProfile, updateProfile, useProfile } from './profiles/commands.js';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
11
|
+
import { createProfile, deleteProfile, listProfiles, loginProfile, logoutProfile, showActiveAuthToken, showActiveIdToken, showAuthDetails, showProfile, tryRefreshToken, updateCurrentProfile, updateProfile, useProfile, } from './profiles/commands.js';
|
|
12
|
+
import { configureGitAuth, serveGitCredential } from './profiles/git.js';
|
|
13
|
+
import { AVAILABLE_REGIONS, config, DEFAULT_REGION, getConfigFile } from './profiles/index.js';
|
|
14
|
+
import { listProjects, useProject } from './projects/index.js';
|
|
17
15
|
import runInteraction from './run/index.js';
|
|
18
16
|
import { runHistory } from './runs/index.js';
|
|
19
|
-
import {
|
|
17
|
+
import { getBooleanOption, hasStatus } from './utils/options.js';
|
|
20
18
|
import { registerWorkflowsCommand } from './workflows/index.js';
|
|
21
19
|
//warnIfNotLatest();
|
|
22
20
|
const program = new Command();
|
|
23
|
-
program
|
|
24
|
-
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
listProjects(program);
|
|
32
|
-
});
|
|
33
|
-
const authRoot = program.command("auth")
|
|
34
|
-
.description("Manage authentication");
|
|
35
|
-
authRoot.command("token")
|
|
36
|
-
.description("Show the auth token used by the current selected profile.")
|
|
37
|
-
.action(() => {
|
|
38
|
-
showActiveAuthToken();
|
|
21
|
+
program
|
|
22
|
+
.version(getVersion())
|
|
23
|
+
.option('-p, --profile <profile>', 'Use the named profile for this command without changing the default profile');
|
|
24
|
+
program.hook('preAction', (command) => {
|
|
25
|
+
const profile = command.optsWithGlobals().profile;
|
|
26
|
+
if (profile) {
|
|
27
|
+
config.use(profile, { explicit: true });
|
|
28
|
+
}
|
|
39
29
|
});
|
|
40
|
-
|
|
30
|
+
program
|
|
31
|
+
.command('upgrade')
|
|
32
|
+
.description('Upgrade to the latest version of the CLI')
|
|
33
|
+
.option('-y, --yes', 'Skip the confirmation prompt')
|
|
34
|
+
.action((options = {}) => upgrade(getBooleanOption(options.yes)));
|
|
35
|
+
const projectsRoot = program
|
|
36
|
+
.command('projects')
|
|
37
|
+
.description('List the projects you have access to')
|
|
38
|
+
.action(() => listProjects(program));
|
|
39
|
+
projectsRoot
|
|
40
|
+
.command('use [project]')
|
|
41
|
+
.description('Switch the current profile to a project without running a browser OAuth flow')
|
|
42
|
+
.option('-p, --project <project>', 'The project ID to use')
|
|
43
|
+
.action((project, options) => useProject(program, options.project || project));
|
|
44
|
+
const authRoot = program.command('auth').description('Manage authentication');
|
|
45
|
+
authRoot
|
|
46
|
+
.command('login [profile]')
|
|
47
|
+
.description('Authenticate a profile, creating it when it does not exist')
|
|
48
|
+
.option('-t, --target <env>', 'The target environment for a new profile. Possible values are: local, dev-main, dev-preview, preview, prod or a custom URL.')
|
|
49
|
+
.option('-r, --region <region>', `Deployment region for a new profile: ${AVAILABLE_REGIONS.join(', ')}. Defaults to ${DEFAULT_REGION}. Only applies to preview and prod targets.`)
|
|
50
|
+
.option('-p, --project <project>', 'Authenticate for the given project ID')
|
|
51
|
+
.option('-a, --account <account>', 'The account ID to use when creating a profile')
|
|
52
|
+
.action(async (profile, options) => {
|
|
53
|
+
await loginProfile(profile, options);
|
|
54
|
+
});
|
|
55
|
+
authRoot
|
|
56
|
+
.command('logout [profile]')
|
|
57
|
+
.description('Remove stored credentials for a profile without deleting the profile')
|
|
58
|
+
.action((profile) => logoutProfile(profile));
|
|
59
|
+
authRoot
|
|
60
|
+
.command('token')
|
|
61
|
+
.description('Show the auth token used by the current selected profile.')
|
|
62
|
+
.action(() => showActiveAuthToken());
|
|
63
|
+
authRoot
|
|
64
|
+
.command('id-token')
|
|
65
|
+
.description('Show the ID token stored for the current selected profile.')
|
|
66
|
+
.action(() => showActiveIdToken());
|
|
67
|
+
authRoot
|
|
68
|
+
.command('details')
|
|
69
|
+
.alias('info')
|
|
70
|
+
.description('Show non-secret authentication details for the active credential.')
|
|
71
|
+
.option('--json', 'Print authentication details as JSON.')
|
|
72
|
+
.action((options) => showAuthDetails(options));
|
|
73
|
+
authRoot
|
|
74
|
+
.command('refresh')
|
|
41
75
|
.description("Refresh the auth token used by the current profile. An alias to 'vertesia profiles refresh'.")
|
|
42
|
-
.
|
|
43
|
-
updateCurrentProfile();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.description(
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.
|
|
61
|
-
.
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
.
|
|
65
|
-
.
|
|
66
|
-
.
|
|
67
|
-
|
|
68
|
-
.
|
|
69
|
-
.
|
|
70
|
-
.action((interactionId, options) => {
|
|
71
|
-
genTestData(program, interactionId, options);
|
|
72
|
-
});
|
|
73
|
-
program.command("codegen [interactionName]")
|
|
74
|
-
.description("Generate code given an interaction name of for all the interactions in the project if no interaction is specified.")
|
|
75
|
-
.option('--versions [versions]', 'A comma separated list of version selectors to include. A version selector is either a version number or "draft". The default is "draft"', "draft")
|
|
76
|
-
.option('-a, --all', 'When used, all the interaction versions will be exported')
|
|
77
|
-
.option('-d, --dir [file]', 'The output directory if any. Default to "./interactions" if not specified.', './interactions')
|
|
78
|
-
.option('-x, --export <version>', 'The version to export from index.ts. If not specified, the latest version will be exported or if no version is available, the draft version will be exported')
|
|
79
|
-
.action((interactionName, options) => runExport(program, interactionName, options));
|
|
80
|
-
program.command("run <interaction>")
|
|
81
|
-
.description("Run an interaction by full name. The full name is composed by an optional namespace, a required endpoint name and an optional tag or version. Examples: name, namespace:name, namespace:name@version")
|
|
76
|
+
.option('-p, --project <project>', 'Refresh the current profile token for the given project ID')
|
|
77
|
+
.action((options) => updateCurrentProfile(undefined, undefined, options));
|
|
78
|
+
const authGit = authRoot
|
|
79
|
+
.command('git')
|
|
80
|
+
.description('Configure Git to authenticate to Vertesia app repositories with the active profile token.')
|
|
81
|
+
.option('-p, --profile <profile>', 'Profile to use for Git credentials. Defaults to the active profile.')
|
|
82
|
+
.option('--url <url>', 'Git server base URL, for example https://git.dev1.vertesia.io.')
|
|
83
|
+
.option('--no-alias', 'Do not configure the vertesia:<app>.git short alias.')
|
|
84
|
+
.action((options) => configureGitAuth(options));
|
|
85
|
+
authGit
|
|
86
|
+
.command('credential [action]')
|
|
87
|
+
.description('Git credential helper entrypoint. Called by git; users should run `vertesia auth git` instead.')
|
|
88
|
+
.action(function (action) {
|
|
89
|
+
// --profile is declared on the parent `auth git`, so read via globals.
|
|
90
|
+
const profile = this.optsWithGlobals().profile;
|
|
91
|
+
return serveGitCredential(action, { profile });
|
|
92
|
+
});
|
|
93
|
+
program
|
|
94
|
+
.command('envs [envId]')
|
|
95
|
+
.description('List the environments you have access to')
|
|
96
|
+
.action((envId, options) => listEnvironments(program, envId, options));
|
|
97
|
+
program
|
|
98
|
+
.command('interactions [interaction]')
|
|
99
|
+
.description('List the interactions available in the current project')
|
|
100
|
+
.action((interactionId, options) => listInteractions(program, interactionId, options));
|
|
101
|
+
program
|
|
102
|
+
.command('run <interaction>')
|
|
103
|
+
.description('Run an interaction by full name. The full name is composed by an optional namespace, a required endpoint name and an optional tag or version. Examples: name, namespace:name, namespace:name@version')
|
|
82
104
|
.option('-i, --input [file]', 'The input data if any. If no file path is specified it will read from stdin')
|
|
83
105
|
.option('-o, --output [file]', 'The output file if any. If not specified it will print to stdout')
|
|
84
106
|
.option('-d, --data [json]', 'Inline data as a JSON string. If specified takes precedence over --input')
|
|
@@ -101,86 +123,99 @@ program.command("run <interaction>")
|
|
|
101
123
|
.option('-r, --run-data [level]', 'Override the level of storage for the run data. Possible values are: "standard", "restricted", or "debug". Optional. If not specified, it uses the level defined in Studio.')
|
|
102
124
|
.option('--by-id', 'When used, the interaction is selected by ID instead of by name')
|
|
103
125
|
.action((interaction, options) => runInteraction(program, interaction, options));
|
|
104
|
-
program
|
|
126
|
+
program
|
|
127
|
+
.command('runs [interactionId]')
|
|
105
128
|
.description('Search the run history for specific execution runs')
|
|
106
129
|
.option('-t, --tags [tags]', 'A comma separated list of tags to filter the run history')
|
|
107
130
|
.option('--status [status]', 'A status to filter on')
|
|
108
131
|
.option('-e, --env [environmentId]', 'Filter by environment')
|
|
109
132
|
.option('-m, --model [model]', 'Filter by model')
|
|
110
133
|
.option('-q, --query [query]', 'A lucene query')
|
|
111
|
-
.option('-l, --limit [limit]', 'The maximum number of runs to return in a page',
|
|
112
|
-
.option('-P, --page [page]', 'The page number to return (starting from 0)',
|
|
134
|
+
.option('-l, --limit [limit]', 'The maximum number of runs to return in a page', '100')
|
|
135
|
+
.option('-P, --page [page]', 'The page number to return (starting from 0)', '0')
|
|
113
136
|
.option('-f, --format [format]', 'The output format: json, jsonl or csv.', 'json')
|
|
114
|
-
.option(
|
|
115
|
-
.option(
|
|
116
|
-
.option(
|
|
117
|
-
.action((interactionId, options) =>
|
|
118
|
-
runHistory(program, interactionId, options);
|
|
119
|
-
});
|
|
120
|
-
const memoCmd = program.command("memo");
|
|
121
|
-
setupMemoCommand(memoCmd, getPublishMemoryAction(program));
|
|
122
|
-
registerWorkerCommand(program);
|
|
137
|
+
.option('-o, --output [file]', 'The output file if any. If not specified it will print to stdout')
|
|
138
|
+
.option('--before [date]', 'Filter runs before the given date. The date must be in ISO format')
|
|
139
|
+
.option('--after [date]', 'Filter runs after the given date. The date must be in ISO format')
|
|
140
|
+
.action((interactionId, options) => runHistory(program, interactionId, options));
|
|
123
141
|
registerAppsCommand(program);
|
|
142
|
+
registerAgentsCommand(program);
|
|
124
143
|
registerArtifactsCommand(program);
|
|
125
144
|
registerDataCommand(program);
|
|
126
145
|
registerIamCommand(program);
|
|
127
|
-
const profilesRoot = program
|
|
128
|
-
.
|
|
129
|
-
.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
const profilesRoot = program
|
|
147
|
+
.command('profiles')
|
|
148
|
+
.description('Manage configuration profiles')
|
|
149
|
+
.action(async () => {
|
|
150
|
+
await listProfiles();
|
|
151
|
+
});
|
|
152
|
+
profilesRoot
|
|
153
|
+
.command('list')
|
|
154
|
+
.description('List configuration profiles')
|
|
155
|
+
.action(async () => {
|
|
156
|
+
await listProfiles();
|
|
157
|
+
});
|
|
158
|
+
profilesRoot
|
|
159
|
+
.command('show [name]')
|
|
160
|
+
.description('Show the configured profiles or the profile with the given name')
|
|
161
|
+
.action(async (name) => {
|
|
162
|
+
await showProfile(name);
|
|
163
|
+
});
|
|
164
|
+
profilesRoot
|
|
165
|
+
.command('use [name]')
|
|
166
|
+
.description('Switch to another configuration profile')
|
|
167
|
+
.action(async (name) => {
|
|
168
|
+
await useProfile(name);
|
|
169
|
+
});
|
|
170
|
+
profilesRoot
|
|
171
|
+
.command('add [name]')
|
|
143
172
|
.alias('create')
|
|
144
|
-
.option(
|
|
145
|
-
.option(
|
|
146
|
-
.option(
|
|
147
|
-
.option(
|
|
148
|
-
.option(
|
|
149
|
-
.description(
|
|
150
|
-
.action((name, options) => {
|
|
151
|
-
createProfile(name, options
|
|
152
|
-
});
|
|
153
|
-
profilesRoot
|
|
173
|
+
.option('-t, --target <env>', 'The target environment for the profile. Possible values are: local, dev-main, dev-preview, preview, prod or a custom URL.')
|
|
174
|
+
.option('-r, --region <region>', `Deployment region: ${AVAILABLE_REGIONS.join(', ')}. Defaults to ${DEFAULT_REGION}. Only applies to preview and prod targets.`)
|
|
175
|
+
.option('-k, --apikey <key>', 'The API key or auth token to use for the profile')
|
|
176
|
+
.option('-p, --project <project>', 'The project ID to use for the profile')
|
|
177
|
+
.option('-a, --account <account>', 'The account ID to use for the profile')
|
|
178
|
+
.description('Create a new configuration profile')
|
|
179
|
+
.action(async (name, options) => {
|
|
180
|
+
await createProfile(name, options);
|
|
181
|
+
});
|
|
182
|
+
profilesRoot
|
|
183
|
+
.command('edit [name]')
|
|
154
184
|
.alias('update')
|
|
155
|
-
.description(
|
|
156
|
-
.action((name) => {
|
|
157
|
-
updateProfile(name);
|
|
158
|
-
});
|
|
159
|
-
profilesRoot
|
|
160
|
-
.
|
|
161
|
-
.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
185
|
+
.description('Edit an existing configuration profile')
|
|
186
|
+
.action(async (name) => {
|
|
187
|
+
await updateProfile(name);
|
|
188
|
+
});
|
|
189
|
+
profilesRoot
|
|
190
|
+
.command('refresh')
|
|
191
|
+
.description('Refresh token for the current configuration profile')
|
|
192
|
+
.option('-p, --project <project>', 'Refresh the current profile token for the given project ID')
|
|
193
|
+
.action(async (options) => {
|
|
194
|
+
await updateCurrentProfile(undefined, undefined, options);
|
|
195
|
+
});
|
|
196
|
+
profilesRoot
|
|
197
|
+
.command('delete <name>')
|
|
198
|
+
.description('delete an existing configuration profile')
|
|
166
199
|
.action((name) => {
|
|
167
200
|
deleteProfile(name);
|
|
168
201
|
});
|
|
169
|
-
profilesRoot
|
|
170
|
-
.
|
|
202
|
+
profilesRoot
|
|
203
|
+
.command('file')
|
|
204
|
+
.description('print the configuration file path')
|
|
171
205
|
.action(() => {
|
|
172
206
|
console.log(getConfigFile('profiles.json'));
|
|
173
207
|
});
|
|
174
208
|
registerObjectsCommand(program);
|
|
175
209
|
registerWorkflowsCommand(program);
|
|
176
|
-
program.parseAsync(process.argv).catch(err => {
|
|
210
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
177
211
|
console.error(err);
|
|
178
212
|
process.exit(1);
|
|
179
213
|
});
|
|
180
|
-
process.on(
|
|
181
|
-
if (err
|
|
182
|
-
|
|
183
|
-
|
|
214
|
+
process.on('unhandledRejection', (err) => {
|
|
215
|
+
if (hasStatus(err, 401)) {
|
|
216
|
+
// token expired?
|
|
217
|
+
console.error('ERROR', err);
|
|
218
|
+
void tryRefreshToken();
|
|
184
219
|
}
|
|
185
220
|
});
|
|
186
221
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAEH,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,mBAAmB,EAC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OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,GAAY,EAAE,EAAE;IAC9C,IAAI,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;QACtB,iBAAiB;QACjB,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC5B,KAAK,eAAe,EAAE,CAAC;IAC3B,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Command } from
|
|
2
|
-
export declare function listInteractions(program: Command, interactionId: string | undefined, options: Record<string,
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
export declare function listInteractions(program: Command, interactionId: string | undefined, options: Record<string, unknown>): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWzC,wBAAsB,gBAAgB,CAClC,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,iBAiBnC"}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { InteractionStatus } from
|
|
2
|
-
import colors from
|
|
3
|
-
import { getClient } from
|
|
4
|
-
|
|
1
|
+
import { InteractionStatus } from '@vertesia/common';
|
|
2
|
+
import colors from 'ansi-colors';
|
|
3
|
+
import { getClient } from '../client.js';
|
|
4
|
+
function textToPascalCase(text) {
|
|
5
|
+
return text
|
|
6
|
+
.trim()
|
|
7
|
+
.split(/\W/)
|
|
8
|
+
.map((w) => (w ? w[0].toUpperCase() + w.substring(1) : ''))
|
|
9
|
+
.join('');
|
|
10
|
+
}
|
|
5
11
|
export async function listInteractions(program, interactionId, options) {
|
|
6
12
|
const client = await getClient(program);
|
|
7
13
|
if (!interactionId) {
|
|
8
14
|
const interactions = await client.interactions.list();
|
|
9
|
-
|
|
10
|
-
console.log(textToPascalCase(interaction.name)
|
|
11
|
-
}
|
|
15
|
+
for (const interaction of interactions) {
|
|
16
|
+
console.log(`${textToPascalCase(interaction.name)} [${interaction.id}]`);
|
|
17
|
+
}
|
|
12
18
|
return;
|
|
13
19
|
}
|
|
14
20
|
const interaction = await client.interactions.retrieve(interactionId);
|
|
@@ -21,15 +27,15 @@ export async function listInteractions(program, interactionId, options) {
|
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
29
|
function printInteraction(interaction, versions, _options) {
|
|
24
|
-
console.log(colors.bold(interaction.name)
|
|
25
|
-
console.log(colors.bold(
|
|
26
|
-
console.log(colors.bold(
|
|
27
|
-
console.log(colors.bold(
|
|
28
|
-
console.log(colors.bold(
|
|
29
|
-
console.log(colors.bold(
|
|
30
|
+
console.log(`${colors.bold(interaction.name)} [${interaction.id}]`);
|
|
31
|
+
console.log(colors.bold('Description:'), interaction.description || 'n/a');
|
|
32
|
+
console.log(colors.bold('Class name:'), textToPascalCase(interaction.name));
|
|
33
|
+
console.log(colors.bold('Status:'), interaction.status);
|
|
34
|
+
console.log(colors.bold('Version:'), interaction.version);
|
|
35
|
+
console.log(colors.bold('Tags:'), interaction.tags && interaction.tags.length > 0 ? interaction.tags.join(', ') : 'n/a');
|
|
30
36
|
if (interaction.status === InteractionStatus.draft) {
|
|
31
37
|
versions.sort((a, b) => a.version - b.version);
|
|
32
|
-
console.log(colors.bold(
|
|
38
|
+
console.log(colors.bold('Published Versions:'), versions.length > 0 ? versions.map((v) => v.version).join(', ') : 'n/a');
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interactions/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interactions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,SAAS,gBAAgB,CAAC,IAAY;IAClC,OAAO,IAAI;SACN,IAAI,EAAE;SACN,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC1D,IAAI,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAClC,OAAgB,EAChB,aAAiC,EACjC,OAAgC;IAEhC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,CAAC,aAAa,EAAE,CAAC;QACjB,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QACtD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC,EAAE,GAAG,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO;IACX,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,QAA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IAAI,WAAW,CAAC,MAAM,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;QACjD,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,CACP,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAClC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAC1E,CAAC;IACN,CAAC;AACL,CAAC"}
|
|
@@ -1,15 +1,50 @@
|
|
|
1
|
-
import { VertesiaClient } from
|
|
2
|
-
import { ContentObject } from
|
|
3
|
-
import { Command } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import type { VertesiaClient } from '@vertesia/client';
|
|
2
|
+
import type { ContentObject } from '@vertesia/common';
|
|
3
|
+
import type { Command } from 'commander';
|
|
4
|
+
import { type CliOptions } from '../utils/options.js';
|
|
5
|
+
interface JsonOutputOptions {
|
|
6
|
+
json?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ListObjectsOptions extends JsonOutputOptions {
|
|
9
|
+
limit?: string;
|
|
10
|
+
skip?: string;
|
|
11
|
+
}
|
|
12
|
+
interface SearchObjectsOptions extends JsonOutputOptions {
|
|
13
|
+
limit?: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
path?: string;
|
|
16
|
+
select?: string;
|
|
17
|
+
}
|
|
18
|
+
interface QueryObjectsOptions extends JsonOutputOptions {
|
|
19
|
+
dsl?: string;
|
|
20
|
+
}
|
|
21
|
+
type CreateObjectOptions = CliOptions<{
|
|
22
|
+
name?: string;
|
|
23
|
+
type?: string;
|
|
24
|
+
path?: string;
|
|
25
|
+
recursive?: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
type DownloadObjectOptions = CliOptions<{
|
|
28
|
+
output?: string;
|
|
29
|
+
}>;
|
|
30
|
+
interface TypeChoice {
|
|
31
|
+
name: string;
|
|
32
|
+
value: string;
|
|
33
|
+
id?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function createObject(program: Command, files: string[], options: CreateObjectOptions): Promise<void | "No files specified" | ContentObject<import("@vertesia/common").JSONObject>>;
|
|
36
|
+
export declare function createObjectFromFiles(program: Command, files: string[], options: CreateObjectOptions): Promise<void>;
|
|
37
|
+
export declare function createObjectFromFile(program: Command, file: string, options: CreateObjectOptions): Promise<ContentObject<import("@vertesia/common").JSONObject>>;
|
|
38
|
+
export declare function createObjectFromLocalFile(client: VertesiaClient, file: string, options: CreateObjectOptions): Promise<ContentObject<import("@vertesia/common").JSONObject>>;
|
|
39
|
+
export declare function updateObject(program: Command, objectId: string, type: string, _options: Record<string, unknown>): Promise<void>;
|
|
40
|
+
export declare function deleteObject(program: Command, objectId: string, _options: Record<string, unknown>): Promise<void>;
|
|
41
|
+
export declare function getObject(program: Command, objectId: string, _options: Record<string, unknown>): Promise<void>;
|
|
42
|
+
export declare function getObjectText(program: Command, objectId: string, options: JsonOutputOptions): Promise<void>;
|
|
43
|
+
export declare function listObjects(program: Command, folderPath: string | undefined, options: ListObjectsOptions): Promise<void>;
|
|
44
|
+
export declare function searchObjects(program: Command, query: string, options: SearchObjectsOptions): Promise<void>;
|
|
45
|
+
export declare function queryObjects(program: Command, options: QueryObjectsOptions): Promise<void>;
|
|
46
|
+
export declare function listTypes(program: Command): Promise<TypeChoice[]>;
|
|
47
|
+
export declare function findTypeValue(types: TypeChoice[], name: string): string;
|
|
48
|
+
export declare function downloadObjectContent(program: Command, objectId: string, options: DownloadObjectOptions): Promise<void>;
|
|
49
|
+
export {};
|
|
15
50
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/objects/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/objects/commands.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,KAAK,EAER,aAAa,EAMhB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,EAAE,KAAK,UAAU,EAAiC,MAAM,qBAAqB,CAAC;AAQrF,UAAU,iBAAiB;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,kBAAmB,SAAQ,iBAAiB;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,oBAAqB,SAAQ,iBAAiB;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,mBAAoB,SAAQ,iBAAiB;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,mBAAmB,GAAG,UAAU,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAEH,KAAK,qBAAqB,GAAG,UAAU,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC,CAAC;AAEH,UAAU,UAAU;IAChB,IAAI,EAAE,MAAM,CAAC;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