@pipedream/google_drive 0.6.18 → 0.6.19

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.
Files changed (34) hide show
  1. package/actions/add-file-sharing-preference/add-file-sharing-preference.mjs +1 -1
  2. package/actions/copy-file/copy-file.mjs +1 -1
  3. package/actions/create-file/create-file.mjs +1 -1
  4. package/actions/create-file-from-template/create-file-from-template.mjs +1 -1
  5. package/actions/create-file-from-text/create-file-from-text.mjs +1 -1
  6. package/actions/create-folder/create-folder.mjs +1 -1
  7. package/actions/create-shared-drive/create-shared-drive.mjs +1 -1
  8. package/actions/delete-file/delete-file.mjs +1 -1
  9. package/actions/delete-shared-drive/delete-shared-drive.mjs +1 -1
  10. package/actions/download-file/download-file.mjs +1 -1
  11. package/actions/find-file/find-file.mjs +1 -1
  12. package/actions/find-folder/find-folder.mjs +1 -1
  13. package/actions/find-forms/find-forms.mjs +1 -1
  14. package/actions/find-spreadsheets/find-spreadsheets.mjs +1 -1
  15. package/actions/get-folder-id-for-path/get-folder-id-for-path.mjs +1 -1
  16. package/actions/get-shared-drive/get-shared-drive.mjs +1 -1
  17. package/actions/list-files/list-files.mjs +1 -1
  18. package/actions/move-file/move-file.mjs +1 -1
  19. package/actions/move-file-to-trash/move-file-to-trash.mjs +1 -1
  20. package/actions/replace-file/replace-file.mjs +1 -1
  21. package/actions/search-shared-drives/search-shared-drives.mjs +1 -1
  22. package/actions/update-file/update-file.mjs +1 -1
  23. package/actions/update-shared-drive/update-shared-drive.mjs +1 -1
  24. package/actions/upload-file/upload-file.mjs +1 -1
  25. package/google_drive.app.mjs +9 -8
  26. package/package.json +1 -1
  27. package/sources/changes-to-specific-files/changes-to-specific-files.mjs +6 -6
  28. package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs +1 -1
  29. package/sources/new-files-instant/new-files-instant.mjs +1 -1
  30. package/sources/new-or-modified-comments/new-or-modified-comments.mjs +1 -1
  31. package/sources/new-or-modified-files/new-or-modified-files.mjs +1 -1
  32. package/sources/new-or-modified-folders/new-or-modified-folders.mjs +1 -1
  33. package/sources/new-shared-drive/new-shared-drive.mjs +1 -1
  34. package/sources/new-spreadsheet/new-spreadsheet.mjs +1 -1
