Skip to content

Latest commit

 

History

History
243 lines (179 loc) · 17.5 KB

File metadata and controls

243 lines (179 loc) · 17.5 KB

Apps

(apps)

Overview

Operations related to apps

Available Operations

  • getApps - Returns a list of App objects.
  • getApp - Returns an App object.
  • getSyncErrors - Returns a list of recent sync errors that have occurred since the last successful sync.

getApps

Returns a list of App objects.

Example Usage

import { OpalMcp } from "opal-mcp";

const opalMcp = new OpalMcp({
  bearerAuth: process.env["OPALMCP_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await opalMcp.apps.getApps({
    appTypeFilter: [
      "OKTA_DIRECTORY",
      "GIT_HUB",
    ],
    ownerFilter: "29827fb8-f2dd-4e80-9576-28e31e9934ac",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { OpalMcpCore } from "opal-mcp/core.js";
import { appsGetApps } from "opal-mcp/funcs/appsGetApps.js";

// Use `OpalMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const opalMcp = new OpalMcpCore({
  bearerAuth: process.env["OPALMCP_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await appsGetApps(opalMcp, {
    appTypeFilter: [
      "OKTA_DIRECTORY",
      "GIT_HUB",
    ],
    ownerFilter: "29827fb8-f2dd-4e80-9576-28e31e9934ac",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("appsGetApps failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetAppsRequest ✔️ 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<components.AppsList>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

getApp

Returns an App object.

Example Usage

import { OpalMcp } from "opal-mcp";

const opalMcp = new OpalMcp({
  bearerAuth: process.env["OPALMCP_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await opalMcp.apps.getApp({
    appId: "32acc112-21ff-4669-91c2-21e27683eaa1",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { OpalMcpCore } from "opal-mcp/core.js";
import { appsGetApp } from "opal-mcp/funcs/appsGetApp.js";

// Use `OpalMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const opalMcp = new OpalMcpCore({
  bearerAuth: process.env["OPALMCP_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await appsGetApp(opalMcp, {
    appId: "32acc112-21ff-4669-91c2-21e27683eaa1",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("appsGetApp failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetAppRequest ✔️ 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<components.App>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

getSyncErrors

Returns a list of recent sync errors that have occurred since the last successful sync.

Example Usage

import { OpalMcp } from "opal-mcp";

const opalMcp = new OpalMcp({
  bearerAuth: process.env["OPALMCP_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await opalMcp.apps.getSyncErrors({
    appId: "29827fb8-f2dd-4e80-9576-28e31e9934ac",
    resourceId: "4baf8423-db0a-4037-a4cf-f79c60cb67a5",
    groupId: "9546209c-42c2-4801-96d7-9ec42df0f59c",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { OpalMcpCore } from "opal-mcp/core.js";
import { appsGetSyncErrors } from "opal-mcp/funcs/appsGetSyncErrors.js";

// Use `OpalMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const opalMcp = new OpalMcpCore({
  bearerAuth: process.env["OPALMCP_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await appsGetSyncErrors(opalMcp, {
    appId: "29827fb8-f2dd-4e80-9576-28e31e9934ac",
    resourceId: "4baf8423-db0a-4037-a4cf-f79c60cb67a5",
    groupId: "9546209c-42c2-4801-96d7-9ec42df0f59c",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("appsGetSyncErrors failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetSyncErrorsRequest ✔️ 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<components.SyncErrorList[]>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*