@vertesia/cli 1.3.0 → 1.4.0-dev.20260615.042549Z

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 (218) hide show
  1. package/lib/agent-context.d.ts +8 -2
  2. package/lib/agent-context.d.ts.map +1 -1
  3. package/lib/agent-context.js +9 -13
  4. package/lib/agent-context.js.map +1 -1
  5. package/lib/agents/index.d.ts +3 -0
  6. package/lib/agents/index.d.ts.map +1 -0
  7. package/lib/agents/index.js +555 -0
  8. package/lib/agents/index.js.map +1 -0
  9. package/lib/apps/commands.d.ts +25 -10
  10. package/lib/apps/commands.d.ts.map +1 -1
  11. package/lib/apps/commands.js +34 -26
  12. package/lib/apps/commands.js.map +1 -1
  13. package/lib/apps/index.d.ts +1 -1
  14. package/lib/apps/index.d.ts.map +1 -1
  15. package/lib/apps/index.js +40 -41
  16. package/lib/apps/index.js.map +1 -1
  17. package/lib/artifacts/commands.d.ts +13 -5
  18. package/lib/artifacts/commands.d.ts.map +1 -1
  19. package/lib/artifacts/commands.js +10 -10
  20. package/lib/artifacts/commands.js.map +1 -1
  21. package/lib/artifacts/index.d.ts +1 -1
  22. package/lib/artifacts/index.d.ts.map +1 -1
  23. package/lib/artifacts/index.js +22 -17
  24. package/lib/artifacts/index.js.map +1 -1
  25. package/lib/client.d.ts +2 -2
  26. package/lib/client.d.ts.map +1 -1
  27. package/lib/client.js +45 -21
  28. package/lib/client.js.map +1 -1
  29. package/lib/data/commands.d.ts +16 -3
  30. package/lib/data/commands.d.ts.map +1 -1
  31. package/lib/data/commands.js +36 -43
  32. package/lib/data/commands.js.map +1 -1
  33. package/lib/data/index.d.ts +1 -1
  34. package/lib/data/index.d.ts.map +1 -1
  35. package/lib/data/index.js +14 -15
  36. package/lib/data/index.js.map +1 -1
  37. package/lib/envs/index.d.ts +2 -2
  38. package/lib/envs/index.d.ts.map +1 -1
  39. package/lib/envs/index.js +12 -10
  40. package/lib/envs/index.js.map +1 -1
  41. package/lib/iam/commands.d.ts +15 -3
  42. package/lib/iam/commands.d.ts.map +1 -1
  43. package/lib/iam/commands.js +27 -9
  44. package/lib/iam/commands.js.map +1 -1
  45. package/lib/iam/index.d.ts +1 -1
  46. package/lib/iam/index.d.ts.map +1 -1
  47. package/lib/iam/index.js +2 -3
  48. package/lib/iam/index.js.map +1 -1
  49. package/lib/index.js +157 -122
  50. package/lib/index.js.map +1 -1
  51. package/lib/interactions/index.d.ts +2 -2
  52. package/lib/interactions/index.d.ts.map +1 -1
  53. package/lib/interactions/index.js +20 -14
  54. package/lib/interactions/index.js.map +1 -1
  55. package/lib/objects/commands.d.ts +49 -14
  56. package/lib/objects/commands.d.ts.map +1 -1
  57. package/lib/objects/commands.js +185 -32
  58. package/lib/objects/commands.js.map +1 -1
  59. package/lib/objects/index.d.ts +1 -1
  60. package/lib/objects/index.d.ts.map +1 -1
  61. package/lib/objects/index.js +46 -13
  62. package/lib/objects/index.js.map +1 -1
  63. package/lib/package.d.ts +7 -3
  64. package/lib/package.d.ts.map +1 -1
  65. package/lib/package.js +25 -13
  66. package/lib/package.js.map +1 -1
  67. package/lib/profiles/auth.d.ts +14 -0
  68. package/lib/profiles/auth.d.ts.map +1 -0
  69. package/lib/profiles/auth.js +65 -0
  70. package/lib/profiles/auth.js.map +1 -0
  71. package/lib/profiles/commands.d.ts +15 -4
  72. package/lib/profiles/commands.d.ts.map +1 -1
  73. package/lib/profiles/commands.js +384 -57
  74. package/lib/profiles/commands.js.map +1 -1
  75. package/lib/profiles/git.d.ts +9 -0
  76. package/lib/profiles/git.d.ts.map +1 -0
  77. package/lib/profiles/git.js +211 -0
  78. package/lib/profiles/git.js.map +1 -0
  79. package/lib/profiles/index.d.ts +17 -7
  80. package/lib/profiles/index.d.ts.map +1 -1
  81. package/lib/profiles/index.js +215 -66
  82. package/lib/profiles/index.js.map +1 -1
  83. package/lib/profiles/keyring.d.ts +23 -0
  84. package/lib/profiles/keyring.d.ts.map +1 -0
  85. package/lib/profiles/keyring.js +111 -0
  86. package/lib/profiles/keyring.js.map +1 -0
  87. package/lib/profiles/oauth.d.ts +17 -0
  88. package/lib/profiles/oauth.d.ts.map +1 -0
  89. package/lib/profiles/oauth.js +414 -0
  90. package/lib/profiles/oauth.js.map +1 -0
  91. package/lib/profiles/server/cors.d.ts +1 -1
  92. package/lib/profiles/server/cors.d.ts.map +1 -1
  93. package/lib/profiles/server/cors.js +1 -1
  94. package/lib/profiles/server/cors.js.map +1 -1
  95. package/lib/profiles/server/index.d.ts +9 -1
  96. package/lib/profiles/server/index.d.ts.map +1 -1
  97. package/lib/profiles/server/index.js +111 -47
  98. package/lib/profiles/server/index.js.map +1 -1
  99. package/lib/profiles/server/server.d.ts +1 -1
  100. package/lib/profiles/server/server.d.ts.map +1 -1
  101. package/lib/profiles/server/server.js +10 -13
  102. package/lib/profiles/server/server.js.map +1 -1
  103. package/lib/projects/index.d.ts +2 -1
  104. package/lib/projects/index.d.ts.map +1 -1
  105. package/lib/projects/index.js +53 -5
  106. package/lib/projects/index.js.map +1 -1
  107. package/lib/run/executor.d.ts +11 -7
  108. package/lib/run/executor.d.ts.map +1 -1
  109. package/lib/run/executor.js +30 -23
  110. package/lib/run/executor.js.map +1 -1
  111. package/lib/run/index.d.ts +14 -2
  112. package/lib/run/index.d.ts.map +1 -1
  113. package/lib/run/index.js +14 -12
  114. package/lib/run/index.js.map +1 -1
  115. package/lib/runs/index.d.ts +18 -2
  116. package/lib/runs/index.d.ts.map +1 -1
  117. package/lib/runs/index.js +9 -7
  118. package/lib/runs/index.js.map +1 -1
  119. package/lib/utils/console.d.ts +1 -1
  120. package/lib/utils/console.d.ts.map +1 -1
  121. package/lib/utils/console.js +24 -33
  122. package/lib/utils/console.js.map +1 -1
  123. package/lib/utils/options.d.ts +8 -0
  124. package/lib/utils/options.d.ts.map +1 -0
  125. package/lib/utils/options.js +19 -0
  126. package/lib/utils/options.js.map +1 -0
  127. package/lib/utils/stdio.js +3 -2
  128. package/lib/utils/stdio.js.map +1 -1
  129. package/lib/workflows/commands.d.ts +44 -13
  130. package/lib/workflows/commands.d.ts.map +1 -1
  131. package/lib/workflows/commands.js +69 -50
  132. package/lib/workflows/commands.js.map +1 -1
  133. package/lib/workflows/index.d.ts +1 -1
  134. package/lib/workflows/index.d.ts.map +1 -1
  135. package/lib/workflows/index.js +56 -56
  136. package/lib/workflows/index.js.map +1 -1
  137. package/lib/workflows/json-loader.d.ts +1 -1
  138. package/lib/workflows/json-loader.d.ts.map +1 -1
  139. package/lib/workflows/json-loader.js +5 -4
  140. package/lib/workflows/json-loader.js.map +1 -1
  141. package/lib/workflows/streams.d.ts +8 -1
  142. package/lib/workflows/streams.d.ts.map +1 -1
  143. package/lib/workflows/streams.js +107 -84
  144. package/lib/workflows/streams.js.map +1 -1
  145. package/lib/workflows/ts-loader.d.ts +1 -1
  146. package/lib/workflows/ts-loader.d.ts.map +1 -1
  147. package/lib/workflows/ts-loader.js +21 -20
  148. package/lib/workflows/ts-loader.js.map +1 -1
  149. package/lib/workflows/validation.d.ts +1 -1
  150. package/lib/workflows/validation.d.ts.map +1 -1
  151. package/lib/workflows/validation.js +11 -11
  152. package/lib/workflows/validation.js.map +1 -1
  153. package/package.json +21 -24
  154. package/bin/docker-credential-vertesia.js +0 -3
  155. package/lib/codegen/CodeBuilder.d.ts +0 -16
  156. package/lib/codegen/CodeBuilder.d.ts.map +0 -1
  157. package/lib/codegen/CodeBuilder.js +0 -99
  158. package/lib/codegen/CodeBuilder.js.map +0 -1
  159. package/lib/codegen/InteractionVersion.d.ts +0 -29
  160. package/lib/codegen/InteractionVersion.d.ts.map +0 -1
  161. package/lib/codegen/InteractionVersion.js +0 -80
  162. package/lib/codegen/InteractionVersion.js.map +0 -1
  163. package/lib/codegen/index.d.ts +0 -3
  164. package/lib/codegen/index.d.ts.map +0 -1
  165. package/lib/codegen/index.js +0 -30
  166. package/lib/codegen/index.js.map +0 -1
  167. package/lib/codegen/template.d.ts +0 -3
  168. package/lib/codegen/template.d.ts.map +0 -1
  169. package/lib/codegen/template.js +0 -28
  170. package/lib/codegen/template.js.map +0 -1
  171. package/lib/codegen/utils.d.ts +0 -2
  172. package/lib/codegen/utils.d.ts.map +0 -1
  173. package/lib/codegen/utils.js +0 -4
  174. package/lib/codegen/utils.js.map +0 -1
  175. package/lib/datagen/index.d.ts +0 -3
  176. package/lib/datagen/index.d.ts.map +0 -1
  177. package/lib/datagen/index.js +0 -81
  178. package/lib/datagen/index.js.map +0 -1
  179. package/lib/memory/index.d.ts +0 -3
  180. package/lib/memory/index.d.ts.map +0 -1
  181. package/lib/memory/index.js +0 -15
  182. package/lib/memory/index.js.map +0 -1
  183. package/lib/worker/commands.d.ts +0 -11
  184. package/lib/worker/commands.d.ts.map +0 -1
  185. package/lib/worker/commands.js +0 -173
  186. package/lib/worker/commands.js.map +0 -1
  187. package/lib/worker/connect.d.ts +0 -7
  188. package/lib/worker/connect.d.ts.map +0 -1
  189. package/lib/worker/connect.js +0 -68
  190. package/lib/worker/connect.js.map +0 -1
  191. package/lib/worker/docker-credential.d.ts +0 -2
  192. package/lib/worker/docker-credential.d.ts.map +0 -1
  193. package/lib/worker/docker-credential.js +0 -51
  194. package/lib/worker/docker-credential.js.map +0 -1
  195. package/lib/worker/docker.d.ts +0 -10
  196. package/lib/worker/docker.d.ts.map +0 -1
  197. package/lib/worker/docker.js +0 -93
  198. package/lib/worker/docker.js.map +0 -1
  199. package/lib/worker/index.d.ts +0 -3
  200. package/lib/worker/index.d.ts.map +0 -1
  201. package/lib/worker/index.js +0 -90
  202. package/lib/worker/index.js.map +0 -1
  203. package/lib/worker/project.d.ts +0 -58
  204. package/lib/worker/project.d.ts.map +0 -1
  205. package/lib/worker/project.js +0 -125
  206. package/lib/worker/project.js.map +0 -1
  207. package/lib/worker/refresh.d.ts +0 -6
  208. package/lib/worker/refresh.d.ts.map +0 -1
  209. package/lib/worker/refresh.js +0 -47
  210. package/lib/worker/refresh.js.map +0 -1
  211. package/lib/worker/registry.d.ts +0 -7
  212. package/lib/worker/registry.d.ts.map +0 -1
  213. package/lib/worker/registry.js +0 -47
  214. package/lib/worker/registry.js.map +0 -1
  215. package/lib/worker/version.d.ts +0 -2
  216. package/lib/worker/version.d.ts.map +0 -1
  217. package/lib/worker/version.js +0 -4
  218. 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 { AVAILABLE_REGIONS, DEFAULT_REGION, getConfigFile } from './profiles/index.js';