@@ -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.3",
14
+ version: "0.1.4",
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.2",
7
+ version: "0.1.3",
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.4",
10
+ version: "0.1.5",
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.2",
11
+ version: "0.1.3",
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.2",
8
+ version: "0.1.3",
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.2",
16
+ version: "0.1.3",
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.2",
7
+ version: "0.1.3",
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.2",
8
+ version: "0.1.3",
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.2",
7
+ version: "0.1.3",
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.2",
21
+ version: "0.1.3",
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.2",
8
+ version: "0.1.3",
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.2",
10
+ version: "0.1.3",
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.3",
8
+ version: "0.0.4",
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.2",
8
+ version: "0.1.3",
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.2",
15
+ version: "0.1.3",
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.2",
7
+ version: "0.1.3",
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.6",
8
+ version: "0.1.7",
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 docs](https://developers.google.com/drive/api/v3/reference/files/update) for more information",
7
- version: "0.1.2",
7
+ version: "0.1.3",
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.2",
8
+ version: "0.1.3",
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.2",
18
+ version: "0.1.3",
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.2",
7
+ version: "0.1.3",
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.2",
11
+ version: "0.1.3",
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.2",
7
+ version: "0.1.3",
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.4",
13
+ version: "0.1.5",
14
14
  type: "action",
15
15
  props: {
16
16
  googleDrive,
@@ -816,8 +816,6 @@ export default {
816
816
  };
817
817
  },
818
818
  async activateFileHook(channelID, url, fileId) {
819
- channelID = channelID || uuid();
820
-
821
819
  const {
822
820
  expiration,
823
821
  resourceId,
@@ -830,7 +828,6 @@ export default {
830
828
  return {
831
829
  expiration,
832
830
  resourceId,
833
- channelID,
834
831
  };
835
832
  },
836
833
  async deactivateHook(channelID, resourceId) {
@@ -905,13 +902,18 @@ export default {
905
902
  newChannelID,
906
903
  };
907
904
  },
908
- async renewFileSubscription(subscription, url, channelID, fileId, nextRunTimestamp) {
905
+ async renewFileSubscription(
906
+ subscription,
907
+ url,
908
+ channelID,
909
+ newChannelID,
910
+ fileId,
911
+ nextRunTimestamp,
912
+ ) {
909
913
  if (nextRunTimestamp && subscription?.expiration < nextRunTimestamp) {
910
914
  return subscription;
911
915
  }
912
916
 
913
- const newChannelID = channelID || uuid();
914
-
915
917
  if (subscription?.resourceId) {
916
918
  console.log(
917
919
  `Notifications for resource ${subscription.resourceId} are expiring at ${subscription.expiration}. Renewing`,
@@ -925,13 +927,12 @@ export default {
925
927
  expiration,
926
928
  resourceId,
927
929
  } = await this.watchFile(
928
- channelID,
930
+ newChannelID,
929
931
  url,
930
932
  fileId,
931
933
  );
932
934
 
933
935
  return {
934
- newChannelID,
935
936
  expiration,
936
937
  resourceId,
937
938
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/google_drive",
3
- "version": "0.6.18",
3
+ "version": "0.6.19",
4
4
  "description": "Pipedream Google_drive Components",
5
5
  "main": "google_drive.app.mjs",
6
6
  "keywords": [
@@ -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.4",
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
@@ -48,7 +48,7 @@ export default {
48
48
  // You can pass the same channel ID in watch requests for multiple files, so
49
49
  // our channel ID is fixed for this component to simplify the state we have to
50
50
  // keep track of.
51
- const channelID = this._getChannelID() || uuid();
51
+ const channelID = uuid();
52
52
 
53
53
  // Subscriptions are keyed on Google's resourceID, "an opaque value that
54
54
  // identifies the watched resource". This value is included in request
@@ -116,10 +116,9 @@ export default {
116
116
  }
117
117
  },
118
118
  async renewFileSubscriptions(event) {
119
- // Assume subscription & channelID may all be undefined at
120
- // this point Handle their absence appropriately.
121
119
  const subscriptions = this._getSubscriptions() || {};
122
- const channelID = this._getChannelID() || uuid();
120
+ const channelID = this._getChannelID();
121
+ const newChannelID = uuid();
123
122
 
124
123
  const nextRunTimestamp = this._getNextTimerEventTimestamp(event);
125
124
 
@@ -140,6 +139,7 @@ export default {
140
139
  subscription,
141
140
  this.http.endpoint,
142
141
  channelID,
142
+ newChannelID,
143
143
  fileID,
144
144
  nextRunTimestamp,
145
145
  );
@@ -149,7 +149,7 @@ export default {
149
149
  };
150
150
  }
151
151
  this._setSubscriptions(subscriptions);
152
- this._setChannelID(channelID);
152
+ this._setChannelID(newChannelID);
153
153
  },
154
154
  },
155
155
  async run(event) {
@@ -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.4",
29
+ version: "0.1.5",
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.5",
13
+ version: "0.1.6",
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.5",
20
+ version: "0.1.6",
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.1",
24
+ version: "0.2.2",
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.3",
23
+ version: "0.1.4",
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
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_drive-new-shared-drive",
6
6
  name: "New Shared Drive",
7
7
  description: "Emits a new event any time a shared drive is created.",
8
- version: "0.1.2",
8
+ version: "0.1.3",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
@@ -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.3",
9
+ version: "0.1.4",
10
10
  props: {
11
11
  googleDrive: newFilesInstant.props.googleDrive,
12
12
  db: newFilesInstant.props.db,