@xano/cli 0.0.95 → 1.0.1
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 +133 -66
- package/dist/base-command.d.ts +41 -1
- package/dist/base-command.js +92 -3
- package/dist/commands/auth/index.d.ts +1 -0
- package/dist/commands/auth/index.js +16 -11
- package/dist/commands/branch/create/index.d.ts +4 -1
- package/dist/commands/branch/create/index.js +22 -21
- package/dist/commands/branch/delete/index.d.ts +1 -0
- package/dist/commands/branch/delete/index.js +1 -4
- package/dist/commands/branch/edit/index.d.ts +1 -0
- package/dist/commands/branch/edit/index.js +1 -4
- package/dist/commands/branch/get/index.d.ts +1 -0
- package/dist/commands/branch/get/index.js +1 -4
- package/dist/commands/branch/list/index.d.ts +2 -6
- package/dist/commands/branch/list/index.js +13 -17
- package/dist/commands/branch/set_live/index.d.ts +1 -0
- package/dist/commands/branch/set_live/index.js +1 -4
- package/dist/commands/function/create/index.d.ts +1 -0
- package/dist/commands/function/create/index.js +1 -2
- package/dist/commands/function/edit/index.d.ts +1 -0
- package/dist/commands/function/edit/index.js +1 -2
- package/dist/commands/function/get/index.d.ts +1 -0
- package/dist/commands/function/get/index.js +1 -4
- package/dist/commands/function/list/index.d.ts +1 -0
- package/dist/commands/function/list/index.js +1 -4
- package/dist/commands/platform/get/index.d.ts +1 -0
- package/dist/commands/platform/get/index.js +1 -4
- package/dist/commands/platform/list/index.d.ts +1 -0
- package/dist/commands/platform/list/index.js +1 -4
- package/dist/commands/profile/create/index.d.ts +1 -0
- package/dist/commands/profile/create/index.js +12 -6
- package/dist/commands/profile/delete/index.d.ts +1 -0
- package/dist/commands/profile/delete/index.js +8 -4
- package/dist/commands/profile/edit/index.d.ts +1 -0
- package/dist/commands/profile/edit/index.js +3 -6
- package/dist/commands/profile/get/index.d.ts +3 -0
- package/dist/commands/profile/get/index.js +12 -5
- package/dist/commands/profile/list/index.d.ts +1 -0
- package/dist/commands/profile/list/index.js +8 -4
- package/dist/commands/profile/me/index.d.ts +1 -0
- package/dist/commands/profile/me/index.js +22 -6
- package/dist/commands/profile/set/index.d.ts +3 -0
- package/dist/commands/profile/set/index.js +12 -6
- package/dist/commands/profile/token/index.d.ts +3 -0
- package/dist/commands/profile/token/index.js +12 -5
- package/dist/commands/profile/wizard/index.d.ts +1 -0
- package/dist/commands/profile/wizard/index.js +16 -12
- package/dist/commands/profile/workspace/index.d.ts +3 -0
- package/dist/commands/profile/workspace/index.js +12 -5
- package/dist/commands/profile/workspace/set/index.d.ts +1 -0
- package/dist/commands/profile/workspace/set/index.js +2 -4
- package/dist/commands/release/create/index.d.ts +4 -1
- package/dist/commands/release/create/index.js +12 -14
- package/dist/commands/release/delete/index.d.ts +1 -0
- package/dist/commands/release/delete/index.js +1 -4
- package/dist/commands/release/deploy/index.d.ts +20 -0
- package/dist/commands/release/deploy/index.js +137 -0
- package/dist/commands/release/edit/index.d.ts +1 -0
- package/dist/commands/release/edit/index.js +1 -4
- package/dist/commands/release/export/index.d.ts +1 -0
- package/dist/commands/release/export/index.js +1 -3
- package/dist/commands/release/get/index.d.ts +1 -0
- package/dist/commands/release/get/index.js +1 -4
- package/dist/commands/release/import/index.d.ts +1 -0
- package/dist/commands/release/import/index.js +1 -3
- package/dist/commands/release/list/index.d.ts +1 -0
- package/dist/commands/release/list/index.js +1 -4
- package/dist/commands/release/pull/index.d.ts +2 -3
- package/dist/commands/release/pull/index.js +19 -18
- package/dist/commands/release/push/index.d.ts +2 -3
- package/dist/commands/release/push/index.js +19 -22
- package/dist/commands/sandbox/delete/index.d.ts +13 -0
- package/dist/commands/sandbox/delete/index.js +71 -0
- package/dist/commands/sandbox/env/delete/index.d.ts +15 -0
- package/dist/commands/sandbox/env/delete/index.js +89 -0
- package/dist/commands/sandbox/env/get/index.d.ts +13 -0
- package/dist/commands/sandbox/env/get/index.js +65 -0
- package/dist/commands/sandbox/env/get_all/index.d.ts +14 -0
- package/dist/commands/sandbox/env/get_all/index.js +78 -0
- package/dist/commands/sandbox/env/list/index.d.ts +12 -0
- package/dist/commands/sandbox/env/list/index.js +67 -0
- package/dist/commands/sandbox/env/set/index.d.ts +14 -0
- package/dist/commands/sandbox/env/set/index.js +74 -0
- package/dist/commands/sandbox/env/set_all/index.d.ts +14 -0
- package/dist/commands/sandbox/env/set_all/index.js +86 -0
- package/dist/commands/sandbox/get/index.d.ts +12 -0
- package/dist/commands/sandbox/get/index.js +63 -0
- package/dist/commands/sandbox/impersonate/index.d.ts +5 -0
- package/dist/commands/sandbox/impersonate/index.js +5 -0
- package/dist/commands/sandbox/license/get/index.d.ts +14 -0
- package/dist/commands/sandbox/license/get/index.js +78 -0
- package/dist/commands/sandbox/license/set/index.d.ts +15 -0
- package/dist/commands/sandbox/license/set/index.js +95 -0
- package/dist/commands/sandbox/pull/index.d.ts +16 -0
- package/dist/commands/sandbox/pull/index.js +185 -0
- package/dist/commands/sandbox/push/index.d.ts +26 -0
- package/dist/commands/sandbox/push/index.js +196 -0
- package/dist/commands/sandbox/reset/index.d.ts +13 -0
- package/dist/commands/sandbox/reset/index.js +71 -0
- package/dist/commands/sandbox/review/index.d.ts +14 -0
- package/dist/commands/sandbox/review/index.js +94 -0
- package/dist/commands/sandbox/unit_test/list/index.d.ts +14 -0
- package/dist/commands/sandbox/unit_test/list/index.js +91 -0
- package/dist/commands/sandbox/unit_test/run/index.d.ts +15 -0
- package/dist/commands/sandbox/unit_test/run/index.js +79 -0
- package/dist/commands/sandbox/unit_test/run_all/index.d.ts +14 -0
- package/dist/commands/sandbox/unit_test/run_all/index.js +171 -0
- package/dist/commands/sandbox/workflow_test/list/index.d.ts +13 -0
- package/dist/commands/sandbox/workflow_test/list/index.js +84 -0
- package/dist/commands/sandbox/workflow_test/run/index.d.ts +18 -0
- package/dist/commands/sandbox/workflow_test/run/index.js +77 -0
- package/dist/commands/sandbox/workflow_test/run_all/index.d.ts +13 -0
- package/dist/commands/sandbox/workflow_test/run_all/index.js +157 -0
- package/dist/commands/static_host/build/create/index.d.ts +1 -0
- package/dist/commands/static_host/build/create/index.js +1 -3
- package/dist/commands/static_host/build/get/index.d.ts +1 -0
- package/dist/commands/static_host/build/get/index.js +1 -4
- package/dist/commands/static_host/build/list/index.d.ts +1 -0
- package/dist/commands/static_host/build/list/index.js +1 -4
- package/dist/commands/static_host/list/index.d.ts +1 -0
- package/dist/commands/static_host/list/index.js +1 -4
- package/dist/commands/tenant/backup/create/index.d.ts +1 -0
- package/dist/commands/tenant/backup/create/index.js +1 -4
- package/dist/commands/tenant/backup/delete/index.d.ts +1 -0
- package/dist/commands/tenant/backup/delete/index.js +1 -4
- package/dist/commands/tenant/backup/export/index.d.ts +1 -0
- package/dist/commands/tenant/backup/export/index.js +1 -3
- package/dist/commands/tenant/backup/import/index.d.ts +1 -0
- package/dist/commands/tenant/backup/import/index.js +1 -3
- package/dist/commands/tenant/backup/list/index.d.ts +1 -0
- package/dist/commands/tenant/backup/list/index.js +1 -4
- package/dist/commands/tenant/backup/restore/index.d.ts +1 -0
- package/dist/commands/tenant/backup/restore/index.js +1 -4
- package/dist/commands/tenant/cluster/create/index.d.ts +1 -0
- package/dist/commands/tenant/cluster/create/index.js +1 -3
- package/dist/commands/tenant/cluster/delete/index.d.ts +1 -0
- package/dist/commands/tenant/cluster/delete/index.js +1 -4
- package/dist/commands/tenant/cluster/edit/index.d.ts +1 -0
- package/dist/commands/tenant/cluster/edit/index.js +1 -4
- package/dist/commands/tenant/cluster/get/index.d.ts +1 -0
- package/dist/commands/tenant/cluster/get/index.js +1 -4
- package/dist/commands/tenant/cluster/license/get/index.d.ts +1 -0
- package/dist/commands/tenant/cluster/license/get/index.js +1 -3
- package/dist/commands/tenant/cluster/license/set/index.d.ts +1 -0
- package/dist/commands/tenant/cluster/license/set/index.js +1 -3
- package/dist/commands/tenant/cluster/list/index.d.ts +1 -0
- package/dist/commands/tenant/cluster/list/index.js +1 -4
- package/dist/commands/tenant/create/index.d.ts +1 -1
- package/dist/commands/tenant/create/index.js +1 -8
- package/dist/commands/tenant/delete/index.d.ts +1 -0
- package/dist/commands/tenant/delete/index.js +1 -4
- package/dist/commands/tenant/deploy_platform/index.d.ts +1 -0
- package/dist/commands/tenant/deploy_platform/index.js +1 -3
- package/dist/commands/tenant/deploy_release/index.d.ts +1 -0
- package/dist/commands/tenant/deploy_release/index.js +1 -4
- package/dist/commands/tenant/edit/index.d.ts +1 -0
- package/dist/commands/tenant/edit/index.js +1 -4
- package/dist/commands/tenant/env/delete/index.d.ts +1 -0
- package/dist/commands/tenant/env/delete/index.js +1 -4
- package/dist/commands/tenant/env/get/index.d.ts +1 -0
- package/dist/commands/tenant/env/get/index.js +1 -4
- package/dist/commands/tenant/env/get_all/index.d.ts +1 -0
- package/dist/commands/tenant/env/get_all/index.js +1 -3
- package/dist/commands/tenant/env/list/index.d.ts +1 -0
- package/dist/commands/tenant/env/list/index.js +1 -4
- package/dist/commands/tenant/env/set/index.d.ts +1 -0
- package/dist/commands/tenant/env/set/index.js +1 -4
- package/dist/commands/tenant/env/set_all/index.d.ts +1 -0
- package/dist/commands/tenant/env/set_all/index.js +1 -3
- package/dist/commands/tenant/get/index.d.ts +1 -0
- package/dist/commands/tenant/get/index.js +3 -6
- package/dist/commands/tenant/impersonate/index.d.ts +1 -0
- package/dist/commands/tenant/impersonate/index.js +1 -4
- package/dist/commands/tenant/license/get/index.d.ts +1 -0
- package/dist/commands/tenant/license/get/index.js +1 -3
- package/dist/commands/tenant/license/set/index.d.ts +1 -0
- package/dist/commands/tenant/license/set/index.js +1 -3
- package/dist/commands/tenant/list/index.d.ts +1 -0
- package/dist/commands/tenant/list/index.js +3 -6
- package/dist/commands/tenant/pull/index.d.ts +2 -3
- package/dist/commands/tenant/pull/index.js +20 -21
- package/dist/commands/tenant/push/index.d.ts +2 -22
- package/dist/commands/tenant/push/index.js +7 -259
- package/dist/commands/tenant/unit_test/list/index.d.ts +16 -0
- package/dist/commands/tenant/unit_test/list/index.js +115 -0
- package/dist/commands/tenant/unit_test/run/index.d.ts +17 -0
- package/dist/commands/tenant/unit_test/run/index.js +103 -0
- package/dist/commands/tenant/unit_test/run_all/index.d.ts +16 -0
- package/dist/commands/tenant/unit_test/run_all/index.js +190 -0
- package/dist/commands/tenant/workflow_test/list/index.d.ts +15 -0
- package/dist/commands/tenant/workflow_test/list/index.js +108 -0
- package/dist/commands/tenant/workflow_test/run/index.d.ts +20 -0
- package/dist/commands/tenant/workflow_test/run/index.js +101 -0
- package/dist/commands/tenant/workflow_test/run_all/index.d.ts +15 -0
- package/dist/commands/tenant/workflow_test/run_all/index.js +176 -0
- package/dist/commands/unit_test/list/index.d.ts +1 -0
- package/dist/commands/unit_test/list/index.js +1 -4
- package/dist/commands/unit_test/run/index.d.ts +1 -0
- package/dist/commands/unit_test/run/index.js +1 -4
- package/dist/commands/unit_test/run_all/index.d.ts +1 -0
- package/dist/commands/unit_test/run_all/index.js +1 -4
- package/dist/commands/update/index.d.ts +1 -0
- package/dist/commands/workflow_test/delete/index.d.ts +1 -0
- package/dist/commands/workflow_test/delete/index.js +1 -4
- package/dist/commands/workflow_test/get/index.d.ts +1 -0
- package/dist/commands/workflow_test/get/index.js +1 -4
- package/dist/commands/workflow_test/list/index.d.ts +1 -0
- package/dist/commands/workflow_test/list/index.js +1 -4
- package/dist/commands/workflow_test/run/index.d.ts +1 -0
- package/dist/commands/workflow_test/run/index.js +1 -4
- package/dist/commands/workflow_test/run_all/index.d.ts +1 -0
- package/dist/commands/workflow_test/run_all/index.js +1 -4
- package/dist/commands/workspace/create/index.d.ts +1 -0
- package/dist/commands/workspace/create/index.js +1 -4
- package/dist/commands/workspace/delete/index.d.ts +2 -6
- package/dist/commands/workspace/delete/index.js +17 -16
- package/dist/commands/workspace/edit/index.d.ts +3 -6
- package/dist/commands/workspace/edit/index.js +31 -25
- package/dist/commands/workspace/get/index.d.ts +2 -6
- package/dist/commands/workspace/get/index.js +23 -25
- package/dist/commands/workspace/git/pull/index.d.ts +2 -3
- package/dist/commands/workspace/git/pull/index.js +18 -17
- package/dist/commands/workspace/list/index.d.ts +2 -0
- package/dist/commands/workspace/list/index.js +15 -11
- package/dist/commands/workspace/pull/index.d.ts +2 -3
- package/dist/commands/workspace/pull/index.js +21 -24
- package/dist/commands/workspace/push/index.d.ts +7 -16
- package/dist/commands/workspace/push/index.js +85 -674
- package/dist/help.d.ts +2 -1
- package/dist/help.js +39 -1
- package/dist/utils/multidoc-push.d.ts +63 -0
- package/dist/utils/multidoc-push.js +690 -0
- package/dist/utils/reference-checker.d.ts +57 -0
- package/dist/utils/reference-checker.js +232 -0
- package/oclif.manifest.json +5562 -2228
- package/package.json +19 -3
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class UnitTestRun extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -100,8 +98,7 @@ Result: PASS
|
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
loadCredentials() {
|
|
103
|
-
const
|
|
104
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
101
|
+
const credentialsPath = this.getCredentialsPath();
|
|
105
102
|
if (!fs.existsSync(credentialsPath)) {
|
|
106
103
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
107
104
|
`Create a profile using 'xano profile create'`);
|
|
@@ -7,6 +7,7 @@ export default class UnitTestRunAll extends BaseCommand {
|
|
|
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
9
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class UnitTestRunAll extends BaseCommand {
|
|
8
6
|
static description = 'Run all unit tests in a workspace';
|
|
@@ -195,8 +193,7 @@ Results: 2 passed, 1 failed
|
|
|
195
193
|
}
|
|
196
194
|
}
|
|
197
195
|
loadCredentials() {
|
|
198
|
-
const
|
|
199
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
196
|
+
const credentialsPath = this.getCredentialsPath();
|
|
200
197
|
if (!fs.existsSync(credentialsPath)) {
|
|
201
198
|
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
202
199
|
}
|
|
@@ -5,6 +5,7 @@ export default class Update extends BaseCommand {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
beta: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
check: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
};
|
|
@@ -12,6 +12,7 @@ export default class WorkflowTestDelete extends BaseCommand {
|
|
|
12
12
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
14
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
16
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
18
|
};
|
|
@@ -2,8 +2,6 @@ import { Args, Flags } from '@oclif/core';
|
|
|
2
2
|
import * as readline from 'node:readline';
|
|
3
3
|
import * as yaml from 'js-yaml';
|
|
4
4
|
import * as fs from 'node:fs';
|
|
5
|
-
import * as os from 'node:os';
|
|
6
|
-
import * as path from 'node:path';
|
|
7
5
|
import BaseCommand from '../../../base-command.js';
|
|
8
6
|
export default class WorkflowTestDelete extends BaseCommand {
|
|
9
7
|
static args = {
|
|
@@ -109,8 +107,7 @@ Deleted workflow test 1
|
|
|
109
107
|
});
|
|
110
108
|
}
|
|
111
109
|
loadCredentials() {
|
|
112
|
-
const
|
|
113
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
110
|
+
const credentialsPath = this.getCredentialsPath();
|
|
114
111
|
if (!fs.existsSync(credentialsPath)) {
|
|
115
112
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
116
113
|
`Create a profile using 'xano profile create'`);
|
|
@@ -12,6 +12,7 @@ export default class WorkflowTestGet extends BaseCommand {
|
|
|
12
12
|
'include-draft': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
14
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
16
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
18
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class WorkflowTestGet extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -121,8 +119,7 @@ Workflow Test: my-test (ID: 1)
|
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
loadCredentials() {
|
|
124
|
-
const
|
|
125
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
122
|
+
const credentialsPath = this.getCredentialsPath();
|
|
126
123
|
if (!fs.existsSync(credentialsPath)) {
|
|
127
124
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
128
125
|
`Create a profile using 'xano profile create'`);
|
|
@@ -6,6 +6,7 @@ export default class WorkflowTestList extends BaseCommand {
|
|
|
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
8
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class WorkflowTestList extends BaseCommand {
|
|
8
6
|
static description = 'List all workflow tests in a workspace';
|
|
@@ -108,8 +106,7 @@ Workflow tests in workspace 5:
|
|
|
108
106
|
}
|
|
109
107
|
}
|
|
110
108
|
loadCredentials() {
|
|
111
|
-
const
|
|
112
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
109
|
+
const credentialsPath = this.getCredentialsPath();
|
|
113
110
|
if (!fs.existsSync(credentialsPath)) {
|
|
114
111
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
115
112
|
`Create a profile using 'xano profile create'`);
|
|
@@ -11,6 +11,7 @@ export default class WorkflowTestRun extends BaseCommand {
|
|
|
11
11
|
static flags: {
|
|
12
12
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
16
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class WorkflowTestRun extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -98,8 +96,7 @@ Result: PASS (1.234s)
|
|
|
98
96
|
}
|
|
99
97
|
}
|
|
100
98
|
loadCredentials() {
|
|
101
|
-
const
|
|
102
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
99
|
+
const credentialsPath = this.getCredentialsPath();
|
|
103
100
|
if (!fs.existsSync(credentialsPath)) {
|
|
104
101
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
105
102
|
`Create a profile using 'xano profile create'`);
|
|
@@ -6,6 +6,7 @@ export default class WorkflowTestRunAll extends BaseCommand {
|
|
|
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
8
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class WorkflowTestRunAll extends BaseCommand {
|
|
8
6
|
static description = 'Run all workflow tests in a workspace';
|
|
@@ -183,8 +181,7 @@ Results: 2 passed, 1 failed (2.691s total)
|
|
|
183
181
|
}
|
|
184
182
|
}
|
|
185
183
|
loadCredentials() {
|
|
186
|
-
const
|
|
187
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
184
|
+
const credentialsPath = this.getCredentialsPath();
|
|
188
185
|
if (!fs.existsSync(credentialsPath)) {
|
|
189
186
|
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
190
187
|
}
|
|
@@ -8,6 +8,7 @@ export default class WorkspaceCreate extends BaseCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class WorkspaceCreate extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -109,8 +107,7 @@ Created workspace: my-app (ID: 456)
|
|
|
109
107
|
}
|
|
110
108
|
}
|
|
111
109
|
loadCredentials() {
|
|
112
|
-
const
|
|
113
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
110
|
+
const credentialsPath = this.getCredentialsPath();
|
|
114
111
|
// Check if credentials file exists
|
|
115
112
|
if (!fs.existsSync(credentialsPath)) {
|
|
116
113
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import BaseCommand from '../../../base-command.js';
|
|
2
2
|
export default class WorkspaceDelete extends BaseCommand {
|
|
3
|
-
static args: {
|
|
4
|
-
workspace_id: import("@oclif/core/interfaces").Arg<number, {
|
|
5
|
-
max?: number;
|
|
6
|
-
min?: number;
|
|
7
|
-
}>;
|
|
8
|
-
};
|
|
9
3
|
static description: string;
|
|
10
4
|
static examples: string[];
|
|
11
5
|
static flags: {
|
|
12
6
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
7
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
11
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
12
|
};
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class WorkspaceDelete extends BaseCommand {
|
|
8
|
-
static args = {
|
|
9
|
-
workspace_id: Args.integer({
|
|
10
|
-
description: 'Workspace ID to delete',
|
|
11
|
-
required: true,
|
|
12
|
-
}),
|
|
13
|
-
};
|
|
14
6
|
static description = 'Delete a workspace via the Xano Metadata API. Cannot delete workspaces with active tenants.';
|
|
15
7
|
static examples = [
|
|
16
|
-
`$ xano workspace delete 123
|
|
8
|
+
`$ xano workspace delete -w 123
|
|
17
9
|
Are you sure you want to delete workspace 123? This action cannot be undone. (y/N) y
|
|
18
10
|
Deleted workspace 123
|
|
19
11
|
`,
|
|
20
|
-
`$ xano workspace delete 123 --force
|
|
12
|
+
`$ xano workspace delete -w 123 --force
|
|
21
13
|
Deleted workspace 123
|
|
22
14
|
`,
|
|
23
|
-
`$ xano workspace delete 123 -f -o json
|
|
15
|
+
`$ xano workspace delete -w 123 -f -o json
|
|
24
16
|
{
|
|
25
17
|
"deleted": true,
|
|
26
18
|
"workspace_id": 123
|
|
@@ -42,9 +34,14 @@ Deleted workspace 123
|
|
|
42
34
|
options: ['summary', 'json'],
|
|
43
35
|
required: false,
|
|
44
36
|
}),
|
|
37
|
+
workspace: Flags.string({
|
|
38
|
+
char: 'w',
|
|
39
|
+
description: 'Workspace ID to delete (uses profile workspace if not provided)',
|
|
40
|
+
required: false,
|
|
41
|
+
}),
|
|
45
42
|
};
|
|
46
43
|
async run() {
|
|
47
|
-
const {
|
|
44
|
+
const { flags } = await this.parse(WorkspaceDelete);
|
|
48
45
|
// Get profile name (default or from flag/env)
|
|
49
46
|
const profileName = flags.profile || this.getDefaultProfile();
|
|
50
47
|
// Load credentials
|
|
@@ -62,7 +59,12 @@ Deleted workspace 123
|
|
|
62
59
|
if (!profile.access_token) {
|
|
63
60
|
this.error(`Profile '${profileName}' is missing access_token`);
|
|
64
61
|
}
|
|
65
|
-
|
|
62
|
+
// Get workspace ID from flag or profile
|
|
63
|
+
const workspaceId = flags.workspace || profile.workspace;
|
|
64
|
+
if (!workspaceId) {
|
|
65
|
+
this.error('No workspace ID provided. Use -w flag or set one in your profile.\n' +
|
|
66
|
+
'Usage: xano workspace delete -w <workspace_id>');
|
|
67
|
+
}
|
|
66
68
|
// Confirmation prompt unless --force is used
|
|
67
69
|
if (!flags.force) {
|
|
68
70
|
const confirmed = await this.confirm(`Are you sure you want to delete workspace ${workspaceId}? This action cannot be undone.`);
|
|
@@ -118,8 +120,7 @@ Deleted workspace 123
|
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
122
|
loadCredentials() {
|
|
121
|
-
const
|
|
122
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
123
|
+
const credentialsPath = this.getCredentialsPath();
|
|
123
124
|
// Check if credentials file exists
|
|
124
125
|
if (!fs.existsSync(credentialsPath)) {
|
|
125
126
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import BaseCommand from '../../../base-command.js';
|
|
2
2
|
export default class WorkspaceEdit extends BaseCommand {
|
|
3
|
-
static args: {
|
|
4
|
-
workspace_id: import("@oclif/core/interfaces").Arg<number | undefined, {
|
|
5
|
-
max?: number;
|
|
6
|
-
min?: number;
|
|
7
|
-
}>;
|
|
8
|
-
};
|
|
9
3
|
static description: string;
|
|
10
4
|
static examples: string[];
|
|
11
5
|
static flags: {
|
|
6
|
+
'allow-push': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
7
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
8
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
9
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
10
|
'require-token': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
11
|
swagger: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
14
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
15
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
16
|
};
|
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class WorkspaceEdit extends BaseCommand {
|
|
8
|
-
static args = {
|
|
9
|
-
workspace_id: Args.integer({
|
|
10
|
-
description: 'Workspace ID to edit (uses profile workspace if not provided)',
|
|
11
|
-
required: false,
|
|
12
|
-
}),
|
|
13
|
-
};
|
|
14
6
|
static description = 'Edit an existing workspace via the Xano Metadata API';
|
|
15
7
|
static examples = [
|
|
16
|
-
`$ xano workspace edit 123 --name "new-name"
|
|
8
|
+
`$ xano workspace edit -w 123 --name "new-name"
|
|
17
9
|
Updated workspace: new-name (ID: 123)
|
|
18
10
|
`,
|
|
19
11
|
`$ xano workspace edit --name "updated-workspace" --description "Updated description"
|
|
20
12
|
Updated workspace: updated-workspace (ID: 123)
|
|
21
13
|
Description: Updated description
|
|
22
14
|
`,
|
|
23
|
-
`$ xano workspace edit 123 --swagger --require-token
|
|
15
|
+
`$ xano workspace edit -w 123 --swagger --require-token
|
|
24
16
|
Updated workspace: my-workspace (ID: 123)
|
|
25
17
|
Swagger: enabled
|
|
26
18
|
Require Token: true
|
|
27
19
|
`,
|
|
28
|
-
`$ xano workspace edit 123 --no-swagger -o json
|
|
20
|
+
`$ xano workspace edit -w 123 --no-swagger -o json
|
|
29
21
|
{
|
|
30
22
|
"id": 123,
|
|
31
23
|
"name": "my-workspace",
|
|
@@ -35,6 +27,11 @@ Updated workspace: my-workspace (ID: 123)
|
|
|
35
27
|
];
|
|
36
28
|
static flags = {
|
|
37
29
|
...BaseCommand.baseFlags,
|
|
30
|
+
'allow-push': Flags.boolean({
|
|
31
|
+
allowNo: true,
|
|
32
|
+
description: 'Enable or disable direct CLI push to this workspace (not applicable on Free plan)',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
38
35
|
description: Flags.string({
|
|
39
36
|
char: 'd',
|
|
40
37
|
description: 'New description for the workspace',
|
|
@@ -62,9 +59,14 @@ Updated workspace: my-workspace (ID: 123)
|
|
|
62
59
|
description: 'Enable or disable swagger documentation',
|
|
63
60
|
required: false,
|
|
64
61
|
}),
|
|
62
|
+
workspace: Flags.string({
|
|
63
|
+
char: 'w',
|
|
64
|
+
description: 'Workspace ID (uses profile workspace if not provided)',
|
|
65
|
+
required: false,
|
|
66
|
+
}),
|
|
65
67
|
};
|
|
66
68
|
async run() {
|
|
67
|
-
const {
|
|
69
|
+
const { flags } = await this.parse(WorkspaceEdit);
|
|
68
70
|
// Get profile name (default or from flag/env)
|
|
69
71
|
const profileName = flags.profile || this.getDefaultProfile();
|
|
70
72
|
// Load credentials
|
|
@@ -82,11 +84,11 @@ Updated workspace: my-workspace (ID: 123)
|
|
|
82
84
|
if (!profile.access_token) {
|
|
83
85
|
this.error(`Profile '${profileName}' is missing access_token`);
|
|
84
86
|
}
|
|
85
|
-
// Get workspace ID from
|
|
86
|
-
const workspaceId =
|
|
87
|
+
// Get workspace ID from flag or profile
|
|
88
|
+
const workspaceId = flags.workspace || profile.workspace;
|
|
87
89
|
if (!workspaceId) {
|
|
88
|
-
this.error('No workspace ID provided.
|
|
89
|
-
'Usage: xano workspace edit <workspace_id> [flags]');
|
|
90
|
+
this.error('No workspace ID provided. Use -w flag or set one in your profile.\n' +
|
|
91
|
+
'Usage: xano workspace edit -w <workspace_id> [flags]');
|
|
90
92
|
}
|
|
91
93
|
// Build request body - only include fields that were specified
|
|
92
94
|
const body = {};
|
|
@@ -102,9 +104,12 @@ Updated workspace: my-workspace (ID: 123)
|
|
|
102
104
|
if (flags['require-token'] !== undefined) {
|
|
103
105
|
body.documentation = { require_token: flags['require-token'] };
|
|
104
106
|
}
|
|
107
|
+
if (flags['allow-push'] !== undefined) {
|
|
108
|
+
body.preferences = { allow_push: flags['allow-push'] };
|
|
109
|
+
}
|
|
105
110
|
// Check if at least one field is being updated
|
|
106
111
|
if (Object.keys(body).length === 0) {
|
|
107
|
-
this.error('No fields specified to update. Use --name, --description, --swagger,
|
|
112
|
+
this.error('No fields specified to update. Use --name, --description, --swagger, --require-token, or --allow-push flags.\n' +
|
|
108
113
|
'Example: xano workspace edit 123 --name "new-name"');
|
|
109
114
|
}
|
|
110
115
|
// Construct the API URL
|
|
@@ -114,8 +119,8 @@ Updated workspace: my-workspace (ID: 123)
|
|
|
114
119
|
const response = await this.verboseFetch(apiUrl, {
|
|
115
120
|
body: JSON.stringify(body),
|
|
116
121
|
headers: {
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
accept: 'application/json',
|
|
123
|
+
Authorization: `Bearer ${profile.access_token}`,
|
|
119
124
|
'Content-Type': 'application/json',
|
|
120
125
|
},
|
|
121
126
|
method: 'PUT',
|
|
@@ -124,7 +129,7 @@ Updated workspace: my-workspace (ID: 123)
|
|
|
124
129
|
const errorText = await response.text();
|
|
125
130
|
this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
|
|
126
131
|
}
|
|
127
|
-
const workspace = await response.json();
|
|
132
|
+
const workspace = (await response.json());
|
|
128
133
|
// Output results
|
|
129
134
|
if (flags.output === 'json') {
|
|
130
135
|
this.log(JSON.stringify(workspace, null, 2));
|
|
@@ -141,6 +146,9 @@ Updated workspace: my-workspace (ID: 123)
|
|
|
141
146
|
if (workspace.documentation?.require_token !== undefined) {
|
|
142
147
|
this.log(` Require Token: ${workspace.documentation.require_token}`);
|
|
143
148
|
}
|
|
149
|
+
if (workspace.preferences?.allow_push !== undefined) {
|
|
150
|
+
this.log(` Allow Push: ${workspace.preferences.allow_push}`);
|
|
151
|
+
}
|
|
144
152
|
}
|
|
145
153
|
}
|
|
146
154
|
catch (error) {
|
|
@@ -153,12 +161,10 @@ Updated workspace: my-workspace (ID: 123)
|
|
|
153
161
|
}
|
|
154
162
|
}
|
|
155
163
|
loadCredentials() {
|
|
156
|
-
const
|
|
157
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
164
|
+
const credentialsPath = this.getCredentialsPath();
|
|
158
165
|
// Check if credentials file exists
|
|
159
166
|
if (!fs.existsSync(credentialsPath)) {
|
|
160
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
161
|
-
`Create a profile using 'xano profile create'`);
|
|
167
|
+
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
162
168
|
}
|
|
163
169
|
// Read credentials file
|
|
164
170
|
try {
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import BaseCommand from '../../../base-command.js';
|
|
2
2
|
export default class WorkspaceGet extends BaseCommand {
|
|
3
|
-
static args: {
|
|
4
|
-
workspace_id: import("@oclif/core/interfaces").Arg<number | undefined, {
|
|
5
|
-
max?: number;
|
|
6
|
-
min?: number;
|
|
7
|
-
}>;
|
|
8
|
-
};
|
|
9
3
|
static description: string;
|
|
10
4
|
static examples: string[];
|
|
11
5
|
static flags: {
|
|
12
6
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
9
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
10
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
11
|
};
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import * as os from 'node:os';
|
|
5
|
-
import * as path from 'node:path';
|
|
6
4
|
import BaseCommand from '../../../base-command.js';
|
|
7
5
|
export default class WorkspaceGet extends BaseCommand {
|
|
8
|
-
static args = {
|
|
9
|
-
workspace_id: Args.integer({
|
|
10
|
-
description: 'Workspace ID to get details for (uses profile workspace if not provided)',
|
|
11
|
-
required: false,
|
|
12
|
-
}),
|
|
13
|
-
};
|
|
14
6
|
static description = 'Get details of a specific workspace from the Xano Metadata API';
|
|
15
7
|
static examples = [
|
|
16
|
-
`$ xano workspace get 123
|
|
8
|
+
`$ xano workspace get -w 123
|
|
17
9
|
Workspace: my-workspace (ID: 123)
|
|
18
10
|
Description: My workspace description
|
|
19
11
|
Created: 2024-01-15
|
|
@@ -25,7 +17,7 @@ Workspace: my-workspace (ID: 123)
|
|
|
25
17
|
"description": "My workspace description"
|
|
26
18
|
}
|
|
27
19
|
`,
|
|
28
|
-
`$ xano workspace get 456 -p production -o json
|
|
20
|
+
`$ xano workspace get -w 456 -p production -o json
|
|
29
21
|
{
|
|
30
22
|
"id": 456,
|
|
31
23
|
"name": "production-workspace"
|
|
@@ -41,9 +33,14 @@ Workspace: my-workspace (ID: 123)
|
|
|
41
33
|
options: ['summary', 'json'],
|
|
42
34
|
required: false,
|
|
43
35
|
}),
|
|
36
|
+
workspace: Flags.string({
|
|
37
|
+
char: 'w',
|
|
38
|
+
description: 'Workspace ID (uses profile workspace if not provided)',
|
|
39
|
+
required: false,
|
|
40
|
+
}),
|
|
44
41
|
};
|
|
45
42
|
async run() {
|
|
46
|
-
const {
|
|
43
|
+
const { flags } = await this.parse(WorkspaceGet);
|
|
47
44
|
// Get profile name (default or from flag/env)
|
|
48
45
|
const profileName = flags.profile || this.getDefaultProfile();
|
|
49
46
|
// Load credentials
|
|
@@ -61,11 +58,11 @@ Workspace: my-workspace (ID: 123)
|
|
|
61
58
|
if (!profile.access_token) {
|
|
62
59
|
this.error(`Profile '${profileName}' is missing access_token`);
|
|
63
60
|
}
|
|
64
|
-
// Get workspace ID from
|
|
65
|
-
const workspaceId =
|
|
61
|
+
// Get workspace ID from flag or profile
|
|
62
|
+
const workspaceId = flags.workspace || profile.workspace;
|
|
66
63
|
if (!workspaceId) {
|
|
67
|
-
this.error('No workspace ID provided.
|
|
68
|
-
'Usage: xano workspace get <workspace_id>');
|
|
64
|
+
this.error('No workspace ID provided. Use -w flag or set one in your profile.\n' +
|
|
65
|
+
'Usage: xano workspace get -w <workspace_id>');
|
|
69
66
|
}
|
|
70
67
|
// Construct the API URL
|
|
71
68
|
const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}`;
|
|
@@ -73,8 +70,8 @@ Workspace: my-workspace (ID: 123)
|
|
|
73
70
|
try {
|
|
74
71
|
const response = await this.verboseFetch(apiUrl, {
|
|
75
72
|
headers: {
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
accept: 'application/json',
|
|
74
|
+
Authorization: `Bearer ${profile.access_token}`,
|
|
78
75
|
},
|
|
79
76
|
method: 'GET',
|
|
80
77
|
}, flags.verbose, profile.access_token);
|
|
@@ -82,7 +79,7 @@ Workspace: my-workspace (ID: 123)
|
|
|
82
79
|
const errorText = await response.text();
|
|
83
80
|
this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
|
|
84
81
|
}
|
|
85
|
-
const workspace = await response.json();
|
|
82
|
+
const workspace = (await response.json());
|
|
86
83
|
// Output results
|
|
87
84
|
if (flags.output === 'json') {
|
|
88
85
|
this.log(JSON.stringify(workspace, null, 2));
|
|
@@ -94,13 +91,16 @@ Workspace: my-workspace (ID: 123)
|
|
|
94
91
|
this.log(` Description: ${workspace.description}`);
|
|
95
92
|
}
|
|
96
93
|
if (workspace.created_at) {
|
|
97
|
-
const createdDate = new Date(workspace.created_at
|
|
94
|
+
const createdDate = new Date(workspace.created_at).toISOString().split('T')[0];
|
|
98
95
|
this.log(` Created: ${createdDate}`);
|
|
99
96
|
}
|
|
100
97
|
if (workspace.updated_at) {
|
|
101
|
-
const updatedDate = new Date(workspace.updated_at
|
|
98
|
+
const updatedDate = new Date(workspace.updated_at).toISOString().split('T')[0];
|
|
102
99
|
this.log(` Updated: ${updatedDate}`);
|
|
103
100
|
}
|
|
101
|
+
if (workspace.preferences?.allow_push !== undefined) {
|
|
102
|
+
this.log(` Allow Push: ${workspace.preferences.allow_push}`);
|
|
103
|
+
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
catch (error) {
|
|
@@ -113,12 +113,10 @@ Workspace: my-workspace (ID: 123)
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
loadCredentials() {
|
|
116
|
-
const
|
|
117
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
116
|
+
const credentialsPath = this.getCredentialsPath();
|
|
118
117
|
// Check if credentials file exists
|
|
119
118
|
if (!fs.existsSync(credentialsPath)) {
|
|
120
|
-
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
121
|
-
`Create a profile using 'xano profile create'`);
|
|
119
|
+
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
122
120
|
}
|
|
123
121
|
// Read credentials file
|
|
124
122
|
try {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import BaseCommand from '../../../../base-command.js';
|
|
2
2
|
export default class GitPull extends BaseCommand {
|
|
3
|
-
static args: {
|
|
4
|
-
directory: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
-
};
|
|
6
3
|
static description: string;
|
|
7
4
|
static examples: string[];
|
|
8
5
|
static flags: {
|
|
9
6
|
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
8
|
path: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
9
|
repo: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
10
|
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
12
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
13
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
14
|
};
|