@pipedream/google_drive 0.5.0 → 0.6.0

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,54 @@
1
+ import googleDrive from "../../google_drive.app.mjs";
2
+ import { getListFilesOpts } from "../../common/utils.mjs";
3
+
4
+ export default {
5
+ key: "google_drive-find-forms",
6
+ name: "Find Forms",
7
+ description: "List Google Form documents or search for a Form by name. [See the docs](https://developers.google.com/drive/api/v3/search-files) for more information",
8
+ version: "0.0.1",
9
+ type: "action",
10
+ props: {
11
+ googleDrive,
12
+ drive: {
13
+ propDefinition: [
14
+ googleDrive,
15
+ "watchedDrive",
16
+ ],
17
+ optional: true,
18
+ },
19
+ folderId: {
20
+ propDefinition: [
21
+ googleDrive,
22
+ "folderId",
23
+ (c) => ({
24
+ drive: c.drive,
25
+ }),
26
+ ],
27
+ label: "Parent Folder",
28
+ description: "The ID of the parent folder which contains the file. If not specified, it will list files from the drive's top-level folder.",
29
+ optional: true,
30
+ },
31
+ nameSearchTerm: {
32
+ propDefinition: [
33
+ googleDrive,
34
+ "fileNameSearchTerm",
35
+ ],
36
+ optional: true,
37
+ },
38
+ },
39
+ async run({ $ }) {
40
+ let q = "mimeType = 'application/vnd.google-apps.form'";
41
+ if (this.nameSearchTerm) {
42
+ q = `${q} and name contains '${this.nameSearchTerm}'`;
43
+ }
44
+ if (this.folderId) {
45
+ q = `${q} and "${this.folderId}" in parents`;
46
+ }
47
+ const opts = getListFilesOpts(this.drive, {
48
+ q: q.trim(),
49
+ });
50
+ const files = (await this.googleDrive.listFilesInPage(null, opts)).files;
51
+ $.export("$summary", `Successfully found ${files.length} form(s)`);
52
+ return files;
53
+ },
54
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/google_drive",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Pipedream Google_drive Components",
5
5
  "main": "google_drive.app.mjs",
6
6
  "keywords": [