16
- import { listProjects } from './projects/index.js';
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 { registerWorkerCommand } from './worker/index.js';
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.version(getVersion());
24
- program.command("upgrade")
25
- .description("Upgrade to the latest version of the CLI")
26
- .option("-y, --yes", "Skip the confirmation prompt")
27
- .action((options = {}) => upgrade(options.yes));
28
- program.command("projects")
29
- .description("List the projects you have access to")
30
- .action(() => {
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
- authRoot.command("refresh")
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
- .action(() => {
43
- updateCurrentProfile();
44
- });
45
- program.command("envs [envId]")
46
- .description("List the environments you have access to")
47
- .action((envId, options) => {
48
- listEnvironments(program, envId, options);
49
- });
50
- program.command("interactions [interaction]")
51
- .description("List the interactions available in the current project")
52
- .action((interactionId, options) => {
53
- listInteractions(program, interactionId, options);
54
- });
55
- program.command("datagen <interaction>")
56
- .description("Generate test input data, given an interaction ID")
57
- .option('-e, --env [envId]', 'The environment ID to use to generating the test data')
58
- .option('-m, --model [model]', 'The model to use to generating the test data. If the selected environment has a default model then this option is optional.')
59
- .option('-t, --temperature [value]', 'The temperature used to generating the test data.')
60
- .option('--max-tokens [max-tokens]', 'The maximum number of tokens to generate')
61
- .option('--top-p [top-p]', 'The top P value to use')
62
- .option('--top-k [top-k]', 'The top K value to use')
63
- .option('--presence-penalty [presence-penalty]', 'The presence penalty value to use')
64
- .option('--frequency-penalty [frequency-penalty]', 'The frequency penalty value to use')
65
- .option('--stop-sequence [stop-sequence]', 'A comma separated list of sequences to stop the generation')
66
- .option('--config-mode [config-mode]', 'The configuration mode to use.Possible values are: "run_and_interaction_config", "run_config_only", "interaction_config_only". Optional. If not specified, "run_and_interaction_config" is used.')
67
- .option('-o, --output [file]', 'A file to save the generated test data. If not specified the data will be printed to stdout.')
68
- .option('-c, --count [value]', 'The number of data objects to generate', '1')
69
- .option('--message [value]', 'An optional message')
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.command("runs [interactionId]")
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', "100")
112
- .option('-P, --page [page]', 'The page number to return (starting from 0)', "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("-o, --output [file]", "The output file if any. If not specified it will print to stdout")
115
- .option("--before [date]", "Filter runs before the given date. The date must be in ISO format")
116
- .option("--after [date]", "Filter runs after the given date. The date must be in ISO format")
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.command("profiles")
128
- .description("Manage configuration profiles")
129
- .action(() => {
130
- listProfiles();
131
- });
132
- profilesRoot.command('show [name]')
133
- .description("Show the configured profiles or the profile with the given name")
134
- .action((name) => {
135
- showProfile(name);
136
- });
137
- profilesRoot.command('use [name]')
138
- .description("Switch to another configuration profile")
139
- .action((name) => {
140
- useProfile(name);
141
- });
142
- profilesRoot.command('add [name]')
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("-t, --target <env>", "The target environment for the profile. Possible values are: local, dev-main, dev-preview, preview, prod or a custom URL.")
145
- .option("-r, --region <region>", `Deployment region: ${AVAILABLE_REGIONS.join(', ')}. Defaults to ${DEFAULT_REGION}. Only applies to preview and prod targets.`)
146
- .option("-k, --apikey <key>", "The API key to use for the profile")
147
- .option("-p, --project <project>", "The project ID to use for the profile")
148
- .option("-a, --account <account>", "The account ID to use for the profile")
149
- .description("Create a new configuration profile")
150
- .action((name, options) => {
151
- createProfile(name, options || {});
152
- });
153
- profilesRoot.command('edit [name]')
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("Edit an existing configuration profile")
156
- .action((name) => {
157
- updateProfile(name);
158
- });
159
- profilesRoot.command('refresh')
160
- .description("Refresh token for the current configuration profile")
161
- .action(() => {
162
- updateCurrentProfile();
163
- });
164
- profilesRoot.command('delete <name>')
165
- .description("delete an existing configuration profile")
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.command('file')
170
- .description("print the configuration file path")
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("unhandledRejection", (err) => {
181
- if (err.status === 401) { // token expired?
182
- console.error("ERROR", err);
183
- tryRefreshToken();
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,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACxL,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,cAAc,MAAM,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AE,4DAA4D,CAAC;KAC/F,MAAM,CAAC,KAAK,EAAE,OAA6B,EAAE,EAAE;IAC5C,MAAM,oBAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC,CAAC;AACP,YAAY;KACP,OAAO,CAAC,eAAe,CAAC;KACxB,WAAW,CAAC,0CAA0C,CAAC;KACvD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;IACb,aAAa,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC,CAAC,CAAC;AACP,YAAY;KACP,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,mCAAmC,CAAC;KAChD,MAAM,CAAC,GAAG,EAAE;IACT,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC;AAEP,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAChC,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAElC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC3C,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,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 "commander";
2
- export declare function listInteractions(program: Command, interactionId: string | undefined, options: Record<string, any>): Promise<void>;
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;AAIpC,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,iBAgBvH"}
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 "@vertesia/common";
2
- import colors from "ansi-colors";
3
- import { getClient } from "../client.js";
4
- import { textToPascalCase } from "../codegen/utils.js";
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
- interactions.map(interaction => {
10
- console.log(textToPascalCase(interaction.name) + ` [${interaction.id}]`);
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) + " [" + interaction.id + "]");
25
- console.log(colors.bold("Description:"), interaction.description || 'n/a');
26
- console.log(colors.bold("Class name:"), textToPascalCase(interaction.name));
27
- console.log(colors.bold("Status:"), interaction.status);
28
- console.log(colors.bold("Version:"), interaction.version);
29
- console.log(colors.bold("Tags:"), interaction.tags && interaction.tags.length > 0 ? interaction.tags.join(", ") : "n/a");
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("Published Versions:"), versions.length > 0 ? versions.map(v => v.version).join(", ") : "n/a");
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,EAA+B,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAgB,EAAE,aAAiC,EAAE,OAA4B;IACpH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,C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";
2
- import { ContentObject } from "@vertesia/common";
3
- import { Command } from "commander";
4
- export declare function createObject(program: Command, files: string[], options: Record<string, any>): Promise<void | "No files specified" | ContentObject<any>>;
5
- export declare function createObjectFromFiles(program: Command, files: string[], options: Record<string, any>): Promise<void>;
6
- export declare function createObjectFromFile(program: Command, file: string, options: Record<string, any>): Promise<ContentObject<any>>;
7
- export declare function createObjectFromLocalFile(client: VertesiaClient, file: string, options: Record<string, any>): Promise<ContentObject<any>>;
8
- export declare function updateObject(program: Command, objectId: string, type: string, _options: Record<string, any>): Promise<void>;
9
- export declare function deleteObject(program: Command, objectId: string, _options: Record<string, any>): Promise<void>;
10
- export declare function getObject(program: Command, objectId: string, _options: Record<string, any>): Promise<void>;
11
- export declare function listObjects(program: Command, _folderPath: string | undefined, _options: Record<string, any>): Promise<void>;
12
- export declare function listTypes(program: Command): Promise<any[]>;
13
- export declare function findTypeValue(types: any[], name: string): any;
14
- export declare function downloadObjectContent(program: Command, objectId: string, options: Record<string, any>): Promise<void>;
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":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAqD,MAAM,kBAAkB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwDpC,wBAAsB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,6DA0GjG;AAED,wBAAsB,qBAAq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