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

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 (75) hide show
  1. package/README.md +17 -9
  2. package/dist/base-command.d.ts +24 -0
  3. package/dist/base-command.js +37 -0
  4. package/dist/commands/auth/index.js +1 -1
  5. package/dist/commands/profile/me/index.js +21 -2
  6. package/dist/commands/profile/wizard/index.js +1 -1
  7. package/dist/commands/profile/workspace/set/index.js +1 -1
  8. package/dist/commands/{ephemeral → sandbox}/env/delete/index.d.ts +1 -4
  9. package/dist/commands/{ephemeral → sandbox}/env/delete/index.js +17 -33
  10. package/dist/commands/{ephemeral → sandbox}/env/get/index.d.ts +1 -4
  11. package/dist/commands/{ephemeral → sandbox}/env/get/index.js +13 -29
  12. package/dist/commands/{ephemeral → sandbox}/env/get_all/index.d.ts +1 -4
  13. package/dist/commands/{ephemeral → sandbox}/env/get_all/index.js +16 -32
  14. package/dist/commands/{ephemeral → sandbox}/env/list/index.d.ts +1 -4
  15. package/dist/commands/sandbox/env/list/index.js +67 -0
  16. package/dist/commands/{ephemeral → sandbox}/env/set/index.d.ts +1 -4
  17. package/dist/commands/{ephemeral → sandbox}/env/set/index.js +14 -30
  18. package/dist/commands/{ephemeral → sandbox}/env/set_all/index.d.ts +1 -4
  19. package/dist/commands/{ephemeral → sandbox}/env/set_all/index.js +16 -32
  20. package/dist/commands/{ephemeral → sandbox}/get/index.d.ts +1 -4
  21. package/dist/commands/sandbox/get/index.js +48 -0
  22. package/dist/commands/sandbox/impersonate/index.d.ts +5 -0
  23. package/dist/commands/sandbox/impersonate/index.js +5 -0
  24. package/dist/commands/{ephemeral → sandbox}/license/get/index.d.ts +1 -4
  25. package/dist/commands/{ephemeral → sandbox}/license/get/index.js +16 -32
  26. package/dist/commands/{ephemeral → sandbox}/license/set/index.d.ts +1 -4
  27. package/dist/commands/{ephemeral → sandbox}/license/set/index.js +17 -33
  28. package/dist/commands/{ephemeral → sandbox}/pull/index.d.ts +1 -2
  29. package/dist/commands/{ephemeral → sandbox}/pull/index.js +11 -26
  30. package/dist/commands/{ephemeral → sandbox}/push/index.d.ts +1 -2
  31. package/dist/commands/{ephemeral → sandbox}/push/index.js +13 -28
  32. package/dist/commands/{ephemeral/delete → sandbox/reset}/index.d.ts +1 -5
  33. package/dist/commands/sandbox/reset/index.js +71 -0
  34. package/dist/commands/{ephemeral/impersonate → sandbox/review}/index.d.ts +1 -4
  35. package/dist/commands/{ephemeral/impersonate → sandbox/review}/index.js +15 -31
  36. package/dist/commands/{ephemeral/unit_test/run_all → sandbox/unit_test/list}/index.d.ts +1 -2
  37. package/dist/commands/{ephemeral → sandbox}/unit_test/list/index.js +10 -24
  38. package/dist/commands/{ephemeral → sandbox}/unit_test/run/index.d.ts +1 -2
  39. package/dist/commands/{ephemeral → sandbox}/unit_test/run/index.js +9 -23
  40. package/dist/commands/{ephemeral/unit_test/list → sandbox/unit_test/run_all}/index.d.ts +1 -2
  41. package/dist/commands/{ephemeral → sandbox}/unit_test/run_all/index.js +9 -23
  42. package/dist/commands/{ephemeral/workflow_test/get → sandbox/workflow_test/delete}/index.d.ts +1 -2
  43. package/dist/commands/{ephemeral → sandbox}/workflow_test/delete/index.js +9 -23
  44. package/dist/commands/{ephemeral/workflow_test/run → sandbox/workflow_test/get}/index.d.ts +1 -2
  45. package/dist/commands/{ephemeral → sandbox}/workflow_test/get/index.js +8 -25
  46. package/dist/commands/{ephemeral/workflow_test/run_all → sandbox/workflow_test/list}/index.d.ts +1 -2
  47. package/dist/commands/{ephemeral → sandbox}/workflow_test/list/index.js +11 -25
  48. package/dist/commands/{ephemeral/workflow_test/delete → sandbox/workflow_test/run}/index.d.ts +1 -2
  49. package/dist/commands/{ephemeral → sandbox}/workflow_test/run/index.js +9 -23
  50. package/dist/commands/{ephemeral/workflow_test/list → sandbox/workflow_test/run_all}/index.d.ts +1 -2
  51. package/dist/commands/{ephemeral → sandbox}/workflow_test/run_all/index.js +9 -23
  52. package/dist/commands/tenant/create/index.d.ts +2 -1
  53. package/dist/commands/tenant/create/index.js +23 -6
  54. package/dist/commands/tenant/get/index.js +2 -2
  55. package/dist/commands/tenant/list/index.js +2 -2
  56. package/dist/commands/tenant/push/index.js +0 -34
  57. package/dist/commands/workspace/edit/index.d.ts +1 -0
  58. package/dist/commands/workspace/edit/index.js +16 -6
  59. package/dist/commands/workspace/get/index.js +9 -7
  60. package/dist/commands/workspace/list/index.d.ts +1 -0
  61. package/dist/commands/workspace/list/index.js +14 -7
  62. package/dist/commands/workspace/push/index.js +26 -0
  63. package/oclif.manifest.json +1788 -2249
  64. package/package.json +7 -7
  65. package/dist/commands/ephemeral/access/index.d.ts +0 -15
  66. package/dist/commands/ephemeral/access/index.js +0 -78
  67. package/dist/commands/ephemeral/create/index.d.ts +0 -17
  68. package/dist/commands/ephemeral/create/index.js +0 -102
  69. package/dist/commands/ephemeral/delete/index.js +0 -99
  70. package/dist/commands/ephemeral/env/list/index.js +0 -83
  71. package/dist/commands/ephemeral/get/index.js +0 -102
  72. package/dist/commands/ephemeral/list/index.d.ts +0 -15
  73. package/dist/commands/ephemeral/list/index.js +0 -109
  74. package/dist/commands/ephemeral/shared/index.d.ts +0 -15
  75. package/dist/commands/ephemeral/shared/index.js +0 -108
