@xano/cli 0.0.25 → 0.0.26
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/dist/base-command.d.ts +1 -3
- package/dist/base-command.js +5 -12
- package/dist/commands/function/create/index.d.ts +6 -7
- package/dist/commands/function/create/index.js +55 -55
- package/dist/commands/function/edit/index.d.ts +10 -11
- package/dist/commands/function/edit/index.js +162 -155
- package/dist/commands/function/get/index.d.ts +5 -6
- package/dist/commands/function/get/index.js +60 -55
- package/dist/commands/function/list/index.d.ts +5 -6
- package/dist/commands/function/list/index.js +52 -52
- package/dist/commands/profile/create/index.d.ts +6 -6
- package/dist/commands/profile/create/index.js +37 -37
- package/dist/commands/profile/delete/index.d.ts +2 -2
- package/dist/commands/profile/delete/index.js +9 -9
- package/dist/commands/profile/edit/index.d.ts +7 -8
- package/dist/commands/profile/edit/index.js +48 -48
- package/dist/commands/profile/get-default/index.js +1 -1
- package/dist/commands/profile/list/index.d.ts +2 -2
- package/dist/commands/profile/list/index.js +9 -9
- package/dist/commands/profile/me/index.d.ts +3 -4
- package/dist/commands/profile/me/index.js +21 -21
- package/dist/commands/profile/project/index.js +1 -1
- package/dist/commands/profile/set-default/index.js +1 -1
- package/dist/commands/profile/token/index.js +1 -1
- package/dist/commands/profile/wizard/index.d.ts +4 -5
- package/dist/commands/profile/wizard/index.js +108 -142
- package/dist/commands/run/env/delete/index.d.ts +2 -3
- package/dist/commands/run/env/delete/index.js +10 -10
- package/dist/commands/run/env/get/index.d.ts +2 -3
- package/dist/commands/run/env/get/index.js +11 -11
- package/dist/commands/run/env/list/index.d.ts +2 -3
- package/dist/commands/run/env/list/index.js +19 -17
- package/dist/commands/run/env/set/index.d.ts +2 -3
- package/dist/commands/run/env/set/index.js +5 -5
- package/dist/commands/run/exec/index.d.ts +8 -19
- package/dist/commands/run/exec/index.js +108 -186
- package/dist/commands/run/info/index.d.ts +4 -5
- package/dist/commands/run/info/index.js +27 -27
- package/dist/commands/run/projects/create/index.d.ts +3 -4
- package/dist/commands/run/projects/create/index.js +23 -23
- package/dist/commands/run/projects/delete/index.d.ts +2 -3
- package/dist/commands/run/projects/delete/index.js +10 -10
- package/dist/commands/run/projects/list/index.d.ts +2 -3
- package/dist/commands/run/projects/list/index.js +12 -12
- package/dist/commands/run/projects/update/index.d.ts +3 -4
- package/dist/commands/run/projects/update/index.js +21 -21
- package/dist/commands/run/secrets/delete/index.d.ts +2 -3
- package/dist/commands/run/secrets/delete/index.js +10 -10
- package/dist/commands/run/secrets/get/index.d.ts +2 -3
- package/dist/commands/run/secrets/get/index.js +11 -11
- package/dist/commands/run/secrets/list/index.d.ts +2 -3
- package/dist/commands/run/secrets/list/index.js +24 -22
- package/dist/commands/run/secrets/set/index.d.ts +3 -4
- package/dist/commands/run/secrets/set/index.js +16 -16
- package/dist/commands/run/sessions/delete/index.d.ts +2 -3
- package/dist/commands/run/sessions/delete/index.js +10 -10
- package/dist/commands/run/sessions/get/index.d.ts +2 -3
- package/dist/commands/run/sessions/get/index.js +11 -11
- package/dist/commands/run/sessions/list/index.d.ts +2 -3
- package/dist/commands/run/sessions/list/index.js +11 -11
- package/dist/commands/run/sessions/start/index.d.ts +2 -3
- package/dist/commands/run/sessions/start/index.js +11 -11
- package/dist/commands/run/sessions/stop/index.d.ts +2 -3
- package/dist/commands/run/sessions/stop/index.js +11 -11
- package/dist/commands/run/sink/get/index.d.ts +2 -3
- package/dist/commands/run/sink/get/index.js +11 -11
- package/dist/commands/static_host/build/create/index.d.ts +4 -5
- package/dist/commands/static_host/build/create/index.js +33 -33
- package/dist/commands/static_host/build/get/index.d.ts +4 -5
- package/dist/commands/static_host/build/get/index.js +20 -20
- package/dist/commands/static_host/build/list/index.d.ts +3 -4
- package/dist/commands/static_host/build/list/index.js +31 -31
- package/dist/commands/static_host/list/index.d.ts +3 -4
- package/dist/commands/static_host/list/index.js +31 -31
- package/dist/commands/workspace/list/index.d.ts +2 -3
- package/dist/commands/workspace/list/index.js +15 -15
- package/dist/commands/workspace/pull/index.d.ts +4 -5
- package/dist/commands/workspace/pull/index.js +52 -47
- package/dist/commands/workspace/push/index.d.ts +0 -1
- package/dist/commands/workspace/push/index.js +4 -4
- package/dist/help.d.ts +1 -1
- package/dist/lib/base-run-command.d.ts +6 -6
- package/dist/lib/base-run-command.js +6 -8
- package/dist/lib/run-http-client.d.ts +18 -24
- package/dist/lib/run-http-client.js +61 -96
- package/dist/lib/run-types.d.ts +80 -80
- package/oclif.manifest.json +849 -2027
- package/package.json +3 -1
- package/dist/commands/auth/index.d.ts +0 -21
- package/dist/commands/auth/index.js +0 -533
- package/dist/commands/branch/create/index.d.ts +0 -17
- package/dist/commands/branch/create/index.js +0 -164
- package/dist/commands/branch/delete/index.d.ts +0 -18
- package/dist/commands/branch/delete/index.js +0 -156
- package/dist/commands/branch/edit/index.d.ts +0 -19
- package/dist/commands/branch/edit/index.js +0 -166
- package/dist/commands/branch/get/index.d.ts +0 -16
- package/dist/commands/branch/get/index.js +0 -135
- package/dist/commands/branch/list/index.d.ts +0 -18
- package/dist/commands/branch/list/index.js +0 -138
- package/dist/commands/branch/set-live/index.d.ts +0 -18
- package/dist/commands/branch/set-live/index.js +0 -155
- package/dist/commands/workspace/create/index.d.ts +0 -14
- package/dist/commands/workspace/create/index.js +0 -131
- package/dist/commands/workspace/delete/index.d.ts +0 -20
- package/dist/commands/workspace/delete/index.js +0 -141
- package/dist/commands/workspace/edit/index.d.ts +0 -22
- package/dist/commands/workspace/edit/index.js +0 -176
- package/dist/commands/workspace/get/index.d.ts +0 -18
- package/dist/commands/workspace/get/index.js +0 -136
|
@@ -3,6 +3,29 @@ import * as fs from 'node:fs';
|
|
|
3
3
|
import BaseRunCommand from '../../../lib/base-run-command.js';
|
|
4
4
|
export default class RunInfo extends BaseRunCommand {
|
|
5
5
|
static args = {};
|
|
6
|
+
static flags = {
|
|
7
|
+
...BaseRunCommand.baseFlags,
|
|
8
|
+
file: Flags.string({
|
|
9
|
+
char: 'f',
|
|
10
|
+
description: 'Path or URL to file containing XanoScript code',
|
|
11
|
+
required: false,
|
|
12
|
+
exclusive: ['stdin'],
|
|
13
|
+
}),
|
|
14
|
+
stdin: Flags.boolean({
|
|
15
|
+
char: 's',
|
|
16
|
+
description: 'Read XanoScript code from stdin',
|
|
17
|
+
required: false,
|
|
18
|
+
default: false,
|
|
19
|
+
exclusive: ['file'],
|
|
20
|
+
}),
|
|
21
|
+
output: Flags.string({
|
|
22
|
+
char: 'o',
|
|
23
|
+
description: 'Output format',
|
|
24
|
+
required: false,
|
|
25
|
+
default: 'summary',
|
|
26
|
+
options: ['summary', 'json'],
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
6
29
|
static description = 'Get information about a XanoScript document (type, inputs, env vars)';
|
|
7
30
|
static examples = [
|
|
8
31
|
`$ xano run info -f script.xs
|
|
@@ -25,33 +48,10 @@ Document Info:
|
|
|
25
48
|
{ "type": "job", "input": { "name": {...} }, "env": ["API_KEY"] }
|
|
26
49
|
`,
|
|
27
50
|
];
|
|
28
|
-
static flags = {
|
|
29
|
-
...BaseRunCommand.baseFlags,
|
|
30
|
-
file: Flags.string({
|
|
31
|
-
char: 'f',
|
|
32
|
-
description: 'Path or URL to file containing XanoScript code',
|
|
33
|
-
exclusive: ['stdin'],
|
|
34
|
-
required: false,
|
|
35
|
-
}),
|
|
36
|
-
output: Flags.string({
|
|
37
|
-
char: 'o',
|
|
38
|
-
default: 'summary',
|
|
39
|
-
description: 'Output format',
|
|
40
|
-
options: ['summary', 'json'],
|
|
41
|
-
required: false,
|
|
42
|
-
}),
|
|
43
|
-
stdin: Flags.boolean({
|
|
44
|
-
char: 's',
|
|
45
|
-
default: false,
|
|
46
|
-
description: 'Read XanoScript code from stdin',
|
|
47
|
-
exclusive: ['file'],
|
|
48
|
-
required: false,
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
51
51
|
async run() {
|
|
52
52
|
const { flags } = await this.parse(RunInfo);
|
|
53
53
|
// Initialize with project required
|
|
54
|
-
await this.initRunCommandWithProject(flags.profile
|
|
54
|
+
await this.initRunCommandWithProject(flags.profile);
|
|
55
55
|
// Read XanoScript content
|
|
56
56
|
let xanoscript;
|
|
57
57
|
if (flags.file) {
|
|
@@ -112,9 +112,6 @@ Document Info:
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
isUrl(str) {
|
|
116
|
-
return str.startsWith('http://') || str.startsWith('https://');
|
|
117
|
-
}
|
|
118
115
|
outputSummary(result) {
|
|
119
116
|
this.log('Document Info:');
|
|
120
117
|
this.log(` Type: ${result.type}`);
|
|
@@ -142,6 +139,9 @@ Document Info:
|
|
|
142
139
|
this.log(' (none)');
|
|
143
140
|
}
|
|
144
141
|
}
|
|
142
|
+
isUrl(str) {
|
|
143
|
+
return str.startsWith('http://') || str.startsWith('https://');
|
|
144
|
+
}
|
|
145
145
|
async readStdin() {
|
|
146
146
|
return new Promise((resolve, reject) => {
|
|
147
147
|
const chunks = [];
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import BaseRunCommand from '../../../../lib/base-run-command.js';
|
|
2
2
|
export default class RunProjectsCreate extends BaseRunCommand {
|
|
3
3
|
static args: {};
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
4
|
static flags: {
|
|
7
|
-
description: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
5
|
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
description: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
7
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
8
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
9
|
};
|
|
10
|
+
static description: string;
|
|
11
|
+
static examples: string[];
|
|
13
12
|
run(): Promise<void>;
|
|
14
13
|
}
|
|
@@ -2,6 +2,27 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import BaseRunCommand from '../../../../lib/base-run-command.js';
|
|
3
3
|
export default class RunProjectsCreate extends BaseRunCommand {
|
|
4
4
|
static args = {};
|
|
5
|
+
static flags = {
|
|
6
|
+
...BaseRunCommand.baseFlags,
|
|
7
|
+
name: Flags.string({
|
|
8
|
+
char: 'n',
|
|
9
|
+
description: 'Project name',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
description: Flags.string({
|
|
13
|
+
char: 'd',
|
|
14
|
+
description: 'Project description',
|
|
15
|
+
required: false,
|
|
16
|
+
default: '',
|
|
17
|
+
}),
|
|
18
|
+
output: Flags.string({
|
|
19
|
+
char: 'o',
|
|
20
|
+
description: 'Output format',
|
|
21
|
+
required: false,
|
|
22
|
+
default: 'summary',
|
|
23
|
+
options: ['summary', 'json'],
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
5
26
|
static description = 'Create a new project';
|
|
6
27
|
static examples = [
|
|
7
28
|
`$ xano run projects create -n "My Project"
|
|
@@ -18,34 +39,13 @@ Project created successfully!
|
|
|
18
39
|
{ "id": "abc123-def456-ghi789", "name": "My Project", ... }
|
|
19
40
|
`,
|
|
20
41
|
];
|
|
21
|
-
static flags = {
|
|
22
|
-
...BaseRunCommand.baseFlags,
|
|
23
|
-
description: Flags.string({
|
|
24
|
-
char: 'd',
|
|
25
|
-
default: '',
|
|
26
|
-
description: 'Project description',
|
|
27
|
-
required: false,
|
|
28
|
-
}),
|
|
29
|
-
name: Flags.string({
|
|
30
|
-
char: 'n',
|
|
31
|
-
description: 'Project name',
|
|
32
|
-
required: true,
|
|
33
|
-
}),
|
|
34
|
-
output: Flags.string({
|
|
35
|
-
char: 'o',
|
|
36
|
-
default: 'summary',
|
|
37
|
-
description: 'Output format',
|
|
38
|
-
options: ['summary', 'json'],
|
|
39
|
-
required: false,
|
|
40
|
-
}),
|
|
41
|
-
};
|
|
42
42
|
async run() {
|
|
43
43
|
const { flags } = await this.parse(RunProjectsCreate);
|
|
44
44
|
// Initialize (no project required for creating projects)
|
|
45
|
-
await this.initRunCommand(flags.profile
|
|
45
|
+
await this.initRunCommand(flags.profile);
|
|
46
46
|
const input = {
|
|
47
|
-
description: flags.description || '',
|
|
48
47
|
name: flags.name,
|
|
48
|
+
description: flags.description || '',
|
|
49
49
|
};
|
|
50
50
|
try {
|
|
51
51
|
const url = this.httpClient.buildUrl('/project');
|
|
@@ -3,12 +3,11 @@ export default class RunProjectsDelete extends BaseRunCommand {
|
|
|
3
3
|
static args: {
|
|
4
4
|
projectId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
6
|
static flags: {
|
|
9
7
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
8
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
9
|
};
|
|
10
|
+
static description: string;
|
|
11
|
+
static examples: string[];
|
|
13
12
|
run(): Promise<void>;
|
|
14
13
|
}
|
|
@@ -7,6 +7,15 @@ export default class RunProjectsDelete extends BaseRunCommand {
|
|
|
7
7
|
required: true,
|
|
8
8
|
}),
|
|
9
9
|
};
|
|
10
|
+
static flags = {
|
|
11
|
+
...BaseRunCommand.baseFlags,
|
|
12
|
+
force: Flags.boolean({
|
|
13
|
+
char: 'f',
|
|
14
|
+
description: 'Skip confirmation prompt',
|
|
15
|
+
required: false,
|
|
16
|
+
default: false,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
10
19
|
static description = 'Delete a project';
|
|
11
20
|
static examples = [
|
|
12
21
|
`$ xano run projects delete abc123-def456
|
|
@@ -17,19 +26,10 @@ Project deleted successfully!
|
|
|
17
26
|
Project deleted successfully!
|
|
18
27
|
`,
|
|
19
28
|
];
|
|
20
|
-
static flags = {
|
|
21
|
-
...BaseRunCommand.baseFlags,
|
|
22
|
-
force: Flags.boolean({
|
|
23
|
-
char: 'f',
|
|
24
|
-
default: false,
|
|
25
|
-
description: 'Skip confirmation prompt',
|
|
26
|
-
required: false,
|
|
27
|
-
}),
|
|
28
|
-
};
|
|
29
29
|
async run() {
|
|
30
30
|
const { args, flags } = await this.parse(RunProjectsDelete);
|
|
31
31
|
// Initialize (no project required)
|
|
32
|
-
await this.initRunCommand(flags.profile
|
|
32
|
+
await this.initRunCommand(flags.profile);
|
|
33
33
|
// Confirm deletion unless --force is used
|
|
34
34
|
if (!flags.force) {
|
|
35
35
|
const readline = await import('node:readline');
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import BaseRunCommand from '../../../../lib/base-run-command.js';
|
|
2
2
|
export default class RunProjectsList extends BaseRunCommand {
|
|
3
3
|
static args: {};
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
4
|
static flags: {
|
|
7
5
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
6
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
7
|
};
|
|
8
|
+
static description: string;
|
|
9
|
+
static examples: string[];
|
|
11
10
|
run(): Promise<void>;
|
|
12
11
|
private outputTable;
|
|
13
12
|
}
|
|
@@ -2,6 +2,16 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import BaseRunCommand from '../../../../lib/base-run-command.js';
|
|
3
3
|
export default class RunProjectsList extends BaseRunCommand {
|
|
4
4
|
static args = {};
|
|
5
|
+
static flags = {
|
|
6
|
+
...BaseRunCommand.baseFlags,
|
|
7
|
+
output: Flags.string({
|
|
8
|
+
char: 'o',
|
|
9
|
+
description: 'Output format',
|
|
10
|
+
required: false,
|
|
11
|
+
default: 'table',
|
|
12
|
+
options: ['table', 'json'],
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
5
15
|
static description = 'List all projects';
|
|
6
16
|
static examples = [
|
|
7
17
|
`$ xano run projects list
|
|
@@ -15,20 +25,10 @@ xyz789-uvw456-rst123 Test Project public
|
|
|
15
25
|
]
|
|
16
26
|
`,
|
|
17
27
|
];
|
|
18
|
-
static flags = {
|
|
19
|
-
...BaseRunCommand.baseFlags,
|
|
20
|
-
output: Flags.string({
|
|
21
|
-
char: 'o',
|
|
22
|
-
default: 'table',
|
|
23
|
-
description: 'Output format',
|
|
24
|
-
options: ['table', 'json'],
|
|
25
|
-
required: false,
|
|
26
|
-
}),
|
|
27
|
-
};
|
|
28
28
|
async run() {
|
|
29
29
|
const { flags } = await this.parse(RunProjectsList);
|
|
30
30
|
// Initialize (no project required for listing projects)
|
|
31
|
-
await this.initRunCommand(flags.profile
|
|
31
|
+
await this.initRunCommand(flags.profile);
|
|
32
32
|
try {
|
|
33
33
|
const url = this.httpClient.buildUrl('/project');
|
|
34
34
|
const projects = await this.httpClient.get(url);
|
|
@@ -59,7 +59,7 @@ xyz789-uvw456-rst123 Test Project public
|
|
|
59
59
|
for (const project of projects) {
|
|
60
60
|
const id = project.id.padEnd(36);
|
|
61
61
|
const name = project.name.slice(0, 24).padEnd(25);
|
|
62
|
-
const
|
|
62
|
+
const access = project.access;
|
|
63
63
|
this.log(`${id} ${name} ${access}`);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -3,14 +3,13 @@ export default class RunProjectsUpdate extends BaseRunCommand {
|
|
|
3
3
|
static args: {
|
|
4
4
|
projectId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
6
|
static flags: {
|
|
9
|
-
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
7
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
9
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
11
|
};
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
15
14
|
run(): Promise<void>;
|
|
16
15
|
}
|
|
@@ -7,6 +7,26 @@ export default class RunProjectsUpdate extends BaseRunCommand {
|
|
|
7
7
|
required: true,
|
|
8
8
|
}),
|
|
9
9
|
};
|
|
10
|
+
static flags = {
|
|
11
|
+
...BaseRunCommand.baseFlags,
|
|
12
|
+
name: Flags.string({
|
|
13
|
+
char: 'n',
|
|
14
|
+
description: 'New project name',
|
|
15
|
+
required: false,
|
|
16
|
+
}),
|
|
17
|
+
description: Flags.string({
|
|
18
|
+
char: 'd',
|
|
19
|
+
description: 'New project description',
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
output: Flags.string({
|
|
23
|
+
char: 'o',
|
|
24
|
+
description: 'Output format',
|
|
25
|
+
required: false,
|
|
26
|
+
default: 'summary',
|
|
27
|
+
options: ['summary', 'json'],
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
10
30
|
static description = 'Update a project';
|
|
11
31
|
static examples = [
|
|
12
32
|
`$ xano run projects update abc123-def456 -n "New Name"
|
|
@@ -23,30 +43,10 @@ Project updated successfully!
|
|
|
23
43
|
{ "id": "abc123-def456", "name": "New Name", ... }
|
|
24
44
|
`,
|
|
25
45
|
];
|
|
26
|
-
static flags = {
|
|
27
|
-
...BaseRunCommand.baseFlags,
|
|
28
|
-
description: Flags.string({
|
|
29
|
-
char: 'd',
|
|
30
|
-
description: 'New project description',
|
|
31
|
-
required: false,
|
|
32
|
-
}),
|
|
33
|
-
name: Flags.string({
|
|
34
|
-
char: 'n',
|
|
35
|
-
description: 'New project name',
|
|
36
|
-
required: false,
|
|
37
|
-
}),
|
|
38
|
-
output: Flags.string({
|
|
39
|
-
char: 'o',
|
|
40
|
-
default: 'summary',
|
|
41
|
-
description: 'Output format',
|
|
42
|
-
options: ['summary', 'json'],
|
|
43
|
-
required: false,
|
|
44
|
-
}),
|
|
45
|
-
};
|
|
46
46
|
async run() {
|
|
47
47
|
const { args, flags } = await this.parse(RunProjectsUpdate);
|
|
48
48
|
// Initialize (no project required)
|
|
49
|
-
await this.initRunCommand(flags.profile
|
|
49
|
+
await this.initRunCommand(flags.profile);
|
|
50
50
|
// Check if any update flags were provided
|
|
51
51
|
if (!flags.name && flags.description === undefined) {
|
|
52
52
|
this.error('At least one of --name or --description must be provided');
|
|
@@ -3,12 +3,11 @@ export default class RunSecretsDelete extends BaseRunCommand {
|
|
|
3
3
|
static args: {
|
|
4
4
|
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
6
|
static flags: {
|
|
9
7
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
8
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
9
|
};
|
|
10
|
+
static description: string;
|
|
11
|
+
static examples: string[];
|
|
13
12
|
run(): Promise<void>;
|
|
14
13
|
}
|
|
@@ -7,6 +7,15 @@ export default class RunSecretsDelete extends BaseRunCommand {
|
|
|
7
7
|
required: true,
|
|
8
8
|
}),
|
|
9
9
|
};
|
|
10
|
+
static flags = {
|
|
11
|
+
...BaseRunCommand.baseFlags,
|
|
12
|
+
force: Flags.boolean({
|
|
13
|
+
char: 'f',
|
|
14
|
+
description: 'Skip confirmation prompt',
|
|
15
|
+
required: false,
|
|
16
|
+
default: false,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
10
19
|
static description = 'Delete a secret';
|
|
11
20
|
static examples = [
|
|
12
21
|
`$ xano run secrets delete docker-registry
|
|
@@ -17,19 +26,10 @@ Secret 'docker-registry' deleted successfully!
|
|
|
17
26
|
Secret 'docker-registry' deleted successfully!
|
|
18
27
|
`,
|
|
19
28
|
];
|
|
20
|
-
static flags = {
|
|
21
|
-
...BaseRunCommand.baseFlags,
|
|
22
|
-
force: Flags.boolean({
|
|
23
|
-
char: 'f',
|
|
24
|
-
default: false,
|
|
25
|
-
description: 'Skip confirmation prompt',
|
|
26
|
-
required: false,
|
|
27
|
-
}),
|
|
28
|
-
};
|
|
29
29
|
async run() {
|
|
30
30
|
const { args, flags } = await this.parse(RunSecretsDelete);
|
|
31
31
|
// Initialize with project required
|
|
32
|
-
await this.initRunCommandWithProject(flags.profile
|
|
32
|
+
await this.initRunCommandWithProject(flags.profile);
|
|
33
33
|
// Confirm deletion unless --force is used
|
|
34
34
|
if (!flags.force) {
|
|
35
35
|
const readline = await import('node:readline');
|
|
@@ -3,12 +3,11 @@ export default class RunSecretsGet extends BaseRunCommand {
|
|
|
3
3
|
static args: {
|
|
4
4
|
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
6
|
static flags: {
|
|
9
7
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
8
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
9
|
};
|
|
10
|
+
static description: string;
|
|
11
|
+
static examples: string[];
|
|
13
12
|
run(): Promise<void>;
|
|
14
13
|
}
|
|
@@ -7,6 +7,16 @@ export default class RunSecretsGet extends BaseRunCommand {
|
|
|
7
7
|
required: true,
|
|
8
8
|
}),
|
|
9
9
|
};
|
|
10
|
+
static flags = {
|
|
11
|
+
...BaseRunCommand.baseFlags,
|
|
12
|
+
output: Flags.string({
|
|
13
|
+
char: 'o',
|
|
14
|
+
description: 'Output format',
|
|
15
|
+
required: false,
|
|
16
|
+
default: 'value',
|
|
17
|
+
options: ['value', 'json'],
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
10
20
|
static description = 'Get a secret value';
|
|
11
21
|
static examples = [
|
|
12
22
|
`$ xano run secrets get docker-registry
|
|
@@ -16,20 +26,10 @@ export default class RunSecretsGet extends BaseRunCommand {
|
|
|
16
26
|
{ "name": "docker-registry", "type": "kubernetes.io/dockerconfigjson", "value": "..." }
|
|
17
27
|
`,
|
|
18
28
|
];
|
|
19
|
-
static flags = {
|
|
20
|
-
...BaseRunCommand.baseFlags,
|
|
21
|
-
output: Flags.string({
|
|
22
|
-
char: 'o',
|
|
23
|
-
default: 'value',
|
|
24
|
-
description: 'Output format',
|
|
25
|
-
options: ['value', 'json'],
|
|
26
|
-
required: false,
|
|
27
|
-
}),
|
|
28
|
-
};
|
|
29
29
|
async run() {
|
|
30
30
|
const { args, flags } = await this.parse(RunSecretsGet);
|
|
31
31
|
// Initialize with project required
|
|
32
|
-
await this.initRunCommandWithProject(flags.profile
|
|
32
|
+
await this.initRunCommandWithProject(flags.profile);
|
|
33
33
|
try {
|
|
34
34
|
const url = this.httpClient.buildProjectUrl('/secret', { name: args.name });
|
|
35
35
|
const result = await this.httpClient.get(url);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import BaseRunCommand from '../../../../lib/base-run-command.js';
|
|
2
2
|
export default class RunSecretsList extends BaseRunCommand {
|
|
3
3
|
static args: {};
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
4
|
static flags: {
|
|
7
5
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
6
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
7
|
};
|
|
8
|
+
static description: string;
|
|
9
|
+
static examples: string[];
|
|
11
10
|
run(): Promise<void>;
|
|
12
11
|
}
|
|
@@ -2,6 +2,16 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import BaseRunCommand from '../../../../lib/base-run-command.js';
|
|
3
3
|
export default class RunSecretsList extends BaseRunCommand {
|
|
4
4
|
static args = {};
|
|
5
|
+
static flags = {
|
|
6
|
+
...BaseRunCommand.baseFlags,
|
|
7
|
+
output: Flags.string({
|
|
8
|
+
char: 'o',
|
|
9
|
+
description: 'Output format',
|
|
10
|
+
required: false,
|
|
11
|
+
default: 'table',
|
|
12
|
+
options: ['table', 'json'],
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
5
15
|
static description = 'List all secret keys';
|
|
6
16
|
static examples = [
|
|
7
17
|
`$ xano run secrets list
|
|
@@ -13,38 +23,30 @@ service-account kubernetes.io/service-account-token -
|
|
|
13
23
|
{ "secrets": [{ "name": "docker-registry", "type": "kubernetes.io/dockerconfigjson", "repo": "ghcr.io" }] }
|
|
14
24
|
`,
|
|
15
25
|
];
|
|
16
|
-
static flags = {
|
|
17
|
-
...BaseRunCommand.baseFlags,
|
|
18
|
-
output: Flags.string({
|
|
19
|
-
char: 'o',
|
|
20
|
-
default: 'table',
|
|
21
|
-
description: 'Output format',
|
|
22
|
-
options: ['table', 'json'],
|
|
23
|
-
required: false,
|
|
24
|
-
}),
|
|
25
|
-
};
|
|
26
26
|
async run() {
|
|
27
27
|
const { flags } = await this.parse(RunSecretsList);
|
|
28
28
|
// Initialize with project required
|
|
29
|
-
await this.initRunCommandWithProject(flags.profile
|
|
29
|
+
await this.initRunCommandWithProject(flags.profile);
|
|
30
30
|
try {
|
|
31
31
|
const url = this.httpClient.buildProjectUrl('/secret/key');
|
|
32
32
|
const result = await this.httpClient.get(url);
|
|
33
33
|
if (flags.output === 'json') {
|
|
34
34
|
this.outputJson(result);
|
|
35
35
|
}
|
|
36
|
-
else if (result.secrets.length === 0) {
|
|
37
|
-
this.log('No secrets found.');
|
|
38
|
-
}
|
|
39
36
|
else {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
if (result.secrets.length === 0) {
|
|
38
|
+
this.log('No secrets found.');
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// Print header
|
|
42
|
+
this.log('NAME TYPE REPO');
|
|
43
|
+
this.log('-'.repeat(80));
|
|
44
|
+
for (const secret of result.secrets) {
|
|
45
|
+
const name = secret.name.slice(0, 24).padEnd(24);
|
|
46
|
+
const type = secret.type.padEnd(37);
|
|
47
|
+
const repo = secret.repo || '-';
|
|
48
|
+
this.log(`${name} ${type} ${repo}`);
|
|
49
|
+
}
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -3,14 +3,13 @@ export default class RunSecretsSet extends BaseRunCommand {
|
|
|
3
3
|
static args: {
|
|
4
4
|
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
6
|
static flags: {
|
|
9
|
-
repo: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
7
|
type: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
8
|
value: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
repo: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
11
|
};
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
15
14
|
run(): Promise<void>;
|
|
16
15
|
}
|
|
@@ -7,38 +7,38 @@ export default class RunSecretsSet extends BaseRunCommand {
|
|
|
7
7
|
required: true,
|
|
8
8
|
}),
|
|
9
9
|
};
|
|
10
|
-
static description = 'Set a secret';
|
|
11
|
-
static examples = [
|
|
12
|
-
`$ xano run secrets set docker-registry -t dockerconfigjson -v '{"auths":{"ghcr.io":{"auth":"..."}}}' -r ghcr.io
|
|
13
|
-
Secret 'docker-registry' set successfully!
|
|
14
|
-
`,
|
|
15
|
-
`$ xano run secrets set service-key -t service-account-token -v 'token-value-here'
|
|
16
|
-
Secret 'service-key' set successfully!
|
|
17
|
-
`,
|
|
18
|
-
];
|
|
19
10
|
static flags = {
|
|
20
11
|
...BaseRunCommand.baseFlags,
|
|
21
|
-
repo: Flags.string({
|
|
22
|
-
char: 'r',
|
|
23
|
-
description: 'Repository (for dockerconfigjson type)',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
12
|
type: Flags.string({
|
|
27
13
|
char: 't',
|
|
28
14
|
description: 'Secret type',
|
|
29
|
-
options: ['dockerconfigjson', 'service-account-token'],
|
|
30
15
|
required: true,
|
|
16
|
+
options: ['dockerconfigjson', 'service-account-token'],
|
|
31
17
|
}),
|
|
32
18
|
value: Flags.string({
|
|
33
19
|
char: 'v',
|
|
34
20
|
description: 'Secret value',
|
|
35
21
|
required: true,
|
|
36
22
|
}),
|
|
23
|
+
repo: Flags.string({
|
|
24
|
+
char: 'r',
|
|
25
|
+
description: 'Repository (for dockerconfigjson type)',
|
|
26
|
+
required: false,
|
|
27
|
+
}),
|
|
37
28
|
};
|
|
29
|
+
static description = 'Set a secret';
|
|
30
|
+
static examples = [
|
|
31
|
+
`$ xano run secrets set docker-registry -t dockerconfigjson -v '{"auths":{"ghcr.io":{"auth":"..."}}}' -r ghcr.io
|
|
32
|
+
Secret 'docker-registry' set successfully!
|
|
33
|
+
`,
|
|
34
|
+
`$ xano run secrets set service-key -t service-account-token -v 'token-value-here'
|
|
35
|
+
Secret 'service-key' set successfully!
|
|
36
|
+
`,
|
|
37
|
+
];
|
|
38
38
|
async run() {
|
|
39
39
|
const { args, flags } = await this.parse(RunSecretsSet);
|
|
40
40
|
// Initialize with project required
|
|
41
|
-
await this.initRunCommandWithProject(flags.profile
|
|
41
|
+
await this.initRunCommandWithProject(flags.profile);
|
|
42
42
|
// Map short type to full type
|
|
43
43
|
const typeMap = {
|
|
44
44
|
'dockerconfigjson': 'kubernetes.io/dockerconfigjson',
|
|
@@ -3,12 +3,11 @@ export default class RunSessionsDelete extends BaseRunCommand {
|
|
|
3
3
|
static args: {
|
|
4
4
|
sessionId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
6
|
static flags: {
|
|
9
7
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
8
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
9
|
};
|
|
10
|
+
static description: string;
|
|
11
|
+
static examples: string[];
|
|
13
12
|
run(): Promise<void>;
|
|
14
13
|
}
|