@xano/cli 1.0.6-beta.0 → 1.0.6-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.
Files changed (36) hide show
  1. package/README.md +29 -3
  2. package/dist/base-command.d.ts +2 -0
  3. package/dist/base-command.js +10 -4
  4. package/dist/commands/ephemeral/impersonate/index.d.ts +1 -0
  5. package/dist/commands/ephemeral/impersonate/index.js +11 -3
  6. package/dist/commands/ephemeral/pull/index.d.ts +3 -1
  7. package/dist/commands/ephemeral/pull/index.js +15 -14
  8. package/dist/commands/ephemeral/push/index.d.ts +3 -1
  9. package/dist/commands/ephemeral/push/index.js +17 -16
  10. package/dist/commands/ephemeral/static_host/build/delete/index.d.ts +20 -0
  11. package/dist/commands/ephemeral/static_host/build/delete/index.js +121 -0
  12. package/dist/commands/ephemeral/static_host/build/get/index.d.ts +18 -0
  13. package/dist/commands/ephemeral/static_host/build/get/index.js +137 -0
  14. package/dist/commands/ephemeral/static_host/build/list/index.d.ts +19 -0
  15. package/dist/commands/ephemeral/static_host/build/list/index.js +158 -0
  16. package/dist/commands/ephemeral/static_host/build/pull/index.d.ts +53 -0
  17. package/dist/commands/ephemeral/static_host/build/pull/index.js +308 -0
  18. package/dist/commands/ephemeral/static_host/build/push/index.d.ts +24 -0
  19. package/dist/commands/ephemeral/static_host/build/push/index.js +250 -0
  20. package/dist/commands/ephemeral/static_host/create/index.d.ts +18 -0
  21. package/dist/commands/ephemeral/static_host/create/index.js +92 -0
  22. package/dist/commands/ephemeral/static_host/deploy/index.d.ts +19 -0
  23. package/dist/commands/ephemeral/static_host/deploy/index.js +112 -0
  24. package/dist/commands/ephemeral/static_host/edit/index.d.ts +24 -0
  25. package/dist/commands/ephemeral/static_host/edit/index.js +158 -0
  26. package/dist/commands/ephemeral/static_host/get/index.d.ts +19 -0
  27. package/dist/commands/ephemeral/static_host/get/index.js +101 -0
  28. package/dist/commands/ephemeral/static_host/list/index.d.ts +18 -0
  29. package/dist/commands/ephemeral/static_host/list/index.js +152 -0
  30. package/dist/commands/tenant/pull/index.js +12 -1
  31. package/dist/commands/workspace/git/pull/index.js +10 -1
  32. package/dist/commands/workspace/pull/index.js +21 -1
  33. package/dist/utils/document-parser.d.ts +26 -0
  34. package/dist/utils/document-parser.js +38 -1
  35. package/oclif.manifest.json +3832 -2632
  36. package/package.json +7 -1
