Skip to content

Commit e45fc90

Browse files
authored
Merging pull request #18153
* new components * pnpm-lock.yaml * versions * pnpm-lock.yaml * fix typo
1 parent 04803d2 commit e45fc90

File tree

16 files changed

+245
-11
lines changed

16 files changed

+245
-11
lines changed

components/google_docs/actions/append-image/append-image.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "google_docs-append-image",
55
name: "Append Image to Document",
66
description: "Appends an image to the end of a document. [See the documentation](https://developers.google.com/docs/api/reference/rest/v1/documents/request#InsertInlineImageRequest)",
7-
version: "0.0.7",
7+
version: "0.0.8",
88
type: "action",
99
props: {
1010
googleDocs,

components/google_docs/actions/append-text/append-text.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "google_docs-append-text",
55
name: "Append Text",
66
description: "Append text to an existing document. [See the documentation](https://developers.google.com/docs/api/reference/rest/v1/documents/request#InsertTextRequest)",
7-
version: "0.1.6",
7+
version: "0.1.7",
88
type: "action",
99
props: {
1010
googleDocs,

components/google_docs/actions/create-document-from-template/create-document-from-template.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
...others,
1414
key: "google_docs-create-document-from-template",
1515
name: "Create New Document From Template",
16-
version: "0.0.2",
16+
version: "0.0.3",
1717
description,
1818
type,
1919
props: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "google_docs-create-document",
55
name: "Create a New Document",
66
description: "Create a new document. [See the documentation](https://developers.google.com/docs/api/reference/rest/v1/documents/create)",
7-
version: "0.1.6",
7+
version: "0.1.7",
88
type: "action",
99
props: {
1010
googleDocs,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default {
1414
...others,
1515
key: "google_docs-find-document",
1616
name: "Find Document",
17-
version: "0.0.2",
17+
version: "0.0.3",
1818
description,
1919
type,
2020
props: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "google_docs-get-document",
66
name: "Get Document",
77
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)",
8-
version: "0.1.6",
8+
version: "0.1.7",
99
type: "action",
1010
props: {
1111
googleDocs,
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import googleDocs from "../../google_docs.app.mjs";
2+
3+
export default {
4+
key: "google_docs-get-tab-content",
5+
name: "Get Tab Content",
6+
description: "Get the content of a tab in a document. [See the documentation](https://developers.google.com/docs/api/reference/rest/v1/documents/get)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
googleDocs,
11+
docId: {
12+
propDefinition: [
13+
googleDocs,
14+
"docId",
15+
],
16+
},
17+
tabIds: {
18+
type: "string[]",
19+
label: "Tab IDs",
20+
description: "Return content for the specified tabs",
21+
async options() {
22+
const { tabs } = await this.googleDocs.getDocument(this.docId, true);
23+
if (!tabs?.length) return [];
24+
return tabs.map((tab) => ({
25+
label: tab.tabProperties.title,
26+
value: tab.tabProperties.tabId,
27+
}));
28+
},
29+
},
30+
},
31+
async run({ $ }) {
32+
const response = await this.googleDocs.getDocument(this.docId, true);
33+
const tabs = response.tabs.filter((tab) => this.tabIds.includes(tab.tabProperties.tabId));
34+
$.export("$summary", `Successfully retrieved tab content for document with ID: ${this.docId}`);
35+
return tabs;
36+
},
37+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import googleDocs from "../../google_docs.app.mjs";
2+
3+
export default {
4+
key: "google_docs-insert-page-break",
5+
name: "Insert Page Break",
6+
description: "Insert a page break into a document. [See the documentation](https://developers.google.com/workspace/docs/api/reference/rest/v1/documents/request#insertpagebreakrequest)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
googleDocs,
11+
docId: {
12+
propDefinition: [
13+
googleDocs,
14+
"docId",
15+
],
16+
},
17+
index: {
18+
type: "integer",
19+
label: "Index",
20+
description: "The index to insert the page break at",
21+
default: 1,
22+
optional: true,
23+
},
24+
tabId: {
25+
propDefinition: [
26+
googleDocs,
27+
"tabId",
28+
(c) => ({
29+
documentId: c.docId,
30+
}),
31+
],
32+
},
33+
},
34+
async run({ $ }) {
35+
const pageBreak = {
36+
location: {
37+
index: this.index,
38+
tabId: this.tabId,
39+
},
40+
};
41+
await this.googleDocs.insertPageBreak(this.docId, pageBreak);
42+
$.export("$summary", "Successfully inserted page break");
43+
return this.googleDocs.getDocument(this.docId, !!this.tabId);
44+
},
45+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import googleDocs from "../../google_docs.app.mjs";
2+
3+
export default {
4+
key: "google_docs-insert-table",
5+
name: "Insert Table",
6+
description: "Insert a table into a document. [See the documentation](https://developers.google.com/workspace/docs/api/reference/rest/v1/documents/request#inserttablerequest)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
googleDocs,
11+
docId: {
12+
propDefinition: [
13+
googleDocs,
14+
"docId",
15+
],
16+
},
17+
rows: {
18+
type: "integer",
19+
label: "Rows",
20+
description: "The number of rows in the table",
21+
},
22+
columns: {
23+
type: "integer",
24+
label: "Columns",
25+
description: "The number of columns in the table",
26+
},
27+
index: {
28+
type: "integer",
29+
label: "Index",
30+
description: "The index to insert the table at",
31+
default: 1,
32+
optional: true,
33+
},
34+
tabId: {
35+
propDefinition: [
36+
googleDocs,
37+
"tabId",
38+
(c) => ({
39+
documentId: c.docId,
40+
}),
41+
],
42+
},
43+
},
44+
async run({ $ }) {
45+
const table = {
46+
rows: this.rows,
47+
columns: this.columns,
48+
location: {
49+
index: this.index,
50+
tabId: this.tabId,
51+
},
52+
};
53+
await this.googleDocs.insertTable(this.docId, table);
54+
$.export("$summary", "Successfully inserted table");
55+
return this.googleDocs.getDocument(this.docId, !!this.tabId);
56+
},
57+
};
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import googleDocs from "../../google_docs.app.mjs";
2+
3+
export default {
4+
key: "google_docs-insert-text",
5+
name: "Insert Text",
6+
description: "Insert text into a document. [See the documentation](https://developers.google.com/workspace/docs/api/reference/rest/v1/documents/request#inserttextrequest)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
googleDocs,
11+
docId: {
12+
propDefinition: [
13+
googleDocs,
14+
"docId",
15+
],
16+
},
17+
text: {
18+
propDefinition: [
19+
googleDocs,
20+
"text",
21+
],
22+
},
23+
index: {
24+
type: "integer",
25+
label: "Index",
26+
description: "The index to insert the text at",
27+
default: 1,
28+
optional: true,
29+
},
30+
tabId: {
31+
propDefinition: [
32+
googleDocs,
33+
"tabId",
34+
(c) => ({
35+
documentId: c.docId,
36+
}),
37+
],
38+
},
39+
},
40+
async run({ $ }) {
41+
const text = {
42+
text: this.text,
43+
location: {
44+
index: this.index,
45+
tabId: this.tabId,
46+
},
47+
};
48+
await this.googleDocs._batchUpdate(this.docId, "insertText", text);
49+
$.export("$summary", "Successfully inserted text");
50+
return this.googleDocs.getDocument(this.docId, !!this.tabId);
51+
},
52+
};

0 commit comments

Comments
 (0)