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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ tests
.gitignore
.github
.fernignore
.prettierrc.yml
biome.json
tsconfig.json
yarn.lock
Expand Down
9 changes: 6 additions & 3 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.2.0",
"private": false,
"repository": "github:PipedreamHQ/pipedream-sdk-typescript",
"type": "commonjs",
Expand Down Expand Up @@ -71,6 +71,9 @@
],
"scripts": {
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"lint:fix": "biome lint --fix --unsafe --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",
Expand All @@ -86,8 +89,8 @@
"vitest": "^3.2.4",
"msw": "2.11.2",
"@types/node": "^18.19.70",
"@biomejs/biome": "2.2.5",
"typescript": "~5.7.2"
"typescript": "~5.7.2",
"@biomejs/biome": "2.2.5"
},
"browser": {
"./dist/cjs/wrapper/utils/getBaseUrl.js": "./dist/cjs/wrapper/utils/getBaseUrl.browser.js",
Expand Down
261 changes: 131 additions & 130 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/api/resources/accounts/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class Accounts {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/accounts`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/accounts`,
),
method: "GET",
headers: _headers,
Expand Down Expand Up @@ -203,7 +203,7 @@ export class Accounts {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/accounts`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/accounts`,
),
method: "POST",
headers: _headers,
Expand Down Expand Up @@ -309,7 +309,7 @@ export class Accounts {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/accounts/${encodeURIComponent(accountId)}`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/accounts/${core.url.encodePathParam(accountId)}`,
),
method: "GET",
headers: _headers,
Expand Down Expand Up @@ -395,7 +395,7 @@ export class Accounts {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/accounts/${encodeURIComponent(accountId)}`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/accounts/${core.url.encodePathParam(accountId)}`,
),
method: "DELETE",
headers: _headers,
Expand Down Expand Up @@ -472,7 +472,7 @@ export class Accounts {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/apps/${encodeURIComponent(appId)}/accounts`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/apps/${core.url.encodePathParam(appId)}/accounts`,
),
method: "DELETE",
headers: _headers,
Expand Down
27 changes: 19 additions & 8 deletions src/api/resources/actions/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class Actions {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions`,
),
method: "GET",
headers: _headers,
Expand Down Expand Up @@ -148,24 +148,35 @@ export class Actions {
* Get detailed configuration for a specific action by its key
*
* @param {string} componentId - The key that uniquely identifies the component (e.g., 'slack-send-message')
* @param {Pipedream.ActionsRetrieveRequest} request
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Pipedream.TooManyRequestsError}
*
* @example
* await client.actions.retrieve("component_id")
* await client.actions.retrieve("component_id", {
* version: "1.2.3"
* })
*/
public retrieve(
componentId: string,
request: Pipedream.ActionsRetrieveRequest = {},
requestOptions?: Actions.RequestOptions,
): core.HttpResponsePromise<Pipedream.GetComponentResponse> {
return core.HttpResponsePromise.fromPromise(this.__retrieve(componentId, requestOptions));
return core.HttpResponsePromise.fromPromise(this.__retrieve(componentId, request, requestOptions));
}

private async __retrieve(
componentId: string,
request: Pipedream.ActionsRetrieveRequest = {},
requestOptions?: Actions.RequestOptions,
): Promise<core.WithRawResponse<Pipedream.GetComponentResponse>> {
const { version } = request;
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
if (version != null) {
_queryParams.version = version;
}

const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
this._options?.headers,
mergeOnlyDefinedHeaders({
Expand All @@ -179,11 +190,11 @@ export class Actions {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions/${encodeURIComponent(componentId)}`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions/${core.url.encodePathParam(componentId)}`,
),
method: "GET",
headers: _headers,
queryParameters: requestOptions?.queryParams,
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
Expand Down Expand Up @@ -272,7 +283,7 @@ export class Actions {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions/configure`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions/configure`,
),
method: "POST",
headers: _headers,
Expand Down Expand Up @@ -370,7 +381,7 @@ export class Actions {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions/props`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions/props`,
),
method: "POST",
headers: _headers,
Expand Down Expand Up @@ -468,7 +479,7 @@ export class Actions {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions/run`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions/run`,
),
method: "POST",
headers: _headers,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This file was auto-generated by Fern from our API Definition.

/**
* @example
* {
* version: "1.2.3"
* }
*/
export interface ActionsRetrieveRequest {
/** Optional semantic version of the component to retrieve (for example '1.0.0') */
version?: string;
}
2 changes: 2 additions & 0 deletions src/api/resources/actions/client/requests/RunActionOpts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import type * as Pipedream from "../../../../index.js";
export interface RunActionOpts {
/** The action component ID */
id: string;
/** Optional action component version (in SemVer format, for example '1.0.0'), defaults to latest */
version?: string;
/** The external user ID */
externalUserId: string;
configuredProps?: Pipedream.ConfiguredProps;
Expand Down
1 change: 1 addition & 0 deletions src/api/resources/actions/client/requests/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export type { ActionsListRequest } from "./ActionsListRequest.js";
export type { ActionsRetrieveRequest } from "./ActionsRetrieveRequest.js";
export type { RunActionOpts } from "./RunActionOpts.js";
2 changes: 1 addition & 1 deletion src/api/resources/appCategories/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class AppCategories {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/app_categories/${encodeURIComponent(id)}`,
`v1/connect/app_categories/${core.url.encodePathParam(id)}`,
),
method: "GET",
headers: _headers,
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/apps/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class Apps {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/apps/${encodeURIComponent(appId)}`,
`v1/connect/apps/${core.url.encodePathParam(appId)}`,
),
method: "GET",
headers: _headers,
Expand Down
25 changes: 18 additions & 7 deletions src/api/resources/components/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class Components {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/components`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/components`,
),
method: "GET",
headers: _headers,
Expand Down Expand Up @@ -155,24 +155,35 @@ export class Components {
* Get detailed configuration for a specific component by its key
*
* @param {string} componentId - The key that uniquely identifies the component (e.g., 'slack-send-message')
* @param {Pipedream.ComponentsRetrieveRequest} request
* @param {Components.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Pipedream.TooManyRequestsError}
*
* @example
* await client.components.retrieve("component_id")
* await client.components.retrieve("component_id", {
* version: "1.2.3"
* })
*/
public retrieve(
componentId: string,
request: Pipedream.ComponentsRetrieveRequest = {},
requestOptions?: Components.RequestOptions,
): core.HttpResponsePromise<Pipedream.GetComponentResponse> {
return core.HttpResponsePromise.fromPromise(this.__retrieve(componentId, requestOptions));
return core.HttpResponsePromise.fromPromise(this.__retrieve(componentId, request, requestOptions));
}

private async __retrieve(
componentId: string,
request: Pipedream.ComponentsRetrieveRequest = {},
requestOptions?: Components.RequestOptions,
): Promise<core.WithRawResponse<Pipedream.GetComponentResponse>> {
const { version } = request;
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
if (version != null) {
_queryParams.version = version;
}

const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
this._options?.headers,
mergeOnlyDefinedHeaders({
Expand All @@ -186,11 +197,11 @@ export class Components {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/components/${encodeURIComponent(componentId)}`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/components/${core.url.encodePathParam(componentId)}`,
),
method: "GET",
headers: _headers,
queryParameters: requestOptions?.queryParams,
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
Expand Down Expand Up @@ -279,7 +290,7 @@ export class Components {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/components/configure`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/components/configure`,
),
method: "POST",
headers: _headers,
Expand Down Expand Up @@ -377,7 +388,7 @@ export class Components {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.PipedreamEnvironment.Prod,
`v1/connect/${encodeURIComponent(this._options.projectId)}/components/props`,
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/components/props`,
),
method: "POST",
headers: _headers,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This file was auto-generated by Fern from our API Definition.

/**
* @example
* {
* version: "1.2.3"
* }
*/
export interface ComponentsRetrieveRequest {
/** Optional semantic version of the component to retrieve (for example '1.0.0') */
version?: string;
}
1 change: 1 addition & 0 deletions src/api/resources/components/client/requests/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export type { ComponentsListRequest } from "./ComponentsListRequest.js";
export type { ComponentsRetrieveRequest } from "./ComponentsRetrieveRequest.js";
Loading