Files
2025-09-26 02:33:10 +00:00

146 lines
11 KiB
Markdown

# GitProvider
(*gitProvider*)
## Overview
### Available Operations
* [getAll](#getall)
* [remove](#remove)
## getAll
### Example Usage
<!-- UsageSnippet language="typescript" operationID="gitProvider-getAll" method="get" path="/gitProvider.getAll" -->
```typescript
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.gitProvider.getAll();
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { DokployCore } from "dokploy/core.js";
import { gitProviderGetAll } from "dokploy/funcs/gitProviderGetAll.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 gitProviderGetAll(dokploy);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("gitProviderGetAll 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 | \*/\* |
## remove
### Example Usage
<!-- UsageSnippet language="typescript" operationID="gitProvider-remove" method="post" path="/gitProvider.remove" -->
```typescript
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.gitProvider.remove({
gitProviderId: "<id>",
});
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { DokployCore } from "dokploy/core.js";
import { gitProviderRemove } from "dokploy/funcs/gitProviderRemove.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 gitProviderRemove(dokploy, {
gitProviderId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("gitProviderRemove failed:", res.error);
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [operations.GitProviderRemoveRequest](../../models/operations/gitproviderremoverequest.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 | \*/\* |