@xano/cli 0.0.69-beta.3 → 0.0.71-beta.2

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.
@@ -1,4 +1,4 @@
1
- import { Command, Flags } from '@oclif/core';
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
4
  import * as os from 'node:os';
@@ -84,7 +84,7 @@ Profile: default
84
84
  this.log('Available profiles:\n');
85
85
  for (const name of profileNames.sort()) {
86
86
  const profile = credentials.profiles[name];
87
- const isDefault = credentials.default === name ? ' [DEFAULT]' : '';
87
+ const isDefault = credentials.default === name ? ` ${ux.colorize('yellow', '[DEFAULT]')}` : '';
88
88
  this.log(`Profile: ${name}${isDefault}`);
89
89
  this.log(` Account Origin: ${profile.account_origin || '(not set)'}`);
90
90
  this.log(` Instance Origin: ${profile.instance_origin}`);
@@ -107,8 +107,11 @@ Profile: default
107
107
  else {
108
108
  this.log('Available profiles:');
109
109
  for (const name of profileNames.sort()) {
110
- const isDefault = credentials.default === name ? ' [DEFAULT]' : '';
111
- this.log(` - ${name}${isDefault}`);
110
+ const profile = credentials.profiles[name];
111
+ const isDefault = credentials.default === name ? ` ${ux.colorize('yellow', '[DEFAULT]')}` : '';
112
+ const instance = profile.instance_origin ? ` (${profile.instance_origin.replace(/^https?:\/\//, '')}` : ' (';
113
+ const workspace = profile.workspace ? `, workspace: ${profile.workspace})` : ')';
114
+ this.log(` - ${name}${isDefault}${instance}${workspace}`);
112
115
  }
113
116
  }
114
117
  }
@@ -53,15 +53,13 @@ Truncate all table records before importing
53
53
  required: false,
54
54
  }),
55
55
  delete: Flags.boolean({
56
- allowNo: true,
57
56
  default: false,
58
- description: 'Delete workspace objects not included in the push (default: false)',
57
+ description: 'Delete workspace objects not included in the push',
59
58
  required: false,
60
59
  }),
61
60
  env: Flags.boolean({
62
- allowNo: true,
63
- default: true,
64
- description: 'Include environment variables in import (default: true, use --no-env to exclude)',
61
+ default: false,
62
+ description: 'Include environment variables in import',
65
63
  required: false,
66
64
  }),
67
65
  partial: Flags.boolean({
@@ -70,9 +68,8 @@ Truncate all table records before importing
70
68
  required: false,
71
69
  }),
72
70
  records: Flags.boolean({
73
- allowNo: true,
74
- default: true,
75
- description: 'Include records in import (default: true, use --no-records to exclude)',
71
+ default: false,
72
+ description: 'Include records in import',
76
73
  required: false,
77
74
  }),
78
75
  'sync-guids': Flags.boolean({
@@ -222,7 +219,7 @@ Truncate all table records before importing
222
219
  const preview = JSON.parse(dryRunText);
223
220
  // Check if the server returned a valid dry-run response
224
221
  if (preview && preview.summary) {
225
- this.renderPreview(preview, shouldDelete, workspaceId);
222
+ this.renderPreview(preview, shouldDelete, workspaceId, flags.verbose);
226
223
  // Check if there are any actual changes (exclude deletes when --delete is off)
227
224
  const hasChanges = Object.values(preview.summary).some((c) => c.created > 0 || c.updated > 0 || (shouldDelete && c.deleted > 0) || c.truncated > 0);
228
225
  if (!hasChanges) {
@@ -414,7 +411,7 @@ Truncate all table records before importing
414
411
  });
415
412
  });
416
413
  }
417
- renderPreview(result, willDelete, workspaceId) {
414
+ renderPreview(result, willDelete, workspaceId, verbose = false) {
418
415
  const typeLabels = {
419
416
  addon: 'Addons',
420
417
  agent: 'Agents',
@@ -469,9 +466,12 @@ Truncate all table records before importing
469
466
  const color = op.action === 'update' || op.action === 'update_field' ? 'yellow' : 'green';
470
467
  const actionLabel = op.action.toUpperCase();
471
468
  this.log(` ${ux.colorize(color, actionLabel.padEnd(16))} ${op.type.padEnd(18)} ${op.name}`);
472
- if ((op.action === 'add_field' || op.action === 'update_field') && op.details) {
469
+ if (op.details) {
473
470
  this.log(` ${' '.repeat(16)} ${' '.repeat(18)} ${ux.colorize('dim', op.details)}`);
474
471
  }
472
+ if (verbose && op.reason) {
473
+ this.log(` ${' '.repeat(16)} ${' '.repeat(18)} ${ux.colorize('dim', `reason: ${op.reason}`)}`);
474
+ }
475
475
  }
476
476
  }
477
477
  // Split destructive ops by category
@@ -490,6 +490,9 @@ Truncate all table records before importing
490
490
  if (op.details) {
491
491
  this.log(` ${' '.repeat(16)} ${' '.repeat(18)} ${ux.colorize('dim', op.details)}`);
492
492
  }
493
+ if (verbose && op.reason) {
494
+ this.log(` ${' '.repeat(16)} ${' '.repeat(18)} ${ux.colorize('dim', `reason: ${op.reason}`)}`);
495
+ }
493
496
  }
494
497
  }
495
498
  // Warn about potential field renames (add + drop on same table)