Skip to content

Commit 94f17f8

Browse files
committed
add support for tabs content
1 parent 7224a54 commit 94f17f8

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

components/google_docs/actions/get-document/get-document.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "google_docs-get-document",
55
name: "Get Document",
66
description: "Get the contents of the latest version of a document. [See the documentation](https://developers.google.com/docs/api/reference/rest/v1/documents/get)",
7-
version: "0.1.4",
7+
version: "0.1.5",
88
type: "action",
99
props: {
1010
googleDocs,
@@ -14,9 +14,15 @@ export default {
1414
"docId",
1515
],
1616
},
17+
includeTabsContent: {
18+
type: "boolean",
19+
label: "Include Tabs Content",
20+
description: "Whether to populate the `Document.tabs` field instead of the text content fields like `body` and `documentStyle` on `Document`",
21+
default: false,
22+
},
1723
},
1824
async run({ $ }) {
19-
const response = await this.googleDocs.getDocument(this.docId);
25+
const response = await this.googleDocs.getDocument(this.docId, this.includeTabsContent);
2026

2127
$.export("$summary", `Successfully retrieved document with ID: ${this.docId}`);
2228

components/google_docs/google_docs.app.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,14 @@ export default {
102102
},
103103
});
104104
},
105-
async getDocument(documentId) {
105+
async getDocument(documentId, includeTabsContent = false) {
106106
const { data } = await this.docs().documents.get({
107107
documentId,
108+
includeTabsContent,
108109
});
109-
const doc = utils.addTextContentToDocument(data);
110+
const doc = includeTabsContent
111+
? data
112+
: utils.addTextContentToDocument(data);
110113
return doc;
111114
},
112115
async createEmptyDoc(title) {

components/google_docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/google_docs",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"description": "Pipedream Google_docs Components",
55
"main": "google_docs.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)