@xano/cli 0.0.37 → 0.0.39

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 (114) hide show
  1. package/README.md +325 -102
  2. package/dist/commands/auth/index.d.ts +0 -2
  3. package/dist/commands/auth/index.js +2 -55
  4. package/dist/commands/profile/create/index.d.ts +0 -2
  5. package/dist/commands/profile/create/index.js +0 -15
  6. package/dist/commands/profile/edit/index.d.ts +0 -4
  7. package/dist/commands/profile/edit/index.js +7 -38
  8. package/dist/commands/profile/wizard/index.d.ts +0 -2
  9. package/dist/commands/profile/wizard/index.js +0 -106
  10. package/dist/commands/profile/{project → workspace}/index.d.ts +1 -1
  11. package/dist/commands/profile/{project → workspace}/index.js +10 -10
  12. package/dist/commands/release/delete/index.d.ts +2 -4
  13. package/dist/commands/release/delete/index.js +39 -12
  14. package/dist/commands/release/edit/index.d.ts +2 -4
  15. package/dist/commands/release/edit/index.js +31 -5
  16. package/dist/commands/release/export/index.d.ts +2 -4
  17. package/dist/commands/release/export/index.js +39 -11
  18. package/dist/commands/release/get/index.d.ts +2 -4
  19. package/dist/commands/release/get/index.js +31 -5
  20. package/dist/commands/release/pull/index.d.ts +31 -0
  21. package/dist/commands/release/pull/index.js +345 -0
  22. package/dist/commands/release/push/index.d.ts +26 -0
  23. package/dist/commands/release/push/index.js +230 -0
  24. package/dist/commands/tenant/backup/delete/index.d.ts +1 -1
  25. package/dist/commands/tenant/backup/delete/index.js +8 -9
  26. package/dist/commands/tenant/backup/export/index.d.ts +1 -1
  27. package/dist/commands/tenant/backup/export/index.js +9 -10
  28. package/dist/commands/tenant/backup/restore/index.d.ts +1 -1
  29. package/dist/commands/tenant/backup/restore/index.js +8 -9
  30. package/dist/commands/tenant/cluster/create/index.d.ts +18 -0
  31. package/dist/commands/tenant/cluster/create/index.js +149 -0
  32. package/dist/commands/{run/sessions/start → tenant/cluster/delete}/index.d.ts +9 -3
  33. package/dist/commands/tenant/cluster/delete/index.js +125 -0
  34. package/dist/commands/tenant/cluster/edit/index.d.ts +22 -0
  35. package/dist/commands/tenant/cluster/edit/index.js +128 -0
  36. package/dist/commands/{run/sessions → tenant/cluster}/get/index.d.ts +7 -3
  37. package/dist/commands/tenant/cluster/get/index.js +114 -0
  38. package/dist/commands/{run/info → tenant/cluster/license/get}/index.d.ts +10 -7
  39. package/dist/commands/tenant/cluster/license/get/index.js +118 -0
  40. package/dist/commands/tenant/cluster/license/set/index.d.ts +21 -0
  41. package/dist/commands/tenant/cluster/license/set/index.js +132 -0
  42. package/dist/commands/{run/env → tenant/cluster}/list/index.d.ts +3 -3
  43. package/dist/commands/tenant/cluster/list/index.js +109 -0
  44. package/dist/commands/tenant/create/index.d.ts +6 -3
  45. package/dist/commands/tenant/create/index.js +28 -20
  46. package/dist/commands/tenant/deploy_platform/index.d.ts +1 -1
  47. package/dist/commands/tenant/deploy_platform/index.js +8 -9
  48. package/dist/commands/tenant/deploy_release/index.d.ts +1 -1
  49. package/dist/commands/tenant/deploy_release/index.js +8 -9
  50. package/dist/commands/tenant/env/delete/index.d.ts +19 -0
  51. package/dist/commands/tenant/env/delete/index.js +139 -0
  52. package/dist/commands/{run/projects/create → tenant/env/get}/index.d.ts +7 -4
  53. package/dist/commands/tenant/env/get/index.js +113 -0
  54. package/dist/commands/{run/projects/update → tenant/env/get_all}/index.d.ts +7 -5
  55. package/dist/commands/tenant/env/get_all/index.js +123 -0
  56. package/dist/commands/{run/secrets/get → tenant/env/list}/index.d.ts +5 -3
  57. package/dist/commands/tenant/env/list/index.js +116 -0
  58. package/dist/commands/tenant/env/set/index.d.ts +18 -0
  59. package/dist/commands/tenant/env/set/index.js +122 -0
  60. package/dist/commands/tenant/env/set_all/index.d.ts +18 -0
  61. package/dist/commands/tenant/env/set_all/index.js +131 -0
  62. package/dist/commands/tenant/get/index.js +6 -5
  63. package/dist/commands/tenant/impersonate/index.d.ts +19 -0
  64. package/dist/commands/tenant/impersonate/index.js +146 -0
  65. package/dist/commands/tenant/license/get/index.d.ts +18 -0
  66. package/dist/commands/tenant/license/get/index.js +127 -0
  67. package/dist/commands/tenant/license/set/index.d.ts +19 -0
  68. package/dist/commands/tenant/license/set/index.js +141 -0
  69. package/dist/commands/tenant/list/index.js +6 -6
  70. package/dist/commands/tenant/pull/index.d.ts +31 -0
  71. package/dist/commands/tenant/pull/index.js +327 -0
  72. package/dist/commands/tenant/push/index.d.ts +24 -0
  73. package/dist/commands/tenant/push/index.js +245 -0
  74. package/oclif.manifest.json +2218 -1813
  75. package/package.json +1 -19
  76. package/dist/commands/run/env/delete/index.d.ts +0 -14
  77. package/dist/commands/run/env/delete/index.js +0 -65
  78. package/dist/commands/run/env/get/index.d.ts +0 -14
  79. package/dist/commands/run/env/get/index.js +0 -52
  80. package/dist/commands/run/env/list/index.js +0 -56
  81. package/dist/commands/run/env/set/index.d.ts +0 -14
  82. package/dist/commands/run/env/set/index.js +0 -51
  83. package/dist/commands/run/exec/index.d.ts +0 -31
  84. package/dist/commands/run/exec/index.js +0 -431
  85. package/dist/commands/run/info/index.js +0 -160
  86. package/dist/commands/run/projects/create/index.js +0 -75
  87. package/dist/commands/run/projects/delete/index.d.ts +0 -14
  88. package/dist/commands/run/projects/delete/index.js +0 -65
  89. package/dist/commands/run/projects/list/index.d.ts +0 -13
  90. package/dist/commands/run/projects/list/index.js +0 -66
  91. package/dist/commands/run/projects/update/index.js +0 -86
  92. package/dist/commands/run/secrets/delete/index.d.ts +0 -14
  93. package/dist/commands/run/secrets/delete/index.js +0 -65
  94. package/dist/commands/run/secrets/get/index.js +0 -52
  95. package/dist/commands/run/secrets/list/index.d.ts +0 -12
  96. package/dist/commands/run/secrets/list/index.js +0 -60
  97. package/dist/commands/run/secrets/set/index.d.ts +0 -16
  98. package/dist/commands/run/secrets/set/index.js +0 -74
  99. package/dist/commands/run/sessions/delete/index.d.ts +0 -14
  100. package/dist/commands/run/sessions/delete/index.js +0 -65
  101. package/dist/commands/run/sessions/get/index.js +0 -72
  102. package/dist/commands/run/sessions/list/index.d.ts +0 -13
  103. package/dist/commands/run/sessions/list/index.js +0 -64
  104. package/dist/commands/run/sessions/start/index.js +0 -56
  105. package/dist/commands/run/sessions/stop/index.d.ts +0 -14
  106. package/dist/commands/run/sessions/stop/index.js +0 -56
  107. package/dist/commands/run/sink/get/index.d.ts +0 -14
  108. package/dist/commands/run/sink/get/index.js +0 -63
  109. package/dist/lib/base-run-command.d.ts +0 -41
  110. package/dist/lib/base-run-command.js +0 -75
  111. package/dist/lib/run-http-client.d.ts +0 -64
  112. package/dist/lib/run-http-client.js +0 -171
  113. package/dist/lib/run-types.d.ts +0 -226
  114. package/dist/lib/run-types.js +0 -5
