Skip to content

Commit ced1c1b

Browse files
authored
Biz/dj 2450 add getprojectinfo function to the sdk (#13968)
* Add getProjectInfo function * Bump version * Cleanup
1 parent a48cf80 commit ced1c1b

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

packages/sdk/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": "0.0.12",
3+
"version": "0.0.13",
44
"description": "Pipedream SDK",
55
"type": "module",
66
"main": "dist/server/index.js",

packages/sdk/src/server/index.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,28 @@ export type ConnectTokenCreateOpts = {
4848
external_user_id: string;
4949
};
5050

51+
export type AppInfo = {
52+
/**
53+
* ID of the app. Only applies for Oauth apps.
54+
*/
55+
id?: string;
56+
57+
/**
58+
* https://pipedream.com/docs/connect/quickstart#find-your-apps-name-slug
59+
*/
60+
name_slug: string;
61+
}
62+
63+
/**
64+
* Response received after requesting project info.
65+
*/
66+
export type ProjectInfoResponse = {
67+
/**
68+
* An array of apps linked to the project.
69+
*/
70+
apps: AppInfo[]
71+
}
72+
5173
/**
5274
* Response received after creating a connect token.
5375
*/
@@ -491,4 +513,10 @@ class ServerClient {
491513
method: "DELETE",
492514
});
493515
}
516+
517+
async getProjectInfo(): Promise<ProjectInfoResponse> {
518+
return this._makeConnectRequest<ProjectInfoResponse>("/projects/info", {
519+
method: "GET",
520+
});
521+
}
494522
}

0 commit comments

Comments
 (0)