Files
komodo/frontend/public/client/lib.d.ts
T
Maxwell Becker 5daba3a557 1.16.0 (#140)
* consolidate deserializers

* key value list doc

* use string list deserializers for all entity Vec<String>

* add additional env files support

* plumbing for Action resource

* js client readme indentation

* regen lock

* add action UI

* action backend

* start on action frontend

* update lock

* get up to speed

* get action started

* clean up default action file

* seems to work

* toml export include action

* action works

* action works part 2

* bump rust version to 1.82.0

* copy deno bin from bin image

* action use local dir

* update not having changes doesn't return error

* format with prettier

* support yaml formatting with prettier

* variable no change is Ok
2024-10-19 23:27:28 -07:00

92 lines
2.8 KiB
TypeScript

import { AuthResponses, ExecuteResponses, ReadResponses, UserResponses, WriteResponses } from "./responses.js";
import { AuthRequest, ExecuteRequest, ReadRequest, UserRequest, WriteRequest } from "./types.js";
export * as Types from "./types.js";
type InitOptions = {
type: "jwt";
params: {
jwt: string;
};
} | {
type: "api-key";
params: {
key: string;
secret: string;
};
};
/** Initialize a new client for Komodo */
export declare function KomodoClient(url: string, options: InitOptions): {
/**
* Call the `/auth` api.
*
* ```
* const login_options = await komodo.auth("GetLoginOptions", {});
* ```
*
* https://docs.rs/komodo_client/latest/komodo_client/api/auth/index.html
*/
auth: <T extends AuthRequest["type"], Req extends Extract<AuthRequest, {
type: T;
}>>(type: T, params: Req["params"]) => Promise<AuthResponses[Req["type"]]>;
/**
* Call the `/user` api.
*
* ```
* const { key, secret } = await komodo.user("CreateApiKey", {
* name: "my-api-key"
* });
* ```
*
* https://docs.rs/komodo_client/latest/komodo_client/api/user/index.html
*/
user: <T extends UserRequest["type"], Req extends Extract<UserRequest, {
type: T;
}>>(type: T, params: Req["params"]) => Promise<UserResponses[Req["type"]]>;
/**
* Call the `/read` api.
*
* ```
* const stack = await komodo.read("GetStack", {
* stack: "my-stack"
* });
* ```
*
* https://docs.rs/komodo_client/latest/komodo_client/api/read/index.html
*/
read: <T extends ReadRequest["type"], Req extends Extract<ReadRequest, {
type: T;
}>>(type: T, params: Req["params"]) => Promise<ReadResponses[Req["type"]]>;
/**
* Call the `/write` api.
*
* ```
* const build = await komodo.write("UpdateBuild", {
* id: "my-build",
* config: {
* version: "1.0.4"
* }
* });
* ```
*
* https://docs.rs/komodo_client/latest/komodo_client/api/write/index.html
*/
write: <T extends WriteRequest["type"], Req extends Extract<WriteRequest, {
type: T;
}>>(type: T, params: Req["params"]) => Promise<WriteResponses[Req["type"]]>;
/**
* Call the `/execute` api.
*
* ```
* const update = await komodo.execute("DeployStack", {
* stack: "my-stack"
* });
* ```
*
* https://docs.rs/komodo_client/latest/komodo_client/api/execute/index.html
*/
execute: <T extends ExecuteRequest["type"], Req extends Extract<ExecuteRequest, {
type: T;
}>>(type: T, params: Req["params"]) => Promise<ExecuteResponses[Req["type"]]>;
/** Returns the version of Komodo Core the client is calling to. */
core_version: () => Promise<string>;
};