@@ -1,65 +0,0 @@
1
- import { Args, Flags } from '@oclif/core';
2
- import BaseRunCommand from '../../../../lib/base-run-command.js';
3
- export default class RunProjectsDelete extends BaseRunCommand {
4
- static args = {
5
- projectId: Args.string({
6
- description: 'Project ID to delete',
7
- required: true,
8
- }),
9
- };
10
- static description = 'Delete a project';
11
- static examples = [
12
- `$ xano run projects delete abc123-def456
13
- Are you sure you want to delete project 'abc123-def456'? (y/N)
14
- Project deleted successfully!
15
- `,
16
- `$ xano run projects delete abc123-def456 --force
17
- Project deleted successfully!
18
- `,
19
- ];
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
- async run() {
30
- const { args, flags } = await this.parse(RunProjectsDelete);
31
- // Initialize (no project required)
32
- await this.initRunCommand(flags.profile, flags.verbose);
33
- // Confirm deletion unless --force is used
34
- if (!flags.force) {
35
- const readline = await import('node:readline');
36
- const rl = readline.createInterface({
37
- input: process.stdin,
38
- output: process.stdout,
39
- });
40
- const confirmed = await new Promise((resolve) => {
41
- rl.question(`Are you sure you want to delete project '${args.projectId}'? (y/N) `, (answer) => {
42
- rl.close();
43
- resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
44
- });
45
- });
46
- if (!confirmed) {
47
- this.log('Deletion cancelled.');
48
- return;
49
- }
50
- }
51
- try {
52
- const url = this.httpClient.buildUrl(`/project/${args.projectId}`);
53
- await this.httpClient.delete(url);
54
- this.log('Project deleted successfully!');
55
- }
56
- catch (error) {
57
- if (error instanceof Error) {
58
- this.error(`Failed to delete project: ${error.message}`);
59
- }
60
- else {
61
- this.error(`Failed to delete project: ${String(error)}`);
62
- }
63
- }
64
- }
65
- }
@@ -1,13 +0,0 @@
1
- import BaseRunCommand from '../../../../lib/base-run-command.js';
2
- export default class RunProjectsList extends BaseRunCommand {
3
- static args: {};
4
- static description: string;
5
- static examples: string[];
6
- static flags: {
7
- output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
- profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
- };
11
- run(): Promise<void>;
12
- private outputTable;
13
- }
@@ -1,66 +0,0 @@
1
- import { Flags } from '@oclif/core';
2
- import BaseRunCommand from '../../../../lib/base-run-command.js';
3
- export default class RunProjectsList extends BaseRunCommand {
4
- static args = {};
5
- static description = 'List all projects';
6
- static examples = [
7
- `$ xano run projects list
8
- ID NAME ACCESS
9
- abc123-def456-ghi789 My Project private
10
- xyz789-uvw456-rst123 Test Project public
11
- `,
12
- `$ xano run projects list -o json
13
- [
14
- { "id": "abc123-def456-ghi789", "name": "My Project", ... }
15
- ]
16
- `,
17
- ];
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
- async run() {
29
- const { flags } = await this.parse(RunProjectsList);
30
- // Initialize (no project required for listing projects)
31
- await this.initRunCommand(flags.profile, flags.verbose);
32
- try {
33
- const url = this.httpClient.buildUrl('/project');
34
- const projects = await this.httpClient.get(url);
35
- if (flags.output === 'json') {
36
- this.outputJson(projects);
37
- }
38
- else {
39
- this.outputTable(projects);
40
- }
41
- }
42
- catch (error) {
43
- if (error instanceof Error) {
44
- this.error(`Failed to list projects: ${error.message}`);
45
- }
46
- else {
47
- this.error(`Failed to list projects: ${String(error)}`);
48
- }
49
- }
50
- }
51
- outputTable(projects) {
52
- if (projects.length === 0) {
53
- this.log('No projects found.');
54
- return;
55
- }
56
- // Print header
57
- this.log('ID NAME ACCESS');
58
- this.log('-'.repeat(75));
59
- for (const project of projects) {
60
- const id = project.id.padEnd(36);
61
- const name = project.name.slice(0, 24).padEnd(25);
62
- const { access } = project;
63
- this.log(`${id} ${name} ${access}`);
64
- }
65
- }
66
- }
@@ -1,86 +0,0 @@
1
- import { Args, Flags } from '@oclif/core';
2
- import BaseRunCommand from '../../../../lib/base-run-command.js';
3
- export default class RunProjectsUpdate extends BaseRunCommand {
4
- static args = {
5
- projectId: Args.string({
6
- description: 'Project ID to update',
7
- required: true,
8
- }),
9
- };
10
- static description = 'Update a project';
11
- static examples = [
12
- `$ xano run projects update abc123-def456 -n "New Name"
13
- Project updated successfully!
14
- ID: abc123-def456
15
- Name: New Name
16
- `,
17
- `$ xano run projects update abc123-def456 -d "New description"
18
- Project updated successfully!
19
- ID: abc123-def456
20
- Description: New description
21
- `,
22
- `$ xano run projects update abc123-def456 -n "New Name" -o json
23
- { "id": "abc123-def456", "name": "New Name", ... }
24
- `,
25
- ];
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
- async run() {
47
- const { args, flags } = await this.parse(RunProjectsUpdate);
48
- // Initialize (no project required)
49
- await this.initRunCommand(flags.profile, flags.verbose);
50
- // Check if any update flags were provided
51
- if (!flags.name && flags.description === undefined) {
52
- this.error('At least one of --name or --description must be provided');
53
- }
54
- const input = {};
55
- if (flags.name) {
56
- input.name = flags.name;
57
- }
58
- if (flags.description !== undefined) {
59
- input.description = flags.description;
60
- }
61
- try {
62
- const url = this.httpClient.buildUrl(`/project/${args.projectId}`);
63
- const project = await this.httpClient.patch(url, input);
64
- if (flags.output === 'json') {
65
- this.outputJson(project);
66
- }
67
- else {
68
- this.log('Project updated successfully!');
69
- this.log(` ID: ${project.id}`);
70
- this.log(` Name: ${project.name}`);
71
- if (project.description) {
72
- this.log(` Description: ${project.description}`);
73
- }
74
- this.log(` Access: ${project.access}`);
75
- }
76
- }
77
- catch (error) {
78
- if (error instanceof Error) {
79
- this.error(`Failed to update project: ${error.message}`);
80
- }
81
- else {
82
- this.error(`Failed to update project: ${String(error)}`);
83
- }
84
- }
85
- }
86
- }
@@ -1,14 +0,0 @@
1
- import BaseRunCommand from '../../../../lib/base-run-command.js';
2
- export default class RunSecretsDelete extends BaseRunCommand {
3
- static args: {
4
- name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
- };
6
- static description: string;
7
- static examples: string[];
8
- static flags: {
9
- force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
- profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
- };
13
- run(): Promise<void>;
14
- }
@@ -1,65 +0,0 @@
1
- import { Args, Flags } from '@oclif/core';
2
- import BaseRunCommand from '../../../../lib/base-run-command.js';
3
- export default class RunSecretsDelete extends BaseRunCommand {
4
- static args = {
5
- name: Args.string({
6
- description: 'Secret name',
7
- required: true,
8
- }),
9
- };
10
- static description = 'Delete a secret';
11
- static examples = [
12
- `$ xano run secrets delete docker-registry
13
- Are you sure you want to delete secret 'docker-registry'? (y/N)
14
- Secret 'docker-registry' deleted successfully!
15
- `,
16
- `$ xano run secrets delete docker-registry --force
17
- Secret 'docker-registry' deleted successfully!
18
- `,
19
- ];
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
- async run() {
30
- const { args, flags } = await this.parse(RunSecretsDelete);
31
- // Initialize with project required
32
- await this.initRunCommandWithProject(flags.profile, flags.verbose);
33
- // Confirm deletion unless --force is used
34
- if (!flags.force) {
35
- const readline = await import('node:readline');
36
- const rl = readline.createInterface({
37
- input: process.stdin,
38
- output: process.stdout,
39
- });
40
- const confirmed = await new Promise((resolve) => {
41
- rl.question(`Are you sure you want to delete secret '${args.name}'? (y/N) `, (answer) => {
42
- rl.close();
43
- resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
44
- });
45
- });
46
- if (!confirmed) {
47
- this.log('Deletion cancelled.');
48
- return;
49
- }
50
- }
51
- try {
52
- const url = this.httpClient.buildProjectUrl('/secret');
53
- await this.httpClient.delete(url, { name: args.name });
54
- this.log(`Secret '${args.name}' deleted successfully!`);
55
- }
56
- catch (error) {
57
- if (error instanceof Error) {
58
- this.error(`Failed to delete secret: ${error.message}`);
59
- }
60
- else {
61
- this.error(`Failed to delete secret: ${String(error)}`);
62
- }
63
- }
64
- }
65
- }
@@ -1,52 +0,0 @@
1
- import { Args, Flags } from '@oclif/core';
2
- import BaseRunCommand from '../../../../lib/base-run-command.js';
3
- export default class RunSecretsGet extends BaseRunCommand {
4
- static args = {
5
- name: Args.string({
6
- description: 'Secret name',
7
- required: true,
8
- }),
9
- };
10
- static description = 'Get a secret value';
11
- static examples = [
12
- `$ xano run secrets get docker-registry
13
- {"auths":{"ghcr.io":{"auth":"..."}}}
14
- `,
15
- `$ xano run secrets get docker-registry -o json
16
- { "name": "docker-registry", "type": "kubernetes.io/dockerconfigjson", "value": "..." }
17
- `,
18
- ];
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
- async run() {
30
- const { args, flags } = await this.parse(RunSecretsGet);
31
- // Initialize with project required
32
- await this.initRunCommandWithProject(flags.profile, flags.verbose);
33
- try {
34
- const url = this.httpClient.buildProjectUrl('/secret', { name: args.name });
35
- const result = await this.httpClient.get(url);
36
- if (flags.output === 'json') {
37
- this.outputJson(result);
38
- }
39
- else {
40
- this.log(result.value);
41
- }
42
- }
43
- catch (error) {
44
- if (error instanceof Error) {
45
- this.error(`Failed to get secret: ${error.message}`);
46
- }
47
- else {
48
- this.error(`Failed to get secret: ${String(error)}`);
49
- }
50
- }
51
- }
52
- }
@@ -1,12 +0,0 @@
1
- import BaseRunCommand from '../../../../lib/base-run-command.js';
2
- export default class RunSecretsList extends BaseRunCommand {
3
- static args: {};
4
- static description: string;
5
- static examples: string[];
6
- static flags: {
7
- output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
- profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
- };
11
- run(): Promise<void>;
12
- }
@@ -1,60 +0,0 @@
1
- import { Flags } from '@oclif/core';
2
- import BaseRunCommand from '../../../../lib/base-run-command.js';
3
- export default class RunSecretsList extends BaseRunCommand {
4
- static args = {};
5
- static description = 'List all secret keys';
6
- static examples = [
7
- `$ xano run secrets list
8
- NAME TYPE REPO
9
- docker-registry kubernetes.io/dockerconfigjson ghcr.io
10
- service-account kubernetes.io/service-account-token -
11
- `,
12
- `$ xano run secrets list -o json
13
- { "secrets": [{ "name": "docker-registry", "type": "kubernetes.io/dockerconfigjson", "repo": "ghcr.io" }] }
14
- `,
15
- ];
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
- async run() {
27
- const { flags } = await this.parse(RunSecretsList);
28
- // Initialize with project required
29
- await this.initRunCommandWithProject(flags.profile, flags.verbose);
30
- try {
31
- const url = this.httpClient.buildProjectUrl('/secret/key');
32
- const result = await this.httpClient.get(url);
33
- if (flags.output === 'json') {
34
- this.outputJson(result);
35
- }
36
- else if (result.secrets.length === 0) {
37
- this.log('No secrets found.');
38
- }
39
- else {
40
- // Print header
41
- this.log('NAME TYPE REPO');
42
- this.log('-'.repeat(80));
43
- for (const secret of result.secrets) {
44
- const name = secret.name.slice(0, 24).padEnd(24);
45
- const type = secret.type.padEnd(37);
46
- const repo = secret.repo || '-';
47
- this.log(`${name} ${type} ${repo}`);
48
- }
49
- }
50
- }
51
- catch (error) {
52
- if (error instanceof Error) {
53
- this.error(`Failed to list secrets: ${error.message}`);
54
- }
55
- else {
56
- this.error(`Failed to list secrets: ${String(error)}`);
57
- }
58
- }
59
- }
60
- }
@@ -1,16 +0,0 @@
1
- import BaseRunCommand from '../../../../lib/base-run-command.js';
2
- export default class RunSecretsSet extends BaseRunCommand {
3
- static args: {
4
- name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
- };
6
- static description: string;
7
- static examples: string[];
8
- static flags: {
9
- repo: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
- type: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
- value: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
- profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- };
15
- run(): Promise<void>;
16
- }
@@ -1,74 +0,0 @@
1
- import { Args, Flags } from '@oclif/core';
2
- import BaseRunCommand from '../../../../lib/base-run-command.js';
3
- export default class RunSecretsSet extends BaseRunCommand {
4
- static args = {
5
- name: Args.string({
6
- description: 'Secret name',
7
- required: true,
8
- }),
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
- static flags = {
20
- ...BaseRunCommand.baseFlags,
21
- repo: Flags.string({
22
- char: 'r',
23
- description: 'Repository (for dockerconfigjson type)',
24
- required: false,
25
- }),
26
- type: Flags.string({
27
- char: 't',
28
- description: 'Secret type',
29
- options: ['dockerconfigjson', 'service-account-token'],
30
- required: true,
31
- }),
32
- value: Flags.string({
33
- char: 'v',
34
- description: 'Secret value',
35
- required: true,
36
- }),
37
- };
38
- async run() {
39
- const { args, flags } = await this.parse(RunSecretsSet);
40
- // Initialize with project required
41
- await this.initRunCommandWithProject(flags.profile, flags.verbose);
42
- // Map short type to full type
43
- const typeMap = {
44
- 'dockerconfigjson': 'kubernetes.io/dockerconfigjson',
45
- 'service-account-token': 'kubernetes.io/service-account-token',
46
- };
47
- const secretType = typeMap[flags.type];
48
- if (!secretType) {
49
- this.error(`Invalid secret type: ${flags.type}`);
50
- }
51
- const input = {
52
- name: args.name,
53
- secret: {
54
- name: args.name,
55
- type: secretType,
56
- value: flags.value,
57
- ...(flags.repo && { repo: flags.repo }),
58
- },
59
- };
60
- try {
61
- const url = this.httpClient.buildProjectUrl('/secret');
62
- await this.httpClient.patch(url, input);
63
- this.log(`Secret '${args.name}' set successfully!`);
64
- }
65
- catch (error) {
66
- if (error instanceof Error) {
67
- this.error(`Failed to set secret: ${error.message}`);
68
- }
69
- else {
70
- this.error(`Failed to set secret: ${String(error)}`);
71
- }
72
- }
73
- }
74
- }
@@ -1,14 +0,0 @@
1
- import BaseRunCommand from '../../../../lib/base-run-command.js';
2
- export default class RunSessionsDelete extends BaseRunCommand {
3
- static args: {
4
- sessionId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
- };
6
- static description: string;
7
- static examples: string[];
8
- static flags: {
9
- force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
- profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
- };
13
- run(): Promise<void>;
14
- }
@@ -1,65 +0,0 @@
1
- import { Args, Flags } from '@oclif/core';
2
- import BaseRunCommand from '../../../../lib/base-run-command.js';
3
- export default class RunSessionsDelete extends BaseRunCommand {
4
- static args = {
5
- sessionId: Args.string({
6
- description: 'Session ID',
7
- required: true,
8
- }),
9
- };
10
- static description = 'Delete a session';
11
- static examples = [
12
- `$ xano run sessions delete abc123-def456
13
- Are you sure you want to delete session 'abc123-def456'? (y/N)
14
- Session deleted successfully!
15
- `,
16
- `$ xano run sessions delete abc123-def456 --force
17
- Session deleted successfully!
18
- `,
19
- ];
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
- async run() {
30
- const { args, flags } = await this.parse(RunSessionsDelete);
31
- // Initialize with project required
32
- await this.initRunCommandWithProject(flags.profile, flags.verbose);
33
- // Confirm deletion unless --force is used
34
- if (!flags.force) {
35
- const readline = await import('node:readline');
36
- const rl = readline.createInterface({
37
- input: process.stdin,
38
- output: process.stdout,
39
- });
40
- const confirmed = await new Promise((resolve) => {
41
- rl.question(`Are you sure you want to delete session '${args.sessionId}'? (y/N) `, (answer) => {
42
- rl.close();
43
- resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
44
- });
45
- });
46
- if (!confirmed) {
47
- this.log('Deletion cancelled.');
48
- return;
49
- }
50
- }
51
- try {
52
- const url = this.httpClient.buildProjectUrl(`/run/session/${args.sessionId}`);
53
- await this.httpClient.delete(url);
54
- this.log('Session deleted successfully!');
55
- }
56
- catch (error) {
57
- if (error instanceof Error) {
58
- this.error(`Failed to delete session: ${error.message}`);
59
- }
60
- else {
61
- this.error(`Failed to delete session: ${String(error)}`);
62
- }
63
- }
64
- }
65
- }