@nurix/apollo 0.5.4 → 0.5.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/dist/index.js +27 -1
- package/dist/lib/apollo_client.js +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -102,4 +102,30 @@ search
|
|
|
102
102
|
.option("--type <type>", "filter services by type")
|
|
103
103
|
.option("--limit <n>", "max results (default 20)", toLimit)
|
|
104
104
|
.action(async (keywords, options) => runSearchServices(keywords, options, program.opts()));
|
|
105
|
-
|
|
105
|
+
// Translate an unexpected throw (mostly network failures from the read-only
|
|
106
|
+
// commands that call the client directly) into a single clean stderr line —
|
|
107
|
+
// never a raw Node stack trace. Interactive commands frame their own errors.
|
|
108
|
+
function describeError(error) {
|
|
109
|
+
const cause = error?.cause;
|
|
110
|
+
const code = cause?.code;
|
|
111
|
+
if (code === "ENOTFOUND" || code === "EAI_AGAIN") {
|
|
112
|
+
return "couldn't resolve the Apollo host — check your connection or pass --apollo-url.";
|
|
113
|
+
}
|
|
114
|
+
if (code === "ECONNREFUSED") {
|
|
115
|
+
return "the Apollo host refused the connection — is it up? Override with --apollo-url.";
|
|
116
|
+
}
|
|
117
|
+
if (error instanceof Error && (error.name === "TimeoutError" || error.name === "AbortError")) {
|
|
118
|
+
return "the request to Apollo timed out — check your connection or try again.";
|
|
119
|
+
}
|
|
120
|
+
if (error instanceof Error && error.message === "fetch failed") {
|
|
121
|
+
return "couldn't reach Apollo — check your connection or pass --apollo-url.";
|
|
122
|
+
}
|
|
123
|
+
return error instanceof Error ? error.message : String(error);
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
await program.parseAsync(process.argv);
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
console.error(`apollo: ${describeError(error)}`);
|
|
130
|
+
process.exitCode = 1;
|
|
131
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/cli/src/lib/apollo_client.ts - HTTP client for the Apollo discovery
|
|
2
2
|
// plane: catalogue fetch + credential exchange + key validation.
|
|
3
|
-
const DEFAULT_APOLLO_URL = "https://apollo.
|
|
3
|
+
const DEFAULT_APOLLO_URL = "https://apollo.nustack.tech";
|
|
4
4
|
const REQUEST_TIMEOUT_MS = 10_000;
|
|
5
5
|
// Resolve the Apollo base URL: --apollo-url flag > APOLLO_URL env > hosted default.
|
|
6
6
|
export function resolveApolloUrl(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nurix/apollo",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "The apollo CLI — bootstrap NuStack services into a repo via the Apollo discovery plane.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"build": "tsc && node scripts/copy_schema.mjs",
|
|
24
24
|
"dev": "tsc --watch",
|
|
25
25
|
"typecheck": "tsc --noEmit",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
26
28
|
"prepublishOnly": "npm run build"
|
|
27
29
|
},
|
|
28
30
|
"dependencies": {
|
|
@@ -33,7 +35,8 @@
|
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@types/node": "^22.10.0",
|
|
36
|
-
"typescript": "catalog:"
|
|
38
|
+
"typescript": "catalog:",
|
|
39
|
+
"vitest": "latest"
|
|
37
40
|
},
|
|
38
41
|
"publishConfig": {
|
|
39
42
|
"access": "restricted"
|