@xano/cli 0.0.21 → 0.0.23

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 (107) hide show
  1. package/dist/base-command.d.ts +1 -1
  2. package/dist/base-command.js +6 -6
  3. package/dist/commands/branch/create/index.d.ts +17 -0
  4. package/dist/commands/branch/create/index.js +164 -0
  5. package/dist/commands/branch/delete/index.d.ts +18 -0
  6. package/dist/commands/branch/delete/index.js +156 -0
  7. package/dist/commands/branch/edit/index.d.ts +19 -0
  8. package/dist/commands/branch/edit/index.js +166 -0
  9. package/dist/commands/branch/get/index.d.ts +16 -0
  10. package/dist/commands/branch/get/index.js +135 -0
  11. package/dist/commands/branch/list/index.d.ts +18 -0
  12. package/dist/commands/branch/list/index.js +138 -0
  13. package/dist/commands/branch/set-live/index.d.ts +18 -0
  14. package/dist/commands/branch/set-live/index.js +155 -0
  15. package/dist/commands/function/create/index.d.ts +6 -6
  16. package/dist/commands/function/create/index.js +55 -55
  17. package/dist/commands/function/edit/index.d.ts +10 -10
  18. package/dist/commands/function/edit/index.js +155 -162
  19. package/dist/commands/function/get/index.d.ts +5 -5
  20. package/dist/commands/function/get/index.js +55 -60
  21. package/dist/commands/function/list/index.d.ts +5 -5
  22. package/dist/commands/function/list/index.js +52 -52
  23. package/dist/commands/profile/create/index.d.ts +6 -6
  24. package/dist/commands/profile/create/index.js +37 -37
  25. package/dist/commands/profile/delete/index.d.ts +2 -2
  26. package/dist/commands/profile/delete/index.js +9 -9
  27. package/dist/commands/profile/edit/index.d.ts +7 -7
  28. package/dist/commands/profile/edit/index.js +47 -47
  29. package/dist/commands/profile/get-default/index.js +1 -1
  30. package/dist/commands/profile/list/index.d.ts +2 -2
  31. package/dist/commands/profile/list/index.js +9 -9
  32. package/dist/commands/profile/me/index.d.ts +3 -3
  33. package/dist/commands/profile/me/index.js +21 -21
  34. package/dist/commands/profile/project/index.js +1 -1
  35. package/dist/commands/profile/set-default/index.js +1 -1
  36. package/dist/commands/profile/token/index.js +1 -1
  37. package/dist/commands/profile/wizard/index.d.ts +4 -4
  38. package/dist/commands/profile/wizard/index.js +118 -122
  39. package/dist/commands/run/env/delete/index.d.ts +2 -2
  40. package/dist/commands/run/env/delete/index.js +9 -9
  41. package/dist/commands/run/env/get/index.d.ts +2 -2
  42. package/dist/commands/run/env/get/index.js +10 -10
  43. package/dist/commands/run/env/list/index.d.ts +2 -2
  44. package/dist/commands/run/env/list/index.js +16 -18
  45. package/dist/commands/run/env/set/index.d.ts +2 -2
  46. package/dist/commands/run/env/set/index.js +4 -4
  47. package/dist/commands/run/exec/index.d.ts +11 -11
  48. package/dist/commands/run/exec/index.js +109 -109
  49. package/dist/commands/run/info/index.d.ts +4 -4
  50. package/dist/commands/run/info/index.js +26 -26
  51. package/dist/commands/run/projects/create/index.d.ts +3 -3
  52. package/dist/commands/run/projects/create/index.js +22 -22
  53. package/dist/commands/run/projects/delete/index.d.ts +2 -2
  54. package/dist/commands/run/projects/delete/index.js +9 -9
  55. package/dist/commands/run/projects/list/index.d.ts +2 -2
  56. package/dist/commands/run/projects/list/index.js +11 -11
  57. package/dist/commands/run/projects/update/index.d.ts +3 -3
  58. package/dist/commands/run/projects/update/index.js +20 -20
  59. package/dist/commands/run/secrets/delete/index.d.ts +2 -2
  60. package/dist/commands/run/secrets/delete/index.js +9 -9
  61. package/dist/commands/run/secrets/get/index.d.ts +2 -2
  62. package/dist/commands/run/secrets/get/index.js +10 -10
  63. package/dist/commands/run/secrets/list/index.d.ts +2 -2
  64. package/dist/commands/run/secrets/list/index.js +21 -23
  65. package/dist/commands/run/secrets/set/index.d.ts +3 -3
  66. package/dist/commands/run/secrets/set/index.js +15 -15
  67. package/dist/commands/run/sessions/delete/index.d.ts +2 -2
  68. package/dist/commands/run/sessions/delete/index.js +9 -9
  69. package/dist/commands/run/sessions/get/index.d.ts +2 -2
  70. package/dist/commands/run/sessions/get/index.js +10 -10
  71. package/dist/commands/run/sessions/list/index.d.ts +2 -2
  72. package/dist/commands/run/sessions/list/index.js +10 -10
  73. package/dist/commands/run/sessions/start/index.d.ts +2 -2
  74. package/dist/commands/run/sessions/start/index.js +10 -10
  75. package/dist/commands/run/sessions/stop/index.d.ts +2 -2
  76. package/dist/commands/run/sessions/stop/index.js +10 -10
  77. package/dist/commands/run/sink/get/index.d.ts +2 -2
  78. package/dist/commands/run/sink/get/index.js +10 -10
  79. package/dist/commands/static_host/build/create/index.d.ts +4 -4
  80. package/dist/commands/static_host/build/create/index.js +33 -33
  81. package/dist/commands/static_host/build/get/index.d.ts +4 -4
  82. package/dist/commands/static_host/build/get/index.js +20 -20
  83. package/dist/commands/static_host/build/list/index.d.ts +3 -3
  84. package/dist/commands/static_host/build/list/index.js +31 -31
  85. package/dist/commands/static_host/list/index.d.ts +3 -3
  86. package/dist/commands/static_host/list/index.js +31 -31
  87. package/dist/commands/workspace/create/index.d.ts +3 -3
  88. package/dist/commands/workspace/create/index.js +24 -24
  89. package/dist/commands/workspace/delete/index.d.ts +2 -2
  90. package/dist/commands/workspace/delete/index.js +18 -18
  91. package/dist/commands/workspace/edit/index.d.ts +5 -5
  92. package/dist/commands/workspace/edit/index.js +34 -34
  93. package/dist/commands/workspace/get/index.d.ts +2 -2
  94. package/dist/commands/workspace/get/index.js +12 -12
  95. package/dist/commands/workspace/list/index.d.ts +2 -2
  96. package/dist/commands/workspace/list/index.js +15 -15
  97. package/dist/commands/workspace/pull/index.d.ts +4 -4
  98. package/dist/commands/workspace/pull/index.js +46 -51
  99. package/dist/commands/workspace/push/index.js +3 -3
  100. package/dist/help.d.ts +1 -1
  101. package/dist/lib/base-run-command.d.ts +4 -4
  102. package/dist/lib/base-run-command.js +3 -3
  103. package/dist/lib/run-http-client.d.ts +20 -20
  104. package/dist/lib/run-http-client.js +71 -71
  105. package/dist/lib/run-types.d.ts +80 -80
  106. package/oclif.manifest.json +1531 -1010
  107. package/package.json +1 -1
