@xano/cli 0.0.26 → 0.0.27

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 (110) hide show
  1. package/dist/base-command.d.ts +3 -1
  2. package/dist/base-command.js +12 -5
  3. package/dist/commands/auth/index.d.ts +21 -0
  4. package/dist/commands/auth/index.js +533 -0
  5. package/dist/commands/branch/create/index.d.ts +17 -0
  6. package/dist/commands/branch/create/index.js +164 -0
  7. package/dist/commands/branch/delete/index.d.ts +18 -0
  8. package/dist/commands/branch/delete/index.js +156 -0
  9. package/dist/commands/branch/edit/index.d.ts +19 -0
  10. package/dist/commands/branch/edit/index.js +166 -0
  11. package/dist/commands/branch/get/index.d.ts +16 -0
  12. package/dist/commands/branch/get/index.js +135 -0
  13. package/dist/commands/branch/list/index.d.ts +18 -0
  14. package/dist/commands/branch/list/index.js +138 -0
  15. package/dist/commands/branch/set-live/index.d.ts +18 -0
  16. package/dist/commands/branch/set-live/index.js +155 -0
  17. package/dist/commands/function/create/index.d.ts +7 -6
  18. package/dist/commands/function/create/index.js +55 -55
  19. package/dist/commands/function/edit/index.d.ts +11 -10
  20. package/dist/commands/function/edit/index.js +155 -162
  21. package/dist/commands/function/get/index.d.ts +6 -5
  22. package/dist/commands/function/get/index.js +55 -60
  23. package/dist/commands/function/list/index.d.ts +6 -5
  24. package/dist/commands/function/list/index.js +52 -52
  25. package/dist/commands/profile/create/index.d.ts +6 -6
  26. package/dist/commands/profile/create/index.js +37 -37
  27. package/dist/commands/profile/delete/index.d.ts +2 -2
  28. package/dist/commands/profile/delete/index.js +9 -9
  29. package/dist/commands/profile/edit/index.d.ts +8 -7
  30. package/dist/commands/profile/edit/index.js +48 -48
  31. package/dist/commands/profile/get-default/index.js +1 -1
  32. package/dist/commands/profile/list/index.d.ts +2 -2
  33. package/dist/commands/profile/list/index.js +9 -9
  34. package/dist/commands/profile/me/index.d.ts +4 -3
  35. package/dist/commands/profile/me/index.js +21 -21
  36. package/dist/commands/profile/project/index.js +1 -1
  37. package/dist/commands/profile/set-default/index.js +1 -1
  38. package/dist/commands/profile/token/index.js +1 -1
  39. package/dist/commands/profile/wizard/index.d.ts +5 -4
  40. package/dist/commands/profile/wizard/index.js +142 -108
  41. package/dist/commands/run/env/delete/index.d.ts +3 -2
  42. package/dist/commands/run/env/delete/index.js +10 -10
  43. package/dist/commands/run/env/get/index.d.ts +3 -2
  44. package/dist/commands/run/env/get/index.js +11 -11
  45. package/dist/commands/run/env/list/index.d.ts +3 -2
  46. package/dist/commands/run/env/list/index.js +17 -19
  47. package/dist/commands/run/env/set/index.d.ts +3 -2
  48. package/dist/commands/run/env/set/index.js +5 -5
  49. package/dist/commands/run/exec/index.d.ts +19 -8
  50. package/dist/commands/run/exec/index.js +186 -108
  51. package/dist/commands/run/info/index.d.ts +5 -4
  52. package/dist/commands/run/info/index.js +27 -27
  53. package/dist/commands/run/projects/create/index.d.ts +4 -3
  54. package/dist/commands/run/projects/create/index.js +23 -23
  55. package/dist/commands/run/projects/delete/index.d.ts +3 -2
  56. package/dist/commands/run/projects/delete/index.js +10 -10
  57. package/dist/commands/run/projects/list/index.d.ts +3 -2
  58. package/dist/commands/run/projects/list/index.js +12 -12
  59. package/dist/commands/run/projects/update/index.d.ts +4 -3
  60. package/dist/commands/run/projects/update/index.js +21 -21
  61. package/dist/commands/run/secrets/delete/index.d.ts +3 -2
  62. package/dist/commands/run/secrets/delete/index.js +10 -10
  63. package/dist/commands/run/secrets/get/index.d.ts +3 -2
  64. package/dist/commands/run/secrets/get/index.js +11 -11
  65. package/dist/commands/run/secrets/list/index.d.ts +3 -2
  66. package/dist/commands/run/secrets/list/index.js +22 -24
  67. package/dist/commands/run/secrets/set/index.d.ts +4 -3
  68. package/dist/commands/run/secrets/set/index.js +16 -16
  69. package/dist/commands/run/sessions/delete/index.d.ts +3 -2
  70. package/dist/commands/run/sessions/delete/index.js +10 -10
  71. package/dist/commands/run/sessions/get/index.d.ts +3 -2
  72. package/dist/commands/run/sessions/get/index.js +11 -11
  73. package/dist/commands/run/sessions/list/index.d.ts +3 -2
  74. package/dist/commands/run/sessions/list/index.js +11 -11
  75. package/dist/commands/run/sessions/start/index.d.ts +3 -2
  76. package/dist/commands/run/sessions/start/index.js +11 -11
  77. package/dist/commands/run/sessions/stop/index.d.ts +3 -2
  78. package/dist/commands/run/sessions/stop/index.js +11 -11
  79. package/dist/commands/run/sink/get/index.d.ts +3 -2
  80. package/dist/commands/run/sink/get/index.js +11 -11
  81. package/dist/commands/static_host/build/create/index.d.ts +5 -4
  82. package/dist/commands/static_host/build/create/index.js +33 -33
  83. package/dist/commands/static_host/build/get/index.d.ts +5 -4
  84. package/dist/commands/static_host/build/get/index.js +20 -20
  85. package/dist/commands/static_host/build/list/index.d.ts +4 -3
  86. package/dist/commands/static_host/build/list/index.js +31 -31
  87. package/dist/commands/static_host/list/index.d.ts +4 -3
  88. package/dist/commands/static_host/list/index.js +31 -31
  89. package/dist/commands/workspace/create/index.d.ts +14 -0
  90. package/dist/commands/workspace/create/index.js +131 -0
  91. package/dist/commands/workspace/delete/index.d.ts +20 -0
  92. package/dist/commands/workspace/delete/index.js +141 -0
  93. package/dist/commands/workspace/edit/index.d.ts +22 -0
  94. package/dist/commands/workspace/edit/index.js +176 -0
  95. package/dist/commands/workspace/get/index.d.ts +18 -0
  96. package/dist/commands/workspace/get/index.js +136 -0
  97. package/dist/commands/workspace/list/index.d.ts +3 -2
  98. package/dist/commands/workspace/list/index.js +15 -15
  99. package/dist/commands/workspace/pull/index.d.ts +5 -4
  100. package/dist/commands/workspace/pull/index.js +113 -64
  101. package/dist/commands/workspace/push/index.d.ts +1 -0
  102. package/dist/commands/workspace/push/index.js +5 -5
  103. package/dist/help.d.ts +1 -1
  104. package/dist/lib/base-run-command.d.ts +6 -6
  105. package/dist/lib/base-run-command.js +8 -6
  106. package/dist/lib/run-http-client.d.ts +24 -18
  107. package/dist/lib/run-http-client.js +96 -61
  108. package/dist/lib/run-types.d.ts +80 -80
  109. package/oclif.manifest.json +1963 -785
  110. package/package.json +1 -1
