@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
|
@@ -3,9 +3,8 @@ import { Command, Flags } from '@oclif/core';
|
|
|
3
3
|
import inquirer from 'inquirer';
|
|
4
4
|
import * as yaml from 'js-yaml';
|
|
5
5
|
import * as fs from 'node:fs';
|
|
6
|
-
import * as os from 'node:os';
|
|
7
6
|
import * as path from 'node:path';
|
|
8
|
-
import { buildUserAgent } from '../../../base-command.js';
|
|
7
|
+
import { buildUserAgent, resolveCredentialsPath } from '../../../base-command.js';
|
|
9
8
|
export default class ProfileWizard extends Command {
|
|
10
9
|
static description = 'Create a new profile configuration using an interactive wizard';
|
|
11
10
|
static examples = [
|
|
@@ -20,6 +19,12 @@ Profile 'production' created successfully at ~/.xano/credentials.yaml
|
|
|
20
19
|
`,
|
|
21
20
|
];
|
|
22
21
|
static flags = {
|
|
22
|
+
config: Flags.string({
|
|
23
|
+
char: 'c',
|
|
24
|
+
description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
|
|
25
|
+
env: 'XANO_CONFIG',
|
|
26
|
+
required: false,
|
|
27
|
+
}),
|
|
23
28
|
insecure: Flags.boolean({
|
|
24
29
|
char: 'k',
|
|
25
30
|
default: false,
|
|
@@ -178,7 +183,7 @@ Profile 'production' created successfully at ~/.xano/credentials.yaml
|
|
|
178
183
|
instance_origin: selectedInstance.origin,
|
|
179
184
|
name: profileName,
|
|
180
185
|
workspace,
|
|
181
|
-
}, true);
|
|
186
|
+
}, true, flags.config);
|
|
182
187
|
this.log('');
|
|
183
188
|
this.log(`✓ Profile '${profileName}' created successfully!`);
|
|
184
189
|
}
|
|
@@ -299,8 +304,7 @@ Profile 'production' created successfully at ~/.xano/credentials.yaml
|
|
|
299
304
|
}
|
|
300
305
|
getDefaultProfileName() {
|
|
301
306
|
try {
|
|
302
|
-
const
|
|
303
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
307
|
+
const credentialsPath = resolveCredentialsPath();
|
|
304
308
|
if (!fs.existsSync(credentialsPath)) {
|
|
305
309
|
return 'default';
|
|
306
310
|
}
|
|
@@ -315,10 +319,10 @@ Profile 'production' created successfully at ~/.xano/credentials.yaml
|
|
|
315
319
|
return 'default';
|
|
316
320
|
}
|
|
317
321
|
}
|
|
318
|
-
async saveProfile(profile, setAsDefault = false) {
|
|
319
|
-
const
|
|
320
|
-
const
|
|
321
|
-
// Ensure the
|
|
322
|
+
async saveProfile(profile, setAsDefault = false, configPath) {
|
|
323
|
+
const credentialsPath = resolveCredentialsPath(configPath);
|
|
324
|
+
const configDir = path.dirname(credentialsPath);
|
|
325
|
+
// Ensure the directory exists
|
|
322
326
|
if (!fs.existsSync(configDir)) {
|
|
323
327
|
fs.mkdirSync(configDir, { recursive: true });
|
|
324
328
|
}
|
|
@@ -2,5 +2,8 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
export default class ProfileWorkspace 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 ProfileWorkspace extends Command {
|
|
7
6
|
static description = 'Print the workspace ID for the default profile';
|
|
8
7
|
static examples = [
|
|
@@ -13,9 +12,17 @@ abc123-workspace-id
|
|
|
13
12
|
# Copies the workspace ID 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(ProfileWorkspace);
|
|
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 ProfileWorkspaceSet extends BaseCommand {
|
|
|
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
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
8
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
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, { buildUserAgent } from '../../../../base-command.js';
|
|
7
5
|
export default class ProfileWorkspaceSet extends BaseCommand {
|
|
8
6
|
static description = 'Interactively select a workspace for a profile';
|
|
@@ -50,7 +48,7 @@ Workspace updated to 'Production API' (xyz789) on profile 'production'
|
|
|
50
48
|
]);
|
|
51
49
|
profile.workspace = selectedWorkspace;
|
|
52
50
|
credentials.profiles[profileName] = profile;
|
|
53
|
-
const credentialsPath =
|
|
51
|
+
const credentialsPath = this.getCredentialsPath();
|
|
54
52
|
const yamlContent = yaml.dump(credentials, {
|
|
55
53
|
indent: 2,
|
|
56
54
|
lineWidth: -1,
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import BaseCommand from '../../../base-command.js';
|
|
2
2
|
export default class ReleaseCreate extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
3
6
|
static description: string;
|
|
4
7
|
static examples: string[];
|
|
5
8
|
static flags: {
|
|
6
9
|
branch: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
10
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
11
|
hotfix: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
12
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
13
|
'table-ids': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
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>;
|
|
13
16
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
17
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
18
|
};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
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 ReleaseCreate extends BaseCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
name: Args.string({
|
|
8
|
+
description: 'Name for the release',
|
|
9
|
+
required: true,
|
|
10
|
+
}),
|
|
11
|
+
};
|
|
8
12
|
static description = 'Create a new release in a workspace';
|
|
9
13
|
static examples = [
|
|
10
|
-
`$ xano release create
|
|
14
|
+
`$ xano release create "v1.0" --branch main
|
|
11
15
|
Created release: v1.0 - ID: 10
|
|
12
16
|
`,
|
|
13
|
-
`$ xano release create
|
|
17
|
+
`$ xano release create "v1.1-hotfix" --branch main --hotfix --description "Critical fix" -o json`,
|
|
14
18
|
];
|
|
15
19
|
static flags = {
|
|
16
20
|
...BaseCommand.baseFlags,
|
|
@@ -29,11 +33,6 @@ Created release: v1.0 - ID: 10
|
|
|
29
33
|
description: 'Mark as a hotfix release',
|
|
30
34
|
required: false,
|
|
31
35
|
}),
|
|
32
|
-
name: Flags.string({
|
|
33
|
-
char: 'n',
|
|
34
|
-
description: 'Name for the release',
|
|
35
|
-
required: true,
|
|
36
|
-
}),
|
|
37
36
|
output: Flags.string({
|
|
38
37
|
char: 'o',
|
|
39
38
|
default: 'summary',
|
|
@@ -52,7 +51,7 @@ Created release: v1.0 - ID: 10
|
|
|
52
51
|
}),
|
|
53
52
|
};
|
|
54
53
|
async run() {
|
|
55
|
-
const { flags } = await this.parse(ReleaseCreate);
|
|
54
|
+
const { args, flags } = await this.parse(ReleaseCreate);
|
|
56
55
|
const profileName = flags.profile || this.getDefaultProfile();
|
|
57
56
|
const credentials = this.loadCredentials();
|
|
58
57
|
if (!(profileName in credentials.profiles)) {
|
|
@@ -73,7 +72,7 @@ Created release: v1.0 - ID: 10
|
|
|
73
72
|
const body = {
|
|
74
73
|
branch: flags.branch,
|
|
75
74
|
hotfix: flags.hotfix,
|
|
76
|
-
name:
|
|
75
|
+
name: args.name,
|
|
77
76
|
};
|
|
78
77
|
if (flags.description)
|
|
79
78
|
body.description = flags.description;
|
|
@@ -117,8 +116,7 @@ Created release: v1.0 - ID: 10
|
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
loadCredentials() {
|
|
120
|
-
const
|
|
121
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
119
|
+
const credentialsPath = this.getCredentialsPath();
|
|
122
120
|
if (!fs.existsSync(credentialsPath)) {
|
|
123
121
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
124
122
|
`Create a profile using 'xano profile create'`);
|
|
@@ -9,6 +9,7 @@ export default class ReleaseDelete 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<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
|
};
|
|
@@ -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 ReleaseDelete extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -114,8 +112,7 @@ Deleted release 'v1.0'
|
|
|
114
112
|
});
|
|
115
113
|
}
|
|
116
114
|
loadCredentials() {
|
|
117
|
-
const
|
|
118
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
115
|
+
const credentialsPath = this.getCredentialsPath();
|
|
119
116
|
if (!fs.existsSync(credentialsPath)) {
|
|
120
117
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
121
118
|
`Create a profile using 'xano profile create'`);
|
|
@@ -7,11 +7,14 @@ export default class ReleaseDeploy extends BaseCommand {
|
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
9
|
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
set_live: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
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>;
|
|
13
15
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
16
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
17
|
};
|
|
16
18
|
run(): Promise<void>;
|
|
19
|
+
private confirm;
|
|
17
20
|
}
|
|
@@ -10,10 +10,14 @@ export default class ReleaseDeploy extends BaseCommand {
|
|
|
10
10
|
static description = 'Deploy a release to its workspace as a new branch';
|
|
11
11
|
static examples = [
|
|
12
12
|
`$ xano release deploy "v1.0"
|
|
13
|
+
Are you sure you want to deploy release "v1.0"? (y/N) y
|
|
13
14
|
Deployed release "v1.0" to workspace 40 (branch: v1.0, set live)
|
|
15
|
+
`,
|
|
16
|
+
`$ xano release deploy "v1.0" --force
|
|
17
|
+
Deployed release "v1.0" to workspace 40 (branch: v1.0)
|
|
14
18
|
`,
|
|
15
19
|
`$ xano release deploy "v1.0" --branch "restore-v1" --no-set_live`,
|
|
16
|
-
`$ xano release deploy "v1.0" -w 40 -o json`,
|
|
20
|
+
`$ xano release deploy "v1.0" -w 40 -o json --force`,
|
|
17
21
|
];
|
|
18
22
|
static flags = {
|
|
19
23
|
...BaseCommand.baseFlags,
|
|
@@ -22,6 +26,12 @@ Deployed release "v1.0" to workspace 40 (branch: v1.0, set live)
|
|
|
22
26
|
description: 'Branch label for the new branch (defaults to release branch name)',
|
|
23
27
|
required: false,
|
|
24
28
|
}),
|
|
29
|
+
force: Flags.boolean({
|
|
30
|
+
char: 'f',
|
|
31
|
+
default: false,
|
|
32
|
+
description: 'Skip confirmation prompt',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
25
35
|
output: Flags.string({
|
|
26
36
|
char: 'o',
|
|
27
37
|
default: 'summary',
|
|
@@ -65,6 +75,13 @@ Deployed release "v1.0" to workspace 40 (branch: v1.0, set live)
|
|
|
65
75
|
};
|
|
66
76
|
if (flags.branch)
|
|
67
77
|
body.branch = flags.branch;
|
|
78
|
+
if (!flags.force) {
|
|
79
|
+
const confirmed = await this.confirm(`Are you sure you want to deploy release "${args.release_name}" to workspace ${workspaceId}?`);
|
|
80
|
+
if (!confirmed) {
|
|
81
|
+
this.log('Deploy cancelled.');
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
68
85
|
this.warn('This may take a few minutes. Please be patient.');
|
|
69
86
|
const startTime = Date.now();
|
|
70
87
|
try {
|
|
@@ -104,4 +121,17 @@ Deployed release "v1.0" to workspace 40 (branch: v1.0, set live)
|
|
|
104
121
|
}
|
|
105
122
|
}
|
|
106
123
|
}
|
|
124
|
+
async confirm(message) {
|
|
125
|
+
const readline = await import('node:readline');
|
|
126
|
+
const rl = readline.createInterface({
|
|
127
|
+
input: process.stdin,
|
|
128
|
+
output: process.stdout,
|
|
129
|
+
});
|
|
130
|
+
return new Promise((resolve) => {
|
|
131
|
+
rl.question(`${message} (y/N) `, (answer) => {
|
|
132
|
+
rl.close();
|
|
133
|
+
resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
107
137
|
}
|
|
@@ -10,6 +10,7 @@ export default class ReleaseEdit extends BaseCommand {
|
|
|
10
10
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
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
|
};
|
|
@@ -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 ReleaseEdit extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -116,8 +114,7 @@ Updated release: v1.0-final - ID: 10
|
|
|
116
114
|
}
|
|
117
115
|
}
|
|
118
116
|
loadCredentials() {
|
|
119
|
-
const
|
|
120
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
117
|
+
const credentialsPath = this.getCredentialsPath();
|
|
121
118
|
if (!fs.existsSync(credentialsPath)) {
|
|
122
119
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
123
120
|
`Create a profile using 'xano profile create'`);
|
|
@@ -9,6 +9,7 @@ export default class ReleaseExport extends BaseCommand {
|
|
|
9
9
|
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
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
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
|
-
import * as os from 'node:os';
|
|
4
3
|
import * as path from 'node:path';
|
|
5
4
|
import * as yaml from 'js-yaml';
|
|
6
5
|
import BaseCommand, { buildUserAgent } from '../../../base-command.js';
|
|
@@ -125,8 +124,7 @@ Downloaded release 'v1.0' to ./release-v1.0.tar.gz
|
|
|
125
124
|
}
|
|
126
125
|
}
|
|
127
126
|
loadCredentials() {
|
|
128
|
-
const
|
|
129
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
127
|
+
const credentialsPath = this.getCredentialsPath();
|
|
130
128
|
if (!fs.existsSync(credentialsPath)) {
|
|
131
129
|
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
132
130
|
}
|
|
@@ -8,6 +8,7 @@ export default class ReleaseGet 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<string | 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 ReleaseGet extends BaseCommand {
|
|
8
6
|
static args = {
|
|
@@ -102,8 +100,7 @@ Release: v1.0 - ID: 10
|
|
|
102
100
|
}
|
|
103
101
|
}
|
|
104
102
|
loadCredentials() {
|
|
105
|
-
const
|
|
106
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
103
|
+
const credentialsPath = this.getCredentialsPath();
|
|
107
104
|
if (!fs.existsSync(credentialsPath)) {
|
|
108
105
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
109
106
|
`Create a profile using 'xano profile create'`);
|
|
@@ -7,6 +7,7 @@ export default class ReleaseImport extends BaseCommand {
|
|
|
7
7
|
file: import("@oclif/core/interfaces").OptionFlag<string, 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,6 +1,5 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
|
-
import * as os from 'node:os';
|
|
4
3
|
import * as path from 'node:path';
|
|
5
4
|
import * as yaml from 'js-yaml';
|
|
6
5
|
import BaseCommand from '../../../base-command.js';
|
|
@@ -93,8 +92,7 @@ Imported release as #15
|
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
loadCredentials() {
|
|
96
|
-
const
|
|
97
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
95
|
+
const credentialsPath = this.getCredentialsPath();
|
|
98
96
|
if (!fs.existsSync(credentialsPath)) {
|
|
99
97
|
this.error(`Credentials file not found at ${credentialsPath}\n` +
|
|
100
98
|
`Create a profile using 'xano profile create'`);
|
|
@@ -5,6 +5,7 @@ export default class ReleaseList extends BaseCommand {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
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>;
|
|
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
|
};
|
|
@@ -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 ReleaseList extends BaseCommand {
|
|
8
6
|
static description = 'List all releases in a workspace';
|
|
@@ -102,8 +100,7 @@ Releases in workspace 5:
|
|
|
102
100
|
}
|
|
103
101
|
}
|
|
104
102
|
loadCredentials() {
|
|
105
|
-
const
|
|
106
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
103
|
+
const credentialsPath = this.getCredentialsPath();
|
|
107
104
|
if (!fs.existsSync(credentialsPath)) {
|
|
108
105
|
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
|
|
109
106
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import BaseCommand from '../../../base-command.js';
|
|
2
2
|
export default class ReleasePull 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: {
|
|
6
|
+
directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
7
|
env: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
8
|
records: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
9
|
release: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
10
|
workspace: 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
|
};
|
|
@@ -1,32 +1,34 @@
|
|
|
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
4
|
import * as path from 'node:path';
|
|
6
5
|
import snakeCase from 'lodash.snakecase';
|
|
7
6
|
import BaseCommand from '../../../base-command.js';
|
|
8
7
|
import { buildApiGroupFolderResolver, parseDocument } from '../../../utils/document-parser.js';
|
|
9
8
|
export default class ReleasePull extends BaseCommand {
|
|
10
|
-
static args = {
|
|
11
|
-
directory: Args.string({
|
|
12
|
-
description: 'Output directory for pulled documents',
|
|
13
|
-
required: true,
|
|
14
|
-
}),
|
|
15
|
-
};
|
|
16
9
|
static description = 'Pull a release multidoc from the Xano Metadata API and split into individual files';
|
|
17
10
|
static examples = [
|
|
18
|
-
`$ xano release pull
|
|
11
|
+
`$ xano release pull -r v1.0
|
|
12
|
+
Pulled 42 documents from release 'v1.0' to current directory
|
|
13
|
+
`,
|
|
14
|
+
`$ xano release pull -d ./my-release -r v1.0
|
|
19
15
|
Pulled 42 documents from release 'v1.0' to ./my-release
|
|
20
16
|
`,
|
|
21
|
-
`$ xano release pull ./output -r v1.0 -w 40
|
|
17
|
+
`$ xano release pull -d ./output -r v1.0 -w 40
|
|
22
18
|
Pulled 15 documents from release 'v1.0' to ./output
|
|
23
19
|
`,
|
|
24
|
-
`$ xano release pull
|
|
25
|
-
Pulled 58 documents from release 'v1.0'
|
|
20
|
+
`$ xano release pull -r v1.0 --profile production --env --records
|
|
21
|
+
Pulled 58 documents from release 'v1.0'
|
|
26
22
|
`,
|
|
27
23
|
];
|
|
28
24
|
static flags = {
|
|
29
25
|
...BaseCommand.baseFlags,
|
|
26
|
+
directory: Flags.string({
|
|
27
|
+
char: 'd',
|
|
28
|
+
default: '.',
|
|
29
|
+
description: 'Output directory for pulled documents (defaults to current directory)',
|
|
30
|
+
required: false,
|
|
31
|
+
}),
|
|
30
32
|
env: Flags.boolean({
|
|
31
33
|
default: false,
|
|
32
34
|
description: 'Include environment variables',
|
|
@@ -49,7 +51,7 @@ Pulled 58 documents from release 'v1.0' to ./backup
|
|
|
49
51
|
}),
|
|
50
52
|
};
|
|
51
53
|
async run() {
|
|
52
|
-
const {
|
|
54
|
+
const { flags } = await this.parse(ReleasePull);
|
|
53
55
|
// Get profile name (default or from flag/env)
|
|
54
56
|
const profileName = flags.profile || this.getDefaultProfile();
|
|
55
57
|
// Load credentials
|
|
@@ -77,7 +79,7 @@ Pulled 58 documents from release 'v1.0' to ./backup
|
|
|
77
79
|
}
|
|
78
80
|
else {
|
|
79
81
|
this.error(`Workspace ID is required. Either:\n` +
|
|
80
|
-
` 1. Provide it as a flag: xano release pull
|
|
82
|
+
` 1. Provide it as a flag: xano release pull -r <release_name> -w <workspace_id>\n` +
|
|
81
83
|
` 2. Set it in your profile using: xano profile:edit ${profileName} -w <workspace_id>`);
|
|
82
84
|
}
|
|
83
85
|
const releaseName = flags.release;
|
|
@@ -133,7 +135,7 @@ Pulled 58 documents from release 'v1.0' to ./backup
|
|
|
133
135
|
return;
|
|
134
136
|
}
|
|
135
137
|
// Resolve the output directory
|
|
136
|
-
const outputDir = path.resolve(
|
|
138
|
+
const outputDir = path.resolve(flags.directory);
|
|
137
139
|
// Create the output directory if it doesn't exist
|
|
138
140
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
139
141
|
// Resolve api_group names to unique folder names, disambiguating collisions
|
|
@@ -239,11 +241,10 @@ Pulled 58 documents from release 'v1.0' to ./backup
|
|
|
239
241
|
fs.writeFileSync(filePath, doc.content, 'utf8');
|
|
240
242
|
writtenCount++;
|
|
241
243
|
}
|
|
242
|
-
this.log(`Pulled ${writtenCount} documents from release '${releaseName}' to ${
|
|
244
|
+
this.log(`Pulled ${writtenCount} documents from release '${releaseName}' to ${flags.directory}`);
|
|
243
245
|
}
|
|
244
246
|
loadCredentials() {
|
|
245
|
-
const
|
|
246
|
-
const credentialsPath = path.join(configDir, 'credentials.yaml');
|
|
247
|
+
const credentialsPath = this.getCredentialsPath();
|
|
247
248
|
// Check if credentials file exists
|
|
248
249
|
if (!fs.existsSync(credentialsPath)) {
|
|
249
250
|
this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile:create'`);
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import BaseCommand from '../../../base-command.js';
|
|
2
2
|
export default class ReleasePush 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
|
description: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
8
|
env: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
9
|
hotfix: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
10
|
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
11
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
12
|
records: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
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>;
|
|
16
15
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
16
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
17
|
};
|