@xano/cli 0.0.95-beta.2 → 0.0.95-beta.3

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 (64) hide show
  1. package/README.md +15 -8
  2. package/dist/base-command.d.ts +24 -0
  3. package/dist/base-command.js +37 -0
  4. package/dist/commands/{ephemeral → sandbox}/env/delete/index.d.ts +1 -4
  5. package/dist/commands/{ephemeral → sandbox}/env/delete/index.js +17 -33
  6. package/dist/commands/{ephemeral → sandbox}/env/get/index.d.ts +1 -4
  7. package/dist/commands/{ephemeral → sandbox}/env/get/index.js +13 -29
  8. package/dist/commands/{ephemeral → sandbox}/env/get_all/index.d.ts +1 -4
  9. package/dist/commands/{ephemeral → sandbox}/env/get_all/index.js +16 -32
  10. package/dist/commands/{ephemeral → sandbox}/env/list/index.d.ts +1 -4
  11. package/dist/commands/sandbox/env/list/index.js +67 -0
  12. package/dist/commands/{ephemeral → sandbox}/env/set/index.d.ts +1 -4
  13. package/dist/commands/{ephemeral → sandbox}/env/set/index.js +14 -30
  14. package/dist/commands/{ephemeral → sandbox}/env/set_all/index.d.ts +1 -4
  15. package/dist/commands/{ephemeral → sandbox}/env/set_all/index.js +16 -32
  16. package/dist/commands/{ephemeral → sandbox}/get/index.d.ts +1 -4
  17. package/dist/commands/sandbox/get/index.js +48 -0
  18. package/dist/commands/sandbox/impersonate/index.d.ts +5 -0
  19. package/dist/commands/sandbox/impersonate/index.js +5 -0
  20. package/dist/commands/{ephemeral → sandbox}/license/get/index.d.ts +1 -4
  21. package/dist/commands/{ephemeral → sandbox}/license/get/index.js +16 -32
  22. package/dist/commands/{ephemeral → sandbox}/license/set/index.d.ts +1 -4
  23. package/dist/commands/{ephemeral → sandbox}/license/set/index.js +17 -33
  24. package/dist/commands/{ephemeral → sandbox}/pull/index.d.ts +1 -2
  25. package/dist/commands/{ephemeral → sandbox}/pull/index.js +11 -26
  26. package/dist/commands/{ephemeral → sandbox}/push/index.d.ts +1 -2
  27. package/dist/commands/{ephemeral → sandbox}/push/index.js +13 -28
  28. package/dist/commands/{ephemeral/delete → sandbox/reset}/index.d.ts +1 -5
  29. package/dist/commands/sandbox/reset/index.js +71 -0
  30. package/dist/commands/{ephemeral/impersonate → sandbox/review}/index.d.ts +1 -4
  31. package/dist/commands/{ephemeral/impersonate → sandbox/review}/index.js +15 -31
  32. package/dist/commands/{ephemeral/unit_test/run_all → sandbox/unit_test/list}/index.d.ts +1 -2
  33. package/dist/commands/{ephemeral → sandbox}/unit_test/list/index.js +10 -24
  34. package/dist/commands/{ephemeral → sandbox}/unit_test/run/index.d.ts +1 -2
  35. package/dist/commands/{ephemeral → sandbox}/unit_test/run/index.js +9 -23
  36. package/dist/commands/{ephemeral/unit_test/list → sandbox/unit_test/run_all}/index.d.ts +1 -2
  37. package/dist/commands/{ephemeral → sandbox}/unit_test/run_all/index.js +9 -23
  38. package/dist/commands/{ephemeral/workflow_test/get → sandbox/workflow_test/delete}/index.d.ts +1 -2
  39. package/dist/commands/{ephemeral → sandbox}/workflow_test/delete/index.js +9 -23
  40. package/dist/commands/{ephemeral/workflow_test/run → sandbox/workflow_test/get}/index.d.ts +1 -2
  41. package/dist/commands/{ephemeral → sandbox}/workflow_test/get/index.js +8 -25
  42. package/dist/commands/{ephemeral/workflow_test/run_all → sandbox/workflow_test/list}/index.d.ts +1 -2
  43. package/dist/commands/{ephemeral → sandbox}/workflow_test/list/index.js +11 -25
  44. package/dist/commands/{ephemeral/workflow_test/delete → sandbox/workflow_test/run}/index.d.ts +1 -2
  45. package/dist/commands/{ephemeral → sandbox}/workflow_test/run/index.js +9 -23
  46. package/dist/commands/{ephemeral/workflow_test/list → sandbox/workflow_test/run_all}/index.d.ts +1 -2
  47. package/dist/commands/{ephemeral → sandbox}/workflow_test/run_all/index.js +9 -23
  48. package/dist/commands/tenant/get/index.js +2 -2
  49. package/dist/commands/tenant/list/index.js +2 -2
  50. package/dist/commands/tenant/push/index.js +0 -34
  51. package/dist/commands/workspace/push/index.js +26 -0
  52. package/oclif.manifest.json +2404 -2888
  53. package/package.json +7 -7
  54. package/dist/commands/ephemeral/access/index.d.ts +0 -15
  55. package/dist/commands/ephemeral/access/index.js +0 -78
  56. package/dist/commands/ephemeral/create/index.d.ts +0 -17
  57. package/dist/commands/ephemeral/create/index.js +0 -102
  58. package/dist/commands/ephemeral/delete/index.js +0 -99
  59. package/dist/commands/ephemeral/env/list/index.js +0 -83
  60. package/dist/commands/ephemeral/get/index.js +0 -102
  61. package/dist/commands/ephemeral/list/index.d.ts +0 -15
  62. package/dist/commands/ephemeral/list/index.js +0 -109
  63. package/dist/commands/ephemeral/shared/index.d.ts +0 -15
  64. package/dist/commands/ephemeral/shared/index.js +0 -108
