@xano/cli 0.0.75-beta.6 → 0.0.78
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.
|
@@ -8,6 +8,7 @@ export default class Push extends BaseCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
delete: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
env: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
partial: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
records: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -12,10 +12,13 @@ export default class Push extends BaseCommand {
|
|
|
12
12
|
required: true,
|
|
13
13
|
}),
|
|
14
14
|
};
|
|
15
|
-
static description = 'Push local documents to a workspace. Shows a preview of changes before pushing unless --
|
|
15
|
+
static description = 'Push local documents to a workspace. Shows a preview of changes before pushing unless --force is specified. Use --dry-run to preview only.';
|
|
16
16
|
static examples = [
|
|
17
17
|
`$ xano workspace push ./my-workspace
|
|
18
18
|
Shows preview of changes, requires confirmation
|
|
19
|
+
`,
|
|
20
|
+
`$ xano workspace push ./my-workspace --dry-run
|
|
21
|
+
Preview changes without pushing
|
|
19
22
|
`,
|
|
20
23
|
`$ xano workspace push ./my-workspace --force
|
|
21
24
|
Skip preview and push immediately (for CI/CD)
|
|
@@ -57,6 +60,11 @@ Truncate all table records before importing
|
|
|
57
60
|
description: 'Delete workspace objects not included in the push',
|
|
58
61
|
required: false,
|
|
59
62
|
}),
|
|
63
|
+
'dry-run': Flags.boolean({
|
|
64
|
+
default: false,
|
|
65
|
+
description: 'Show preview of changes without pushing (exit after preview)',
|
|
66
|
+
required: false,
|
|
67
|
+
}),
|
|
60
68
|
env: Flags.boolean({
|
|
61
69
|
default: false,
|
|
62
70
|
description: 'Include environment variables in import',
|
|
@@ -180,7 +188,7 @@ Truncate all table records before importing
|
|
|
180
188
|
'Content-Type': 'text/x-xanoscript',
|
|
181
189
|
};
|
|
182
190
|
// Preview mode: show what would change before pushing
|
|
183
|
-
if (!flags.force) {
|
|
191
|
+
if (flags['dry-run'] || !flags.force) {
|
|
184
192
|
const dryRunParams = new URLSearchParams(queryParams);
|
|
185
193
|
// Always request delete info in dry-run so we can show remote-only items
|
|
186
194
|
dryRunParams.set('delete', 'true');
|
|
@@ -224,6 +232,9 @@ Truncate all table records before importing
|
|
|
224
232
|
return;
|
|
225
233
|
}
|
|
226
234
|
}
|
|
235
|
+
else {
|
|
236
|
+
this.error('Non-interactive environment detected. Use --force to skip confirmation.');
|
|
237
|
+
}
|
|
227
238
|
// Skip the rest of preview logic
|
|
228
239
|
}
|
|
229
240
|
else {
|
|
@@ -239,6 +250,9 @@ Truncate all table records before importing
|
|
|
239
250
|
this.log('No changes to push.');
|
|
240
251
|
return;
|
|
241
252
|
}
|
|
253
|
+
if (flags['dry-run']) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
242
256
|
const hasDestructive = preview.operations.some((op) => (shouldDelete && (op.action === 'delete' || op.action === 'cascade_delete')) ||
|
|
243
257
|
op.action === 'truncate' ||
|
|
244
258
|
op.action === 'drop_field' ||
|
|
@@ -254,8 +268,7 @@ Truncate all table records before importing
|
|
|
254
268
|
}
|
|
255
269
|
}
|
|
256
270
|
else {
|
|
257
|
-
|
|
258
|
-
this.warn('Non-interactive environment detected, proceeding without confirmation.');
|
|
271
|
+
this.error('Non-interactive environment detected. Use --force to skip confirmation.');
|
|
259
272
|
}
|
|
260
273
|
}
|
|
261
274
|
else {
|
|
@@ -270,6 +283,9 @@ Truncate all table records before importing
|
|
|
270
283
|
return;
|
|
271
284
|
}
|
|
272
285
|
}
|
|
286
|
+
else {
|
|
287
|
+
this.error('Non-interactive environment detected. Use --force to skip confirmation.');
|
|
288
|
+
}
|
|
273
289
|
}
|
|
274
290
|
}
|
|
275
291
|
}
|
|
@@ -297,6 +313,9 @@ Truncate all table records before importing
|
|
|
297
313
|
return;
|
|
298
314
|
}
|
|
299
315
|
}
|
|
316
|
+
else {
|
|
317
|
+
this.error('Non-interactive environment detected. Use --force to skip confirmation.');
|
|
318
|
+
}
|
|
300
319
|
}
|
|
301
320
|
}
|
|
302
321
|
const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/multidoc?${queryParams.toString()}`;
|