mirror of
https://github.com/LukeHagar/Dokploy-ts-sdk.git
synced 2025-12-06 04:19:37 +00:00
23 KiB
23 KiB
Security
(security)
Overview
Available Operations
create
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.security.create({
applicationId: "<id>",
username: "Jaida.Zulauf",
password: "K9baGIdLMCnW0iF",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { securityCreate } from "dokploy/funcs/securityCreate.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 securityCreate(dokploy, {
applicationId: "<id>",
username: "Jaida.Zulauf",
password: "K9baGIdLMCnW0iF",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("securityCreate failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.SecurityCreateRequest | ✔️ | 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 | */* |
get
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.security.get({
securityId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { securityGet } from "dokploy/funcs/securityGet.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 securityGet(dokploy, {
securityId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("securityGet failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.SecurityOneRequest | ✔️ | 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 | */* |
delete
Example Usage
import { Dokploy } from "dokploy";
const dokploy = new Dokploy({
authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});
async function run() {
const result = await dokploy.security.delete({
securityId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { securityDelete } from "dokploy/funcs/securityDelete.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 securityDelete(dokploy, {
securityId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("securityDelete failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.SecurityDeleteRequest | ✔️ | 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.security.update({
securityId: "<id>",
username: "Easter19",
password: "lzeP1olfVZ7Co23",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { DokployCore } from "dokploy/core.js";
import { securityUpdate } from "dokploy/funcs/securityUpdate.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 securityUpdate(dokploy, {
securityId: "<id>",
username: "Easter19",
password: "lzeP1olfVZ7Co23",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("securityUpdate failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.SecurityUpdateRequest | ✔️ | 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 | */* |