intercom-client
Version:
Official Node bindings to the Intercom API
142 lines (141 loc) • 5.9 kB
TypeScript
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 ArticlesClient {
interface Options extends BaseClientOptions {
}
interface RequestOptions extends BaseRequestOptions {
}
}
/**
* Everything about your Articles
*/
export declare class ArticlesClient {
protected readonly _options: NormalizedClientOptionsWithAuth<ArticlesClient.Options>;
constructor(options?: ArticlesClient.Options);
/**
* You can fetch a list of all articles by making a GET request to `https://api.intercom.io/articles`.
*
* > 📘 How are the articles sorted and ordered?
* >
* > Articles will be returned in descending order on the `updated_at` attribute. This means if you need to iterate through results then we'll show the most recently updated articles first.
*
* @param {Intercom.ListArticlesRequest} request
* @param {ArticlesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
*
* @example
* await client.articles.list()
*/
list(request?: Intercom.ListArticlesRequest, requestOptions?: ArticlesClient.RequestOptions): Promise<core.Page<Intercom.ArticleListItem, Intercom.ArticleList>>;
/**
* You can create a new article by making a POST request to `https://api.intercom.io/articles`.
*
* @param {Intercom.CreateArticleRequest} request
* @param {ArticlesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.BadRequestError}
* @throws {@link Intercom.UnauthorizedError}
*
* @example
* await client.articles.create({
* title: "Thanks for everything",
* description: "Description of the Article",
* body: "Body of the Article",
* author_id: 991267497,
* state: "published",
* parent_id: 145,
* parent_type: "collection",
* translated_content: {
* fr: {
* title: "Merci pour tout",
* description: "Description de l'article",
* body: "Corps de l'article",
* author_id: 991267497,
* state: "published"
* }
* }
* })
*
* @example
* await client.articles.create({
* title: "Thanks for everything",
* description: "Description of the Article",
* body: "Body of the Article",
* author_id: 1295,
* state: "published"
* })
*/
create(request?: Intercom.CreateArticleRequest, requestOptions?: ArticlesClient.RequestOptions): core.HttpResponsePromise<Intercom.Article>;
private __create;
/**
* You can fetch the details of a single article by making a GET request to `https://api.intercom.io/articles/<id>`.
*
* @param {Intercom.FindArticleRequest} request
* @param {ArticlesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
* @throws {@link Intercom.NotFoundError}
*
* @example
* await client.articles.find({
* article_id: 1
* })
*/
find(request: Intercom.FindArticleRequest, requestOptions?: ArticlesClient.RequestOptions): core.HttpResponsePromise<Intercom.Article>;
private __find;
/**
* You can update the details of a single article by making a PUT request to `https://api.intercom.io/articles/<id>`.
*
* @param {Intercom.UpdateArticleRequest} request
* @param {ArticlesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
* @throws {@link Intercom.NotFoundError}
*
* @example
* await client.articles.update({
* article_id: 1,
* title: "Christmas is here!",
* body: "<p>New gifts in store for the jolly season</p>"
* })
*/
update(request: Intercom.UpdateArticleRequest, requestOptions?: ArticlesClient.RequestOptions): core.HttpResponsePromise<Intercom.Article>;
private __update;
/**
* You can delete a single article by making a DELETE request to `https://api.intercom.io/articles/<id>`.
*
* @param {Intercom.DeleteArticleRequest} request
* @param {ArticlesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
* @throws {@link Intercom.NotFoundError}
*
* @example
* await client.articles.delete({
* article_id: 1
* })
*/
delete(request: Intercom.DeleteArticleRequest, requestOptions?: ArticlesClient.RequestOptions): core.HttpResponsePromise<Intercom.DeletedArticleObject>;
private __delete;
/**
* You can search for articles by making a GET request to `https://api.intercom.io/articles/search`.
*
* @param {Intercom.SearchArticlesRequest} request
* @param {ArticlesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Intercom.UnauthorizedError}
*
* @example
* await client.articles.search({
* phrase: "Getting started",
* state: "published",
* help_center_id: 1,
* highlight: true
* })
*/
search(request?: Intercom.SearchArticlesRequest, requestOptions?: ArticlesClient.RequestOptions): core.HttpResponsePromise<Intercom.ArticleSearchResponse>;
private __search;
}