Skip to content
Merged
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
  •  
  •  
  •  
34 changes: 33 additions & 1 deletion .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Custom CI/CD
.github/workflows/auto-close-empty-prs.yml
.github/workflows/ci.yml

.gitignore
.prettierignore
Expand All @@ -17,10 +18,41 @@ reference.md
MIGRATE.md

# Custom Pipedream client files
src/api/resources/index.ts
src/api/types/index.ts
src/browser/index.ts
src/index.ts
src/wrapper

# Ideally, we shouldn't. But until Fern supports the changes that we've made we
# have to override some parts.

src/Client.ts

# Custom auth files
src/core/auth/index.ts
src/core/auth/ConnectTokenProvider.ts
src/core/auth/StaticTokenProvider.ts
src/core/auth/TokenProvider.ts

# Custom configuration props files
src/api/types/ConfiguredProps.ts
src/serialization/types/ConfiguredProps.ts

# Custom Proxy files
src/api/resources/proxy/client/requests/ProxyPutRequest.ts
src/api/resources/proxy/client/requests/ProxyGetRequest.ts
src/api/resources/proxy/client/requests/index.ts
src/api/resources/proxy/client/requests/ProxyPostRequest.ts
src/api/resources/proxy/client/requests/ProxyPatchRequest.ts
src/api/resources/proxy/client/requests/ProxyDeleteRequest.ts
src/api/resources/proxy/client/Client.ts
src/api/resources/proxy/client/index.ts

# Custom Workflow files
src/api/resources/workflows/client/requests/InvokeWorkflowForExternalUserOpts.ts
src/api/resources/workflows/client/requests/index.ts
src/api/resources/workflows/client/requests/InvokeWorkflowOpts.ts
src/api/resources/workflows/client/Client.ts
src/api/resources/workflows/client/index.ts
src/api/resources/workflows/index.ts
src/api/types/HTTPAuthType.ts
31 changes: 25 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ jobs:
- name: Set up node
uses: actions/setup-node@v3

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

- name: Install dependencies
run: pnpm install

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

test:
runs-on: ubuntu-latest
Expand All @@ -26,13 +32,20 @@ jobs:
- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn test
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install dependencies
run: pnpm install

- name: Test
run: pnpm test

publish:
needs:
- compile
- test

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

Expand All @@ -42,12 +55,18 @@ 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
run: pnpm install --frozen-lockfile

- name: Build
run: yarn build
run: pnpm 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 publish --access public
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.

33 changes: 15 additions & 18 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.1.0",
"private": false,
"repository": "github:PipedreamHQ/pipedream-sdk-typescript",
"type": "commonjs",
Expand Down Expand Up @@ -70,27 +70,24 @@
"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",
Expand All @@ -100,7 +97,7 @@
"path": false,
"stream": false
},
"packageManager": "yarn@1.22.22",
"packageManager": "pnpm@10.14.0",
"engines": {
"node": ">=18.0.0"
},
Expand Down
Loading