Skip to content

Commit bfa7176

Browse files
SDK regeneration
1 parent e4c49cf commit bfa7176

File tree

114 files changed

+5218
-2460
lines changed

Some content is hidden

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

114 files changed

+5218
-2460
lines changed

.fern/metadata.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"cliVersion": "1.9.0",
3+
"generatorName": "fernapi/fern-typescript-node-sdk",
4+
"generatorVersion": "3.31.1",
5+
"generatorConfig": {
6+
"includeApiReference": true,
7+
"namespaceExport": "Pipedream",
8+
"noSerdeLayer": false
9+
}
10+
}

.npmignore

Lines changed: 0 additions & 11 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: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,15 +464,15 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl
464464
import { PipedreamClient } from "@pipedream/sdk";
465465

466466
const client = new PipedreamClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET", projectEnvironment: "YOUR_PROJECT_ENVIRONMENT", projectId: "YOUR_PROJECT_ID" });
467-
const response = await client.apps.list({
467+
const pageableResponse = await client.apps.list({
468468
after: "after",
469469
before: "before",
470470
limit: 1,
471471
q: "q",
472472
sortKey: "name",
473473
sortDirection: "asc"
474474
});
475-
for await (const item of response) {
475+
for await (const item of pageableResponse) {
476476
console.log(item);
477477
}
478478

@@ -488,6 +488,9 @@ let page = await client.apps.list({
488488
while (page.hasNextPage()) {
489489
page = page.getNextPage();
490490
}
491+
492+
// You can also access the underlying response
493+
const response = page.response;
491494
```
492495

493496
## Advanced
@@ -570,6 +573,69 @@ console.log(data);
570573
console.log(rawResponse.headers['X-My-Header']);
571574
```
572575

576+
### Logging
577+
578+
The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options.
579+
580+
```typescript
581+
import { PipedreamClient, logging } from "@pipedream/sdk";
582+
583+
const client = new PipedreamClient({
584+
...
585+
logging: {
586+
level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info
587+
logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger
588+
silent: false, // defaults to true, set to false to enable logging
589+
}
590+
});
591+
```
592+
The `logging` object can have the following properties:
593+
- `level`: The log level to use. Defaults to `logging.LogLevel.Info`.
594+
- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`.
595+
- `silent`: Whether to silence the logger. Defaults to `true`.
596+
597+
The `level` property can be one of the following values:
598+
- `logging.LogLevel.Debug`
599+
- `logging.LogLevel.Info`
600+
- `logging.LogLevel.Warn`
601+
- `logging.LogLevel.Error`
602+
603+
To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface.
604+
605+
<details>
606+
<summary>Custom logger examples</summary>
607+
608+
Here's an example using the popular `winston` logging library.
609+
```ts
610+
import winston from 'winston';
611+
612+
const winstonLogger = winston.createLogger({...});
613+
614+
const logger: logging.ILogger = {
615+
debug: (msg, ...args) => winstonLogger.debug(msg, ...args),
616+
info: (msg, ...args) => winstonLogger.info(msg, ...args),
617+
warn: (msg, ...args) => winstonLogger.warn(msg, ...args),
618+
error: (msg, ...args) => winstonLogger.error(msg, ...args),
619+
};
620+
```
621+
622+
Here's an example using the popular `pino` logging library.
623+
624+
```ts
625+
import pino from 'pino';
626+
627+
const pinoLogger = pino({...});
628+
629+
const logger: logging.ILogger = {
630+
debug: (msg, ...args) => pinoLogger.debug(args, msg),
631+
info: (msg, ...args) => pinoLogger.info(args, msg),
632+
warn: (msg, ...args) => pinoLogger.warn(args, msg),
633+
error: (msg, ...args) => pinoLogger.error(args, msg),
634+
};
635+
```
636+
</details>
637+
638+
573639
### Runtime Compatibility
574640

575641

biome.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.1/schema.json",
33
"root": true,
44
"vcs": {
55
"enabled": false
66
},
77
"files": {
88
"ignoreUnknown": true,
99
"includes": [
10-
"./**",
11-
"!dist",
12-
"!lib",
13-
"!*.tsbuildinfo",
14-
"!_tmp_*",
15-
"!*.tmp",
16-
"!.tmp/",
17-
"!*.log",
18-
"!.DS_Store",
19-
"!Thumbs.db"
10+
"**",
11+
"!!dist",
12+
"!!**/dist",
13+
"!!lib",
14+
"!!**/lib",
15+
"!!_tmp_*",
16+
"!!**/_tmp_*",
17+
"!!*.tmp",
18+
"!!**/*.tmp",
19+
"!!.tmp/",
20+
"!!**/.tmp/",
21+
"!!*.log",
22+
"!!**/*.log",
23+
"!!**/.DS_Store",
24+
"!!**/Thumbs.db"
2025
]
2126
},
2227
"formatter": {

package.json

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/sdk",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"private": false,
55
"repository": "github:PipedreamHQ/pipedream-sdk-typescript",
66
"type": "commonjs",
@@ -10,11 +10,6 @@
1010
"exports": {
1111
".": {
1212
"types": "./dist/cjs/index.d.ts",
13-
"browser": {
14-
"types": "./dist/esm/browser/index.d.mts",
15-
"import": "./dist/esm/browser/index.mjs",
16-
"default": "./dist/esm/browser/index.mjs"
17-
},
1813
"import": {
1914
"types": "./dist/esm/index.d.mts",
2015
"default": "./dist/esm/index.mjs"
@@ -25,18 +20,6 @@
2520
},
2621
"default": "./dist/cjs/index.js"
2722
},
28-
"./browser": {
29-
"types": "./dist/esm/browser/index.d.mts",
30-
"import": {
31-
"types": "./dist/esm/browser/index.d.mts",
32-
"default": "./dist/esm/browser/index.mjs"
33-
},
34-
"require": {
35-
"types": "./dist/cjs/browser/index.d.ts",
36-
"default": "./dist/cjs/browser/index.js"
37-
},
38-
"default": "./dist/esm/browser/index.mjs"
39-
},
4023
"./serialization": {
4124
"types": "./dist/cjs/serialization/index.d.ts",
4225
"import": {
@@ -49,18 +32,6 @@
4932
},
5033
"default": "./dist/cjs/serialization/index.js"
5134
},
52-
"./server": {
53-
"types": "./dist/cjs/index.d.ts",
54-
"import": {
55-
"types": "./dist/esm/index.d.mts",
56-
"default": "./dist/esm/index.mjs"
57-
},
58-
"require": {
59-
"types": "./dist/cjs/index.d.ts",
60-
"default": "./dist/cjs/index.js"
61-
},
62-
"default": "./dist/cjs/index.js"
63-
},
6435
"./package.json": "./package.json"
6536
},
6637
"files": [
@@ -83,24 +54,23 @@
8354
"test:unit": "vitest --project unit",
8455
"test:wire": "vitest --project wire"
8556
},
57+
"dependencies": {},
8658
"devDependencies": {
8759
"webpack": "^5.97.1",
8860
"ts-loader": "^9.5.1",
8961
"vitest": "^3.2.4",
9062
"msw": "2.11.2",
9163
"@types/node": "^18.19.70",
9264
"typescript": "~5.7.2",
93-
"@biomejs/biome": "2.2.5"
65+
"@biomejs/biome": "2.3.1"
9466
},
9567
"browser": {
96-
"./dist/cjs/wrapper/utils/getBaseUrl.js": "./dist/cjs/wrapper/utils/getBaseUrl.browser.js",
97-
"./dist/esm/wrapper/utils/getBaseUrl.mjs": "./dist/esm/wrapper/utils/getBaseUrl.browser.mjs",
9868
"fs": false,
9969
"os": false,
10070
"path": false,
10171
"stream": false
10272
},
103-
"packageManager": "pnpm@10.14.0",
73+
"packageManager": "pnpm@10.20.0",
10474
"engines": {
10575
"node": ">=18.0.0"
10676
},

0 commit comments

Comments
 (0)