@xano/cli 0.0.27 → 0.0.28
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.
|
@@ -6,6 +6,7 @@ export default class Pull extends BaseCommand {
|
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
+
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
env: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
records: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -22,10 +22,18 @@ Pulled 15 documents to ./output
|
|
|
22
22
|
`,
|
|
23
23
|
`$ xano workspace pull ./backup --profile production --env --records
|
|
24
24
|
Pulled 58 documents to ./backup
|
|
25
|
+
`,
|
|
26
|
+
`$ xano workspace pull ./my-workspace -b dev
|
|
27
|
+
Pulled 42 documents to ./my-workspace
|
|
25
28
|
`,
|
|
26
29
|
];
|
|
27
30
|
static flags = {
|
|
28
31
|
...BaseCommand.baseFlags,
|
|
32
|
+
branch: Flags.string({
|
|
33
|
+
char: 'b',
|
|
34
|
+
description: 'Branch name (optional if set in profile, defaults to live)',
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
29
37
|
env: Flags.boolean({
|
|
30
38
|
default: false,
|
|
31
39
|
description: 'Include environment variables',
|
|
@@ -74,8 +82,11 @@ Pulled 58 documents to ./backup
|
|
|
74
82
|
` 1. Provide it as a flag: xano workspace pull <directory> -w <workspace_id>\n` +
|
|
75
83
|
` 2. Set it in your profile using: xano profile:edit ${profileName} -w <workspace_id>`);
|
|
76
84
|
}
|
|
85
|
+
// Determine branch from flag or profile
|
|
86
|
+
const branch = flags.branch || profile.branch || '';
|
|
77
87
|
// Build query parameters
|
|
78
88
|
const queryParams = new URLSearchParams({
|
|
89
|
+
branch,
|
|
79
90
|
env: flags.env.toString(),
|
|
80
91
|
records: flags.records.toString(),
|
|
81
92
|
});
|
|
@@ -6,6 +6,7 @@ export default class Push extends BaseCommand {
|
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
+
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
workspace: 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>;
|
|
@@ -21,10 +21,18 @@ Pushed 15 documents from ./output
|
|
|
21
21
|
`,
|
|
22
22
|
`$ xano workspace push ./backup --profile production
|
|
23
23
|
Pushed 58 documents from ./backup
|
|
24
|
+
`,
|
|
25
|
+
`$ xano workspace push ./my-workspace -b dev
|
|
26
|
+
Pushed 42 documents from ./my-workspace
|
|
24
27
|
`,
|
|
25
28
|
];
|
|
26
29
|
static flags = {
|
|
27
30
|
...BaseCommand.baseFlags,
|
|
31
|
+
branch: Flags.string({
|
|
32
|
+
char: 'b',
|
|
33
|
+
description: 'Branch name (optional if set in profile, defaults to live)',
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
28
36
|
workspace: Flags.string({
|
|
29
37
|
char: 'w',
|
|
30
38
|
description: 'Workspace ID (optional if set in profile)',
|
|
@@ -88,8 +96,11 @@ Pushed 58 documents from ./backup
|
|
|
88
96
|
this.error(`All .xs files in ${args.directory} are empty`);
|
|
89
97
|
}
|
|
90
98
|
const multidoc = documents.join('\n---\n');
|
|
99
|
+
// Determine branch from flag or profile
|
|
100
|
+
const branch = flags.branch || profile.branch || '';
|
|
91
101
|
// Construct the API URL
|
|
92
|
-
const
|
|
102
|
+
const queryParams = new URLSearchParams({ branch });
|
|
103
|
+
const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/multidoc?${queryParams.toString()}`;
|
|
93
104
|
// POST the multidoc to the API
|
|
94
105
|
try {
|
|
95
106
|
const response = await fetch(apiUrl, {
|