mirror of
https://github.com/LukeHagar/Dokploy-ts-sdk.git
synced 2025-12-06 04:19:37 +00:00
initial commit
This commit is contained in:
307
docs/sdks/redirects/README.md
Normal file
307
docs/sdks/redirects/README.md
Normal file
@@ -0,0 +1,307 @@
|
||||
# Redirects
|
||||
(*redirects*)
|
||||
|
||||
## Overview
|
||||
|
||||
### Available Operations
|
||||
|
||||
* [create](#create)
|
||||
* [getOne](#getone)
|
||||
* [delete](#delete)
|
||||
* [update](#update)
|
||||
|
||||
## create
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="redirects-create" method="post" path="/redirects.create" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.redirects.create({
|
||||
regex: "<value>",
|
||||
replacement: "<value>",
|
||||
permanent: false,
|
||||
applicationId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { redirectsCreate } from "dokploy/funcs/redirectsCreate.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 redirectsCreate(dokploy, {
|
||||
regex: "<value>",
|
||||
replacement: "<value>",
|
||||
permanent: false,
|
||||
applicationId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("redirectsCreate failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.RedirectsCreateRequest](../../models/operations/redirectscreaterequest.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 | \*/\* |
|
||||
|
||||
## getOne
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="redirects-one" method="get" path="/redirects.one" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.redirects.getOne({
|
||||
redirectId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { redirectsGetOne } from "dokploy/funcs/redirectsGetOne.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 redirectsGetOne(dokploy, {
|
||||
redirectId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("redirectsGetOne failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.RedirectsOneRequest](../../models/operations/redirectsonerequest.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 | \*/\* |
|
||||
|
||||
## delete
|
||||
|
||||
### Example Usage
|
||||
|
||||
<!-- UsageSnippet language="typescript" operationID="redirects-delete" method="post" path="/redirects.delete" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.redirects.delete({
|
||||
redirectId: "<id>",
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { redirectsDelete } from "dokploy/funcs/redirectsDelete.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 redirectsDelete(dokploy, {
|
||||
redirectId: "<id>",
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("redirectsDelete failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.RedirectsDeleteRequest](../../models/operations/redirectsdeleterequest.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="redirects-update" method="post" path="/redirects.update" -->
|
||||
```typescript
|
||||
import { Dokploy } from "dokploy";
|
||||
|
||||
const dokploy = new Dokploy({
|
||||
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dokploy.redirects.update({
|
||||
redirectId: "<id>",
|
||||
regex: "<value>",
|
||||
replacement: "<value>",
|
||||
permanent: false,
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Standalone function
|
||||
|
||||
The standalone function version of this method:
|
||||
|
||||
```typescript
|
||||
import { DokployCore } from "dokploy/core.js";
|
||||
import { redirectsUpdate } from "dokploy/funcs/redirectsUpdate.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 redirectsUpdate(dokploy, {
|
||||
redirectId: "<id>",
|
||||
regex: "<value>",
|
||||
replacement: "<value>",
|
||||
permanent: false,
|
||||
});
|
||||
if (res.ok) {
|
||||
const { value: result } = res;
|
||||
console.log(result);
|
||||
} else {
|
||||
console.log("redirectsUpdate failed:", res.error);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.RedirectsUpdateRequest](../../models/operations/redirectsupdaterequest.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