/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Klavis from "../../../index.js"; export declare namespace User { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; apiKey?: core.Supplier; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Additional headers to include in the request. */ headers?: Record | undefined>; } } export declare class User { protected readonly _options: User.Options; constructor(_options?: User.Options); /** * Get all available integrations (MCP server names) by user ID. * Returns a list of integration names as McpServerName types. * * @param {string} userId - The external user ID * @param {User.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.user.getUserIntegrations("userId") */ getUserIntegrations(userId: string, requestOptions?: User.RequestOptions): core.HttpResponsePromise; private __getUserIntegrations; /** * Get user information by user_id. * * @param {string} userId - The identifier for the user to fetch. * @param {User.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.user.getUserByUserId("userId") */ getUserByUserId(userId: string, requestOptions?: User.RequestOptions): core.HttpResponsePromise; private __getUserByUserId; /** * Delete a user and all associated data by user_id. * Users cannot delete their own accounts. * This operation will permanently remove all user data. * * @param {string} userId - The identifier for the user to delete. * @param {User.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.user.deleteUserByUserId("userId") */ deleteUserByUserId(userId: string, requestOptions?: User.RequestOptions): core.HttpResponsePromise; private __deleteUserByUserId; /** * Retrieve all users that have been created under your account, with support for pagination. * * @param {Klavis.GetAllUsersRequest} request * @param {User.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.user.getAllUsers({ * page_size: 1, * page_number: 1 * }) */ getAllUsers(request?: Klavis.GetAllUsersRequest, requestOptions?: User.RequestOptions): core.HttpResponsePromise; private __getAllUsers; /** * Sets authentication data for a specific integration for a user. * * Accepts either API key authentication or general authentication data. * This updates the auth_metadata for the specified user's integration instance. * * @param {Klavis.SetUserAuthRequest} request * @param {User.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.user.setUserAuth({ * userId: "userId", * serverName: "Affinity", * authData: {} * }) */ setUserAuth(request: Klavis.SetUserAuthRequest, requestOptions?: User.RequestOptions): core.HttpResponsePromise; private __setUserAuth; /** * Retrieves authentication data for a specific integration for a user. * * Returns the authentication data if available, along with authentication status. * Includes token refresh handling if needed. * * @param {string} userId - The identifier for the user * @param {Klavis.McpServerName} serverName - The name of the MCP server (e.g., 'GitHub', 'Jira') * @param {User.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.user.getUserAuth("userId", "Affinity") */ getUserAuth(userId: string, serverName: Klavis.McpServerName, requestOptions?: User.RequestOptions): core.HttpResponsePromise; private __getUserAuth; /** * Deletes authentication data for a specific integration for a user. * * This will clear the stored authentication credentials, effectively unauthenticating the integration. * * @param {string} userId - The unique identifier for the user * @param {Klavis.McpServerName} serverName - The name of the MCP server to delete authentication for (e.g., 'github', 'jira') * @param {User.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Klavis.UnprocessableEntityError} * * @example * await client.user.deleteUserAuth("userId", "Affinity") */ deleteUserAuth(userId: string, serverName: Klavis.McpServerName, requestOptions?: User.RequestOptions): core.HttpResponsePromise; private __deleteUserAuth; protected _getAuthorizationHeader(): Promise; }