Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

# Changelog

## [1.5.3] - 2025-04-18

### Added

- Added `ProxyResponse` type for makeProxyRequest
- changed the location of connect DEBUG calls so they'll still show in the

Check failure on line 10 in packages/sdk/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / test

Trailing spaces

packages/sdk/CHANGELOG.md:10:75 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md009.md

Check failure on line 10 in packages/sdk/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / test

Trailing spaces

packages/sdk/CHANGELOG.md:10:75 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md009.md
error case.

Check failure on line 11 in packages/sdk/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / test

Lists should be surrounded by blank lines

packages/sdk/CHANGELOG.md:11 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "error case."] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md032.md

Check failure on line 11 in packages/sdk/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / test

Lists should be surrounded by blank lines

packages/sdk/CHANGELOG.md:11 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "error case."] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md032.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix Markdown lint errors: trailing spaces, capitalization, wrapping, and list spacing
Line 10 has a trailing space (MD009), the item should be capitalized to match other entries, and the text must wrap within 80 characters. Also, lists must be surrounded by blank lines (MD032)—add a blank line after the list before the next header. Apply this diff to lines 10–11:

@@ -10,2 +10,3 @@ ### Added
- - changed the location of connect DEBUG calls so they'll still show in the 
-     error case.
+ - Changed the location of connect DEBUG calls so they'll still show in the
+   error case.

Then insert a blank line before the ## [1.5.2] - 2025-04-15 heading.

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 GitHub Check: test

[failure] 10-10: Trailing spaces
packages/sdk/CHANGELOG.md:10:75 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md009.md


[failure] 11-11: Lists should be surrounded by blank lines
packages/sdk/CHANGELOG.md:11 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "error case."] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md032.md

🪛 GitHub Actions: Lint SDK Markdown Files

[error] 10-10: markdownlint MD009/no-trailing-spaces: Trailing spaces detected (Expected: 0 or 2; Actual: 1). See https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md009.md

## [1.5.2] - 2025-04-15

Check failure on line 12 in packages/sdk/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / test

Headings should be surrounded by blank lines

packages/sdk/CHANGELOG.md:12 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "## [1.5.2] - 2025-04-15"] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md022.md

Check failure on line 12 in packages/sdk/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / test

Headings should be surrounded by blank lines

packages/sdk/CHANGELOG.md:12 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "## [1.5.2] - 2025-04-15"] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md022.md

### Added

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pipedream/sdk",
"type": "module",
"version": "1.5.2",
"version": "1.5.3",
"description": "Pipedream SDK",
"main": "./dist/server.js",
"module": "./dist/server.js",
Expand Down
10 changes: 9 additions & 1 deletion packages/sdk/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ export type ProxyTargetApiRequest = {
options: ProxyTargetApiOpts;
};

/**
* The parsed response body from a proxied API request.
*
* If the response has a Content-Type of application/json, the body will be parsed
* and returned as an object. Otherwise the type will be a string.
*/
export type ProxyResponse = Record<string, unknown> | string;

/**
* Creates a new instance of BackendClient with the provided options.
*
Expand Down Expand Up @@ -422,7 +430,7 @@ export class BackendClient extends BaseClient {
*
* @returns A promise resolving to the response from the downstream service
*/
public makeProxyRequest(proxyOptions: ProxyApiOpts, targetRequest: ProxyTargetApiRequest): Promise<string> {
public makeProxyRequest(proxyOptions: ProxyApiOpts, targetRequest: ProxyTargetApiRequest): Promise<ProxyResponse> {
const url64 = btoa(targetRequest.url).replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=+$/, "");
Expand Down
6 changes: 5 additions & 1 deletion packages/sdk/src/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1021,11 +1021,15 @@ export abstract class BaseClient {

const rawBody = await response.text();

DEBUG("status: ", response.status)
DEBUG("url: ", url.toString())
DEBUG("requestOptions: ", requestOptions)
DEBUG("rawBody: ", rawBody)

if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}, body: ${rawBody}`);
}

DEBUG(response.status, url.toString(), requestOptions, rawBody)
const contentType = response.headers.get("Content-Type");
if (contentType && contentType.includes("application/json")) {
try {
Expand Down
Loading