@@ -1,13 +1,13 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import BaseCommand from '../../../../base-command.js';
3
- export default class EphemeralUnitTestList extends BaseCommand {
4
- static description = 'List all unit tests for an ephemeral tenant';
3
+ export default class SandboxUnitTestList extends BaseCommand {
4
+ static description = 'List all unit tests for a sandbox environment';
5
5
  static examples = [
6
- `$ xano ephemeral unit-test list -t e1a2-b3c4-x5y6
6
+ `$ xano sandbox unit-test list
7
7
  Unit tests:
8
8
  - my-test (ID: abc-123) [function: math]
9
9
  `,
10
- `$ xano ephemeral unit-test list -t e1a2-b3c4-x5y6 -o json`,
10
+ `$ xano sandbox unit-test list -o json`,
11
11
  ];
12
12
  static flags = {
13
13
  ...BaseCommand.baseFlags,
@@ -28,33 +28,19 @@ Unit tests:
28
28
  options: ['summary', 'json'],
29
29
  required: false,
30
30
  }),
31
- tenant: Flags.string({
32
- char: 't',
33
- description: 'Ephemeral tenant name',
34
- required: true,
35
- }),
36
31
  };
37
32
  async run() {
38
- const { flags } = await this.parse(EphemeralUnitTestList);
39
- const profileName = flags.profile || this.getDefaultProfile();
40
- const credentials = this.loadCredentialsFile();
41
- if (!credentials || !(profileName in credentials.profiles)) {
42
- this.error(`Profile '${profileName}' not found.\nCreate a profile using 'xano profile create'`);
43
- }
44
- const profile = credentials.profiles[profileName];
45
- if (!profile.instance_origin) {
46
- this.error(`Profile '${profileName}' is missing instance_origin`);
47
- }
48
- if (!profile.access_token) {
49
- this.error(`Profile '${profileName}' is missing access_token`);
50
- }
33
+ const { flags } = await this.parse(SandboxUnitTestList);
34
+ const { profile } = this.resolveProfile(flags);
35
+ const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
36
+ const tenantName = tenant.name;
51
37
  const params = new URLSearchParams();
52
38
  params.set('per_page', '10000');
53
39
  if (flags.branch)
54
40
  params.set('branch', flags.branch);
55
41
  if (flags['obj-type'])
56
42
  params.set('obj_type', flags['obj-type']);
57
- const apiUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/${encodeURIComponent(flags.tenant)}/unit_test?${params}`;
43
+ const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/unit_test?${params}`;
58
44
  try {
59
45
  const response = await this.verboseFetch(apiUrl, {
60
46
  headers: {
@@ -86,7 +72,7 @@ Unit tests:
86
72
  this.log('No unit tests found');
87
73
  }
88
74
  else {
89
- this.log(`Unit tests for tenant ${flags.tenant}:`);
75
+ this.log(`Unit tests for sandbox environment ${tenantName}:`);
90
76
  for (const test of tests) {
91
77
  this.log(` - ${test.name} (ID: ${test.id}) [${test.obj_type}: ${test.obj_name}]`);
92
78
  }
@@ -1,5 +1,5 @@
1
1
  import BaseCommand from '../../../../base-command.js';
2
- export default class EphemeralUnitTestRun extends BaseCommand {
2
+ export default class SandboxUnitTestRun extends BaseCommand {
3
3
  static args: {
4
4
  unit_test_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
5
  };
@@ -7,7 +7,6 @@ export default class EphemeralUnitTestRun extends BaseCommand {
7
7
  static examples: string[];
8
8
  static flags: {
9
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
- tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
11
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
12
  };
@@ -1,19 +1,19 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import BaseCommand from '../../../../base-command.js';
3
- export default class EphemeralUnitTestRun extends BaseCommand {
3
+ export default class SandboxUnitTestRun extends BaseCommand {
4
4
  static args = {
5
5
  unit_test_id: Args.string({
6
6
  description: 'ID of the unit test to run',
7
7
  required: true,
8
8
  }),
9
9
  };
10
- static description = 'Run a unit test for an ephemeral tenant';
10
+ static description = 'Run a unit test for a sandbox environment';
11
11
  static examples = [
12
- `$ xano ephemeral unit-test run abc-123 -t e1a2-b3c4-x5y6
12
+ `$ xano sandbox unit-test run abc-123
13
13
  Running unit test abc-123...
14
14
  Result: PASS
15
15
  `,
16
- `$ xano ephemeral unit-test run abc-123 -t e1a2-b3c4-x5y6 -o json`,
16
+ `$ xano sandbox unit-test run abc-123 -o json`,
17
17
  ];
18
18
  static flags = {
19
19
  ...BaseCommand.baseFlags,
@@ -24,27 +24,13 @@ Result: PASS
24
24
  options: ['summary', 'json'],
25
25
  required: false,
26
26
  }),
27
- tenant: Flags.string({
28
- char: 't',
29
- description: 'Ephemeral tenant name',
30
- required: true,
31
- }),
32
27
  };
