@xano/cli 0.0.95-beta.9 → 1.0.0
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 +111 -70
- package/dist/base-command.d.ts +16 -1
- package/dist/base-command.js +57 -5
- package/dist/commands/auth/index.d.ts +1 -0
- package/dist/commands/auth/index.js +15 -10
- 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 +10 -4
- 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 +1 -4
- 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 +1 -4
- 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 +13 -9
- 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 +1 -3
- 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 +3 -0
- package/dist/commands/release/deploy/index.js +31 -1
- 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 +1 -0
- package/dist/commands/sandbox/env/delete/index.js +4 -2
- package/dist/commands/sandbox/env/get/index.d.ts +1 -0
- package/dist/commands/sandbox/env/get/index.js +4 -2
- package/dist/commands/sandbox/env/get_all/index.d.ts +1 -0
- package/dist/commands/sandbox/env/get_all/index.js +4 -2
- package/dist/commands/sandbox/env/list/index.d.ts +1 -0
- package/dist/commands/sandbox/env/list/index.js +4 -2
- package/dist/commands/sandbox/env/set/index.d.ts +1 -0
- package/dist/commands/sandbox/env/set/index.js +4 -2
- package/dist/commands/sandbox/env/set_all/index.d.ts +1 -0
- package/dist/commands/sandbox/env/set_all/index.js +4 -2
- package/dist/commands/sandbox/get/index.d.ts +1 -0
- package/dist/commands/sandbox/get/index.js +2 -0
- package/dist/commands/sandbox/license/get/index.d.ts +1 -0
- package/dist/commands/sandbox/license/get/index.js +4 -2
- package/dist/commands/sandbox/license/set/index.d.ts +1 -0
- package/dist/commands/sandbox/license/set/index.js +4 -2
- package/dist/commands/sandbox/pull/index.d.ts +2 -3
- package/dist/commands/sandbox/pull/index.js +19 -14
- package/dist/commands/sandbox/push/index.d.ts +12 -4
- package/dist/commands/sandbox/push/index.js +150 -95
- package/dist/commands/sandbox/reset/index.d.ts +1 -0
- package/dist/commands/sandbox/reset/index.js +4 -2
- package/dist/commands/sandbox/review/index.d.ts +1 -0
- package/dist/commands/sandbox/review/index.js +4 -2
- package/dist/commands/sandbox/unit_test/list/index.d.ts +1 -0
- package/dist/commands/sandbox/unit_test/list/index.js +4 -2
- package/dist/commands/sandbox/unit_test/run/index.d.ts +1 -0
- package/dist/commands/sandbox/unit_test/run/index.js +4 -2
- package/dist/commands/sandbox/unit_test/run_all/index.d.ts +1 -0
- package/dist/commands/sandbox/unit_test/run_all/index.js +4 -0
- package/dist/commands/sandbox/workflow_test/list/index.d.ts +1 -0
- package/dist/commands/sandbox/workflow_test/list/index.js +4 -2
- package/dist/commands/sandbox/workflow_test/run/index.d.ts +1 -0
- package/dist/commands/sandbox/workflow_test/run/index.js +4 -2
- package/dist/commands/sandbox/workflow_test/run_all/index.d.ts +1 -0
- package/dist/commands/sandbox/workflow_test/run_all/index.js +4 -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 -0
- package/dist/commands/tenant/create/index.js +1 -3
- 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 +1 -4
- 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 +1 -4
- 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 -225
- package/dist/commands/tenant/unit_test/list/index.d.ts +1 -0
- package/dist/commands/tenant/unit_test/list/index.js +2 -27
- package/dist/commands/tenant/unit_test/run/index.d.ts +1 -0
- package/dist/commands/tenant/unit_test/run/index.js +2 -27
- package/dist/commands/tenant/unit_test/run_all/index.d.ts +1 -0
- package/dist/commands/tenant/unit_test/run_all/index.js +2 -27
- package/dist/commands/tenant/workflow_test/list/index.d.ts +1 -0
- package/dist/commands/tenant/workflow_test/list/index.js +2 -27
- package/dist/commands/tenant/workflow_test/run/index.d.ts +1 -0
- package/dist/commands/tenant/workflow_test/run/index.js +2 -27
- package/dist/commands/tenant/workflow_test/run_all/index.d.ts +1 -0
- package/dist/commands/tenant/workflow_test/run_all/index.js +2 -27
- 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 +2 -6
- package/dist/commands/workspace/edit/index.js +16 -20
- package/dist/commands/workspace/get/index.d.ts +2 -6
- package/dist/commands/workspace/get/index.js +14 -18
- 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 +1 -0
- package/dist/commands/workspace/list/index.js +1 -4
- 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 -700
- 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 +3562 -2647
- package/package.json +1 -1
- package/dist/commands/sandbox/workflow_test/delete/index.d.ts +0 -17
- package/dist/commands/sandbox/workflow_test/delete/index.js +0 -59
- package/dist/commands/sandbox/workflow_test/get/index.d.ts +0 -17
- package/dist/commands/sandbox/workflow_test/get/index.js +0 -58
- package/dist/commands/tenant/workflow_test/delete/index.d.ts +0 -19
- package/dist/commands/tenant/workflow_test/delete/index.js +0 -110
- package/dist/commands/tenant/workflow_test/get/index.d.ts +0 -19
- package/dist/commands/tenant/workflow_test/get/index.js +0 -112
|
@@ -8,6 +8,7 @@ export default class BranchGet extends BaseCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
workspace: import("@oclif/core/interfaces").OptionFlag<number | undefined, 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 BranchGet extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -112,8 +110,7 @@ Branch: dev
|
|
|
112
110
|
}
|
|
113
111
|
}
|
|
114
112
|
loadCredentials() {
|
|
115
|
-
const
|
|
116
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
113
|
+
const credentialsPath = this.getCredentialsPath();
|
|
117
114
|
// Check if credentials file exists
|
|
118
115
|
if (!fs.existsSync(credentialsPath)) {
|
|
119
116
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import BaseCommand from '../../../base-command.js';
|
|
2
2
|
export default class BranchList 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,16 +1,8 @@
|
|
|
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 BranchList extends BaseCommand {
|
|
8
|
-
static args = {
|
|
9
|
-
workspace_id: Args.integer({
|
|
10
|
-
description: 'Workspace ID (uses profile workspace if not provided)',
|
|
11
|
-
required: false,
|
|
12
|
-
}),
|
|
13
|
-
};
|
|
14
6
|
static description = 'List all branches in a workspace';
|
|
15
7
|
static examples = [
|
|
16
8
|
`$ xano branch list
|
|
@@ -19,7 +11,7 @@ Available branches:
|
|
|
19
11
|
- dev
|
|
20
12
|
- staging
|
|
21
13
|
`,
|
|
22
|
-
`$ xano branch list 123
|
|
14
|
+
`$ xano branch list -w 123
|
|
23
15
|
Available branches:
|
|
24
16
|
- v1 (live)
|
|
25
17
|
- feature-auth
|
|
@@ -44,9 +36,14 @@ Available branches:
|
|
|
44
36
|
options: ['summary', 'json'],
|
|
45
37
|
required: false,
|
|
46
38
|
}),
|
|
39
|
+
workspace: Flags.string({
|
|
40
|
+
char: 'w',
|
|
41
|
+
description: 'Workspace ID (uses profile workspace if not provided)',
|
|
42
|
+
required: false,
|
|
43
|
+
}),
|
|
47
44
|
};
|
|
48
45
|
async run() {
|
|
49
|
-
const {
|
|
46
|
+
const { flags } = await this.parse(BranchList);
|
|
50
47
|
// Get profile name (default or from flag/env)
|
|
51
48
|
const profileName = flags.profile || this.getDefaultProfile();
|
|
52
49
|
// Load credentials
|
|
@@ -64,11 +61,11 @@ Available branches:
|
|
|
64
61
|
if (!profile.access_token) {
|
|
65
62
|
this.error(`Profile '${profileName}' is missing access_token`);
|
|
66
63
|
}
|
|
67
|
-
// Get workspace ID from
|
|
68
|
-
const workspaceId =
|
|
64
|
+
// Get workspace ID from flag or profile
|
|
65
|
+
const workspaceId = flags.workspace || profile.workspace;
|
|
69
66
|
if (!workspaceId) {
|
|
70
|
-
this.error('No workspace ID provided.
|
|
71
|
-
'Usage: xano branch list
|
|
67
|
+
this.error('No workspace ID provided. Use -w flag or set one in your profile.\n' +
|
|
68
|
+
'Usage: xano branch list -w <workspace_id>');
|
|
72
69
|
}
|
|
73
70
|
// Construct the API URL
|
|
74
71
|
const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/branch`;
|
|
@@ -115,8 +112,7 @@ Available branches:
|
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
114
|
loadCredentials() {
|
|
118
|
-
const
|
|
119
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
115
|
+
const credentialsPath = this.getCredentialsPath();
|
|
120
116
|
// Check if credentials file exists
|
|
121
117
|
if (!fs.existsSync(credentialsPath)) {
|
|
122
118
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
@@ -9,6 +9,7 @@ export default class BranchSetLive extends BaseCommand {
|
|
|
9
9
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
workspace: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
};
|
|
@@ -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 BranchSetLive extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -132,8 +130,7 @@ Branch 'v1' is now live
|
|
|
132
130
|
});
|
|
133
131
|
}
|
|
134
132
|
loadCredentials() {
|
|
135
|
-
const
|
|
136
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
133
|
+
const credentialsPath = this.getCredentialsPath();
|
|
137
134
|
// Check if credentials file exists
|
|
138
135
|
if (!fs.existsSync(credentialsPath)) {
|
|
139
136
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
@@ -9,6 +9,7 @@ export default class FunctionCreate extends BaseCommand {
|
|
|
9
9
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
stdin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
};
|
|
@@ -241,8 +241,7 @@ Name: my_function
|
|
|
241
241
|
return tmpFile;
|
|
242
242
|
}
|
|
243
243
|
loadCredentials() {
|
|
244
|
-
const
|
|
245
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
244
|
+
const credentialsPath = this.getCredentialsPath();
|
|
246
245
|
// Check if credentials file exists
|
|
247
246
|
if (!fs.existsSync(credentialsPath)) {
|
|
248
247
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
@@ -12,6 +12,7 @@ export default class FunctionEdit extends BaseCommand {
|
|
|
12
12
|
publish: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
stdin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
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
|
};
|
|
@@ -369,8 +369,7 @@ Name: my_function
|
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
loadCredentials() {
|
|
372
|
-
const
|
|
373
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
372
|
+
const credentialsPath = this.getCredentialsPath();
|
|
374
373
|
// Check if credentials file exists
|
|
375
374
|
if (!fs.existsSync(credentialsPath)) {
|
|
376
375
|
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile:create'`);
|
|
@@ -10,6 +10,7 @@ export default class FunctionGet extends BaseCommand {
|
|
|
10
10
|
include_xanoscript: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
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>;
|
|
13
14
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
};
|
|
@@ -2,8 +2,6 @@ import { Args, Flags } from '@oclif/core';
|
|
|
2
2
|
import inquirer from 'inquirer';
|
|
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, { buildUserAgent } from '../../../base-command.js';
|
|
8
6
|
export default class FunctionGet extends BaseCommand {
|
|
9
7
|
static args = {
|
|
@@ -185,8 +183,7 @@ function yo {
|
|
|
185
183
|
}
|
|
186
184
|
}
|
|
187
185
|
loadCredentials() {
|
|
188
|
-
const
|
|
189
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
186
|
+
const credentialsPath = this.getCredentialsPath();
|
|
190
187
|
// Check if credentials file exists
|
|
191
188
|
if (!fs.existsSync(credentialsPath)) {
|
|
192
189
|
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile:create'`);
|
|
@@ -12,6 +12,7 @@ export default class FunctionList extends BaseCommand {
|
|
|
12
12
|
per_page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
sort: 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 { 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 FunctionList extends BaseCommand {
|
|
8
6
|
static args = {};
|
|
@@ -185,8 +183,7 @@ Available functions:
|
|
|
185
183
|
}
|
|
186
184
|
}
|
|
187
185
|
loadCredentials() {
|
|
188
|
-
const
|
|
189
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
186
|
+
const credentialsPath = this.getCredentialsPath();
|
|
190
187
|
// Check if credentials file exists
|
|
191
188
|
if (!fs.existsSync(credentialsPath)) {
|
|
192
189
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
@@ -10,6 +10,7 @@ export default class PlatformGet extends BaseCommand {
|
|
|
10
10
|
static examples: string[];
|
|
11
11
|
static flags: {
|
|
12
12
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
};
|
|
@@ -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 PlatformGet extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -105,8 +103,7 @@ Platform ID: 23629
|
|
|
105
103
|
}
|
|
106
104
|
}
|
|
107
105
|
loadCredentials() {
|
|
108
|
-
const
|
|
109
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
106
|
+
const credentialsPath = this.getCredentialsPath();
|
|
110
107
|
if (!fs.existsSync(credentialsPath)) {
|
|
111
108
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
112
109
|
`Create a profile using 'xano profile create'`);
|
|
@@ -4,6 +4,7 @@ export default class PlatformList extends BaseCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
8
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
};
|
|
@@ -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 PlatformList extends BaseCommand {
|
|
8
6
|
static description = 'List all platforms';
|
|
@@ -92,8 +90,7 @@ Platforms:
|
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
loadCredentials() {
|
|
95
|
-
const
|
|
96
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
93
|
+
const credentialsPath = this.getCredentialsPath();
|
|
97
94
|
if (!fs.existsSync(credentialsPath)) {
|
|
98
95
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
99
96
|
`Create a profile using 'xano profile create'`);
|
|
@@ -6,6 +6,7 @@ export default class ProfileCreate extends Command {
|
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
access_token: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
account_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Args, Command, 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
4
|
import * as path from 'node:path';
|
|
5
|
+
import { resolveCredentialsPath } from '../../../base-command.js';
|
|
6
6
|
export default class ProfileCreate extends Command {
|
|
7
7
|
static args = {
|
|
8
8
|
name: Args.string({
|
|
@@ -30,6 +30,12 @@ Profile 'selfhosted' created successfully at ~/.xano/credentials.yaml
|
|
|
30
30
|
`,
|
|
31
31
|
];
|
|
32
32
|
static flags = {
|
|
33
|
+
config: Flags.string({
|
|
34
|
+
char: 'c',
|
|
35
|
+
description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
|
|
36
|
+
env: 'XANO_CONFIG',
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
33
39
|
access_token: Flags.string({
|
|
34
40
|
char: 't',
|
|
35
41
|
description: 'Access token for the Xano Metadata API',
|
|
@@ -69,9 +75,9 @@ Profile 'selfhosted' created successfully at ~/.xano/credentials.yaml
|
|
|
69
75
|
};
|
|
70
76
|
async run() {
|
|
71
77
|
const { args, flags } = await this.parse(ProfileCreate);
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
// Ensure the
|
|
78
|
+
const credentialsPath = resolveCredentialsPath(flags.config);
|
|
79
|
+
const configDir = path.dirname(credentialsPath);
|
|
80
|
+
// Ensure the directory exists
|
|
75
81
|
if (!fs.existsSync(configDir)) {
|
|
76
82
|
fs.mkdirSync(configDir, { recursive: true });
|
|
77
83
|
this.log(`Created directory: ${configDir}`);
|
|
@@ -6,6 +6,7 @@ export default class ProfileDelete extends Command {
|
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
};
|
|
11
12
|
run(): Promise<void>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import
|
|
5
|
-
import * as path from 'node:path';
|
|
4
|
+
import { resolveCredentialsPath } from '../../../base-command.js';
|
|
6
5
|
export default class ProfileDelete extends Command {
|
|
7
6
|
static args = {
|
|
8
7
|
name: Args.string({
|
|
@@ -24,6 +23,12 @@ Profile 'old-profile' deleted successfully from ~/.xano/credentials.yaml
|
|
|
24
23
|
`,
|
|
25
24
|
];
|
|
26
25
|
static flags = {
|
|
26
|
+
config: Flags.string({
|
|
27
|
+
char: 'c',
|
|
28
|
+
description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
|
|
29
|
+
env: 'XANO_CONFIG',
|
|
30
|
+
required: false,
|
|
31
|
+
}),
|
|
27
32
|
force: Flags.boolean({
|
|
28
33
|
char: 'f',
|
|
29
34
|
default: false,
|
|
@@ -33,8 +38,7 @@ Profile 'old-profile' deleted successfully from ~/.xano/credentials.yaml
|
|
|
33
38
|
};
|
|
34
39
|
async run() {
|
|
35
40
|
const { args, flags } = await this.parse(ProfileDelete);
|
|
36
|
-
const
|
|
37
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
41
|
+
const credentialsPath = resolveCredentialsPath(flags.config);
|
|
38
42
|
// Check if credentials file exists
|
|
39
43
|
if (!fs.existsSync(credentialsPath)) {
|
|
40
44
|
this.error(`Credentials file not found at ${credentialsPath}. No profiles to delete.`);
|
|
@@ -15,6 +15,7 @@ export default class ProfileEdit extends BaseCommand {
|
|
|
15
15
|
'remove-insecure': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
16
|
'remove-workspace': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
17
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
19
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
21
|
};
|
|
@@ -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 ProfileEdit extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -87,8 +85,7 @@ Profile 'default' updated successfully at ~/.xano/credentials.yaml
|
|
|
87
85
|
const { args, flags } = await this.parse(ProfileEdit);
|
|
88
86
|
// Use provided name or default profile
|
|
89
87
|
const profileName = args.name || this.getDefaultProfile();
|
|
90
|
-
const
|
|
91
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
88
|
+
const credentialsPath = this.getCredentialsPath();
|
|
92
89
|
// Check if credentials file exists
|
|
93
90
|
if (!fs.existsSync(credentialsPath)) {
|
|
94
91
|
this.error(`Credentials file not found at ${credentialsPath}. Create a profile first using 'profile:create'.`);
|
|
@@ -2,5 +2,8 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
export default class ProfileGet extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
};
|
|
5
8
|
run(): Promise<void>;
|
|
6
9
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import
|
|
5
|
-
import * as path from 'node:path';
|
|
4
|
+
import { resolveCredentialsPath } from '../../../base-command.js';
|
|
6
5
|
export default class ProfileGet extends Command {
|
|
7
6
|
static description = 'Get the current default profile name';
|
|
8
7
|
static examples = [
|
|
@@ -10,9 +9,17 @@ export default class ProfileGet extends Command {
|
|
|
10
9
|
production
|
|
11
10
|
`,
|
|
12
11
|
];
|
|
12
|
+
static flags = {
|
|
13
|
+
config: Flags.string({
|
|
14
|
+
char: 'c',
|
|
15
|
+
description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
|
|
16
|
+
env: 'XANO_CONFIG',
|
|
17
|
+
required: false,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
13
20
|
async run() {
|
|
14
|
-
const
|
|
15
|
-
const credentialsPath =
|
|
21
|
+
const { flags } = await this.parse(ProfileGet);
|
|
22
|
+
const credentialsPath = resolveCredentialsPath(flags.config);
|
|
16
23
|
if (!fs.existsSync(credentialsPath)) {
|
|
17
24
|
this.error(`Credentials file not found at ${credentialsPath}. No profiles exist.`);
|
|
18
25
|
}
|
|
@@ -3,6 +3,7 @@ export default class ProfileList extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
7
|
details: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
};
|
|
8
9
|
run(): Promise<void>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Command, Flags, ux } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import
|
|
5
|
-
import * as path from 'node:path';
|
|
4
|
+
import { resolveCredentialsPath } from '../../../base-command.js';
|
|
6
5
|
export default class ProfileList extends Command {
|
|
7
6
|
static description = 'List all available profile configurations';
|
|
8
7
|
static examples = [
|
|
@@ -42,6 +41,12 @@ Profile: default
|
|
|
42
41
|
`,
|
|
43
42
|
];
|
|
44
43
|
static flags = {
|
|
44
|
+
config: Flags.string({
|
|
45
|
+
char: 'c',
|
|
46
|
+
description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
|
|
47
|
+
env: 'XANO_CONFIG',
|
|
48
|
+
required: false,
|
|
49
|
+
}),
|
|
45
50
|
details: Flags.boolean({
|
|
46
51
|
char: 'd',
|
|
47
52
|
default: false,
|
|
@@ -51,8 +56,7 @@ Profile: default
|
|
|
51
56
|
};
|
|
52
57
|
async run() {
|
|
53
58
|
const { flags } = await this.parse(ProfileList);
|
|
54
|
-
const
|
|
55
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
59
|
+
const credentialsPath = resolveCredentialsPath(flags.config);
|
|
56
60
|
// Check if credentials file exists
|
|
57
61
|
if (!fs.existsSync(credentialsPath)) {
|
|
58
62
|
this.log(`No profiles found. The credentials file does not exist at ${credentialsPath}`);
|
|
@@ -4,6 +4,7 @@ export default class ProfileMe extends BaseCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
8
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
};
|
|
@@ -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 ProfileMe extends BaseCommand {
|
|
8
6
|
static description = 'Get information about the currently authenticated user';
|
|
@@ -170,8 +168,7 @@ User Information:
|
|
|
170
168
|
.join(' ');
|
|
171
169
|
}
|
|
172
170
|
loadCredentials() {
|
|
173
|
-
const
|
|
174
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
171
|
+
const credentialsPath = this.getCredentialsPath();
|
|
175
172
|
// Check if credentials file exists
|
|
176
173
|
if (!fs.existsSync(credentialsPath)) {
|
|
177
174
|
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile:create'`);
|
|
@@ -5,5 +5,8 @@ export default class ProfileSet extends Command {
|
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
8
11
|
run(): Promise<void>;
|
|
9
12
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Args, Command } from '@oclif/core';
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import
|
|
5
|
-
import * as path from 'node:path';
|
|
4
|
+
import { resolveCredentialsPath } from '../../../base-command.js';
|
|
6
5
|
export default class ProfileSet extends Command {
|
|
7
6
|
static args = {
|
|
8
7
|
name: Args.string({
|
|
@@ -16,10 +15,17 @@ export default class ProfileSet extends Command {
|
|
|
16
15
|
Default profile set to 'production'
|
|
17
16
|
`,
|
|
18
17
|
];
|
|
18
|
+
static flags = {
|
|
19
|
+
config: Flags.string({
|
|
20
|
+
char: 'c',
|
|
21
|
+
description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
|
|
22
|
+
env: 'XANO_CONFIG',
|
|
23
|
+
required: false,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
19
26
|
async run() {
|
|
20
|
-
const { args } = await this.parse(ProfileSet);
|
|
21
|
-
const
|
|
22
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
27
|
+
const { args, flags } = await this.parse(ProfileSet);
|
|
28
|
+
const credentialsPath = resolveCredentialsPath(flags.config);
|
|
23
29
|
if (!fs.existsSync(credentialsPath)) {
|
|
24
30
|
this.error(`Credentials file not found at ${credentialsPath}. Create a profile first using 'profile:create'.`);
|
|
25
31
|
}
|
|
@@ -2,5 +2,8 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
export default class ProfileToken extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
};
|
|
5
8
|
run(): Promise<void>;
|
|
6
9
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import * as yaml from 'js-yaml';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
|
-
import
|
|
5
|
-
import * as path from 'node:path';
|
|
4
|
+
import { resolveCredentialsPath } from '../../../base-command.js';
|
|
6
5
|
export default class ProfileToken extends Command {
|
|
7
6
|
static description = 'Print the access token for the default profile';
|
|
8
7
|
static examples = [
|
|
@@ -13,9 +12,17 @@ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
|
|
13
12
|
# Copies the token to clipboard on macOS
|
|
14
13
|
`,
|
|
15
14
|
];
|
|
15
|
+
static flags = {
|
|
16
|
+
config: Flags.string({
|
|
17
|
+
char: 'c',
|
|
18
|
+
description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
|
|
19
|
+
env: 'XANO_CONFIG',
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
16
23
|
async run() {
|
|
17
|
-
const
|
|
18
|
-
const credentialsPath =
|
|
24
|
+
const { flags } = await this.parse(ProfileToken);
|
|
25
|
+
const credentialsPath = resolveCredentialsPath(flags.config);
|
|
19
26
|
// Check if credentials file exists
|
|
20
27
|
if (!fs.existsSync(credentialsPath)) {
|
|
21
28
|
this.error(`Credentials file not found at ${credentialsPath}. Create a profile first using 'profile:create'.`);
|
|
@@ -3,6 +3,7 @@ export default class ProfileWizard extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
7
|
insecure: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
origin: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|