Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 14 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,16 @@ jobs:
- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn build

test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set up node
uses: actions/setup-node@v3
- name: Install dependencies
run: pnpm install

- name: Compile
run: yarn && yarn test
run: pnpm build

publish:
needs:
- compile
- test
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
test:
runs-on: ubuntu-latest

steps:
Expand All @@ -42,12 +31,12 @@ jobs:

- name: Set up node
uses: actions/setup-node@v3

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive

- name: Build
run: yarn build
- name: Set up NPM authentication
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: Publish
run: npm publish --access public --no-git-tag-version --tag latest
run: pnpm install

- name: Test
run: pnpm test
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tests
.gitignore
.github
.fernignore
.prettierrc.yml
biome.json
tsconfig.json
yarn.lock
pnpm-lock.yaml
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ Instantiate and use the client with the following:
```typescript
import { PipedreamClient } from "@pipedream/sdk";

const client = new PipedreamClient({
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
projectEnvironment: "YOUR_PROJECT_ENVIRONMENT",
projectId: "YOUR_PROJECT_ID",
});
const client = new PipedreamClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET", projectEnvironment: "YOUR_PROJECT_ENVIRONMENT", projectId: "YOUR_PROJECT_ID" });
await client.actions.run({
id: "id",
externalUserId: "external_user_id",
externalUserId: "external_user_id"
});
```

Expand Down Expand Up @@ -86,7 +81,6 @@ const stream: ReadableStream<Uint8Array> = response.stream();
// If you want to check if the response body has been used, you can use the following property.
const bodyUsed = response.bodyUsed;
```

<details>
<summary>Save binary response to a file</summary>

Expand Down Expand Up @@ -469,19 +463,14 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl
```typescript
import { PipedreamClient } from "@pipedream/sdk";

const client = new PipedreamClient({
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
projectEnvironment: "YOUR_PROJECT_ENVIRONMENT",
projectId: "YOUR_PROJECT_ID",
});
const client = new PipedreamClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET", projectEnvironment: "YOUR_PROJECT_ENVIRONMENT", projectId: "YOUR_PROJECT_ID" });
const response = await client.apps.list({
after: "after",
before: "before",
limit: 1,
q: "q",
sortKey: "name",
sortDirection: "asc",
sortDirection: "asc"
});
for await (const item of response) {
console.log(item);
Expand All @@ -494,7 +483,7 @@ let page = await client.apps.list({
limit: 1,
q: "q",
sortKey: "name",
sortDirection: "asc",
sortDirection: "asc"
});
while (page.hasNextPage()) {
page = page.getNextPage();
Expand Down Expand Up @@ -583,8 +572,11 @@ console.log(rawResponse.headers['X-My-Header']);

### Runtime Compatibility


The SDK works in the following runtimes:



- Node.js 18+
- Vercel
- Cloudflare Workers
Expand Down Expand Up @@ -614,4 +606,4 @@ otherwise they would be overwritten upon the next generated release. Feel free t
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!
On the other hand, contributions to the README are always very welcome!
69 changes: 69 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
"root": true,
"vcs": {
"enabled": false
},
"files": {
"ignoreUnknown": true,
"includes": [
"./**",
"!dist",
"!lib",
"!*.tsbuildinfo",
"!_tmp_*",
"!*.tmp",
"!.tmp/",
"!*.log",
"!.DS_Store",
"!Thumbs.db"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 120
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"linter": {
"rules": {
"style": {
"useNodejsImportProtocol": "off"
},
"suspicious": {
"noAssignInExpressions": "warn",
"noUselessEscapeInString": {
"level": "warn",
"fix": "none",
"options": {}
},
"noThenProperty": "warn",
"useIterableCallbackReturn": "warn",
"noShadowRestrictedNames": "warn",
"noTsIgnore": {
"level": "warn",
"fix": "none",
"options": {}
},
"noConfusingVoidType": {
"level": "warn",
"fix": "none",
"options": {}
}
}
}
}
}
42 changes: 0 additions & 42 deletions jest.config.mjs

This file was deleted.

64 changes: 15 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/sdk",
"version": "2.0.13",
"version": "2.0.14",
"private": false,
"repository": "github:PipedreamHQ/pipedream-sdk-typescript",
"type": "commonjs",
Expand All @@ -10,11 +10,6 @@
"exports": {
".": {
"types": "./dist/cjs/index.d.ts",
"browser": {
"types": "./dist/esm/browser/index.d.mts",
"import": "./dist/esm/browser/index.mjs",
"default": "./dist/esm/browser/index.mjs"
},
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
Expand All @@ -25,18 +20,6 @@
},
"default": "./dist/cjs/index.js"
},
"./browser": {
"types": "./dist/esm/browser/index.d.mts",
"import": {
"types": "./dist/esm/browser/index.d.mts",
"default": "./dist/esm/browser/index.mjs"
},
"require": {
"types": "./dist/cjs/browser/index.d.ts",
"default": "./dist/cjs/browser/index.js"
},
"default": "./dist/esm/browser/index.mjs"
},
"./serialization": {
"types": "./dist/cjs/serialization/index.d.ts",
"import": {
Expand All @@ -49,18 +32,6 @@
},
"default": "./dist/cjs/serialization/index.js"
},
"./server": {
"types": "./dist/cjs/index.d.ts",
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
},
"default": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
"files": [
Expand All @@ -70,37 +41,32 @@
"LICENSE"
],
"scripts": {
"format": "prettier . --write --ignore-unknown",
"build": "yarn build:cjs && yarn build:esm",
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"build": "pnpm build:cjs && pnpm build:esm",
"build:cjs": "tsc --project ./tsconfig.cjs.json",
"build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
"test": "jest --config jest.config.mjs",
"test:unit": "jest --selectProjects unit",
"test:browser": "jest --selectProjects browser",
"test:wire": "jest --selectProjects wire"
"test": "vitest",
"test:unit": "vitest --project unit",
"test:wire": "vitest --project wire"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.14",
"@types/node": "^18.19.70",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"msw": "^2.8.4",
"prettier": "^3.4.2",
"ts-jest": "^29.3.4",
"webpack": "^5.97.1",
"ts-loader": "^9.5.1",
"typescript": "~5.7.2",
"webpack": "^5.97.1"
"vitest": "^3.2.4",
"msw": "2.11.2",
"@types/node": "^18.19.70",
"@biomejs/biome": "2.2.5",
"typescript": "~5.7.2"
},
"browser": {
"./dist/cjs/wrapper/utils/getBaseUrl.js": "./dist/cjs/wrapper/utils/getBaseUrl.browser.js",
"./dist/esm/wrapper/utils/getBaseUrl.mjs": "./dist/esm/wrapper/utils/getBaseUrl.browser.mjs",
"fs": false,
"os": false,
"path": false,
"stream": false
},
"packageManager": "yarn@1.22.22",
"packageManager": "pnpm@10.14.0",
"engines": {
"node": ">=18.0.0"
},
Expand Down
Loading
Loading