From 62344661f11487e9e1b9df3240f6f4a0735e3243 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 18:01:25 +0000 Subject: [PATCH 1/2] SDK regeneration --- package.json | 2 +- reference.md | 265 ++ src/BaseClient.ts | 4 +- src/Client.ts | 6 + src/api/resources/index.ts | 1 + .../resources/ipAllowlist/client/Client.ts | 179 ++ src/api/resources/ipAllowlist/client/index.ts | 1 + src/api/resources/ipAllowlist/index.ts | 1 + src/api/resources/unstable/client/Client.ts | 6 + .../resources/aiAgent/types/AiAgent.ts | 1 + .../client/requests/UpdateContactRequest.ts | 2 + .../resources/contacts/types/Contact.ts | 2 +- .../resources/conversations/client/Client.ts | 81 + .../requests/ListHandlingEventsRequest.ts | 12 + .../conversations/client/requests/index.ts | 1 + .../conversations/types/Conversation.ts | 2 + src/api/resources/unstable/resources/index.ts | 2 + .../resources/workflows/client/Client.ts | 107 + .../resources/workflows/client/index.ts | 1 + .../client/requests/ExportWorkflowRequest.ts | 12 + .../workflows/client/requests/index.ts | 1 + .../unstable/resources/workflows/index.ts | 1 + .../ConversationAttributeUpdatedByAdmin.ts | 4 +- .../ConversationAttributeUpdatedByUser.ts | 23 + .../types/ConversationSlaAppliedByRule.ts | 27 + .../types/ConversationSlaAppliedByWorkflow.ts | 27 + .../unstable/types/ConversationSlaPaused.ts | 33 + .../unstable/types/ConversationSlaRemoved.ts | 9 + .../types/ConversationSlaTargetMissed.ts | 55 + .../unstable/types/ConversationSlaUnpaused.ts | 9 + .../unstable/types/ConversationTagsUpdated.ts | 11 + .../resources/unstable/types/EventDetails.ts | 12 +- .../resources/unstable/types/HandlingEvent.ts | 25 + .../unstable/types/HandlingEventList.ts | 11 + .../unstable/types/PriorityChanged.ts | 26 + src/api/resources/unstable/types/Snoozed.ts | 11 + .../unstable/types/TeammateReference.ts | 25 + .../unstable/types/WorkflowExport.ts | 59 + src/api/resources/unstable/types/index.ts | 14 + src/api/types/ActivityLog.ts | 7 +- src/api/types/IpAllowlist.ts | 18 + src/api/types/index.ts | 1 + src/version.ts | 2 +- tests/wire/ipAllowlist.test.ts | 122 + tests/wire/unstable/conversations.test.ts | 2288 +++++++++++++++++ tests/wire/unstable/workflows.test.ts | 131 + 46 files changed, 3632 insertions(+), 8 deletions(-) create mode 100644 src/api/resources/ipAllowlist/client/Client.ts create mode 100644 src/api/resources/ipAllowlist/client/index.ts create mode 100644 src/api/resources/ipAllowlist/index.ts create mode 100644 src/api/resources/unstable/resources/conversations/client/requests/ListHandlingEventsRequest.ts create mode 100644 src/api/resources/unstable/resources/workflows/client/Client.ts create mode 100644 src/api/resources/unstable/resources/workflows/client/index.ts create mode 100644 src/api/resources/unstable/resources/workflows/client/requests/ExportWorkflowRequest.ts create mode 100644 src/api/resources/unstable/resources/workflows/client/requests/index.ts create mode 100644 src/api/resources/unstable/resources/workflows/index.ts create mode 100644 src/api/resources/unstable/types/ConversationAttributeUpdatedByUser.ts create mode 100644 src/api/resources/unstable/types/ConversationSlaAppliedByRule.ts create mode 100644 src/api/resources/unstable/types/ConversationSlaAppliedByWorkflow.ts create mode 100644 src/api/resources/unstable/types/ConversationSlaPaused.ts create mode 100644 src/api/resources/unstable/types/ConversationSlaRemoved.ts create mode 100644 src/api/resources/unstable/types/ConversationSlaTargetMissed.ts create mode 100644 src/api/resources/unstable/types/ConversationSlaUnpaused.ts create mode 100644 src/api/resources/unstable/types/ConversationTagsUpdated.ts create mode 100644 src/api/resources/unstable/types/HandlingEvent.ts create mode 100644 src/api/resources/unstable/types/HandlingEventList.ts create mode 100644 src/api/resources/unstable/types/PriorityChanged.ts create mode 100644 src/api/resources/unstable/types/Snoozed.ts create mode 100644 src/api/resources/unstable/types/TeammateReference.ts create mode 100644 src/api/resources/unstable/types/WorkflowExport.ts create mode 100644 src/api/types/IpAllowlist.ts create mode 100644 tests/wire/ipAllowlist.test.ts create mode 100644 tests/wire/unstable/workflows.test.ts diff --git a/package.json b/package.json index 77a16de3..6d3287ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "intercom-client", - "version": "7.0.1", + "version": "7.0.2", "private": false, "repository": "github:intercom/intercom-node", "type": "commonjs", diff --git a/reference.md b/reference.md index 5b2306ab..224ae271 100644 --- a/reference.md +++ b/reference.md @@ -2451,6 +2451,132 @@ await client.internalArticles.searchInternalArticles({ + + + + +## IP Allowlist +
client.ipAllowlist.getIpAllowlist() -> Intercom.IpAllowlist +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the current IP allowlist configuration for the workspace. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ipAllowlist.getIpAllowlist(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `IpAllowlistClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ipAllowlist.updateIpAllowlist({ ...params }) -> Intercom.IpAllowlist +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the IP allowlist configuration for the workspace. + +{% admonition type="warning" name="Lockout Protection" %} + The API will reject updates that would lock out the caller's IP address. Ensure your current IP is included in the allowlist when enabling the feature. +{% /admonition %} +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ipAllowlist.updateIpAllowlist({ + enabled: true, + ip_allowlist: ["192.168.1.0/24", "10.0.0.1"] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Intercom.IpAllowlist` + +
+
+ +
+
+ +**requestOptions:** `IpAllowlistClient.RequestOptions` + +
+
+
+
+ +
@@ -16633,6 +16759,73 @@ await client.unstable.conversations.detachContactFromConversation({ + + + + +
client.unstable.conversations.listHandlingEvents({ ...params }) -> Intercom.HandlingEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List all pause/resume events for a conversation. These events track when teammates paused or resumed handling a conversation. + +Requires the `read_conversations` OAuth scope. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.unstable.conversations.listHandlingEvents({ + id: "123" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Intercom.unstable.ListHandlingEventsRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ +
@@ -18150,6 +18343,78 @@ await client.unstable.dataExport.downloadDataExport({ + + + + +## Workflows +
client.unstable.workflows.exportWorkflow({ ...params }) -> Intercom.WorkflowExport +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Export a workflow configuration by its ID. This endpoint returns the complete workflow definition including its steps, targeting rules, and attributes. + +This endpoint is designed for EU Data Act compliance, allowing customers to export their workflow configurations. + +{% admonition type="warning" name="Unstable API" %} + This API is currently in the Unstable version. Its behavior may change in future releases. +{% /admonition %} +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.unstable.workflows.exportWorkflow({ + id: "12345" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Intercom.unstable.ExportWorkflowRequest` + +
+
+ +
+
+ +**requestOptions:** `WorkflowsClient.RequestOptions` + +
+
+
+
+ +
diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 45d31870..84ecd466 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -96,8 +96,8 @@ export function normalizeClientOptions(options: T): { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", - "X-Fern-SDK-Version": "7.0.0", - "User-Agent": "intercom-client/7.0.0", + "X-Fern-SDK-Version": "7.0.2", + "User-Agent": "intercom-client/7.0.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "Intercom-Version": options?.version ?? "2.14", diff --git a/src/Client.ts b/src/Client.ts index 8db0d729..db9d639f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -16,6 +16,7 @@ import { EventsClient } from "./api/resources/events/client/Client.js"; import { ExportClient } from "./api/resources/export/client/Client.js"; import { HelpCentersClient } from "./api/resources/helpCenters/client/Client.js"; import { InternalArticlesClient } from "./api/resources/internalArticles/client/Client.js"; +import { IpAllowlistClient } from "./api/resources/ipAllowlist/client/Client.js"; import { JobsClient } from "./api/resources/jobs/client/Client.js"; import { MessagesClient } from "./api/resources/messages/client/Client.js"; import { NewsClient } from "./api/resources/news/client/Client.js"; @@ -49,6 +50,7 @@ export class IntercomClient { protected _dataExport: DataExportClient | undefined; protected _helpCenters: HelpCentersClient | undefined; protected _internalArticles: InternalArticlesClient | undefined; + protected _ipAllowlist: IpAllowlistClient | undefined; protected _companies: CompaniesClient | undefined; protected _contacts: ContactsClient | undefined; protected _notes: NotesClient | undefined; @@ -108,6 +110,10 @@ export class IntercomClient { return (this._internalArticles ??= new InternalArticlesClient(this._options)); } + public get ipAllowlist(): IpAllowlistClient { + return (this._ipAllowlist ??= new IpAllowlistClient(this._options)); + } + public get companies(): CompaniesClient { return (this._companies ??= new CompaniesClient(this._options)); } diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 80be8483..716d6022 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -49,6 +49,7 @@ export * as helpCenters from "./helpCenters/index.js"; export * from "./internalArticles/client/requests/index.js"; export * as internalArticles from "./internalArticles/index.js"; export * from "./internalArticles/types/index.js"; +export * as ipAllowlist from "./ipAllowlist/index.js"; export * from "./jobs/client/requests/index.js"; export * as jobs from "./jobs/index.js"; export * from "./jobs/types/index.js"; diff --git a/src/api/resources/ipAllowlist/client/Client.ts b/src/api/resources/ipAllowlist/client/Client.ts new file mode 100644 index 00000000..21809d4b --- /dev/null +++ b/src/api/resources/ipAllowlist/client/Client.ts @@ -0,0 +1,179 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Intercom from "../../../index.js"; + +export declare namespace IpAllowlistClient { + export interface Options extends BaseClientOptions {} + + export interface RequestOptions extends BaseRequestOptions {} +} + +/** + * Manage IP allowlist settings for your workspace. + * + * The IP Allowlist API allows you to configure which IP addresses are allowed to access the Intercom API and web application for your workspace. This is useful for restricting access to your Intercom workspace to specific corporate networks or VPNs. + * + * {% admonition type="info" name="Authentication" %} + * This endpoint requires the `manage_ip_allowlist` OAuth scope. + * {% /admonition %} + */ +export class IpAllowlistClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: IpAllowlistClient.Options = {}) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Retrieve the current IP allowlist configuration for the workspace. + * + * @param {IpAllowlistClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Intercom.UnauthorizedError} + * + * @example + * await client.ipAllowlist.getIpAllowlist() + */ + public getIpAllowlist( + requestOptions?: IpAllowlistClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getIpAllowlist(requestOptions)); + } + + private async __getIpAllowlist( + requestOptions?: IpAllowlistClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Intercom-Version": requestOptions?.version }), + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.IntercomEnvironment.UsProduction, + "ip_allowlist", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 20) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Intercom.IpAllowlist, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Intercom.UnauthorizedError( + _response.error.body as Intercom.Error_, + _response.rawResponse, + ); + default: + throw new errors.IntercomError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/ip_allowlist"); + } + + /** + * Update the IP allowlist configuration for the workspace. + * + * {% admonition type="warning" name="Lockout Protection" %} + * The API will reject updates that would lock out the caller's IP address. Ensure your current IP is included in the allowlist when enabling the feature. + * {% /admonition %} + * + * @param {Intercom.IpAllowlist} request + * @param {IpAllowlistClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Intercom.UnauthorizedError} + * @throws {@link Intercom.UnprocessableEntityError} + * + * @example + * await client.ipAllowlist.updateIpAllowlist({ + * enabled: true, + * ip_allowlist: ["192.168.1.0/24", "10.0.0.1"] + * }) + */ + public updateIpAllowlist( + request: Intercom.IpAllowlist, + requestOptions?: IpAllowlistClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateIpAllowlist(request, requestOptions)); + } + + private async __updateIpAllowlist( + request: Intercom.IpAllowlist, + requestOptions?: IpAllowlistClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Intercom-Version": requestOptions?.version }), + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.IntercomEnvironment.UsProduction, + "ip_allowlist", + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 20) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Intercom.IpAllowlist, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Intercom.UnauthorizedError( + _response.error.body as Intercom.Error_, + _response.rawResponse, + ); + case 422: + throw new Intercom.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.IntercomError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/ip_allowlist"); + } +} diff --git a/src/api/resources/ipAllowlist/client/index.ts b/src/api/resources/ipAllowlist/client/index.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/src/api/resources/ipAllowlist/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/ipAllowlist/index.ts b/src/api/resources/ipAllowlist/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/ipAllowlist/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/unstable/client/Client.ts b/src/api/resources/unstable/client/Client.ts index 3058c14f..f42b2732 100644 --- a/src/api/resources/unstable/client/Client.ts +++ b/src/api/resources/unstable/client/Client.ts @@ -35,6 +35,7 @@ import { TicketsClient } from "../resources/tickets/client/Client.js"; import { TicketTypeAttributesClient } from "../resources/ticketTypeAttributes/client/Client.js"; import { TicketTypesClient } from "../resources/ticketTypes/client/Client.js"; import { VisitorsClient } from "../resources/visitors/client/Client.js"; +import { WorkflowsClient } from "../resources/workflows/client/Client.js"; export declare namespace UnstableClient { export interface Options extends BaseClientOptions {} @@ -60,6 +61,7 @@ export class UnstableClient { protected _dataAttributes: DataAttributesClient | undefined; protected _dataEvents: DataEventsClient | undefined; protected _dataExport: DataExportClient | undefined; + protected _workflows: WorkflowsClient | undefined; protected _jobs: JobsClient | undefined; protected _macros: MacrosClient | undefined; protected _messages: MessagesClient | undefined; @@ -152,6 +154,10 @@ export class UnstableClient { return (this._dataExport ??= new DataExportClient(this._options)); } + public get workflows(): WorkflowsClient { + return (this._workflows ??= new WorkflowsClient(this._options)); + } + public get jobs(): JobsClient { return (this._jobs ??= new JobsClient(this._options)); } diff --git a/src/api/resources/unstable/resources/aiAgent/types/AiAgent.ts b/src/api/resources/unstable/resources/aiAgent/types/AiAgent.ts index fb043f41..868b1cd9 100644 --- a/src/api/resources/unstable/resources/aiAgent/types/AiAgent.ts +++ b/src/api/resources/unstable/resources/aiAgent/types/AiAgent.ts @@ -47,6 +47,7 @@ export namespace AiAgent { ConfirmedResolution: "confirmed_resolution", Escalated: "escalated", NegativeFeedback: "negative_feedback", + ProcedureHandoff: "procedure_handoff", } as const; export type ResolutionState = (typeof ResolutionState)[keyof typeof ResolutionState]; } diff --git a/src/api/resources/unstable/resources/contacts/client/requests/UpdateContactRequest.ts b/src/api/resources/unstable/resources/contacts/client/requests/UpdateContactRequest.ts index e33aba66..3d671681 100644 --- a/src/api/resources/unstable/resources/contacts/client/requests/UpdateContactRequest.ts +++ b/src/api/resources/unstable/resources/contacts/client/requests/UpdateContactRequest.ts @@ -41,6 +41,8 @@ export interface UpdateContactRequest { owner_id?: number; /** Whether the contact is unsubscribed from emails */ unsubscribed_from_emails?: boolean; + /** A preferred language setting for the contact, used by Intercom as the language of Fin and the Messenger even if their browser has a different setting. Supports ISO 639-1 two-letter language codes. If an unsupported code is supplied, the field will be set to null. */ + language_override?: string; /** The custom attributes which are set for the contact */ custom_attributes?: Record; } diff --git a/src/api/resources/unstable/resources/contacts/types/Contact.ts b/src/api/resources/unstable/resources/contacts/types/Contact.ts index 0cf076af..cb4e3927 100644 --- a/src/api/resources/unstable/resources/contacts/types/Contact.ts +++ b/src/api/resources/unstable/resources/contacts/types/Contact.ts @@ -50,7 +50,7 @@ export interface Contact { last_email_opened_at?: number; /** (UNIX timestamp) The time when the contact last clicked a link in an email. */ last_email_clicked_at?: number; - /** A preferred language setting for the contact, used by the Intercom Messenger even if their browser settings change. */ + /** A preferred language setting for the contact, used by Intercom as the language of Fin and the Messenger even if their browser has a different setting. Supports ISO 639-1 two-letter language codes. If an unsupported code is supplied, the field will be set to null. */ language_override?: string; /** The name of the browser which the contact is using. */ browser?: string; diff --git a/src/api/resources/unstable/resources/conversations/client/Client.ts b/src/api/resources/unstable/resources/conversations/client/Client.ts index 70ca206d..1823bcca 100644 --- a/src/api/resources/unstable/resources/conversations/client/Client.ts +++ b/src/api/resources/unstable/resources/conversations/client/Client.ts @@ -1161,6 +1161,87 @@ export class ConversationsClient { ); } + /** + * List all pause/resume events for a conversation. These events track when teammates paused or resumed handling a conversation. + * + * Requires the `read_conversations` OAuth scope. + * + * @param {Intercom.unstable.ListHandlingEventsRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Intercom.unstable.UnauthorizedError} + * @throws {@link Intercom.unstable.NotFoundError} + * + * @example + * await client.unstable.conversations.listHandlingEvents({ + * id: "123" + * }) + */ + public listHandlingEvents( + request: Intercom.unstable.ListHandlingEventsRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listHandlingEvents(request, requestOptions)); + } + + private async __listHandlingEvents( + request: Intercom.unstable.ListHandlingEventsRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Intercom-Version": requestOptions?.version }), + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.IntercomEnvironment.UsProduction, + `conversations/${core.url.encodePathParam(id)}/handling_events`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 20) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Intercom.unstable.HandlingEventList, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Intercom.unstable.UnauthorizedError( + _response.error.body as Intercom.unstable.Error_, + _response.rawResponse, + ); + case 404: + throw new Intercom.unstable.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.IntercomError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/conversations/{id}/handling_events", + ); + } + /** * You can redact a conversation part or the source message of a conversation (as seen in the source object). * diff --git a/src/api/resources/unstable/resources/conversations/client/requests/ListHandlingEventsRequest.ts b/src/api/resources/unstable/resources/conversations/client/requests/ListHandlingEventsRequest.ts new file mode 100644 index 00000000..3f3f4d31 --- /dev/null +++ b/src/api/resources/unstable/resources/conversations/client/requests/ListHandlingEventsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "123" + * } + */ +export interface ListHandlingEventsRequest { + /** The identifier for the conversation as given by Intercom. */ + id: string; +} diff --git a/src/api/resources/unstable/resources/conversations/client/requests/index.ts b/src/api/resources/unstable/resources/conversations/client/requests/index.ts index 0d6b5317..3733a95d 100644 --- a/src/api/resources/unstable/resources/conversations/client/requests/index.ts +++ b/src/api/resources/unstable/resources/conversations/client/requests/index.ts @@ -4,6 +4,7 @@ export type { CreateConversationRequest } from "./CreateConversationRequest.js"; export type { DeleteConversationRequest } from "./DeleteConversationRequest.js"; export type { DetachContactFromConversationRequest } from "./DetachContactFromConversationRequest.js"; export type { ListConversationsRequest } from "./ListConversationsRequest.js"; +export type { ListHandlingEventsRequest } from "./ListHandlingEventsRequest.js"; export type { ManageConversationRequest } from "./ManageConversationRequest.js"; export type { ReplyConversationRequest } from "./ReplyConversationRequest.js"; export type { RetrieveConversationRequest } from "./RetrieveConversationRequest.js"; diff --git a/src/api/resources/unstable/resources/conversations/types/Conversation.ts b/src/api/resources/unstable/resources/conversations/types/Conversation.ts index 8a79bcda..d53ea2a2 100644 --- a/src/api/resources/unstable/resources/conversations/types/Conversation.ts +++ b/src/api/resources/unstable/resources/conversations/types/Conversation.ts @@ -34,6 +34,8 @@ export interface Conversation { team_assignee_id?: string; /** The ID of the company that the conversation is associated with. The unique identifier for the company which is given by Intercom. */ company_id?: string; + /** The company associated with the conversation. */ + company?: Intercom.unstable.Company; tags?: Intercom.unstable.Tags; conversation_rating?: Intercom.unstable.ConversationRating; source?: Intercom.unstable.ConversationSource; diff --git a/src/api/resources/unstable/resources/index.ts b/src/api/resources/unstable/resources/index.ts index 47fc9e84..e821213e 100644 --- a/src/api/resources/unstable/resources/index.ts +++ b/src/api/resources/unstable/resources/index.ts @@ -91,3 +91,5 @@ export * from "./ticketTypes/client/requests/index.js"; export * as ticketTypes from "./ticketTypes/index.js"; export * from "./visitors/client/requests/index.js"; export * as visitors from "./visitors/index.js"; +export * from "./workflows/client/requests/index.js"; +export * as workflows from "./workflows/index.js"; diff --git a/src/api/resources/unstable/resources/workflows/client/Client.ts b/src/api/resources/unstable/resources/workflows/client/Client.ts new file mode 100644 index 00000000..9e14a53a --- /dev/null +++ b/src/api/resources/unstable/resources/workflows/client/Client.ts @@ -0,0 +1,107 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import * as environments from "../../../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as Intercom from "../../../../../index.js"; + +export declare namespace WorkflowsClient { + export interface Options extends BaseClientOptions {} + + export interface RequestOptions extends BaseRequestOptions {} +} + +/** + * Export workflow configurations from your workspace. + */ +export class WorkflowsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: WorkflowsClient.Options = {}) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Export a workflow configuration by its ID. This endpoint returns the complete workflow definition including its steps, targeting rules, and attributes. + * + * This endpoint is designed for EU Data Act compliance, allowing customers to export their workflow configurations. + * + * {% admonition type="warning" name="Unstable API" %} + * This API is currently in the Unstable version. Its behavior may change in future releases. + * {% /admonition %} + * + * @param {Intercom.unstable.ExportWorkflowRequest} request + * @param {WorkflowsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Intercom.unstable.ForbiddenError} + * @throws {@link Intercom.unstable.NotFoundError} + * + * @example + * await client.unstable.workflows.exportWorkflow({ + * id: "12345" + * }) + */ + public exportWorkflow( + request: Intercom.unstable.ExportWorkflowRequest, + requestOptions?: WorkflowsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__exportWorkflow(request, requestOptions)); + } + + private async __exportWorkflow( + request: Intercom.unstable.ExportWorkflowRequest, + requestOptions?: WorkflowsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Intercom-Version": requestOptions?.version }), + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.IntercomEnvironment.UsProduction, + `export/workflows/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 20) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Intercom.unstable.WorkflowExport, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 403: + throw new Intercom.unstable.ForbiddenError( + _response.error.body as Intercom.unstable.Error_, + _response.rawResponse, + ); + case 404: + throw new Intercom.unstable.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.IntercomError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/export/workflows/{id}"); + } +} diff --git a/src/api/resources/unstable/resources/workflows/client/index.ts b/src/api/resources/unstable/resources/workflows/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/unstable/resources/workflows/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/unstable/resources/workflows/client/requests/ExportWorkflowRequest.ts b/src/api/resources/unstable/resources/workflows/client/requests/ExportWorkflowRequest.ts new file mode 100644 index 00000000..f8d7dd1d --- /dev/null +++ b/src/api/resources/unstable/resources/workflows/client/requests/ExportWorkflowRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "12345" + * } + */ +export interface ExportWorkflowRequest { + /** The unique identifier for the workflow */ + id: string; +} diff --git a/src/api/resources/unstable/resources/workflows/client/requests/index.ts b/src/api/resources/unstable/resources/workflows/client/requests/index.ts new file mode 100644 index 00000000..b9acc294 --- /dev/null +++ b/src/api/resources/unstable/resources/workflows/client/requests/index.ts @@ -0,0 +1 @@ +export type { ExportWorkflowRequest } from "./ExportWorkflowRequest.js"; diff --git a/src/api/resources/unstable/resources/workflows/index.ts b/src/api/resources/unstable/resources/workflows/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/unstable/resources/workflows/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/unstable/types/ConversationAttributeUpdatedByAdmin.ts b/src/api/resources/unstable/types/ConversationAttributeUpdatedByAdmin.ts index b44c2202..997b2ea3 100644 --- a/src/api/resources/unstable/types/ConversationAttributeUpdatedByAdmin.ts +++ b/src/api/resources/unstable/types/ConversationAttributeUpdatedByAdmin.ts @@ -15,7 +15,9 @@ export namespace ConversationAttributeUpdatedByAdmin { } export interface Value { - /** Value of the CDA updated */ + /** Current value of the CDA updated */ name?: string; + /** Previous value of the CDA */ + previous?: string; } } diff --git a/src/api/resources/unstable/types/ConversationAttributeUpdatedByUser.ts b/src/api/resources/unstable/types/ConversationAttributeUpdatedByUser.ts new file mode 100644 index 00000000..c0f19e67 --- /dev/null +++ b/src/api/resources/unstable/types/ConversationAttributeUpdatedByUser.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains details about Custom Data Attributes (CDAs) that were modified by a user for conversation part type conversation_attribute_updated_by_user. + */ +export interface ConversationAttributeUpdatedByUser { + attribute?: ConversationAttributeUpdatedByUser.Attribute; + value?: ConversationAttributeUpdatedByUser.Value; +} + +export namespace ConversationAttributeUpdatedByUser { + export interface Attribute { + /** Name of the CDA updated */ + name?: string; + } + + export interface Value { + /** Current value of the CDA updated */ + name?: string; + /** Previous value of the CDA (null for older events) */ + previous?: string; + } +} diff --git a/src/api/resources/unstable/types/ConversationSlaAppliedByRule.ts b/src/api/resources/unstable/types/ConversationSlaAppliedByRule.ts new file mode 100644 index 00000000..8340e44f --- /dev/null +++ b/src/api/resources/unstable/types/ConversationSlaAppliedByRule.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains details about SLA applied by modern Operator workflows for conversation part type conversation_sla_applied_by_rule. + */ +export interface ConversationSlaAppliedByRule { + /** Name of the SLA that was applied */ + sla_name?: string; + /** Target times configured for the SLA (in seconds) */ + sla_definition?: ConversationSlaAppliedByRule.SlaDefinition; +} + +export namespace ConversationSlaAppliedByRule { + /** + * Target times configured for the SLA (in seconds) + */ + export interface SlaDefinition { + /** First response time target in seconds */ + first_reply_time?: number; + /** Next reply time target in seconds */ + next_reply_time?: number; + /** Resolution time target in seconds */ + resolution_time?: number; + /** Time to close target in seconds */ + time_to_close?: number; + } +} diff --git a/src/api/resources/unstable/types/ConversationSlaAppliedByWorkflow.ts b/src/api/resources/unstable/types/ConversationSlaAppliedByWorkflow.ts new file mode 100644 index 00000000..29b5464d --- /dev/null +++ b/src/api/resources/unstable/types/ConversationSlaAppliedByWorkflow.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains details about SLA applied by legacy Inbox Rules for conversation part type conversation_sla_applied_by_workflow. + */ +export interface ConversationSlaAppliedByWorkflow { + /** Name of the SLA that was applied */ + sla_name?: string; + /** Target times configured for the SLA (in seconds) */ + sla_definition?: ConversationSlaAppliedByWorkflow.SlaDefinition; +} + +export namespace ConversationSlaAppliedByWorkflow { + /** + * Target times configured for the SLA (in seconds) + */ + export interface SlaDefinition { + /** First response time target in seconds */ + first_reply_time?: number; + /** Next reply time target in seconds */ + next_reply_time?: number; + /** Resolution time target in seconds */ + resolution_time?: number; + /** Time to close target in seconds */ + time_to_close?: number; + } +} diff --git a/src/api/resources/unstable/types/ConversationSlaPaused.ts b/src/api/resources/unstable/types/ConversationSlaPaused.ts new file mode 100644 index 00000000..eb842828 --- /dev/null +++ b/src/api/resources/unstable/types/ConversationSlaPaused.ts @@ -0,0 +1,33 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains SLA status at the moment of pausing for conversation part type conversation_sla_paused. + */ +export interface ConversationSlaPaused { + /** Name of the SLA being paused */ + sla_name?: string; + /** Overall SLA status at pause time */ + current_sla_status?: ConversationSlaPaused.CurrentSlaStatus; + /** Status of all SLA targets at pause time */ + sla_states?: Record; +} + +export namespace ConversationSlaPaused { + /** Overall SLA status at pause time */ + export const CurrentSlaStatus = { + Active: "active", + Hit: "hit", + Missed: "missed", + Canceled: "canceled", + } as const; + export type CurrentSlaStatus = (typeof CurrentSlaStatus)[keyof typeof CurrentSlaStatus]; + + export namespace SlaStates { + export interface Value { + /** Status of this specific target (always paused) */ + status?: "paused"; + /** Time remaining when paused */ + seconds_remaining?: number; + } + } +} diff --git a/src/api/resources/unstable/types/ConversationSlaRemoved.ts b/src/api/resources/unstable/types/ConversationSlaRemoved.ts new file mode 100644 index 00000000..c0007356 --- /dev/null +++ b/src/api/resources/unstable/types/ConversationSlaRemoved.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains basic SLA information when removed for conversation part type conversation_sla_removed. + */ +export interface ConversationSlaRemoved { + /** Name of the SLA that was removed */ + sla_name?: string; +} diff --git a/src/api/resources/unstable/types/ConversationSlaTargetMissed.ts b/src/api/resources/unstable/types/ConversationSlaTargetMissed.ts new file mode 100644 index 00000000..bec5f996 --- /dev/null +++ b/src/api/resources/unstable/types/ConversationSlaTargetMissed.ts @@ -0,0 +1,55 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains complete status of all SLA targets when a breach occurs for conversation part type conversation_sla_target_missed. + */ +export interface ConversationSlaTargetMissed { + /** Name of the SLA */ + sla_name?: string; + /** Which specific target was missed */ + sla_target_type?: ConversationSlaTargetMissed.SlaTargetType; + /** Overall SLA status */ + current_sla_status?: ConversationSlaTargetMissed.CurrentSlaStatus; + /** Status of all SLA targets at the time of breach */ + sla_states?: Record; +} + +export namespace ConversationSlaTargetMissed { + /** Which specific target was missed */ + export const SlaTargetType = { + FirstReplyTime: "first_reply_time", + NextReplyTime: "next_reply_time", + ResolutionTime: "resolution_time", + TimeToClose: "time_to_close", + } as const; + export type SlaTargetType = (typeof SlaTargetType)[keyof typeof SlaTargetType]; + /** Overall SLA status */ + export const CurrentSlaStatus = { + Hit: "hit", + Missed: "missed", + Active: "active", + Paused: "paused", + Canceled: "canceled", + } as const; + export type CurrentSlaStatus = (typeof CurrentSlaStatus)[keyof typeof CurrentSlaStatus]; + + export namespace SlaStates { + export interface Value { + /** Status of this specific target */ + status?: Value.Status; + /** Time remaining for active/paused targets (null for hit/missed) */ + seconds_remaining?: number; + } + + export namespace Value { + /** Status of this specific target */ + export const Status = { + Hit: "hit", + Missed: "missed", + Active: "active", + Paused: "paused", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; + } + } +} diff --git a/src/api/resources/unstable/types/ConversationSlaUnpaused.ts b/src/api/resources/unstable/types/ConversationSlaUnpaused.ts new file mode 100644 index 00000000..e7045d0f --- /dev/null +++ b/src/api/resources/unstable/types/ConversationSlaUnpaused.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains basic SLA information when unpaused for conversation part type conversation_sla_unpaused. + */ +export interface ConversationSlaUnpaused { + /** Name of the SLA being unpaused */ + sla_name?: string; +} diff --git a/src/api/resources/unstable/types/ConversationTagsUpdated.ts b/src/api/resources/unstable/types/ConversationTagsUpdated.ts new file mode 100644 index 00000000..556dd3e0 --- /dev/null +++ b/src/api/resources/unstable/types/ConversationTagsUpdated.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains details about tags that were added or removed from a conversation for conversation part type conversation_tags_updated. + */ +export interface ConversationTagsUpdated { + /** Array of tag names that were added */ + tags_added?: string[]; + /** Array of tag names that were removed */ + tags_removed?: string[]; +} diff --git a/src/api/resources/unstable/types/EventDetails.ts b/src/api/resources/unstable/types/EventDetails.ts index b257b71e..422603dc 100644 --- a/src/api/resources/unstable/types/EventDetails.ts +++ b/src/api/resources/unstable/types/EventDetails.ts @@ -5,6 +5,16 @@ import type * as Intercom from "../../../index.js"; export type EventDetails = | Intercom.unstable.ConversationAttributeUpdatedByWorkflow | Intercom.unstable.ConversationAttributeUpdatedByAdmin + | Intercom.unstable.ConversationAttributeUpdatedByUser | Intercom.unstable.CustomActionStarted | Intercom.unstable.CustomActionFinished - | Intercom.unstable.OperatorWorkflowEvent; + | Intercom.unstable.OperatorWorkflowEvent + | Intercom.unstable.ConversationTagsUpdated + | Intercom.unstable.Snoozed + | Intercom.unstable.PriorityChanged + | Intercom.unstable.ConversationSlaAppliedByRule + | Intercom.unstable.ConversationSlaAppliedByWorkflow + | Intercom.unstable.ConversationSlaTargetMissed + | Intercom.unstable.ConversationSlaPaused + | Intercom.unstable.ConversationSlaUnpaused + | Intercom.unstable.ConversationSlaRemoved; diff --git a/src/api/resources/unstable/types/HandlingEvent.ts b/src/api/resources/unstable/types/HandlingEvent.ts new file mode 100644 index 00000000..f6d3e9d6 --- /dev/null +++ b/src/api/resources/unstable/types/HandlingEvent.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Intercom from "../../../index.js"; + +/** + * A pause or resume event for a conversation + */ +export interface HandlingEvent { + teammate: Intercom.unstable.TeammateReference; + /** The type of handling event */ + type: HandlingEvent.Type; + /** ISO8601 timestamp when the event occurred */ + timestamp: string; + /** Optional reason for the event (e.g., "Paused", "Away") */ + reason?: string; +} + +export namespace HandlingEvent { + /** The type of handling event */ + export const Type = { + Paused: "paused", + Resumed: "resumed", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; +} diff --git a/src/api/resources/unstable/types/HandlingEventList.ts b/src/api/resources/unstable/types/HandlingEventList.ts new file mode 100644 index 00000000..57dfe2d2 --- /dev/null +++ b/src/api/resources/unstable/types/HandlingEventList.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Intercom from "../../../index.js"; + +/** + * A list of handling events for a conversation + */ +export interface HandlingEventList { + /** Array of handling events */ + handling_events?: Intercom.unstable.HandlingEvent[]; +} diff --git a/src/api/resources/unstable/types/PriorityChanged.ts b/src/api/resources/unstable/types/PriorityChanged.ts new file mode 100644 index 00000000..f09b55df --- /dev/null +++ b/src/api/resources/unstable/types/PriorityChanged.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains details about priority changes for conversation part type priority_changed. + */ +export interface PriorityChanged { + /** Current priority state */ + current_priority?: PriorityChanged.CurrentPriority; + /** Previous priority state */ + previous_priority?: PriorityChanged.PreviousPriority; +} + +export namespace PriorityChanged { + /** Current priority state */ + export const CurrentPriority = { + Priority: "priority", + NotPriority: "not_priority", + } as const; + export type CurrentPriority = (typeof CurrentPriority)[keyof typeof CurrentPriority]; + /** Previous priority state */ + export const PreviousPriority = { + Priority: "priority", + NotPriority: "not_priority", + } as const; + export type PreviousPriority = (typeof PreviousPriority)[keyof typeof PreviousPriority]; +} diff --git a/src/api/resources/unstable/types/Snoozed.ts b/src/api/resources/unstable/types/Snoozed.ts new file mode 100644 index 00000000..c8ea22fc --- /dev/null +++ b/src/api/resources/unstable/types/Snoozed.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Contains details about conversation snooze timing for conversation part type snoozed. + */ +export interface Snoozed { + /** Human-readable description of snooze duration */ + until?: string; + /** ISO timestamp for custom snooze times (null for general snoozes) */ + custom_until_time?: string; +} diff --git a/src/api/resources/unstable/types/TeammateReference.ts b/src/api/resources/unstable/types/TeammateReference.ts new file mode 100644 index 00000000..913ea0b2 --- /dev/null +++ b/src/api/resources/unstable/types/TeammateReference.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * A reference to a teammate (admin, team, or bot) + */ +export interface TeammateReference { + /** The type of teammate */ + type: TeammateReference.Type; + /** The unique identifier of the teammate */ + id: number; + /** The display name of the teammate */ + name: string; + /** The email address of the teammate (optional for teams/bots) */ + email?: string; +} + +export namespace TeammateReference { + /** The type of teammate */ + export const Type = { + Admin: "admin", + Team: "team", + Bot: "bot", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; +} diff --git a/src/api/resources/unstable/types/WorkflowExport.ts b/src/api/resources/unstable/types/WorkflowExport.ts new file mode 100644 index 00000000..93531949 --- /dev/null +++ b/src/api/resources/unstable/types/WorkflowExport.ts @@ -0,0 +1,59 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * A workflow export containing the complete workflow configuration. + */ +export interface WorkflowExport { + /** The version of the export format. */ + export_version?: string; + /** The timestamp when the export was generated. */ + exported_at?: string; + /** The workspace identifier. */ + app_id?: number; + /** The workflow configuration. */ + workflow?: WorkflowExport.Workflow; +} + +export namespace WorkflowExport { + /** + * The workflow configuration. + */ + export interface Workflow { + /** The unique identifier for the workflow. */ + id?: string; + /** The title of the workflow. */ + title?: string; + /** The description of the workflow. */ + description?: string; + /** The type of trigger that starts this workflow. */ + trigger_type?: string; + /** The current state of the workflow. */ + state?: Workflow.State; + /** The channels this workflow targets. */ + target_channels?: string[]; + /** The preferred devices for this workflow. */ + preferred_devices?: string[]; + /** When the workflow was created. */ + created_at?: string; + /** When the workflow was last updated. */ + updated_at?: string; + /** The targeting rules for this workflow. */ + targeting?: Record; + /** The current snapshot of workflow steps and configuration. */ + snapshot?: Record; + /** Custom attributes defined for this workflow. */ + attributes?: Record[]; + /** Rules embedded within the workflow steps. */ + embedded_rules?: Record[]; + } + + export namespace Workflow { + /** The current state of the workflow. */ + export const State = { + Live: "live", + Draft: "draft", + Paused: "paused", + } as const; + export type State = (typeof State)[keyof typeof State]; + } +} diff --git a/src/api/resources/unstable/types/index.ts b/src/api/resources/unstable/types/index.ts index ff1cd877..5b8c268e 100644 --- a/src/api/resources/unstable/types/index.ts +++ b/src/api/resources/unstable/types/index.ts @@ -49,6 +49,7 @@ export * from "./ContactUnarchived.js"; export * from "./ContentSourcesList.js"; export * from "./ConversationAttachmentFiles.js"; export * from "./ConversationAttributeUpdatedByAdmin.js"; +export * from "./ConversationAttributeUpdatedByUser.js"; export * from "./ConversationAttributeUpdatedByWorkflow.js"; export * from "./ConversationContacts.js"; export * from "./ConversationDeleted.js"; @@ -60,8 +61,15 @@ export * from "./ConversationPartMetadata.js"; export * from "./ConversationParts.js"; export * from "./ConversationRating.js"; export * from "./ConversationResponseTime.js"; +export * from "./ConversationSlaAppliedByRule.js"; +export * from "./ConversationSlaAppliedByWorkflow.js"; +export * from "./ConversationSlaPaused.js"; +export * from "./ConversationSlaRemoved.js"; +export * from "./ConversationSlaTargetMissed.js"; +export * from "./ConversationSlaUnpaused.js"; export * from "./ConversationSource.js"; export * from "./ConversationStatistics.js"; +export * from "./ConversationTagsUpdated.js"; export * from "./ConversationTeammates.js"; export * from "./CreateArticleRequest.js"; export * from "./CreateDataAttributeRequest.js"; @@ -102,6 +110,8 @@ export * from "./EventDetails.js"; export * from "./FileAttribute.js"; export * from "./GroupContent.js"; export * from "./GroupTranslatedContent.js"; +export * from "./HandlingEvent.js"; +export * from "./HandlingEventList.js"; export * from "./InternalArticleList.js"; export * from "./LinkedObject.js"; export * from "./LinkedObjectList.js"; @@ -116,6 +126,7 @@ export * from "./PaginatedResponse.js"; export * from "./PaginatedResponseDataItem.js"; export * from "./PartAttachment.js"; export * from "./PhoneSwitch.js"; +export * from "./PriorityChanged.js"; export * from "./QuickReplyOption.js"; export * from "./Recipient.js"; export * from "./RedactConversationRequest.js"; @@ -127,6 +138,7 @@ export * from "./SegmentList.js"; export * from "./SingleFilterSearchRequest.js"; export * from "./SlaApplied.js"; export * from "./SnoozeConversationRequest.js"; +export * from "./Snoozed.js"; export * from "./SocialProfile.js"; export * from "./StartingAfterPaging.js"; export * from "./SubscriptionTypeList.js"; @@ -135,6 +147,7 @@ export * from "./TagList.js"; export * from "./TagMultipleUsersRequest.js"; export * from "./Tags.js"; export * from "./TeamList.js"; +export * from "./TeammateReference.js"; export * from "./TeamPriorityLevel.js"; export * from "./TicketCustomAttributes.js"; export * from "./TicketList.js"; @@ -152,3 +165,4 @@ export * from "./UpdateDataAttributeRequestBody.js"; export * from "./Visitor.js"; export * from "./VisitorDeletedObject.js"; export * from "./WhatsappMessageStatusList.js"; +export * from "./WorkflowExport.js"; diff --git a/src/api/types/ActivityLog.ts b/src/api/types/ActivityLog.ts index ddf4451d..eea2e6fd 100644 --- a/src/api/types/ActivityLog.ts +++ b/src/api/types/ActivityLog.ts @@ -88,7 +88,7 @@ export namespace ActivityLog { InboxAccessChange: "inbox_access_change", MacroCreation: "macro_creation", MacroDeletion: "macro_deletion", - MacroUpdated: "macro_updated", + MacroUpdate: "macro_update", MaliciousDomainsSettingChange: "malicious_domains_setting_change", MessageDeletion: "message_deletion", MessageStateChange: "message_state_change", @@ -110,6 +110,11 @@ export namespace ActivityLog { SeatChange: "seat_change", SeatRevoke: "seat_revoke", SecuritySettingsChange: "security_settings_change", + SeriesCreation: "series_creation", + SeriesDeletion: "series_deletion", + SeriesSettingsUpdate: "series_settings_update", + SeriesStatusChange: "series_status_change", + SeriesUpdate: "series_update", StripInboundEmailLinksChange: "strip_inbound_email_links_change", TemporaryExpectationChange: "temporary_expectation_change", TeamAssignmentLimitChange: "team_assignment_limit_change", diff --git a/src/api/types/IpAllowlist.ts b/src/api/types/IpAllowlist.ts new file mode 100644 index 00000000..27a5b011 --- /dev/null +++ b/src/api/types/IpAllowlist.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * IP allowlist settings for the workspace. + */ +export interface IpAllowlist { + /** String representing the object's type. Always has the value `ip_allowlist`. */ + type?: string; + /** Whether the IP allowlist is enabled for the workspace. */ + enabled?: boolean; + /** + * List of allowed IP addresses and/or IP ranges in CIDR notation. + * Examples: + * - Single IP: `192.168.0.1` + * - IP range: `192.168.0.1/24` (allows 192.168.0.0 - 192.168.0.255) + */ + ip_allowlist?: string[]; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index f81547cc..d0b6e87d 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -106,6 +106,7 @@ export * from "./FileAttribute.js"; export * from "./GroupContent.js"; export * from "./GroupTranslatedContent.js"; export * from "./InternalArticleList.js"; +export * from "./IpAllowlist.js"; export * from "./LinkedObject.js"; export * from "./LinkedObjectList.js"; export * from "./Metadata.js"; diff --git a/src/version.ts b/src/version.ts index 6bb53d57..b37f04e1 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "7.0.0"; +export const SDK_VERSION = "7.0.2"; diff --git a/tests/wire/ipAllowlist.test.ts b/tests/wire/ipAllowlist.test.ts new file mode 100644 index 00000000..de84803f --- /dev/null +++ b/tests/wire/ipAllowlist.test.ts @@ -0,0 +1,122 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Intercom from "../../src/api/index"; +import { IntercomClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("IpAllowlistClient", () => { + test("getIpAllowlist (1)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + + const rawResponseBody = { type: "ip_allowlist", enabled: true, ip_allowlist: ["192.168.1.0/24", "10.0.0.1"] }; + server.mockEndpoint().get("/ip_allowlist").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.ipAllowlist.getIpAllowlist(); + expect(response).toEqual({ + type: "ip_allowlist", + enabled: true, + ip_allowlist: ["192.168.1.0/24", "10.0.0.1"], + }); + }); + + test("getIpAllowlist (2)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + + const rawResponseBody = { type: "error.list", errors: [{ code: "code" }, { code: "code" }] }; + server.mockEndpoint().get("/ip_allowlist").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.ipAllowlist.getIpAllowlist(); + }).rejects.toThrow(Intercom.UnauthorizedError); + }); + + test("updateIpAllowlist (1)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + const rawRequestBody = { enabled: true, ip_allowlist: ["192.168.1.0/24", "10.0.0.1"] }; + const rawResponseBody = { type: "ip_allowlist", enabled: true, ip_allowlist: ["192.168.1.0/24", "10.0.0.1"] }; + server + .mockEndpoint() + .put("/ip_allowlist") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ipAllowlist.updateIpAllowlist({ + enabled: true, + ip_allowlist: ["192.168.1.0/24", "10.0.0.1"], + }); + expect(response).toEqual({ + type: "ip_allowlist", + enabled: true, + ip_allowlist: ["192.168.1.0/24", "10.0.0.1"], + }); + }); + + test("updateIpAllowlist (2)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + const rawRequestBody = {}; + const rawResponseBody = { type: "error.list", errors: [{ code: "code" }, { code: "code" }] }; + server + .mockEndpoint() + .put("/ip_allowlist") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ipAllowlist.updateIpAllowlist({}); + }).rejects.toThrow(Intercom.UnauthorizedError); + }); + + test("updateIpAllowlist (3)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/ip_allowlist") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ipAllowlist.updateIpAllowlist({}); + }).rejects.toThrow(Intercom.UnprocessableEntityError); + }); +}); diff --git a/tests/wire/unstable/conversations.test.ts b/tests/wire/unstable/conversations.test.ts index 4dca52d8..88fb1544 100644 --- a/tests/wire/unstable/conversations.test.ts +++ b/tests/wire/unstable/conversations.test.ts @@ -32,6 +32,27 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }], @@ -144,6 +165,27 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + }, tags: { type: "tag.list", tags: [ @@ -511,6 +553,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -788,6 +872,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -1220,6 +1357,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -1426,6 +1605,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -1683,6 +1915,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -1850,6 +2124,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -2071,6 +2398,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -2277,6 +2646,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -2696,6 +3118,27 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }], @@ -2826,6 +3269,27 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + }, tags: { type: "tag.list", tags: [ @@ -2984,6 +3448,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -3157,6 +3663,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -3384,6 +3943,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -3557,6 +4158,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -3787,6 +4441,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -3969,6 +4665,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -4197,6 +4946,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -4376,6 +5167,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -4603,6 +5447,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -4776,6 +5662,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -5109,6 +6048,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -5281,6 +6262,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -5503,6 +6537,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -5675,6 +6751,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -5897,6 +7026,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -6068,6 +7239,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -6290,6 +7514,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 991267715, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -6464,6 +7730,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 991267715, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -6690,6 +8009,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -6862,6 +8223,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -7177,6 +8591,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -7331,6 +8787,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -7537,6 +9046,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -7691,6 +9242,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -7975,6 +9579,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -8127,6 +9773,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -8333,6 +10032,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -8485,6 +10226,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -8691,6 +10485,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -8843,6 +10679,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -9049,6 +10938,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -9201,6 +11132,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -9495,6 +11479,120 @@ describe("ConversationsClient", () => { }).rejects.toThrow(Intercom.unstable.UnprocessableEntityError); }); + test("listHandlingEvents (1)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + + const rawResponseBody = { + handling_events: [ + { + teammate: { type: "admin", id: 123, name: "Jane Example", email: "jane@example.com" }, + type: "paused", + timestamp: "2026-01-09T09:00:00Z", + reason: "Paused", + }, + { + teammate: { type: "admin", id: 123, name: "Jane Example", email: "jane@example.com" }, + type: "resumed", + timestamp: "2026-01-09T09:10:00Z", + reason: "Paused", + }, + ], + }; + server + .mockEndpoint() + .get("/conversations/123/handling_events") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.unstable.conversations.listHandlingEvents({ + id: "123", + }); + expect(response).toEqual({ + handling_events: [ + { + teammate: { + type: "admin", + id: 123, + name: "Jane Example", + email: "jane@example.com", + }, + type: "paused", + timestamp: "2026-01-09T09:00:00Z", + reason: "Paused", + }, + { + teammate: { + type: "admin", + id: 123, + name: "Jane Example", + email: "jane@example.com", + }, + type: "resumed", + timestamp: "2026-01-09T09:10:00Z", + reason: "Paused", + }, + ], + }); + }); + + test("listHandlingEvents (2)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + + const rawResponseBody = { type: "type", errors: [{ code: "code" }, { code: "code" }] }; + server + .mockEndpoint() + .get("/conversations/id/handling_events") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.unstable.conversations.listHandlingEvents({ + id: "id", + }); + }).rejects.toThrow(Intercom.unstable.UnauthorizedError); + }); + + test("listHandlingEvents (3)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/conversations/id/handling_events") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.unstable.conversations.listHandlingEvents({ + id: "id", + }); + }).rejects.toThrow(Intercom.unstable.NotFoundError); + }); + test("redactConversation (1)", async () => { const server = mockServerPool.createServer(); const client = new IntercomClient({ @@ -9523,6 +11621,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -9692,6 +11832,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ @@ -9918,6 +12111,48 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { type: "plan", id: "269315", name: "Pro" }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { type: "tag.list" }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { type: "note", id: "17495962", created_at: 1674589321, body: "

Text for the note.

" }, + ], + }, + }, tags: { type: "tag.list", tags: [{ type: "tag", id: "123456", name: "Test tag", applied_at: 1663597223 }] }, conversation_rating: { rating: 5, @@ -10087,6 +12322,59 @@ describe("ConversationsClient", () => { admin_assignee_id: 0, team_assignee_id: "5017691", company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", + company: { + type: "company", + id: "531ee472cce572a6ec000006", + name: "Blue Sun", + app_id: "ecahpwf5", + plan: { + type: "plan", + id: "269315", + name: "Pro", + }, + company_id: "6", + remote_created_at: 1663597223, + created_at: 1663597223, + updated_at: 1663597223, + last_request_at: 1663597223, + size: 100, + website: "https://www.intercom.com", + industry: "Software", + monthly_spend: 100, + session_count: 100, + user_count: 100, + custom_attributes: { + paid_subscriber: "custom_attributes", + monthly_spend: "custom_attributes", + team_mates: "custom_attributes", + }, + tags: { + type: "tag.list", + }, + segments: { + type: "segment.list", + segments: [ + { + id: "56203d253cba154d39010062", + name: "Active", + created_at: 1394621988, + updated_at: 1394622004, + count: 3, + }, + ], + }, + notes: { + type: "note.list", + notes: [ + { + type: "note", + id: "17495962", + created_at: 1674589321, + body: "

Text for the note.

", + }, + ], + }, + }, tags: { type: "tag.list", tags: [ diff --git a/tests/wire/unstable/workflows.test.ts b/tests/wire/unstable/workflows.test.ts new file mode 100644 index 00000000..b4035d7f --- /dev/null +++ b/tests/wire/unstable/workflows.test.ts @@ -0,0 +1,131 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Intercom from "../../../src/api/index"; +import { IntercomClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; + +describe("WorkflowsClient", () => { + test("exportWorkflow (1)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + + const rawResponseBody = { + export_version: "1.0", + exported_at: "2026-01-26T12:00:00Z", + app_id: 12345, + workflow: { + id: "67890", + title: "My Workflow", + description: "A workflow that handles customer inquiries", + trigger_type: "inbound_conversation", + state: "live", + target_channels: ["chat"], + preferred_devices: ["desktop", "mobile"], + created_at: "2025-06-15T10:30:00Z", + updated_at: "2026-01-20T14:45:00Z", + targeting: { key: "value" }, + snapshot: { key: "value" }, + attributes: [{ key: "value" }], + embedded_rules: [{ key: "value" }], + }, + }; + server + .mockEndpoint() + .get("/export/workflows/12345") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.unstable.workflows.exportWorkflow({ + id: "12345", + }); + expect(response).toEqual({ + export_version: "1.0", + exported_at: "2026-01-26T12:00:00Z", + app_id: 12345, + workflow: { + id: "67890", + title: "My Workflow", + description: "A workflow that handles customer inquiries", + trigger_type: "inbound_conversation", + state: "live", + target_channels: ["chat"], + preferred_devices: ["desktop", "mobile"], + created_at: "2025-06-15T10:30:00Z", + updated_at: "2026-01-20T14:45:00Z", + targeting: { + key: "value", + }, + snapshot: { + key: "value", + }, + attributes: [ + { + key: "value", + }, + ], + embedded_rules: [ + { + key: "value", + }, + ], + }, + }); + }); + + test("exportWorkflow (2)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + + const rawResponseBody = { type: "type", errors: [{ code: "code" }, { code: "code" }] }; + server + .mockEndpoint() + .get("/export/workflows/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.unstable.workflows.exportWorkflow({ + id: "id", + }); + }).rejects.toThrow(Intercom.unstable.ForbiddenError); + }); + + test("exportWorkflow (3)", async () => { + const server = mockServerPool.createServer(); + const client = new IntercomClient({ + maxRetries: 0, + token: "test", + version: "2.14", + environment: server.baseUrl, + }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/export/workflows/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.unstable.workflows.exportWorkflow({ + id: "id", + }); + }).rejects.toThrow(Intercom.unstable.NotFoundError); + }); +}); From 349c30fc6f8f46725882dcf9cac93b9276df7cf6 Mon Sep 17 00:00:00 2001 From: fern-support <126544928+fern-support@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:12:11 -0500 Subject: [PATCH 2/2] Fix key issue in integration tests --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d5b7754..268fb922 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,7 @@ jobs: run: pnpm test env: INTERCOM_API_KEY: ${{ secrets.INTERCOM_API_KEY }} + API_TOKEN: ${{ secrets.INTERCOM_API_KEY }} publish: needs: [ compile, test ]