Skip to content

ComputeSecrets

Overview

Available Operations

listComputeSecrets

List secrets

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.computeSecrets.listComputeSecrets({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeSecretsListComputeSecrets } from "@meetkai/mka1/funcs/computeSecretsListComputeSecrets.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await computeSecretsListComputeSecrets(sdk, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("computeSecretsListComputeSecrets failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useComputeSecretsListComputeSecrets,
  useComputeSecretsListComputeSecretsSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchComputeSecretsListComputeSecrets,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateComputeSecretsListComputeSecrets,
  invalidateAllComputeSecretsListComputeSecrets,
} from "@meetkai/mka1/react-query/computeSecretsListComputeSecrets.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ListComputeSecretsRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ListComputeSecretsResponse>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

createComputeSecret

Create a secret

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.computeSecrets.createComputeSecret({
    computeSecretCreate: {
      data: {
        "key": "<value>",
        "key1": "<value>",
      },
      name: "<value>",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeSecretsCreateComputeSecret } from "@meetkai/mka1/funcs/computeSecretsCreateComputeSecret.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await computeSecretsCreateComputeSecret(sdk, {
    computeSecretCreate: {
      data: {
        "key": "<value>",
        "key1": "<value>",
      },
      name: "<value>",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("computeSecretsCreateComputeSecret failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useComputeSecretsCreateComputeSecretMutation
} from "@meetkai/mka1/react-query/computeSecretsCreateComputeSecret.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.CreateComputeSecretRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.CreateComputeSecretResponse>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

deleteComputeSecret

Delete a secret

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.computeSecrets.deleteComputeSecret({
    id: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeSecretsDeleteComputeSecret } from "@meetkai/mka1/funcs/computeSecretsDeleteComputeSecret.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await computeSecretsDeleteComputeSecret(sdk, {
    id: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("computeSecretsDeleteComputeSecret failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useComputeSecretsDeleteComputeSecretMutation
} from "@meetkai/mka1/react-query/computeSecretsDeleteComputeSecret.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.DeleteComputeSecretRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ComputeErrorEnvelope>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

getComputeSecret

Get a secret

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.computeSecrets.getComputeSecret({
    id: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeSecretsGetComputeSecret } from "@meetkai/mka1/funcs/computeSecretsGetComputeSecret.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await computeSecretsGetComputeSecret(sdk, {
    id: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("computeSecretsGetComputeSecret failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useComputeSecretsGetComputeSecret,
  useComputeSecretsGetComputeSecretSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchComputeSecretsGetComputeSecret,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateComputeSecretsGetComputeSecret,
  invalidateAllComputeSecretsGetComputeSecret,
} from "@meetkai/mka1/react-query/computeSecretsGetComputeSecret.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.GetComputeSecretRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetComputeSecretResponse>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*