intercom-client
Version:
Official Node bindings to the Intercom API
115 lines (114 loc) • 4.73 kB
TypeScript
/**
* This file was auto-generated by Fern from our API Definition.
*/
import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as Intercom from "../../../index";
export declare namespace Admins {
interface Options {
environment?: core.Supplier<environments.IntercomEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
/** Override the Intercom-Version header */
version?: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "2.0" | "2.1" | "2.2" | "2.3" | "2.4" | "2.5" | "2.6" | "2.7" | "2.8" | "2.9" | "2.10" | "2.11" | "Unstable";
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<string, string>;
/** Override the Intercom-Version header */
version?: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "2.0" | "2.1" | "2.2" | "2.3" | "2.4" | "2.5" | "2.6" | "2.7" | "2.8" | "2.9" | "2.10" | "2.11" | "Unstable";
}
}
/**
* Everything about your Admins
*/
export declare class Admins {
protected readonly _options: Admins.Options;
constructor(_options?: Admins.Options);
/**
*
* You can view the currently authorised admin along with the embedded app object (a "workspace" in legacy terminology).
*
* > 🚧 Single Sign On
* >
* > If you are building a custom "Log in with Intercom" flow for your site, and you call the `/me` endpoint to identify the logged-in user, you should not accept any sign-ins from users with unverified email addresses as it poses a potential impersonation security risk.
*
* @param {Admins.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.admins.identify()
*/
identify(requestOptions?: Admins.RequestOptions): core.HttpResponsePromise<Intercom.AdminWithApp>;
private __identify;
/**
* You can set an Admin as away for the Inbox.
*
* @param {Intercom.ConfigureAwayAdminRequest} request
* @param {Admins.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
* @throws {@link Intercom.NotFoundError}
*
* @example
* await client.admins.away({
* admin_id: "admin_id",
* away_mode_enabled: true,
* away_mode_reassign: true
* })
*/
away(request: Intercom.ConfigureAwayAdminRequest, requestOptions?: Admins.RequestOptions): core.HttpResponsePromise<Intercom.Admin>;
private __away;
/**
* You can get a log of activities by all admins in an app.
*
* @param {Intercom.ListAllActivityLogsRequest} request
* @param {Admins.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
*
* @example
* await client.admins.listAllActivityLogs({
* created_at_after: "1677253093",
* created_at_before: "1677861493"
* })
*/
listAllActivityLogs(request: Intercom.ListAllActivityLogsRequest, requestOptions?: Admins.RequestOptions): core.HttpResponsePromise<Intercom.ActivityLogList>;
private __listAllActivityLogs;
/**
* You can fetch a list of admins for a given workspace.
*
* @param {Admins.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
*
* @example
* await client.admins.list()
*/
list(requestOptions?: Admins.RequestOptions): core.HttpResponsePromise<Intercom.AdminList>;
private __list;
/**
* You can retrieve the details of a single admin.
*
* @param {Intercom.FindAdminRequest} request
* @param {Admins.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
* @throws {@link Intercom.NotFoundError}
*
* @example
* await client.admins.find({
* admin_id: "123"
* })
*/
find(request: Intercom.FindAdminRequest, requestOptions?: Admins.RequestOptions): core.HttpResponsePromise<Intercom.Admin>;
private __find;
protected _getAuthorizationHeader(): Promise<string>;
}