Skip to content

Commit 1df4643

Browse files
committed
Add getProjectInfo function
1 parent ae48681 commit 1df4643

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

packages/sdk/src/server/index.ts

Lines changed: 29 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,11 @@ 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
}
523+

0 commit comments

Comments
 (0)