Skip to content

Latest commit

 

History

History
428 lines (344 loc) · 30 KB

File metadata and controls

428 lines (344 loc) · 30 KB

Actions

Overview

Retrieve Actions metadata and definitions.

Available Operations

buildActionEmbeddings

Rebuild action embeddings for semantic search

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.actions.buildActionEmbeddings({
    connectorKey: "slack",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { actionsBuildActionEmbeddings } from "@stackone/stackone-client-ts/funcs/actionsBuildActionEmbeddings.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

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

run();

Parameters

Parameter Type Required Description
request shared.ActionBuildDto ✔️ 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.StackoneBuildActionEmbeddingsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listActionsMeta

Retrieves a list of all actions metadata

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";
import { ExcludeT, Include } from "@stackone/stackone-client-ts/sdk/models/operations";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.actions.listActionsMeta({
    exclude: [
      ExcludeT.Actions,
    ],
    filter: {
      accountIds: "account1,account2",
      actionKey: "action1",
      connectors: "connector1,connector2",
    },
    groupBy: "[\"connector\"]",
    include: [
      Include.ActionDetails,
    ],
    search: "employee",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { actionsListActionsMeta } from "@stackone/stackone-client-ts/funcs/actionsListActionsMeta.js";
import { ExcludeT, Include } from "@stackone/stackone-client-ts/sdk/models/operations";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await actionsListActionsMeta(stackOne, {
    exclude: [
      ExcludeT.Actions,
    ],
    filter: {
      accountIds: "account1,account2",
      actionKey: "action1",
      connectors: "connector1,connector2",
    },
    groupBy: "[\"connector\"]",
    include: [
      Include.ActionDetails,
    ],
    search: "employee",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("actionsListActionsMeta failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

rpcAction

Makes a remote procedure call to the specified action

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.actions.rpcAction({
    action: "create_employee",
    body: {
      "data": "example",
    },
    headers: {
      "Content-Type": "application/json",
    },
    path: {
      "id": "123",
    },
    query: {
      debug: false,
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { actionsRpcAction } from "@stackone/stackone-client-ts/funcs/actionsRpcAction.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await actionsRpcAction(stackOne, {
    action: "create_employee",
    body: {
      "data": "example",
    },
    headers: {
      "Content-Type": "application/json",
    },
    path: {
      "id": "123",
    },
    query: {
      debug: false,
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("actionsRpcAction failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request shared.ActionsRpcRequestDto ✔️ 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.StackoneRpcActionResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

searchActions

Search connector actions by semantic similarity

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.actions.searchActions({
    connector: "slack",
    query: "send a message",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { actionsSearchActions } from "@stackone/stackone-client-ts/funcs/actionsSearchActions.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await actionsSearchActions(stackOne, {
    connector: "slack",
    query: "send a message",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("actionsSearchActions failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request shared.ActionSearchDto ✔️ 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.StackoneSearchActionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*