Skip to content

Latest commit

 

History

History
490 lines (366 loc) · 36.9 KB

File metadata and controls

490 lines (366 loc) · 36.9 KB

Themes

(themes)

Overview

Themes

Available Operations

listThemes

List all team themes.

Example Usage

import { Scalar } from "@scalar/sdk";

const scalar = new Scalar({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await scalar.themes.listThemes();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ScalarCore } from "@scalar/sdk/core.js";
import { themesListThemes } from "@scalar/sdk/funcs/themesListThemes.js";

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

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

run();

Parameters

Parameter Type Required Description
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<operations.ListThemesResponse>

Errors

Error Type Status Code Content Type
errors.FourHundred 400 application/json
errors.FourHundredAndOne 401 application/json
errors.FourHundredAndThree 403 application/json
errors.FourHundredAndFour 404 application/json
errors.FourHundredAndTwentyTwo 422 application/json
errors.FiveHundred 500 application/json
errors.APIError 4XX, 5XX */*

createTheme

Create a team theme.

Example Usage

import { Scalar } from "@scalar/sdk";

const scalar = new Scalar({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await scalar.themes.createTheme({
    name: "<value>",
    slug: "<value>",
    document: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ScalarCore } from "@scalar/sdk/core.js";
import { themesCreateTheme } from "@scalar/sdk/funcs/themesCreateTheme.js";

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

async function run() {
  const res = await themesCreateTheme(scalar, {
    name: "<value>",
    slug: "<value>",
    document: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("themesCreateTheme failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.CreateThemeRequestBody ✔️ 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<operations.CreateThemeResponse>

Errors

Error Type Status Code Content Type
errors.FourHundred 400 application/json
errors.FourHundredAndOne 401 application/json
errors.FourHundredAndThree 403 application/json
errors.FourHundredAndFour 404 application/json
errors.FourHundredAndTwentyTwo 422 application/json
errors.FiveHundred 500 application/json
errors.APIError 4XX, 5XX */*

updateTheme

Update theme metadata.

Example Usage

import { Scalar } from "@scalar/sdk";

const scalar = new Scalar({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await scalar.themes.updateTheme({
    slug: "<value>",
    requestBody: {},
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ScalarCore } from "@scalar/sdk/core.js";
import { themesUpdateTheme } from "@scalar/sdk/funcs/themesUpdateTheme.js";

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

async function run() {
  const res = await themesUpdateTheme(scalar, {
    slug: "<value>",
    requestBody: {},
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("themesUpdateTheme failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.UpdateThemeRequest ✔️ 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<operations.UpdateThemeResponse>

Errors

Error Type Status Code Content Type
errors.FourHundred 400 application/json
errors.FourHundredAndOne 401 application/json
errors.FourHundredAndThree 403 application/json
errors.FourHundredAndFour 404 application/json
errors.FourHundredAndTwentyTwo 422 application/json
errors.FiveHundred 500 application/json
errors.APIError 4XX, 5XX */*

replaceThemeDocument

Replace the theme document.

Example Usage

import { Scalar } from "@scalar/sdk";

const scalar = new Scalar({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await scalar.themes.replaceThemeDocument({
    slug: "<value>",
    requestBody: {
      document: "<value>",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ScalarCore } from "@scalar/sdk/core.js";
import { themesReplaceThemeDocument } from "@scalar/sdk/funcs/themesReplaceThemeDocument.js";

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

async function run() {
  const res = await themesReplaceThemeDocument(scalar, {
    slug: "<value>",
    requestBody: {
      document: "<value>",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("themesReplaceThemeDocument failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ReplaceThemeDocumentRequest ✔️ 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<operations.ReplaceThemeDocumentResponse>

Errors

Error Type Status Code Content Type
errors.FourHundred 400 application/json
errors.FourHundredAndOne 401 application/json
errors.FourHundredAndThree 403 application/json
errors.FourHundredAndFour 404 application/json
errors.FourHundredAndTwentyTwo 422 application/json
errors.FiveHundred 500 application/json
errors.APIError 4XX, 5XX */*

deleteTheme

Delete a theme by slug.

Example Usage

import { Scalar } from "@scalar/sdk";

const scalar = new Scalar({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await scalar.themes.deleteTheme({
    slug: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ScalarCore } from "@scalar/sdk/core.js";
import { themesDeleteTheme } from "@scalar/sdk/funcs/themesDeleteTheme.js";

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

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

run();

Parameters

Parameter Type Required Description
request operations.DeleteThemeRequest ✔️ 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<operations.DeleteThemeResponse>

Errors

Error Type Status Code Content Type
errors.FourHundred 400 application/json
errors.FourHundredAndOne 401 application/json
errors.FourHundredAndThree 403 application/json
errors.FourHundredAndFour 404 application/json
errors.FourHundredAndTwentyTwo 422 application/json
errors.FiveHundred 500 application/json
errors.APIError 4XX, 5XX */*

getTheme

Get the theme document by slug.

Example Usage

import { Scalar } from "@scalar/sdk";

const scalar = new Scalar({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await scalar.themes.getTheme({
    slug: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ScalarCore } from "@scalar/sdk/core.js";
import { themesGetTheme } from "@scalar/sdk/funcs/themesGetTheme.js";

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

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

run();

Parameters

Parameter Type Required Description
request operations.GetThemeRequest ✔️ 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<operations.GetThemeResponse>

Errors

Error Type Status Code Content Type
errors.FourHundred 400 application/json
errors.FourHundredAndOne 401 application/json
errors.FourHundredAndThree 403 application/json
errors.FourHundredAndFour 404 application/json
errors.FourHundredAndTwentyTwo 422 application/json
errors.FiveHundred 500 application/json
errors.APIError 4XX, 5XX */*