/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 2dda252d574b */ import { betaConnectorsActivateForConsumer } from "../funcs/betaConnectorsActivateForConsumer.js"; import { betaConnectorsCallTool } from "../funcs/betaConnectorsCallTool.js"; import { betaConnectorsCreate } from "../funcs/betaConnectorsCreate.js"; import { betaConnectorsCreateCredentials } from "../funcs/betaConnectorsCreateCredentials.js"; import { betaConnectorsDeactivateForConsumer } from "../funcs/betaConnectorsDeactivateForConsumer.js"; import { betaConnectorsDelete } from "../funcs/betaConnectorsDelete.js"; import { betaConnectorsDeleteAllUserCredentials } from "../funcs/betaConnectorsDeleteAllUserCredentials.js"; import { betaConnectorsDeleteOrganizationCredentials } from "../funcs/betaConnectorsDeleteOrganizationCredentials.js"; import { betaConnectorsDeleteUserCredentials } from "../funcs/betaConnectorsDeleteUserCredentials.js"; import { betaConnectorsDeleteWorkspaceCredentials } from "../funcs/betaConnectorsDeleteWorkspaceCredentials.js"; import { betaConnectorsGet } from "../funcs/betaConnectorsGet.js"; import { betaConnectorsGetAuthenticationMethods } from "../funcs/betaConnectorsGetAuthenticationMethods.js"; import { betaConnectorsGetAuthUrl } from "../funcs/betaConnectorsGetAuthUrl.js"; import { betaConnectorsList } from "../funcs/betaConnectorsList.js"; import { betaConnectorsListOrganizationCredentials } from "../funcs/betaConnectorsListOrganizationCredentials.js"; import { betaConnectorsListTools } from "../funcs/betaConnectorsListTools.js"; import { betaConnectorsListUserCredentials } from "../funcs/betaConnectorsListUserCredentials.js"; import { betaConnectorsListWorkspaceCredentials } from "../funcs/betaConnectorsListWorkspaceCredentials.js"; import { betaConnectorsShare } from "../funcs/betaConnectorsShare.js"; import { betaConnectorsShareToOrganization } from "../funcs/betaConnectorsShareToOrganization.js"; import { betaConnectorsUnshare } from "../funcs/betaConnectorsUnshare.js"; import { betaConnectorsUnshareFromOrganization } from "../funcs/betaConnectorsUnshareFromOrganization.js"; import { betaConnectorsUpdate } from "../funcs/betaConnectorsUpdate.js"; import { betaConnectorsUpdateCredentials } from "../funcs/betaConnectorsUpdateCredentials.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Connectors extends ClientSDK { /** * Create a new connector. * * @remarks * Create a new MCP or HTTP connector. You can customize its visibility, URL, and auth type. */ async create( request: operations.ConnectorCreateV1Payload, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsCreate( this, request, options, )); } /** * List all connectors. * * @remarks * List all your custom connectors with keyset pagination and filters. */ async list( request?: operations.ConnectorListV1Request | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsList( this, request, options, )); } /** * Get the auth URL for a connector. * * @remarks * Get the OAuth2 authorization URL for a connector to initiate user authentication. */ async getAuthUrl( request: operations.ConnectorGetAuthUrlV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsGetAuthUrl( this, request, options, )); } /** * Share a private connector to the current workspace. * * @remarks * Transfers ownership of a private user-owned connector to the current workspace, making it available to all workspace members. The creator can later revert this via the unshare endpoint. Any authentication flows that rely on the original owner's identity (e.g. OAuth on-behalf-of) will be affected and must be reconfigured after sharing. Only the connector's creator can call this endpoint. Requires the ShareConnectorToWorkspace workspace permission. */ async share( request: operations.ConnectorShareV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsShare( this, request, options, )); } /** * Unshare a connector from the current workspace. * * @remarks * Reverts a workspace-shared connector back to a private, creator-owned connector. Workspace-scoped connections and other members' connections are removed; the creator's own connection is preserved. Only the connector's creator can call this endpoint. Requires the ShareConnectorToWorkspace workspace permission. */ async unshare( request: operations.ConnectorUnshareV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsUnshare( this, request, options, )); } /** * Share a connector to the current organization. * * @remarks * Transfers ownership of a private user-owned connector to the current organization, making it available to all organization members. The creator can later revert this via the unshare endpoint. Any authentication flows that rely on the original owner's identity (e.g. OAuth on-behalf-of) will be affected and must be reconfigured after sharing. Requires the ShareConnectorToOrg organization permission. */ async shareToOrganization( request: operations.ConnectorShareToOrganizationV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsShareToOrganization( this, request, options, )); } /** * Unshare a connector from the current organization. * * @remarks * Reverts an organization-shared connector back to a private, creator-owned connector. Organization-scoped connections and other members' connections are removed; the creator's own connection is preserved. Requires the ShareConnectorToOrg organization permission. */ async unshareFromOrganization( request: operations.ConnectorUnshareFromOrganizationV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsUnshareFromOrganization( this, request, options, )); } /** * Activate a connector for the given consumer (organization, workspace, user). * * @remarks * Enable a connector for the consumer. */ async activateForConsumer( request: operations.ConnectorActivateForConsumerV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsActivateForConsumer( this, request, options, )); } /** * Deactivate a connector for the current consumer (at organization, workspace or user level). * * @remarks * Disable a connector for the calling consumer only. */ async deactivateForConsumer( request: operations.ConnectorDeactivateForConsumerV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsDeactivateForConsumer( this, request, options, )); } /** * Call Connector Tool * * @remarks * Call a tool on an MCP connector. */ async callTool( request: operations.ConnectorCallToolV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsCallTool( this, request, options, )); } /** * List tools for a connector. * * @remarks * List all tools available for an MCP connector. */ async listTools( request: operations.ConnectorListToolsV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsListTools( this, request, options, )); } /** * Get authentication methods for a connector. * * @remarks * Get the authentication schema for a connector. Returns the list of supported authentication methods and their required headers. */ async getAuthenticationMethods( request: operations.ConnectorGetAuthenticationMethodsV1Request, options?: RequestOptions, ): Promise> { return unwrapAsync(betaConnectorsGetAuthenticationMethods( this, request, options, )); } /** * List organization credentials for a connector. * * @remarks * List all credentials configured at the organization level for a given connector. */ async listOrganizationCredentials( request: operations.ConnectorListOrganizationCredentialsV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsListOrganizationCredentials( this, request, options, )); } /** * List workspace credentials for a connector. * * @remarks * List all credentials configured at the workspace level for a given connector. */ async listWorkspaceCredentials( request: operations.ConnectorListWorkspaceCredentialsV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsListWorkspaceCredentials( this, request, options, )); } /** * List user credentials for a connector. * * @remarks * List all credentials configured at the user level for a given connector. */ async listUserCredentials( request: operations.ConnectorListUserCredentialsV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsListUserCredentials( this, request, options, )); } /** * Delete all user credentials for a connector. * * @remarks * Delete all credentials configured at the user level for a given connector. */ async deleteAllUserCredentials( request: operations.ConnectorDeleteAllUserCredentialsV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsDeleteAllUserCredentials( this, request, options, )); } /** * Create consumer credentials for a connector. * * @remarks * Create consumer credentials for a given connector and consumer scope (organization, workspace, user) */ async createCredentials( request: operations.ConnectorCreateCredentialsV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsCreateCredentials( this, request, options, )); } /** * Create or update consumer credentials for a connector. * * @remarks * Create or update consumer credentials for a given connector. */ async updateCredentials( request: operations.ConnectorUpdateCredentialsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsUpdateCredentials( this, request, options, )); } /** * Delete organization credentials for a connector. * * @remarks * Delete credentials at the organization level for a given connector. */ async deleteOrganizationCredentials( request: operations.ConnectorDeleteOrganizationCredentialsV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsDeleteOrganizationCredentials( this, request, options, )); } /** * Delete workspace credentials for a connector. * * @remarks * Delete credentials at the workspace level for a given connector. */ async deleteWorkspaceCredentials( request: operations.ConnectorDeleteWorkspaceCredentialsV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsDeleteWorkspaceCredentials( this, request, options, )); } /** * Delete user credentials for a connector. * * @remarks * Delete credentials at the user level for a given connector. */ async deleteUserCredentials( request: operations.ConnectorDeleteUserCredentialsV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsDeleteUserCredentials( this, request, options, )); } /** * Get a connector. * * @remarks * Get a connector by its ID or name. */ async get( request: operations.ConnectorGetV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsGet( this, request, options, )); } /** * Update a connector. * * @remarks * Update a connector by its ID. */ async update( request: operations.ConnectorUpdateV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsUpdate( this, request, options, )); } /** * Delete a connector. * * @remarks * Delete a connector by its ID. */ async delete( request: operations.ConnectorDeleteV1Request, options?: RequestOptions, ): Promise { return unwrapAsync(betaConnectorsDelete( this, request, options, )); } }