@xano/cli 0.0.71-beta.0 → 0.0.73-beta.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.
@@ -193,7 +193,19 @@ Truncate all table records before importing
193
193
  }, flags.verbose, profile.access_token);
194
194
  if (!dryRunResponse.ok) {
195
195
  if (dryRunResponse.status === 404) {
196
- // Dry-run endpoint not available on this instance
196
+ // Check if the workspace itself doesn't exist
197
+ const wsCheckUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}`;
198
+ const wsCheckResponse = await this.verboseFetch(wsCheckUrl, {
199
+ headers: {
200
+ accept: 'application/json',
201
+ Authorization: `Bearer ${profile.access_token}`,
202
+ },
203
+ method: 'GET',
204
+ }, flags.verbose, profile.access_token);
205
+ if (!wsCheckResponse.ok) {
206
+ this.error(`Workspace ${workspaceId} not found on this instance.`);
207
+ }
208
+ // Workspace exists — dry-run endpoint just not available
197
209
  this.log('');
198
210
  this.log(ux.colorize('dim', 'Push preview not yet available on this instance.'));
199
211
  this.log('');
@@ -219,7 +231,7 @@ Truncate all table records before importing
219
231
  const preview = JSON.parse(dryRunText);
220
232
  // Check if the server returned a valid dry-run response
221
233
  if (preview && preview.summary) {
222
- this.renderPreview(preview, shouldDelete, workspaceId);
234
+ this.renderPreview(preview, shouldDelete, workspaceId, flags.verbose);
223
235
  // Check if there are any actual changes (exclude deletes when --delete is off)
224
236
  const hasChanges = Object.values(preview.summary).some((c) => c.created > 0 || c.updated > 0 || (shouldDelete && c.deleted > 0) || c.truncated > 0);
225
237
  if (!hasChanges) {
@@ -267,6 +279,10 @@ Truncate all table records before importing
267
279
  this.log('\nPush cancelled.');
268
280
  return;
269
281
  }
282
+ // Re-throw oclif errors (e.g. from this.error()) so they exit properly
283
+ if (error instanceof Error && 'oclif' in error) {
284
+ throw error;
285
+ }
270
286
  // If dry-run fails unexpectedly, proceed without preview
271
287
  this.log('');
272
288
  this.log(ux.colorize('dim', 'Push preview not yet available on this instance.'));
@@ -411,7 +427,7 @@ Truncate all table records before importing
411
427
  });
412
428
  });
413
429
  }
414
- renderPreview(result, willDelete, workspaceId) {
430
+ renderPreview(result, willDelete, workspaceId, verbose = false) {
415
431
  const typeLabels = {
416
432
  addon: 'Addons',
417
433
  agent: 'Agents',
@@ -469,6 +485,9 @@ Truncate all table records before importing
469
485
  if (op.details) {
470
486
  this.log(` ${' '.repeat(16)} ${' '.repeat(18)} ${ux.colorize('dim', op.details)}`);
471
487
  }
488
+ if (verbose && op.reason) {
489
+ this.log(` ${' '.repeat(16)} ${' '.repeat(18)} ${ux.colorize('dim', `reason: ${op.reason}`)}`);
490
+ }
472
491
  }
473
492
  }
474
493
  // Split destructive ops by category
@@ -487,6 +506,9 @@ Truncate all table records before importing
487
506
  if (op.details) {
488
507
  this.log(` ${' '.repeat(16)} ${' '.repeat(18)} ${ux.colorize('dim', op.details)}`);
489
508
  }
509
+ if (verbose && op.reason) {
510
+ this.log(` ${' '.repeat(16)} ${' '.repeat(18)} ${ux.colorize('dim', `reason: ${op.reason}`)}`);
511
+ }
490
512
  }
491
513
  }
492
514
  // Warn about potential field renames (add + drop on same table)