Skip to content

Commit 8f7c33e

Browse files
release: 6.0.0-beta.2 (#427)
* feat(api): update via SDK Studio (#426) * chore(tests): update prism version (#428) * feat(api): update via SDK Studio (#429) * chore(tests): update prism version (#430) * fix(compat): remove ReadableStream polyfill redundant since node v16 (#431) Note that this breaks streaming in Node v14, which has been unsupported since v4.0.0 of this library. * chore(internal): codegen related update (#432) * chore(docs): fix incorrect client var names (#433) * chore(internal): add constant for default timeout (#434) * feat(api): update via SDK Studio (#435) * release: 6.0.0-beta.2 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent f0bba56 commit 8f7c33e

Some content is hidden

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

63 files changed

+522
-446
lines changed

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "6.0.0-beta.1"
2+
".": "6.0.0-beta.2"
33
}

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 108
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-61fd2f21fb0fb6a94c5e87ea423d828bf37d1dd90ca1511eda9b91d58ccb5d39.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-a52cc0e4313a38d4329e6c2f40afa341d800389762fc643b9bf5b13248f8c5da.yml

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Changelog
22

3+
## 6.0.0-beta.2 (2024-07-30)
4+
5+
Full Changelog: [v6.0.0-beta.1...v6.0.0-beta.2](https://github.com/intercom/intercom-node/compare/v6.0.0-beta.1...v6.0.0-beta.2)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([#426](https://github.com/intercom/intercom-node/issues/426)) ([ef7e2da](https://github.com/intercom/intercom-node/commit/ef7e2da5db3c43bc5c418d2d225152824f1fee98))
10+
* **api:** update via SDK Studio ([#429](https://github.com/intercom/intercom-node/issues/429)) ([87e2fc5](https://github.com/intercom/intercom-node/commit/87e2fc5a69de4ff9cbcd965dee87c116ffa0351c))
11+
* **api:** update via SDK Studio ([#435](https://github.com/intercom/intercom-node/issues/435)) ([00dfaa7](https://github.com/intercom/intercom-node/commit/00dfaa769e2e82e30824b7530fb10dca0074a29e))
12+
13+
14+
### Bug Fixes
15+
16+
* **compat:** remove ReadableStream polyfill redundant since node v16 ([#431](https://github.com/intercom/intercom-node/issues/431)) ([063c487](https://github.com/intercom/intercom-node/commit/063c487e24daafd0c062ebf76802c4a63e0e81b8))
17+
18+
19+
### Chores
20+
21+
* **docs:** fix incorrect client var names ([#433](https://github.com/intercom/intercom-node/issues/433)) ([4a0ad83](https://github.com/intercom/intercom-node/commit/4a0ad830f2f68faa88aaa614e625776a19310092))
22+
* **internal:** add constant for default timeout ([#434](https://github.com/intercom/intercom-node/issues/434)) ([0a41a59](https://github.com/intercom/intercom-node/commit/0a41a59c08f3c3225113464ee1fa336179e740c9))
23+
* **internal:** codegen related update ([#432](https://github.com/intercom/intercom-node/issues/432)) ([c76e487](https://github.com/intercom/intercom-node/commit/c76e48745a679b3155c22736e14b61af6df8aaf4))
24+
* **tests:** update prism version ([#428](https://github.com/intercom/intercom-node/issues/428)) ([425939f](https://github.com/intercom/intercom-node/commit/425939f4145d533621e53c36b786caebb8a1932f))
25+
* **tests:** update prism version ([#430](https://github.com/intercom/intercom-node/issues/430)) ([d123ec9](https://github.com/intercom/intercom-node/commit/d123ec9ea199e56b76f8ae9cc9f4cc31318659f8))
26+
327
## 6.0.0-beta.1 (2024-07-19)
428

529
Full Changelog: [v6.0.0-beta.0...v6.0.0-beta.1](https://github.com/intercom/intercom-node/compare/v6.0.0-beta.0...v6.0.0-beta.1)

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const client = new Intercom({
2828
});
2929

3030
async function main() {
31-
const adminWithApp = await intercom.me.retrieve();
31+
const adminWithApp = await client.me.retrieve();
3232

3333
console.log(adminWithApp.id);
3434
}
@@ -50,7 +50,7 @@ const client = new Intercom({
5050
});
5151

5252
async function main() {
53-
const adminWithApp: Intercom.AdminWithApp | null = await intercom.me.retrieve();
53+
const adminWithApp: Intercom.AdminWithApp | null = await client.me.retrieve();
5454
}
5555

5656
main();
@@ -67,7 +67,7 @@ a subclass of `APIError` will be thrown:
6767
<!-- prettier-ignore -->
6868
```ts
6969
async function main() {
70-
const adminWithApp = await intercom.me.retrieve().catch(async (err) => {
70+
const adminWithApp = await client.me.retrieve().catch(async (err) => {
7171
if (err instanceof Intercom.APIError) {
7272
console.log(err.status); // 400
7373
console.log(err.name); // BadRequestError
@@ -110,7 +110,7 @@ const client = new Intercom({
110110
});
111111

112112
// Or, configure per-request:
113-
await intercom.me.retrieve({
113+
await client.me.retrieve({
114114
maxRetries: 5,
115115
});
116116
```
@@ -127,7 +127,7 @@ const client = new Intercom({
127127
});
128128

129129
// Override per-request:
130-
await intercom.me.retrieve({
130+
await client.me.retrieve({
131131
timeout: 5 * 1000,
132132
});
133133
```
@@ -148,11 +148,11 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
148148
```ts
149149
const client = new Intercom();
150150

151-
const response = await intercom.me.retrieve().asResponse();
151+
const response = await client.me.retrieve().asResponse();
152152
console.log(response.headers.get('X-My-Header'));
153153
console.log(response.statusText); // access the underlying Response object
154154

155-
const { data: adminWithApp, response: raw } = await intercom.me.retrieve().withResponse();
155+
const { data: adminWithApp, response: raw } = await client.me.retrieve().withResponse();
156156
console.log(raw.headers.get('X-My-Header'));
157157
console.log(adminWithApp.id);
158158
```
@@ -258,7 +258,7 @@ const client = new Intercom({
258258
});
259259

260260
// Override per-request:
261-
await intercom.me.retrieve({
261+
await client.me.retrieve({
262262
httpAgent: new http.Agent({ keepAlive: false }),
263263
});
264264
```

api.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Types:
1515
- <code><a href="./src/resources/shared.ts">Message</a></code>
1616
- <code><a href="./src/resources/shared.ts">MultipleFilterSearchRequest</a></code>
1717
- <code><a href="./src/resources/shared.ts">Note</a></code>
18-
- <code><a href="./src/resources/shared.ts">PaginatedResponse</a></code>
1918
- <code><a href="./src/resources/shared.ts">PartAttachment</a></code>
2019
- <code><a href="./src/resources/shared.ts">Reference</a></code>
2120
- <code><a href="./src/resources/shared.ts">SearchRequest</a></code>
@@ -223,8 +222,8 @@ Methods:
223222

224223
Types:
225224

226-
- <code><a href="./src/resources/conversations/conversations.ts">ConversationList</a></code>
227225
- <code><a href="./src/resources/conversations/conversations.ts">ConversationListResponse</a></code>
226+
- <code><a href="./src/resources/conversations/conversations.ts">ConversationSearchResponse</a></code>
228227

229228
Methods:
230229

@@ -234,7 +233,7 @@ Methods:
234233
- <code title="get /conversations">client.conversations.<a href="./src/resources/conversations/conversations.ts">list</a>({ ...params }) -> ConversationListResponsesCursorPagination</code>
235234
- <code title="post /conversations/{id}/convert">client.conversations.<a href="./src/resources/conversations/conversations.ts">convert</a>(id, { ...params }) -> Ticket | null</code>
236235
- <code title="post /conversations/redact">client.conversations.<a href="./src/resources/conversations/conversations.ts">redact</a>({ ...params }) -> Conversation</code>
237-
- <code title="post /conversations/search">client.conversations.<a href="./src/resources/conversations/conversations.ts">search</a>({ ...params }) -> ConversationList</code>
236+
- <code title="post /conversations/search">client.conversations.<a href="./src/resources/conversations/conversations.ts">search</a>({ ...params }) -> ConversationSearchResponse</code>
238237

239238
## Tags
240239

@@ -340,32 +339,38 @@ Methods:
340339
Types:
341340

342341
- <code><a href="./src/resources/news/news-items.ts">NewsItem</a></code>
342+
- <code><a href="./src/resources/news/news-items.ts">NewsItemListResponse</a></code>
343343
- <code><a href="./src/resources/news/news-items.ts">NewsItemDeleteResponse</a></code>
344344

345345
Methods:
346346

347347
- <code title="post /news/news_items">client.news.newsItems.<a href="./src/resources/news/news-items.ts">create</a>({ ...params }) -> NewsItem</code>
348348
- <code title="get /news/news_items/{id}">client.news.newsItems.<a href="./src/resources/news/news-items.ts">retrieve</a>(id, { ...params }) -> NewsItem</code>
349349
- <code title="put /news/news_items/{id}">client.news.newsItems.<a href="./src/resources/news/news-items.ts">update</a>(id, { ...params }) -> NewsItem</code>
350-
- <code title="get /news/news_items">client.news.newsItems.<a href="./src/resources/news/news-items.ts">list</a>({ ...params }) -> PaginatedResponse</code>
350+
- <code title="get /news/news_items">client.news.newsItems.<a href="./src/resources/news/news-items.ts">list</a>({ ...params }) -> NewsItemListResponse</code>
351351
- <code title="delete /news/news_items/{id}">client.news.newsItems.<a href="./src/resources/news/news-items.ts">delete</a>(id, { ...params }) -> NewsItemDeleteResponse</code>
352352

353353
## Newsfeeds
354354

355355
Types:
356356

357357
- <code><a href="./src/resources/news/newsfeeds/newsfeeds.ts">Newsfeed</a></code>
358+
- <code><a href="./src/resources/news/newsfeeds/newsfeeds.ts">NewsfeedListResponse</a></code>
358359

359360
Methods:
360361

361362
- <code title="get /news/newsfeeds/{id}">client.news.newsfeeds.<a href="./src/resources/news/newsfeeds/newsfeeds.ts">retrieve</a>(id, { ...params }) -> Newsfeed</code>
362-
- <code title="get /news/newsfeeds">client.news.newsfeeds.<a href="./src/resources/news/newsfeeds/newsfeeds.ts">list</a>({ ...params }) -> PaginatedResponse</code>
363+
- <code title="get /news/newsfeeds">client.news.newsfeeds.<a href="./src/resources/news/newsfeeds/newsfeeds.ts">list</a>({ ...params }) -> NewsfeedListResponse</code>
363364

364365
### Items
365366

367+
Types:
368+
369+
- <code><a href="./src/resources/news/newsfeeds/items.ts">ItemListResponse</a></code>
370+
366371
Methods:
367372

368-
- <code title="get /news/newsfeeds/{id}/items">client.news.newsfeeds.items.<a href="./src/resources/news/newsfeeds/items.ts">list</a>(id, { ...params }) -> PaginatedResponse</code>
373+
- <code title="get /news/newsfeeds/{id}/items">client.news.newsfeeds.items.<a href="./src/resources/news/newsfeeds/items.ts">list</a>(id, { ...params }) -> ItemListResponse</code>
369374

370375
# Notes
371376

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "intercom-client",
3-
"version": "6.0.0-beta.1",
3+
"version": "6.0.0-beta.2",
44
"description": "The official TypeScript library for the Intercom API",
55
"author": "Intercom <[email protected]>",
66
"types": "dist/index.d.ts",
@@ -32,8 +32,7 @@
3232
"form-data-encoder": "1.7.2",
3333
"formdata-node": "^4.3.2",
3434
"node-fetch": "^2.6.7",
35-
"qs": "^6.10.3",
36-
"web-streams-polyfill": "^3.2.1"
35+
"qs": "^6.10.3"
3736
},
3837
"devDependencies": {
3938
"@swc/core": "^1.3.102",

scripts/mock

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}"
2121

2222
# Run prism mock on the given spec
2323
if [ "$1" == "--daemon" ]; then
24-
npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log &
24+
npm exec --package=@stainless-api/[email protected].4 -- prism mock "$URL" &> .prism.log &
2525

2626
# Wait for server to come online
2727
echo -n "Waiting for server"
@@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then
3737

3838
echo
3939
else
40-
npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL"
40+
npm exec --package=@stainless-api/[email protected].4 -- prism mock "$URL"
4141
fi

src/_shims/node-runtime.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import { Readable } from 'node:stream';
1313
import { type RequestOptions } from '../core';
1414
import { MultipartBody } from './MultipartBody';
1515
import { type Shims } from './registry';
16-
17-
// @ts-ignore (this package does not have proper export maps for this export)
18-
import { ReadableStream } from 'web-streams-polyfill/dist/ponyfill.es2018.js';
16+
import { ReadableStream } from 'node:stream/web';
1917

2018
type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
2119

src/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ export class Intercom extends Core.APIClient {
190190
}
191191

192192
static Intercom = this;
193+
static DEFAULT_TIMEOUT = 60000; // 1 minute
193194

194195
static IntercomError = Errors.IntercomError;
195196
static APIError = Errors.APIError;
@@ -289,8 +290,9 @@ export namespace Intercom {
289290
export import ContactUnarchiveParams = API.ContactUnarchiveParams;
290291

291292
export import Conversations = API.Conversations;
292-
export import ConversationList = API.ConversationList;
293293
export import ConversationListResponse = API.ConversationListResponse;
294+
export import ConversationSearchResponse = API.ConversationSearchResponse;
295+
export import ConversationListResponsesCursorPagination = API.ConversationListResponsesCursorPagination;
294296
export import ConversationCreateParams = API.ConversationCreateParams;
295297
export import ConversationRetrieveParams = API.ConversationRetrieveParams;
296298
export import ConversationUpdateParams = API.ConversationUpdateParams;
@@ -391,7 +393,6 @@ export namespace Intercom {
391393
export import Message = API.Message;
392394
export import MultipleFilterSearchRequest = API.MultipleFilterSearchRequest;
393395
export import Note = API.Note;
394-
export import PaginatedResponse = API.PaginatedResponse;
395396
export import PartAttachment = API.PartAttachment;
396397
export import Reference = API.Reference;
397398
export import SearchRequest = API.SearchRequest;

src/resources/conversations/conversations.ts

+16-13
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ import { isRequestOptions } from '../../core';
55
import * as Core from '../../core';
66
import * as ConversationsAPI from './conversations';
77
import * as Shared from '../shared';
8-
import { ConversationListResponsesCursorPagination } from '../shared';
98
import * as CustomersAPI from './customers';
109
import * as PartsAPI from './parts';
1110
import * as ReplyAPI from './reply';
1211
import * as RunAssignmentRulesAPI from './run-assignment-rules';
1312
import * as TagsAPI from './tags';
1413
import * as NewsItemsAPI from '../news/news-items';
1514
import * as NewsfeedsAPI from '../news/newsfeeds/newsfeeds';
16-
import { type CursorPaginationParams } from '../../pagination';
15+
import { CursorPagination, type CursorPaginationParams } from '../../pagination';
1716

1817
export class Conversations extends APIResource {
1918
tags: TagsAPI.Tags = new TagsAPI.Tags(this._client);
@@ -324,7 +323,10 @@ export class Conversations extends APIResource {
324323
* | ^ | String | Starts With |
325324
* | $ | String | Ends With |
326325
*/
327-
search(params: ConversationSearchParams, options?: Core.RequestOptions): Core.APIPromise<ConversationList> {
326+
search(
327+
params: ConversationSearchParams,
328+
options?: Core.RequestOptions,
329+
): Core.APIPromise<ConversationSearchResponse> {
328330
const { 'Intercom-Version': intercomVersion, ...body } = params;
329331
return this._client.post('/conversations/search', {
330332
body,
@@ -339,12 +341,20 @@ export class Conversations extends APIResource {
339341
}
340342
}
341343

344+
export class ConversationListResponsesCursorPagination extends CursorPagination<ConversationListResponse> {}
345+
346+
/**
347+
* A News Item is a content type in Intercom enabling you to announce product
348+
* updates, company news, promotions, events and more with your customers.
349+
*/
350+
export type ConversationListResponse = NewsItemsAPI.NewsItem | NewsfeedsAPI.Newsfeed;
351+
342352
/**
343353
* Conversations are how you can communicate with users in Intercom. They are
344354
* created when a contact replies to an outbound message, or when one admin
345355
* directly sends a message to a single contact.
346356
*/
347-
export interface ConversationList {
357+
export interface ConversationSearchResponse {
348358
/**
349359
* The list of conversation objects
350360
*/
@@ -369,12 +379,6 @@ export interface ConversationList {
369379
type?: 'conversation.list';
370380
}
371381

372-
/**
373-
* A News Item is a content type in Intercom enabling you to announce product
374-
* updates, company news, promotions, events and more with your customers.
375-
*/
376-
export type ConversationListResponse = NewsItemsAPI.NewsItem | NewsfeedsAPI.Newsfeed;
377-
378382
export interface ConversationCreateParams {
379383
/**
380384
* Body param: The content of the message. HTML is not supported.
@@ -725,8 +729,9 @@ export interface ConversationSearchParams {
725729
}
726730

727731
export namespace Conversations {
728-
export import ConversationList = ConversationsAPI.ConversationList;
729732
export import ConversationListResponse = ConversationsAPI.ConversationListResponse;
733+
export import ConversationSearchResponse = ConversationsAPI.ConversationSearchResponse;
734+
export import ConversationListResponsesCursorPagination = ConversationsAPI.ConversationListResponsesCursorPagination;
730735
export import ConversationCreateParams = ConversationsAPI.ConversationCreateParams;
731736
export import ConversationRetrieveParams = ConversationsAPI.ConversationRetrieveParams;
732737
export import ConversationUpdateParams = ConversationsAPI.ConversationUpdateParams;
@@ -747,5 +752,3 @@ export namespace Conversations {
747752
export import CustomerCreateParams = CustomersAPI.CustomerCreateParams;
748753
export import CustomerDeleteParams = CustomersAPI.CustomerDeleteParams;
749754
}
750-
751-
export { ConversationListResponsesCursorPagination };

src/resources/conversations/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
export {
4-
ConversationList,
54
ConversationListResponse,
5+
ConversationSearchResponse,
66
ConversationCreateParams,
77
ConversationRetrieveParams,
88
ConversationUpdateParams,

src/resources/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export {
4646
Contacts,
4747
} from './contacts/contacts';
4848
export {
49-
ConversationList,
5049
ConversationListResponse,
50+
ConversationSearchResponse,
5151
ConversationCreateParams,
5252
ConversationRetrieveParams,
5353
ConversationUpdateParams,

src/resources/news/index.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
export { News } from './news';
44
export {
55
NewsItem,
6+
NewsItemListResponse,
67
NewsItemDeleteResponse,
78
NewsItemCreateParams,
89
NewsItemRetrieveParams,
@@ -11,4 +12,10 @@ export {
1112
NewsItemDeleteParams,
1213
NewsItems,
1314
} from './news-items';
14-
export { Newsfeed, NewsfeedRetrieveParams, NewsfeedListParams, Newsfeeds } from './newsfeeds/index';
15+
export {
16+
Newsfeed,
17+
NewsfeedListResponse,
18+
NewsfeedRetrieveParams,
19+
NewsfeedListParams,
20+
Newsfeeds,
21+
} from './newsfeeds/index';

0 commit comments

Comments
 (0)