@@ -3,17 +3,17 @@ export default class StaticHostBuildCreate extends BaseCommand {
3
3
  static args: {
4
4
  static_host: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
5
  };
6
+ static description: string;
7
+ static examples: string[];
6
8
  static flags: {
7
- workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
10
  file: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
11
  name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
- description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
14
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
15
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
16
  };
15
- static description: string;
16
- static examples: string[];
17
17
  run(): Promise<void>;
18
18
  private loadCredentials;
19
19
  }
@@ -1,8 +1,8 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
+ import * as yaml from 'js-yaml';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  import * as path from 'node:path';
5
- import * as yaml from 'js-yaml';
6
6
  import BaseCommand from '../../../../base-command.js';
7
7
  export default class StaticHostBuildCreate extends BaseCommand {
8
8
  static args = {
@@ -11,36 +11,6 @@ export default class StaticHostBuildCreate extends BaseCommand {
11
11
  required: true,
12
12
  }),
13
13
  };
14
- static flags = {
15
- ...BaseCommand.baseFlags,
16
- workspace: Flags.string({
17
- char: 'w',
18
- description: 'Workspace ID (optional if set in profile)',
19
- required: false,
20
- }),
21
- file: Flags.string({
22
- char: 'f',
23
- description: 'Path to zip file to upload',
24
- required: true,
25
- }),
26
- name: Flags.string({
27
- char: 'n',
28
- description: 'Build name',
29
- required: true,
30
- }),
31
- description: Flags.string({
32
- char: 'd',
33
- description: 'Build description',
34
- required: false,
35
- }),
36
- output: Flags.string({
37
- char: 'o',
38
- description: 'Output format',
39
- required: false,
40
- default: 'summary',
41
- options: ['summary', 'json'],
42
- }),
43
- };
44
14
  static description = 'Create a new build for a static host';
