@xano/cli 0.0.95-beta.2 → 0.0.95-beta.5
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 +17 -9
- package/dist/base-command.d.ts +24 -0
- package/dist/base-command.js +37 -0
- package/dist/commands/auth/index.js +1 -1
- package/dist/commands/profile/me/index.js +21 -2
- package/dist/commands/profile/wizard/index.js +1 -1
- package/dist/commands/profile/workspace/set/index.js +1 -1
- 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/create/index.d.ts +2 -1
- package/dist/commands/tenant/create/index.js +23 -6
- 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/edit/index.d.ts +1 -0
- package/dist/commands/workspace/edit/index.js +16 -6
- package/dist/commands/workspace/get/index.js +9 -7
- package/dist/commands/workspace/list/index.d.ts +1 -0
- package/dist/commands/workspace/list/index.js +14 -7
- package/dist/commands/workspace/push/index.js +26 -0
- package/oclif.manifest.json +1788 -2249
- 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
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
2
|
-
import BaseCommand from '../../../base-command.js';
|
|
3
|
-
export default class EphemeralShared extends BaseCommand {
|
|
4
|
-
static description = 'List all shared ephemeral tenants on the instance';
|
|
5
|
-
static examples = [
|
|
6
|
-
`$ xano ephemeral shared
|
|
7
|
-
Shared ephemeral tenants:
|
|
8
|
-
- My Tenant (e1a2-b3c4-x5y6) [ok] [shared]
|
|
9
|
-
- CI Tenant (e2b3-c4d5-y6z7) [ok] [shared]
|
|
10
|
-
`,
|
|
11
|
-
`$ xano ephemeral shared -o json`,
|
|
12
|
-
];
|
|
13
|
-
static flags = {
|
|
14
|
-
...BaseCommand.baseFlags,
|
|
15
|
-
order: Flags.string({
|
|
16
|
-
default: 'asc',
|
|
17
|
-
description: 'Sort order',
|
|
18
|
-
options: ['asc', 'desc'],
|
|
19
|
-
required: false,
|
|
20
|
-
}),
|
|
21
|
-
output: Flags.string({
|
|
22
|
-
char: 'o',
|
|
23
|
-
default: 'summary',
|
|
24
|
-
description: 'Output format',
|
|
25
|
-
options: ['summary', 'json'],
|
|
26
|
-
required: false,
|
|
27
|
-
}),
|
|
28
|
-
page: Flags.integer({
|
|
29
|
-
default: 1,
|
|
30
|
-
description: 'Page number',
|
|
31
|
-
required: false,
|
|
32
|
-
}),
|
|
33
|
-
per_page: Flags.integer({
|
|
34
|
-
default: 50,
|
|
35
|
-
description: 'Items per page',
|
|
36
|
-
required: false,
|
|
37
|
-
}),
|
|
38
|
-
sort: Flags.string({
|
|
39
|
-
default: 'name',
|
|
40
|
-
description: 'Sort field',
|
|
41
|
-
options: ['name', 'created_at', 'state'],
|
|
42
|
-
required: false,
|
|
43
|
-
}),
|
|
44
|
-
};
|
|
45
|
-
async run() {
|
|
46
|
-
const { flags } = await this.parse(EphemeralShared);
|
|
47
|
-
const profileName = flags.profile || this.getDefaultProfile();
|
|
48
|
-
const credentials = this.loadCredentialsFile();
|
|
49
|
-
if (!credentials || !(profileName in credentials.profiles)) {
|
|
50
|
-
this.error(`Profile '${profileName}' not found.\n` + `Create a profile using 'xano profile create'`);
|
|
51
|
-
}
|
|
52
|
-
const profile = credentials.profiles[profileName];
|
|
53
|
-
if (!profile.instance_origin) {
|
|
54
|
-
this.error(`Profile '${profileName}' is missing instance_origin`);
|
|
55
|
-
}
|
|
56
|
-
if (!profile.access_token) {
|
|
57
|
-
this.error(`Profile '${profileName}' is missing access_token`);
|
|
58
|
-
}
|
|
59
|
-
const params = new URLSearchParams({
|
|
60
|
-
order: flags.order,
|
|
61
|
-
page: String(flags.page),
|
|
62
|
-
per_page: String(flags.per_page),
|
|
63
|
-
sort: flags.sort,
|
|
64
|
-
});
|
|
65
|
-
const apiUrl = `${profile.instance_origin}/api:meta/ephemeral/tenant/shared?${params}`;
|
|
66
|
-
try {
|
|
67
|
-
const response = await this.verboseFetch(apiUrl, {
|
|
68
|
-
headers: {
|
|
69
|
-
accept: 'application/json',
|
|
70
|
-
Authorization: `Bearer ${profile.access_token}`,
|
|
71
|
-
},
|
|
72
|
-
method: 'GET',
|
|
73
|
-
}, flags.verbose, profile.access_token);
|
|
74
|
-
if (!response.ok) {
|
|
75
|
-
const errorText = await response.text();
|
|
76
|
-
this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
|
|
77
|
-
}
|
|
78
|
-
const data = (await response.json());
|
|
79
|
-
const tenants = data.items ?? [];
|
|
80
|
-
if (flags.output === 'json') {
|
|
81
|
-
this.log(JSON.stringify(data, null, 2));
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
if (tenants.length === 0) {
|
|
85
|
-
this.log('No shared ephemeral tenants found');
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
this.log('Shared ephemeral tenants:');
|
|
89
|
-
for (const tenant of tenants) {
|
|
90
|
-
const state = tenant.state ? ` [${tenant.state}]` : '';
|
|
91
|
-
this.log(` - ${tenant.display || tenant.name} (${tenant.name})${state}`);
|
|
92
|
-
}
|
|
93
|
-
if (data.nextPage) {
|
|
94
|
-
this.log(`\nPage ${data.curPage} — more results available (use --page ${data.nextPage})`);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
if (error instanceof Error) {
|
|
101
|
-
this.error(`Failed to list shared ephemeral tenants: ${error.message}`);
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this.error(`Failed to list shared ephemeral tenants: ${String(error)}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|