@pipedream/google_drive 0.8.6 → 0.8.8
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/create-file-from-text/create-file-from-text.mjs +49 -7
- package/package.json +1 -1
- package/sources/changes-to-specific-files/changes-to-specific-files.mjs +1 -1
- package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs +1 -1
- package/sources/common-webhook.mjs +1 -0
- package/sources/new-files-instant/new-files-instant.mjs +1 -1
- package/sources/new-or-modified-comments/new-or-modified-comments.mjs +1 -1
- package/sources/new-or-modified-files/new-or-modified-files.mjs +1 -1
- package/sources/new-or-modified-folders/new-or-modified-folders.mjs +1 -1
- package/sources/new-spreadsheet/new-spreadsheet.mjs +1 -1
@@ -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.
|
8
|
+
version: "0.2.0",
|
9
9
|
type: "action",
|
10
10
|
props: {
|
11
11
|
googleDrive,
|
@@ -44,24 +44,66 @@ export default {
|
|
44
44
|
optional: true,
|
45
45
|
default: "",
|
46
46
|
},
|
47
|
+
mimeType: {
|
48
|
+
type: "string",
|
49
|
+
label: "Conversion Format",
|
50
|
+
description:
|
51
|
+
"The [format](https://developers.google.com/drive/api/v3/ref-export-formats) in which the text is presented",
|
52
|
+
optional: true,
|
53
|
+
default: "text/plain",
|
54
|
+
options: [
|
55
|
+
{
|
56
|
+
value: "text/plain",
|
57
|
+
label: "Plain Text",
|
58
|
+
},
|
59
|
+
{
|
60
|
+
value: "text/markdown",
|
61
|
+
label: "Markdown",
|
62
|
+
},
|
63
|
+
{
|
64
|
+
value: "text/html",
|
65
|
+
label: "HTML",
|
66
|
+
},
|
67
|
+
{
|
68
|
+
value: "application/rtf",
|
69
|
+
label: "Rich Text",
|
70
|
+
},
|
71
|
+
{
|
72
|
+
value: "text/csv",
|
73
|
+
label: "CSV",
|
74
|
+
},
|
75
|
+
],
|
76
|
+
},
|
47
77
|
},
|
48
78
|
async run({ $ }) {
|
49
79
|
const {
|
50
80
|
parentId,
|
51
81
|
name,
|
52
82
|
content,
|
83
|
+
mimeType,
|
53
84
|
} = this;
|
54
85
|
const file = Readable.from([
|
55
86
|
content,
|
56
87
|
]);
|
88
|
+
const drive = this.googleDrive.drive();
|
57
89
|
const driveId = this.googleDrive.getDriveId(this.drive);
|
58
|
-
const
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
90
|
+
const parent = parentId ?? driveId;
|
91
|
+
|
92
|
+
const { data: resp } = await drive.files.create({
|
93
|
+
supportsAllDrives: true,
|
94
|
+
media: {
|
95
|
+
mimeType,
|
96
|
+
body: file,
|
97
|
+
},
|
98
|
+
requestBody: {
|
99
|
+
name,
|
100
|
+
mimeType: "application/vnd.google-apps.document",
|
101
|
+
parents: [
|
102
|
+
parent,
|
103
|
+
],
|
104
|
+
},
|
64
105
|
});
|
106
|
+
|
65
107
|
$.export("$summary", `Successfully created a new file, "${resp.name}"`);
|
66
108
|
return resp;
|
67
109
|
},
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@ export default {
|
|
15
15
|
key: "google_drive-changes-to-specific-files",
|
16
16
|
name: "Changes to Specific Files",
|
17
17
|
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.2.
|
18
|
+
version: "0.2.4",
|
19
19
|
type: "source",
|
20
20
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
21
21
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs
CHANGED
@@ -27,7 +27,7 @@ export default {
|
|
27
27
|
key: "google_drive-changes-to-specific-files-shared-drive",
|
28
28
|
name: "Changes to Specific Files (Shared Drive)",
|
29
29
|
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.2.
|
30
|
+
version: "0.2.4",
|
31
31
|
type: "source",
|
32
32
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
33
33
|
// 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 when a new file is added in your linked Google Drive",
|
13
|
-
version: "0.1.
|
13
|
+
version: "0.1.11",
|
14
14
|
type: "source",
|
15
15
|
dedupe: "unique",
|
16
16
|
props: {
|
@@ -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.3",
|
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
|
@@ -24,7 +24,7 @@ export default {
|
|
24
24
|
key: "google_drive-new-or-modified-files",
|
25
25
|
name: "New or Modified Files (Instant)",
|
26
26
|
description: "Emit new event when a file in the selected Drive is created, modified or trashed.",
|
27
|
-
version: "0.3.
|
27
|
+
version: "0.3.4",
|
28
28
|
type: "source",
|
29
29
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
30
30
|
// 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 (Instant)",
|
22
22
|
description: "Emit new event when a folder is created or modified in the selected Drive",
|
23
|
-
version: "0.1.
|
23
|
+
version: "0.1.9",
|
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.9",
|
10
10
|
props: {
|
11
11
|
googleDrive: newFilesInstant.props.googleDrive,
|
12
12
|
db: newFilesInstant.props.db,
|