33
28
  async run() {
34
- const { args, flags } = await this.parse(EphemeralUnitTestRun);
35
- const profileName = flags.profile || this.getDefaultProfile();
36
- const credentials = this.loadCredentialsFile();
37
- if (!credentials || !(profileName in credentials.profiles)) {
38
- this.error(`Profile '${profileName}' not found.\nCreate a profile using 'xano profile create'`);
39
- }
40
- const profile = credentials.profiles[profileName];
41
- if (!profile.instance_origin) {
42
- this.error(`Profile '${profileName}' is missing instance_origin`);
43
- }
44
- if (!profile.access_token) {
45
- this.error(`Profile '${profileName}' is missing access_token`);
46
- }
47
- const apiUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/${encodeURIComponent(flags.tenant)}/unit_test/${encodeURIComponent(args.unit_test_id)}/run`;
29
+ const { args, flags } = await this.parse(SandboxUnitTestRun);
30
+ const { profile } = this.resolveProfile(flags);
31
+ const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
32
+ const tenantName = tenant.name;
33
+ const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/unit_test/${encodeURIComponent(args.unit_test_id)}/run`;
48
34
  try {
49
35
  if (flags.output === 'summary') {
50
36
  this.log(`Running unit test ${args.unit_test_id}...`);
@@ -1,12 +1,11 @@
1
1
  import BaseCommand from '../../../../base-command.js';
2
- export default class EphemeralUnitTestList extends BaseCommand {
2
+ export default class SandboxUnitTestRunAll extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
6
  branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  'obj-type': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
8
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
- tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
9
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
10
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
11
  };
@@ -1,9 +1,9 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import BaseCommand from '../../../../base-command.js';
3
- export default class EphemeralUnitTestRunAll extends BaseCommand {
4
- static description = 'Run all unit tests for an ephemeral tenant';
3
+ export default class SandboxUnitTestRunAll extends BaseCommand {
4
+ static description = 'Run all unit tests for a sandbox environment';
5
5
  static examples = [
6
- `$ xano ephemeral unit-test run-all -t e1a2-b3c4-x5y6
6
+ `$ xano sandbox unit-test run-all
7
7
  Running 5 unit tests...
8
8
 
9
9
  PASS my-test [function: math]
@@ -12,7 +12,7 @@ FAIL data-validation [function: validate]
12
12
 
13
13
  Results: 4 passed, 1 failed
14
14
  `,
15
- `$ xano ephemeral unit-test run-all -t e1a2-b3c4-x5y6 -o json`,
15
+ `$ xano sandbox unit-test run-all -o json`,
16
16
  ];
17
17
  static flags = {
18
18
  ...BaseCommand.baseFlags,
@@ -33,27 +33,13 @@ Results: 4 passed, 1 failed
33
33
  options: ['summary', 'json'],
34
34
  required: false,
35
35
  }),
36
- tenant: Flags.string({
37
- char: 't',
38
- description: 'Ephemeral tenant name',
39
- required: true,
40
- }),
41
36
  };
42
37
  async run() {
43
- const { flags } = await this.parse(EphemeralUnitTestRunAll);
44
- const profileName = flags.profile || this.getDefaultProfile();
45
- const credentials = this.loadCredentialsFile();
46
- if (!credentials || !(profileName in credentials.profiles)) {
47
- this.error(`Profile '${profileName}' not found.\nCreate a profile using 'xano profile create'`);
48
- }
49
- const profile = credentials.profiles[profileName];
50
- if (!profile.instance_origin) {
51
- this.error(`Profile '${profileName}' is missing instance_origin`);
52
- }
53
- if (!profile.access_token) {
54
- this.error(`Profile '${profileName}' is missing access_token`);
55
- }
56
- const baseUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/${encodeURIComponent(flags.tenant)}/unit_test`;
38
+ const { flags } = await this.parse(SandboxUnitTestRunAll);
39
+ const { profile } = this.resolveProfile(flags);
40
+ const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
41
+ const tenantName = tenant.name;
42
+ const baseUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/unit_test`;
57
43
  try {
58
44
  // Step 1: List all unit tests
59
45
  const listParams = new URLSearchParams();
@@ -1,5 +1,5 @@
1
1
  import BaseCommand from '../../../../base-command.js';
2
- export default class EphemeralWorkflowTestGet extends BaseCommand {
2
+ export default class SandboxWorkflowTestDelete extends BaseCommand {
3
3
  static args: {
4
4
  workflow_test_id: import("@oclif/core/interfaces").Arg<number, {
5
5
  max?: number;
@@ -10,7 +10,6 @@ export default class EphemeralWorkflowTestGet extends BaseCommand {
10
10
  static examples: string[];
11
11
  static flags: {
12
12
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
- tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
14
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
15
  };
@@ -1,18 +1,18 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import BaseCommand from '../../../../base-command.js';
3
- export default class EphemeralWorkflowTestDelete extends BaseCommand {
3
+ export default class SandboxWorkflowTestDelete extends BaseCommand {
4
4
  static args = {
5
5
  workflow_test_id: Args.integer({
6
6
  description: 'ID of the workflow test to delete',
7
7
  required: true,
8
8
  }),
9
9
  };
10
- static description = 'Delete a workflow test for an ephemeral tenant';
10
+ static description = 'Delete a workflow test for a sandbox environment';
11
11
  static examples = [
12
- `$ xano ephemeral workflow-test delete 42 -t e1a2-b3c4-x5y6
12
+ `$ xano sandbox workflow-test delete 42
13
13
  Deleted workflow test 42
14
14
  `,
15
- `$ xano ephemeral workflow-test delete 42 -t e1a2-b3c4-x5y6 -o json`,
15
+ `$ xano sandbox workflow-test delete 42 -o json`,
16
16
  ];
17
17
  static flags = {
18
18
  ...BaseCommand.baseFlags,
@@ -23,27 +23,13 @@ Deleted workflow test 42
23
23
  options: ['summary', 'json'],
24
24
  required: false,
25
25
  }),
26
- tenant: Flags.string({
27
- char: 't',
28
- description: 'Ephemeral tenant name',
29
- required: true,
30
- }),
31
26
  };
32
27
  async run() {
33
- const { args, flags } = await this.parse(EphemeralWorkflowTestDelete);
34
- const profileName = flags.profile || this.getDefaultProfile();
35
- const credentials = this.loadCredentialsFile();
36
- if (!credentials || !(profileName in credentials.profiles)) {
37
- this.error(`Profile '${profileName}' not found.\nCreate a profile using 'xano profile create'`);
38
- }
39
- const profile = credentials.profiles[profileName];
40
- if (!profile.instance_origin) {
41
- this.error(`Profile '${profileName}' is missing instance_origin`);
42
- }
43
- if (!profile.access_token) {
44
- this.error(`Profile '${profileName}' is missing access_token`);
45
- }
46
- const apiUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/${encodeURIComponent(flags.tenant)}/workflow_test/${args.workflow_test_id}`;
28
+ const { args, flags } = await this.parse(SandboxWorkflowTestDelete);
29
+ const { profile } = this.resolveProfile(flags);
30
+ const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
31
+ const tenantName = tenant.name;
32
+ const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/workflow_test/${args.workflow_test_id}`;
47
33
  try {
48
34
  const response = await this.verboseFetch(apiUrl, {
49
35
  headers: {
@@ -1,5 +1,5 @@
1
1
  import BaseCommand from '../../../../base-command.js';
2
- export default class EphemeralWorkflowTestRun extends BaseCommand {
2
+ export default class SandboxWorkflowTestGet extends BaseCommand {
3
3
  static args: {
4
4
  workflow_test_id: import("@oclif/core/interfaces").Arg<number, {
5
5
  max?: number;
@@ -10,7 +10,6 @@ export default class EphemeralWorkflowTestRun extends BaseCommand {
10
10
  static examples: string[];
11
11
  static flags: {
12
12
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
- tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
14
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
15
  };
@@ -1,17 +1,14 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import BaseCommand from '../../../../base-command.js';
3
- export default class EphemeralWorkflowTestGet extends BaseCommand {
3
+ export default class SandboxWorkflowTestGet extends BaseCommand {
4
4
  static args = {
5
5
  workflow_test_id: Args.integer({
6
6
  description: 'ID of the workflow test',
7
7
  required: true,
8
8
  }),
9
9
  };
10
- static description = 'Get a workflow test for an ephemeral tenant';
11
- static examples = [
12
- `$ xano ephemeral workflow-test get 42 -t e1a2-b3c4-x5y6`,
13
- `$ xano ephemeral workflow-test get 42 -t e1a2-b3c4-x5y6 -o json`,
14
- ];
10
+ static description = 'Get a workflow test for a sandbox environment';
11
+ static examples = [`$ xano sandbox workflow-test get 42`, `$ xano sandbox workflow-test get 42 -o json`];
15
12
  static flags = {
16
13
  ...BaseCommand.baseFlags,
17
14
  output: Flags.string({
@@ -21,27 +18,13 @@ export default class EphemeralWorkflowTestGet extends BaseCommand {
21
18
  options: ['summary', 'json'],
22
19
  required: false,
23
20
  }),
24
- tenant: Flags.string({
25
- char: 't',
26
- description: 'Ephemeral tenant name',
27
- required: true,
28
- }),
29
21
  };
30
22
  async run() {
31
- const { args, flags } = await this.parse(EphemeralWorkflowTestGet);
32
- const profileName = flags.profile || this.getDefaultProfile();
33
- const credentials = this.loadCredentialsFile();
34
- if (!credentials || !(profileName in credentials.profiles)) {
35
- this.error(`Profile '${profileName}' not found.\nCreate a profile using 'xano profile create'`);
36
- }
37
- const profile = credentials.profiles[profileName];
38
- if (!profile.instance_origin) {
39
- this.error(`Profile '${profileName}' is missing instance_origin`);
40
- }
41
- if (!profile.access_token) {
42
- this.error(`Profile '${profileName}' is missing access_token`);
43
- }
44
- const apiUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/${encodeURIComponent(flags.tenant)}/workflow_test/${args.workflow_test_id}`;
23
+ const { args, flags } = await this.parse(SandboxWorkflowTestGet);
24
+ const { profile } = this.resolveProfile(flags);
25
+ const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
26
+ const tenantName = tenant.name;
27
+ const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/workflow_test/${args.workflow_test_id}`;
45
28
  try {
46
29
  const response = await this.verboseFetch(apiUrl, {
47
30
  headers: {
@@ -1,11 +1,10 @@
1
1
  import BaseCommand from '../../../../base-command.js';
2
- export default class EphemeralWorkflowTestRunAll extends BaseCommand {
2
+ export default class SandboxWorkflowTestList extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
6
  branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
- tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
8
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
9
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
10
  };
@@ -1,13 +1,13 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import BaseCommand from '../../../../base-command.js';
3
- export default class EphemeralWorkflowTestList extends BaseCommand {
4
- static description = 'List workflow tests for an ephemeral tenant';
3
+ export default class SandboxWorkflowTestList extends BaseCommand {
4
+ static description = 'List workflow tests for a sandbox environment';
5
5
  static examples = [
6
- `$ xano ephemeral workflow-test list -t e1a2-b3c4-x5y6
7
- Workflow tests for tenant e1a2-b3c4-x5y6:
6
+ `$ xano sandbox workflow-test list
7
+ Workflow tests:
8
8
  - my-test (ID: 1)
9
9
  `,
10
- `$ xano ephemeral workflow-test list -t e1a2-b3c4-x5y6 -o json`,
10
+ `$ xano sandbox workflow-test list -o json`,
11
11
  ];
12
12
  static flags = {
13
13
  ...BaseCommand.baseFlags,
@@ -23,31 +23,17 @@ Workflow tests for tenant e1a2-b3c4-x5y6:
23
23
  options: ['summary', 'json'],
24
24
  required: false,
25
25
  }),
26
- tenant: Flags.string({
27
- char: 't',
28
- description: 'Ephemeral tenant name',
29
- required: true,
30
- }),
31
26
  };
32
27
  async run() {
33
- const { flags } = await this.parse(EphemeralWorkflowTestList);
34
- const profileName = flags.profile || this.getDefaultProfile();
35
- const credentials = this.loadCredentialsFile();
36
- if (!credentials || !(profileName in credentials.profiles)) {
37
- this.error(`Profile '${profileName}' not found.\nCreate a profile using 'xano profile create'`);
38
- }
39
- const profile = credentials.profiles[profileName];
40
- if (!profile.instance_origin) {
41
- this.error(`Profile '${profileName}' is missing instance_origin`);
42
- }
43
- if (!profile.access_token) {
44
- this.error(`Profile '${profileName}' is missing access_token`);
45
- }
28
+ const { flags } = await this.parse(SandboxWorkflowTestList);
29
+ const { profile } = this.resolveProfile(flags);
30
+ const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
31
+ const tenantName = tenant.name;
46
32
  const params = new URLSearchParams();
47
33
  params.set('per_page', '10000');
48
34
  if (flags.branch)
49
35
  params.set('branch', flags.branch);
50
- const apiUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/${encodeURIComponent(flags.tenant)}/workflow_test?${params}`;
36
+ const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/workflow_test?${params}`;
51
37
  try {
52
38
  const response = await this.verboseFetch(apiUrl, {
53
39
  headers: {
@@ -79,7 +65,7 @@ Workflow tests for tenant e1a2-b3c4-x5y6:
79
65
  this.log('No workflow tests found');
80
66
  }
81
67
  else {
82
- this.log(`Workflow tests for tenant ${flags.tenant}:`);
68
+ this.log(`Workflow tests for sandbox environment ${tenantName}:`);
83
69
  for (const test of tests) {
84
70
  this.log(` - ${test.name} (ID: ${test.id})`);
85
71
  }
@@ -1,5 +1,5 @@
1
1
  import BaseCommand from '../../../../base-command.js';
2
- export default class EphemeralWorkflowTestDelete extends BaseCommand {
2
+ export default class SandboxWorkflowTestRun extends BaseCommand {
3
3
  static args: {
4
4
  workflow_test_id: import("@oclif/core/interfaces").Arg<number, {
5
5
  max?: number;
@@ -10,7 +10,6 @@ export default class EphemeralWorkflowTestDelete extends BaseCommand {
10
10
  static examples: string[];
11
11
  static flags: {
12
12
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
- tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
14
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
15
  };
@@ -1,19 +1,19 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import BaseCommand from '../../../../base-command.js';
3
- export default class EphemeralWorkflowTestRun extends BaseCommand {
3
+ export default class SandboxWorkflowTestRun extends BaseCommand {
4
4
  static args = {
5
5
  workflow_test_id: Args.integer({
6
6
  description: 'ID of the workflow test to run',
7
7
  required: true,
8
8
  }),
9
9
  };
10
- static description = 'Run a workflow test for an ephemeral tenant';
10
+ static description = 'Run a workflow test for a sandbox environment';
11
11
  static examples = [
12
- `$ xano ephemeral workflow-test run 42 -t e1a2-b3c4-x5y6
12
+ `$ xano sandbox workflow-test run 42
13
13
  Running workflow test 42...
14
14
  Result: PASS (0.25s)
15
15
  `,
16
- `$ xano ephemeral workflow-test run 42 -t e1a2-b3c4-x5y6 -o json`,
16
+ `$ xano sandbox workflow-test run 42 -o json`,
17
17
  ];
18
18
  static flags = {
19
19
  ...BaseCommand.baseFlags,
@@ -24,27 +24,13 @@ Result: PASS (0.25s)
24
24
  options: ['summary', 'json'],
25
25
  required: false,
26
26
  }),
27
- tenant: Flags.string({
28
- char: 't',
29
- description: 'Ephemeral tenant name',
30
- required: true,
31
- }),
32
27
  };
33
28
  async run() {
34
- const { args, flags } = await this.parse(EphemeralWorkflowTestRun);
35
- const profileName = flags.profile || this.getDefaultProfile();
36
- const credentials = this.loadCredentialsFile();
37
- if (!credentials || !(profileName in credentials.profiles)) {
38
- this.error(`Profile '${profileName}' not found.\nCreate a profile using 'xano profile create'`);
39
- }
40
- const profile = credentials.profiles[profileName];
41
- if (!profile.instance_origin) {
42
- this.error(`Profile '${profileName}' is missing instance_origin`);
43
- }
44
- if (!profile.access_token) {
45
- this.error(`Profile '${profileName}' is missing access_token`);
46
- }
47
- const apiUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/${encodeURIComponent(flags.tenant)}/workflow_test/${args.workflow_test_id}/run`;
29
+ const { args, flags } = await this.parse(SandboxWorkflowTestRun);
30
+ const { profile } = this.resolveProfile(flags);
31
+ const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
32
+ const tenantName = tenant.name;
33
+ const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/workflow_test/${args.workflow_test_id}/run`;
48
34
  try {
49
35
  if (flags.output === 'summary') {
50
36
  this.log(`Running workflow test ${args.workflow_test_id}...`);
@@ -1,11 +1,10 @@
1
1
  import BaseCommand from '../../../../base-command.js';
2
- export default class EphemeralWorkflowTestList extends BaseCommand {
2
+ export default class SandboxWorkflowTestRunAll extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
6
  branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
- tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
8
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
9
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
10
  };
@@ -1,9 +1,9 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import BaseCommand from '../../../../base-command.js';
3
- export default class EphemeralWorkflowTestRunAll extends BaseCommand {
4
- static description = 'Run all workflow tests for an ephemeral tenant';
3
+ export default class SandboxWorkflowTestRunAll extends BaseCommand {
4
+ static description = 'Run all workflow tests for a sandbox environment';
5
5
  static examples = [
6
- `$ xano ephemeral workflow-test run-all -t e1a2-b3c4-x5y6
6
+ `$ xano sandbox workflow-test run-all
7
7
  Running 3 workflow tests...
8
8
 
9
9
  PASS my-test (0.25s)
@@ -12,7 +12,7 @@ FAIL data-check (0.10s)
12
12
 
13
13
  Results: 2 passed, 1 failed
14
14
  `,
15
- `$ xano ephemeral workflow-test run-all -t e1a2-b3c4-x5y6 -o json`,
15
+ `$ xano sandbox workflow-test run-all -o json`,
16
16
  ];
17
17
  static flags = {
18
18
  ...BaseCommand.baseFlags,
@@ -28,27 +28,13 @@ Results: 2 passed, 1 failed
28
28
  options: ['summary', 'json'],
29
29
  required: false,
30
30
  }),
31
- tenant: Flags.string({
32
- char: 't',
33
- description: 'Ephemeral tenant name',
34
- required: true,
35
- }),
36
31
  };
37
32
  async run() {
38
- const { flags } = await this.parse(EphemeralWorkflowTestRunAll);
39
- const profileName = flags.profile || this.getDefaultProfile();
40
- const credentials = this.loadCredentialsFile();
41
- if (!credentials || !(profileName in credentials.profiles)) {
42
- this.error(`Profile '${profileName}' not found.\nCreate a profile using 'xano profile create'`);
43
- }
44
- const profile = credentials.profiles[profileName];
45
- if (!profile.instance_origin) {
46
- this.error(`Profile '${profileName}' is missing instance_origin`);
47
- }
48
- if (!profile.access_token) {
49
- this.error(`Profile '${profileName}' is missing access_token`);
50
- }
51
- const baseUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/${encodeURIComponent(flags.tenant)}/workflow_test`;
33
+ const { flags } = await this.parse(SandboxWorkflowTestRunAll);
34
+ const { profile } = this.resolveProfile(flags);
35
+ const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
36
+ const tenantName = tenant.name;
37
+ const baseUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/workflow_test`;
52
38
  try {
53
39
  // Step 1: List all workflow tests
54
40
  const listParams = new URLSearchParams();
@@ -99,8 +99,8 @@ Tenant: My Tenant (my-tenant)
99
99
  this.log(` Tasks: ${tenant.tasks}`);
100
100
  if (tenant.ingress !== undefined)
101
101
  this.log(` Ingress: ${tenant.ingress}`);
102
- if (tenant.ephemeral)
103
- this.log(` Ephemeral: ${tenant.ephemeral}`);
102
+ if (tenant.type)
103
+ this.log(` Type: ${tenant.type}`);
104
104
  if (tenant.deployed_at) {
105
105
  const d = new Date(tenant.deployed_at);
106
106
  const deployedDate = Number.isNaN(d.getTime()) ? tenant.deployed_at : d.toISOString().split('T')[0];
@@ -92,8 +92,8 @@ Tenants in workspace 5:
92
92
  for (const tenant of tenants) {
93
93
  const state = tenant.state ? ` [${tenant.state}]` : '';
94
94
  const license = tenant.license ? ` - ${tenant.license}` : '';
95
- const ephemeral = tenant.ephemeral ? ' [ephemeral]' : '';
96
- this.log(` - ${tenant.display || tenant.name} (${tenant.name})${state}${license}${ephemeral}`);
95
+ const typeLabel = tenant.type && tenant.type !== 'standard' ? ` [${tenant.type}]` : '';
96
+ this.log(` - ${tenant.display || tenant.name} (${tenant.name})${state}${license}${typeLabel}`);
97
97
  if (tenant.cluster?.name)
98
98
  this.log(` Cluster: ${tenant.cluster.name}`);
99
99
  const releaseName = typeof tenant.release === 'string' ? tenant.release : tenant.release?.name;