@pipedream/google_drive 1.0.6 → 1.1.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.
- package/actions/add-comment/add-comment.mjs +1 -1
- 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-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-comment/delete-comment.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-file-by-id/get-file-by-id.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-access-proposals/list-access-proposals.mjs +1 -1
- package/actions/list-comments/list-comments.mjs +1 -1
- package/actions/list-files/list-files.mjs +1 -1
- package/actions/move-file/move-file.mjs +1 -1
- package/actions/move-file-to-trash/move-file-to-trash.mjs +1 -1
- package/actions/reply-to-comment/reply-to-comment.mjs +1 -1
- package/actions/resolve-access-proposal/resolve-access-proposal.mjs +1 -1
- package/actions/resolve-comment/resolve-comment.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/common/utils.mjs +40 -0
- package/package.json +1 -1
- package/sources/changes-to-files-in-drive/changes-to-files-in-drive.mjs +147 -0
- package/sources/changes-to-specific-files/changes-to-specific-files.mjs +26 -2
- package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs +25 -9
- package/sources/common-dedupe-changes.mjs +1 -1
- package/sources/common-webhook.mjs +8 -1
- package/sources/new-access-proposal/new-access-proposal.mjs +1 -1
- package/sources/new-files-instant/new-files-instant.mjs +20 -4
- package/sources/new-files-shared-drive/new-files-shared-drive.mjs +13 -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 +17 -1
- package/sources/new-or-modified-files/test-event.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
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-add-comment",
|
|
5
5
|
name: "Add Comment",
|
|
6
6
|
description: "Add an unanchored comment to a Google Doc (general feedback, no text highlighting). [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/create)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.2",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
googleDrive,
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
name: "Share File or Folder",
|
|
21
21
|
description:
|
|
22
22
|
"Add a [sharing permission](https://support.google.com/drive/answer/7166529) to the sharing preferences of a file or folder and provide a sharing URL. [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/create)",
|
|
23
|
-
version: "0.2.
|
|
23
|
+
version: "0.2.6",
|
|
24
24
|
type: "action",
|
|
25
25
|
props: {
|
|
26
26
|
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 documentation](https://developers.google.com/drive/api/v3/reference/files/copy) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.13",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
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.13",
|
|
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 documentation](https://developers.google.com/drive/api/v3/reference/files/create) for more information",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.6",
|
|
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 documentation](https://developers.google.com/drive/api/v3/reference/files/create) for more information",
|
|
16
|
-
version: "0.1.
|
|
16
|
+
version: "0.1.14",
|
|
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 documentation](https://developers.google.com/drive/api/v3/reference/drives/create) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.14",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
googleDrive,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-delete-comment",
|
|
5
5
|
name: "Delete Comment",
|
|
6
6
|
description: "Delete a specific comment (Requires ownership or permissions). [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/delete)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.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 documentation](https://developers.google.com/drive/api/v3/reference/files/delete) for more information",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.14",
|
|
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 documentation](https://developers.google.com/drive/api/v3/reference/drives/delete) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.13",
|
|
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 documentation](https://developers.google.com/drive/api/v3/manage-downloads) for more information",
|
|
21
|
-
version: "0.1.
|
|
21
|
+
version: "0.1.16",
|
|
22
22
|
type: "action",
|
|
23
23
|
props: {
|
|
24
24
|
googleDrive,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_drive-find-file",
|
|
7
7
|
name: "Find File",
|
|
8
8
|
description: "Search for a specific file by name. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.13",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
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 documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.13",
|
|
11
11
|
type: "action",
|
|
12
12
|
props: {
|
|
13
13
|
googleDrive,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_drive-find-forms",
|
|
7
7
|
name: "Find Forms",
|
|
8
8
|
description: "List Google Form documents or search for a Form by name. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.14",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
googleDrive,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_drive-find-spreadsheets",
|
|
7
7
|
name: "Find Spreadsheets",
|
|
8
8
|
description: "Search for a specific spreadsheet by name. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.13",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
googleDrive,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "google_drive-get-file-by-id",
|
|
6
6
|
name: "Get File By ID",
|
|
7
7
|
description: "Get info on a specific file. [See the documentation](https://developers.google.com/drive/api/reference/rest/v3/files/get) for more information",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.10",
|
|
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 documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
|
|
15
|
-
version: "0.1.
|
|
15
|
+
version: "0.1.15",
|
|
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 metadata for one or all shared drives. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/get) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.13",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
googleDrive,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-list-access-proposals",
|
|
5
5
|
name: "List Access Proposals",
|
|
6
6
|
description: "List access proposals for a file or folder. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/accessproposals/list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.6",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
googleDrive,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-list-comments",
|
|
5
5
|
name: "List Comments",
|
|
6
6
|
description: "List all comments on a file. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.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.17",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
googleDrive,
|
|
@@ -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 documentation](https://developers.google.com/drive/api/v3/reference/files/update) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.13",
|
|
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 documentation](https://developers.google.com/drive/api/v3/reference/files/update) for more information",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.13",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
googleDrive,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-reply-to-comment",
|
|
5
5
|
name: "Reply to Comment",
|
|
6
6
|
description: "Add a reply to an existing comment. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/replies/create)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.2",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
googleDrive,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "google_drive-resolve-access-proposal",
|
|
6
6
|
name: "Resolve Access Proposals",
|
|
7
7
|
description: "Accept or deny a request for access to a file or folder in Google Drive. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/accessproposals/resolve)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
googleDrive,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-resolve-comment",
|
|
5
5
|
name: "Resolve Comment",
|
|
6
6
|
description: "Mark a comment as resolved. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/update)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.2",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
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 documentation](https://developers.google.com/drive/api/v3/search-shareddrives) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.14",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
googleDrive,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_drive-update-file",
|
|
7
7
|
name: "Update File",
|
|
8
8
|
description: "Update a file's metadata and/or content. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/update) for more information",
|
|
9
|
-
version: "2.0.
|
|
9
|
+
version: "2.0.5",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
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 documentation](https://developers.google.com/drive/api/v3/reference/drives/update) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.13",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
googleDrive,
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
key: "google_drive-upload-file",
|
|
14
14
|
name: "Upload File",
|
|
15
15
|
description: "Upload a file to Google Drive. [See the documentation](https://developers.google.com/drive/api/v3/manage-uploads) for more information",
|
|
16
|
-
version: "2.0.
|
|
16
|
+
version: "2.0.6",
|
|
17
17
|
type: "action",
|
|
18
18
|
props: {
|
|
19
19
|
googleDrive,
|
package/common/utils.mjs
CHANGED
|
@@ -3,7 +3,9 @@ import {
|
|
|
3
3
|
MY_DRIVE_VALUE,
|
|
4
4
|
LEGACY_MY_DRIVE_VALUE,
|
|
5
5
|
MAX_FILE_OPTION_PATH_SEGMENTS,
|
|
6
|
+
GOOGLE_DRIVE_MIME_TYPE_PREFIX,
|
|
6
7
|
} from "../common/constants.mjs";
|
|
8
|
+
import { Readable } from "stream";
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Returns whether the specified drive ID corresponds to the authenticated
|
|
@@ -264,6 +266,43 @@ function parseObjectEntries(value = {}) {
|
|
|
264
266
|
);
|
|
265
267
|
}
|
|
266
268
|
|
|
269
|
+
async function stashFile(item, googleDrive, dir) {
|
|
270
|
+
const fileMetadata = await googleDrive.getFile(item.id, {
|
|
271
|
+
fields: "name,mimeType",
|
|
272
|
+
});
|
|
273
|
+
let mimeType = fileMetadata.mimeType;
|
|
274
|
+
const isWorkspaceDocument = mimeType.includes(GOOGLE_DRIVE_MIME_TYPE_PREFIX);
|
|
275
|
+
if (isWorkspaceDocument) {
|
|
276
|
+
mimeType = "application/pdf";
|
|
277
|
+
}
|
|
278
|
+
const response = isWorkspaceDocument
|
|
279
|
+
? await googleDrive.downloadWorkspaceFile(item.id, {
|
|
280
|
+
mimeType,
|
|
281
|
+
})
|
|
282
|
+
: await googleDrive.getFile(item.id, {
|
|
283
|
+
alt: "media",
|
|
284
|
+
});
|
|
285
|
+
// Convert stream to buffer
|
|
286
|
+
const chunks = [];
|
|
287
|
+
for await (const chunk of response) {
|
|
288
|
+
chunks.push(chunk);
|
|
289
|
+
}
|
|
290
|
+
const buffer = Buffer.concat(chunks);
|
|
291
|
+
// Construct a file path unique to this attachment to avoid overwriting
|
|
292
|
+
// files with the same name.
|
|
293
|
+
const filepath = `${item.id}/${item.name}`;
|
|
294
|
+
// Upload the attachment to the configured directory (File Stash) so it
|
|
295
|
+
// can be accessed later.
|
|
296
|
+
const file = await dir.open(filepath).fromReadableStream(
|
|
297
|
+
Readable.from(buffer),
|
|
298
|
+
mimeType,
|
|
299
|
+
buffer.length,
|
|
300
|
+
);
|
|
301
|
+
// Return file details and temporary download link:
|
|
302
|
+
// { path, get_url, s3Key, type }
|
|
303
|
+
return await file.withoutPutUrl().withGetUrl();
|
|
304
|
+
}
|
|
305
|
+
|
|
267
306
|
export {
|
|
268
307
|
MY_DRIVE_VALUE,
|
|
269
308
|
isMyDrive,
|
|
@@ -276,4 +315,5 @@ export {
|
|
|
276
315
|
streamToBuffer,
|
|
277
316
|
byteToMB,
|
|
278
317
|
parseObjectEntries,
|
|
318
|
+
stashFile,
|
|
279
319
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import common from "../common-webhook.mjs";
|
|
2
|
+
import {
|
|
3
|
+
MY_DRIVE_VALUE,
|
|
4
|
+
GOOGLE_DRIVE_NOTIFICATION_ADD,
|
|
5
|
+
GOOGLE_DRIVE_NOTIFICATION_CHANGE,
|
|
6
|
+
GOOGLE_DRIVE_NOTIFICATION_UPDATE,
|
|
7
|
+
} from "../../common/constants.mjs";
|
|
8
|
+
import commonDedupeChanges from "../common-dedupe-changes.mjs";
|
|
9
|
+
import { stashFile } from "../../common/utils.mjs";
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
...common,
|
|
13
|
+
key: "google_drive-changes-to-files-in-drive",
|
|
14
|
+
name: "Changes to Files in Drive",
|
|
15
|
+
description: "Emit new event when a change is made to one of the specified files. [See the documentation](https://developers.google.com/drive/api/v3/reference/changes/watch)",
|
|
16
|
+
version: "0.0.1",
|
|
17
|
+
type: "source",
|
|
18
|
+
dedupe: "unique",
|
|
19
|
+
props: {
|
|
20
|
+
infoAlert: {
|
|
21
|
+
type: "alert",
|
|
22
|
+
alertType: "info",
|
|
23
|
+
content: "This source uses `changes.watch` and supports watching 10+ files. To watch for changes to fewer than 10 files, you may want to use the **Changes to Specific Files** source instead (uses `files.watch`).",
|
|
24
|
+
},
|
|
25
|
+
...common.props,
|
|
26
|
+
drive: {
|
|
27
|
+
type: "string",
|
|
28
|
+
label: "Drive",
|
|
29
|
+
description: "Defaults to `My Drive`. To use a [Shared Drive](https://support.google.com/a/users/answer/9310351), use the **Changes to Specific Files (Shared Drive)** source instead.",
|
|
30
|
+
optional: true,
|
|
31
|
+
default: MY_DRIVE_VALUE,
|
|
32
|
+
},
|
|
33
|
+
files: {
|
|
34
|
+
type: "string[]",
|
|
35
|
+
label: "Files",
|
|
36
|
+
description: "The files you want to watch for changes.",
|
|
37
|
+
options({ prevContext }) {
|
|
38
|
+
const { nextPageToken } = prevContext;
|
|
39
|
+
return this.googleDrive.listFilesOptions(nextPageToken, this.getListFilesOpts());
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
includeLink: {
|
|
43
|
+
label: "Include Link",
|
|
44
|
+
type: "boolean",
|
|
45
|
+
description: "Upload file to your File Stash and emit temporary download link to the file. Google Workspace documents will be converted to PDF. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.",
|
|
46
|
+
default: false,
|
|
47
|
+
optional: true,
|
|
48
|
+
},
|
|
49
|
+
dir: {
|
|
50
|
+
type: "dir",
|
|
51
|
+
accessMode: "write",
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
...commonDedupeChanges.props,
|
|
55
|
+
},
|
|
56
|
+
hooks: {
|
|
57
|
+
async deploy() {
|
|
58
|
+
const daysAgo = new Date();
|
|
59
|
+
daysAgo.setDate(daysAgo.getDate() - 30);
|
|
60
|
+
const timeString = daysAgo.toISOString();
|
|
61
|
+
|
|
62
|
+
const args = this.getListFilesOpts({
|
|
63
|
+
q: `mimeType != "application/vnd.google-apps.folder" and modifiedTime > "${timeString}" and trashed = false`,
|
|
64
|
+
fields: "files",
|
|
65
|
+
pageSize: 5,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const { files } = await this.googleDrive.listFilesInPage(null, args);
|
|
69
|
+
|
|
70
|
+
await this.processChanges(files);
|
|
71
|
+
},
|
|
72
|
+
...common.hooks,
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
...common.methods,
|
|
76
|
+
getUpdateTypes() {
|
|
77
|
+
return [
|
|
78
|
+
GOOGLE_DRIVE_NOTIFICATION_ADD,
|
|
79
|
+
GOOGLE_DRIVE_NOTIFICATION_CHANGE,
|
|
80
|
+
GOOGLE_DRIVE_NOTIFICATION_UPDATE,
|
|
81
|
+
];
|
|
82
|
+
},
|
|
83
|
+
generateMeta(data, headers) {
|
|
84
|
+
const {
|
|
85
|
+
id: fileId,
|
|
86
|
+
name: fileName,
|
|
87
|
+
modifiedTime: tsString,
|
|
88
|
+
} = data;
|
|
89
|
+
const ts = Date.parse(tsString);
|
|
90
|
+
const resourceState = headers && headers["x-goog-resource-state"];
|
|
91
|
+
|
|
92
|
+
const summary = resourceState
|
|
93
|
+
? `${resourceState.toUpperCase()} - ${fileName || "Untitled"}`
|
|
94
|
+
: fileName || "Untitled";
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
id: `${fileId}-${ts}`,
|
|
98
|
+
summary,
|
|
99
|
+
ts,
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
isFileRelevant(file) {
|
|
103
|
+
return this.files.includes(file.id);
|
|
104
|
+
},
|
|
105
|
+
getChanges(headers) {
|
|
106
|
+
if (!headers) {
|
|
107
|
+
return {
|
|
108
|
+
change: { },
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
change: {
|
|
113
|
+
state: headers["x-goog-resource-state"],
|
|
114
|
+
resourceURI: headers["x-goog-resource-uri"],
|
|
115
|
+
changed: headers["x-goog-changed"], // "Additional details about the changes. Possible values: content, parents, children, permissions"
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
async processChange(file, headers) {
|
|
120
|
+
const changes = this.getChanges(headers);
|
|
121
|
+
const fileInfo = await this.googleDrive.getFile(file.id);
|
|
122
|
+
if (this.includeLink) {
|
|
123
|
+
fileInfo.file = await stashFile(file, this.googleDrive, this.dir);
|
|
124
|
+
}
|
|
125
|
+
const eventToEmit = {
|
|
126
|
+
file: fileInfo,
|
|
127
|
+
...changes,
|
|
128
|
+
};
|
|
129
|
+
const meta = this.generateMeta(fileInfo, headers);
|
|
130
|
+
this.$emit(eventToEmit, meta);
|
|
131
|
+
},
|
|
132
|
+
async processChanges(changedFiles, headers) {
|
|
133
|
+
console.log(`Processing ${changedFiles.length} changed files`);
|
|
134
|
+
console.log(`Changed files: ${JSON.stringify(changedFiles, null, 2)}!!!`);
|
|
135
|
+
console.log(`Files: ${this.files}!!!`);
|
|
136
|
+
|
|
137
|
+
const filteredFiles = this.checkMinimumInterval(changedFiles);
|
|
138
|
+
for (const file of filteredFiles) {
|
|
139
|
+
if (!this.isFileRelevant(file)) {
|
|
140
|
+
console.log(`Skipping event for irrelevant file ${file.id}`);
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
await this.processChange(file, headers);
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
};
|
|
@@ -3,6 +3,7 @@ import includes from "lodash/includes.js";
|
|
|
3
3
|
import { v4 as uuid } from "uuid";
|
|
4
4
|
import { MY_DRIVE_VALUE } from "../../common/constants.mjs";
|
|
5
5
|
import changesToSpecificFiles from "../changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs";
|
|
6
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
6
7
|
import sampleEmit from "./test-event.mjs";
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -15,12 +16,17 @@ export default {
|
|
|
15
16
|
key: "google_drive-changes-to-specific-files",
|
|
16
17
|
name: "Changes to Specific Files",
|
|
17
18
|
description: "Watches for changes to specific files, emitting an event when 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.",
|
|
18
|
-
version: "0.
|
|
19
|
+
version: "0.3.1",
|
|
19
20
|
type: "source",
|
|
20
21
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
|
21
22
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
|
22
23
|
dedupe: "unique",
|
|
23
24
|
props: {
|
|
25
|
+
infoAlert: {
|
|
26
|
+
type: "alert",
|
|
27
|
+
alertType: "info",
|
|
28
|
+
content: "This source uses `files.watch` and supports up to 10 file subscriptions. To watch for changes to more than 10 files, use the **Changes to Files in Drive** source instead (uses `changes.watch`).",
|
|
29
|
+
},
|
|
24
30
|
...changesToSpecificFiles.props,
|
|
25
31
|
drive: {
|
|
26
32
|
type: "string",
|
|
@@ -35,9 +41,27 @@ export default {
|
|
|
35
41
|
"updateTypes",
|
|
36
42
|
],
|
|
37
43
|
},
|
|
44
|
+
includeLink: {
|
|
45
|
+
label: "Include Link",
|
|
46
|
+
type: "boolean",
|
|
47
|
+
description: "Upload file to your File Stash and emit temporary download link to the file. Google Workspace documents will be converted to PDF. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.",
|
|
48
|
+
default: false,
|
|
49
|
+
optional: true,
|
|
50
|
+
},
|
|
51
|
+
dir: {
|
|
52
|
+
type: "dir",
|
|
53
|
+
accessMode: "write",
|
|
54
|
+
optional: true,
|
|
55
|
+
},
|
|
38
56
|
},
|
|
39
57
|
hooks: {
|
|
40
58
|
...changesToSpecificFiles.hooks,
|
|
59
|
+
async deploy() {
|
|
60
|
+
if (this.files.length > 10) {
|
|
61
|
+
throw new ConfigurationError("This source only supports up to 10 files");
|
|
62
|
+
}
|
|
63
|
+
await changesToSpecificFiles.hooks.deploy.bind(this)();
|
|
64
|
+
},
|
|
41
65
|
async activate() {
|
|
42
66
|
// Called when a component is created or updated. Handles all the logic
|
|
43
67
|
// for starting and stopping watch notifications tied to the desired
|
|
@@ -226,7 +250,7 @@ export default {
|
|
|
226
250
|
file,
|
|
227
251
|
]);
|
|
228
252
|
if (checkedFile) {
|
|
229
|
-
this.processChange(file, headers);
|
|
253
|
+
await this.processChange(file, headers);
|
|
230
254
|
}
|
|
231
255
|
},
|
|
232
256
|
sampleEmit,
|
package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
GOOGLE_DRIVE_NOTIFICATION_UPDATE,
|
|
17
17
|
} from "../../common/constants.mjs";
|
|
18
18
|
import commonDedupeChanges from "../common-dedupe-changes.mjs";
|
|
19
|
+
import { stashFile } from "../../common/utils.mjs";
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* This source uses the Google Drive API's
|
|
@@ -27,7 +28,7 @@ export default {
|
|
|
27
28
|
key: "google_drive-changes-to-specific-files-shared-drive",
|
|
28
29
|
name: "Changes to Specific Files (Shared Drive)",
|
|
29
30
|
description: "Watches for changes to specific files in a shared drive, emitting an event when a change is made to one of those files",
|
|
30
|
-
version: "0.
|
|
31
|
+
version: "0.3.1",
|
|
31
32
|
type: "source",
|
|
32
33
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
|
33
34
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
|
@@ -43,6 +44,18 @@ export default {
|
|
|
43
44
|
return this.googleDrive.listFilesOptions(nextPageToken, this.getListFilesOpts());
|
|
44
45
|
},
|
|
45
46
|
},
|
|
47
|
+
includeLink: {
|
|
48
|
+
label: "Include Link",
|
|
49
|
+
type: "boolean",
|
|
50
|
+
description: "Upload file to your File Stash and emit temporary download link to the file. Google Workspace documents will be converted to PDF. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.",
|
|
51
|
+
default: false,
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
dir: {
|
|
55
|
+
type: "dir",
|
|
56
|
+
accessMode: "write",
|
|
57
|
+
optional: true,
|
|
58
|
+
},
|
|
46
59
|
...commonDedupeChanges.props,
|
|
47
60
|
},
|
|
48
61
|
hooks: {
|
|
@@ -59,7 +72,7 @@ export default {
|
|
|
59
72
|
|
|
60
73
|
const { files } = await this.googleDrive.listFilesInPage(null, args);
|
|
61
74
|
|
|
62
|
-
this.processChanges(files);
|
|
75
|
+
await this.processChanges(files);
|
|
63
76
|
},
|
|
64
77
|
...common.hooks,
|
|
65
78
|
},
|
|
@@ -79,7 +92,6 @@ export default {
|
|
|
79
92
|
modifiedTime: tsString,
|
|
80
93
|
} = data;
|
|
81
94
|
const ts = Date.parse(tsString);
|
|
82
|
-
const eventId = headers && headers["x-goog-message-number"];
|
|
83
95
|
const resourceState = headers && headers["x-goog-resource-state"];
|
|
84
96
|
|
|
85
97
|
const summary = resourceState
|
|
@@ -87,7 +99,7 @@ export default {
|
|
|
87
99
|
: fileName || "Untitled";
|
|
88
100
|
|
|
89
101
|
return {
|
|
90
|
-
id: `${fileId}-${
|
|
102
|
+
id: `${fileId}-${ts}`,
|
|
91
103
|
summary,
|
|
92
104
|
ts,
|
|
93
105
|
};
|
|
@@ -109,16 +121,20 @@ export default {
|
|
|
109
121
|
},
|
|
110
122
|
};
|
|
111
123
|
},
|
|
112
|
-
processChange(file, headers) {
|
|
124
|
+
async processChange(file, headers) {
|
|
113
125
|
const changes = this.getChanges(headers);
|
|
126
|
+
const fileInfo = await this.googleDrive.getFile(file.id);
|
|
127
|
+
if (this.includeLink) {
|
|
128
|
+
fileInfo.file = await stashFile(file, this.googleDrive, this.dir);
|
|
129
|
+
}
|
|
114
130
|
const eventToEmit = {
|
|
115
|
-
file,
|
|
131
|
+
file: fileInfo,
|
|
116
132
|
...changes,
|
|
117
133
|
};
|
|
118
|
-
const meta = this.generateMeta(
|
|
134
|
+
const meta = this.generateMeta(fileInfo, headers);
|
|
119
135
|
this.$emit(eventToEmit, meta);
|
|
120
136
|
},
|
|
121
|
-
processChanges(changedFiles, headers) {
|
|
137
|
+
async processChanges(changedFiles, headers) {
|
|
122
138
|
console.log(`Processing ${changedFiles.length} changed files`);
|
|
123
139
|
console.log(`Changed files: ${JSON.stringify(changedFiles, null, 2)}!!!`);
|
|
124
140
|
console.log(`Files: ${this.files}!!!`);
|
|
@@ -129,7 +145,7 @@ export default {
|
|
|
129
145
|
console.log(`Skipping event for irrelevant file ${file.id}`);
|
|
130
146
|
continue;
|
|
131
147
|
}
|
|
132
|
-
this.processChange(file, headers);
|
|
148
|
+
await this.processChange(file, headers);
|
|
133
149
|
}
|
|
134
150
|
},
|
|
135
151
|
},
|
|
@@ -13,7 +13,7 @@ You can change or disable this minimum interval using the prop \`Minimum Interva
|
|
|
13
13
|
description: "How many minutes to wait until the same file can emit another event.\n\nIf set to `0`, this interval is disabled and all events will be emitted.",
|
|
14
14
|
min: 0,
|
|
15
15
|
max: 60,
|
|
16
|
-
default:
|
|
16
|
+
default: 3,
|
|
17
17
|
optional: true,
|
|
18
18
|
},
|
|
19
19
|
},
|
|
@@ -10,7 +10,10 @@ export default {
|
|
|
10
10
|
props: {
|
|
11
11
|
googleDrive,
|
|
12
12
|
db: "$.service.db",
|
|
13
|
-
http:
|
|
13
|
+
http: {
|
|
14
|
+
type: "$.interface.http",
|
|
15
|
+
customResponse: true,
|
|
16
|
+
},
|
|
14
17
|
drive: {
|
|
15
18
|
propDefinition: [
|
|
16
19
|
googleDrive,
|
|
@@ -157,6 +160,10 @@ export default {
|
|
|
157
160
|
this._setChannelID(newChannelID);
|
|
158
161
|
this._setPageToken(newPageToken);
|
|
159
162
|
return;
|
|
163
|
+
} else {
|
|
164
|
+
this.http.respond({
|
|
165
|
+
status: 200,
|
|
166
|
+
});
|
|
160
167
|
}
|
|
161
168
|
|
|
162
169
|
const { headers } = event;
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_drive-new-access-proposal",
|
|
7
7
|
name: "New Access Proposal",
|
|
8
8
|
description: "Emit new event when a new access proposal is requested in Google Drive",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.6",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
GOOGLE_DRIVE_NOTIFICATION_CHANGE,
|
|
4
4
|
} from "../../common/constants.mjs";
|
|
5
5
|
import common from "../common-webhook.mjs";
|
|
6
|
+
import { stashFile } from "../../common/utils.mjs";
|
|
6
7
|
import sampleEmit from "./test-event.mjs";
|
|
7
8
|
|
|
8
9
|
export default {
|
|
@@ -10,7 +11,7 @@ export default {
|
|
|
10
11
|
key: "google_drive-new-files-instant",
|
|
11
12
|
name: "New Files (Instant)",
|
|
12
13
|
description: "Emit new event when a new file is added in your linked Google Drive",
|
|
13
|
-
version: "0.1
|
|
14
|
+
version: "0.2.1",
|
|
14
15
|
type: "source",
|
|
15
16
|
dedupe: "unique",
|
|
16
17
|
props: {
|
|
@@ -46,6 +47,18 @@ export default {
|
|
|
46
47
|
return this.googleDrive.listFilesOptions(nextPageToken, opts);
|
|
47
48
|
},
|
|
48
49
|
},
|
|
50
|
+
includeLink: {
|
|
51
|
+
label: "Include Link",
|
|
52
|
+
type: "boolean",
|
|
53
|
+
description: "Upload file to your File Stash and emit temporary download link to the file. Google Workspace documents will be converted to PDF. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.",
|
|
54
|
+
default: false,
|
|
55
|
+
optional: true,
|
|
56
|
+
},
|
|
57
|
+
dir: {
|
|
58
|
+
type: "dir",
|
|
59
|
+
accessMode: "write",
|
|
60
|
+
optional: true,
|
|
61
|
+
},
|
|
49
62
|
},
|
|
50
63
|
hooks: {
|
|
51
64
|
async deploy() {
|
|
@@ -62,7 +75,7 @@ export default {
|
|
|
62
75
|
|
|
63
76
|
const { files } = await this.googleDrive.listFilesInPage(null, args);
|
|
64
77
|
|
|
65
|
-
this.emitFiles(files);
|
|
78
|
+
await this.emitFiles(files);
|
|
66
79
|
},
|
|
67
80
|
...common.hooks,
|
|
68
81
|
async activate() {
|
|
@@ -91,11 +104,14 @@ export default {
|
|
|
91
104
|
GOOGLE_DRIVE_NOTIFICATION_CHANGE,
|
|
92
105
|
];
|
|
93
106
|
},
|
|
94
|
-
emitFiles(files) {
|
|
107
|
+
async emitFiles(files) {
|
|
95
108
|
for (const file of files) {
|
|
96
109
|
if (!this.shouldProcess(file)) {
|
|
97
110
|
continue;
|
|
98
111
|
}
|
|
112
|
+
if (this.includeLink) {
|
|
113
|
+
file.file = await stashFile(file, this.googleDrive, this.dir);
|
|
114
|
+
}
|
|
99
115
|
this.$emit(file, {
|
|
100
116
|
summary: `New File: ${file.name}`,
|
|
101
117
|
id: file.id,
|
|
@@ -119,7 +135,7 @@ export default {
|
|
|
119
135
|
return;
|
|
120
136
|
}
|
|
121
137
|
|
|
122
|
-
this.emitFiles(files);
|
|
138
|
+
await this.emitFiles(files);
|
|
123
139
|
|
|
124
140
|
this._setLastFileCreatedTime(Date.parse(files[0].createdTime));
|
|
125
141
|
},
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "google_drive-new-files-shared-drive",
|
|
8
8
|
name: "New Files (Shared Drive)",
|
|
9
9
|
description: "Emit new event when a new file is added in your shared Google Drive",
|
|
10
|
-
version: "0.
|
|
10
|
+
version: "0.1.1",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
props: {
|
|
@@ -30,6 +30,18 @@ export default {
|
|
|
30
30
|
optional: false,
|
|
31
31
|
},
|
|
32
32
|
folders: sourceComponent.props.folders,
|
|
33
|
+
includeLink: {
|
|
34
|
+
label: "Include Link",
|
|
35
|
+
type: "boolean",
|
|
36
|
+
description: "Upload file to your File Stash and emit temporary download link to the file. Google Workspace documents will be converted to PDF. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.",
|
|
37
|
+
default: false,
|
|
38
|
+
optional: true,
|
|
39
|
+
},
|
|
40
|
+
dir: {
|
|
41
|
+
type: "dir",
|
|
42
|
+
accessMode: "write",
|
|
43
|
+
optional: true,
|
|
44
|
+
},
|
|
33
45
|
},
|
|
34
46
|
hooks: {
|
|
35
47
|
async deploy() {
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
name: "New or Modified Comments (Instant)",
|
|
18
18
|
description:
|
|
19
19
|
"Emit new event when a comment is created or modified in the selected file",
|
|
20
|
-
version: "1.0.
|
|
20
|
+
version: "1.0.10",
|
|
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
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from "../../common/constants.mjs";
|
|
16
16
|
import commonDedupeChanges from "../common-dedupe-changes.mjs";
|
|
17
17
|
import common from "../common-webhook.mjs";
|
|
18
|
+
import { stashFile } from "../../common/utils.mjs";
|
|
18
19
|
import sampleEmit from "./test-event.mjs";
|
|
19
20
|
|
|
20
21
|
const { googleDrive } = common.props;
|
|
@@ -24,7 +25,7 @@ export default {
|
|
|
24
25
|
key: "google_drive-new-or-modified-files",
|
|
25
26
|
name: "New or Modified Files (Instant)",
|
|
26
27
|
description: "Emit new event when a file in the selected Drive is created, modified or trashed.",
|
|
27
|
-
version: "0.
|
|
28
|
+
version: "0.4.1",
|
|
28
29
|
type: "source",
|
|
29
30
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
|
30
31
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
|
@@ -61,6 +62,18 @@ export default {
|
|
|
61
62
|
"watchForPropertiesChanges",
|
|
62
63
|
],
|
|
63
64
|
},
|
|
65
|
+
includeLink: {
|
|
66
|
+
label: "Include Link",
|
|
67
|
+
type: "boolean",
|
|
68
|
+
description: "Upload file to your File Stash and emit temporary download link to the file. Google Workspace documents will be converted to PDF. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.",
|
|
69
|
+
default: false,
|
|
70
|
+
optional: true,
|
|
71
|
+
},
|
|
72
|
+
dir: {
|
|
73
|
+
type: "dir",
|
|
74
|
+
accessMode: "write",
|
|
75
|
+
optional: true,
|
|
76
|
+
},
|
|
64
77
|
...commonDedupeChanges.props,
|
|
65
78
|
},
|
|
66
79
|
hooks: {
|
|
@@ -152,6 +165,9 @@ export default {
|
|
|
152
165
|
file,
|
|
153
166
|
...changes,
|
|
154
167
|
};
|
|
168
|
+
if (this.includeLink) {
|
|
169
|
+
eventToEmit.fileURL = await stashFile(file, this.googleDrive, this.dir);
|
|
170
|
+
}
|
|
155
171
|
const meta = this.generateMeta(file, headers);
|
|
156
172
|
this.$emit(eventToEmit, meta);
|
|
157
173
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default JSON.parse("{\n \"file\": {\n \"kind\": \"drive#file\",\n \"copyRequiresWriterPermission\": false,\n \"writersCanShare\": true,\n \"viewedByMe\": true,\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\",\n \"exportLinks\": {\n \"application/x-vnd.oasis.opendocument.spreadsheet\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbTmw4&exportFormat=ods\",\n \"text/tab-separated-values\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXnViTOo&exportFormat=tsv\",\n \"application/pdf\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaBViTOo&exportFormat=pdf\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbOo&exportFormat=xlsx\",\n \"text/csv\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbBViTOo&exportFormat=csv\",\n \"application/zip\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-VbTmw4Pt2BViTOo&exportFormat=zip\",\n \"application/vnd.oasis.opendocument.spreadsheet\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbViTOo&exportFormat=ods\"\n },\n \"parents\": [\n \"0ANs73yKKVA\"\n ],\n \"thumbnailLink\": \"https://docs.google.com/feeds/vt?gd=true&id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbTmw4&v=12&s=AMedNnoAAAAAZKWjrEqscucFpYCyRCJqnd0wtBiDtXYh&sz=s220\",\n \"iconLink\": \"https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.google-apps.spreadsheet\",\n \"shared\": false,\n \"lastModifyingUser\": {\n \"displayName\": \"John Doe\",\n \"kind\": \"drive#user\",\n \"me\": true,\n \"permissionId\": \"077423361841532483\",\n \"emailAddress\": \"john@doe.com\",\n \"photoLink\": \"https://lh3.googleusercontent.com/a/default-user=s64\"\n },\n \"owners\": [\n {\n \"displayName\": \"John Doe\",\n \"kind\": \"drive#user\",\n \"me\": true,\n \"permissionId\": \"07742336189483\",\n \"emailAddress\": \"john@doe.com\",\n \"photoLink\": \"https://lh3.googleusercontent.com/a/default-user=s64\"\n }\n ],\n \"webViewLink\": \"https://docs.google.com/spreadsheets/d/1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbTmwTOo/edit?usp=drivesdk\",\n \"size\": \"1024\",\n \"viewersCanCopyContent\": true,\n \"permissions\": [\n {\n \"id\": \"07742336184153259483\",\n \"displayName\": \"John Doe\",\n \"type\": \"user\",\n \"kind\": \"drive#permission\",\n \"photoLink\": \"https://lh3.googleusercontent.com/a/default-user=s64\",\n \"emailAddress\": \"john@doe.com\",\n \"role\": \"owner\",\n \"deleted\": false,\n \"pendingOwner\": false\n }\n ],\n \"hasThumbnail\": true,\n \"spaces\": [\n \"drive\"\n ],\n \"id\": \"1LmXTIQ0wqKP7T3-l9r127Maw4Pt2BViTOo\",\n \"name\": \"Pipedream 2213\",\n \"starred\": false,\n \"trashed\": false,\n \"explicitlyTrashed\": false,\n \"createdTime\": \"2023-02-06T15:13:33.023Z\",\n \"modifiedTime\": \"2023-06-28T12:52:54.570Z\",\n \"modifiedByMeTime\": \"2023-06-28T12:52:54.570Z\",\n \"viewedByMeTime\": \"2023-06-29T06:30:58.441Z\",\n \"quotaBytesUsed\": \"1024\",\n \"version\": \"53\",\n \"ownedByMe\": true,\n \"isAppAuthorized\": false,\n \"capabilities\": {\n \"canChangeViewersCanCopyContent\": true,\n \"canEdit\": true,\n \"canCopy\": true,\n \"canComment\": true,\n \"canAddChildren\": false,\n \"canDelete\": true,\n \"canDownload\": true,\n \"canListChildren\": false,\n \"canRemoveChildren\": false,\n \"canRename\": true,\n \"canTrash\": true,\n \"canReadRevisions\": true,\n \"canChangeCopyRequiresWriterPermission\": true,\n \"canMoveItemIntoTeamDrive\": true,\n \"canUntrash\": true,\n \"canModifyContent\": true,\n \"canMoveItemOutOfDrive\": true,\n \"canAddMyDriveParent\": false,\n \"canRemoveMyDriveParent\": true,\n \"canMoveItemWithinDrive\": true,\n \"canShare\": true,\n \"canMoveChildrenWithinDrive\": false,\n \"canModifyContentRestriction\": true,\n \"canChangeSecurityUpdateEnabled\": false,\n \"canAcceptOwnership\": false,\n \"canReadLabels\": true,\n \"canModifyLabels\": true\n },\n \"thumbnailVersion\": \"12\",\n \"modifiedByMe\": true,\n \"permissionIds\": [\n \"07742336184153259483\"\n ],\n \"linkShareMetadata\": {\n \"securityUpdateEligible\": false,\n \"securityUpdateEnabled\": true\n }\n }\n}")
|
|
1
|
+
export default JSON.parse("{\n \"file\": {\n \"kind\": \"drive#file\",\n \"copyRequiresWriterPermission\": false,\n \"writersCanShare\": true,\n \"viewedByMe\": true,\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\",\n \"exportLinks\": {\n \"application/x-vnd.oasis.opendocument.spreadsheet\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbTmw4&exportFormat=ods\",\n \"text/tab-separated-values\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXnViTOo&exportFormat=tsv\",\n \"application/pdf\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaBViTOo&exportFormat=pdf\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbOo&exportFormat=xlsx\",\n \"text/csv\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbBViTOo&exportFormat=csv\",\n \"application/zip\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-VbTmw4Pt2BViTOo&exportFormat=zip\",\n \"application/vnd.oasis.opendocument.spreadsheet\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbViTOo&exportFormat=ods\"\n },\n \"parents\": [\n \"0ANs73yKKVA\"\n ],\n \"thumbnailLink\": \"https://docs.google.com/feeds/vt?gd=true&id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbTmw4&v=12&s=AMedNnoAAAAAZKWjrEqscucFpYCyRCJqnd0wtBiDtXYh&sz=s220\",\n \"iconLink\": \"https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.google-apps.spreadsheet\",\n \"shared\": false,\n \"lastModifyingUser\": {\n \"displayName\": \"John Doe\",\n \"kind\": \"drive#user\",\n \"me\": true,\n \"permissionId\": \"077423361841532483\",\n \"emailAddress\": \"john@doe.com\",\n \"photoLink\": \"https://lh3.googleusercontent.com/a/default-user=s64\"\n },\n \"owners\": [\n {\n \"displayName\": \"John Doe\",\n \"kind\": \"drive#user\",\n \"me\": true,\n \"permissionId\": \"07742336189483\",\n \"emailAddress\": \"john@doe.com\",\n \"photoLink\": \"https://lh3.googleusercontent.com/a/default-user=s64\"\n }\n ],\n \"webViewLink\": \"https://docs.google.com/spreadsheets/d/1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbTmwTOo/edit?usp=drivesdk\",\n \"size\": \"1024\",\n \"viewersCanCopyContent\": true,\n \"permissions\": [\n {\n \"id\": \"07742336184153259483\",\n \"displayName\": \"John Doe\",\n \"type\": \"user\",\n \"kind\": \"drive#permission\",\n \"photoLink\": \"https://lh3.googleusercontent.com/a/default-user=s64\",\n \"emailAddress\": \"john@doe.com\",\n \"role\": \"owner\",\n \"deleted\": false,\n \"pendingOwner\": false\n }\n ],\n \"hasThumbnail\": true,\n \"spaces\": [\n \"drive\"\n ],\n \"id\": \"1LmXTIQ0wqKP7T3-l9r127Maw4Pt2BViTOo\",\n \"name\": \"Pipedream 2213\",\n \"starred\": false,\n \"trashed\": false,\n \"explicitlyTrashed\": false,\n \"createdTime\": \"2023-02-06T15:13:33.023Z\",\n \"modifiedTime\": \"2023-06-28T12:52:54.570Z\",\n \"modifiedByMeTime\": \"2023-06-28T12:52:54.570Z\",\n \"viewedByMeTime\": \"2023-06-29T06:30:58.441Z\",\n \"quotaBytesUsed\": \"1024\",\n \"version\": \"53\",\n \"ownedByMe\": true,\n \"isAppAuthorized\": false,\n \"capabilities\": {\n \"canChangeViewersCanCopyContent\": true,\n \"canEdit\": true,\n \"canCopy\": true,\n \"canComment\": true,\n \"canAddChildren\": false,\n \"canDelete\": true,\n \"canDownload\": true,\n \"canListChildren\": false,\n \"canRemoveChildren\": false,\n \"canRename\": true,\n \"canTrash\": true,\n \"canReadRevisions\": true,\n \"canChangeCopyRequiresWriterPermission\": true,\n \"canMoveItemIntoTeamDrive\": true,\n \"canUntrash\": true,\n \"canModifyContent\": true,\n \"canMoveItemOutOfDrive\": true,\n \"canAddMyDriveParent\": false,\n \"canRemoveMyDriveParent\": true,\n \"canMoveItemWithinDrive\": true,\n \"canShare\": true,\n \"canMoveChildrenWithinDrive\": false,\n \"canModifyContentRestriction\": true,\n \"canChangeSecurityUpdateEnabled\": false,\n \"canAcceptOwnership\": false,\n \"canReadLabels\": true,\n \"canModifyLabels\": true\n },\n \"thumbnailVersion\": \"12\",\n \"modifiedByMe\": true,\n \"permissionIds\": [\n \"07742336184153259483\"\n ],\n \"linkShareMetadata\": {\n \"securityUpdateEligible\": false,\n \"securityUpdateEnabled\": true\n }\n }\n}");
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
key: "google_drive-new-or-modified-folders",
|
|
21
21
|
name: "New or Modified Folders (Instant)",
|
|
22
22
|
description: "Emit new event when a folder is created or modified in the selected Drive",
|
|
23
|
-
version: "0.2.
|
|
23
|
+
version: "0.2.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 when a new spreadsheet is created in a drive.",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.16",
|
|
10
10
|
props: {
|
|
11
11
|
googleDrive: newFilesInstant.props.googleDrive,
|
|
12
12
|
db: newFilesInstant.props.db,
|