@@ -7,15 +7,6 @@ export default class RunSessionsDelete 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
- };
19
10
  static description = 'Delete a session';
20
11
  static examples = [
21
12
  `$ xano run sessions delete abc123-def456
@@ -26,10 +17,19 @@ Session deleted successfully!
26
17
  Session deleted successfully!
27
18
  `,
28
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
29
  async run() {
30
30
  const { args, flags } = await this.parse(RunSessionsDelete);
31
31
  // Initialize with project required
32
- await this.initRunCommandWithProject(flags.profile);
32
+ await this.initRunCommandWithProject(flags.profile, flags.verbose);
33
33
  // Confirm deletion unless --force is used
34
34
  if (!flags.force) {
35
35
  const readline = await import('node:readline');
@@ -3,11 +3,12 @@ export default class RunSessionsGet 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[];
6
8
  static flags: {
7
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
12
  };
10
- static description: string;
11
- static examples: string[];
12
13
  run(): Promise<void>;
13
14
  }
@@ -7,16 +7,6 @@ export default class RunSessionsGet 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: 'summary',
17
- options: ['summary', 'json'],
18
- }),
19
- };
20
10
  static description = 'Get session details';
21
11
  static examples = [
22
12
  `$ xano run sessions get abc123-def456
@@ -32,10 +22,20 @@ Session Details:
32
22
  { "id": "abc123-def456", "name": "My Session", "status": "running", ... }
33
23
  `,
34
24
  ];
