Skip to content

Commit 209c25f

Browse files
fern-api[bot]jverceverhovskyJacob Pines
authored
Changes in component operations (#248)
* Run actions using a specific component version * Expose component key when retrieving deployed triggers * Associate workflow ID when deploying triggers * Filter component lists by emitter type (e.g. HTTP, Timer, etc.) * Replace type of component listing and retrieval with the new `Emitter` type --------- Co-authored-by: Jay Vercellone <jay@pipedream.com> Co-authored-by: Boris Verkhovskiy <boris@pipedream.com> Co-authored-by: Jacob Pines <jacob@pipedream.com>
1 parent 1c1c21c commit 209c25f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+427
-252
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ tests
44
.gitignore
55
.github
66
.fernignore
7+
.prettierrc.yml
78
biome.json
89
tsconfig.json
910
yarn.lock

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/sdk",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"private": false,
55
"repository": "github:PipedreamHQ/pipedream-sdk-typescript",
66
"type": "commonjs",
@@ -71,6 +71,9 @@
7171
],
7272
"scripts": {
7373
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
74+
"format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
75+
"lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
76+
"lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
7477
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
7578
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
7679
"build": "pnpm build:cjs && pnpm build:esm",
@@ -86,8 +89,8 @@
8689
"vitest": "^3.2.4",
8790
"msw": "2.11.2",
8891
"@types/node": "^18.19.70",
89-
"@biomejs/biome": "2.2.5",
90-
"typescript": "~5.7.2"
92+
"typescript": "~5.7.2",
93+
"@biomejs/biome": "2.2.5"
9194
},
9295
"browser": {
9396
"./dist/cjs/wrapper/utils/getBaseUrl.js": "./dist/cjs/wrapper/utils/getBaseUrl.browser.js",

pnpm-lock.yaml

Lines changed: 131 additions & 130 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/resources/accounts/client/Client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class Accounts {
8686
(await core.Supplier.get(this._options.baseUrl)) ??
8787
(await core.Supplier.get(this._options.environment)) ??
8888
environments.PipedreamEnvironment.Prod,
89-
`v1/connect/${encodeURIComponent(this._options.projectId)}/accounts`,
89+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/accounts`,
9090
),
9191
method: "GET",
9292
headers: _headers,
@@ -203,7 +203,7 @@ export class Accounts {
203203
(await core.Supplier.get(this._options.baseUrl)) ??
204204
(await core.Supplier.get(this._options.environment)) ??
205205
environments.PipedreamEnvironment.Prod,
206-
`v1/connect/${encodeURIComponent(this._options.projectId)}/accounts`,
206+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/accounts`,
207207
),
208208
method: "POST",
209209
headers: _headers,
@@ -309,7 +309,7 @@ export class Accounts {
309309
(await core.Supplier.get(this._options.baseUrl)) ??
310310
(await core.Supplier.get(this._options.environment)) ??
311311
environments.PipedreamEnvironment.Prod,
312-
`v1/connect/${encodeURIComponent(this._options.projectId)}/accounts/${encodeURIComponent(accountId)}`,
312+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/accounts/${core.url.encodePathParam(accountId)}`,
313313
),
314314
method: "GET",
315315
headers: _headers,
@@ -395,7 +395,7 @@ export class Accounts {
395395
(await core.Supplier.get(this._options.baseUrl)) ??
396396
(await core.Supplier.get(this._options.environment)) ??
397397
environments.PipedreamEnvironment.Prod,
398-
`v1/connect/${encodeURIComponent(this._options.projectId)}/accounts/${encodeURIComponent(accountId)}`,
398+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/accounts/${core.url.encodePathParam(accountId)}`,
399399
),
400400
method: "DELETE",
401401
headers: _headers,
@@ -472,7 +472,7 @@ export class Accounts {
472472
(await core.Supplier.get(this._options.baseUrl)) ??
473473
(await core.Supplier.get(this._options.environment)) ??
474474
environments.PipedreamEnvironment.Prod,
475-
`v1/connect/${encodeURIComponent(this._options.projectId)}/apps/${encodeURIComponent(appId)}/accounts`,
475+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/apps/${core.url.encodePathParam(appId)}/accounts`,
476476
),
477477
method: "DELETE",
478478
headers: _headers,

src/api/resources/actions/client/Client.ts

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class Actions {
7878
(await core.Supplier.get(this._options.baseUrl)) ??
7979
(await core.Supplier.get(this._options.environment)) ??
8080
environments.PipedreamEnvironment.Prod,
81-
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions`,
81+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions`,
8282
),
8383
method: "GET",
8484
headers: _headers,
@@ -148,24 +148,35 @@ export class Actions {
148148
* Get detailed configuration for a specific action by its key
149149
*
150150
* @param {string} componentId - The key that uniquely identifies the component (e.g., 'slack-send-message')
151+
* @param {Pipedream.ActionsRetrieveRequest} request
151152
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
152153
*
153154
* @throws {@link Pipedream.TooManyRequestsError}
154155
*
155156
* @example
156-
* await client.actions.retrieve("component_id")
157+
* await client.actions.retrieve("component_id", {
158+
* version: "1.2.3"
159+
* })
157160
*/
158161
public retrieve(
159162
componentId: string,
163+
request: Pipedream.ActionsRetrieveRequest = {},
160164
requestOptions?: Actions.RequestOptions,
161165
): core.HttpResponsePromise<Pipedream.GetComponentResponse> {
162-
return core.HttpResponsePromise.fromPromise(this.__retrieve(componentId, requestOptions));
166+
return core.HttpResponsePromise.fromPromise(this.__retrieve(componentId, request, requestOptions));
163167
}
164168

165169
private async __retrieve(
166170
componentId: string,
171+
request: Pipedream.ActionsRetrieveRequest = {},
167172
requestOptions?: Actions.RequestOptions,
168173
): Promise<core.WithRawResponse<Pipedream.GetComponentResponse>> {
174+
const { version } = request;
175+
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
176+
if (version != null) {
177+
_queryParams.version = version;
178+
}
179+
169180
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
170181
this._options?.headers,
171182
mergeOnlyDefinedHeaders({
@@ -179,11 +190,11 @@ export class Actions {
179190
(await core.Supplier.get(this._options.baseUrl)) ??
180191
(await core.Supplier.get(this._options.environment)) ??
181192
environments.PipedreamEnvironment.Prod,
182-
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions/${encodeURIComponent(componentId)}`,
193+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions/${core.url.encodePathParam(componentId)}`,
183194
),
184195
method: "GET",
185196
headers: _headers,
186-
queryParameters: requestOptions?.queryParams,
197+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
187198
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
188199
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
189200
abortSignal: requestOptions?.abortSignal,
@@ -272,7 +283,7 @@ export class Actions {
272283
(await core.Supplier.get(this._options.baseUrl)) ??
273284
(await core.Supplier.get(this._options.environment)) ??
274285
environments.PipedreamEnvironment.Prod,
275-
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions/configure`,
286+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions/configure`,
276287
),
277288
method: "POST",
278289
headers: _headers,
@@ -370,7 +381,7 @@ export class Actions {
370381
(await core.Supplier.get(this._options.baseUrl)) ??
371382
(await core.Supplier.get(this._options.environment)) ??
372383
environments.PipedreamEnvironment.Prod,
373-
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions/props`,
384+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions/props`,
374385
),
375386
method: "POST",
376387
headers: _headers,
@@ -468,7 +479,7 @@ export class Actions {
468479
(await core.Supplier.get(this._options.baseUrl)) ??
469480
(await core.Supplier.get(this._options.environment)) ??
470481
environments.PipedreamEnvironment.Prod,
471-
`v1/connect/${encodeURIComponent(this._options.projectId)}/actions/run`,
482+
`v1/connect/${core.url.encodePathParam(this._options.projectId)}/actions/run`,
472483
),
473484
method: "POST",
474485
headers: _headers,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
/**
4+
* @example
5+
* {
6+
* version: "1.2.3"
7+
* }
8+
*/
9+
export interface ActionsRetrieveRequest {
10+
/** Optional semantic version of the component to retrieve (for example '1.0.0') */
11+
version?: string;
12+
}

src/api/resources/actions/client/requests/RunActionOpts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import type * as Pipedream from "../../../../index.js";
1212
export interface RunActionOpts {
1313
/** The action component ID */
1414
id: string;
15+
/** Optional action component version (in SemVer format, for example '1.0.0'), defaults to latest */
16+
version?: string;
1517
/** The external user ID */
1618
externalUserId: string;
1719
configuredProps?: Pipedream.ConfiguredProps;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export type { ActionsListRequest } from "./ActionsListRequest.js";
2+
export type { ActionsRetrieveRequest } from "./ActionsRetrieveRequest.js";
23
export type { RunActionOpts } from "./RunActionOpts.js";

src/api/resources/appCategories/client/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class AppCategories {
133133
(await core.Supplier.get(this._options.baseUrl)) ??
134134
(await core.Supplier.get(this._options.environment)) ??
135135
environments.PipedreamEnvironment.Prod,
136-
`v1/connect/app_categories/${encodeURIComponent(id)}`,
136+
`v1/connect/app_categories/${core.url.encodePathParam(id)}`,
137137
),
138138
method: "GET",
139139
headers: _headers,

src/api/resources/apps/client/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class Apps {
183183
(await core.Supplier.get(this._options.baseUrl)) ??
184184
(await core.Supplier.get(this._options.environment)) ??
185185
environments.PipedreamEnvironment.Prod,
186-
`v1/connect/apps/${encodeURIComponent(appId)}`,
186+
`v1/connect/apps/${core.url.encodePathParam(appId)}`,
187187
),
188188
method: "GET",
189189
headers: _headers,

0 commit comments

Comments
 (0)