@mks2508/coolify-mks-cli-mcp 0.3.2 → 0.4.1

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 CHANGED
@@ -28071,7 +28071,7 @@ var CoolifyService = class {
28071
28071
  const parsed = data;
28072
28072
  let errorMessage = parsed?.message || `HTTP ${response.status}`;
28073
28073
  if (parsed?.errors) {
28074
- const details = Object.entries(parsed.errors).map(([field, reasons]) => `${field}: ${reasons.join(", ")}`).join("; ");
28074
+ const details = Object.entries(parsed.errors).map(([field, reasons]) => `${field}: ${Array.isArray(reasons) ? reasons.join(", ") : String(reasons)}`).join("; ");
28075
28075
  errorMessage += ` — ${details}`;
28076
28076
  }
28077
28077
  return {
@@ -28171,7 +28171,8 @@ var CoolifyService = class {
28171
28171
  server_uuid: options.serverUuid
28172
28172
  };
28173
28173
  if (appType === "public" || appType === "private-github-app" || appType === "private-deploy-key") {
28174
- if (options.githubRepoUrl) body.git_repository = options.githubRepoUrl;
28174
+ if (options.githubRepoUrl) body.git_repository = options.githubRepoUrl.replace(/^https?:\/\/github\.com\//, "").replace(/\.git$/, "");
28175
+ if (options.githubAppUuid) body.github_app_uuid = options.githubAppUuid;
28175
28176
  body.git_branch = options.branch || "main";
28176
28177
  body.build_pack = options.buildPack || "dockerfile";
28177
28178
  if (options.portsExposes) body.ports_exposes = options.portsExposes;
@@ -28205,21 +28206,22 @@ var CoolifyService = class {
28205
28206
  * @returns Result indicating success or error
28206
28207
  */
28207
28208
  async setEnvironmentVariables(appUuid, envVars) {
28208
- log.info(`Setting environment variables for ${appUuid}`);
28209
- const envArray = Object.entries(envVars).map(([key, value]) => ({
28210
- key,
28211
- value,
28212
- is_build_time: false
28213
- }));
28214
- const result = await this.request(`/applications/${appUuid}/envs`, {
28215
- method: "POST",
28216
- body: JSON.stringify({ data: envArray })
28217
- });
28218
- if (result.error) {
28219
- log.error(`Failed to set env vars: ${result.error}`);
28220
- return err(new Error(result.error));
28209
+ log.info(`Setting ${Object.keys(envVars).length} environment variables for ${appUuid}`);
28210
+ for (const [key, value] of Object.entries(envVars)) {
28211
+ const result = await this.request(`/applications/${appUuid}/envs`, {
28212
+ method: "POST",
28213
+ body: JSON.stringify({
28214
+ key,
28215
+ value,
28216
+ is_preview: false
28217
+ })
28218
+ });
28219
+ if (result.error) {
28220
+ log.error(`Failed to set env var ${key}: ${result.error}`);
28221
+ return err(new Error(`Failed to set ${key}: ${result.error}`));
28222
+ }
28221
28223
  }
28222
- log.success("Environment variables set");
28224
+ log.success(`${Object.keys(envVars).length} environment variables set`);
28223
28225
  return ok(void 0);
28224
28226
  }
28225
28227
  /**
@@ -28345,6 +28347,16 @@ var CoolifyService = class {
28345
28347
  return ok(result.data);
28346
28348
  }
28347
28349
  /**
28350
+ * Lists all GitHub Apps configured in Coolify.
28351
+ *
28352
+ * @returns Result with GitHub Apps list or error
28353
+ */
28354
+ async listGithubApps() {
28355
+ const result = await this.request("/github-apps");
28356
+ if (result.error) return err(new Error(result.error));
28357
+ return ok(result.data || []);
28358
+ }
28359
+ /**
28348
28360
  * Lists all projects.
28349
28361
  *
28350
28362
  * @returns Result with projects list or error
@@ -28476,6 +28488,7 @@ var CoolifyService = class {
28476
28488
  if (options.dockerfileLocation) body.dockerfile_location = options.dockerfileLocation;
28477
28489
  if (options.baseDirectory) body.base_directory = options.baseDirectory;
28478
28490
  if (options.domains) body.domains = options.domains;
28491
+ if (options.dockerComposeDomains) body.docker_compose_domains = options.dockerComposeDomains;
28479
28492
  if (options.isForceHttpsEnabled !== void 0) body.is_force_https_enabled = options.isForceHttpsEnabled;
28480
28493
  if (options.isAutoDeployEnabled !== void 0) body.is_auto_deploy_enabled = options.isAutoDeployEnabled;
28481
28494
  const result = await this.request(`/applications/${appUuid}`, {