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
  •  
  •  
  •  
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
biome.json
.prettierrc.yml
tsconfig.json
yarn.lock
pnpm-lock.yaml
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ 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 @@ -81,6 +86,7 @@ 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 @@ -463,14 +469,19 @@ 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 @@ -483,7 +494,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 @@ -572,11 +583,8 @@ 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 @@ -606,4 +614,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: 0 additions & 69 deletions biome.json

This file was deleted.

42 changes: 42 additions & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/** @type {import('jest').Config} */
export default {
preset: "ts-jest",
testEnvironment: "node",
projects: [
{
displayName: "unit",
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/tests"],
testPathIgnorePatterns: ["\.browser\.(spec|test)\.[jt]sx?$", "/tests/wire/"],
setupFilesAfterEnv: [],
},
{
displayName: "browser",
preset: "ts-jest",
testEnvironment: "<rootDir>/tests/BrowserTestEnvironment.ts",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/tests"],
testMatch: ["<rootDir>/tests/unit/**/?(*.)+(browser).(spec|test).[jt]s?(x)"],
setupFilesAfterEnv: [],
},
,
{
displayName: "wire",
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/tests/wire"],
setupFilesAfterEnv: ["<rootDir>/tests/mock-server/setup.ts"],
},
],
workerThreads: false,
passWithNoTests: true,
};
58 changes: 15 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/sdk",
"version": "2.1.0",
"version": "2.1.1",
"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,34 +41,35 @@
"LICENSE"
],
"scripts": {
"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",
"format": "prettier . --write --ignore-unknown",
"build": "yarn build:cjs && yarn 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": "vitest",
"test:unit": "vitest --project unit",
"test:wire": "vitest --project wire"
"test": "jest --config jest.config.mjs",
"test:unit": "jest --selectProjects unit",
"test:browser": "jest --selectProjects browser",
"test:wire": "jest --selectProjects wire"
},
"devDependencies": {
"webpack": "^5.97.1",
"ts-loader": "^9.5.1",
"vitest": "^3.2.4",
"msw": "2.11.2",
"jest": "^29.7.0",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.14",
"ts-jest": "^29.3.4",
"jest-environment-jsdom": "^29.7.0",
"msw": "^2.8.4",
"@types/node": "^18.19.70",
"@biomejs/biome": "2.2.5",
"prettier": "^3.4.2",
"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": "pnpm@10.14.0",
"packageManager": "yarn@1.22.22",
"engines": {
"node": ">=18.0.0"
},
Expand Down
Loading
Loading