45
15
  static examples = [
46
16
  `$ xano static_host:build:create default -f ./build.zip -n "v1.0.0"
@@ -63,6 +33,36 @@ Description: Production build
63
33
  }
64
34
  `,
65
35
  ];
36
+ static flags = {
37
+ ...BaseCommand.baseFlags,
38
+ description: Flags.string({
39
+ char: 'd',
40
+ description: 'Build description',
41
+ required: false,
42
+ }),
43
+ file: Flags.string({
44
+ char: 'f',
45
+ description: 'Path to zip file to upload',
46
+ required: true,
47
+ }),
48
+ name: Flags.string({
49
+ char: 'n',
50
+ description: 'Build name',
51
+ required: true,
52
+ }),
53
+ output: Flags.string({
54
+ char: 'o',
55
+ default: 'summary',
56
+ description: 'Output format',
57
+ options: ['summary', 'json'],
58
+ required: false,
59
+ }),
60
+ workspace: Flags.string({
61
+ char: 'w',
62
+ description: 'Workspace ID (optional if set in profile)',
63
+ required: false,
64
+ }),
65
+ };
66
66
  async run() {
67
67
  const { args, flags } = await this.parse(StaticHostBuildCreate);
68
68
  // Get profile name (default or from flag/env)
@@ -128,12 +128,12 @@ Description: Production build
128
128
  // Create build via API
129
129
  try {
130
130
  const response = await fetch(apiUrl, {
131
- method: 'POST',
131
+ body: formData,
132
132
  headers: {
133
133
  'accept': 'application/json',
134
134
  'Authorization': `Bearer ${profile.access_token}`,
135
135
  },
136
- body: formData,
136
+ method: 'POST',
137
137
  });
138
138
  if (!response.ok) {
139
139
  const errorText = await response.text();
@@ -1,17 +1,17 @@
1
1
  import BaseCommand from '../../../../base-command.js';
2
2
  export default class StaticHostBuildGet extends BaseCommand {
3
3
  static args: {
4
- static_host: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
4
  build_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ static_host: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
6
  };
7
+ static description: string;
8
+ static examples: string[];
7
9
  static flags: {
8
- workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
12
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
13
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
14
  };
13
- static description: string;
14
- static examples: string[];
15
15
  run(): Promise<void>;
16
16
  private loadCredentials;
17
17
  }
@@ -1,33 +1,18 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
+ import * as yaml from 'js-yaml';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  import * as path from 'node:path';
5
- import * as yaml from 'js-yaml';
6
6
  import BaseCommand from '../../../../base-command.js';
7
7
  export default class StaticHostBuildGet extends BaseCommand {
8
8
  static args = {
9
- static_host: Args.string({
10
- description: 'Static Host name',
11
- required: true,
12
- }),
13
9
  build_id: Args.string({
14
10
  description: 'Build ID',
15
11
  required: true,
16
12
  }),
17
- };
18
- static flags = {
19
- ...BaseCommand.baseFlags,
20
- workspace: Flags.string({
21
- char: 'w',
22
- description: 'Workspace ID (optional if set in profile)',
23
- required: false,
24
- }),
25
- output: Flags.string({
26
- char: 'o',
27
- description: 'Output format',
28
- required: false,
29
- default: 'summary',
30
- options: ['summary', 'json'],
13
+ static_host: Args.string({
14
+ description: 'Static Host name',
15
+ required: true,
31
16
  }),
32
17
  };
33
18
  static description = 'Get details of a specific build for a static host';
@@ -57,6 +42,21 @@ Name: production-build
57
42
  }
58
43
  `,
59
44
  ];
45
+ static flags = {
46
+ ...BaseCommand.baseFlags,
47
+ output: Flags.string({
48
+ char: 'o',
49
+ default: 'summary',
50
+ description: 'Output format',
51
+ options: ['summary', 'json'],
52
+ required: false,
53
+ }),
54
+ workspace: Flags.string({
55
+ char: 'w',
56
+ description: 'Workspace ID (optional if set in profile)',
57
+ required: false,
58
+ }),
59
+ };
60
60
  async run() {
61
61
  const { args, flags } = await this.parse(StaticHostBuildGet);
62
62
  // Get profile name (default or from flag/env)
@@ -94,11 +94,11 @@ Name: production-build
94
94
  // Fetch build from the API
95
95
  try {
96
96
  const response = await fetch(apiUrl, {
97
- method: 'GET',
98
97
  headers: {
99
98
  'accept': 'application/json',
100
99
  'Authorization': `Bearer ${profile.access_token}`,
101
100
  },
101
+ method: 'GET',
102
102
  });
103
103
  if (!response.ok) {
104
104
  const errorText = await response.text();
@@ -3,16 +3,16 @@ export default class StaticHostBuildList extends BaseCommand {
3
3
  static args: {
4
4
  static_host: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
5
  };
6
+ static description: string;
7
+ static examples: string[];
6
8
  static flags: {
7
- workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
10
  page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
10
11
  per_page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
12
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
14
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
15
  };
14
- static description: string;
15
- static examples: string[];
16
16
  run(): Promise<void>;
17
17
  private loadCredentials;
18
18
  }
@@ -1,8 +1,8 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
+ import * as yaml from 'js-yaml';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  import * as path from 'node:path';
5
- import * as yaml from 'js-yaml';
6
6
  import BaseCommand from '../../../../base-command.js';
7
7
  export default class StaticHostBuildList extends BaseCommand {
8
8
  static args = {
@@ -11,31 +11,6 @@ export default class StaticHostBuildList extends BaseCommand {
11
11
  required: true,
12
12
  }),
13
13
  };
14
- static flags = {
15
- ...BaseCommand.baseFlags,
16
- workspace: Flags.string({
17
- char: 'w',
18
- description: 'Workspace ID (optional if set in profile)',
19
- required: false,
20
- }),
21
- output: Flags.string({
22
- char: 'o',
23
- description: 'Output format',
24
- required: false,
25
- default: 'summary',
26
- options: ['summary', 'json'],
27
- }),
28
- page: Flags.integer({
29
- description: 'Page number for pagination',
30
- required: false,
31
- default: 1,
32
- }),
33
- per_page: Flags.integer({
34
- description: 'Number of results per page',
35
- required: false,
36
- default: 50,
37
- }),
38
- };
39
14
  static description = 'List all builds for a static host';
40
15
  static examples = [
41
16
  `$ xano static_host:build:list default -w 40
@@ -66,6 +41,31 @@ Available builds:
66
41
  ]
67
42
  `,
68
43
  ];
44
+ static flags = {
45
+ ...BaseCommand.baseFlags,
46
+ output: Flags.string({
47
+ char: 'o',
48
+ default: 'summary',
49
+ description: 'Output format',
50
+ options: ['summary', 'json'],
51
+ required: false,
52
+ }),
53
+ page: Flags.integer({
54
+ default: 1,
55
+ description: 'Page number for pagination',
56
+ required: false,
57
+ }),
58
+ per_page: Flags.integer({
59
+ default: 50,
60
+ description: 'Number of results per page',
61
+ required: false,
62
+ }),
63
+ workspace: Flags.string({
64
+ char: 'w',
65
+ description: 'Workspace ID (optional if set in profile)',
66
+ required: false,
67
+ }),
68
+ };
69
69
  async run() {
70
70
  const { args, flags } = await this.parse(StaticHostBuildList);
71
71
  // Get profile name (default or from flag/env)
@@ -111,11 +111,11 @@ Available builds:
111
111
  // Fetch builds from the API
112
112
  try {
113
113
  const response = await fetch(apiUrl, {
114
- method: 'GET',
115
114
  headers: {
116
115
  'accept': 'application/json',
117
116
  'Authorization': `Bearer ${profile.access_token}`,
118
117
  },
118
+ method: 'GET',
119
119
  });
120
120
  if (!response.ok) {
121
121
  const errorText = await response.text();
@@ -148,12 +148,12 @@ Available builds:
148
148
  else {
149
149
  this.log('Available builds:');
150
150
  for (const build of builds) {
151
- if (build.id !== undefined) {
152
- const statusInfo = build.status ? ` - Status: ${build.status}` : '';
153
- this.log(` - ${build.name} (ID: ${build.id})${statusInfo}`);
151
+ if (build.id === undefined) {
152
+ this.log(` - ${build.name}`);
154
153
  }
155
154
  else {
156
- this.log(` - ${build.name}`);
155
+ const statusInfo = build.status ? ` - Status: ${build.status}` : '';
156
+ this.log(` - ${build.name} (ID: ${build.id})${statusInfo}`);
157
157
  }
158
158
  }
159
159
  }
@@ -1,16 +1,16 @@
1
1
  import BaseCommand from '../../../base-command.js';
2
2
  export default class StaticHostList extends BaseCommand {
3
3
  static args: {};
4
+ static description: string;
5
+ static examples: string[];
4
6
  static flags: {
5
- workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
7
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
8
  page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
8
9
  per_page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
10
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
11
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
12
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
13
  };
12
- static description: string;
13
- static examples: string[];
14
14
  run(): Promise<void>;
15
15
  private loadCredentials;
16
16
  }
@@ -1,36 +1,11 @@
1
1
  import { Flags } from '@oclif/core';
2
+ import * as yaml from 'js-yaml';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  import * as path from 'node:path';
5
- import * as yaml from 'js-yaml';
6
6
  import BaseCommand from '../../../base-command.js';
7
7
  export default class StaticHostList extends BaseCommand {
8
8
  static args = {};
9
- static flags = {
10
- ...BaseCommand.baseFlags,
11
- workspace: Flags.string({
12
- char: 'w',
13
- description: 'Workspace ID (optional if set in profile)',
14
- required: false,
15
- }),
16
- output: Flags.string({
17
- char: 'o',
18
- description: 'Output format',
19
- required: false,
20
- default: 'summary',
21
- options: ['summary', 'json'],
22
- }),
23
- page: Flags.integer({
24
- description: 'Page number for pagination',
25
- required: false,
26
- default: 1,
27
- }),
28
- per_page: Flags.integer({
29
- description: 'Number of results per page',
30
- required: false,
31
- default: 50,
32
- }),
33
- };
34
9
  static description = 'List all static hosts in a workspace from the Xano Metadata API';
35
10
  static examples = [
36
11
  `$ xano static_host:list -w 40
@@ -61,6 +36,31 @@ Available static hosts:
61
36
  ]
62
37
  `,
63
38
  ];
39
+ static flags = {
40
+ ...BaseCommand.baseFlags,
41
+ output: Flags.string({
42
+ char: 'o',
43
+ default: 'summary',
44
+ description: 'Output format',
45
+ options: ['summary', 'json'],
46
+ required: false,
47
+ }),
48
+ page: Flags.integer({
49
+ default: 1,
50
+ description: 'Page number for pagination',
51
+ required: false,
52
+ }),
53
+ per_page: Flags.integer({
54
+ default: 50,
55
+ description: 'Number of results per page',
56
+ required: false,
57
+ }),
58
+ workspace: Flags.string({
59
+ char: 'w',
60
+ description: 'Workspace ID (optional if set in profile)',
61
+ required: false,
62
+ }),
63
+ };
64
64
  async run() {
65
65
  const { flags } = await this.parse(StaticHostList);
66
66
  // Get profile name (default or from flag/env)
@@ -106,11 +106,11 @@ Available static hosts:
106
106
  // Fetch static hosts from the API
107
107
  try {
108
108
  const response = await fetch(apiUrl, {
109
- method: 'GET',
110
109
  headers: {
111
110
  'accept': 'application/json',
112
111
  'Authorization': `Bearer ${profile.access_token}`,
113
112
  },
113
+ method: 'GET',
114
114
  });
115
115
  if (!response.ok) {
116
116
  const errorText = await response.text();
@@ -143,12 +143,12 @@ Available static hosts:
143
143
  else {
144
144
  this.log('Available static hosts:');
145
145
  for (const host of staticHosts) {
146
- if (host.id !== undefined) {
147
- const domainInfo = host.domain ? ` - ${host.domain}` : '';
148
- this.log(` - ${host.name} (ID: ${host.id})${domainInfo}`);
146
+ if (host.id === undefined) {
147
+ this.log(` - ${host.name}`);
149
148
  }
150
149
  else {
151
- this.log(` - ${host.name}`);
150
+ const domainInfo = host.domain ? ` - ${host.domain}` : '';
151
+ this.log(` - ${host.name} (ID: ${host.id})${domainInfo}`);
152
152
  }
153
153
  }
154
154
  }
@@ -1,14 +1,14 @@
1
1
  import BaseCommand from '../../../base-command.js';
2
2
  export default class WorkspaceCreate extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
3
5
  static flags: {
4
- name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
5
6
  description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
8
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
9
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
10
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
11
  };
10
- static description: string;
11
- static examples: string[];
12
12
  run(): Promise<void>;
13
13
  private loadCredentials;
14
14
  }
@@ -1,30 +1,10 @@
1
1
  import { Flags } from '@oclif/core';
2
+ import * as yaml from 'js-yaml';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  import * as path from 'node:path';
5
- import * as yaml from 'js-yaml';
6
6
  import BaseCommand from '../../../base-command.js';
7
7
  export default class WorkspaceCreate extends BaseCommand {
8
- static flags = {
9
- ...BaseCommand.baseFlags,
10
- name: Flags.string({
11
- char: 'n',
12
- description: 'Name of the workspace',
13
- required: true,
14
- }),
15
- description: Flags.string({
16
- char: 'd',
17
- description: 'Description for the workspace',
18
- required: false,
19
- }),
20
- output: Flags.string({
21
- char: 'o',
22
- description: 'Output format',
23
- required: false,
24
- default: 'summary',
25
- options: ['summary', 'json'],
26
- }),
27
- };
28
8
  static description = 'Create a new workspace via the Xano Metadata API';
29
9
  static examples = [
30
10
  `$ xano workspace create --name "my-workspace"
@@ -42,6 +22,26 @@ Created workspace: my-app (ID: 456)
42
22
  }
43
23
  `,
44
24
  ];
25
+ static flags = {
26
+ ...BaseCommand.baseFlags,
27
+ description: Flags.string({
28
+ char: 'd',
29
+ description: 'Description for the workspace',
30
+ required: false,
31
+ }),
32
+ name: Flags.string({
33
+ char: 'n',
34
+ description: 'Name of the workspace',
35
+ required: true,
36
+ }),
37
+ output: Flags.string({
38
+ char: 'o',
39
+ default: 'summary',
40
+ description: 'Output format',
41
+ options: ['summary', 'json'],
42
+ required: false,
43
+ }),
44
+ };
45
45
  async run() {
46
46
  const { flags } = await this.parse(WorkspaceCreate);
47
47
  // Get profile name (default or from flag/env)
@@ -73,13 +73,13 @@ Created workspace: my-app (ID: 456)
73
73
  // Create workspace via the API
74
74
  try {
75
75
  const response = await fetch(apiUrl, {
76
- method: 'POST',
76
+ body: JSON.stringify(body),
77
77
  headers: {
78
78
  'accept': 'application/json',
79
- 'content-type': 'application/json',
80
79
  'Authorization': `Bearer ${profile.access_token}`,
80
+ 'content-type': 'application/json',
81
81
  },
82
- body: JSON.stringify(body),
82
+ method: 'POST',
83
83
  });
84
84
  if (!response.ok) {
85
85
  const errorText = await response.text();
@@ -6,14 +6,14 @@ export default class WorkspaceDelete extends BaseCommand {
6
6
  min?: number;
7
7
  }>;
8
8
  };
9
+ static description: string;
10
+ static examples: string[];
9
11
  static flags: {
10
12
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
13
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
14
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
15
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
16
  };
15
- static description: string;
16
- static examples: string[];
17
17
  run(): Promise<void>;
18
18
  private confirm;
19
19
  private loadCredentials;
@@ -1,8 +1,8 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
+ import * as yaml from 'js-yaml';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  import * as path from 'node:path';
5
- import * as yaml from 'js-yaml';
6
6
  import BaseCommand from '../../../base-command.js';
7
7
  export default class WorkspaceDelete extends BaseCommand {
8
8
  static args = {
@@ -11,22 +11,6 @@ export default class WorkspaceDelete extends BaseCommand {
11
11
  required: true,
12
12
  }),
13
13
  };
14
- static flags = {
15
- ...BaseCommand.baseFlags,
16
- force: Flags.boolean({
17
- char: 'f',
18
- description: 'Skip confirmation prompt',
19
- required: false,
20
- default: 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
- };
30
14
  static description = 'Delete a workspace via the Xano Metadata API. Cannot delete workspaces with active tenants.';
31
15
  static examples = [
32
16
  `$ xano workspace delete 123
@@ -43,6 +27,22 @@ Deleted workspace 123
43
27
  }
44
28
  `,
45
29
  ];
30
+ static flags = {
31
+ ...BaseCommand.baseFlags,
32
+ force: Flags.boolean({
33
+ char: 'f',
34
+ default: false,
35
+ description: 'Skip confirmation prompt',
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(WorkspaceDelete);
48
48
  // Get profile name (default or from flag/env)
@@ -76,11 +76,11 @@ Deleted workspace 123
76
76
  // Delete workspace via the API
77
77
  try {
78
78
  const response = await fetch(apiUrl, {
79
- method: 'DELETE',
80
79
  headers: {
81
80
  'accept': 'application/json',
82
81
  'Authorization': `Bearer ${profile.access_token}`,
83
82
  },
83
+ method: 'DELETE',
84
84
  });
85
85
  if (!response.ok) {
86
86
  const errorText = await response.text();
@@ -6,17 +6,17 @@ export default class WorkspaceEdit extends BaseCommand {
6
6
  min?: number;
7
7
  }>;
8
8
  };
9
+ static description: string;
10
+ static examples: string[];
9
11
  static flags: {
10
- name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
- swagger: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- 'require-token': import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
14
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
+ 'require-token': import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
+ swagger: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
17
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
18
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
19
  };
18
- static description: string;
19
- static examples: string[];
20
20
  run(): Promise<void>;
21
21
  private loadCredentials;
22
22
  }