@eve-horizon/cli 0.2.28 → 0.2.29
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/dist/index.js +119 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -50288,7 +50288,7 @@ for cloud deployments. Credentials are stored globally per API URL.`,
|
|
|
50288
50288
|
]
|
|
50289
50289
|
},
|
|
50290
50290
|
admin: {
|
|
50291
|
-
description: "Administrative commands for user and
|
|
50291
|
+
description: "Administrative commands for user, identity, and platform operations.",
|
|
50292
50292
|
usage: "eve admin <subcommand> [options]",
|
|
50293
50293
|
subcommands: {
|
|
50294
50294
|
invite: {
|
|
@@ -50304,11 +50304,24 @@ for cloud deployments. Credentials are stored globally per API URL.`,
|
|
|
50304
50304
|
"eve admin invite --email user@example.com --github octocat",
|
|
50305
50305
|
"eve admin invite --email user@example.com --github octocat --role admin --org org_xxx"
|
|
50306
50306
|
]
|
|
50307
|
+
},
|
|
50308
|
+
"ingress-aliases": {
|
|
50309
|
+
description: "Inspect and reclaim ingress alias claims (system admin)",
|
|
50310
|
+
usage: "eve admin ingress-aliases <list|reclaim> [options]",
|
|
50311
|
+
options: [
|
|
50312
|
+
"list options: --alias <name> --project <id> --environment <id|null> --limit <n> --offset <n>",
|
|
50313
|
+
'reclaim usage: eve admin ingress-aliases reclaim <alias> --reason "<text>"'
|
|
50314
|
+
],
|
|
50315
|
+
examples: [
|
|
50316
|
+
"eve admin ingress-aliases list --project proj_xxx",
|
|
50317
|
+
'eve admin ingress-aliases reclaim eve-pm --reason "Reserved org rename"'
|
|
50318
|
+
]
|
|
50307
50319
|
}
|
|
50308
50320
|
},
|
|
50309
50321
|
examples: [
|
|
50310
50322
|
"eve admin invite --email user@example.com --github octocat",
|
|
50311
|
-
"eve admin invite --email user@example.com --github octocat --org org_xxx"
|
|
50323
|
+
"eve admin invite --email user@example.com --github octocat --org org_xxx",
|
|
50324
|
+
"eve admin ingress-aliases list"
|
|
50312
50325
|
]
|
|
50313
50326
|
},
|
|
50314
50327
|
release: {
|
|
@@ -51321,7 +51334,7 @@ function showMainHelp() {
|
|
|
51321
51334
|
console.log(" analytics Org analytics (jobs, pipelines, env health)");
|
|
51322
51335
|
console.log(" ollama Manage inference targets, aliases, and model routes");
|
|
51323
51336
|
console.log(" access Access control: permissions, roles, bindings, policy-as-code sync");
|
|
51324
|
-
console.log(" admin User and
|
|
51337
|
+
console.log(" admin User and platform admin operations");
|
|
51325
51338
|
console.log(" skills Install skills from skills.txt (skills CLI)");
|
|
51326
51339
|
console.log(" migrate Migration helpers for upgrading config formats");
|
|
51327
51340
|
console.log(" system System health and status checks");
|
|
@@ -52116,7 +52129,12 @@ async function fetchProfileStatus(ctx, envFilter) {
|
|
|
52116
52129
|
let services = [];
|
|
52117
52130
|
try {
|
|
52118
52131
|
const diagnose = await requestJson(ctx, `/projects/${ctx.projectId}/envs/${env.name}/diagnose`);
|
|
52119
|
-
services = buildStatusServices(
|
|
52132
|
+
services = buildStatusServices(
|
|
52133
|
+
diagnose.pods,
|
|
52134
|
+
diagnose.namespace ?? env.namespace,
|
|
52135
|
+
domain,
|
|
52136
|
+
env.ingress_aliases ?? []
|
|
52137
|
+
);
|
|
52120
52138
|
} catch {
|
|
52121
52139
|
}
|
|
52122
52140
|
environments.push({
|
|
@@ -52135,7 +52153,7 @@ async function fetchProfileStatus(ctx, envFilter) {
|
|
|
52135
52153
|
environments
|
|
52136
52154
|
};
|
|
52137
52155
|
}
|
|
52138
|
-
function buildStatusServices(pods, namespace, domain) {
|
|
52156
|
+
function buildStatusServices(pods, namespace, domain, ingressAliases) {
|
|
52139
52157
|
const services = /* @__PURE__ */ new Map();
|
|
52140
52158
|
for (const pod of pods) {
|
|
52141
52159
|
const component = pod.labels["eve.component"] || pod.labels["app.kubernetes.io/name"] || pod.labels["app"] || pod.labels["component"] || "unknown";
|
|
@@ -52149,12 +52167,14 @@ function buildStatusServices(pods, namespace, domain) {
|
|
|
52149
52167
|
const allDone = info.phases.size > 0 && [...info.phases].every((p) => p === "Succeeded" || p === "Failed");
|
|
52150
52168
|
const status = allDone ? "completed" : info.ready === info.total ? "ready" : "not-ready";
|
|
52151
52169
|
const url = !allDone && namespace && domain ? buildServiceUrl(name, namespace, domain) : null;
|
|
52170
|
+
const aliasUrls = !allDone && domain ? ingressAliases.filter((entry) => entry.service_name === name).map((entry) => buildAliasUrl(entry.alias, domain)).sort((a, b2) => a.localeCompare(b2)) : [];
|
|
52152
52171
|
return {
|
|
52153
52172
|
name,
|
|
52154
52173
|
pods_ready: info.ready,
|
|
52155
52174
|
pods_total: info.total,
|
|
52156
52175
|
status,
|
|
52157
|
-
url
|
|
52176
|
+
url,
|
|
52177
|
+
alias_urls: aliasUrls
|
|
52158
52178
|
};
|
|
52159
52179
|
});
|
|
52160
52180
|
}
|
|
@@ -52173,6 +52193,10 @@ function buildServiceUrl(component, namespace, domain) {
|
|
|
52173
52193
|
const secure = !domain.includes("lvh.me") && !domain.includes("localhost");
|
|
52174
52194
|
return `${secure ? "https" : "http"}://${component}.${slug}.${domain}`;
|
|
52175
52195
|
}
|
|
52196
|
+
function buildAliasUrl(alias, domain) {
|
|
52197
|
+
const secure = !domain.includes("lvh.me") && !domain.includes("localhost");
|
|
52198
|
+
return `${secure ? "https" : "http"}://${alias}.${domain}`;
|
|
52199
|
+
}
|
|
52176
52200
|
function formatStatusOutput(results) {
|
|
52177
52201
|
for (let i = 0; i < results.length; i++) {
|
|
52178
52202
|
const r = results[i];
|
|
@@ -52211,10 +52235,25 @@ function formatStatusOutput(results) {
|
|
|
52211
52235
|
const podsW = Math.max(...env.services.map((s) => `${s.pods_ready}/${s.pods_total}`.length));
|
|
52212
52236
|
for (const svc of env.services) {
|
|
52213
52237
|
const pods = `${svc.pods_ready}/${svc.pods_total}`;
|
|
52214
|
-
const
|
|
52238
|
+
const urls = [];
|
|
52239
|
+
if (svc.url) {
|
|
52240
|
+
urls.push(svc.url);
|
|
52241
|
+
}
|
|
52242
|
+
for (const aliasUrl of svc.alias_urls ?? []) {
|
|
52243
|
+
if (!urls.includes(aliasUrl)) {
|
|
52244
|
+
urls.push(aliasUrl);
|
|
52245
|
+
}
|
|
52246
|
+
}
|
|
52247
|
+
const urlPart = urls.length > 0 ? ` ${urls[0]}` : "";
|
|
52215
52248
|
console.log(
|
|
52216
52249
|
` ${padRight(svc.name, nameW)} ${padRight(pods, podsW)} ${padRight(svc.status, 9)}${urlPart}`
|
|
52217
52250
|
);
|
|
52251
|
+
if (urls.length > 1) {
|
|
52252
|
+
const prefix = ` ${padRight("", nameW)} ${padRight("", podsW)} ${padRight("", 9)}`;
|
|
52253
|
+
for (const aliasUrl of urls.slice(1)) {
|
|
52254
|
+
console.log(`${prefix} ${aliasUrl}`);
|
|
52255
|
+
}
|
|
52256
|
+
}
|
|
52218
52257
|
}
|
|
52219
52258
|
}
|
|
52220
52259
|
}
|
|
@@ -56731,6 +56770,10 @@ var EnvironmentResponseSchema = external_exports.object({
|
|
|
56731
56770
|
labels: EnvironmentLabelsSchema.nullable(),
|
|
56732
56771
|
current_release_id: external_exports.string().nullable(),
|
|
56733
56772
|
last_failed_release_id: external_exports.string().nullable(),
|
|
56773
|
+
ingress_aliases: external_exports.array(external_exports.object({
|
|
56774
|
+
alias: external_exports.string(),
|
|
56775
|
+
service_name: external_exports.string()
|
|
56776
|
+
})).optional(),
|
|
56734
56777
|
status: EnvironmentStatusSchema,
|
|
56735
56778
|
suspended_at: external_exports.string().nullable(),
|
|
56736
56779
|
suspension_reason: external_exports.string().nullable(),
|
|
@@ -58109,9 +58152,15 @@ var ManagedDbConfigSchema = external_exports.object({
|
|
|
58109
58152
|
engine_version: external_exports.string().optional()
|
|
58110
58153
|
// e.g., '16'
|
|
58111
58154
|
});
|
|
58155
|
+
var IngressAliasPattern = /^[a-z][a-z0-9-]*[a-z0-9]$/;
|
|
58156
|
+
var IngressConfigSchema = external_exports.object({
|
|
58157
|
+
public: external_exports.boolean().optional(),
|
|
58158
|
+
port: external_exports.number().optional(),
|
|
58159
|
+
alias: external_exports.string().min(3).max(63).regex(IngressAliasPattern).optional()
|
|
58160
|
+
}).passthrough();
|
|
58112
58161
|
var ServiceXeveSchema = external_exports.object({
|
|
58113
58162
|
role: external_exports.string().optional(),
|
|
58114
|
-
ingress:
|
|
58163
|
+
ingress: IngressConfigSchema.optional(),
|
|
58115
58164
|
api_spec: ApiSpecSchema.optional(),
|
|
58116
58165
|
api_specs: external_exports.array(ApiSpecSchema).optional(),
|
|
58117
58166
|
external: external_exports.boolean().optional(),
|
|
@@ -67479,6 +67528,12 @@ function formatEnvironmentDetails(env, health) {
|
|
|
67479
67528
|
console.log(` Database Ref: ${env.db_ref || "(none)"}`);
|
|
67480
67529
|
console.log(` Current Release: ${env.current_release_id || "(none)"}`);
|
|
67481
67530
|
console.log(` Last Failed: ${env.last_failed_release_id || "(none)"}`);
|
|
67531
|
+
if (env.ingress_aliases && env.ingress_aliases.length > 0) {
|
|
67532
|
+
console.log(" Ingress Aliases:");
|
|
67533
|
+
for (const entry of env.ingress_aliases) {
|
|
67534
|
+
console.log(` ${entry.alias} -> ${entry.service_name}`);
|
|
67535
|
+
}
|
|
67536
|
+
}
|
|
67482
67537
|
if (health) {
|
|
67483
67538
|
console.log("");
|
|
67484
67539
|
console.log(` Deployment Status: ${health.status}`);
|
|
@@ -73035,6 +73090,61 @@ ${response.length} record(s)`);
|
|
|
73035
73090
|
throw new Error("Usage: eve admin usage <list|summary> --org <orgId> [--since] [--until] [--limit] [--json]");
|
|
73036
73091
|
}
|
|
73037
73092
|
}
|
|
73093
|
+
case "ingress-aliases": {
|
|
73094
|
+
const action = positionals[0] ?? "list";
|
|
73095
|
+
switch (action) {
|
|
73096
|
+
case "list": {
|
|
73097
|
+
const params = new URLSearchParams();
|
|
73098
|
+
const alias = getStringFlag(flags, ["alias"]);
|
|
73099
|
+
const projectId = getStringFlag(flags, ["project", "project_id"]);
|
|
73100
|
+
const environmentId = getStringFlag(flags, ["environment", "env", "environment_id"]);
|
|
73101
|
+
const limit = getStringFlag(flags, ["limit"]);
|
|
73102
|
+
const offset = getStringFlag(flags, ["offset"]);
|
|
73103
|
+
if (alias) params.set("alias", alias);
|
|
73104
|
+
if (projectId) params.set("project_id", projectId);
|
|
73105
|
+
if (environmentId) params.set("environment_id", environmentId);
|
|
73106
|
+
if (limit) params.set("limit", limit);
|
|
73107
|
+
if (offset) params.set("offset", offset);
|
|
73108
|
+
const query = params.toString();
|
|
73109
|
+
const path6 = `/admin/ingress-aliases${query ? `?${query}` : ""}`;
|
|
73110
|
+
const response = await requestJson(context2, path6);
|
|
73111
|
+
if (json) {
|
|
73112
|
+
outputJson(response, true);
|
|
73113
|
+
return;
|
|
73114
|
+
}
|
|
73115
|
+
const rows = Array.isArray(response.data) ? response.data : [];
|
|
73116
|
+
if (rows.length === 0) {
|
|
73117
|
+
console.log("No ingress aliases found.");
|
|
73118
|
+
return;
|
|
73119
|
+
}
|
|
73120
|
+
for (const row of rows) {
|
|
73121
|
+
console.log(`${row.alias} project=${row.project_id} env=${row.environment_id ?? "(reserved)"} service=${row.service_name}`);
|
|
73122
|
+
}
|
|
73123
|
+
console.log(`
|
|
73124
|
+
${rows.length} alias(es)`);
|
|
73125
|
+
return;
|
|
73126
|
+
}
|
|
73127
|
+
case "reclaim": {
|
|
73128
|
+
const alias = positionals[1] ?? getStringFlag(flags, ["alias"]);
|
|
73129
|
+
const reason = getStringFlag(flags, ["reason"]);
|
|
73130
|
+
if (!alias || !reason) {
|
|
73131
|
+
throw new Error('Usage: eve admin ingress-aliases reclaim <alias> --reason "<text>"');
|
|
73132
|
+
}
|
|
73133
|
+
const response = await requestJson(context2, `/admin/ingress-aliases/${encodeURIComponent(alias)}/reclaim`, {
|
|
73134
|
+
method: "POST",
|
|
73135
|
+
body: { reason }
|
|
73136
|
+
});
|
|
73137
|
+
outputJson(
|
|
73138
|
+
response,
|
|
73139
|
+
json,
|
|
73140
|
+
`+ Reclaimed ${response.alias} (project=${response.project_id}, env=${response.environment_id ?? "(reserved)"})`
|
|
73141
|
+
);
|
|
73142
|
+
return;
|
|
73143
|
+
}
|
|
73144
|
+
default:
|
|
73145
|
+
throw new Error("Usage: eve admin ingress-aliases <list|reclaim> [options]");
|
|
73146
|
+
}
|
|
73147
|
+
}
|
|
73038
73148
|
case "access-requests": {
|
|
73039
73149
|
const action = positionals[0];
|
|
73040
73150
|
switch (action) {
|
|
@@ -73097,7 +73207,7 @@ ${response.length} record(s)`);
|
|
|
73097
73207
|
}
|
|
73098
73208
|
}
|
|
73099
73209
|
default:
|
|
73100
|
-
throw new Error("Usage: eve admin <invite|pricing|receipts|balance|usage|access-requests>");
|
|
73210
|
+
throw new Error("Usage: eve admin <invite|pricing|receipts|balance|usage|ingress-aliases|access-requests>");
|
|
73101
73211
|
}
|
|
73102
73212
|
}
|
|
73103
73213
|
function formatBalanceSummary(data) {
|