Skip to content

Commit c3526fd

Browse files
Better README example (#64)
* Update `README.md` with a better example endpoint * Clean up `.fernignore` so that it doesn't wipe our work * Fix incorrect versions --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Jay Vercellone <[email protected]>
1 parent 198acfd commit c3526fd

File tree

6 files changed

+60
-46
lines changed

6 files changed

+60
-46
lines changed

.fernignore

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,29 @@ LICENSE
1313
# References doc (we have additional use cases)
1414
reference.md
1515

16+
# Migration doc
17+
MIGRATE.md
18+
1619
# Custom Pipedream client files
1720
src/api/resources/index.ts
1821
src/api/types/index.ts
1922
src/index.ts
2023
src/wrapper
2124

2225
# Custom Proxy files
23-
src/api/resources/proxy/client/*
26+
src/api/resources/proxy/client/requests/ProxyPutRequest.ts
27+
src/api/resources/proxy/client/requests/ProxyGetRequest.ts
28+
src/api/resources/proxy/client/requests/index.ts
29+
src/api/resources/proxy/client/requests/ProxyPostRequest.ts
30+
src/api/resources/proxy/client/requests/ProxyPatchRequest.ts
31+
src/api/resources/proxy/client/requests/ProxyDeleteRequest.ts
32+
src/api/resources/proxy/client/Client.ts
33+
src/api/resources/proxy/client/index.ts
2434

2535
# Custom Workflow files
26-
src/api/resources/workflows/client/*
36+
src/api/resources/workflows/client/requests/InvokeWorkflowForExternalUserOpts.ts
37+
src/api/resources/workflows/client/requests/index.ts
38+
src/api/resources/workflows/client/requests/InvokeWorkflowOpts.ts
39+
src/api/resources/workflows/client/Client.ts
40+
src/api/resources/workflows/client/index.ts
41+
src/api/types/HTTPAuthType.ts

MIGRATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ incrementally without breaking your existing codebase. To do this, you can
740740
install the new SDK with an alias:
741741

742742
```bash
743-
npm install @pipedream/sdk-v2@npm:@pipedream/sdk@^2.0.0 --save
743+
npm install @pipedream/sdk-v2@npm:@pipedream/sdk@^2.0.0-rc.2 --save
744744
```
745745

746746
Then, in your code, you can import the new SDK with the alias:

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ const client = new PipedreamClient({
3333
projectEnvironment: "YOUR_PROJECT_ENVIRONMENT",
3434
projectId: "YOUR_PROJECT_ID",
3535
});
36-
await client.accounts.create({
37-
app_slug: "app_slug",
38-
cfmap_json: "cfmap_json",
39-
connect_token: "connect_token",
36+
await client.actions.run({
37+
id: "id",
38+
external_user_id: "external_user_id",
4039
});
4140
```
4241

@@ -62,7 +61,7 @@ will be thrown.
6261
import { PipedreamError } from "@pipedream/sdk";
6362

6463
try {
65-
await client.accounts.create(...);
64+
await client.actions.run(...);
6665
} catch (err) {
6766
if (err instanceof PipedreamError) {
6867
console.log(err.statusCode);
@@ -105,7 +104,7 @@ while (page.hasNextPage()) {
105104
If you would like to send additional headers as part of the request, use the `headers` request option.
106105

107106
```typescript
108-
const response = await client.accounts.create(..., {
107+
const response = await client.actions.run(..., {
109108
headers: {
110109
'X-Custom-Header': 'custom value'
111110
}
@@ -117,7 +116,7 @@ const response = await client.accounts.create(..., {
117116
If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
118117

119118
```typescript
120-
const response = await client.accounts.create(..., {
119+
const response = await client.actions.run(..., {
121120
queryParams: {
122121
'customQueryParamKey': 'custom query param value'
123122
}
@@ -139,7 +138,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
139138
Use the `maxRetries` request option to configure this behavior.
140139

141140
```typescript
142-
const response = await client.accounts.create(..., {
141+
const response = await client.actions.run(..., {
143142
maxRetries: 0 // override maxRetries at the request level
144143
});
145144
```
@@ -149,7 +148,7 @@ const response = await client.accounts.create(..., {
149148
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
150149

151150
```typescript
152-
const response = await client.accounts.create(..., {
151+
const response = await client.actions.run(..., {
153152
timeoutInSeconds: 30 // override timeout to 30s
154153
});
155154
```
@@ -160,7 +159,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
160159

161160
```typescript
162161
const controller = new AbortController();
163-
const response = await client.accounts.create(..., {
162+
const response = await client.actions.run(..., {
164163
abortSignal: controller.signal
165164
});
166165
controller.abort(); // aborts the request
@@ -172,7 +171,7 @@ The SDK provides access to raw response data, including headers, through the `.w
172171
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
173172

174173
```typescript
175-
const { data, rawResponse } = await client.accounts.create(...).withRawResponse();
174+
const { data, rawResponse } = await client.actions.run(...).withRawResponse();
176175

177176
console.log(data);
178177
console.log(rawResponse.headers['X-My-Header']);

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@
3939
"test:wire": "jest --selectProjects wire"
4040
},
4141
"devDependencies": {
42+
"webpack": "^5.97.1",
43+
"ts-loader": "^9.5.1",
44+
"jest": "^29.7.0",
4245
"@jest/globals": "^29.7.0",
4346
"@types/jest": "^29.5.14",
44-
"@types/node": "^18.19.70",
45-
"jest": "^29.7.0",
47+
"ts-jest": "^29.3.4",
4648
"jest-environment-jsdom": "^29.7.0",
4749
"msw": "^2.8.4",
50+
"@types/node": "^18.19.70",
4851
"prettier": "^3.4.2",
49-
"ts-jest": "^29.3.4",
50-
"ts-loader": "^9.5.1",
51-
"typescript": "~5.7.2",
52-
"webpack": "^5.97.1"
52+
"typescript": "~5.7.2"
5353
},
5454
"browser": {
5555
"fs": false,

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const SDK_VERSION = "1.7.1";
1+
export const SDK_VERSION = "2.0.0-rc.2";

yarn.lock

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,9 @@
575575
"@jridgewell/sourcemap-codec" "^1.4.14"
576576

577577
"@mswjs/interceptors@^0.39.1":
578-
version "0.39.3"
579-
resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.39.3.tgz#d27886db295c9a7dbc41aa229a644bc7bbb04723"
580-
integrity sha512-9bw/wBL7pblsnOCIqvn1788S9o4h+cC5HWXg0Xhh0dOzsZ53IyfmBM+FYqpDDPbm0xjCqEqvCITloF3Dm4TXRQ==
578+
version "0.39.5"
579+
resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.39.5.tgz#6f0571493bf76291a60b62234ed0add2c4bd970e"
580+
integrity sha512-B9nHSJYtsv79uo7QdkZ/b/WoKm20IkVSmTc/WCKarmDtFwM0dRx2ouEniqwNkzCSLn3fydzKmnMzjtfdOWt3VQ==
581581
dependencies:
582582
"@open-draft/deferred-promise" "^2.2.0"
583583
"@open-draft/logger" "^0.3.0"
@@ -655,11 +655,11 @@
655655
"@babel/types" "^7.0.0"
656656

657657
"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6":
658-
version "7.20.7"
659-
resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.7.tgz#968cdc2366ec3da159f61166428ee40f370e56c2"
660-
integrity sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==
658+
version "7.28.0"
659+
resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.28.0.tgz#07d713d6cce0d265c9849db0cbe62d3f61f36f74"
660+
integrity sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==
661661
dependencies:
662-
"@babel/types" "^7.20.7"
662+
"@babel/types" "^7.28.2"
663663

664664
"@types/cookie@^0.6.0":
665665
version "0.6.0"
@@ -743,9 +743,9 @@
743743
undici-types "~7.8.0"
744744

745745
"@types/node@^18.19.70":
746-
version "18.19.120"
747-
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.120.tgz#07b3bd73875956d5281fa27e6d77a66415f7d455"
748-
integrity sha512-WtCGHFXnVI8WHLxDAt5TbnCM4eSE+nI0QN2NJtwzcgMhht2eNz6V9evJrk+lwC8bCY8OWV5Ym8Jz7ZEyGnKnMA==
746+
version "18.19.121"
747+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.121.tgz#c50d353ea2d1fb1261a8bbd0bf2850306f5af2b3"
748+
integrity sha512-bHOrbyztmyYIi4f1R0s17QsPs1uyyYnGcXeZoGEd227oZjry0q6XQBQxd82X1I57zEfwO8h9Xo+Kl5gX1d9MwQ==
749749
dependencies:
750750
undici-types "~5.26.4"
751751

@@ -1052,9 +1052,9 @@ babel-plugin-jest-hoist@^29.6.3:
10521052
"@types/babel__traverse" "^7.0.6"
10531053

10541054
babel-preset-current-node-syntax@^1.0.0:
1055-
version "1.1.0"
1056-
resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz#9a929eafece419612ef4ae4f60b1862ebad8ef30"
1057-
integrity sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==
1055+
version "1.2.0"
1056+
resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz#20730d6cdc7dda5d89401cab10ac6a32067acde6"
1057+
integrity sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==
10581058
dependencies:
10591059
"@babel/plugin-syntax-async-generators" "^7.8.4"
10601060
"@babel/plugin-syntax-bigint" "^7.8.3"
@@ -1160,9 +1160,9 @@ camelcase@^6.2.0:
11601160
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
11611161

11621162
caniuse-lite@^1.0.30001726:
1163-
version "1.0.30001727"
1164-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001727.tgz#22e9706422ad37aa50556af8c10e40e2d93a8b85"
1165-
integrity sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==
1163+
version "1.0.30001731"
1164+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001731.tgz#277c07416ea4613ec564e5b0ffb47e7b60f32e2f"
1165+
integrity sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg==
11661166

11671167
chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0:
11681168
version "4.1.2"
@@ -1364,9 +1364,9 @@ ejs@^3.1.10:
13641364
jake "^10.8.5"
13651365

13661366
electron-to-chromium@^1.5.173:
1367-
version "1.5.191"
1368-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.191.tgz#8ae49a471447b1ceaf1d4d183a9000082f52363c"
1369-
integrity sha512-xcwe9ELcuxYLUFqZZxL19Z6HVKcvNkIwhbHUz7L3us6u12yR+7uY89dSl570f/IqNthx8dAw3tojG7i4Ni4tDA==
1367+
version "1.5.194"
1368+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.194.tgz#05e541c3373ba8d967a65c92bc14d60608908236"
1369+
integrity sha512-SdnWJwSUot04UR51I2oPD8kuP2VI37/CADR1OHsFOUzZIvfWJBO6q11k5P/uKNyTT3cdOsnyjkrZ+DDShqYqJA==
13701370

13711371
emittery@^0.13.1:
13721372
version "0.13.1"
@@ -2494,9 +2494,9 @@ npm-run-path@^4.0.1:
24942494
path-key "^3.0.0"
24952495

24962496
nwsapi@^2.2.2:
2497-
version "2.2.20"
2498-
resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.20.tgz#22e53253c61e7b0e7e93cef42c891154bcca11ef"
2499-
integrity sha512-/ieB+mDe4MrrKMT8z+mQL8klXydZWGR5Dowt4RAGKbJ3kIGEx3X4ljUo+6V73IXtUPWgfOlU5B9MlGxFO5T+cA==
2497+
version "2.2.21"
2498+
resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.21.tgz#8df7797079350adda208910d8c33fc4c2d7520c3"
2499+
integrity sha512-o6nIY3qwiSXl7/LuOU0Dmuctd34Yay0yeuZRLFmDPrrdHpXKFndPj3hM+YEPVHYC5fx2otBx4Ilc/gyYSAUaIA==
25002500

25012501
once@^1.3.0:
25022502
version "1.4.0"
@@ -3074,9 +3074,9 @@ webpack-sources@^3.3.3:
30743074
integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==
30753075

30763076
webpack@^5.97.1:
3077-
version "5.100.2"
3078-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.100.2.tgz#e2341facf9f7de1d702147c91bcb65b693adf9e8"
3079-
integrity sha512-QaNKAvGCDRh3wW1dsDjeMdDXwZm2vqq3zn6Pvq4rHOEOGSaUMgOOjG2Y9ZbIGzpfkJk9ZYTHpDqgDfeBDcnLaw==
3077+
version "5.101.0"
3078+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.101.0.tgz#4b81407ffad9857f81ff03f872e3369b9198cc9d"
3079+
integrity sha512-B4t+nJqytPeuZlHuIKTbalhljIFXeNRqrUGAQgTGlfOl2lXXKXw+yZu6bicycP+PUlM44CxBjCFD6aciKFT3LQ==
30803080
dependencies:
30813081
"@types/eslint-scope" "^3.7.7"
30823082
"@types/estree" "^1.0.8"

0 commit comments

Comments
 (0)