@xano/cli 0.0.95-beta.2 → 0.0.95-beta.3
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 +15 -8
- package/dist/base-command.d.ts +24 -0
- package/dist/base-command.js +37 -0
- package/dist/commands/{ephemeral → sandbox}/env/delete/index.d.ts +1 -4
- package/dist/commands/{ephemeral → sandbox}/env/delete/index.js +17 -33
- package/dist/commands/{ephemeral → sandbox}/env/get/index.d.ts +1 -4
- package/dist/commands/{ephemeral → sandbox}/env/get/index.js +13 -29
- package/dist/commands/{ephemeral → sandbox}/env/get_all/index.d.ts +1 -4
- package/dist/commands/{ephemeral → sandbox}/env/get_all/index.js +16 -32
- package/dist/commands/{ephemeral → sandbox}/env/list/index.d.ts +1 -4
- package/dist/commands/sandbox/env/list/index.js +67 -0
- package/dist/commands/{ephemeral → sandbox}/env/set/index.d.ts +1 -4
- package/dist/commands/{ephemeral → sandbox}/env/set/index.js +14 -30
- package/dist/commands/{ephemeral → sandbox}/env/set_all/index.d.ts +1 -4
- package/dist/commands/{ephemeral → sandbox}/env/set_all/index.js +16 -32
- package/dist/commands/{ephemeral → sandbox}/get/index.d.ts +1 -4
- package/dist/commands/sandbox/get/index.js +48 -0
- package/dist/commands/sandbox/impersonate/index.d.ts +5 -0
- package/dist/commands/sandbox/impersonate/index.js +5 -0
- package/dist/commands/{ephemeral → sandbox}/license/get/index.d.ts +1 -4
- package/dist/commands/{ephemeral → sandbox}/license/get/index.js +16 -32
- package/dist/commands/{ephemeral → sandbox}/license/set/index.d.ts +1 -4
- package/dist/commands/{ephemeral → sandbox}/license/set/index.js +17 -33
- package/dist/commands/{ephemeral → sandbox}/pull/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/pull/index.js +11 -26
- package/dist/commands/{ephemeral → sandbox}/push/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/push/index.js +13 -28
- package/dist/commands/{ephemeral/delete → sandbox/reset}/index.d.ts +1 -5
- package/dist/commands/sandbox/reset/index.js +71 -0
- package/dist/commands/{ephemeral/impersonate → sandbox/review}/index.d.ts +1 -4
- package/dist/commands/{ephemeral/impersonate → sandbox/review}/index.js +15 -31
- package/dist/commands/{ephemeral/unit_test/run_all → sandbox/unit_test/list}/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/unit_test/list/index.js +10 -24
- package/dist/commands/{ephemeral → sandbox}/unit_test/run/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/unit_test/run/index.js +9 -23
- package/dist/commands/{ephemeral/unit_test/list → sandbox/unit_test/run_all}/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/unit_test/run_all/index.js +9 -23
- package/dist/commands/{ephemeral/workflow_test/get → sandbox/workflow_test/delete}/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/workflow_test/delete/index.js +9 -23
- package/dist/commands/{ephemeral/workflow_test/run → sandbox/workflow_test/get}/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/workflow_test/get/index.js +8 -25
- package/dist/commands/{ephemeral/workflow_test/run_all → sandbox/workflow_test/list}/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/workflow_test/list/index.js +11 -25
- package/dist/commands/{ephemeral/workflow_test/delete → sandbox/workflow_test/run}/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/workflow_test/run/index.js +9 -23
- package/dist/commands/{ephemeral/workflow_test/list → sandbox/workflow_test/run_all}/index.d.ts +1 -2
- package/dist/commands/{ephemeral → sandbox}/workflow_test/run_all/index.js +9 -23
- package/dist/commands/tenant/get/index.js +2 -2
- package/dist/commands/tenant/list/index.js +2 -2
- package/dist/commands/tenant/push/index.js +0 -34
- package/dist/commands/workspace/push/index.js +26 -0
- package/oclif.manifest.json +2404 -2888
- package/package.json +7 -7
- package/dist/commands/ephemeral/access/index.d.ts +0 -15
- package/dist/commands/ephemeral/access/index.js +0 -78
- package/dist/commands/ephemeral/create/index.d.ts +0 -17
- package/dist/commands/ephemeral/create/index.js +0 -102
- package/dist/commands/ephemeral/delete/index.js +0 -99
- package/dist/commands/ephemeral/env/list/index.js +0 -83
- package/dist/commands/ephemeral/get/index.js +0 -102
- package/dist/commands/ephemeral/list/index.d.ts +0 -15
- package/dist/commands/ephemeral/list/index.js +0 -109
- package/dist/commands/ephemeral/shared/index.d.ts +0 -15
- package/dist/commands/ephemeral/shared/index.js +0 -108
|
@@ -100,40 +100,6 @@ Truncate all table records before importing
|
|
|
100
100
|
` 2. Set it in your profile using: xano profile:edit ${profileName} -w <workspace_id>`);
|
|
101
101
|
}
|
|
102
102
|
const tenantName = flags.tenant;
|
|
103
|
-
// Fetch tenant details and verify it's ephemeral
|
|
104
|
-
const tenantApiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}`;
|
|
105
|
-
try {
|
|
106
|
-
const tenantResponse = await this.verboseFetch(tenantApiUrl, {
|
|
107
|
-
headers: {
|
|
108
|
-
accept: 'application/json',
|
|
109
|
-
Authorization: `Bearer ${profile.access_token}`,
|
|
110
|
-
},
|
|
111
|
-
method: 'GET',
|
|
112
|
-
}, flags.verbose, profile.access_token);
|
|
113
|
-
if (!tenantResponse.ok) {
|
|
114
|
-
const errorText = await tenantResponse.text();
|
|
115
|
-
this.error(`Failed to fetch tenant '${tenantName}' (${tenantResponse.status}): ${errorText}`);
|
|
116
|
-
}
|
|
117
|
-
const tenantData = (await tenantResponse.json());
|
|
118
|
-
if (!tenantData.ephemeral) {
|
|
119
|
-
this.error(`Tenant '${tenantName}' is not ephemeral. Push is only allowed for ephemeral tenants.\n` +
|
|
120
|
-
`Create an ephemeral tenant with: xano ephemeral create "name"`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
if (error instanceof Error && error.message.includes('is not ephemeral')) {
|
|
125
|
-
throw error;
|
|
126
|
-
}
|
|
127
|
-
if (error instanceof Error && error.message.includes('Failed to fetch tenant')) {
|
|
128
|
-
throw error;
|
|
129
|
-
}
|
|
130
|
-
if (error instanceof Error) {
|
|
131
|
-
this.error(`Failed to verify tenant: ${error.message}`);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
this.error(`Failed to verify tenant: ${String(error)}`);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
103
|
// Resolve the input directory
|
|
138
104
|
const inputDir = path.resolve(args.directory);
|
|
139
105
|
if (!fs.existsSync(inputDir)) {
|
|
@@ -282,6 +282,24 @@ Push functions but exclude test files
|
|
|
282
282
|
}
|
|
283
283
|
else {
|
|
284
284
|
const errorText = await dryRunResponse.text();
|
|
285
|
+
// Check if push is disabled on this workspace
|
|
286
|
+
try {
|
|
287
|
+
const errorJson = JSON.parse(errorText);
|
|
288
|
+
if (errorJson.message?.includes('Push is disabled')) {
|
|
289
|
+
this.log('');
|
|
290
|
+
this.log(ux.colorize('red', ux.colorize('bold', 'Direct push to this workspace is disabled.')));
|
|
291
|
+
this.log(ux.colorize('dim', 'To apply changes to the workspace, use the sandbox review flow:'));
|
|
292
|
+
this.log(` ${ux.colorize('cyan', 'xano sandbox push')} ${ux.colorize('dim', '— push changes to your sandbox')}`);
|
|
293
|
+
this.log(` ${ux.colorize('cyan', 'xano sandbox review')} ${ux.colorize('dim', '— edit any logic, inspect the snapshot diff, and promote changes to the workspace')}`);
|
|
294
|
+
this.log('');
|
|
295
|
+
this.log(ux.colorize('dim', 'To enable direct push, go to Workspace Settings → CLI → Allow Direct Workspace Push.'));
|
|
296
|
+
this.log('');
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
catch {
|
|
301
|
+
// Not JSON, fall through
|
|
302
|
+
}
|
|
285
303
|
this.warn(`Push preview failed (${dryRunResponse.status}). Skipping preview.`);
|
|
286
304
|
if (flags.verbose) {
|
|
287
305
|
this.log(ux.colorize('dim', errorText));
|
|
@@ -465,6 +483,14 @@ Push functions but exclude test files
|
|
|
465
483
|
if (errorJson.payload?.param) {
|
|
466
484
|
errorMessage += `\n Parameter: ${errorJson.payload.param}`;
|
|
467
485
|
}
|
|
486
|
+
// Provide clear guidance when push is disabled
|
|
487
|
+
if (errorJson.message?.includes('Push is disabled')) {
|
|
488
|
+
this.error(`Push is disabled for this workspace.\n\n` +
|
|
489
|
+
`To enable, go to Workspace Settings and turn on "Allow Push".\n\n` +
|
|
490
|
+
`Alternatively, use sandbox commands:\n` +
|
|
491
|
+
` xano sandbox push ${args.directory}\n` +
|
|
492
|
+
` xano sandbox impersonate`);
|
|
493
|
+
}
|
|
468
494
|
}
|
|
469
495
|
catch {
|
|
470
496
|
errorMessage += `\n${errorText}`;
|