Skip to content

Commit 217f6d3

Browse files
SDK regeneration (#479)
1 parent 36bd5ba commit 217f6d3

File tree

94 files changed

+1679
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1679
-679
lines changed

README.md

+24-28
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
# Intercom TypeScript Library (intercom-client)
1+
# Intercom TypeScript Library
22

33
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fintercom%2Fintercom-node)
44
[![npm shield](https://img.shields.io/npm/v/intercom-client)](https://www.npmjs.com/package/intercom-client)
55

66
The Intercom TypeScript library provides convenient access to the Intercom API from TypeScript.
77

8-
[![npm](https://img.shields.io/npm/v/intercom-client)](https://www.npmjs.com/package/intercom-client)
9-
![Intercom API Version](https://img.shields.io/badge/Intercom%20API%20Version-2.11-blue)
10-
![Typescript Supported](https://img.shields.io/badge/Typescript-Supported-lightgrey)
11-
128
## Project Updates
139

1410
The TypeScript SDK has been updated to support latest API version (2.11).
@@ -32,9 +28,9 @@ import { IntercomClient } from "intercom-client";
3228

3329
const client = new IntercomClient({ token: "YOUR_TOKEN" });
3430
await client.articles.create({
35-
title: "How to create an account",
36-
description: "Example article about creating an account.",
37-
body: "Here are the steps to create an account.",
31+
title: "Thanks for everything",
32+
description: "Description of the Article",
33+
body: "Body of the Article",
3834
author_id: 1295,
3935
state: "published",
4036
});
@@ -72,6 +68,26 @@ try {
7268
}
7369
```
7470

71+
## Pagination
72+
73+
List endpoints are paginated. The SDK provides an iterator so that you can simply loop over the items:
74+
75+
```typescript
76+
import { IntercomClient } from "intercom-client";
77+
78+
const client = new IntercomClient({ token: "YOUR_TOKEN" });
79+
const response = await client.articles.list();
80+
for await (const item of response) {
81+
console.log(item);
82+
}
83+
84+
// Or you can manually iterate page-by-page
85+
const page = await client.articles.list();
86+
while (page.hasNextPage()) {
87+
page = page.getNextPage();
88+
}
89+
```
90+
7591
## Request Options
7692

7793
This client library also supports passing in [`request` options](https://github.com/axios/axios#request-config):
@@ -94,26 +110,6 @@ client.useRequestOpts({
94110
});
95111
```
96112

97-
## Pagination
98-
99-
List endpoints are paginated. The SDK provides an iterator so that you can simply loop over the items:
100-
101-
```typescript
102-
import { IntercomClient } from "intercom-client";
103-
104-
const client = new IntercomClient({ token: "YOUR_TOKEN" });
105-
const response = await client.articles.list();
106-
for await (const item of response) {
107-
console.log(item);
108-
}
109-
110-
// Or you can manually iterate page-by-page
111-
const page = await client.articles.list();
112-
while (page.hasNextPage()) {
113-
page = page.getNextPage();
114-
}
115-
```
116-
117113
## Advanced
118114

119115
### Additional Headers

package.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "intercom-client",
3-
"version": "6.0.0",
3+
"version": "6.1.0",
44
"private": false,
55
"repository": "https://github.com/intercom/intercom-node",
66
"main": "./index.js",
@@ -39,5 +39,13 @@
3939
"fs": false,
4040
"os": false,
4141
"path": false
42-
}
42+
},
43+
"license": "Apache-2.0",
44+
"description": "Official Node bindings to the Intercom API",
45+
"homepage": "https://github.com/intercom/intercom-node",
46+
"bugs": "https://github.com/intercom/intercom-node/issues",
47+
"keywords": [
48+
"intercom",
49+
"api"
50+
]
4351
}

reference.md

+12-14
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ Companies will be only visible in Intercom when there is at least one associated
973973

974974
Companies are looked up via `company_id` in a `POST` request, if not found via `company_id`, the new company will be created, if found, that company will be updated.
975975

976-
{% admonition type="attention" name="Using `company_id`" %}
976+
{% admonition type="warning" name="Using `company_id`" %}
977977
You can set a unique `company_id` value when creating a company. However, it is not possible to update `company_id`. Be sure to set a unique value once upon creation of the company.
978978
{% /admonition %}
979979

@@ -1109,7 +1109,7 @@ await client.companies.find({
11091109

11101110
You can update a single company using the Intercom provisioned `id`.
11111111

1112-
{% admonition type="attention" name="Using `company_id`" %}
1112+
{% admonition type="warning" name="Using `company_id`" %}
11131113
When updating a company it is not possible to update `company_id`. This can only be set once upon creation of the company.
11141114
{% /admonition %}
11151115

@@ -2400,7 +2400,6 @@ Most key listed as part of the Contacts Model are searchable, whether writeable
24002400
| email | String |
24012401
| email_domain | String |
24022402
| phone | String |
2403-
| formatted_phone | String |
24042403
| external_id | String |
24052404
| created_at | Date (UNIX Timestamp) |
24062405
| signed_up_at | Date (UNIX Timestamp) |
@@ -2438,7 +2437,7 @@ Most key listed as part of the Contacts Model are searchable, whether writeable
24382437

24392438
### Accepted Operators
24402439

2441-
{% admonition type="attention" name="Searching based on `created_at`" %}
2440+
{% admonition type="warning" name="Searching based on `created_at`" %}
24422441
You cannot use the `<=` or `>=` operators to search by `created_at`.
24432442
{% /admonition %}
24442443

@@ -4300,11 +4299,9 @@ For managing conversations you can:
43004299
await client.conversations.manage({
43014300
conversation_id: "123",
43024301
body: {
4303-
message_type: "assignment",
4302+
message_type: "close",
43044303
type: "admin",
43054304
admin_id: "12345",
4306-
assignee_id: "4324241",
4307-
body: "Goodbye :)",
43084305
},
43094306
});
43104307
```
@@ -4353,8 +4350,11 @@ await client.conversations.manage({
43534350
<dl>
43544351
<dd>
43554352

4353+
{% admonition type="danger" name="Deprecation of Run Assignment Rules" %}
4354+
Run assignment rules is now deprecated in version 2.12 and future versions and will be permanently removed on December 31, 2026. After this date, any requests made to this endpoint will fail.
4355+
{% /admonition %}
43564356
You can let a conversation be automatically assigned following assignment rules.
4357-
{% admonition type="attention" name="When using workflows" %}
4357+
{% admonition type="warning" name="When using workflows" %}
43584358
It is not possible to use this endpoint with Workflows.
43594359
{% /admonition %}
43604360

@@ -4423,7 +4423,7 @@ await client.conversations.runAssignmentRules({
44234423

44244424
You can add participants who are contacts to a conversation, on behalf of either another contact or an admin.
44254425

4426-
{% admonition type="attention" name="Contacts without an email" %}
4426+
{% admonition type="warning" name="Contacts without an email" %}
44274427
If you add a contact via the email parameter and there is no user/lead found on that workspace with he given email, then we will create a new contact with `role` set to `lead`.
44284428
{% /admonition %}
44294429

@@ -4496,7 +4496,7 @@ await client.conversations.attachContactAsAdmin({
44964496

44974497
You can add participants who are contacts to a conversation, on behalf of either another contact or an admin.
44984498

4499-
{% admonition type="attention" name="Contacts without an email" %}
4499+
{% admonition type="warning" name="Contacts without an email" %}
45004500
If you add a contact via the email parameter and there is no user/lead found on that workspace with he given email, then we will create a new contact with `role` set to `lead`.
45014501
{% /admonition %}
45024502

@@ -5477,9 +5477,9 @@ This will return the Message model that has been created.
54775477

54785478
```typescript
54795479
await client.messages.create({
5480-
message_type: "inapp",
5480+
message_type: "email",
54815481
subject: "Thanks for everything",
5482-
body: "heyy",
5482+
body: "Hello there",
54835483
template: "plain",
54845484
from: {
54855485
type: "admin",
@@ -5489,8 +5489,6 @@ await client.messages.create({
54895489
type: "user",
54905490
id: "536e564f316c83104c000020",
54915491
},
5492-
created_at: 1590000000,
5493-
create_conversation_without_contact_reply: true,
54945492
});
54955493
```
54965494

src/api/resources/admins/client/Client.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,16 @@ export class Admins {
9797
Authorization: await this._getAuthorizationHeader(),
9898
"X-Fern-Language": "JavaScript",
9999
"X-Fern-SDK-Name": "intercom-client",
100-
"X-Fern-SDK-Version": "6.0.0",
101-
"User-Agent": "intercom-client/6.0.0",
100+
"X-Fern-SDK-Version": "6.1.0",
101+
"User-Agent": "intercom-client/6.1.0",
102102
"Intercom-Version": requestOptions?.version ?? this._options?.version ?? "2.11",
103103
"X-Fern-Runtime": core.RUNTIME.type,
104104
"X-Fern-Runtime-Version": core.RUNTIME.version,
105105
...requestOptions?.headers,
106106
},
107107
contentType: "application/json",
108108
requestType: "json",
109-
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
109+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
110110
maxRetries: requestOptions?.maxRetries,
111111
abortSignal: requestOptions?.abortSignal,
112112
});
@@ -167,8 +167,8 @@ export class Admins {
167167
Authorization: await this._getAuthorizationHeader(),
168168
"X-Fern-Language": "JavaScript",
169169
"X-Fern-SDK-Name": "intercom-client",
170-
"X-Fern-SDK-Version": "6.0.0",
171-
"User-Agent": "intercom-client/6.0.0",
170+
"X-Fern-SDK-Version": "6.1.0",
171+
"User-Agent": "intercom-client/6.1.0",
172172
"Intercom-Version": requestOptions?.version ?? this._options?.version ?? "2.11",
173173
"X-Fern-Runtime": core.RUNTIME.type,
174174
"X-Fern-Runtime-Version": core.RUNTIME.version,
@@ -177,7 +177,7 @@ export class Admins {
177177
contentType: "application/json",
178178
requestType: "json",
179179
body: _body,
180-
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
180+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
181181
maxRetries: requestOptions?.maxRetries,
182182
abortSignal: requestOptions?.abortSignal,
183183
});
@@ -249,8 +249,8 @@ export class Admins {
249249
Authorization: await this._getAuthorizationHeader(),
250250
"X-Fern-Language": "JavaScript",
251251
"X-Fern-SDK-Name": "intercom-client",
252-
"X-Fern-SDK-Version": "6.0.0",
253-
"User-Agent": "intercom-client/6.0.0",
252+
"X-Fern-SDK-Version": "6.1.0",
253+
"User-Agent": "intercom-client/6.1.0",
254254
"Intercom-Version": requestOptions?.version ?? this._options?.version ?? "2.11",
255255
"X-Fern-Runtime": core.RUNTIME.type,
256256
"X-Fern-Runtime-Version": core.RUNTIME.version,
@@ -259,7 +259,7 @@ export class Admins {
259259
contentType: "application/json",
260260
queryParameters: _queryParams,
261261
requestType: "json",
262-
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
262+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
263263
maxRetries: requestOptions?.maxRetries,
264264
abortSignal: requestOptions?.abortSignal,
265265
});
@@ -315,16 +315,16 @@ export class Admins {
315315
Authorization: await this._getAuthorizationHeader(),
316316
"X-Fern-Language": "JavaScript",
317317
"X-Fern-SDK-Name": "intercom-client",
318-
"X-Fern-SDK-Version": "6.0.0",
319-
"User-Agent": "intercom-client/6.0.0",
318+
"X-Fern-SDK-Version": "6.1.0",
319+
"User-Agent": "intercom-client/6.1.0",
320320
"Intercom-Version": requestOptions?.version ?? this._options?.version ?? "2.11",
321321
"X-Fern-Runtime": core.RUNTIME.type,
322322
"X-Fern-Runtime-Version": core.RUNTIME.version,
323323
...requestOptions?.headers,
324324
},
325325
contentType: "application/json",
326326
requestType: "json",
327-
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
327+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
328328
maxRetries: requestOptions?.maxRetries,
329329
abortSignal: requestOptions?.abortSignal,
330330
});
@@ -388,16 +388,16 @@ export class Admins {
388388
Authorization: await this._getAuthorizationHeader(),
389389
"X-Fern-Language": "JavaScript",
390390
"X-Fern-SDK-Name": "intercom-client",
391-
"X-Fern-SDK-Version": "6.0.0",
392-
"User-Agent": "intercom-client/6.0.0",
391+
"X-Fern-SDK-Version": "6.1.0",
392+
"User-Agent": "intercom-client/6.1.0",
393393
"Intercom-Version": requestOptions?.version ?? this._options?.version ?? "2.11",
394394
"X-Fern-Runtime": core.RUNTIME.type,
395395
"X-Fern-Runtime-Version": core.RUNTIME.version,
396396
...requestOptions?.headers,
397397
},
398398
contentType: "application/json",
399399
requestType: "json",
400-
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
400+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
401401
maxRetries: requestOptions?.maxRetries,
402402
abortSignal: requestOptions?.abortSignal,
403403
});

src/api/resources/admins/types/Admin.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,17 @@ export interface Admin {
2626
has_inbox_seat: boolean;
2727
/** This object represents the avatar associated with the admin. */
2828
team_ids: number[];
29-
/** Image for the associated team or teammate */
30-
avatar?: string;
29+
/** The avatar object associated with the admin */
30+
avatar?: Admin.Avatar;
3131
team_priority_level?: Intercom.TeamPriorityLevel;
3232
}
33+
34+
export namespace Admin {
35+
/**
36+
* The avatar object associated with the admin
37+
*/
38+
export interface Avatar {
39+
/** URL of the admin's avatar image */
40+
image_url: string;
41+
}
42+
}

0 commit comments

Comments
 (0)