@pipedream/google_drive 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import googleDrive from "../../google_drive.app.mjs";
|
|
2
|
+
|
|
3
|
+
const ABOUT_FIELDS = "user,storageQuota";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
key: "google_drive-get-current-user",
|
|
7
|
+
name: "Get Current User",
|
|
8
|
+
description: "Retrieve Google Drive account metadata for the authenticated user via `about.get`, including display name, email, permission ID, and storage quota. Useful when flows or agents need to confirm the active Google identity or understand available storage. [See the documentation](https://developers.google.com/drive/api/v3/reference/about/get).",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
annotations: {
|
|
12
|
+
destructiveHint: false,
|
|
13
|
+
openWorldHint: true,
|
|
14
|
+
readOnlyHint: true,
|
|
15
|
+
},
|
|
16
|
+
props: {
|
|
17
|
+
googleDrive,
|
|
18
|
+
},
|
|
19
|
+
async run({ $ }) {
|
|
20
|
+
const about = await this.googleDrive.getAbout(ABOUT_FIELDS);
|
|
21
|
+
|
|
22
|
+
const summaryName =
|
|
23
|
+
about?.user?.displayName
|
|
24
|
+
|| about?.user?.emailAddress
|
|
25
|
+
|| about?.user?.permissionId;
|
|
26
|
+
$.export("$summary", `Retrieved Google Drive user ${summaryName}`);
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
about,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
};
|