Files
Dokploy-ts-sdk/docs/sdks/github/README.md
2025-09-26 02:33:10 +00:00

33 KiB
Raw Permalink Blame History

Github

(github)

Overview

Available Operations

one

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.github.one({
    githubId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { githubOne } from "dokploy/funcs/githubOne.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await githubOne(dokploy, {
    githubId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("githubOne failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GithubOneRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

getRepositories

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.github.getRepositories({
    githubId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { githubGetRepositories } from "dokploy/funcs/githubGetRepositories.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await githubGetRepositories(dokploy, {
    githubId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("githubGetRepositories failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GithubGetGithubRepositoriesRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

getBranches

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.github.getBranches({
    repo: "<value>",
    owner: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { githubGetBranches } from "dokploy/funcs/githubGetBranches.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await githubGetBranches(dokploy, {
    repo: "<value>",
    owner: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("githubGetBranches failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GithubGetGithubBranchesRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

getProviders

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.github.getProviders();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { githubGetProviders } from "dokploy/funcs/githubGetProviders.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await githubGetProviders(dokploy);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("githubGetProviders failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

testConnection

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.github.testConnection({
    githubId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { githubTestConnection } from "dokploy/funcs/githubTestConnection.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await githubTestConnection(dokploy, {
    githubId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("githubTestConnection failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GithubTestConnectionRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

update

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.github.update({
    githubId: "<id>",
    gitProviderId: "<id>",
    name: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { githubUpdate } from "dokploy/funcs/githubUpdate.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await githubUpdate(dokploy, {
    githubId: "<id>",
    gitProviderId: "<id>",
    name: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("githubUpdate failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GithubUpdateRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*