@jurislm/coolify-plugin 3.7.10 → 3.7.11
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/.codex-plugin/plugin.json +1 -1
- package/dist/client.js +9 -3
- package/dist/config.d.ts +2 -2
- package/dist/config.js +2 -4
- package/package.json +1 -1
- package/plugin.json +1 -1
package/dist/client.js
CHANGED
|
@@ -53,6 +53,12 @@ export class CoolifyClient {
|
|
|
53
53
|
this.fetchImpl = fetchImpl;
|
|
54
54
|
}
|
|
55
55
|
async request(operation, input) {
|
|
56
|
+
const baseUrl = this.config.baseUrl;
|
|
57
|
+
if (!baseUrl)
|
|
58
|
+
throw new CoolifyApiError(0, operation.method, operation.path, "COOLIFY_URL is required");
|
|
59
|
+
const token = this.config.token;
|
|
60
|
+
if (!token)
|
|
61
|
+
throw new CoolifyApiError(0, operation.method, operation.path, "COOLIFY_TOKEN is required");
|
|
56
62
|
let path = operation.path;
|
|
57
63
|
for (const parameter of operation.parameters)
|
|
58
64
|
if (parameter.location === "path") {
|
|
@@ -60,11 +66,11 @@ export class CoolifyClient {
|
|
|
60
66
|
}
|
|
61
67
|
if (path.includes("{"))
|
|
62
68
|
throw new Error(`Unresolved path parameter in ${operation.path}`);
|
|
63
|
-
const url = new URL(
|
|
69
|
+
const url = new URL(baseUrl + path);
|
|
64
70
|
for (const parameter of operation.parameters)
|
|
65
71
|
if (parameter.location === "query")
|
|
66
72
|
appendQuery(url, parameter.name, input[parameter.name]);
|
|
67
|
-
const headers = new Headers({ accept: "application/json, text/plain, */*", authorization: `Bearer ${
|
|
73
|
+
const headers = new Headers({ accept: "application/json, text/plain, */*", authorization: `Bearer ${token}` });
|
|
68
74
|
const init = { method: operation.method, headers, signal: AbortSignal.timeout(this.config.timeoutMs) };
|
|
69
75
|
if (input.body !== undefined && !["GET", "HEAD"].includes(operation.method)) {
|
|
70
76
|
headers.set("content-type", "application/json");
|
|
@@ -75,7 +81,7 @@ export class CoolifyClient {
|
|
|
75
81
|
response = await this.fetchImpl(url, init);
|
|
76
82
|
}
|
|
77
83
|
catch (error) {
|
|
78
|
-
throw new CoolifyApiError(0, operation.method, path, `Coolify request failed for ${operation.method} ${path}: ${error instanceof Error ? error.message.replaceAll(
|
|
84
|
+
throw new CoolifyApiError(0, operation.method, path, `Coolify request failed for ${operation.method} ${path}: ${error instanceof Error ? error.message.replaceAll(token, "[REDACTED]") : "request error"}`);
|
|
79
85
|
}
|
|
80
86
|
if (!response.ok)
|
|
81
87
|
throw new CoolifyApiError(response.status, operation.method, path, `Coolify API returned ${response.status} for ${operation.method} ${path}`);
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
|
@@ -8,9 +8,7 @@ export function loadConfig(env = process.env) {
|
|
|
8
8
|
const rawUrl = env.COOLIFY_URL?.trim();
|
|
9
9
|
const token = env.COOLIFY_TOKEN?.trim();
|
|
10
10
|
if (!rawUrl)
|
|
11
|
-
|
|
12
|
-
if (!token)
|
|
13
|
-
throw new ConfigError("COOLIFY_TOKEN is required");
|
|
11
|
+
return { ...(token ? { token } : {}), timeoutMs: 30_000 };
|
|
14
12
|
let url;
|
|
15
13
|
try {
|
|
16
14
|
url = new URL(rawUrl);
|
|
@@ -26,5 +24,5 @@ export function loadConfig(env = process.env) {
|
|
|
26
24
|
url.pathname = url.pathname.replace(/\/+$/u, "");
|
|
27
25
|
if (!url.pathname.endsWith("/api/v1"))
|
|
28
26
|
url.pathname = `${url.pathname}/api/v1`.replace(/^\/\//u, "/");
|
|
29
|
-
return { baseUrl: url.toString().replace(/\/$/u, ""), token, timeoutMs: 30_000 };
|
|
27
|
+
return { baseUrl: url.toString().replace(/\/$/u, ""), ...(token ? { token } : {}), timeoutMs: 30_000 };
|
|
30
28
|
}
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "coolify-plugin",
|
|
4
|
-
"version": "3.7.
|
|
4
|
+
"version": "3.7.11",
|
|
5
5
|
"description": "Portable Coolify MCP plugin with local stdio tools generated from the official OpenAPI contract.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "JurisLM",
|