Skip to content

Commit a32afa8

Browse files
SDK regeneration
1 parent 111b10c commit a32afa8

File tree

1,232 files changed

+113130
-28318
lines changed

Some content is hidden

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

1,232 files changed

+113130
-28318
lines changed

.fern/metadata.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"cliVersion": "3.0.2",
3+
"generatorName": "fernapi/fern-typescript-sdk",
4+
"generatorVersion": "3.35.8",
5+
"generatorConfig": {
6+
"namespaceExport": "Intercom",
7+
"allowCustomFetcher": true,
8+
"skipResponseValidation": true,
9+
"includeApiReference": true,
10+
"noSerdeLayer": true,
11+
"enableInlineTypes": true,
12+
"inlinePathParameters": true,
13+
"timeoutInSeconds": 20,
14+
"packageJson": {
15+
"license": "Apache-2.0",
16+
"description": "Official Node bindings to the Intercom API",
17+
"homepage": "https://github.com/intercom/intercom-node",
18+
"bugs": "https://github.com/intercom/intercom-node/issues",
19+
"keywords": ["intercom", "api"]
20+
}
21+
}
22+
}

.npmignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

.prettierrc.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Contributing
2+
3+
Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
9+
- Node.js 20 or higher
10+
- pnpm package manager
11+
12+
### Installation
13+
14+
Install the project dependencies:
15+
16+
```bash
17+
pnpm install
18+
```
19+
20+
### Building
21+
22+
Build the project:
23+
24+
```bash
25+
pnpm build
26+
```
27+
28+
### Testing
29+
30+
Run the test suite:
31+
32+
```bash
33+
pnpm test
34+
```
35+
36+
Run specific test types:
37+
- `pnpm test:unit` - Run unit tests
38+
- `pnpm test:wire` - Run wire/integration tests
39+
40+
### Linting and Formatting
41+
42+
Check code style:
43+
44+
```bash
45+
pnpm run lint
46+
pnpm run format:check
47+
```
48+
49+
Fix code style issues:
50+
51+
```bash
52+
pnpm run lint:fix
53+
pnpm run format:fix
54+
```
55+
56+
Or use the combined check command:
57+
58+
```bash
59+
pnpm run check:fix
60+
```
61+
62+
## About Generated Code
63+
64+
**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.
65+
66+
### Generated Files
67+
68+
The following directories contain generated code:
69+
- `src/api/` - API client classes and types
70+
- `src/serialization/` - Serialization/deserialization logic
71+
- Most TypeScript files in `src/`
72+
73+
### How to Customize
74+
75+
If you need to customize the SDK, you have two options:
76+
77+
#### Option 1: Use `.fernignore`
78+
79+
For custom code that should persist across SDK regenerations:
80+
81+
1. Create a `.fernignore` file in the project root
82+
2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
83+
3. Add your custom code to those files
84+
85+
Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.
86+
87+
For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).
88+
89+
#### Option 2: Contribute to the Generator
90+
91+
If you want to change how code is generated for all users of this SDK:
92+
93+
1. The TypeScript SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
94+
2. Generator code is located at `generators/typescript/sdk/`
95+
3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
96+
4. Submit a pull request with your changes to the generator
97+
98+
This approach is best for:
99+
- Bug fixes in generated code
100+
- New features that would benefit all users
101+
- Improvements to code generation patterns
102+
103+
## Making Changes
104+
105+
### Workflow
106+
107+
1. Create a new branch for your changes
108+
2. Make your modifications
109+
3. Run tests to ensure nothing breaks: `pnpm test`
110+
4. Run linting and formatting: `pnpm run check:fix`
111+
5. Build the project: `pnpm build`
112+
6. Commit your changes with a clear commit message
113+
7. Push your branch and create a pull request
114+
115+
### Commit Messages
116+
117+
Write clear, descriptive commit messages that explain what changed and why.
118+
119+
### Code Style
120+
121+
This project uses automated code formatting and linting. Run `pnpm run check:fix` before committing to ensure your code meets the project's style guidelines.
122+
123+
## Questions or Issues?
124+
125+
If you have questions or run into issues:
126+
127+
1. Check the [Fern documentation](https://buildwithfern.com)
128+
2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
129+
3. Open a new issue if your question hasn't been addressed
130+
131+
## License
132+
133+
By contributing to this project, you agree that your contributions will be licensed under the same license as the project.

README.md

Lines changed: 95 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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

6-
The Intercom TypeScript library provides convenient access to the Intercom API from TypeScript.
6+
The Intercom TypeScript library provides convenient access to the Intercom APIs from TypeScript.
77

88
## Project Updates
99

@@ -27,12 +27,8 @@ Instantiate and use the client with the following:
2727
import { IntercomClient } from "intercom-client";
2828

2929
const client = new IntercomClient({ token: "YOUR_TOKEN" });
30-
await client.articles.create({
31-
title: "Thanks for everything",
32-
description: "Description of the Article",
33-
body: "Body of the Article",
34-
author_id: 1295,
35-
state: "published",
30+
await client.aiContent.createContentImportSource({
31+
url: "https://www.example.com"
3632
});
3733
```
3834

@@ -58,7 +54,7 @@ will be thrown.
5854
import { IntercomError } from "intercom-client";
5955

6056
try {
61-
await client.articles.create(...);
57+
await client.aiContent.createContentImportSource(...);
6258
} catch (err) {
6359
if (err instanceof IntercomError) {
6460
console.log(err.statusCode);
@@ -77,16 +73,19 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl
7773
import { IntercomClient } from "intercom-client";
7874

7975
const client = new IntercomClient({ token: "YOUR_TOKEN" });
80-
const response = await client.articles.list();
81-
for await (const item of response) {
76+
const pageableResponse = await client.articles.list();
77+
for await (const item of pageableResponse) {
8278
console.log(item);
8379
}
8480

8581
// Or you can manually iterate page-by-page
86-
const page = await client.articles.list();
82+
let page = await client.articles.list();
8783
while (page.hasNextPage()) {
8884
page = page.getNextPage();
8985
}
86+
87+
// You can also access the underlying response
88+
const response = page.response;
9089
```
9190

9291
## Advanced
@@ -96,13 +95,25 @@ while (page.hasNextPage()) {
9695
If you would like to send additional headers as part of the request, use the `headers` request option.
9796

9897
```typescript
99-
const response = await client.articles.create(..., {
98+
const response = await client.aiContent.createContentImportSource(..., {
10099
headers: {
101100
'X-Custom-Header': 'custom value'
102101
}
103102
});
104103
```
105104

105+
### Additional Query String Parameters
106+
107+
If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
108+
109+
```typescript
110+
const response = await client.aiContent.createContentImportSource(..., {
111+
queryParams: {
112+
'customQueryParamKey': 'custom query param value'
113+
}
114+
});
115+
```
116+
106117
### Retries
107118

108119
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
@@ -118,7 +129,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
118129
Use the `maxRetries` request option to configure this behavior.
119130

120131
```typescript
121-
const response = await client.articles.create(..., {
132+
const response = await client.aiContent.createContentImportSource(..., {
122133
maxRetries: 0 // override maxRetries at the request level
123134
});
124135
```
@@ -128,7 +139,7 @@ const response = await client.articles.create(..., {
128139
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
129140

130141
```typescript
131-
const response = await client.articles.create(..., {
142+
const response = await client.aiContent.createContentImportSource(..., {
132143
timeoutInSeconds: 30 // override timeout to 30s
133144
});
134145
```
@@ -139,7 +150,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
139150

140151
```typescript
141152
const controller = new AbortController();
142-
const response = await client.articles.create(..., {
153+
const response = await client.aiContent.createContentImportSource(..., {
143154
abortSignal: controller.signal
144155
});
145156
controller.abort(); // aborts the request
@@ -151,16 +162,81 @@ The SDK provides access to raw response data, including headers, through the `.w
151162
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
152163

153164
```typescript
154-
const { data, rawResponse } = await client.articles.create(...).withRawResponse();
165+
const { data, rawResponse } = await client.aiContent.createContentImportSource(...).withRawResponse();
155166

156167
console.log(data);
157168
console.log(rawResponse.headers['X-My-Header']);
158169
```
159170

171+
### Logging
172+
173+
The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options.
174+
175+
```typescript
176+
import { IntercomClient, logging } from "intercom-client";
177+
178+
const client = new IntercomClient({
179+
...
180+
logging: {
181+
level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info
182+
logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger
183+
silent: false, // defaults to true, set to false to enable logging
184+
}
185+
});
186+
```
187+
The `logging` object can have the following properties:
188+
- `level`: The log level to use. Defaults to `logging.LogLevel.Info`.
189+
- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`.
190+
- `silent`: Whether to silence the logger. Defaults to `true`.
191+
192+
The `level` property can be one of the following values:
193+
- `logging.LogLevel.Debug`
194+
- `logging.LogLevel.Info`
195+
- `logging.LogLevel.Warn`
196+
- `logging.LogLevel.Error`
197+
198+
To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface.
199+
200+
<details>
201+
<summary>Custom logger examples</summary>
202+
203+
Here's an example using the popular `winston` logging library.
204+
```ts
205+
import winston from 'winston';
206+
207+
const winstonLogger = winston.createLogger({...});
208+
209+
const logger: logging.ILogger = {
210+
debug: (msg, ...args) => winstonLogger.debug(msg, ...args),
211+
info: (msg, ...args) => winstonLogger.info(msg, ...args),
212+
warn: (msg, ...args) => winstonLogger.warn(msg, ...args),
213+
error: (msg, ...args) => winstonLogger.error(msg, ...args),
214+
};
215+
```
216+
217+
Here's an example using the popular `pino` logging library.
218+
219+
```ts
220+
import pino from 'pino';
221+
222+
const pinoLogger = pino({...});
223+
224+
const logger: logging.ILogger = {
225+
debug: (msg, ...args) => pinoLogger.debug(args, msg),
226+
info: (msg, ...args) => pinoLogger.info(args, msg),
227+
warn: (msg, ...args) => pinoLogger.warn(args, msg),
228+
error: (msg, ...args) => pinoLogger.error(args, msg),
229+
};
230+
```
231+
</details>
232+
233+
160234
### Runtime Compatibility
161235

162-
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
163-
runtimes:
236+
237+
The SDK works in the following runtimes:
238+
239+
164240

165241
- Node.js 18+
166242
- Vercel
@@ -191,14 +267,4 @@ otherwise they would be overwritten upon the next generated release. Feel free t
191267
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
192268
an issue first to discuss with us!
193269

194-
On the other hand, contributions to the README are always very welcome!
195-
196-
## Contributing
197-
198-
While we value open-source contributions to this SDK, this library is generated programmatically.
199-
Additions made directly to this library would have to be moved over to our generation code,
200-
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
201-
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
202-
an issue first to discuss with us!
203-
204-
On the other hand, contributions to the README are always very welcome!
270+
On the other hand, contributions to the README are always very welcome!

0 commit comments

Comments
 (0)