mirror of
https://github.com/LukeHagar/Dokploy-ts-sdk.git
synced 2025-12-06 04:19:37 +00:00
510 lines
39 KiB
Markdown
510 lines
39 KiB
Markdown
# Gitlab
|
|
(*gitlab*)
|
|
|
|
## Overview
|
|
|
|
### Available Operations
|
|
|
|
* [create](#create)
|
|
* [one](#one)
|
|
* [providers](#providers)
|
|
* [getGitlabRepositories](#getgitlabrepositories)
|
|
* [getGitlabBranches](#getgitlabbranches)
|
|
* [testConnection](#testconnection)
|
|
* [update](#update)
|
|
|
|
## create
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="gitlab-create" method="post" path="/gitlab.create" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.gitlab.create({
|
|
authId: "<id>",
|
|
name: "<value>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { gitlabCreate } from "dokploy/funcs/gitlabCreate.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 gitlabCreate(dokploy, {
|
|
authId: "<id>",
|
|
name: "<value>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("gitlabCreate failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GitlabCreateRequest](../../models/operations/gitlabcreaterequest.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 | \*/\* |
|
|
|
|
## one
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="gitlab-one" method="get" path="/gitlab.one" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.gitlab.one({
|
|
gitlabId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { gitlabOne } from "dokploy/funcs/gitlabOne.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 gitlabOne(dokploy, {
|
|
gitlabId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("gitlabOne failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GitlabOneRequest](../../models/operations/gitlabonerequest.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 | \*/\* |
|
|
|
|
## providers
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="gitlab-gitlabProviders" method="get" path="/gitlab.gitlabProviders" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.gitlab.providers();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { gitlabProviders } from "dokploy/funcs/gitlabProviders.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 gitlabProviders(dokploy);
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("gitlabProviders 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 | \*/\* |
|
|
|
|
## getGitlabRepositories
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="gitlab-getGitlabRepositories" method="get" path="/gitlab.getGitlabRepositories" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.gitlab.getGitlabRepositories({
|
|
gitlabId: "<id>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { gitlabGetGitlabRepositories } from "dokploy/funcs/gitlabGetGitlabRepositories.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 gitlabGetGitlabRepositories(dokploy, {
|
|
gitlabId: "<id>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("gitlabGetGitlabRepositories failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GitlabGetGitlabRepositoriesRequest](../../models/operations/gitlabgetgitlabrepositoriesrequest.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 | \*/\* |
|
|
|
|
## getGitlabBranches
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="gitlab-getGitlabBranches" method="get" path="/gitlab.getGitlabBranches" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.gitlab.getGitlabBranches({
|
|
owner: "<value>",
|
|
repo: "<value>",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { gitlabGetGitlabBranches } from "dokploy/funcs/gitlabGetGitlabBranches.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 gitlabGetGitlabBranches(dokploy, {
|
|
owner: "<value>",
|
|
repo: "<value>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("gitlabGetGitlabBranches failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GitlabGetGitlabBranchesRequest](../../models/operations/gitlabgetgitlabbranchesrequest.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 | \*/\* |
|
|
|
|
## testConnection
|
|
|
|
### Example Usage
|
|
|
|
<!-- UsageSnippet language="typescript" operationID="gitlab-testConnection" method="post" path="/gitlab.testConnection" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.gitlab.testConnection({});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Standalone function
|
|
|
|
The standalone function version of this method:
|
|
|
|
```typescript
|
|
import { DokployCore } from "dokploy/core.js";
|
|
import { gitlabTestConnection } from "dokploy/funcs/gitlabTestConnection.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 gitlabTestConnection(dokploy, {});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("gitlabTestConnection failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GitlabTestConnectionRequest](../../models/operations/gitlabtestconnectionrequest.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="gitlab-update" method="post" path="/gitlab.update" -->
|
|
```typescript
|
|
import { Dokploy } from "dokploy";
|
|
|
|
const dokploy = new Dokploy({
|
|
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await dokploy.gitlab.update({
|
|
gitlabId: "<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 { gitlabUpdate } from "dokploy/funcs/gitlabUpdate.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 gitlabUpdate(dokploy, {
|
|
gitlabId: "<id>",
|
|
gitProviderId: "<id>",
|
|
name: "<value>",
|
|
});
|
|
if (res.ok) {
|
|
const { value: result } = res;
|
|
console.log(result);
|
|
} else {
|
|
console.log("gitlabUpdate failed:", res.error);
|
|
}
|
|
}
|
|
|
|
run();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `request` | [operations.GitlabUpdateRequest](../../models/operations/gitlabupdaterequest.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 | \*/\* | |