UNPKG

intercom-client

Version:

Official Node bindings to the Intercom API

183 lines (182 loc) 8.51 kB
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as Intercom from "../../../index.js"; export declare namespace AiContentClient { interface Options extends BaseClientOptions { } interface RequestOptions extends BaseRequestOptions { } } /** * With the AI Content APIs, you can create and manage External Pages and Content Import Sources for your Fin Content Library. * * &nbsp; * * *External Pages* are pages that you want Fin to be able to answer questions about. The API for External Pages is a great way to ingest into your Fin Content Library pages that are not publicly accessible and hence can't be crawled by Intercom. * * &nbsp; * * *Content Import Sources* are the sources of those pages, and they are used to determine the default audience for the pages (configured via the UI). You should create a Content Import Source for each source of External Pages that you want to ingest into your Fin Content Library. * * &nbsp; * * You can then iterate through the content from that source via its API and POST it to the External Pages endpoint. That endpoint has an *external_id* parameter which allows you to specify the identifier from the source. The endpoint will then either create a new External Page or update an existing one as appropriate.", */ export declare class AiContentClient { protected readonly _options: NormalizedClientOptionsWithAuth<AiContentClient.Options>; constructor(options?: AiContentClient.Options); /** * You can retrieve a list of all content import sources for a workspace. * * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.listContentImportSources() */ listContentImportSources(requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<Intercom.ContentImportSourcesList>; private __listContentImportSources; /** * You can create a new content import source by sending a POST request to this endpoint. * * @param {Intercom.CreateContentImportSourceRequest} request * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.createContentImportSource({ * url: "https://www.example.com" * }) */ createContentImportSource(request: Intercom.CreateContentImportSourceRequest, requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<Intercom.ContentImportSource>; private __createContentImportSource; /** * @param {Intercom.GetContentImportSourceRequest} request * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.getContentImportSource({ * source_id: "source_id" * }) */ getContentImportSource(request: Intercom.GetContentImportSourceRequest, requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<Intercom.ContentImportSource>; private __getContentImportSource; /** * You can update an existing content import source. * * @param {Intercom.UpdateContentImportSourceRequest} request * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.updateContentImportSource({ * source_id: "source_id", * sync_behavior: "api", * url: "https://www.example.com" * }) */ updateContentImportSource(request: Intercom.UpdateContentImportSourceRequest, requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<Intercom.ContentImportSource>; private __updateContentImportSource; /** * You can delete a content import source by making a DELETE request this endpoint. This will also delete all external pages that were imported from this source. * * @param {Intercom.DeleteContentImportSourceRequest} request * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.deleteContentImportSource({ * source_id: "source_id" * }) */ deleteContentImportSource(request: Intercom.DeleteContentImportSourceRequest, requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<void>; private __deleteContentImportSource; /** * You can retrieve a list of all external pages for a workspace. * * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.listExternalPages() */ listExternalPages(requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<Intercom.ExternalPagesList>; private __listExternalPages; /** * You can create a new external page by sending a POST request to this endpoint. If an external page already exists with the specified source_id and external_id, it will be updated instead. * * @param {Intercom.CreateExternalPageRequest} request * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.createExternalPage({ * title: "Test", * html: "<html><body><h1>Test</h1></body></html>", * url: "https://www.example.com", * source_id: 44, * external_id: "abc1234" * }) */ createExternalPage(request: Intercom.CreateExternalPageRequest, requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<Intercom.ExternalPage>; private __createExternalPage; /** * You can retrieve an external page. * * @param {Intercom.GetExternalPageRequest} request * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.getExternalPage({ * page_id: "page_id" * }) */ getExternalPage(request: Intercom.GetExternalPageRequest, requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<Intercom.ExternalPage>; private __getExternalPage; /** * You can update an existing external page (if it was created via the API). * * @param {Intercom.UpdateExternalPageRequest} request * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.updateExternalPage({ * page_id: "page_id", * title: "Test", * html: "<html><body><h1>Test</h1></body></html>", * url: "https://www.example.com", * source_id: 47, * external_id: "5678" * }) */ updateExternalPage(request: Intercom.UpdateExternalPageRequest, requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<Intercom.ExternalPage>; private __updateExternalPage; /** * Sending a DELETE request for an external page will remove it from the content library UI and from being used for AI answers. * * @param {Intercom.DeleteExternalPageRequest} request * @param {AiContentClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Intercom.UnauthorizedError} * * @example * await client.aiContent.deleteExternalPage({ * page_id: "page_id" * }) */ deleteExternalPage(request: Intercom.DeleteExternalPageRequest, requestOptions?: AiContentClient.RequestOptions): core.HttpResponsePromise<Intercom.ExternalPage>; private __deleteExternalPage; }