@pipedream/google_drive 0.6.16 → 0.6.18
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.
- package/README.md +9 -8
- package/actions/add-file-sharing-preference/add-file-sharing-preference.mjs +1 -1
- package/actions/copy-file/copy-file.mjs +1 -1
- package/actions/create-file/create-file.mjs +1 -1
- package/actions/create-file-from-template/create-file-from-template.mjs +1 -1
- package/actions/create-file-from-text/create-file-from-text.mjs +1 -1
- package/actions/create-folder/create-folder.mjs +1 -1
- package/actions/create-shared-drive/create-shared-drive.mjs +1 -1
- package/actions/delete-file/delete-file.mjs +1 -1
- package/actions/delete-shared-drive/delete-shared-drive.mjs +1 -1
- package/actions/download-file/download-file.mjs +1 -1
- package/actions/find-file/find-file.mjs +1 -1
- package/actions/find-folder/find-folder.mjs +1 -1
- package/actions/find-forms/find-forms.mjs +1 -1
- package/actions/find-spreadsheets/find-spreadsheets.mjs +1 -1
- package/actions/get-folder-id-for-path/get-folder-id-for-path.mjs +1 -1
- package/actions/get-shared-drive/get-shared-drive.mjs +1 -1
- package/actions/list-files/list-files.mjs +21 -2
- package/actions/move-file/move-file.mjs +1 -1
- package/actions/move-file-to-trash/move-file-to-trash.mjs +1 -1
- package/actions/replace-file/replace-file.mjs +1 -1
- package/actions/search-shared-drives/search-shared-drives.mjs +1 -1
- package/actions/update-file/update-file.mjs +1 -1
- package/actions/update-shared-drive/update-shared-drive.mjs +1 -1
- package/actions/upload-file/upload-file.mjs +1 -1
- package/google_drive.app.mjs +5 -3
- package/package.json +3 -1
- package/sources/changes-to-specific-files/changes-to-specific-files.mjs +1 -1
- package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs +1 -1
- package/sources/new-files-instant/new-files-instant.mjs +1 -1
- package/sources/new-or-modified-comments/new-or-modified-comments.mjs +1 -1
- package/sources/new-or-modified-files/new-or-modified-files.mjs +1 -1
- package/sources/new-or-modified-folders/new-or-modified-folders.mjs +1 -1
- package/sources/new-shared-drive/new-shared-drive.mjs +1 -1
- package/sources/new-spreadsheet/new-spreadsheet.mjs +1 -1
package/README.md
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# Overview
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
-
|
8
|
-
|
9
|
-
-
|
10
|
-
|
3
|
+
The Google Drive API on Pipedream allows you to automate various file management tasks, such as creating, reading, updating, and deleting files within your Google Drive. You can also share files, manage permissions, and monitor changes to files and folders. This opens up possibilities for creating workflows that seamlessly integrate with other apps and services, streamlining document handling, backup processes, and collaborative workflows.
|
4
|
+
|
5
|
+
# Example Use Cases
|
6
|
+
|
7
|
+
- **Automated Backup to Google Drive**: Create a workflow on Pipedream that triggers at regular intervals to back up important files from your company’s server to a designated Google Drive folder. This workflow can ensure that your data is regularly saved to a secure, cloud-based location without manual intervention.
|
8
|
+
|
9
|
+
- **Content Approval Process**: Streamline the content approval process by setting up a Pipedream workflow that watches for new files in a Google Drive "Pending Approval" folder. When a new file is detected, an email or message can be sent to the approver using an app like Gmail or Slack. Once reviewed, the file can be moved to an "Approved" folder automatically if certain conditions are met.
|
10
|
+
|
11
|
+
- **Synchronize Files Across Cloud Platforms**: Build a workflow on Pipedream that monitors a specific folder in Google Drive for new files and automatically replicates them to another cloud storage service, such as Dropbox or OneDrive. This ensures that your files are accessible across different platforms and kept in sync without needing to upload them to each service manually.
|
11
12
|
|
12
13
|
# Troubleshooting
|
13
14
|
|
@@ -11,7 +11,7 @@ export default {
|
|
11
11
|
name: "Add File Sharing Preference",
|
12
12
|
description:
|
13
13
|
"Add a [sharing](https://support.google.com/drive/answer/7166529) permission to the sharing preferences of a file or folder and provide a sharing URL. [See the docs](https://developers.google.com/drive/api/v3/reference/permissions/create) for more information",
|
14
|
-
version: "0.1.
|
14
|
+
version: "0.1.3",
|
15
15
|
type: "action",
|
16
16
|
props: {
|
17
17
|
googleDrive,
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
key: "google_drive-copy-file",
|
5
5
|
name: "Copy File",
|
6
6
|
description: "Create a copy of the specified file. [See the docs](https://developers.google.com/drive/api/v3/reference/files/copy) for more information",
|
7
|
-
version: "0.1.
|
7
|
+
version: "0.1.2",
|
8
8
|
type: "action",
|
9
9
|
props: {
|
10
10
|
googleDrive,
|
@@ -7,7 +7,7 @@ export default {
|
|
7
7
|
key: "google_drive-create-file",
|
8
8
|
name: "Create a New File",
|
9
9
|
description: "Create a new file from a URL or /tmp/filepath. [See the docs](https://developers.google.com/drive/api/v3/reference/files/create) for more information",
|
10
|
-
version: "0.1.
|
10
|
+
version: "0.1.4",
|
11
11
|
type: "action",
|
12
12
|
props: {
|
13
13
|
googleDrive,
|
@@ -8,7 +8,7 @@ export default {
|
|
8
8
|
key: "google_drive-create-file-from-template",
|
9
9
|
name: "Create New File From Template",
|
10
10
|
description: "Create a new Google Docs file from a template. Optionally include placeholders in the template document that will get replaced from this action. [See documentation](https://www.npmjs.com/package/google-docs-mustaches)",
|
11
|
-
version: "0.1.
|
11
|
+
version: "0.1.2",
|
12
12
|
type: "action",
|
13
13
|
props: {
|
14
14
|
googleDrive,
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
key: "google_drive-create-file-from-text",
|
6
6
|
name: "Create New File From Text",
|
7
7
|
description: "Create a new file from plain text. [See the docs](https://developers.google.com/drive/api/v3/reference/files/create) for more information",
|
8
|
-
version: "0.1.
|
8
|
+
version: "0.1.2",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
googleDrive,
|
@@ -13,7 +13,7 @@ export default {
|
|
13
13
|
key: "google_drive-create-folder",
|
14
14
|
name: "Create Folder",
|
15
15
|
description: "Create a new empty folder. [See the docs](https://developers.google.com/drive/api/v3/reference/files/create) for more information",
|
16
|
-
version: "0.1.
|
16
|
+
version: "0.1.2",
|
17
17
|
type: "action",
|
18
18
|
props: {
|
19
19
|
googleDrive,
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
key: "google_drive-create-shared-drive",
|
5
5
|
name: "Create Shared Drive",
|
6
6
|
description: "Create a new shared drive. [See the docs](https://developers.google.com/drive/api/v3/reference/drives/create) for more information",
|
7
|
-
version: "0.1.
|
7
|
+
version: "0.1.2",
|
8
8
|
type: "action",
|
9
9
|
props: {
|
10
10
|
googleDrive,
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
name: "Delete File",
|
6
6
|
description:
|
7
7
|
"Permanently delete a file or folder without moving it to the trash. [See the docs](https://developers.google.com/drive/api/v3/reference/files/delete) for more information",
|
8
|
-
version: "0.1.
|
8
|
+
version: "0.1.2",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
googleDrive,
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
key: "google_drive-delete-shared-drive",
|
5
5
|
name: "Delete Shared Drive",
|
6
6
|
description: "Delete a shared drive without any content. [See the docs](https://developers.google.com/drive/api/v3/reference/drives/delete) for more information",
|
7
|
-
version: "0.1.
|
7
|
+
version: "0.1.2",
|
8
8
|
type: "action",
|
9
9
|
props: {
|
10
10
|
googleDrive,
|
@@ -18,7 +18,7 @@ export default {
|
|
18
18
|
key: "google_drive-download-file",
|
19
19
|
name: "Download File",
|
20
20
|
description: "Download a file. [See the docs](https://developers.google.com/drive/api/v3/manage-downloads) for more information",
|
21
|
-
version: "0.1.
|
21
|
+
version: "0.1.2",
|
22
22
|
type: "action",
|
23
23
|
props: {
|
24
24
|
googleDrive,
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
key: "google_drive-find-file",
|
6
6
|
name: "Find File",
|
7
7
|
description: "Search for a specific file by name. [See the docs](https://developers.google.com/drive/api/v3/search-files) for more information",
|
8
|
-
version: "0.1.
|
8
|
+
version: "0.1.2",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
googleDrive,
|
@@ -7,7 +7,7 @@ export default {
|
|
7
7
|
key: "google_drive-find-folder",
|
8
8
|
name: "Find Folder",
|
9
9
|
description: "Search for a specific folder by name. [See the docs](https://developers.google.com/drive/api/v3/search-files) for more information",
|
10
|
-
version: "0.1.
|
10
|
+
version: "0.1.2",
|
11
11
|
type: "action",
|
12
12
|
props: {
|
13
13
|
googleDrive,
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
key: "google_drive-find-forms",
|
6
6
|
name: "Find Forms",
|
7
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.
|
8
|
+
version: "0.0.3",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
googleDrive,
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
key: "google_drive-find-spreadsheets",
|
6
6
|
name: "Find Spreadsheets",
|
7
7
|
description: "Search for a specific spreadsheet by name. [See the docs](https://developers.google.com/drive/api/v3/search-files) for more information",
|
8
|
-
version: "0.1.
|
8
|
+
version: "0.1.2",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
googleDrive,
|
@@ -12,7 +12,7 @@ export default {
|
|
12
12
|
key: "google_drive-get-folder-id-for-path",
|
13
13
|
name: "Get Folder ID for a Path",
|
14
14
|
description: "Retrieve a folderId for a path. [See the docs](https://developers.google.com/drive/api/v3/search-files) for more information",
|
15
|
-
version: "0.1.
|
15
|
+
version: "0.1.2",
|
16
16
|
type: "action",
|
17
17
|
props: {
|
18
18
|
googleDrive,
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
key: "google_drive-get-shared-drive",
|
5
5
|
name: "Get Shared Drive",
|
6
6
|
description: "Get a shared drive's metadata by ID. [See the docs](https://developers.google.com/drive/api/v3/reference/drives/get) for more information",
|
7
|
-
version: "0.1.
|
7
|
+
version: "0.1.2",
|
8
8
|
type: "action",
|
9
9
|
props: {
|
10
10
|
googleDrive,
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
key: "google_drive-list-files",
|
6
6
|
name: "List Files",
|
7
7
|
description: "List files from a specific folder. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/list) for more information",
|
8
|
-
version: "0.1.
|
8
|
+
version: "0.1.6",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
googleDrive,
|
@@ -39,6 +39,7 @@ export default {
|
|
39
39
|
description: "Filter by file name that contains a specific text",
|
40
40
|
type: "string",
|
41
41
|
optional: true,
|
42
|
+
reloadProps: true,
|
42
43
|
},
|
43
44
|
trashed: {
|
44
45
|
label: "Trashed",
|
@@ -47,6 +48,22 @@ export default {
|
|
47
48
|
optional: true,
|
48
49
|
},
|
49
50
|
},
|
51
|
+
async additionalProps() {
|
52
|
+
const props = {};
|
53
|
+
if (this.filterText) {
|
54
|
+
props.filterType = {
|
55
|
+
type: "string",
|
56
|
+
label: "Filter Type",
|
57
|
+
description: "Whether to return files with names containing the Filter Text or files with names that match the Filter Text exactly. Defaults to \"CONTAINS\"",
|
58
|
+
options: [
|
59
|
+
"CONTAINS",
|
60
|
+
"EXACT MATCH",
|
61
|
+
],
|
62
|
+
default: "CONTAINS",
|
63
|
+
};
|
64
|
+
}
|
65
|
+
return props;
|
66
|
+
},
|
50
67
|
async run({ $ }) {
|
51
68
|
const opts = getListFilesOpts(this.drive, {
|
52
69
|
q: "",
|
@@ -57,7 +74,9 @@ export default {
|
|
57
74
|
if (this.filterText) {
|
58
75
|
opts.q += `${opts.q
|
59
76
|
? " AND "
|
60
|
-
: ""}name
|
77
|
+
: ""}name ${this.filterType === "CONTAINS"
|
78
|
+
? "contains"
|
79
|
+
: "="} '${this.filterText}'`;
|
61
80
|
}
|
62
81
|
if (typeof this.trashed !== "undefined") {
|
63
82
|
opts.q += `${opts.q
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
key: "google_drive-move-file",
|
5
5
|
name: "Move File",
|
6
6
|
description: "Move a file from one folder to another. [See the docs](https://developers.google.com/drive/api/v3/reference/files/update) for more information",
|
7
|
-
version: "0.1.
|
7
|
+
version: "0.1.2",
|
8
8
|
type: "action",
|
9
9
|
props: {
|
10
10
|
googleDrive,
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
key: "google_drive-move-file-to-trash",
|
6
6
|
name: "Move File to Trash",
|
7
7
|
description: "Move a file or folder to trash. [See the docs](https://developers.google.com/drive/api/v3/reference/files/update) for more information",
|
8
|
-
version: "0.1.
|
8
|
+
version: "0.1.2",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
googleDrive,
|
@@ -15,7 +15,7 @@ export default {
|
|
15
15
|
key: "google_drive-replace-file",
|
16
16
|
name: "Replace File",
|
17
17
|
description: "Upload a file that replaces an existing file. [See the docs](https://developers.google.com/drive/api/v3/reference/files/update) for more information",
|
18
|
-
version: "0.1.
|
18
|
+
version: "0.1.2",
|
19
19
|
type: "action",
|
20
20
|
props: {
|
21
21
|
googleDrive,
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
key: "google_drive-search-shared-drives",
|
5
5
|
name: "Search for Shared Drives",
|
6
6
|
description: "Search for shared drives with query options. [See the docs](https://developers.google.com/drive/api/v3/search-shareddrives) for more information",
|
7
|
-
version: "0.1.
|
7
|
+
version: "0.1.2",
|
8
8
|
type: "action",
|
9
9
|
props: {
|
10
10
|
googleDrive,
|
@@ -8,7 +8,7 @@ export default {
|
|
8
8
|
key: "google_drive-update-file",
|
9
9
|
name: "Update File",
|
10
10
|
description: "Update a file's metadata and/or content. [See the docs](https://developers.google.com/drive/api/v3/reference/files/update) for more information",
|
11
|
-
version: "0.1.
|
11
|
+
version: "0.1.2",
|
12
12
|
type: "action",
|
13
13
|
props: {
|
14
14
|
googleDrive,
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
key: "google_drive-update-shared-drive",
|
5
5
|
name: "Update Shared Drive",
|
6
6
|
description: "Update an existing shared drive. [See the docs](https://developers.google.com/drive/api/v3/reference/drives/update) for more information",
|
7
|
-
version: "0.1.
|
7
|
+
version: "0.1.2",
|
8
8
|
type: "action",
|
9
9
|
props: {
|
10
10
|
googleDrive,
|
@@ -10,7 +10,7 @@ export default {
|
|
10
10
|
key: "google_drive-upload-file",
|
11
11
|
name: "Upload File",
|
12
12
|
description: "Copy an existing file to Google Drive. [See the docs](https://developers.google.com/drive/api/v3/manage-uploads) for more information",
|
13
|
-
version: "0.1.
|
13
|
+
version: "0.1.4",
|
14
14
|
type: "action",
|
15
15
|
props: {
|
16
16
|
googleDrive,
|
package/google_drive.app.mjs
CHANGED
@@ -851,16 +851,16 @@ export default {
|
|
851
851
|
await this.stopNotifications(channelID, resourceId);
|
852
852
|
},
|
853
853
|
async renewSubscription(drive, subscription, url, channelID, pageToken) {
|
854
|
-
const newChannelID = channelID || uuid();
|
855
854
|
const driveId = this.getDriveId(drive);
|
856
855
|
const newPageToken = pageToken || (await this.getPageToken(driveId));
|
857
856
|
|
858
857
|
const {
|
859
858
|
expiration,
|
860
859
|
resourceId,
|
860
|
+
newChannelID,
|
861
861
|
} = await this.checkResubscription(
|
862
862
|
subscription,
|
863
|
-
|
863
|
+
channelID,
|
864
864
|
newPageToken,
|
865
865
|
url,
|
866
866
|
drive,
|
@@ -880,6 +880,7 @@ export default {
|
|
880
880
|
endpoint,
|
881
881
|
drive,
|
882
882
|
) {
|
883
|
+
const newChannelID = uuid();
|
883
884
|
const driveId = this.getDriveId(drive);
|
884
885
|
if (subscription && subscription.resourceId) {
|
885
886
|
console.log(
|
@@ -893,7 +894,7 @@ export default {
|
|
893
894
|
expiration,
|
894
895
|
resourceId,
|
895
896
|
} = await this.watchDrive(
|
896
|
-
|
897
|
+
newChannelID,
|
897
898
|
endpoint,
|
898
899
|
pageToken,
|
899
900
|
driveId,
|
@@ -901,6 +902,7 @@ export default {
|
|
901
902
|
return {
|
902
903
|
expiration,
|
903
904
|
resourceId,
|
905
|
+
newChannelID,
|
904
906
|
};
|
905
907
|
},
|
906
908
|
async renewFileSubscription(subscription, url, channelID, fileId, nextRunTimestamp) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pipedream/google_drive",
|
3
|
-
"version": "0.6.
|
3
|
+
"version": "0.6.18",
|
4
4
|
"description": "Pipedream Google_drive Components",
|
5
5
|
"main": "google_drive.app.mjs",
|
6
6
|
"keywords": [
|
@@ -13,6 +13,8 @@
|
|
13
13
|
"@googleapis/drive": "^2.3.0",
|
14
14
|
"@pipedream/platform": "^1.4.0",
|
15
15
|
"cron-parser": "^4.9.0",
|
16
|
+
"google-docs-mustaches": "^1.2.2",
|
17
|
+
"got": "13.0.0",
|
16
18
|
"lodash": "^4.17.21",
|
17
19
|
"mime-db": "^1.51.0",
|
18
20
|
"uuid": "^8.3.2"
|
@@ -17,7 +17,7 @@ export default {
|
|
17
17
|
key: "google_drive-changes-to-specific-files",
|
18
18
|
name: "Changes to Specific Files",
|
19
19
|
description: "Watches for changes to specific files, emitting an event any time a change is made to one of those files. To watch for changes to [shared drive](https://support.google.com/a/users/answer/9310351) files, use the **Changes to Specific Files (Shared Drive)** source instead.",
|
20
|
-
version: "0.1.
|
20
|
+
version: "0.1.4",
|
21
21
|
type: "source",
|
22
22
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
23
23
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs
CHANGED
@@ -26,7 +26,7 @@ export default {
|
|
26
26
|
key: "google_drive-changes-to-specific-files-shared-drive",
|
27
27
|
name: "Changes to Specific Files (Shared Drive)",
|
28
28
|
description: "Watches for changes to specific files in a shared drive, emitting an event any time a change is made to one of those files",
|
29
|
-
version: "0.1.
|
29
|
+
version: "0.1.4",
|
30
30
|
type: "source",
|
31
31
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
32
32
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
@@ -10,7 +10,7 @@ export default {
|
|
10
10
|
key: "google_drive-new-files-instant",
|
11
11
|
name: "New Files (Instant)",
|
12
12
|
description: "Emit new event any time a new file is added in your linked Google Drive",
|
13
|
-
version: "0.1.
|
13
|
+
version: "0.1.5",
|
14
14
|
type: "source",
|
15
15
|
dedupe: "unique",
|
16
16
|
props: {
|
@@ -17,7 +17,7 @@ export default {
|
|
17
17
|
name: "New or Modified Comments",
|
18
18
|
description:
|
19
19
|
"Emits a new event any time a file comment is added, modified, or deleted in your linked Google Drive",
|
20
|
-
version: "0.1.
|
20
|
+
version: "0.1.5",
|
21
21
|
type: "source",
|
22
22
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
23
23
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
@@ -21,7 +21,7 @@ export default {
|
|
21
21
|
key: "google_drive-new-or-modified-files",
|
22
22
|
name: "New or Modified Files",
|
23
23
|
description: "Emit new event any time any file in your linked Google Drive is added, modified, or deleted",
|
24
|
-
version: "0.2.
|
24
|
+
version: "0.2.1",
|
25
25
|
type: "source",
|
26
26
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
27
27
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
@@ -20,7 +20,7 @@ export default {
|
|
20
20
|
key: "google_drive-new-or-modified-folders",
|
21
21
|
name: "New or Modified Folders",
|
22
22
|
description: "Emit new event any time any folder in your linked Google Drive is added, modified, or deleted",
|
23
|
-
version: "0.1.
|
23
|
+
version: "0.1.3",
|
24
24
|
type: "source",
|
25
25
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
26
26
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
@@ -6,7 +6,7 @@ export default {
|
|
6
6
|
type: "source",
|
7
7
|
name: "New Spreadsheet (Instant)",
|
8
8
|
description: "Emit new event each time a new spreadsheet is created in a drive.",
|
9
|
-
version: "0.1.
|
9
|
+
version: "0.1.3",
|
10
10
|
props: {
|
11
11
|
googleDrive: newFilesInstant.props.googleDrive,
|
12
12
|
db: newFilesInstant.props.db,
|