Skip to content

Commit 49eeb03

Browse files
Apps listing and project settings improvements (#296)
* Add support for the `has_components`, `has_actions` and `has_triggers` existing query params to filter apps listings * Add support for the new `connect_require_key_auth_test` project setting, which verifies that new accounts for key-based apps are tested before creation. --------- Co-authored-by: Jay Vercellone <[email protected]>
1 parent 89c5840 commit 49eeb03

File tree

11 files changed

+66
-7
lines changed

11 files changed

+66
-7
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,10 @@ const response = await client.apps.list({
490490
limit: 1,
491491
q: "q",
492492
sortKey: "name",
493-
sortDirection: "asc"
493+
sortDirection: "asc",
494+
hasComponents: true,
495+
hasActions: true,
496+
hasTriggers: true
494497
});
495498
for await (const item of response) {
496499
console.log(item);
@@ -503,7 +506,10 @@ let page = await client.apps.list({
503506
limit: 1,
504507
q: "q",
505508
sortKey: "name",
506-
sortDirection: "asc"
509+
sortDirection: "asc",
510+
hasComponents: true,
511+
hasActions: true,
512+
hasTriggers: true
507513
});
508514
while (page.hasNextPage()) {
509515
page = page.getNextPage();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/sdk",
3-
"version": "2.3.3",
3+
"version": "2.3.4",
44
"private": false,
55
"repository": "github:PipedreamHQ/pipedream-sdk-typescript",
66
"type": "commonjs",

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export class Apps {
3636
* limit: 1,
3737
* q: "q",
3838
* sortKey: "name",
39-
* sortDirection: "asc"
39+
* sortDirection: "asc",
40+
* hasComponents: true,
41+
* hasActions: true,
42+
* hasTriggers: true
4043
* })
4144
*/
4245
public async list(
@@ -45,7 +48,18 @@ export class Apps {
4548
): Promise<core.Page<Pipedream.App>> {
4649
const list = core.HttpResponsePromise.interceptFunction(
4750
async (request: Pipedream.AppsListRequest): Promise<core.WithRawResponse<Pipedream.ListAppsResponse>> => {
48-
const { after, before, limit, q, sortKey, sortDirection, categoryIds } = request;
51+
const {
52+
after,
53+
before,
54+
limit,
55+
q,
56+
sortKey,
57+
sortDirection,
58+
categoryIds,
59+
hasComponents,
60+
hasActions,
61+
hasTriggers,
62+
} = request;
4963
const _queryParams: Record<string, string | string[] | object | object[] | null> = {};
5064
if (after != null) {
5165
_queryParams.after = after;
@@ -78,6 +92,15 @@ export class Apps {
7892
_queryParams.category_ids = categoryIds;
7993
}
8094
}
95+
if (hasComponents != null) {
96+
_queryParams.has_components = hasComponents.toString();
97+
}
98+
if (hasActions != null) {
99+
_queryParams.has_actions = hasActions.toString();
100+
}
101+
if (hasTriggers != null) {
102+
_queryParams.has_triggers = hasTriggers.toString();
103+
}
81104
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
82105
this._options?.headers,
83106
mergeOnlyDefinedHeaders({

src/api/resources/apps/client/requests/AppsListRequest.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import type * as Pipedream from "../../../../index.js";
1010
* limit: 1,
1111
* q: "q",
1212
* sortKey: "name",
13-
* sortDirection: "asc"
13+
* sortDirection: "asc",
14+
* hasComponents: true,
15+
* hasActions: true,
16+
* hasTriggers: true
1417
* }
1518
*/
1619
export interface AppsListRequest {
@@ -28,4 +31,10 @@ export interface AppsListRequest {
2831
sortDirection?: Pipedream.AppsListRequestSortDirection;
2932
/** Only return apps in these categories */
3033
categoryIds?: string | string[];
34+
/** Filter to apps that have components (actions or triggers) */
35+
hasComponents?: boolean;
36+
/** Filter to apps that have actions */
37+
hasActions?: boolean;
38+
/** Filter to apps that have triggers */
39+
hasTriggers?: boolean;
3140
}

src/api/resources/projects/client/requests/CreateProjectOpts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ export interface CreateProjectOpts {
1313
appName?: string;
1414
/** Support email displayed to end users */
1515
supportEmail?: string;
16+
/** Send a test request to the upstream API when adding Connect accounts for key-based apps */
17+
connectRequireKeyAuthTest?: boolean;
1618
}

src/api/resources/projects/client/requests/UpdateProjectOpts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ export interface UpdateProjectOpts {
1111
appName?: string;
1212
/** Support email displayed to end users */
1313
supportEmail?: string;
14+
/** Send a test request to the upstream API when adding Connect accounts for key-based apps */
15+
connectRequireKeyAuthTest?: boolean;
1416
}

src/api/types/Project.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ export interface Project {
1212
appName?: string;
1313
/** Support email configured for the project */
1414
supportEmail?: string;
15+
/** Send a test request to the upstream API when adding Connect accounts for key-based apps */
16+
connectRequireKeyAuthTest?: boolean;
1517
}

src/serialization/resources/projects/client/requests/CreateProjectOpts.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ export const CreateProjectOpts: core.serialization.Schema<
1111
name: core.serialization.string(),
1212
appName: core.serialization.property("app_name", core.serialization.string().optional()),
1313
supportEmail: core.serialization.property("support_email", core.serialization.string().optional()),
14+
connectRequireKeyAuthTest: core.serialization.property(
15+
"connect_require_key_auth_test",
16+
core.serialization.boolean().optional(),
17+
),
1418
});
1519

1620
export declare namespace CreateProjectOpts {
1721
export interface Raw {
1822
name: string;
1923
app_name?: string | null;
2024
support_email?: string | null;
25+
connect_require_key_auth_test?: boolean | null;
2126
}
2227
}

src/serialization/resources/projects/client/requests/UpdateProjectOpts.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ export const UpdateProjectOpts: core.serialization.Schema<
1111
name: core.serialization.string().optional(),
1212
appName: core.serialization.property("app_name", core.serialization.string().optional()),
1313
supportEmail: core.serialization.property("support_email", core.serialization.string().optional()),
14+
connectRequireKeyAuthTest: core.serialization.property(
15+
"connect_require_key_auth_test",
16+
core.serialization.boolean().optional(),
17+
),
1418
});
1519

1620
export declare namespace UpdateProjectOpts {
1721
export interface Raw {
1822
name?: string | null;
1923
app_name?: string | null;
2024
support_email?: string | null;
25+
connect_require_key_auth_test?: boolean | null;
2126
}
2227
}

src/serialization/types/Project.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export const Project: core.serialization.ObjectSchema<serializers.Project.Raw, P
1010
name: core.serialization.string(),
1111
appName: core.serialization.property("app_name", core.serialization.string().optional()),
1212
supportEmail: core.serialization.property("support_email", core.serialization.string().optional()),
13+
connectRequireKeyAuthTest: core.serialization.property(
14+
"connect_require_key_auth_test",
15+
core.serialization.boolean().optional(),
16+
),
1317
});
1418

1519
export declare namespace Project {
@@ -18,5 +22,6 @@ export declare namespace Project {
1822
name: string;
1923
app_name?: string | null;
2024
support_email?: string | null;
25+
connect_require_key_auth_test?: boolean | null;
2126
}
2227
}

0 commit comments

Comments
 (0)