diff --git a/components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs b/components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs index ae3a97a7c3574..21d45b3bee080 100644 --- a/components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs +++ b/components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs @@ -20,7 +20,7 @@ export default { name: "Share File or Folder", description: "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)", - version: "0.2.3", + version: "0.2.4", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/copy-file/copy-file.mjs b/components/google_drive/actions/copy-file/copy-file.mjs index 475f15c9c6e9a..4770ec9d02e0b 100644 --- a/components/google_drive/actions/copy-file/copy-file.mjs +++ b/components/google_drive/actions/copy-file/copy-file.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-copy-file", name: "Copy File", description: "Create a copy of the specified file. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/copy) for more information", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/create-file-from-template/create-file-from-template.mjs b/components/google_drive/actions/create-file-from-template/create-file-from-template.mjs index 2bf1f5864edda..00cc43cafc351 100644 --- a/components/google_drive/actions/create-file-from-template/create-file-from-template.mjs +++ b/components/google_drive/actions/create-file-from-template/create-file-from-template.mjs @@ -8,7 +8,7 @@ export default { key: "google_drive-create-file-from-template", name: "Create New File From Template", 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)", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/create-file-from-text/create-file-from-text.mjs b/components/google_drive/actions/create-file-from-text/create-file-from-text.mjs index a8495b54c6fa0..0c81c86615e8a 100644 --- a/components/google_drive/actions/create-file-from-text/create-file-from-text.mjs +++ b/components/google_drive/actions/create-file-from-text/create-file-from-text.mjs @@ -5,7 +5,7 @@ export default { key: "google_drive-create-file-from-text", name: "Create New File From Text", description: "Create a new file from plain text. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/create) for more information", - version: "0.2.3", + version: "0.2.4", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/create-folder/create-folder.mjs b/components/google_drive/actions/create-folder/create-folder.mjs index fd1f5d633aba8..0d3819ca3b610 100644 --- a/components/google_drive/actions/create-folder/create-folder.mjs +++ b/components/google_drive/actions/create-folder/create-folder.mjs @@ -1,19 +1,19 @@ -import googleDrive from "../../google_drive.app.mjs"; import { getListFilesOpts, toSingleLineString, } from "../../common/utils.mjs"; +import googleDrive from "../../google_drive.app.mjs"; import { - MY_DRIVE_VALUE, GOOGLE_DRIVE_FOLDER_MIME_TYPE, + MY_DRIVE_VALUE, } from "../../common/constants.mjs"; export default { key: "google_drive-create-folder", name: "Create Folder", description: "Create a new empty folder. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/create) for more information", - version: "0.1.11", + version: "0.1.12", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/create-shared-drive/create-shared-drive.mjs b/components/google_drive/actions/create-shared-drive/create-shared-drive.mjs index 8b02ba3375ece..9a7651e09fe18 100644 --- a/components/google_drive/actions/create-shared-drive/create-shared-drive.mjs +++ b/components/google_drive/actions/create-shared-drive/create-shared-drive.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-create-shared-drive", name: "Create Shared Drive", description: "Create a new shared drive. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/create) for more information", - version: "0.1.11", + version: "0.1.12", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/delete-file/delete-file.mjs b/components/google_drive/actions/delete-file/delete-file.mjs index e71c6ba631e36..d3a7a7a1136d8 100644 --- a/components/google_drive/actions/delete-file/delete-file.mjs +++ b/components/google_drive/actions/delete-file/delete-file.mjs @@ -5,7 +5,7 @@ export default { name: "Delete File", description: "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", - version: "0.1.11", + version: "0.1.12", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs b/components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs index b2b761131e7c7..d77b6264ab2f6 100644 --- a/components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs +++ b/components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-delete-shared-drive", name: "Delete Shared Drive", description: "Delete a shared drive without any content. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/delete) for more information", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/download-file/download-file.mjs b/components/google_drive/actions/download-file/download-file.mjs index edc78b2c26733..c1cf74c1ebd60 100644 --- a/components/google_drive/actions/download-file/download-file.mjs +++ b/components/google_drive/actions/download-file/download-file.mjs @@ -1,10 +1,10 @@ -import googleDrive from "../../google_drive.app.mjs"; import fs from "fs"; import stream from "stream"; import { promisify } from "util"; import { GOOGLE_DRIVE_MIME_TYPE_PREFIX } from "../../common/constants.mjs"; -import googleWorkspaceExportFormats from "../common/google-workspace-export-formats.mjs"; import { toSingleLineString } from "../../common/utils.mjs"; +import googleDrive from "../../google_drive.app.mjs"; +import googleWorkspaceExportFormats from "../common/google-workspace-export-formats.mjs"; /** * Uses Google Drive API to download files to a `filePath` in the /tmp @@ -18,7 +18,7 @@ export default { key: "google_drive-download-file", name: "Download File", description: "Download a file. [See the documentation](https://developers.google.com/drive/api/v3/manage-downloads) for more information", - version: "0.1.13", + version: "0.1.14", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/find-file/find-file.mjs b/components/google_drive/actions/find-file/find-file.mjs index 3f1ef0ea41308..c5c125eb24bf8 100644 --- a/components/google_drive/actions/find-file/find-file.mjs +++ b/components/google_drive/actions/find-file/find-file.mjs @@ -1,12 +1,12 @@ -import googleDrive from "../../google_drive.app.mjs"; -import { getListFilesOpts } from "../../common/utils.mjs"; import commonSearchQuery from "../../common/commonSearchQuery.mjs"; +import { getListFilesOpts } from "../../common/utils.mjs"; +import googleDrive from "../../google_drive.app.mjs"; export default { key: "google_drive-find-file", name: "Find File", description: "Search for a specific file by name. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/find-folder/find-folder.mjs b/components/google_drive/actions/find-folder/find-folder.mjs index 332aa6c0ca204..dfa5fb15c1f91 100644 --- a/components/google_drive/actions/find-folder/find-folder.mjs +++ b/components/google_drive/actions/find-folder/find-folder.mjs @@ -1,5 +1,5 @@ -import googleDrive from "../../google_drive.app.mjs"; import { getListFilesOpts } from "../../common/utils.mjs"; +import googleDrive from "../../google_drive.app.mjs"; import { GOOGLE_DRIVE_FOLDER_MIME_TYPE } from "../../common/constants.mjs"; @@ -7,7 +7,7 @@ export default { key: "google_drive-find-folder", name: "Find Folder", description: "Search for a specific folder by name. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/find-forms/find-forms.mjs b/components/google_drive/actions/find-forms/find-forms.mjs index 5feda3d162986..f830ae856b58a 100644 --- a/components/google_drive/actions/find-forms/find-forms.mjs +++ b/components/google_drive/actions/find-forms/find-forms.mjs @@ -1,12 +1,12 @@ -import googleDrive from "../../google_drive.app.mjs"; -import { getListFilesOpts } from "../../common/utils.mjs"; import commonSearchQuery from "../../common/commonSearchQuery.mjs"; +import { getListFilesOpts } from "../../common/utils.mjs"; +import googleDrive from "../../google_drive.app.mjs"; export default { key: "google_drive-find-forms", name: "Find Forms", 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", - version: "0.0.11", + version: "0.0.12", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs b/components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs index f527478750ffc..992bbc8642977 100644 --- a/components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs +++ b/components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs @@ -1,12 +1,12 @@ -import googleDrive from "../../google_drive.app.mjs"; -import { getListFilesOpts } from "../../common/utils.mjs"; import commonSearchQuery from "../../common/commonSearchQuery.mjs"; +import { getListFilesOpts } from "../../common/utils.mjs"; +import googleDrive from "../../google_drive.app.mjs"; export default { key: "google_drive-find-spreadsheets", name: "Find Spreadsheets", description: "Search for a specific spreadsheet by name. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/get-file-by-id/get-file-by-id.mjs b/components/google_drive/actions/get-file-by-id/get-file-by-id.mjs index 06179cf868d44..14b387e6782fd 100644 --- a/components/google_drive/actions/get-file-by-id/get-file-by-id.mjs +++ b/components/google_drive/actions/get-file-by-id/get-file-by-id.mjs @@ -5,7 +5,7 @@ export default { key: "google_drive-get-file-by-id", name: "Get File By ID", description: "Get info on a specific file. [See the documentation](https://developers.google.com/drive/api/reference/rest/v3/files/get) for more information", - version: "0.0.7", + version: "0.0.8", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs b/components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs index ebcdf64bf2bda..16f61ff5f3570 100644 --- a/components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs +++ b/components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs @@ -12,7 +12,7 @@ export default { key: "google_drive-get-folder-id-for-path", name: "Get Folder ID for a Path", description: "Retrieve a folderId for a path. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information", - version: "0.1.12", + version: "0.1.13", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/get-shared-drive/get-shared-drive.mjs b/components/google_drive/actions/get-shared-drive/get-shared-drive.mjs index 350c55af768e7..e8591f0feb505 100644 --- a/components/google_drive/actions/get-shared-drive/get-shared-drive.mjs +++ b/components/google_drive/actions/get-shared-drive/get-shared-drive.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-get-shared-drive", name: "Get Shared Drive", 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", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/list-access-proposals/list-access-proposals.mjs b/components/google_drive/actions/list-access-proposals/list-access-proposals.mjs index f2817fc0a29c9..b6604211496bb 100644 --- a/components/google_drive/actions/list-access-proposals/list-access-proposals.mjs +++ b/components/google_drive/actions/list-access-proposals/list-access-proposals.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-list-access-proposals", name: "List Access Proposals", description: "List access proposals for a file or folder. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/accessproposals/list)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/list-files/list-files.mjs b/components/google_drive/actions/list-files/list-files.mjs index b743ba7b9a66d..a7651e6754a59 100644 --- a/components/google_drive/actions/list-files/list-files.mjs +++ b/components/google_drive/actions/list-files/list-files.mjs @@ -1,11 +1,11 @@ -import googleDrive from "../../google_drive.app.mjs"; import { getListFilesOpts } from "../../common/utils.mjs"; +import googleDrive from "../../google_drive.app.mjs"; export default { key: "google_drive-list-files", name: "List Files", description: "List files from a specific folder. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/list) for more information", - version: "0.1.14", + version: "0.1.15", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs b/components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs index 744ce5d836fde..3db9138d0258b 100644 --- a/components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs +++ b/components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs @@ -1,11 +1,11 @@ -import googleDrive from "../../google_drive.app.mjs"; import { GOOGLE_DRIVE_FOLDER_MIME_TYPE } from "../../common/constants.mjs"; +import googleDrive from "../../google_drive.app.mjs"; export default { key: "google_drive-move-file-to-trash", name: "Move File to Trash", description: "Move a file or folder to trash. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/update) for more information", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/move-file/move-file.mjs b/components/google_drive/actions/move-file/move-file.mjs index c699e23c98493..82bd6c4f3ed9d 100644 --- a/components/google_drive/actions/move-file/move-file.mjs +++ b/components/google_drive/actions/move-file/move-file.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-move-file", name: "Move File", 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", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs b/components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs index 6a0c1f38b99a8..0e30d357ad7a1 100644 --- a/components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs +++ b/components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs @@ -1,11 +1,11 @@ -import googleDrive from "../../google_drive.app.mjs"; import { ConfigurationError } from "@pipedream/platform"; +import googleDrive from "../../google_drive.app.mjs"; export default { key: "google_drive-resolve-access-proposal", name: "Resolve Access Proposals", 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)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/search-shared-drives/search-shared-drives.mjs b/components/google_drive/actions/search-shared-drives/search-shared-drives.mjs index c88f2e85ddb29..4cc0e9d441e94 100644 --- a/components/google_drive/actions/search-shared-drives/search-shared-drives.mjs +++ b/components/google_drive/actions/search-shared-drives/search-shared-drives.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-search-shared-drives", name: "Search for Shared Drives", description: "Search for shared drives with query options. [See the documentation](https://developers.google.com/drive/api/v3/search-shareddrives) for more information", - version: "0.1.11", + version: "0.1.12", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/update-file/update-file.mjs b/components/google_drive/actions/update-file/update-file.mjs index 6f15872728434..1959bf8002eac 100644 --- a/components/google_drive/actions/update-file/update-file.mjs +++ b/components/google_drive/actions/update-file/update-file.mjs @@ -1,12 +1,12 @@ -import googleDrive from "../../google_drive.app.mjs"; -import { toSingleLineString } from "../../common/utils.mjs"; import { getFileStream } from "@pipedream/platform"; +import { toSingleLineString } from "../../common/utils.mjs"; +import googleDrive from "../../google_drive.app.mjs"; export default { key: "google_drive-update-file", name: "Update File", 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", - version: "2.0.2", + version: "2.0.3", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/update-shared-drive/update-shared-drive.mjs b/components/google_drive/actions/update-shared-drive/update-shared-drive.mjs index d9164ad05a5bf..a45ab0ad08425 100644 --- a/components/google_drive/actions/update-shared-drive/update-shared-drive.mjs +++ b/components/google_drive/actions/update-shared-drive/update-shared-drive.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-update-shared-drive", name: "Update Shared Drive", description: "Update an existing shared drive. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/update) for more information", - version: "0.1.10", + version: "0.1.11", type: "action", props: { googleDrive, diff --git a/components/google_drive/actions/upload-file/upload-file.mjs b/components/google_drive/actions/upload-file/upload-file.mjs index 8c180389ed695..18bd15e2732a5 100644 --- a/components/google_drive/actions/upload-file/upload-file.mjs +++ b/components/google_drive/actions/upload-file/upload-file.mjs @@ -1,18 +1,19 @@ -import googleDrive from "../../google_drive.app.mjs"; +import { + ConfigurationError, + getFileStreamAndMetadata, +} from "@pipedream/platform"; +import { GOOGLE_DRIVE_UPLOAD_TYPE_MULTIPART } from "../../common/constants.mjs"; import { omitEmptyStringValues, parseObjectEntries, } from "../../common/utils.mjs"; -import { GOOGLE_DRIVE_UPLOAD_TYPE_MULTIPART } from "../../common/constants.mjs"; -import { - getFileStreamAndMetadata, ConfigurationError, -} from "@pipedream/platform"; +import googleDrive from "../../google_drive.app.mjs"; export default { key: "google_drive-upload-file", name: "Upload File", description: "Upload a file to Google Drive. [See the documentation](https://developers.google.com/drive/api/v3/manage-uploads) for more information", - version: "2.0.3", + version: "2.0.4", type: "action", props: { googleDrive, diff --git a/components/google_drive/package.json b/components/google_drive/package.json index eb68c7e1bb052..dbf9e0b6a89d6 100644 --- a/components/google_drive/package.json +++ b/components/google_drive/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/google_drive", - "version": "1.0.4", + "version": "1.0.5", "description": "Pipedream Google_drive Components", "main": "google_drive.app.mjs", "keywords": [ diff --git a/components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs b/components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs index e5cde341b2636..6c2e283835678 100644 --- a/components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs +++ b/components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs @@ -11,8 +11,8 @@ import common from "../common-webhook.mjs"; import sampleEmit from "./test-event.mjs"; import { - GOOGLE_DRIVE_NOTIFICATION_CHANGE, GOOGLE_DRIVE_NOTIFICATION_ADD, + GOOGLE_DRIVE_NOTIFICATION_CHANGE, GOOGLE_DRIVE_NOTIFICATION_UPDATE, } from "../../common/constants.mjs"; import commonDedupeChanges from "../common-dedupe-changes.mjs"; @@ -27,7 +27,7 @@ export default { key: "google_drive-changes-to-specific-files-shared-drive", name: "Changes to Specific Files (Shared Drive)", description: "Watches for changes to specific files in a shared drive, emitting an event when a change is made to one of those files", - version: "0.2.7", + version: "0.2.8", type: "source", // Dedupe events based on the "x-goog-message-number" header for the target channel: // https://developers.google.com/drive/api/v3/push#making-watch-requests diff --git a/components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs b/components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs index a3eccf6fa221a..086d74be464ef 100644 --- a/components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs +++ b/components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs @@ -1,9 +1,9 @@ import cronParser from "cron-parser"; -import sampleEmit from "./test-event.mjs"; import includes from "lodash/includes.js"; import { v4 as uuid } from "uuid"; import { MY_DRIVE_VALUE } from "../../common/constants.mjs"; import changesToSpecificFiles from "../changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs"; +import sampleEmit from "./test-event.mjs"; /** * This source uses the Google Drive API's @@ -15,7 +15,7 @@ export default { key: "google_drive-changes-to-specific-files", name: "Changes to Specific Files", 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.", - version: "0.2.7", + version: "0.2.8", type: "source", // Dedupe events based on the "x-goog-message-number" header for the target channel: // https://developers.google.com/drive/api/v3/push#making-watch-requests diff --git a/components/google_drive/sources/new-access-proposal/new-access-proposal.mjs b/components/google_drive/sources/new-access-proposal/new-access-proposal.mjs index cb94daefb80b7..fb8100f8068dd 100644 --- a/components/google_drive/sources/new-access-proposal/new-access-proposal.mjs +++ b/components/google_drive/sources/new-access-proposal/new-access-proposal.mjs @@ -1,12 +1,12 @@ -import googleDrive from "../../google_drive.app.mjs"; import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; +import googleDrive from "../../google_drive.app.mjs"; import sampleEmit from "./test-event.mjs"; export default { key: "google_drive-new-access-proposal", name: "New Access Proposal", description: "Emit new event when a new access proposal is requested in Google Drive", - version: "0.0.3", + version: "0.0.4", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-files-instant/new-files-instant.mjs b/components/google_drive/sources/new-files-instant/new-files-instant.mjs index 2ada6f19bdd34..964b9d1d8871b 100644 --- a/components/google_drive/sources/new-files-instant/new-files-instant.mjs +++ b/components/google_drive/sources/new-files-instant/new-files-instant.mjs @@ -1,16 +1,16 @@ -import common from "../common-webhook.mjs"; -import sampleEmit from "./test-event.mjs"; import { GOOGLE_DRIVE_NOTIFICATION_ADD, GOOGLE_DRIVE_NOTIFICATION_CHANGE, } from "../../common/constants.mjs"; +import common from "../common-webhook.mjs"; +import sampleEmit from "./test-event.mjs"; export default { ...common, key: "google_drive-new-files-instant", name: "New Files (Instant)", description: "Emit new event when a new file is added in your linked Google Drive", - version: "0.1.15", + version: "0.1.16", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs b/components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs index 68672477af00a..44a2e33af0da9 100644 --- a/components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs +++ b/components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs @@ -1,13 +1,13 @@ +import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; import googleDrive from "../../google_drive.app.mjs"; import sourceComponent from "../new-files-instant/new-files-instant.mjs"; import sampleEmit from "../new-files-instant/test-event.mjs"; -import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; export default { key: "google_drive-new-files-shared-drive", name: "New Files (Shared Drive)", description: "Emit new event when a new file is added in your shared Google Drive", - version: "0.0.4", + version: "0.0.5", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs b/components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs index 0135ec1aae5ec..eb52944f363ee 100644 --- a/components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs +++ b/components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs @@ -8,8 +8,8 @@ // 1) The HTTP requests tied to changes in the user's Google Drive // 2) A timer that runs on regular intervals, renewing the notification channel as needed -import common from "../common-webhook.mjs"; import { GOOGLE_DRIVE_NOTIFICATION_CHANGE } from "../../common/constants.mjs"; +import common from "../common-webhook.mjs"; export default { ...common, @@ -17,7 +17,7 @@ export default { name: "New or Modified Comments (Instant)", description: "Emit new event when a comment is created or modified in the selected file", - version: "1.0.6", + version: "1.0.7", type: "source", // Dedupe events based on the "x-goog-message-number" header for the target channel: // https://developers.google.com/drive/api/v3/push#making-watch-requests diff --git a/components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs b/components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs index 0bb94c2e75f5c..237738a3c97a0 100644 --- a/components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs +++ b/components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs @@ -8,14 +8,14 @@ // 1) The HTTP requests tied to changes in the user's Google Drive // 2) A timer that runs on regular intervals, renewing the notification channel as needed -import common from "../common-webhook.mjs"; -import sampleEmit from "./test-event.mjs"; import { GOOGLE_DRIVE_NOTIFICATION_ADD, GOOGLE_DRIVE_NOTIFICATION_CHANGE, GOOGLE_DRIVE_NOTIFICATION_UPDATE, } from "../../common/constants.mjs"; import commonDedupeChanges from "../common-dedupe-changes.mjs"; +import common from "../common-webhook.mjs"; +import sampleEmit from "./test-event.mjs"; const { googleDrive } = common.props; @@ -24,7 +24,7 @@ export default { key: "google_drive-new-or-modified-files", name: "New or Modified Files (Instant)", description: "Emit new event when a file in the selected Drive is created, modified or trashed.", - version: "0.3.7", + version: "0.3.8", type: "source", // Dedupe events based on the "x-goog-message-number" header for the target channel: // https://developers.google.com/drive/api/v3/push#making-watch-requests diff --git a/components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs b/components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs index 91b3f7223b1f2..38f7990780b13 100644 --- a/components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs +++ b/components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs @@ -8,23 +8,44 @@ // 1) The HTTP requests tied to changes in the user's Google Drive // 2) A timer that runs on regular intervals, renewing the notification channel as needed -import common from "../common-webhook.mjs"; import { GOOGLE_DRIVE_NOTIFICATION_ADD, GOOGLE_DRIVE_NOTIFICATION_CHANGE, GOOGLE_DRIVE_NOTIFICATION_UPDATE, } from "../../common/constants.mjs"; +import common from "../common-webhook.mjs"; export default { ...common, key: "google_drive-new-or-modified-folders", name: "New or Modified Folders (Instant)", description: "Emit new event when a folder is created or modified in the selected Drive", - version: "0.1.12", + version: "0.2.0", type: "source", // Dedupe events based on the "x-goog-message-number" header for the target channel: // https://developers.google.com/drive/api/v3/push#making-watch-requests dedupe: "unique", + props: { + ...common.props, + folderId: { + propDefinition: [ + common.props.googleDrive, + "folderId", + (c) => ({ + drive: c.drive, + }), + ], + label: "Parent Folder", + description: "The ID of the parent folder which contains the folders. If not specified, it will watch all folders from the drive's top-level folder.", + optional: true, + }, + includeSubfolders: { + type: "boolean", + label: "Include Subfolders", + description: "Whether to include subfolders of the parent folder in the changes.", + optional: true, + }, + }, hooks: { async deploy() { const daysAgo = new Date(); @@ -34,12 +55,11 @@ export default { const args = this.getListFilesOpts({ q: `mimeType = "application/vnd.google-apps.folder" and modifiedTime > "${timeString}" and trashed = false`, fields: "files(id, mimeType)", - pageSize: 5, }); const { files } = await this.googleDrive.listFilesInPage(null, args); - await this.processChanges(files); + await this.processChanges(files, null, 5); }, ...common.hooks, }, @@ -58,6 +78,24 @@ export default { GOOGLE_DRIVE_NOTIFICATION_UPDATE, ]; }, + async getAllParents(folderId) { + const allParents = []; + let currentId = folderId; + + while (currentId) { + const folder = await this.googleDrive.getFile(currentId, { + fields: "parents", + }); + const parents = folder.parents; + + if (parents && parents.length > 0) { + allParents.push(parents[0]); + } + currentId = parents?.[0]; + } + + return allParents; + }, generateMeta(data, ts) { const { id: fileId, @@ -86,29 +124,51 @@ export default { }, }; }, - async processChanges(changedFiles, headers) { + async processChanges(changedFiles, headers, maxResults) { const files = changedFiles.filter( // API docs that define Google Drive folders: // https://developers.google.com/drive/api/v3/folder (file) => file.mimeType === "application/vnd.google-apps.folder", ); + const filteredFiles = []; for (const file of files) { // The changelog is updated each time a folder is opened. Check the // folder's `modifiedTime` to see if the folder has been modified. const fileInfo = await this.googleDrive.getFile(file.id); + const root = await this.googleDrive.getFile(this.drive === "My Drive" + ? "root" + : this.drive); + + const allParents = []; + if (this.includeSubfolders) { + allParents.push(...(await this.getAllParents(file.id))); + } else { + allParents.push(fileInfo.parents[0]); + } + + if (!allParents.includes(this.folderId || root.id)) { + continue; + } + filteredFiles.push(fileInfo); + } + + if (maxResults && filteredFiles.length >= maxResults) { + filteredFiles.length = maxResults; + } + for (const file of filteredFiles) { const lastModifiedTimeForFile = this._getLastModifiedTimeForFile(file.id); - const modifiedTime = Date.parse(fileInfo.modifiedTime); + const modifiedTime = Date.parse(file.modifiedTime); if (lastModifiedTimeForFile == modifiedTime) continue; const changes = await this.getChanges(headers); const eventToEmit = { - file: fileInfo, + file, ...changes, }; - const meta = this.generateMeta(fileInfo, modifiedTime); + const meta = this.generateMeta(file, modifiedTime); this.$emit(eventToEmit, meta); diff --git a/components/google_drive/sources/new-shared-drive/new-shared-drive.mjs b/components/google_drive/sources/new-shared-drive/new-shared-drive.mjs index 1097bbb40554a..38d866d3ef1f6 100644 --- a/components/google_drive/sources/new-shared-drive/new-shared-drive.mjs +++ b/components/google_drive/sources/new-shared-drive/new-shared-drive.mjs @@ -1,11 +1,11 @@ -import googleDrive from "../../google_drive.app.mjs"; import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; +import googleDrive from "../../google_drive.app.mjs"; export default { key: "google_drive-new-shared-drive", name: "New Shared Drive", description: "Emits a new event any time a shared drive is created.", - version: "0.1.10", + version: "0.1.11", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs b/components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs index ad9d671cc4340..bfab64aebbfb9 100644 --- a/components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs +++ b/components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs @@ -6,7 +6,7 @@ export default { type: "source", name: "New Spreadsheet (Instant)", description: "Emit new event when a new spreadsheet is created in a drive.", - version: "0.1.12", + version: "0.1.13", props: { googleDrive: newFilesInstant.props.googleDrive, db: newFilesInstant.props.db, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af111effa0004..880ebe1f50564 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13014,8 +13014,7 @@ importers: specifier: ^1.4.0 version: 1.6.6 - components/siteglide: - specifiers: {} + components/siteglide: {} components/siteleaf: dependencies: