@xano/cli 1.0.2-beta.4 → 1.0.2-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/README.md +87 -0
- package/dist/base-command.d.ts +21 -1
- package/dist/base-command.js +92 -6
- package/dist/commands/branch/create/index.d.ts +0 -1
- package/dist/commands/branch/create/index.js +1 -38
- package/dist/commands/branch/delete/index.d.ts +0 -1
- package/dist/commands/branch/delete/index.js +1 -39
- package/dist/commands/branch/edit/index.d.ts +0 -1
- package/dist/commands/branch/edit/index.js +1 -39
- package/dist/commands/branch/get/index.d.ts +0 -1
- package/dist/commands/branch/get/index.js +1 -39
- package/dist/commands/branch/list/index.d.ts +0 -1
- package/dist/commands/branch/list/index.js +1 -39
- package/dist/commands/branch/set_live/index.d.ts +0 -1
- package/dist/commands/branch/set_live/index.js +1 -39
- package/dist/commands/function/create/index.d.ts +0 -1
- package/dist/commands/function/create/index.js +1 -38
- package/dist/commands/function/edit/index.d.ts +0 -1
- package/dist/commands/function/edit/index.js +1 -37
- package/dist/commands/function/get/index.d.ts +0 -1
- package/dist/commands/function/get/index.js +1 -38
- package/dist/commands/function/list/index.d.ts +0 -1
- package/dist/commands/function/list/index.js +1 -39
- package/dist/commands/platform/get/index.d.ts +0 -1
- package/dist/commands/platform/get/index.js +1 -33
- package/dist/commands/platform/list/index.d.ts +0 -1
- package/dist/commands/platform/list/index.js +1 -33
- package/dist/commands/profile/use/index.d.ts +33 -0
- package/dist/commands/profile/use/index.js +179 -0
- package/dist/commands/profile/wizard/index.js +8 -2
- package/dist/commands/release/create/index.d.ts +0 -1
- package/dist/commands/release/create/index.js +1 -33
- package/dist/commands/release/delete/index.d.ts +0 -1
- package/dist/commands/release/delete/index.js +1 -33
- package/dist/commands/release/deploy/index.js +1 -12
- package/dist/commands/release/edit/index.d.ts +0 -1
- package/dist/commands/release/edit/index.js +1 -33
- package/dist/commands/release/export/index.d.ts +0 -1
- package/dist/commands/release/export/index.js +1 -31
- package/dist/commands/release/get/index.d.ts +0 -1
- package/dist/commands/release/get/index.js +1 -33
- package/dist/commands/release/import/index.d.ts +0 -1
- package/dist/commands/release/import/index.js +1 -32
- package/dist/commands/release/list/index.d.ts +0 -1
- package/dist/commands/release/list/index.js +1 -32
- package/dist/commands/release/pull/index.d.ts +0 -1
- package/dist/commands/release/pull/index.js +2 -38
- package/dist/commands/release/push/index.d.ts +0 -1
- package/dist/commands/release/push/index.js +1 -37
- package/dist/commands/static_host/build/create/index.d.ts +0 -1
- package/dist/commands/static_host/build/create/index.js +1 -39
- package/dist/commands/static_host/build/get/index.d.ts +0 -1
- package/dist/commands/static_host/build/get/index.js +1 -39
- package/dist/commands/static_host/build/list/index.d.ts +0 -1
- package/dist/commands/static_host/build/list/index.js +1 -39
- package/dist/commands/static_host/list/index.d.ts +0 -1
- package/dist/commands/static_host/list/index.js +1 -39
- package/dist/commands/tenant/backup/create/index.d.ts +0 -1
- package/dist/commands/tenant/backup/create/index.js +1 -33
- package/dist/commands/tenant/backup/delete/index.d.ts +0 -1
- package/dist/commands/tenant/backup/delete/index.js +1 -32
- package/dist/commands/tenant/backup/export/index.d.ts +0 -1
- package/dist/commands/tenant/backup/export/index.js +1 -31
- package/dist/commands/tenant/backup/import/index.d.ts +0 -1
- package/dist/commands/tenant/backup/import/index.js +1 -32
- package/dist/commands/tenant/backup/list/index.d.ts +0 -1
- package/dist/commands/tenant/backup/list/index.js +1 -33
- package/dist/commands/tenant/backup/restore/index.d.ts +0 -1
- package/dist/commands/tenant/backup/restore/index.js +1 -32
- package/dist/commands/tenant/cluster/create/index.d.ts +0 -1
- package/dist/commands/tenant/cluster/create/index.js +1 -31
- package/dist/commands/tenant/cluster/delete/index.d.ts +0 -1
- package/dist/commands/tenant/cluster/delete/index.js +1 -33
- package/dist/commands/tenant/cluster/edit/index.d.ts +0 -1
- package/dist/commands/tenant/cluster/edit/index.js +1 -33
- package/dist/commands/tenant/cluster/get/index.d.ts +0 -1
- package/dist/commands/tenant/cluster/get/index.js +1 -32
- package/dist/commands/tenant/cluster/license/get/index.d.ts +0 -1
- package/dist/commands/tenant/cluster/license/get/index.js +1 -31
- package/dist/commands/tenant/cluster/license/set/index.d.ts +0 -1
- package/dist/commands/tenant/cluster/license/set/index.js +1 -31
- package/dist/commands/tenant/cluster/list/index.d.ts +0 -1
- package/dist/commands/tenant/cluster/list/index.js +1 -32
- package/dist/commands/tenant/create/index.d.ts +0 -1
- package/dist/commands/tenant/create/index.js +1 -30
- package/dist/commands/tenant/delete/index.d.ts +0 -1
- package/dist/commands/tenant/delete/index.js +1 -33
- package/dist/commands/tenant/deploy_platform/index.d.ts +0 -1
- package/dist/commands/tenant/deploy_platform/index.js +1 -31
- package/dist/commands/tenant/deploy_release/index.d.ts +0 -1
- package/dist/commands/tenant/deploy_release/index.js +1 -32
- package/dist/commands/tenant/edit/index.d.ts +0 -1
- package/dist/commands/tenant/edit/index.js +1 -33
- package/dist/commands/tenant/env/delete/index.d.ts +0 -1
- package/dist/commands/tenant/env/delete/index.js +1 -32
- package/dist/commands/tenant/env/get/index.d.ts +0 -1
- package/dist/commands/tenant/env/get/index.js +1 -32
- package/dist/commands/tenant/env/get_all/index.d.ts +0 -1
- package/dist/commands/tenant/env/get_all/index.js +1 -30
- package/dist/commands/tenant/env/list/index.d.ts +0 -1
- package/dist/commands/tenant/env/list/index.js +1 -32
- package/dist/commands/tenant/env/set/index.d.ts +0 -1
- package/dist/commands/tenant/env/set/index.js +1 -32
- package/dist/commands/tenant/env/set_all/index.d.ts +0 -1
- package/dist/commands/tenant/env/set_all/index.js +1 -30
- package/dist/commands/tenant/get/index.d.ts +0 -1
- package/dist/commands/tenant/get/index.js +1 -32
- package/dist/commands/tenant/impersonate/index.d.ts +0 -1
- package/dist/commands/tenant/impersonate/index.js +1 -32
- package/dist/commands/tenant/license/get/index.d.ts +0 -1
- package/dist/commands/tenant/license/get/index.js +1 -31
- package/dist/commands/tenant/license/set/index.d.ts +0 -1
- package/dist/commands/tenant/license/set/index.js +1 -31
- package/dist/commands/tenant/list/index.d.ts +0 -1
- package/dist/commands/tenant/list/index.js +1 -32
- package/dist/commands/tenant/pull/index.d.ts +0 -1
- package/dist/commands/tenant/pull/index.js +1 -37
- package/dist/commands/tenant/unit_test/list/index.js +1 -12
- package/dist/commands/tenant/unit_test/run/index.js +1 -12
- package/dist/commands/tenant/unit_test/run_all/index.js +1 -12
- package/dist/commands/tenant/workflow_test/list/index.js +1 -12
- package/dist/commands/tenant/workflow_test/run/index.js +1 -12
- package/dist/commands/tenant/workflow_test/run_all/index.js +1 -12
- package/dist/commands/unit_test/list/index.d.ts +0 -1
- package/dist/commands/unit_test/list/index.js +1 -33
- package/dist/commands/unit_test/run/index.d.ts +0 -1
- package/dist/commands/unit_test/run/index.js +1 -33
- package/dist/commands/unit_test/run_all/index.d.ts +0 -1
- package/dist/commands/unit_test/run_all/index.js +1 -32
- package/dist/commands/workflow_test/delete/index.d.ts +0 -1
- package/dist/commands/workflow_test/delete/index.js +1 -33
- package/dist/commands/workflow_test/get/index.d.ts +0 -1
- package/dist/commands/workflow_test/get/index.js +1 -33
- package/dist/commands/workflow_test/list/index.d.ts +0 -1
- package/dist/commands/workflow_test/list/index.js +1 -33
- package/dist/commands/workflow_test/run/index.d.ts +0 -1
- package/dist/commands/workflow_test/run/index.js +1 -33
- package/dist/commands/workflow_test/run_all/index.d.ts +0 -1
- package/dist/commands/workflow_test/run_all/index.js +1 -32
- package/dist/commands/workspace/create/index.d.ts +0 -1
- package/dist/commands/workspace/create/index.js +1 -39
- package/dist/commands/workspace/delete/index.d.ts +0 -1
- package/dist/commands/workspace/delete/index.js +1 -39
- package/dist/commands/workspace/edit/index.d.ts +0 -1
- package/dist/commands/workspace/edit/index.js +1 -38
- package/dist/commands/workspace/get/index.d.ts +0 -1
- package/dist/commands/workspace/get/index.js +1 -38
- package/dist/commands/workspace/list/index.d.ts +0 -1
- package/dist/commands/workspace/list/index.js +1 -38
- package/dist/commands/workspace/pull/index.d.ts +0 -1
- package/dist/commands/workspace/pull/index.js +1 -37
- package/dist/utils/local-config.d.ts +43 -0
- package/dist/utils/local-config.js +88 -0
- package/oclif.manifest.json +2153 -2066
- package/package.json +1 -1
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
2
|
import BaseCommand from '../../../../base-command.js';
|
|
5
3
|
export default class TenantClusterEdit extends BaseCommand {
|
|
6
4
|
static args = {
|
|
@@ -47,19 +45,7 @@ Updated tenant cluster: us-east-1-updated (standard) - ID: 1
|
|
|
47
45
|
};
|
|
48
46
|
async run() {
|
|
49
47
|
const { args, flags } = await this.parse(TenantClusterEdit);
|
|
50
|
-
const
|
|
51
|
-
const credentials = this.loadCredentials();
|
|
52
|
-
if (!(profileName in credentials.profiles)) {
|
|
53
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
54
|
-
`Create a profile using 'xano profile create'`);
|
|
55
|
-
}
|
|
56
|
-
const profile = credentials.profiles[profileName];
|
|
57
|
-
if (!profile.instance_origin) {
|
|
58
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
59
|
-
}
|
|
60
|
-
if (!profile.access_token) {
|
|
61
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
62
|
-
}
|
|
48
|
+
const { profile } = this.resolveProfile(flags);
|
|
63
49
|
const clusterId = args.cluster_id;
|
|
64
50
|
const body = {
|
|
65
51
|
description: flags.description,
|
|
@@ -104,22 +90,4 @@ Updated tenant cluster: us-east-1-updated (standard) - ID: 1
|
|
|
104
90
|
}
|
|
105
91
|
}
|
|
106
92
|
}
|
|
107
|
-
loadCredentials() {
|
|
108
|
-
const credentialsPath = this.getCredentialsPath();
|
|
109
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
110
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
111
|
-
`Create a profile using 'xano profile create'`);
|
|
112
|
-
}
|
|
113
|
-
try {
|
|
114
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
115
|
-
const parsed = yaml.load(fileContent);
|
|
116
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
117
|
-
this.error('Credentials file has invalid format.');
|
|
118
|
-
}
|
|
119
|
-
return parsed;
|
|
120
|
-
}
|
|
121
|
-
catch (error) {
|
|
122
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
93
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
2
|
import BaseCommand from '../../../../base-command.js';
|
|
5
3
|
export default class TenantClusterGet extends BaseCommand {
|
|
6
4
|
static args = {
|
|
@@ -31,19 +29,7 @@ Cluster: us-east-1
|
|
|
31
29
|
};
|
|
32
30
|
async run() {
|
|
33
31
|
const { args, flags } = await this.parse(TenantClusterGet);
|
|
34
|
-
const
|
|
35
|
-
const credentials = this.loadCredentials();
|
|
36
|
-
if (!(profileName in credentials.profiles)) {
|
|
37
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
38
|
-
`Create 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
|
-
}
|
|
32
|
+
const { profile } = this.resolveProfile(flags);
|
|
47
33
|
const clusterId = args.cluster_id;
|
|
48
34
|
const apiUrl = `${profile.instance_origin}/api:meta/tenant/cluster/${clusterId}`;
|
|
49
35
|
try {
|
|
@@ -91,21 +77,4 @@ Cluster: us-east-1
|
|
|
91
77
|
}
|
|
92
78
|
}
|
|
93
79
|
}
|
|
94
|
-
loadCredentials() {
|
|
95
|
-
const credentialsPath = this.getCredentialsPath();
|
|
96
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
97
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
101
|
-
const parsed = yaml.load(fileContent);
|
|
102
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
103
|
-
this.error('Credentials file has invalid format.');
|
|
104
|
-
}
|
|
105
|
-
return parsed;
|
|
106
|
-
}
|
|
107
|
-
catch (error) {
|
|
108
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
80
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
2
|
import * as fs from 'node:fs';
|
|
4
3
|
import * as path from 'node:path';
|
|
5
4
|
import BaseCommand from '../../../../../base-command.js';
|
|
@@ -43,19 +42,7 @@ License saved to my-kubeconfig.yaml
|
|
|
43
42
|
};
|
|
44
43
|
async run() {
|
|
45
44
|
const { args, flags } = await this.parse(TenantClusterLicenseGet);
|
|
46
|
-
const
|
|
47
|
-
const credentials = this.loadCredentials();
|
|
48
|
-
if (!(profileName in credentials.profiles)) {
|
|
49
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
50
|
-
`Create a profile using 'xano profile create'`);
|
|
51
|
-
}
|
|
52
|
-
const profile = credentials.profiles[profileName];
|
|
53
|
-
if (!profile.instance_origin) {
|
|
54
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
55
|
-
}
|
|
56
|
-
if (!profile.access_token) {
|
|
57
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
58
|
-
}
|
|
45
|
+
const { profile } = this.resolveProfile(flags);
|
|
59
46
|
const clusterId = args.cluster_id;
|
|
60
47
|
const apiUrl = `${profile.instance_origin}/api:meta/tenant/cluster/${clusterId}/license`;
|
|
61
48
|
try {
|
|
@@ -96,21 +83,4 @@ License saved to my-kubeconfig.yaml
|
|
|
96
83
|
}
|
|
97
84
|
}
|
|
98
85
|
}
|
|
99
|
-
loadCredentials() {
|
|
100
|
-
const credentialsPath = this.getCredentialsPath();
|
|
101
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
102
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
103
|
-
}
|
|
104
|
-
try {
|
|
105
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
106
|
-
const parsed = yaml.load(fileContent);
|
|
107
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
108
|
-
this.error('Credentials file has invalid format.');
|
|
109
|
-
}
|
|
110
|
-
return parsed;
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
86
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
2
|
import * as fs from 'node:fs';
|
|
4
3
|
import * as path from 'node:path';
|
|
5
4
|
import BaseCommand from '../../../../../base-command.js';
|
|
@@ -61,19 +60,7 @@ Reads from kubeconfig-1.yaml
|
|
|
61
60
|
}
|
|
62
61
|
licenseValue = fs.readFileSync(sourceFilePath, 'utf8');
|
|
63
62
|
}
|
|
64
|
-
const
|
|
65
|
-
const credentials = this.loadCredentials();
|
|
66
|
-
if (!(profileName in credentials.profiles)) {
|
|
67
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
68
|
-
`Create a profile using 'xano profile create'`);
|
|
69
|
-
}
|
|
70
|
-
const profile = credentials.profiles[profileName];
|
|
71
|
-
if (!profile.instance_origin) {
|
|
72
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
73
|
-
}
|
|
74
|
-
if (!profile.access_token) {
|
|
75
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
76
|
-
}
|
|
63
|
+
const { profile } = this.resolveProfile(flags);
|
|
77
64
|
const apiUrl = `${profile.instance_origin}/api:meta/tenant/cluster/${clusterId}/license`;
|
|
78
65
|
try {
|
|
79
66
|
const response = await this.verboseFetch(apiUrl, {
|
|
@@ -110,21 +97,4 @@ Reads from kubeconfig-1.yaml
|
|
|
110
97
|
}
|
|
111
98
|
}
|
|
112
99
|
}
|
|
113
|
-
loadCredentials() {
|
|
114
|
-
const credentialsPath = this.getCredentialsPath();
|
|
115
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
116
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
117
|
-
}
|
|
118
|
-
try {
|
|
119
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
120
|
-
const parsed = yaml.load(fileContent);
|
|
121
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
122
|
-
this.error('Credentials file has invalid format.');
|
|
123
|
-
}
|
|
124
|
-
return parsed;
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
100
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
2
|
import BaseCommand from '../../../../base-command.js';
|
|
5
3
|
export default class TenantClusterList extends BaseCommand {
|
|
6
4
|
static description = 'List all tenant clusters';
|
|
@@ -24,19 +22,7 @@ Tenant clusters:
|
|
|
24
22
|
};
|
|
25
23
|
async run() {
|
|
26
24
|
const { flags } = await this.parse(TenantClusterList);
|
|
27
|
-
const
|
|
28
|
-
const credentials = this.loadCredentials();
|
|
29
|
-
if (!(profileName in credentials.profiles)) {
|
|
30
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
31
|
-
`Create a profile using 'xano profile create'`);
|
|
32
|
-
}
|
|
33
|
-
const profile = credentials.profiles[profileName];
|
|
34
|
-
if (!profile.instance_origin) {
|
|
35
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
36
|
-
}
|
|
37
|
-
if (!profile.access_token) {
|
|
38
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
39
|
-
}
|
|
25
|
+
const { profile } = this.resolveProfile(flags);
|
|
40
26
|
const apiUrl = `${profile.instance_origin}/api:meta/tenant/cluster`;
|
|
41
27
|
try {
|
|
42
28
|
const response = await this.verboseFetch(apiUrl, {
|
|
@@ -86,21 +72,4 @@ Tenant clusters:
|
|
|
86
72
|
}
|
|
87
73
|
}
|
|
88
74
|
}
|
|
89
|
-
loadCredentials() {
|
|
90
|
-
const credentialsPath = this.getCredentialsPath();
|
|
91
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
92
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
93
|
-
}
|
|
94
|
-
try {
|
|
95
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
96
|
-
const parsed = yaml.load(fileContent);
|
|
97
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
98
|
-
this.error('Credentials file has invalid format.');
|
|
99
|
-
}
|
|
100
|
-
return parsed;
|
|
101
|
-
}
|
|
102
|
-
catch (error) {
|
|
103
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
75
|
}
|
|
@@ -73,19 +73,7 @@ Created tenant: Production (production) - ID: 42
|
|
|
73
73
|
};
|
|
74
74
|
async run() {
|
|
75
75
|
const { args, flags } = await this.parse(TenantCreate);
|
|
76
|
-
const
|
|
77
|
-
const credentials = this.loadCredentials();
|
|
78
|
-
if (!(profileName in credentials.profiles)) {
|
|
79
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
80
|
-
`Create a profile using 'xano profile create'`);
|
|
81
|
-
}
|
|
82
|
-
const profile = credentials.profiles[profileName];
|
|
83
|
-
if (!profile.instance_origin) {
|
|
84
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
85
|
-
}
|
|
86
|
-
if (!profile.access_token) {
|
|
87
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
88
|
-
}
|
|
76
|
+
const { profile } = this.resolveProfile(flags);
|
|
89
77
|
const workspaceId = flags.workspace || profile.workspace;
|
|
90
78
|
if (!workspaceId) {
|
|
91
79
|
this.error('No workspace ID provided. Use --workspace flag or set one in your profile.');
|
|
@@ -156,21 +144,4 @@ Created tenant: Production (production) - ID: 42
|
|
|
156
144
|
}
|
|
157
145
|
}
|
|
158
146
|
}
|
|
159
|
-
loadCredentials() {
|
|
160
|
-
const credentialsPath = this.getCredentialsPath();
|
|
161
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
162
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
163
|
-
}
|
|
164
|
-
try {
|
|
165
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
166
|
-
const parsed = yaml.load(fileContent);
|
|
167
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
168
|
-
this.error('Credentials file has invalid format.');
|
|
169
|
-
}
|
|
170
|
-
return parsed;
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
147
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
2
|
import BaseCommand from '../../../base-command.js';
|
|
5
3
|
export default class TenantDelete extends BaseCommand {
|
|
6
4
|
static args = {
|
|
@@ -43,19 +41,7 @@ Deleted tenant t1234-abcd-xyz1
|
|
|
43
41
|
};
|
|
44
42
|
async run() {
|
|
45
43
|
const { args, flags } = await this.parse(TenantDelete);
|
|
46
|
-
const
|
|
47
|
-
const credentials = this.loadCredentials();
|
|
48
|
-
if (!(profileName in credentials.profiles)) {
|
|
49
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
50
|
-
`Create a profile using 'xano profile create'`);
|
|
51
|
-
}
|
|
52
|
-
const profile = credentials.profiles[profileName];
|
|
53
|
-
if (!profile.instance_origin) {
|
|
54
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
55
|
-
}
|
|
56
|
-
if (!profile.access_token) {
|
|
57
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
58
|
-
}
|
|
44
|
+
const { profile } = this.resolveProfile(flags);
|
|
59
45
|
const workspaceId = flags.workspace || profile.workspace;
|
|
60
46
|
if (!workspaceId) {
|
|
61
47
|
this.error('No workspace ID provided. Use --workspace flag or set one in your profile.');
|
|
@@ -110,22 +96,4 @@ Deleted tenant t1234-abcd-xyz1
|
|
|
110
96
|
});
|
|
111
97
|
});
|
|
112
98
|
}
|
|
113
|
-
loadCredentials() {
|
|
114
|
-
const credentialsPath = this.getCredentialsPath();
|
|
115
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
116
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
117
|
-
`Create a profile using 'xano profile create'`);
|
|
118
|
-
}
|
|
119
|
-
try {
|
|
120
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
121
|
-
const parsed = yaml.load(fileContent);
|
|
122
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
123
|
-
this.error('Credentials file has invalid format.');
|
|
124
|
-
}
|
|
125
|
-
return parsed;
|
|
126
|
-
}
|
|
127
|
-
catch (error) {
|
|
128
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
99
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
2
|
import * as fs from 'node:fs';
|
|
4
3
|
import * as path from 'node:path';
|
|
5
4
|
import BaseCommand from '../../../base-command.js';
|
|
@@ -44,19 +43,7 @@ Deployed platform 5 to tenant: My Tenant (my-tenant)
|
|
|
44
43
|
};
|
|
45
44
|
async run() {
|
|
46
45
|
const { args, flags } = await this.parse(TenantDeployPlatform);
|
|
47
|
-
const
|
|
48
|
-
const credentials = this.loadCredentials();
|
|
49
|
-
if (!(profileName in credentials.profiles)) {
|
|
50
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
51
|
-
`Create a profile using 'xano profile create'`);
|
|
52
|
-
}
|
|
53
|
-
const profile = credentials.profiles[profileName];
|
|
54
|
-
if (!profile.instance_origin) {
|
|
55
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
56
|
-
}
|
|
57
|
-
if (!profile.access_token) {
|
|
58
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
59
|
-
}
|
|
46
|
+
const { profile } = this.resolveProfile(flags);
|
|
60
47
|
const workspaceId = flags.workspace || profile.workspace;
|
|
61
48
|
if (!workspaceId) {
|
|
62
49
|
this.error('No workspace ID provided. Use --workspace flag or set one in your profile.');
|
|
@@ -127,21 +114,4 @@ Deployed platform 5 to tenant: My Tenant (my-tenant)
|
|
|
127
114
|
}
|
|
128
115
|
}
|
|
129
116
|
}
|
|
130
|
-
loadCredentials() {
|
|
131
|
-
const credentialsPath = this.getCredentialsPath();
|
|
132
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
133
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
134
|
-
}
|
|
135
|
-
try {
|
|
136
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
137
|
-
const parsed = yaml.load(fileContent);
|
|
138
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
139
|
-
this.error('Credentials file has invalid format.');
|
|
140
|
-
}
|
|
141
|
-
return parsed;
|
|
142
|
-
}
|
|
143
|
-
catch (error) {
|
|
144
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
117
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
2
|
import BaseCommand from '../../../base-command.js';
|
|
5
3
|
export default class TenantDeployRelease extends BaseCommand {
|
|
6
4
|
static args = {
|
|
@@ -38,19 +36,7 @@ Deployed release "v1.0" to tenant: My Tenant (my-tenant)
|
|
|
38
36
|
};
|
|
39
37
|
async run() {
|
|
40
38
|
const { args, flags } = await this.parse(TenantDeployRelease);
|
|
41
|
-
const
|
|
42
|
-
const credentials = this.loadCredentials();
|
|
43
|
-
if (!(profileName in credentials.profiles)) {
|
|
44
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
45
|
-
`Create a profile using 'xano profile create'`);
|
|
46
|
-
}
|
|
47
|
-
const profile = credentials.profiles[profileName];
|
|
48
|
-
if (!profile.instance_origin) {
|
|
49
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
50
|
-
}
|
|
51
|
-
if (!profile.access_token) {
|
|
52
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
53
|
-
}
|
|
39
|
+
const { profile } = this.resolveProfile(flags);
|
|
54
40
|
const workspaceId = flags.workspace || profile.workspace;
|
|
55
41
|
if (!workspaceId) {
|
|
56
42
|
this.error('No workspace ID provided. Use --workspace flag or set one in your profile.');
|
|
@@ -97,21 +83,4 @@ Deployed release "v1.0" to tenant: My Tenant (my-tenant)
|
|
|
97
83
|
}
|
|
98
84
|
}
|
|
99
85
|
}
|
|
100
|
-
loadCredentials() {
|
|
101
|
-
const credentialsPath = this.getCredentialsPath();
|
|
102
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
103
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
104
|
-
}
|
|
105
|
-
try {
|
|
106
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
107
|
-
const parsed = yaml.load(fileContent);
|
|
108
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
109
|
-
this.error('Credentials file has invalid format.');
|
|
110
|
-
}
|
|
111
|
-
return parsed;
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
86
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
2
|
import BaseCommand from '../../../base-command.js';
|
|
5
3
|
export default class TenantEdit extends BaseCommand {
|
|
6
4
|
static args = {
|
|
@@ -65,19 +63,7 @@ Updated tenant: New Name (my-tenant) - ID: 42
|
|
|
65
63
|
};
|
|
66
64
|
async run() {
|
|
67
65
|
const { args, flags } = await this.parse(TenantEdit);
|
|
68
|
-
const
|
|
69
|
-
const credentials = this.loadCredentials();
|
|
70
|
-
if (!(profileName in credentials.profiles)) {
|
|
71
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
72
|
-
`Create a profile using 'xano profile create'`);
|
|
73
|
-
}
|
|
74
|
-
const profile = credentials.profiles[profileName];
|
|
75
|
-
if (!profile.instance_origin) {
|
|
76
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
77
|
-
}
|
|
78
|
-
if (!profile.access_token) {
|
|
79
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
80
|
-
}
|
|
66
|
+
const { profile } = this.resolveProfile(flags);
|
|
81
67
|
const workspaceId = flags.workspace || profile.workspace;
|
|
82
68
|
if (!workspaceId) {
|
|
83
69
|
this.error('No workspace ID provided. Use --workspace flag or set one in your profile.');
|
|
@@ -143,22 +129,4 @@ Updated tenant: New Name (my-tenant) - ID: 42
|
|
|
143
129
|
}
|
|
144
130
|
}
|
|
145
131
|
}
|
|
146
|
-
loadCredentials() {
|
|
147
|
-
const credentialsPath = this.getCredentialsPath();
|
|
148
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
149
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
150
|
-
`Create a profile using 'xano profile create'`);
|
|
151
|
-
}
|
|
152
|
-
try {
|
|
153
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
154
|
-
const parsed = yaml.load(fileContent);
|
|
155
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
156
|
-
this.error('Credentials file has invalid format.');
|
|
157
|
-
}
|
|
158
|
-
return parsed;
|
|
159
|
-
}
|
|
160
|
-
catch (error) {
|
|
161
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
132
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import * as yaml from 'js-yaml';
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
2
|
import BaseCommand from '../../../../base-command.js';
|
|
5
3
|
export default class TenantEnvDelete extends BaseCommand {
|
|
6
4
|
static args = {
|
|
@@ -48,19 +46,7 @@ Environment variable 'DATABASE_URL' deleted from tenant my-tenant
|
|
|
48
46
|
};
|
|
49
47
|
async run() {
|
|
50
48
|
const { args, flags } = await this.parse(TenantEnvDelete);
|
|
51
|
-
const
|
|
52
|
-
const credentials = this.loadCredentials();
|
|
53
|
-
if (!(profileName in credentials.profiles)) {
|
|
54
|
-
this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
|
|
55
|
-
`Create a profile using 'xano profile create'`);
|
|
56
|
-
}
|
|
57
|
-
const profile = credentials.profiles[profileName];
|
|
58
|
-
if (!profile.instance_origin) {
|
|
59
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
60
|
-
}
|
|
61
|
-
if (!profile.access_token) {
|
|
62
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
63
|
-
}
|
|
49
|
+
const { profile } = this.resolveProfile(flags);
|
|
64
50
|
const workspaceId = flags.workspace || profile.workspace;
|
|
65
51
|
if (!workspaceId) {
|
|
66
52
|
this.error('No workspace ID provided. Use --workspace flag or set one in your profile.');
|
|
@@ -116,21 +102,4 @@ Environment variable 'DATABASE_URL' deleted from tenant my-tenant
|
|
|
116
102
|
});
|
|
117
103
|
});
|
|
118
104
|
}
|
|
119
|
-
loadCredentials() {
|
|
120
|
-
const credentialsPath = this.getCredentialsPath();
|
|
121
|
-
if (!fs.existsSync(credentialsPath)) {
|
|
122
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
123
|
-
}
|
|
124
|
-
try {
|
|
125
|
-
const fileContent = fs.readFileSync(credentialsPath, 'utf8');
|
|
126
|
-
const parsed = yaml.load(fileContent);
|
|
127
|
-
if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
|
|
128
|
-
this.error('Credentials file has invalid format.');
|
|
129
|
-
}
|
|
130
|
-
return parsed;
|
|
131
|
-
}
|
|
132
|
-
catch (error) {
|
|
133
|
-
this.error(`Failed to parse credentials file: ${error}`);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
105
|
}
|