@xano/cli 0.0.95-beta.5 → 0.0.95-beta.6
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.
- package/dist/base-command.d.ts +1 -0
- package/dist/commands/sandbox/env/delete/index.js +4 -6
- package/dist/commands/sandbox/env/get/index.js +2 -4
- package/dist/commands/sandbox/env/get_all/index.js +2 -4
- package/dist/commands/sandbox/env/list/index.js +3 -5
- package/dist/commands/sandbox/env/set/index.js +2 -4
- package/dist/commands/sandbox/env/set_all/index.js +3 -5
- package/dist/commands/sandbox/get/index.js +13 -0
- package/dist/commands/sandbox/license/get/index.js +2 -4
- package/dist/commands/sandbox/license/set/index.js +3 -5
- package/dist/commands/sandbox/pull/index.js +3 -5
- package/dist/commands/sandbox/push/index.js +3 -5
- package/dist/commands/sandbox/reset/index.js +2 -4
- package/dist/commands/sandbox/review/index.js +1 -3
- package/dist/commands/sandbox/unit_test/list/index.js +2 -4
- package/dist/commands/sandbox/unit_test/run/index.js +1 -3
- package/dist/commands/sandbox/unit_test/run_all/index.js +1 -3
- package/dist/commands/sandbox/workflow_test/delete/index.js +1 -3
- package/dist/commands/sandbox/workflow_test/get/index.js +1 -3
- package/dist/commands/sandbox/workflow_test/list/index.js +2 -4
- package/dist/commands/sandbox/workflow_test/run/index.js +1 -3
- package/dist/commands/sandbox/workflow_test/run_all/index.js +1 -3
- package/oclif.manifest.json +2565 -2565
- package/package.json +1 -1
package/dist/base-command.d.ts
CHANGED
|
@@ -34,17 +34,15 @@ Environment variable 'DATABASE_URL' deleted
|
|
|
34
34
|
async run() {
|
|
35
35
|
const { flags } = await this.parse(SandboxEnvDelete);
|
|
36
36
|
const { profile } = this.resolveProfile(flags);
|
|
37
|
-
const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
|
|
38
|
-
const tenantName = tenant.name;
|
|
39
37
|
const envName = flags.name;
|
|
40
38
|
if (!flags.force) {
|
|
41
|
-
const confirmed = await this.confirm(`Are you sure you want to delete environment variable '${envName}' from sandbox environment
|
|
39
|
+
const confirmed = await this.confirm(`Are you sure you want to delete environment variable '${envName}' from sandbox environment?`);
|
|
42
40
|
if (!confirmed) {
|
|
43
41
|
this.log('Deletion cancelled.');
|
|
44
42
|
return;
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
45
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/env/${envName}`;
|
|
48
46
|
try {
|
|
49
47
|
const response = await this.verboseFetch(apiUrl, {
|
|
50
48
|
headers: {
|
|
@@ -58,10 +56,10 @@ Environment variable 'DATABASE_URL' deleted
|
|
|
58
56
|
this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
|
|
59
57
|
}
|
|
60
58
|
if (flags.output === 'json') {
|
|
61
|
-
this.log(JSON.stringify({ deleted: true, env_name: envName
|
|
59
|
+
this.log(JSON.stringify({ deleted: true, env_name: envName }, null, 2));
|
|
62
60
|
}
|
|
63
61
|
else {
|
|
64
|
-
this.log(`Environment variable '${envName}' deleted from sandbox environment
|
|
62
|
+
this.log(`Environment variable '${envName}' deleted from sandbox environment`);
|
|
65
63
|
}
|
|
66
64
|
}
|
|
67
65
|
catch (error) {
|
|
@@ -26,10 +26,8 @@ postgres://localhost:5432/mydb
|
|
|
26
26
|
async run() {
|
|
27
27
|
const { flags } = await this.parse(SandboxEnvGet);
|
|
28
28
|
const { profile } = this.resolveProfile(flags);
|
|
29
|
-
const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
|
|
30
|
-
const tenantName = tenant.name;
|
|
31
29
|
const envName = flags.name;
|
|
32
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
30
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/env/${envName}`;
|
|
33
31
|
try {
|
|
34
32
|
const response = await this.verboseFetch(apiUrl, {
|
|
35
33
|
headers: {
|
|
@@ -50,7 +48,7 @@ postgres://localhost:5432/mydb
|
|
|
50
48
|
this.log(envVar.value);
|
|
51
49
|
}
|
|
52
50
|
else {
|
|
53
|
-
this.log(`Environment variable '${envName}' not found for sandbox environment
|
|
51
|
+
this.log(`Environment variable '${envName}' not found for sandbox environment`);
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
catch (error) {
|
|
@@ -36,9 +36,7 @@ Environment variables saved to env_<tenant>.yaml
|
|
|
36
36
|
async run() {
|
|
37
37
|
const { flags } = await this.parse(SandboxEnvGetAll);
|
|
38
38
|
const { profile } = this.resolveProfile(flags);
|
|
39
|
-
const
|
|
40
|
-
const tenantName = tenant.name;
|
|
41
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${tenantName}/env_all`;
|
|
39
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/env_all`;
|
|
42
40
|
try {
|
|
43
41
|
const response = await this.verboseFetch(apiUrl, {
|
|
44
42
|
headers: {
|
|
@@ -60,7 +58,7 @@ Environment variables saved to env_<tenant>.yaml
|
|
|
60
58
|
this.log(envYaml.trimEnd());
|
|
61
59
|
}
|
|
62
60
|
else {
|
|
63
|
-
const filePath = path.resolve(flags.file || `
|
|
61
|
+
const filePath = path.resolve(flags.file || `env.yaml`);
|
|
64
62
|
const envYaml = yaml.dump(envMap, { lineWidth: -1, sortKeys: true });
|
|
65
63
|
fs.writeFileSync(filePath, envYaml, 'utf8');
|
|
66
64
|
this.log(`Environment variables saved to ${filePath}`);
|
|
@@ -23,9 +23,7 @@ Environment variables for sandbox environment:
|
|
|
23
23
|
async run() {
|
|
24
24
|
const { flags } = await this.parse(SandboxEnvList);
|
|
25
25
|
const { profile } = this.resolveProfile(flags);
|
|
26
|
-
const
|
|
27
|
-
const tenantName = tenant.name;
|
|
28
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${tenantName}/env_key`;
|
|
26
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/env_key`;
|
|
29
27
|
try {
|
|
30
28
|
const response = await this.verboseFetch(apiUrl, {
|
|
31
29
|
headers: {
|
|
@@ -45,10 +43,10 @@ Environment variables for sandbox environment:
|
|
|
45
43
|
else {
|
|
46
44
|
const envVars = data.env || [];
|
|
47
45
|
if (envVars.length === 0) {
|
|
48
|
-
this.log(`No environment variables found for sandbox environment
|
|
46
|
+
this.log(`No environment variables found for sandbox environment`);
|
|
49
47
|
}
|
|
50
48
|
else {
|
|
51
|
-
this.log(`Environment variables for sandbox environment
|
|
49
|
+
this.log(`Environment variables for sandbox environment:`);
|
|
52
50
|
for (const envVar of envVars) {
|
|
53
51
|
this.log(` - ${envVar.name}`);
|
|
54
52
|
}
|
|
@@ -30,10 +30,8 @@ Environment variable 'DATABASE_URL' set
|
|
|
30
30
|
async run() {
|
|
31
31
|
const { flags } = await this.parse(SandboxEnvSet);
|
|
32
32
|
const { profile } = this.resolveProfile(flags);
|
|
33
|
-
const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
|
|
34
|
-
const tenantName = tenant.name;
|
|
35
33
|
const envName = flags.name;
|
|
36
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
34
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/env/${envName}`;
|
|
37
35
|
const body = {
|
|
38
36
|
env: {
|
|
39
37
|
name: envName,
|
|
@@ -59,7 +57,7 @@ Environment variable 'DATABASE_URL' set
|
|
|
59
57
|
this.log(JSON.stringify(result, null, 2));
|
|
60
58
|
}
|
|
61
59
|
else {
|
|
62
|
-
this.log(`Environment variable '${envName}' set for sandbox environment
|
|
60
|
+
this.log(`Environment variable '${envName}' set for sandbox environment`);
|
|
63
61
|
}
|
|
64
62
|
}
|
|
65
63
|
catch (error) {
|
|
@@ -35,9 +35,7 @@ Reads from env_<tenant>.yaml
|
|
|
35
35
|
async run() {
|
|
36
36
|
const { flags } = await this.parse(SandboxEnvSetAll);
|
|
37
37
|
const { profile } = this.resolveProfile(flags);
|
|
38
|
-
const
|
|
39
|
-
const tenantName = tenant.name;
|
|
40
|
-
const sourceFilePath = path.resolve(flags.file || `env_${tenantName}.yaml`);
|
|
38
|
+
const sourceFilePath = path.resolve(flags.file || `env.yaml`);
|
|
41
39
|
if (!fs.existsSync(sourceFilePath)) {
|
|
42
40
|
this.error(`File not found: ${sourceFilePath}`);
|
|
43
41
|
}
|
|
@@ -47,7 +45,7 @@ Reads from env_<tenant>.yaml
|
|
|
47
45
|
this.error('Invalid env file format. Expected a YAML map of key: value pairs.');
|
|
48
46
|
}
|
|
49
47
|
const envs = Object.entries(envMap).map(([name, value]) => ({ name, value: String(value) }));
|
|
50
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
48
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/env_all`;
|
|
51
49
|
try {
|
|
52
50
|
const response = await this.verboseFetch(apiUrl, {
|
|
53
51
|
body: JSON.stringify({ envs }),
|
|
@@ -67,7 +65,7 @@ Reads from env_<tenant>.yaml
|
|
|
67
65
|
this.log(JSON.stringify(result, null, 2));
|
|
68
66
|
}
|
|
69
67
|
else {
|
|
70
|
-
this.log(`All environment variables updated for sandbox environment
|
|
68
|
+
this.log(`All environment variables updated for sandbox environment (${envs.length} variables)`);
|
|
71
69
|
}
|
|
72
70
|
if (flags.clean && fs.existsSync(sourceFilePath)) {
|
|
73
71
|
fs.unlinkSync(sourceFilePath);
|
|
@@ -34,6 +34,19 @@ Sandbox Environment: (tc24-abcd-x1y2)
|
|
|
34
34
|
this.log(` State: ${tenant.state}`);
|
|
35
35
|
if (tenant.xano_domain)
|
|
36
36
|
this.log(` Domain: ${tenant.xano_domain}`);
|
|
37
|
+
if (tenant.sandbox_expires_at) {
|
|
38
|
+
const expiresAt = new Date(tenant.sandbox_expires_at);
|
|
39
|
+
if (!isNaN(expiresAt.getTime())) {
|
|
40
|
+
const msLeft = expiresAt.getTime() - Date.now();
|
|
41
|
+
if (msLeft > 0) {
|
|
42
|
+
const minsLeft = Math.ceil(msLeft / 60_000);
|
|
43
|
+
this.log(` Session expires: ${expiresAt.toLocaleString()} (${minsLeft} min remaining)`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.log(` Session expires: ${expiresAt.toLocaleString()} (expired)`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
37
50
|
}
|
|
38
51
|
}
|
|
39
52
|
catch (error) {
|
|
@@ -35,9 +35,7 @@ License saved to license_<tenant>.yaml
|
|
|
35
35
|
async run() {
|
|
36
36
|
const { flags } = await this.parse(SandboxLicenseGet);
|
|
37
37
|
const { profile } = this.resolveProfile(flags);
|
|
38
|
-
const
|
|
39
|
-
const tenantName = tenant.name;
|
|
40
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${tenantName}/license`;
|
|
38
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/license`;
|
|
41
39
|
try {
|
|
42
40
|
const response = await this.verboseFetch(apiUrl, {
|
|
43
41
|
headers: {
|
|
@@ -61,7 +59,7 @@ License saved to license_<tenant>.yaml
|
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
61
|
else {
|
|
64
|
-
const filePath = path.resolve(flags.file || `
|
|
62
|
+
const filePath = path.resolve(flags.file || `license.yaml`);
|
|
65
63
|
fs.writeFileSync(filePath, licenseContent, 'utf8');
|
|
66
64
|
this.log(`License saved to ${filePath}`);
|
|
67
65
|
}
|
|
@@ -42,21 +42,19 @@ Reads from license_<tenant>.yaml
|
|
|
42
42
|
async run() {
|
|
43
43
|
const { flags } = await this.parse(SandboxLicenseSet);
|
|
44
44
|
const { profile } = this.resolveProfile(flags);
|
|
45
|
-
const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
|
|
46
|
-
const tenantName = tenant.name;
|
|
47
45
|
let licenseValue;
|
|
48
46
|
let sourceFilePath;
|
|
49
47
|
if (flags.value) {
|
|
50
48
|
licenseValue = flags.value;
|
|
51
49
|
}
|
|
52
50
|
else {
|
|
53
|
-
sourceFilePath = path.resolve(flags.file || `
|
|
51
|
+
sourceFilePath = path.resolve(flags.file || `license.yaml`);
|
|
54
52
|
if (!fs.existsSync(sourceFilePath)) {
|
|
55
53
|
this.error(`File not found: ${sourceFilePath}`);
|
|
56
54
|
}
|
|
57
55
|
licenseValue = fs.readFileSync(sourceFilePath, 'utf8');
|
|
58
56
|
}
|
|
59
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
57
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/license`;
|
|
60
58
|
try {
|
|
61
59
|
const response = await this.verboseFetch(apiUrl, {
|
|
62
60
|
body: JSON.stringify({ value: licenseValue }),
|
|
@@ -76,7 +74,7 @@ Reads from license_<tenant>.yaml
|
|
|
76
74
|
this.log(JSON.stringify(result, null, 2));
|
|
77
75
|
}
|
|
78
76
|
else {
|
|
79
|
-
this.log(`Sandbox environment license updated successfully
|
|
77
|
+
this.log(`Sandbox environment license updated successfully`);
|
|
80
78
|
}
|
|
81
79
|
if (flags.clean && sourceFilePath && fs.existsSync(sourceFilePath)) {
|
|
82
80
|
fs.unlinkSync(sourceFilePath);
|
|
@@ -14,7 +14,7 @@ export default class SandboxPull extends BaseCommand {
|
|
|
14
14
|
static description = 'Pull documents from your sandbox environment and split into individual files';
|
|
15
15
|
static examples = [
|
|
16
16
|
`$ xano sandbox pull ./my-sandbox
|
|
17
|
-
Pulled 42 documents from sandbox environment
|
|
17
|
+
Pulled 42 documents from sandbox environment to ./my-sandbox
|
|
18
18
|
`,
|
|
19
19
|
`$ xano sandbox pull ./backup --env --records`,
|
|
20
20
|
];
|
|
@@ -39,14 +39,12 @@ Pulled 42 documents from sandbox environment tc24-abcd-x1y2 to ./my-sandbox
|
|
|
39
39
|
async run() {
|
|
40
40
|
const { args, flags } = await this.parse(SandboxPull);
|
|
41
41
|
const { profile } = this.resolveProfile(flags);
|
|
42
|
-
const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
|
|
43
|
-
const tenantName = tenant.name;
|
|
44
42
|
const queryParams = new URLSearchParams({
|
|
45
43
|
env: flags.env.toString(),
|
|
46
44
|
include_draft: flags.draft.toString(),
|
|
47
45
|
records: flags.records.toString(),
|
|
48
46
|
});
|
|
49
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
47
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/multidoc?${queryParams.toString()}`;
|
|
50
48
|
let responseText;
|
|
51
49
|
try {
|
|
52
50
|
const response = await this.verboseFetch(apiUrl, {
|
|
@@ -174,7 +172,7 @@ Pulled 42 documents from sandbox environment tc24-abcd-x1y2 to ./my-sandbox
|
|
|
174
172
|
fs.writeFileSync(filePath, doc.content, 'utf8');
|
|
175
173
|
writtenCount++;
|
|
176
174
|
}
|
|
177
|
-
this.log(`Pulled ${writtenCount} documents from sandbox environment
|
|
175
|
+
this.log(`Pulled ${writtenCount} documents from sandbox environment to ${args.directory}`);
|
|
178
176
|
}
|
|
179
177
|
sanitizeFilename(name) {
|
|
180
178
|
return snakeCase(name.replaceAll('"', ''));
|
|
@@ -13,7 +13,7 @@ export default class SandboxPush extends BaseCommand {
|
|
|
13
13
|
static description = 'Push local documents to your sandbox environment via multidoc import';
|
|
14
14
|
static examples = [
|
|
15
15
|
`$ xano sandbox push ./my-workspace
|
|
16
|
-
Pushed 42 documents to sandbox environment
|
|
16
|
+
Pushed 42 documents to sandbox environment from ./my-workspace
|
|
17
17
|
`,
|
|
18
18
|
`$ xano sandbox push ./backup --records --env`,
|
|
19
19
|
`$ xano sandbox push ./my-workspace --truncate`,
|
|
@@ -45,8 +45,6 @@ Pushed 42 documents to sandbox environment tc24-abcd-x1y2 from ./my-workspace
|
|
|
45
45
|
async run() {
|
|
46
46
|
const { args, flags } = await this.parse(SandboxPush);
|
|
47
47
|
const { profile } = this.resolveProfile(flags);
|
|
48
|
-
const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
|
|
49
|
-
const tenantName = tenant.name;
|
|
50
48
|
const inputDir = path.resolve(args.directory);
|
|
51
49
|
if (!fs.existsSync(inputDir)) {
|
|
52
50
|
this.error(`Directory not found: ${inputDir}`);
|
|
@@ -75,7 +73,7 @@ Pushed 42 documents to sandbox environment tc24-abcd-x1y2 from ./my-workspace
|
|
|
75
73
|
transaction: flags.transaction.toString(),
|
|
76
74
|
truncate: flags.truncate.toString(),
|
|
77
75
|
});
|
|
78
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
76
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/multidoc?${queryParams.toString()}`;
|
|
79
77
|
const startTime = Date.now();
|
|
80
78
|
try {
|
|
81
79
|
const response = await this.verboseFetch(apiUrl, {
|
|
@@ -124,7 +122,7 @@ Pushed 42 documents to sandbox environment tc24-abcd-x1y2 from ./my-workspace
|
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
124
|
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
127
|
-
this.log(`Pushed ${documentEntries.length} documents to sandbox environment
|
|
125
|
+
this.log(`Pushed ${documentEntries.length} documents to sandbox environment from ${args.directory} in ${elapsed}s`);
|
|
128
126
|
}
|
|
129
127
|
collectFiles(dir) {
|
|
130
128
|
const files = [];
|
|
@@ -5,7 +5,7 @@ export default class SandboxReset extends BaseCommand {
|
|
|
5
5
|
static examples = [
|
|
6
6
|
`$ xano sandbox reset
|
|
7
7
|
Are you sure you want to reset your sandbox environment? All workspace data and drafts will be cleared. (y/N) y
|
|
8
|
-
|
|
8
|
+
Sandbox environment has been reset.
|
|
9
9
|
`,
|
|
10
10
|
`$ xano sandbox reset --force`,
|
|
11
11
|
];
|
|
@@ -21,8 +21,6 @@ Reset sandbox environment tc24-abcd-x1y2
|
|
|
21
21
|
async run() {
|
|
22
22
|
const { flags } = await this.parse(SandboxReset);
|
|
23
23
|
const { profile } = this.resolveProfile(flags);
|
|
24
|
-
const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
|
|
25
|
-
const tenantName = tenant.name;
|
|
26
24
|
if (!flags.force) {
|
|
27
25
|
const confirmed = await this.confirm(`Are you sure you want to reset your sandbox environment? All workspace data and drafts will be cleared.`);
|
|
28
26
|
if (!confirmed) {
|
|
@@ -30,7 +28,7 @@ Reset sandbox environment tc24-abcd-x1y2
|
|
|
30
28
|
return;
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
31
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/reset`;
|
|
34
32
|
try {
|
|
35
33
|
const response = await this.verboseFetch(apiUrl, {
|
|
36
34
|
headers: {
|
|
@@ -30,9 +30,7 @@ Review session started!
|
|
|
30
30
|
async run() {
|
|
31
31
|
const { flags } = await this.parse(SandboxReview);
|
|
32
32
|
const { profile } = this.resolveProfile(flags);
|
|
33
|
-
const
|
|
34
|
-
const tenantName = tenant.name;
|
|
35
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/impersonate`;
|
|
33
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/impersonate`;
|
|
36
34
|
try {
|
|
37
35
|
const response = await this.verboseFetch(apiUrl, {
|
|
38
36
|
headers: {
|
|
@@ -32,15 +32,13 @@ Unit tests:
|
|
|
32
32
|
async run() {
|
|
33
33
|
const { flags } = await this.parse(SandboxUnitTestList);
|
|
34
34
|
const { profile } = this.resolveProfile(flags);
|
|
35
|
-
const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
|
|
36
|
-
const tenantName = tenant.name;
|
|
37
35
|
const params = new URLSearchParams();
|
|
38
36
|
params.set('per_page', '10000');
|
|
39
37
|
if (flags.branch)
|
|
40
38
|
params.set('branch', flags.branch);
|
|
41
39
|
if (flags['obj-type'])
|
|
42
40
|
params.set('obj_type', flags['obj-type']);
|
|
43
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
41
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/unit_test?${params}`;
|
|
44
42
|
try {
|
|
45
43
|
const response = await this.verboseFetch(apiUrl, {
|
|
46
44
|
headers: {
|
|
@@ -72,7 +70,7 @@ Unit tests:
|
|
|
72
70
|
this.log('No unit tests found');
|
|
73
71
|
}
|
|
74
72
|
else {
|
|
75
|
-
this.log(`Unit tests for sandbox environment
|
|
73
|
+
this.log(`Unit tests for sandbox environment:`);
|
|
76
74
|
for (const test of tests) {
|
|
77
75
|
this.log(` - ${test.name} (ID: ${test.id}) [${test.obj_type}: ${test.obj_name}]`);
|
|
78
76
|
}
|
|
@@ -28,9 +28,7 @@ Result: PASS
|
|
|
28
28
|
async run() {
|
|
29
29
|
const { args, flags } = await this.parse(SandboxUnitTestRun);
|
|
30
30
|
const { profile } = this.resolveProfile(flags);
|
|
31
|
-
const
|
|
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`;
|
|
31
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/unit_test/${encodeURIComponent(args.unit_test_id)}/run`;
|
|
34
32
|
try {
|
|
35
33
|
if (flags.output === 'summary') {
|
|
36
34
|
this.log(`Running unit test ${args.unit_test_id}...`);
|
|
@@ -37,9 +37,7 @@ Results: 4 passed, 1 failed
|
|
|
37
37
|
async run() {
|
|
38
38
|
const { flags } = await this.parse(SandboxUnitTestRunAll);
|
|
39
39
|
const { profile } = this.resolveProfile(flags);
|
|
40
|
-
const
|
|
41
|
-
const tenantName = tenant.name;
|
|
42
|
-
const baseUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/unit_test`;
|
|
40
|
+
const baseUrl = `${profile.instance_origin}/api:meta/sandbox/unit_test`;
|
|
43
41
|
try {
|
|
44
42
|
// Step 1: List all unit tests
|
|
45
43
|
const listParams = new URLSearchParams();
|
|
@@ -27,9 +27,7 @@ Deleted workflow test 42
|
|
|
27
27
|
async run() {
|
|
28
28
|
const { args, flags } = await this.parse(SandboxWorkflowTestDelete);
|
|
29
29
|
const { profile } = this.resolveProfile(flags);
|
|
30
|
-
const
|
|
31
|
-
const tenantName = tenant.name;
|
|
32
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/workflow_test/${args.workflow_test_id}`;
|
|
30
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/workflow_test/${args.workflow_test_id}`;
|
|
33
31
|
try {
|
|
34
32
|
const response = await this.verboseFetch(apiUrl, {
|
|
35
33
|
headers: {
|
|
@@ -22,9 +22,7 @@ export default class SandboxWorkflowTestGet extends BaseCommand {
|
|
|
22
22
|
async run() {
|
|
23
23
|
const { args, flags } = await this.parse(SandboxWorkflowTestGet);
|
|
24
24
|
const { profile } = this.resolveProfile(flags);
|
|
25
|
-
const
|
|
26
|
-
const tenantName = tenant.name;
|
|
27
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/workflow_test/${args.workflow_test_id}`;
|
|
25
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/workflow_test/${args.workflow_test_id}`;
|
|
28
26
|
try {
|
|
29
27
|
const response = await this.verboseFetch(apiUrl, {
|
|
30
28
|
headers: {
|
|
@@ -27,13 +27,11 @@ Workflow tests:
|
|
|
27
27
|
async run() {
|
|
28
28
|
const { flags } = await this.parse(SandboxWorkflowTestList);
|
|
29
29
|
const { profile } = this.resolveProfile(flags);
|
|
30
|
-
const tenant = await this.getOrCreateSandbox(profile, flags.verbose);
|
|
31
|
-
const tenantName = tenant.name;
|
|
32
30
|
const params = new URLSearchParams();
|
|
33
31
|
params.set('per_page', '10000');
|
|
34
32
|
if (flags.branch)
|
|
35
33
|
params.set('branch', flags.branch);
|
|
36
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/
|
|
34
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/workflow_test?${params}`;
|
|
37
35
|
try {
|
|
38
36
|
const response = await this.verboseFetch(apiUrl, {
|
|
39
37
|
headers: {
|
|
@@ -65,7 +63,7 @@ Workflow tests:
|
|
|
65
63
|
this.log('No workflow tests found');
|
|
66
64
|
}
|
|
67
65
|
else {
|
|
68
|
-
this.log(`Workflow tests for sandbox environment
|
|
66
|
+
this.log(`Workflow tests for sandbox environment:`);
|
|
69
67
|
for (const test of tests) {
|
|
70
68
|
this.log(` - ${test.name} (ID: ${test.id})`);
|
|
71
69
|
}
|
|
@@ -28,9 +28,7 @@ Result: PASS (0.25s)
|
|
|
28
28
|
async run() {
|
|
29
29
|
const { args, flags } = await this.parse(SandboxWorkflowTestRun);
|
|
30
30
|
const { profile } = this.resolveProfile(flags);
|
|
31
|
-
const
|
|
32
|
-
const tenantName = tenant.name;
|
|
33
|
-
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/workflow_test/${args.workflow_test_id}/run`;
|
|
31
|
+
const apiUrl = `${profile.instance_origin}/api:meta/sandbox/workflow_test/${args.workflow_test_id}/run`;
|
|
34
32
|
try {
|
|
35
33
|
if (flags.output === 'summary') {
|
|
36
34
|
this.log(`Running workflow test ${args.workflow_test_id}...`);
|
|
@@ -32,9 +32,7 @@ Results: 2 passed, 1 failed
|
|
|
32
32
|
async run() {
|
|
33
33
|
const { flags } = await this.parse(SandboxWorkflowTestRunAll);
|
|
34
34
|
const { profile } = this.resolveProfile(flags);
|
|
35
|
-
const
|
|
36
|
-
const tenantName = tenant.name;
|
|
37
|
-
const baseUrl = `${profile.instance_origin}/api:meta/sandbox/tenant/${encodeURIComponent(tenantName)}/workflow_test`;
|
|
35
|
+
const baseUrl = `${profile.instance_origin}/api:meta/sandbox/workflow_test`;
|
|
38
36
|
try {
|
|
39
37
|
// Step 1: List all workflow tests
|
|
40
38
|
const listParams = new URLSearchParams();
|