mirror of
https://github.com/LukeHagar/Dokploy-ts-sdk.git
synced 2025-12-06 12:27:48 +00:00
initial commit
This commit is contained in:
440
docs/sdks/github/README.md
Normal file
440
docs/sdks/github/README.md
Normal file
@@ -0,0 +1,440 @@
|
||||
# Github
|
||||
(*github*)
|
||||
|
||||
## Overview
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [one](#one)
|
||||
* [getRepositories](#getrepositories)
|
||||
* [getBranches](#getbranches)
|
||||
* [getProviders](#getproviders)
|
||||
* [testConnection](#testconnection)
|
||||
* [update](#update)
|
||||
|
||||
## one
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="github-one" method="get" path="/github.one" -->
|
||||
```typescript
|
||||
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:
|
||||
|
||||
```typescript
|
||||
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](../../models/operations/githubonerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
||||
|
||||
### Response
|
||||
|
||||
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## getRepositories
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="github-getGithubRepositories" method="get" path="/github.getGithubRepositories" -->
|
||||
```typescript
|
||||
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:
|
||||
|
||||
```typescript
|
||||
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](../../models/operations/githubgetgithubrepositoriesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
||||
|
||||
### Response
|
||||
|
||||
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## getBranches
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="github-getGithubBranches" method="get" path="/github.getGithubBranches" -->
|
||||
```typescript
|
||||
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:
|
||||
|
||||
```typescript
|
||||
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](../../models/operations/githubgetgithubbranchesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
||||
|
||||
### Response
|
||||
|
||||
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## getProviders
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="github-githubProviders" method="get" path="/github.githubProviders" -->
|
||||
```typescript
|
||||
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:
|
||||
|
||||
```typescript
|
||||
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 | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
||||
|
||||
### Response
|
||||
|
||||
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## testConnection
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="github-testConnection" method="post" path="/github.testConnection" -->
|
||||
```typescript
|
||||
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:
|
||||
|
||||
```typescript
|
||||
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](../../models/operations/githubtestconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
||||
|
||||
### Response
|
||||
|
||||
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## update
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="github-update" method="post" path="/github.update" -->
|
||||
```typescript
|
||||
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:
|
||||
|
||||
```typescript
|
||||
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](../../models/operations/githubupdaterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
||||
|
||||
### Response
|
||||
|
||||
**Promise\<[models.ErrorT](../../models/errort.md)\>**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.DokployDefaultError | 4XX, 5XX | \*/\* |
|
||||
Reference in New Issue
Block a user