@topgroup/diginext
Version:
A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.
430 lines • 11.4 kB
TypeScript
import type { IApp } from "../entities";
import { AppDto } from "../entities";
import { IDeleteQueryParams, IGetQueryParams, IPatchQueryParams, IPostQueryParams } from "../interfaces";
import { AppInputSchema, CreateEnvVarsDto, DeployEnvironmentData, UpdateEnvVarsDto } from "../interfaces/AppInterfaces";
import type { DeployEnvironmentVolume } from "../interfaces/DeployEnvironmentVolume";
import type { ResponseData } from "../interfaces/ResponseData";
import { AppService } from "../services/AppService";
import BaseController from "./BaseController";
export default class AppController extends BaseController<IApp, AppService> {
constructor();
/**
* List of apps
*/
read(queryParams?: IGetQueryParams): Promise<ResponseData & import("../interfaces").IResponsePagination>;
create(body: AppInputSchema, queryParams?: IPostQueryParams): Promise<ResponseData>;
/**
* Create new app from a git repo SSH url
*/
createFromSshURL(body: {
/**
* Git repo SSH url
* @example git@github.com:digitopvn/diginext.git
*/
sshUrl: string;
/**
* Git provider ID to host the new repo of this app
*/
gitProviderID: string;
/**
* ### CAUTION
* If `TRUE`, it will delete existing git repo and create a new one.
*/
force?: boolean;
}): Promise<ResponseData>;
/**
* Import a git repo SSH url & create new app from it
*/
importFromGitSshURL(body: {
/**
* App's name
*/
name?: string;
/**
* Git repo SSH url
* @example git@github.com:digitopvn/diginext.git
*/
sshUrl: string;
/**
* Git provider ID to host the new repo of this app
*/
gitProviderID: string;
/**
* Select git branch to pull
*/
gitBranch?: string;
/**
* Project ID of this app
*/
projectID?: string;
/**
* `DANGER`
* ---
* Delete app and git repo if they were existed.
* @default false
*/
force?: boolean;
}): Promise<ResponseData & import("../interfaces").IResponsePagination>;
update(body: AppDto, queryParams?: IPatchQueryParams): Promise<ResponseData>;
delete(queryParams?: IDeleteQueryParams): Promise<ResponseData>;
/**
* List of participants in an app
*/
participants(queryParams?: IGetQueryParams): Promise<ResponseData>;
/**
* Take down all deploy environments of this app on the clusters, then mark this app as "archived" in database.
*/
archiveApp(queryParams?: IGetQueryParams): Promise<ResponseData>;
/**
* Mark this app as "unarchived" in database.
*/
unarchiveApp(queryParams?: IGetQueryParams): Promise<ResponseData>;
getAppConfig(queryParams?: {
slug: string;
}): Promise<ResponseData | {
status: number;
data: import("../interfaces").AppConfig;
messages: any[];
}>;
/**
* Get new deploy environment of the application.
*/
getDeployEnvironmentV2(queryParams: {
/**
* App slug
*/
slug: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}): Promise<ResponseData>;
/**
* [V2] Get new deploy environment of the application.
*/
getDeployEnvironment(queryParams: {
/**
* App slug
*/
slug: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}): Promise<ResponseData>;
/**
* [V2] Create new deploy environment of the application.
*/
createDeployEnvironmentV2(
/**
* `REQUIRES`
* ---
* Deploy environment configuration
*/
body: DeployEnvironmentData, queryParams?: {
/**
* App slug
*/
slug: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}): Promise<IApp>;
/**
* [V2] Update new deploy environment of the application.
*/
updateDeployEnvironmentV2(
/**
* `REQUIRES`
* ---
* Deploy environment configuration
*/
body: DeployEnvironmentData, queryParams?: {
/**
* App slug
*/
slug: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}): Promise<ResponseData>;
/**
* [V2] Update new deploy environment of the application.
*/
deleteDeployEnvironmentV2(queryParams?: {
/**
* App's ID
*/
id?: string;
/**
* App's SLUG
*/
slug: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}): Promise<ResponseData>;
/**
* Create new deploy environment of the application.
*/
createDeployEnvironment(body: {
/**
* `REQUIRES`
* ---
* App slug
*/
appSlug: string;
/**
* `REQUIRES`
* ---
* Deploy environment name
* @default dev
*/
env: string;
/**
* `REQUIRES`
* ---
* Deploy environment configuration
*/
deployEnvironmentData: DeployEnvironmentData;
}, queryParams?: IPostQueryParams): Promise<ResponseData & import("../interfaces").IResponsePagination>;
/**
* Create new deploy environment of the application.
*/
updateDeployEnvironment(body: {
/**
* `REQUIRES`
* ---
* App slug
*/
appSlug: string;
/**
* `REQUIRES`
* ---
* Deploy environment name
* @default dev
*/
env: string;
/**
* `REQUIRES`
* ---
* Deploy environment configuration
*/
deployEnvironmentData: DeployEnvironmentData;
}, queryParams?: IPostQueryParams): Promise<ResponseData>;
/**
* Delete a deploy environment of the application.
*/
deleteDeployEnvironment(body?: {
/**
* App's ID (no need `slug` if using `id` or `_id`)
*/
_id?: string;
/**
* [alias] App's ID (no need `slug` if using `id` or `_id`)
*/
id?: string;
/**
* App's slug (no need `id` or `_id` if using `slug`)
*/
slug?: string;
/**
* Short name of deploy environment
* @example "dev", "prod",...
*/
env?: string;
}): Promise<ResponseData>;
/**
* Get list of variables on the deploy environment of the application.
*/
getEnvVarsOnDeployEnvironment(queryParams?: {
slug: string;
env: string;
}): Promise<ResponseData | {
status: number;
data: {
name: string;
value: string;
}[];
messages: any[];
} | {
status: number;
messages: string[];
}>;
/**
* Create new variables on the deploy environment of the application.
*/
createEnvVarsOnDeployEnvironment(body: CreateEnvVarsDto, queryParams?: IPostQueryParams): Promise<ResponseData | {
status: number;
messages: string[];
}>;
/**
* Update environment variables on the deploy environment.
*/
updateEnvVarsOnDeployEnvironment(body: UpdateEnvVarsDto, queryParams?: IPostQueryParams): Promise<ResponseData>;
/**
* Delete variables on the deploy environment of the application.
*/
deleteEnvVarsOnDeployEnvironment(body: {
/**
* App slug
*/
slug: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}, queryParams?: IPostQueryParams): Promise<ResponseData | {
status: number;
data: {
name: string;
value: string;
}[];
messages: string[];
} | {
status: number;
messages: string[];
}>;
/**
* Update a variable on the deploy environment of the application.
*/
addEnvironmentDomain(body: {
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
/**
* New domains to be added into this deploy environment
* @example ["example.com", "www.example.com"]
*/
domains: string[];
}, queryParams?: IPostQueryParams): Promise<ResponseData | {
status: number;
messages: string[];
}>;
/**
* View app's container logs
*/
viewLogs(queryParams?: {
/**
* App's slug
*/
slug: string;
/**
* App's deploy environment code (dev, prod,...)
* @default "dev"
*/
env?: string;
}): Promise<ResponseData>;
/**
* Take down a deploy environment of the application.
*/
takeDownDeployEnvironment(queryParams?: {
/**
* App's ID
*/
_id?: string;
/**
* App slug
*/
slug?: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}): Promise<ResponseData>;
/**
* Sleep a deploy environment of the application.
*/
sleepDeployEnvironment(queryParams?: {
/**
* App's ID
*/
_id?: string;
/**
* App slug
*/
slug?: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}): Promise<ResponseData>;
/**
* Awake a sleeping deploy environment of the application.
*/
awakeDeployEnvironment(queryParams?: {
/**
* App's ID
*/
_id?: string;
/**
* App slug
*/
slug?: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}): Promise<ResponseData>;
/**
* Add new volume to app's deploy environment.
*/
addVolumeToDeployEnvironment(
/**
* `REQUIRES`
* ---
* Volume configuration
*/
body: Pick<DeployEnvironmentVolume, "name" | "size" | "mountPath">, queryParams?: {
/**
* App's ID
*/
_id?: string;
/**
* App slug
*/
slug?: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
}): Promise<ResponseData>;
/**
* Remove the volume of an app's deploy environment.
*/
removeVolumeToDeployEnvironment(queryParams?: {
/**
* App's ID
*/
_id?: string;
/**
* App slug
*/
slug?: string;
/**
* Deploy environment name
* @example "dev" | "prod"
*/
env: string;
/**
* Volume name
*/
name: string;
}): Promise<ResponseData>;
}
//# sourceMappingURL=AppController.d.ts.map