25
+ static flags = {
26
+ ...BaseRunCommand.baseFlags,
27
+ output: Flags.string({
28
+ char: 'o',
29
+ default: 'summary',
30
+ description: 'Output format',
31
+ options: ['summary', 'json'],
32
+ required: false,
33
+ }),
34
+ };
35
35
  async run() {
36
36
  const { args, flags } = await this.parse(RunSessionsGet);
37
37
  // Initialize (no project required for session details)
38
- await this.initRunCommand(flags.profile);
38
+ await this.initRunCommand(flags.profile, flags.verbose);
39
39
  try {
40
40
  const url = this.httpClient.buildSessionUrl(args.sessionId);
41
41
  const session = await this.httpClient.get(url);
@@ -1,12 +1,13 @@
1
1
  import BaseRunCommand from '../../../../lib/base-run-command.js';
2
2
  export default class RunSessionsList extends BaseRunCommand {
3
3
  static args: {};
4
+ static description: string;
5
+ static examples: string[];
4
6
  static flags: {
5
7
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
8
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
10
  };
8
- static description: string;
9
- static examples: string[];
10
11
  run(): Promise<void>;
11
12
  private outputTable;
12
13
  }
@@ -2,16 +2,6 @@ import { Flags } from '@oclif/core';
2
2
  import BaseRunCommand from '../../../../lib/base-run-command.js';
3
3
  export default class RunSessionsList 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
- };
15
5
  static description = 'List all sessions for the project';
16
6
  static examples = [
17
7
  `$ xano run sessions list
@@ -23,10 +13,20 @@ xyz789-uvw456-rst123 stopped 2024-01-14T09:00:00Z
23
13
  { "items": [{ "id": "abc123-def456-ghi789", "state": "running", ... }] }
24
14
  `,
25
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
26
  async run() {
27
27
  const { flags } = await this.parse(RunSessionsList);
28
28
  // Initialize with project required
29
- await this.initRunCommandWithProject(flags.profile);
29
+ await this.initRunCommandWithProject(flags.profile, flags.verbose);
30
30
  try {
31
31
  const url = this.httpClient.buildProjectUrl('/run/session');
32
32
  const result = await this.httpClient.get(url);
@@ -3,11 +3,12 @@ export default class RunSessionsStart 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[];
6
8
  static flags: {
7
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
12
  };
10
- static description: string;
11
- static examples: string[];
12
13
  run(): Promise<void>;
13
14
  }
@@ -7,16 +7,6 @@ export default class RunSessionsStart 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: 'summary',
17
- options: ['summary', 'json'],
18
- }),
19
- };
20
10
  static description = 'Start a session';
21
11
  static examples = [
22
12
  `$ xano run sessions start abc123-def456
@@ -28,10 +18,20 @@ Session started successfully!
28
18
  { "id": "abc123-def456", "state": "running", ... }
29
19
  `,
30
20
  ];
