Skip to content

Commit 73d8c53

Browse files
SDK regeneration (TypeScript generator 3.107.1) (#533)
* SDK regeneration (TypeScript generator 3.107.1) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Update core tests and set version 7.1.0 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Fix README, client.fetch() and 7.0.x compatibility regressions Restore package-user README, default environment and query/Request handling in client.fetch(), query parameters for custom fetchers, deprecated type aliases, optional token supplier typing and queryParams removal semantics. Fernignore the patched files. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Fix repeated query keys for custom fetchers and move compat aliases out of the types barrel The second value of a repeated key was spread into characters. Leave a Request body unread when init replaces it, keep the generated types barrel regenerable by moving the 7.0.x aliases to a fernignored compat file, and note in the README that auth only goes to the configured environment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent d8a05de commit 73d8c53

663 files changed

Lines changed: 6331 additions & 4100 deletions

File tree

Some content is hidden

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

‎.fern/metadata.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"cliVersion": "3.0.2",
2+
"cliVersion": "5.65.3",
33
"generatorName": "fernapi/fern-typescript-sdk",
4-
"generatorVersion": "3.35.8",
4+
"generatorVersion": "3.107.1",
55
"generatorConfig": {
66
"namespaceExport": "Intercom",
77
"allowCustomFetcher": true,

‎.fernignore‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,11 @@ LICENSE
66
REPO_OWNER
77
tests/integration
88
.github/workflows/ci.yml
9-
.github/workflows/publish.yml
9+
.github/workflows/publish.yml
10+
README.md
11+
src/BaseClient.ts
12+
src/auth/BearerAuthProvider.ts
13+
src/core/fetcher/makePassthroughRequest.ts
14+
src/core/url/QueryStringBuilder.ts
15+
src/api/index.ts
16+
src/api/types/compat.ts

‎README.md‎

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,27 @@
55

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

8-
## Project Updates
9-
10-
The TypeScript SDK has been updated to support latest API version (2.11).
8+
## Table of Contents
9+
10+
- [Installation](#installation)
11+
- [Reference](#reference)
12+
- [Usage](#usage)
13+
- [Environments](#environments)
14+
- [Request and Response Types](#request-and-response-types)
15+
- [Exception Handling](#exception-handling)
16+
- [Pagination](#pagination)
17+
- [Advanced](#advanced)
18+
- [Additional Headers](#additional-headers)
19+
- [Additional Query String Parameters](#additional-query-string-parameters)
20+
- [Retries](#retries)
21+
- [Timeouts](#timeouts)
22+
- [Aborting Requests](#aborting-requests)
23+
- [Access Raw Response Data](#access-raw-response-data)
24+
- [Logging](#logging)
25+
- [Custom Fetch](#custom-fetch)
26+
- [Custom Fetcher](#custom-fetcher)
27+
- [Runtime Compatibility](#runtime-compatibility)
28+
- [Contributing](#contributing)
1129

1230
## Installation
1331

@@ -17,7 +35,7 @@ npm i -s intercom-client
1735

1836
## Reference
1937

20-
A full reference for this library is available [here](https://github.com/intercom/intercom-node/blob/HEAD/./reference.md).
38+
A full reference for this library is available [here](./reference.md).
2139

2240
## Usage
2341

@@ -32,7 +50,19 @@ await client.aiContent.createContentImportSource({
3250
});
3351
```
3452

35-
## Request And Response Types
53+
## Environments
54+
55+
This SDK allows you to configure different environments for API requests.
56+
57+
```typescript
58+
import { IntercomClient, IntercomEnvironment } from "intercom-client";
59+
60+
const client = new IntercomClient({
61+
environment: IntercomEnvironment.UsProduction,
62+
});
63+
```
64+
65+
## Request and Response Types
3666

3767
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
3868
following namespace:
@@ -81,7 +111,7 @@ for await (const item of pageableResponse) {
81111
// Or you can manually iterate page-by-page
82112
let page = await client.articles.list();
83113
while (page.hasNextPage()) {
84-
page = page.getNextPage();
114+
page = await page.getNextPage();
85115
}
86116

87117
// You can also access the underlying response
@@ -95,6 +125,15 @@ const response = page.response;
95125
If you would like to send additional headers as part of the request, use the `headers` request option.
96126

97127
```typescript
128+
import { IntercomClient } from "intercom-client";
129+
130+
const client = new IntercomClient({
131+
...
132+
headers: {
133+
'X-Custom-Header': 'custom value'
134+
}
135+
});
136+
98137
const response = await client.aiContent.createContentImportSource(..., {
99138
headers: {
100139
'X-Custom-Header': 'custom value'
@@ -120,11 +159,10 @@ The SDK is instrumented with automatic retries with exponential backoff. A reque
120159
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
121160
retry limit (default: 2).
122161

123-
A request is deemed retryable when any of the following HTTP status codes is returned:
124-
162+
Requests are retried on:
125163
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
126164
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
127-
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
165+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
128166

129167
Use the `maxRetries` request option to configure this behavior.
130168

@@ -136,7 +174,7 @@ const response = await client.aiContent.createContentImportSource(..., {
136174

137175
### Timeouts
138176

139-
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
177+
The SDK defaults to a 20 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
140178

141179
```typescript
142180
const response = await client.aiContent.createContentImportSource(..., {
@@ -231,21 +269,29 @@ const logger: logging.ILogger = {
231269
</details>
232270

233271

234-
### Runtime Compatibility
235-
236-
237-
The SDK works in the following runtimes:
272+
### Custom Fetch
238273

274+
The SDK provides a low-level `fetch` method for making custom HTTP requests while still
275+
benefiting from SDK-level configuration like authentication, retries, timeouts, and logging.
276+
The auth header is only sent to the client's configured environment, so set `environment` to
277+
call a regional host such as `https://api.eu.intercom.io`.
278+
This is useful for calling API endpoints not yet supported in the SDK.
239279

280+
```typescript
281+
const response = await client.fetch("/v1/custom/endpoint", {
282+
method: "GET",
283+
}, {
284+
timeoutInSeconds: 30,
285+
maxRetries: 3,
286+
headers: {
287+
"X-Custom-Header": "custom-value",
288+
},
289+
});
240290

241-
- Node.js 18+
242-
- Vercel
243-
- Cloudflare Workers
244-
- Deno v1.25+
245-
- Bun 1.0+
246-
- React Native
291+
const data = await response.json();
292+
```
247293

248-
### Customizing Fetch Client
294+
### Custom Fetcher
249295

250296
The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an
251297
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
@@ -259,6 +305,21 @@ const client = new IntercomClient({
259305
});
260306
```
261307

308+
### Runtime Compatibility
309+
310+
311+
The SDK works in the following runtimes:
312+
313+
314+
315+
- Node.js 18+
316+
- Vercel
317+
- Cloudflare Workers
318+
- Deno v1.25+
319+
- Bun 1.0+
320+
- React Native
321+
322+
262323
## Contributing
263324

264325
While we value open-source contributions to this SDK, this library is generated programmatically.
@@ -267,4 +328,4 @@ otherwise they would be overwritten upon the next generated release. Feel free t
267328
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
268329
an issue first to discuss with us!
269330

270-
On the other hand, contributions to the README are always very welcome!
331+
On the other hand, contributions to the README are always very welcome!

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "intercom-client",
3-
"version": "7.0.3",
3+
"version": "7.1.0",
44
"private": false,
55
"repository": "github:intercom/intercom-node",
66
"type": "commonjs",

0 commit comments

Comments
 (0)