@@ -1,21 +1,15 @@
1
- import { Args, Flags } from '@oclif/core';
1
+ import { Flags } from '@oclif/core';
2
2
  import open from 'open';
3
3
  import BaseCommand from '../../../base-command.js';
4
- export default class EphemeralImpersonate extends BaseCommand {
5
- static args = {
6
- tenant_name: Args.string({
7
- description: 'Ephemeral tenant name to impersonate',
8
- required: true,
9
- }),
10
- };
11
- static description = 'Impersonate an ephemeral tenant and open it in the browser';
4
+ export default class SandboxReview extends BaseCommand {
5
+ static description = 'Open your sandbox environment in the browser to review and promote changes';
12
6
  static examples = [
13
- `$ xano ephemeral impersonate my-tenant
7
+ `$ xano sandbox review
14
8
  Opening browser...
15
- Impersonation successful!
9
+ Review session started!
16
10
  `,
17
- `$ xano ephemeral impersonate my-tenant -u`,
18
- `$ xano ephemeral impersonate my-tenant -o json`,
11
+ `$ xano sandbox review -u`,
12
+ `$ xano sandbox review -o json`,
19
13
  ];
20
14
  static flags = {
21
15
  ...BaseCommand.baseFlags,
@@ -34,21 +28,11 @@ Impersonation successful!
34
28
  }),
35
29
  };
36
30
  async run() {
37
- const { args, flags } = await this.parse(EphemeralImpersonate);
38
- const profileName = flags.profile || this.getDefaultProfile();
39
- const credentials = this.loadCredentialsFile();
40
- if (!credentials || !(profileName in credentials.profiles)) {
41
- this.error(`Profile '${profileName}' not found.\n` + `Create a profile using 'xano auth'`);
42
- }
43
- const profile = credentials.profiles[profileName];
44
- if (!profile.instance_origin) {
45
- this.error(`Profile '${profileName}' is missing instance_origin`);
46
- }
47
- if (!profile.access_token) {
48
- this.error(`Profile '${profileName}' is missing access_token`);
49
- }
50
- const tenantName = args.tenant_name;
51
- const apiUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/${encodeURIComponent(tenantName)}/impersonate`;
31
+ const { flags } = await this.parse(SandboxReview);
32
+ const { profile } = this.resolveProfile(flags);
33
+ const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
34
+ const tenantName = tenant.name;
35
+ const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/impersonate`;
52
36
  try {
53
37
  const response = await this.verboseFetch(apiUrl, {
54
38
  headers: {
@@ -80,17 +64,17 @@ Impersonation successful!
80
64
  else {
81
65
  this.log('Opening browser...');
82
66
  await open(impersonateUrl);
83
- this.log('Impersonation successful!');
67
+ this.log('Review session started!');
84
68
  }
85
69
  }
86
70
  process.exit(0);
87
71
  }
88
72
  catch (error) {
89
73
  if (error instanceof Error) {
90
- this.error(`Failed to impersonate ephemeral tenant: ${error.message}`);
74
+ this.error(`Failed to open sandbox review: ${error.message}`);
91
75
  }
92
76
  else {
93
- this.error(`Failed to impersonate ephemeral tenant: ${String(error)}`);
77
+ this.error(`Failed to open sandbox review: ${String(error)}`);
94
78
  }
95
79
  }
96
80
  }
@@ -1,12 +1,11 @@
1
1
  import BaseCommand from '../../../../base-command.js';
2
- export default class EphemeralUnitTestRunAll extends BaseCommand {
2
+ export default class SandboxUnitTestList 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,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
  };