21
+ static flags = {
22
+ ...BaseRunCommand.baseFlags,
23
+ output: Flags.string({
24
+ char: 'o',
25
+ default: 'summary',
26
+ description: 'Output format',
27
+ options: ['summary', 'json'],
28
+ required: false,
29
+ }),
30
+ };
31
31
  async run() {
32
32
  const { args, flags } = await this.parse(RunSessionsStart);
33
33
  // Initialize with project required
34
- await this.initRunCommandWithProject(flags.profile);
34
+ await this.initRunCommandWithProject(flags.profile, flags.verbose);
35
35
  try {
36
36
  const url = this.httpClient.buildProjectUrl(`/run/session/${args.sessionId}/start`);
37
37
  const session = await this.httpClient.post(url, {});
@@ -3,11 +3,12 @@ export default class RunSessionsStop 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[];
6
8
  static flags: {
7
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
12
  };
10
- static description: string;
11
- static examples: string[];
12
13
  run(): Promise<void>;
13
14
  }
@@ -7,16 +7,6 @@ export default class RunSessionsStop 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: 'summary',
17
- options: ['summary', 'json'],
18
- }),
19
- };
20
10
  static description = 'Stop a session';
21
11
  static examples = [
22
12
  `$ xano run sessions stop abc123-def456
@@ -28,10 +18,20 @@ Session stopped successfully!
28
18
  { "id": "abc123-def456", "state": "stopped", ... }
29
19
  `,
30
20
  ];
21
+ static flags = {
22
+ ...BaseRunCommand.baseFlags,
23
+ output: Flags.string({
24
+ char: 'o',
25
+ default: 'summary',
26
+ description: 'Output format',
27
+ options: ['summary', 'json'],
28
+ required: false,
29
+ }),
30
+ };
31
31
  async run() {
32
32
  const { args, flags } = await this.parse(RunSessionsStop);
33
33
  // Initialize with project required
34
- await this.initRunCommandWithProject(flags.profile);
34
+ await this.initRunCommandWithProject(flags.profile, flags.verbose);
35
35
  try {
36
36
  const url = this.httpClient.buildProjectUrl(`/run/session/${args.sessionId}/stop`);
37
37
  const session = await this.httpClient.post(url, {});
@@ -3,11 +3,12 @@ export default class RunSinkGet 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[];
6
8
  static flags: {
7
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
12
  };
10
- static description: string;
11
- static examples: string[];
12
13
  run(): Promise<void>;
13
14
  }
@@ -7,16 +7,6 @@ export default class RunSinkGet 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: 'summary',
17
- options: ['summary', 'json'],
18
- }),
19
- };
20
10
  static description = 'Get sink data for a completed session';
21
11
  static examples = [
22
12
  `$ xano run sink get abc123-def456
@@ -31,10 +21,20 @@ Sink Data:
31
21
  { "tables": [...], "logs": [...] }
32
22
  `,
33
23
  ];
24
+ static flags = {
25
+ ...BaseRunCommand.baseFlags,
26
+ output: Flags.string({
27
+ char: 'o',
28
+ default: 'summary',
29
+ description: 'Output format',
30
+ options: ['summary', 'json'],
31
+ required: false,
32
+ }),
33
+ };
34
34
  async run() {
35
35
  const { args, flags } = await this.parse(RunSinkGet);
36
36
  // Initialize (no project required for sink data)
37
- await this.initRunCommand(flags.profile);
37
+ await this.initRunCommand(flags.profile, flags.verbose);
38
38
  try {
39
39
  const url = this.httpClient.buildSessionUrl(args.sessionId, '/sink');
40
40
  const sinkData = await this.httpClient.get(url);
@@ -3,16 +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>;
15
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
16
  };
14
- static description: string;
15
- static examples: string[];
16
17
  run(): Promise<void>;
17
18
  private loadCredentials;
18
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,16 +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>;
13
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
14
  };
12
- static description: string;
13
- static examples: string[];
14
15
  run(): Promise<void>;
15
16
  private loadCredentials;
16
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,15 +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>;
14
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
15
  };
13
- static description: string;
14
- static examples: string[];
15
16
  run(): Promise<void>;
16
17
  private loadCredentials;
17
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
  }