@xano/cli 1.0.6-beta.7 → 1.1.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.
- package/README.md +3 -61
- package/dist/base-command.d.ts +0 -2
- package/dist/base-command.js +4 -10
- package/dist/commands/release/pull/index.d.ts +6 -0
- package/dist/commands/release/pull/index.js +95 -10
- package/dist/commands/sandbox/pull/index.d.ts +1 -0
- package/dist/commands/sandbox/pull/index.js +77 -10
- package/dist/commands/tenant/pull/index.d.ts +6 -0
- package/dist/commands/tenant/pull/index.js +95 -10
- package/dist/commands/workspace/git/pull/index.js +3 -53
- package/dist/commands/workspace/pull/index.d.ts +6 -0
- package/dist/commands/workspace/pull/index.js +95 -10
- package/dist/utils/document-parser.d.ts +0 -85
- package/dist/utils/document-parser.js +1 -214
- package/dist/utils/knowledge-sync.d.ts +0 -1
- package/dist/utils/knowledge-sync.js +5 -11
- package/dist/utils/paging.d.ts +1 -2
- package/dist/utils/reference-checker.js +0 -13
- package/oclif.manifest.json +3174 -5182
- package/package.json +1 -10
- package/dist/commands/ephemeral/create/index.d.ts +0 -18
- package/dist/commands/ephemeral/create/index.js +0 -103
- package/dist/commands/ephemeral/delete/index.d.ts +0 -18
- package/dist/commands/ephemeral/delete/index.js +0 -99
- package/dist/commands/ephemeral/edit/index.d.ts +0 -18
- package/dist/commands/ephemeral/edit/index.js +0 -109
- package/dist/commands/ephemeral/get/index.d.ts +0 -21
- package/dist/commands/ephemeral/get/index.js +0 -125
- package/dist/commands/ephemeral/impersonate/index.d.ts +0 -20
- package/dist/commands/ephemeral/impersonate/index.js +0 -120
- package/dist/commands/ephemeral/list/index.d.ts +0 -19
- package/dist/commands/ephemeral/list/index.js +0 -123
- package/dist/commands/ephemeral/pull/index.d.ts +0 -19
- package/dist/commands/ephemeral/pull/index.js +0 -164
- package/dist/commands/ephemeral/push/index.d.ts +0 -25
- package/dist/commands/ephemeral/push/index.js +0 -144
- package/dist/commands/ephemeral/static_host/build/delete/index.d.ts +0 -20
- package/dist/commands/ephemeral/static_host/build/delete/index.js +0 -121
- package/dist/commands/ephemeral/static_host/build/get/index.d.ts +0 -18
- package/dist/commands/ephemeral/static_host/build/get/index.js +0 -137
- package/dist/commands/ephemeral/static_host/build/list/index.d.ts +0 -18
- package/dist/commands/ephemeral/static_host/build/list/index.js +0 -137
- package/dist/commands/ephemeral/static_host/build/pull/index.d.ts +0 -53
- package/dist/commands/ephemeral/static_host/build/pull/index.js +0 -308
- package/dist/commands/ephemeral/static_host/build/push/index.d.ts +0 -24
- package/dist/commands/ephemeral/static_host/build/push/index.js +0 -250
- package/dist/commands/ephemeral/static_host/create/index.d.ts +0 -18
- package/dist/commands/ephemeral/static_host/create/index.js +0 -92
- package/dist/commands/ephemeral/static_host/deploy/index.d.ts +0 -19
- package/dist/commands/ephemeral/static_host/deploy/index.js +0 -112
- package/dist/commands/ephemeral/static_host/edit/index.d.ts +0 -24
- package/dist/commands/ephemeral/static_host/edit/index.js +0 -158
- package/dist/commands/ephemeral/static_host/get/index.d.ts +0 -19
- package/dist/commands/ephemeral/static_host/get/index.js +0 -101
- package/dist/commands/ephemeral/static_host/list/index.d.ts +0 -17
- package/dist/commands/ephemeral/static_host/list/index.js +0 -132
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import BaseCommand from '../../../../base-command.js';
|
|
3
|
-
import { buildPagingJson, buildPagingParams, formatPagingFooter, normalizeListResponse, pagingFlags } from '../../../../utils/paging.js';
|
|
4
|
-
export default class EphemeralStaticHostList extends BaseCommand {
|
|
5
|
-
static args = {
|
|
6
|
-
tenant_name: Args.string({
|
|
7
|
-
description: 'Ephemeral tenant name',
|
|
8
|
-
required: true,
|
|
9
|
-
}),
|
|
10
|
-
};
|
|
11
|
-
static description = 'List all static hosts for an ephemeral tenant from the Xano Metadata API';
|
|
12
|
-
static examples = [
|
|
13
|
-
`$ xano ephemeral static_host list e4f2-9ab1-xyz1 -w 40
|
|
14
|
-
Available static hosts:
|
|
15
|
-
- my-static-host (ID: 1)
|
|
16
|
-
- another-host (ID: 2)
|
|
17
|
-
`,
|
|
18
|
-
`$ xano ephemeral static_host list e4f2-9ab1-xyz1 --profile production
|
|
19
|
-
Available static hosts:
|
|
20
|
-
- my-static-host (ID: 1)
|
|
21
|
-
- another-host (ID: 2)
|
|
22
|
-
`,
|
|
23
|
-
`$ xano ephemeral static_host list e4f2-9ab1-xyz1 -w 40 --output json
|
|
24
|
-
{
|
|
25
|
-
"count": 1,
|
|
26
|
-
"page": 1,
|
|
27
|
-
"total": 3,
|
|
28
|
-
"items": [
|
|
29
|
-
{
|
|
30
|
-
"id": 1,
|
|
31
|
-
"name": "my-static-host"
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
`,
|
|
36
|
-
`$ xano ephemeral static_host list e4f2-9ab1-xyz1 -p staging -o json --page 2
|
|
37
|
-
[
|
|
38
|
-
{
|
|
39
|
-
"id": 3,
|
|
40
|
-
"name": "static-host-3"
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
`,
|
|
44
|
-
];
|
|
45
|
-
static flags = {
|
|
46
|
-
...BaseCommand.baseFlags,
|
|
47
|
-
output: Flags.string({
|
|
48
|
-
char: 'o',
|
|
49
|
-
default: 'summary',
|
|
50
|
-
description: 'Output format',
|
|
51
|
-
options: ['summary', 'json'],
|
|
52
|
-
required: false,
|
|
53
|
-
}),
|
|
54
|
-
...pagingFlags('page-only-envelope', { fixedPerPage: 100 }),
|
|
55
|
-
workspace: Flags.string({
|
|
56
|
-
char: 'w',
|
|
57
|
-
description: 'Workspace ID (optional if set in profile)',
|
|
58
|
-
required: false,
|
|
59
|
-
}),
|
|
60
|
-
};
|
|
61
|
-
async run() {
|
|
62
|
-
const { args, flags } = await this.parse(EphemeralStaticHostList);
|
|
63
|
-
const { profile, profileName } = this.resolveProfile(flags);
|
|
64
|
-
const tenantName = args.tenant_name;
|
|
65
|
-
// Determine workspace_id from flag or profile
|
|
66
|
-
let workspaceId;
|
|
67
|
-
if (flags.workspace) {
|
|
68
|
-
workspaceId = flags.workspace;
|
|
69
|
-
}
|
|
70
|
-
else if (profile.workspace) {
|
|
71
|
-
workspaceId = profile.workspace;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this.error(`Workspace ID is required. Either:\n` +
|
|
75
|
-
` 1. Provide it as a flag: xano ephemeral static_host list <tenant_name> -w <workspace_id>\n` +
|
|
76
|
-
` 2. Set it in your profile using: xano profile:edit ${profileName} -w <workspace_id>`);
|
|
77
|
-
}
|
|
78
|
-
// Build query parameters
|
|
79
|
-
const queryParams = new URLSearchParams(buildPagingParams(flags, 'page-only-envelope'));
|
|
80
|
-
// Construct the API URL
|
|
81
|
-
const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/static_host?${queryParams.toString()}`;
|
|
82
|
-
// Fetch static hosts from the API
|
|
83
|
-
try {
|
|
84
|
-
const response = await this.verboseFetch(apiUrl, {
|
|
85
|
-
headers: {
|
|
86
|
-
'accept': 'application/json',
|
|
87
|
-
'Authorization': `Bearer ${profile.access_token}`,
|
|
88
|
-
},
|
|
89
|
-
method: 'GET',
|
|
90
|
-
}, flags.verbose, profile.access_token);
|
|
91
|
-
if (!response.ok) {
|
|
92
|
-
const errorText = await response.text();
|
|
93
|
-
this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
|
|
94
|
-
}
|
|
95
|
-
const list = normalizeListResponse(await response.json(), ['static_hosts']);
|
|
96
|
-
const staticHosts = list.items;
|
|
97
|
-
// Output results
|
|
98
|
-
if (flags.output === 'json') {
|
|
99
|
-
this.log(JSON.stringify(buildPagingJson(list, { page: flags.page, tier: 'page-only-envelope' }), null, 2));
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
// summary format
|
|
103
|
-
if (staticHosts.length === 0) {
|
|
104
|
-
this.log('No static hosts found');
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
this.log('Available static hosts:');
|
|
108
|
-
for (const host of staticHosts) {
|
|
109
|
-
if (host.id === undefined) {
|
|
110
|
-
this.log(` - ${host.name}`);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
const domainInfo = host.domain ? ` - ${host.domain}` : '';
|
|
114
|
-
this.log(` - ${host.name} (ID: ${host.id})${domainInfo}`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
const footer = formatPagingFooter(list, { noun: 'static host', page: flags.page, tier: 'page-only-envelope' });
|
|
119
|
-
if (footer)
|
|
120
|
-
this.log(footer);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
if (error instanceof Error) {
|
|
125
|
-
this.error(`Failed to fetch static hosts: ${error.message}`);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
this.error(`Failed to fetch static hosts: ${String(error)}`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|