@@ -0,0 +1,158 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import BaseCommand from '../../../../../base-command.js';
3
+ export default class EphemeralStaticHostBuildList extends BaseCommand {
4
+ static args = {
5
+ tenant_name: Args.string({
6
+ description: 'Ephemeral tenant name',
7
+ required: true,
8
+ }),
9
+ };
10
+ static description = 'List all builds for a static host of an ephemeral tenant';
11
+ static examples = [
12
+ `$ xano ephemeral static_host build list e4f2-9ab1-xyz1 --static-host default -w 40
13
+ Available builds:
14
+ - v1.0.0 (ID: 1) - Status: completed
15
+ - v1.0.1 (ID: 2) - Status: pending
16
+ `,
17
+ `$ xano ephemeral static_host build list e4f2-9ab1-xyz1 -H myhost --profile production
18
+ Available builds:
19
+ - production (ID: 1) - Status: completed
20
+ - staging (ID: 2) - Status: completed
21
+ `,
22
+ `$ xano ephemeral static_host build list e4f2-9ab1-xyz1 -H default -w 40 --output json
23
+ [
24
+ {
25
+ "id": 1,
26
+ "name": "v1.0.0",
27
+ "status": "completed"
28
+ }
29
+ ]
30
+ `,
31
+ `$ xano ephemeral static_host build list e4f2-9ab1-xyz1 -H default -p staging -o json --page 2
32
+ [
33
+ {
34
+ "id": 3,
35
+ "name": "v1.0.2"
36
+ }
37
+ ]
38
+ `,
39
+ ];
40
+ static flags = {
41
+ ...BaseCommand.baseFlags,
42
+ output: Flags.string({
43
+ char: 'o',
44
+ default: 'summary',
45
+ description: 'Output format',
46
+ options: ['summary', 'json'],
47
+ required: false,
48
+ }),
49
+ page: Flags.integer({
50
+ default: 1,
51
+ description: 'Page number for pagination',
52
+ required: false,
53
+ }),
54
+ per_page: Flags.integer({
55
+ default: 50,
56
+ description: 'Number of results per page',
57
+ required: false,
58
+ }),
59
+ 'static-host': Flags.string({
60
+ char: 'H',
61
+ description: 'Static host name',
62
+ required: true,
63
+ }),
64
+ workspace: Flags.string({
65
+ char: 'w',
66
+ description: 'Workspace ID (optional if set in profile)',
67
+ required: false,
68
+ }),
69
+ };
70
+ async run() {
71
+ const { args, flags } = await this.parse(EphemeralStaticHostBuildList);
72
+ const { profile, profileName } = this.resolveProfile(flags);
73
+ const tenantName = args.tenant_name;
74
+ const staticHost = flags['static-host'];
75
+ // Determine workspace_id from flag or profile
76
+ let workspaceId;
77
+ if (flags.workspace) {
78
+ workspaceId = flags.workspace;
79
+ }
80
+ else if (profile.workspace) {
81
+ workspaceId = profile.workspace;
82
+ }
83
+ else {
84
+ this.error(`Workspace ID is required. Either:\n` +
85
+ ` 1. Provide it as a flag: xano ephemeral static_host build list <tenant_name> --static-host <static_host> -w <workspace_id>\n` +
86
+ ` 2. Set it in your profile using: xano profile:edit ${profileName} -w <workspace_id>`);
87
+ }
88
+ // Build query parameters
89
+ const queryParams = new URLSearchParams({
90
+ page: flags.page.toString(),
91
+ });
92
+ // Only add per_page if it's not the default value
93
+ if (flags.per_page !== 50) {
94
+ queryParams.append('per_page', flags.per_page.toString());
95
+ }
96
+ // Construct the API URL
97
+ const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/static_host/${staticHost}/build?${queryParams.toString()}`;
98
+ // Fetch builds from the API
99
+ try {
100
+ const response = await this.verboseFetch(apiUrl, {
101
+ headers: {
102
+ 'accept': 'application/json',
103
+ 'Authorization': `Bearer ${profile.access_token}`,
104
+ },
105
+ method: 'GET',
106
+ }, flags.verbose, profile.access_token);
107
+ if (!response.ok) {
108
+ const errorText = await response.text();
109
+ this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
110
+ }
111
+ const data = await response.json();
112
+ // Handle different response formats
113
+ let builds;
114
+ if (Array.isArray(data)) {
115
+ builds = data;
116
+ }
117
+ else if (data && typeof data === 'object' && 'builds' in data && Array.isArray(data.builds)) {
118
+ builds = data.builds;
119
+ }
120
+ else if (data && typeof data === 'object' && 'items' in data && Array.isArray(data.items)) {
121
+ builds = data.items;
122
+ }
123
+ else {
124
+ this.error('Unexpected API response format');
125
+ }
126
+ // Output results
127
+ if (flags.output === 'json') {
128
+ this.log(JSON.stringify(builds, null, 2));
129
+ }
130
+ else {
131
+ // summary format
132
+ if (builds.length === 0) {
133
+ this.log('No builds found');
134
+ }
135
+ else {
136
+ this.log('Available builds:');
137
+ for (const build of builds) {
138
+ if (build.id === undefined) {
139
+ this.log(` - ${build.name}`);
140
+ }
141
+ else {
142
+ const statusInfo = build.status ? ` - Status: ${build.status}` : '';
143
+ this.log(` - ${build.name} (ID: ${build.id})${statusInfo}`);
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+ catch (error) {
150
+ if (error instanceof Error) {
151
+ this.error(`Failed to fetch builds: ${error.message}`);
152
+ }
153
+ else {
154
+ this.error(`Failed to fetch builds: ${String(error)}`);
155
+ }
156
+ }
157
+ }
158
+ }
@@ -0,0 +1,53 @@
1
+ import BaseCommand from '../../../../../base-command.js';
2
+ export interface StaticHostEnv {
3
+ canonical?: null | string;
4
+ }
5
+ export interface StaticHostSummary {
6
+ [k: string]: unknown;
7
+ dev?: StaticHostEnv;
8
+ name: string;
9
+ prod?: StaticHostEnv;
10
+ }
11
+ export interface BuildSummary {
12
+ canonical?: string;
13
+ id: number;
14
+ }
15
+ /**
16
+ * Find the deployed `canonical` for a static host's env from a list of hosts.
17
+ * Returns null when the host isn't present or nothing is deployed to that env.
18
+ */
19
+ export declare function extractEnvCanonical(hosts: StaticHostSummary[], staticHost: string, env: string): null | string;
20
+ /** Find the build whose unique `canonical` matches, or null if none do. */
21
+ export declare function findBuildByCanonical(builds: BuildSummary[], canonical: string): BuildSummary | null;
22
+ export default class EphemeralStaticHostBuildPull extends BaseCommand {
23
+ static args: {
24
+ tenant_name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
25
+ };
26
+ static description: string;
27
+ static examples: string[];
28
+ static flags: {
29
+ build_id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
30
+ directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
31
+ env: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
32
+ latest: import("@oclif/core/interfaces").BooleanFlag<boolean>;
33
+ source: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
34
+ 'static-host': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
35
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
36
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
37
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
38
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
39
+ };
40
+ run(): Promise<void>;
41
+ private parseFileDocument;
42
+ /**
43
+ * Resolve the build ID currently deployed to a static host's dev/prod env.
44
+ *
45
+ * The deployed env stores the `canonical` of the build it was created from
46
+ * (static_host.{env}.canonical). Each build carries that same unique
47
+ * `canonical`, so we match the env's canonical against the build list to
48
+ * recover the build ID — a shortcut for "list builds, find the deployed one,
49
+ * then pull it".
50
+ */
51
+ private resolveEnvBuild;
52
+ private resolveLatestBuild;
53
+ }
@@ -0,0 +1,308 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import * as fs from 'node:fs';
3
+ import * as path from 'node:path';
4
+ import BaseCommand from '../../../../../base-command.js';
5
+ /**
6
+ * Find the deployed `canonical` for a static host's env from a list of hosts.
7
+ * Returns null when the host isn't present or nothing is deployed to that env.
8
+ */
9
+ export function extractEnvCanonical(hosts, staticHost, env) {
10
+ const host = hosts.find((h) => h.name === staticHost);
11
+ if (!host) {
12
+ return null;
13
+ }
14
+ const envObj = host[env];
15
+ return envObj?.canonical ?? null;
16
+ }
17
+ /** Find the build whose unique `canonical` matches, or null if none do. */
18
+ export function findBuildByCanonical(builds, canonical) {
19
+ return builds.find((b) => b.canonical === canonical) ?? null;
20
+ }
21
+ export default class EphemeralStaticHostBuildPull extends BaseCommand {
22
+ static args = {
23
+ tenant_name: Args.string({
24
+ description: 'Ephemeral tenant name',
25
+ required: true,
26
+ }),
27
+ };
28
+ static description = 'Pull a static host build for an ephemeral tenant to disk. Defaults to the original uploaded source (including package.json); use --source built for the compiled/served output.';
29
+ static examples = [
30
+ `$ xano ephemeral static_host build pull e4f2-9ab1-xyz1 --static-host default --build_id 52
31
+ Pulled 15 files to current directory
32
+ `,
33
+ `$ xano ephemeral static_host build pull e4f2-9ab1-xyz1 -H default --build_id 52 -d ./output
34
+ Pulled 15 files to ./output
35
+ `,
36
+ `$ xano ephemeral static_host build pull e4f2-9ab1-xyz1 -H myhost --build_id 123 -w 40
37
+ Pulled 8 files to current directory
38
+ `,
39
+ `$ xano ephemeral static_host build pull e4f2-9ab1-xyz1 -H default --latest
40
+ Pulled 22 files to current directory
41
+ `,
42
+ `$ xano ephemeral static_host build pull e4f2-9ab1-xyz1 -H default --env dev
43
+ Pulled 18 files to current directory
44
+ `,
45
+ `$ xano ephemeral static_host build pull e4f2-9ab1-xyz1 -H default --env prod -d ./prod-release
46
+ Pulled 18 files to ./prod-release
47
+ `,
48
+ `$ xano ephemeral static_host build pull e4f2-9ab1-xyz1 -H default --build_id 52 --source built
49
+ Pulled the compiled/served output instead of the original source
50
+ `,
51
+ ];
52
+ static flags = {
53
+ ...BaseCommand.baseFlags,
54
+ build_id: Flags.string({
55
+ description: 'Build ID to pull',
56
+ exclusive: ['latest', 'env'],
57
+ required: false,
58
+ }),
59
+ directory: Flags.string({
60
+ char: 'd',
61
+ default: '.',
62
+ description: 'Output directory for pulled files (defaults to current directory)',
63
+ required: false,
64
+ }),
65
+ env: Flags.string({
66
+ description: 'Pull the build currently deployed to this environment',
67
+ exclusive: ['build_id', 'latest'],
68
+ options: ['dev', 'prod'],
69
+ required: false,
70
+ }),
71
+ latest: Flags.boolean({
72
+ default: false,
73
+ description: 'Pull the latest build',
74
+ exclusive: ['build_id', 'env'],
75
+ required: false,
76
+ }),
77
+ source: Flags.string({
78
+ default: 'original',
79
+ description: 'Which files to pull: "original" (the uploaded source, including package.json) or "built" (the compiled/served output)',
80
+ options: ['original', 'built'],
81
+ required: false,
82
+ }),
83
+ 'static-host': Flags.string({
84
+ char: 'H',
85
+ description: 'Static host name',
86
+ required: true,
87
+ }),
88
+ workspace: Flags.string({
89
+ char: 'w',
90
+ description: 'Workspace ID (optional if set in profile)',
91
+ required: false,
92
+ }),
93
+ };
94
+ async run() {
95
+ const { args, flags } = await this.parse(EphemeralStaticHostBuildPull);
96
+ if (!flags.build_id && !flags.latest && !flags.env) {
97
+ this.error('One of --build_id <id>, --latest, or --env <dev|prod> is required');
98
+ }
99
+ const { profile, profileName } = this.resolveProfile(flags);
100
+ const tenantName = args.tenant_name;
101
+ const staticHost = flags['static-host'];
102
+ let workspaceId;
103
+ if (flags.workspace) {
104
+ workspaceId = flags.workspace;
105
+ }
106
+ else if (profile.workspace) {
107
+ workspaceId = profile.workspace;
108
+ }
109
+ else {
110
+ this.error(`Workspace ID is required. Either:\n` +
111
+ ` 1. Provide it as a flag: xano ephemeral static_host build pull <tenant_name> --static-host <static_host> --build_id <id> -w <workspace_id>\n` +
112
+ ` 2. Set it in your profile using: xano profile edit ${profileName} -w <workspace_id>`);
113
+ }
114
+ let buildId;
115
+ if (flags.build_id) {
116
+ buildId = flags.build_id;
117
+ }
118
+ else if (flags.env) {
119
+ buildId = await this.resolveEnvBuild({
120
+ env: flags.env,
121
+ profile,
122
+ staticHost,
123
+ tenantName,
124
+ verbose: flags.verbose,
125
+ workspaceId,
126
+ });
127
+ }
128
+ else {
129
+ buildId = await this.resolveLatestBuild(profile, workspaceId, tenantName, staticHost, flags.verbose);
130
+ }
131
+ // Default is "original" (the uploaded source); only append the param when
132
+ // pulling the built output, so default requests stay clean.
133
+ const query = flags.source === 'built' ? '?source=built' : '';
134
+ const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/static_host/${staticHost}/build/${buildId}/multidoc${query}`;
135
+ let responseText;
136
+ try {
137
+ const response = await this.verboseFetch(apiUrl, {
138
+ headers: {
139
+ accept: 'application/json',
140
+ Authorization: `Bearer ${profile.access_token}`,
141
+ },
142
+ method: 'GET',
143
+ }, flags.verbose, profile.access_token);
144
+ if (!response.ok) {
145
+ const errorText = await response.text();
146
+ this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
147
+ }
148
+ responseText = await response.text();
149
+ }
150
+ catch (error) {
151
+ if (error instanceof Error) {
152
+ this.error(`Failed to fetch build multidoc: ${error.message}`);
153
+ }
154
+ else {
155
+ this.error(`Failed to fetch build multidoc: ${String(error)}`);
156
+ }
157
+ }
158
+ if (!responseText.trim()) {
159
+ this.log('No files found in build');
160
+ return;
161
+ }
162
+ const rawDocuments = responseText.split('\n---\n');
163
+ const files = [];
164
+ for (const raw of rawDocuments) {
165
+ const trimmed = raw.trim();
166
+ if (!trimmed)
167
+ continue;
168
+ const parsed = this.parseFileDocument(trimmed);
169
+ if (parsed) {
170
+ files.push(parsed);
171
+ }
172
+ }
173
+ if (files.length === 0) {
174
+ this.log('No files found in response');
175
+ return;
176
+ }
177
+ const outputDir = path.resolve(flags.directory);
178
+ fs.mkdirSync(outputDir, { recursive: true });
179
+ let writtenCount = 0;
180
+ for (const file of files) {
181
+ const filePath = path.resolve(outputDir, file.path);
182
+ if (!filePath.startsWith(outputDir + path.sep) && filePath !== outputDir) {
183
+ this.warn(`Skipping file with path outside output directory: ${file.path}`);
184
+ continue;
185
+ }
186
+ const fileDir = path.dirname(filePath);
187
+ fs.mkdirSync(fileDir, { recursive: true });
188
+ if (file.encoding === 'base64') {
189
+ const buffer = Buffer.from(file.content, 'base64');
190
+ fs.writeFileSync(filePath, buffer);
191
+ }
192
+ else {
193
+ fs.writeFileSync(filePath, file.content, 'utf8');
194
+ }
195
+ writtenCount++;
196
+ }
197
+ this.log(`Pulled ${writtenCount} files to ${flags.directory}`);
198
+ }
199
+ parseFileDocument(raw) {
200
+ const lines = raw.split('\n');
201
+ const firstLine = lines[0];
202
+ if (!firstLine.startsWith('path: ')) {
203
+ return null;
204
+ }
205
+ const filePath = firstLine.slice('path: '.length).trim();
206
+ if (lines.length > 1 && lines[1] === 'encoding: base64') {
207
+ const content = lines.slice(2).join('\n');
208
+ return { content, encoding: 'base64', path: filePath };
209
+ }
210
+ const content = lines.slice(1).join('\n');
211
+ return { content, path: filePath };
212
+ }
213
+ /**
214
+ * Resolve the build ID currently deployed to a static host's dev/prod env.
215
+ *
216
+ * The deployed env stores the `canonical` of the build it was created from
217
+ * (static_host.{env}.canonical). Each build carries that same unique
218
+ * `canonical`, so we match the env's canonical against the build list to
219
+ * recover the build ID — a shortcut for "list builds, find the deployed one,
220
+ * then pull it".
221
+ */
222
+ async resolveEnvBuild(opts) {
223
+ const { env, profile, staticHost, tenantName, verbose, workspaceId } = opts;
224
+ // 1. Look up the static host to read the deployed canonical for this env.
225
+ const hostUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/static_host`;
226
+ const hostResponse = await this.verboseFetch(hostUrl, {
227
+ headers: {
228
+ accept: 'application/json',
229
+ Authorization: `Bearer ${profile.access_token}`,
230
+ },
231
+ method: 'GET',
232
+ }, verbose, profile.access_token);
233
+ if (!hostResponse.ok) {
234
+ const errorText = await hostResponse.text();
235
+ this.error(`Failed to list static hosts: ${hostResponse.status} ${hostResponse.statusText}\n${errorText}`);
236
+ }
237
+ const hostData = (await hostResponse.json());
238
+ const hosts = Array.isArray(hostData)
239
+ ? hostData
240
+ : hostData && typeof hostData === 'object' && 'items' in hostData && Array.isArray(hostData.items)
241
+ ? hostData.items
242
+ : [];
243
+ const canonical = extractEnvCanonical(hosts, staticHost, env);
244
+ if (!canonical) {
245
+ if (!hosts.some((h) => h.name === staticHost)) {
246
+ this.error(`Static host '${staticHost}' not found`);
247
+ }
248
+ this.error(`No build is deployed to the '${env}' environment of static host '${staticHost}'`);
249
+ }
250
+ // 2. Page through builds to find the one matching the deployed canonical.
251
+ const perPage = 100;
252
+ for (let page = 1;; page++) {
253
+ const listUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/static_host/${staticHost}/build?page=${page}&per_page=${perPage}`;
254
+ // eslint-disable-next-line no-await-in-loop
255
+ const response = await this.verboseFetch(listUrl, {
256
+ headers: {
257
+ accept: 'application/json',
258
+ Authorization: `Bearer ${profile.access_token}`,
259
+ },
260
+ method: 'GET',
261
+ }, verbose, profile.access_token);
262
+ if (!response.ok) {
263
+ // eslint-disable-next-line no-await-in-loop
264
+ const errorText = await response.text();
265
+ this.error(`Failed to list builds: ${response.status} ${response.statusText}\n${errorText}`);
266
+ }
267
+ // eslint-disable-next-line no-await-in-loop
268
+ const data = (await response.json());
269
+ const builds = Array.isArray(data)
270
+ ? data
271
+ : data && typeof data === 'object' && 'items' in data && Array.isArray(data.items)
272
+ ? data.items
273
+ : [];
274
+ const match = findBuildByCanonical(builds, canonical);
275
+ if (match) {
276
+ return String(match.id);
277
+ }
278
+ if (builds.length < perPage) {
279
+ // Reached the last page without a match.
280
+ this.error(`Could not find the build deployed to '${env}' (canonical ${canonical}) in the build list for '${staticHost}'`);
281
+ }
282
+ }
283
+ }
284
+ async resolveLatestBuild(profile, workspaceId, tenantName, staticHost, verbose) {
285
+ const listUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/static_host/${staticHost}/build?page=1&per_page=1`;
286
+ const response = await this.verboseFetch(listUrl, {
287
+ headers: {
288
+ accept: 'application/json',
289
+ Authorization: `Bearer ${profile.access_token}`,
290
+ },
291
+ method: 'GET',
292
+ }, verbose, profile.access_token);
293
+ if (!response.ok) {
294
+ const errorText = await response.text();
295
+ this.error(`Failed to list builds: ${response.status} ${response.statusText}\n${errorText}`);
296
+ }
297
+ const data = await response.json();
298
+ const builds = Array.isArray(data)
299
+ ? data
300
+ : data && typeof data === 'object' && 'items' in data && Array.isArray(data.items)
301
+ ? data.items
302
+ : [];
303
+ if (builds.length === 0) {
304
+ this.error(`No builds found for static host '${staticHost}'`);
305
+ }
306
+ return String(builds[0].id);
307
+ }
308
+ }
@@ -0,0 +1,24 @@
1
+ import BaseCommand from '../../../../../base-command.js';
2
+ export default class EphemeralStaticHostBuildPush extends BaseCommand {
3
+ static args: {
4
+ tenant_name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ directory: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'no-gitignore': import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ 'no-wait': import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
+ 'static-host': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
+ };
22
+ run(): Promise<void>;
23
+ private createZipBuffer;
24
+ }