intercom-client
Version:
Official Node bindings to the Intercom API
45 lines (44 loc) • 2.62 kB
text/typescript
import * as core from "./core/index.mjs";
import type * as environments from "./environments.mjs";
export interface BaseClientOptions {
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" | "2.12" | "2.13" | "2.14" | "Unstable";
/** Additional headers to include in requests. */
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
/** The default maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The default number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
fetch?: typeof fetch;
fetcher?: core.FetchFunction;
/** Configure logging for the client. */
logging?: core.logging.LogConfig | core.logging.Logger;
}
export interface BaseRequestOptions {
/** 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 query string parameters to include in the request. */
queryParams?: Record<string, unknown>;
/** Additional headers to include in the request. */
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | 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" | "2.12" | "2.13" | "2.14" | "Unstable";
}
export type NormalizedClientOptions<T extends BaseClientOptions> = T & {
logging: core.logging.Logger;
authProvider?: core.AuthProvider;
};
export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions> = NormalizedClientOptions<T> & {
authProvider: core.AuthProvider;
};
export declare function normalizeClientOptions<T extends BaseClientOptions>(options: T): NormalizedClientOptions<T>;
export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;