@pipedream/google_slides 0.2.0 → 0.4.0
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-image/create-image.mjs +6 -1
- package/actions/create-page-element/create-page-element.mjs +6 -1
- package/actions/create-presentation/create-presentation.mjs +6 -1
- package/actions/create-slide/create-slide.mjs +6 -1
- package/actions/create-table/create-table.mjs +93 -0
- package/actions/delete-page-element/delete-page-element.mjs +6 -1
- package/actions/delete-slide/delete-slide.mjs +6 -1
- package/actions/delete-table-column/delete-table-column.mjs +57 -0
- package/actions/delete-table-row/delete-table-row.mjs +57 -0
- package/actions/find-presentation/find-presentation.mjs +6 -1
- package/actions/insert-table-columns/insert-table-columns.mjs +73 -0
- package/actions/insert-table-rows/insert-table-rows.mjs +73 -0
- package/actions/insert-text/insert-text.mjs +6 -1
- package/actions/insert-text-into-table/insert-text-into-table.mjs +78 -0
- package/actions/merge-data/merge-data.mjs +6 -1
- package/actions/refresh-chart/refresh-chart.mjs +6 -1
- package/actions/replace-all-text/replace-all-text.mjs +64 -0
- package/google_slides.app.mjs +84 -1
- package/package.json +2 -2
- package/sources/new-presentation/new-presentation.mjs +3 -1
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "google_slides-create-image",
|
|
5
5
|
name: "Create Image",
|
|
6
6
|
description: "Creates an image in a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateImageRequest)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
googleSlides,
|
|
@@ -5,7 +5,12 @@ export default {
|
|
|
5
5
|
key: "google_slides-create-page-element",
|
|
6
6
|
name: "Create Page Element",
|
|
7
7
|
description: "Create a new page element in a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateShapeRequest)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.4",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: false,
|
|
13
|
+
},
|
|
9
14
|
type: "action",
|
|
10
15
|
props: {
|
|
11
16
|
googleSlides,
|
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "google_slides-create-presentation",
|
|
5
5
|
name: "Create Presentation",
|
|
6
6
|
description: "Create a blank presentation or duplicate an existing presentation. [See the docs here](https://developers.google.com/slides/api/guides/presentations#copy_an_existing_presentation)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.7",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
app,
|
|
@@ -5,7 +5,12 @@ export default {
|
|
|
5
5
|
key: "google_slides-create-slide",
|
|
6
6
|
name: "Create Slide",
|
|
7
7
|
description: "Create a new slide in a presentation. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateSlideRequest)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.4",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: false,
|
|
13
|
+
},
|
|
9
14
|
type: "action",
|
|
10
15
|
props: {
|
|
11
16
|
googleSlides,
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import googleSlides from "../../google_slides.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_slides-create-table",
|
|
5
|
+
name: "Create Table",
|
|
6
|
+
description: "Create a new table in a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateTableRequest)",
|
|
7
|
+
version: "0.0.3",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
googleSlides,
|
|
16
|
+
presentationId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
googleSlides,
|
|
19
|
+
"presentationId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
slideId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
googleSlides,
|
|
25
|
+
"slideId",
|
|
26
|
+
(c) => ({
|
|
27
|
+
presentationId: c.presentationId,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
rows: {
|
|
32
|
+
type: "integer",
|
|
33
|
+
label: "Rows",
|
|
34
|
+
description: "The number of rows in the table",
|
|
35
|
+
},
|
|
36
|
+
columns: {
|
|
37
|
+
type: "integer",
|
|
38
|
+
label: "Columns",
|
|
39
|
+
description: "The number of columns in the table",
|
|
40
|
+
},
|
|
41
|
+
height: {
|
|
42
|
+
type: "integer",
|
|
43
|
+
label: "Height",
|
|
44
|
+
description: "The height of the shape in points (1/72 of an inch)",
|
|
45
|
+
},
|
|
46
|
+
width: {
|
|
47
|
+
type: "integer",
|
|
48
|
+
label: "Width",
|
|
49
|
+
description: "The width of the shape in points (1/72 of an inch)",
|
|
50
|
+
},
|
|
51
|
+
translateX: {
|
|
52
|
+
type: "integer",
|
|
53
|
+
label: "Translate X",
|
|
54
|
+
description: "The translation of the table on the x-axis",
|
|
55
|
+
optional: true,
|
|
56
|
+
},
|
|
57
|
+
translateY: {
|
|
58
|
+
type: "integer",
|
|
59
|
+
label: "Translate Y",
|
|
60
|
+
description: "The translation of the table on the y-axis",
|
|
61
|
+
optional: true,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
async run({ $ }) {
|
|
65
|
+
const response = await this.googleSlides.createTable(this.presentationId, {
|
|
66
|
+
elementProperties: {
|
|
67
|
+
pageObjectId: this.slideId,
|
|
68
|
+
size: {
|
|
69
|
+
height: {
|
|
70
|
+
magnitude: this.height,
|
|
71
|
+
unit: "PT",
|
|
72
|
+
},
|
|
73
|
+
width: {
|
|
74
|
+
magnitude: this.width,
|
|
75
|
+
unit: "PT",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
transform: {
|
|
79
|
+
scaleX: 1,
|
|
80
|
+
scaleY: 1,
|
|
81
|
+
translateX: this.translateX,
|
|
82
|
+
translateY: this.translateY,
|
|
83
|
+
unit: "PT",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
rows: this.rows,
|
|
87
|
+
columns: this.columns,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
$.export("$summary", "Successfully created table in the slide");
|
|
91
|
+
return response.data;
|
|
92
|
+
},
|
|
93
|
+
};
|
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "google_slides-delete-page-element",
|
|
5
5
|
name: "Delete Page Element",
|
|
6
6
|
description: "Deletes a page element from a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteObjectRequest)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
googleSlides,
|
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "google_slides-delete-slide",
|
|
5
5
|
name: "Delete Slide",
|
|
6
6
|
description: "Deletes a slide from a presentation. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteObjectRequest)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
googleSlides,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import googleSlides from "../../google_slides.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_slides-delete-table-column",
|
|
5
|
+
name: "Delete Table Column",
|
|
6
|
+
description: "Delete column from a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteTableColumnRequest)",
|
|
7
|
+
version: "0.0.3",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
googleSlides,
|
|
16
|
+
presentationId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
googleSlides,
|
|
19
|
+
"presentationId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
slideId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
googleSlides,
|
|
25
|
+
"slideId",
|
|
26
|
+
(c) => ({
|
|
27
|
+
presentationId: c.presentationId,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
tableId: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
googleSlides,
|
|
34
|
+
"tableId",
|
|
35
|
+
(c) => ({
|
|
36
|
+
presentationId: c.presentationId,
|
|
37
|
+
slideId: c.slideId,
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
columnIndex: {
|
|
42
|
+
type: "integer",
|
|
43
|
+
label: "Column Index",
|
|
44
|
+
description: "The index of the column to delete",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
async run({ $ }) {
|
|
48
|
+
const response = await this.googleSlides.deleteTableColumn(this.presentationId, {
|
|
49
|
+
tableObjectId: this.tableId,
|
|
50
|
+
cellLocation: {
|
|
51
|
+
columnIndex: this.columnIndex,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
$.export("$summary", "Successfully deleted table column");
|
|
55
|
+
return response.data;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import googleSlides from "../../google_slides.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_slides-delete-table-row",
|
|
5
|
+
name: "Delete Table Row",
|
|
6
|
+
description: "Delete row from a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteTableRowRequest)",
|
|
7
|
+
version: "0.0.3",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
googleSlides,
|
|
16
|
+
presentationId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
googleSlides,
|
|
19
|
+
"presentationId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
slideId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
googleSlides,
|
|
25
|
+
"slideId",
|
|
26
|
+
(c) => ({
|
|
27
|
+
presentationId: c.presentationId,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
tableId: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
googleSlides,
|
|
34
|
+
"tableId",
|
|
35
|
+
(c) => ({
|
|
36
|
+
presentationId: c.presentationId,
|
|
37
|
+
slideId: c.slideId,
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
rowIndex: {
|
|
42
|
+
type: "integer",
|
|
43
|
+
label: "Row Index",
|
|
44
|
+
description: "The index of the row to delete",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
async run({ $ }) {
|
|
48
|
+
const response = await this.googleSlides.deleteTableRow(this.presentationId, {
|
|
49
|
+
tableObjectId: this.tableId,
|
|
50
|
+
cellLocation: {
|
|
51
|
+
rowIndex: this.rowIndex,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
$.export("$summary", "Successfully deleted table row");
|
|
55
|
+
return response.data;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "google_slides-find-presentation",
|
|
5
5
|
name: "Find a Presentation",
|
|
6
6
|
description: "Find a presentation on Google Drive. [See the docs here](https://developers.google.com/slides/api/samples/presentation#list_existing_presentation_files)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.7",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
app,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import googleSlides from "../../google_slides.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_slides-insert-table-columns",
|
|
5
|
+
name: "Insert Table Columns",
|
|
6
|
+
description: "Insert new columns into a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTableColumnsRequest)",
|
|
7
|
+
version: "0.0.3",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
googleSlides,
|
|
16
|
+
presentationId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
googleSlides,
|
|
19
|
+
"presentationId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
slideId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
googleSlides,
|
|
25
|
+
"slideId",
|
|
26
|
+
(c) => ({
|
|
27
|
+
presentationId: c.presentationId,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
tableId: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
googleSlides,
|
|
34
|
+
"tableId",
|
|
35
|
+
(c) => ({
|
|
36
|
+
presentationId: c.presentationId,
|
|
37
|
+
slideId: c.slideId,
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
columnIndex: {
|
|
42
|
+
type: "integer",
|
|
43
|
+
label: "Column Index",
|
|
44
|
+
description: "The column index of an existing cell used as the insertion reference point",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
insertRight: {
|
|
48
|
+
type: "boolean",
|
|
49
|
+
label: "Insert Right",
|
|
50
|
+
description: "Whether to insert the column to the right of the specified cell location",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
53
|
+
number: {
|
|
54
|
+
type: "integer",
|
|
55
|
+
label: "Number",
|
|
56
|
+
description: "The number of columns to be inserted. Maximum 20 per request.",
|
|
57
|
+
default: 1,
|
|
58
|
+
optional: true,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
async run({ $ }) {
|
|
62
|
+
const response = await this.googleSlides.insertTableColumns(this.presentationId, {
|
|
63
|
+
tableObjectId: this.tableId,
|
|
64
|
+
cellLocation: {
|
|
65
|
+
columnIndex: this.columnIndex,
|
|
66
|
+
},
|
|
67
|
+
insertRight: this.insertRight,
|
|
68
|
+
number: this.number,
|
|
69
|
+
});
|
|
70
|
+
$.export("$summary", "Successfully inserted table column");
|
|
71
|
+
return response.data;
|
|
72
|
+
},
|
|
73
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import googleSlides from "../../google_slides.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_slides-insert-table-rows",
|
|
5
|
+
name: "Insert Table Rows",
|
|
6
|
+
description: "Insert new rows into a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTableRowsRequest)",
|
|
7
|
+
version: "0.0.3",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
googleSlides,
|
|
16
|
+
presentationId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
googleSlides,
|
|
19
|
+
"presentationId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
slideId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
googleSlides,
|
|
25
|
+
"slideId",
|
|
26
|
+
(c) => ({
|
|
27
|
+
presentationId: c.presentationId,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
tableId: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
googleSlides,
|
|
34
|
+
"tableId",
|
|
35
|
+
(c) => ({
|
|
36
|
+
presentationId: c.presentationId,
|
|
37
|
+
slideId: c.slideId,
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
rowIndex: {
|
|
42
|
+
type: "integer",
|
|
43
|
+
label: "Row Index",
|
|
44
|
+
description: "The row index of an existing cell used as the insertion reference point",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
insertBelow: {
|
|
48
|
+
type: "boolean",
|
|
49
|
+
label: "Insert Below",
|
|
50
|
+
description: "Whether to insert the row below the specified cell location",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
53
|
+
number: {
|
|
54
|
+
type: "integer",
|
|
55
|
+
label: "Number",
|
|
56
|
+
description: "The number of rows to be inserted. Maximum 20 per request.",
|
|
57
|
+
default: 1,
|
|
58
|
+
optional: true,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
async run({ $ }) {
|
|
62
|
+
const response = await this.googleSlides.insertTableRows(this.presentationId, {
|
|
63
|
+
tableObjectId: this.tableId,
|
|
64
|
+
cellLocation: {
|
|
65
|
+
rowIndex: this.rowIndex,
|
|
66
|
+
},
|
|
67
|
+
insertBelow: this.insertBelow,
|
|
68
|
+
number: this.number,
|
|
69
|
+
});
|
|
70
|
+
$.export("$summary", "Successfully inserted table row");
|
|
71
|
+
return response.data;
|
|
72
|
+
},
|
|
73
|
+
};
|
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "google_slides-insert-text",
|
|
5
5
|
name: "Insert Text",
|
|
6
6
|
description: "Insert text into a shape. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTextRequest)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
googleSlides,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import googleSlides from "../../google_slides.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_slides-insert-text-into-table",
|
|
5
|
+
name: "Insert Text into Table",
|
|
6
|
+
description: "Insert text into a table cell. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTextRequest)",
|
|
7
|
+
version: "0.0.3",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
googleSlides,
|
|
16
|
+
presentationId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
googleSlides,
|
|
19
|
+
"presentationId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
slideId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
googleSlides,
|
|
25
|
+
"slideId",
|
|
26
|
+
(c) => ({
|
|
27
|
+
presentationId: c.presentationId,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
tableId: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
googleSlides,
|
|
34
|
+
"tableId",
|
|
35
|
+
(c) => ({
|
|
36
|
+
presentationId: c.presentationId,
|
|
37
|
+
slideId: c.slideId,
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
rowIndex: {
|
|
42
|
+
type: "integer",
|
|
43
|
+
label: "Row Index",
|
|
44
|
+
description: "The 0-based table row index of the target cell",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
columnIndex: {
|
|
48
|
+
type: "integer",
|
|
49
|
+
label: "Column Index",
|
|
50
|
+
description: "The 0-based table column index of the target cell",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
53
|
+
text: {
|
|
54
|
+
type: "string",
|
|
55
|
+
label: "Text",
|
|
56
|
+
description: "The text to insert",
|
|
57
|
+
},
|
|
58
|
+
insertionIndex: {
|
|
59
|
+
type: "integer",
|
|
60
|
+
label: "Insertion Index",
|
|
61
|
+
description: "The index where the text will be inserted",
|
|
62
|
+
optional: true,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
async run({ $ }) {
|
|
66
|
+
const response = await this.googleSlides.insertText(this.presentationId, {
|
|
67
|
+
objectId: this.tableId,
|
|
68
|
+
cellLocation: {
|
|
69
|
+
rowIndex: this.rowIndex,
|
|
70
|
+
columnIndex: this.columnIndex,
|
|
71
|
+
},
|
|
72
|
+
text: this.text,
|
|
73
|
+
insertionIndex: this.insertionIndex,
|
|
74
|
+
});
|
|
75
|
+
$.export("$summary", "Successfully inserted text into table cell");
|
|
76
|
+
return response.data;
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "google_slides-merge-data",
|
|
5
5
|
name: "Merge Data",
|
|
6
6
|
description: "Merge data into a presentation. [See the docs here](https://developers.google.com/slides/api/guides/merge)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.6",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
app,
|
|
@@ -4,7 +4,12 @@ export default {
|
|
|
4
4
|
key: "google_slides-refresh-chart",
|
|
5
5
|
name: "Refresh a chart",
|
|
6
6
|
description: "Refresh a chart from Sheets. [See the docs here](https://developers.google.com/slides/api/samples/elements#refresh_a_chart_from_sheets)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.7",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
8
13
|
type: "action",
|
|
9
14
|
props: {
|
|
10
15
|
app,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import googleSlides from "../../google_slides.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_slides-replace-all-text",
|
|
5
|
+
name: "Replace All Text",
|
|
6
|
+
description: "Replace all text in a presentation. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#ReplaceAllTextRequest)",
|
|
7
|
+
version: "0.0.3",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
googleSlides,
|
|
16
|
+
presentationId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
googleSlides,
|
|
19
|
+
"presentationId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
text: {
|
|
23
|
+
type: "string",
|
|
24
|
+
label: "Text",
|
|
25
|
+
description: "The text to replace",
|
|
26
|
+
},
|
|
27
|
+
replaceText: {
|
|
28
|
+
type: "string",
|
|
29
|
+
label: "Replace Text",
|
|
30
|
+
description: "The text that will replace the matched text",
|
|
31
|
+
},
|
|
32
|
+
slideIds: {
|
|
33
|
+
propDefinition: [
|
|
34
|
+
googleSlides,
|
|
35
|
+
"slideId",
|
|
36
|
+
(c) => ({
|
|
37
|
+
presentationId: c.presentationId,
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
type: "string[]",
|
|
41
|
+
label: "Slide IDs",
|
|
42
|
+
description: "Limits the matches to page elements only on the given pages",
|
|
43
|
+
optional: true,
|
|
44
|
+
},
|
|
45
|
+
matchCase: {
|
|
46
|
+
type: "boolean",
|
|
47
|
+
label: "Match Case",
|
|
48
|
+
description: "Whether to match case",
|
|
49
|
+
optional: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
async run({ $ }) {
|
|
53
|
+
const response = await this.googleSlides.replaceAllText(this.presentationId, {
|
|
54
|
+
replaceText: this.replaceText,
|
|
55
|
+
pageObjectIds: this.slideIds,
|
|
56
|
+
containsText: {
|
|
57
|
+
text: this.text,
|
|
58
|
+
matchCase: this.matchCase,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
$.export("$summary", "Successfully replaced text in the presentation");
|
|
62
|
+
return response.data;
|
|
63
|
+
},
|
|
64
|
+
};
|
package/google_slides.app.mjs
CHANGED
|
@@ -62,6 +62,21 @@ export default {
|
|
|
62
62
|
}));
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
|
+
tableId: {
|
|
66
|
+
type: "string",
|
|
67
|
+
label: "Table ID",
|
|
68
|
+
description: "The ID of a table",
|
|
69
|
+
async options({
|
|
70
|
+
presentationId, slideId,
|
|
71
|
+
}) {
|
|
72
|
+
const { pageElements } = await this.getSlide(presentationId, slideId);
|
|
73
|
+
let tables = pageElements.filter((element) => element?.table);
|
|
74
|
+
return tables.map((element) => ({
|
|
75
|
+
label: `${element.table.rows} x ${element.table.columns} Table`,
|
|
76
|
+
value: element.objectId,
|
|
77
|
+
}));
|
|
78
|
+
},
|
|
79
|
+
},
|
|
65
80
|
},
|
|
66
81
|
methods: {
|
|
67
82
|
...googleDrive.methods,
|
|
@@ -124,6 +139,66 @@ export default {
|
|
|
124
139
|
];
|
|
125
140
|
return this.batchUpdate(presentationId, requests);
|
|
126
141
|
},
|
|
142
|
+
replaceAllText(presentationId, data) {
|
|
143
|
+
const requests = [
|
|
144
|
+
{
|
|
145
|
+
replaceAllText: {
|
|
146
|
+
...data,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
];
|
|
150
|
+
return this.batchUpdate(presentationId, requests);
|
|
151
|
+
},
|
|
152
|
+
createTable(presentationId, data) {
|
|
153
|
+
const requests = [
|
|
154
|
+
{
|
|
155
|
+
createTable: {
|
|
156
|
+
...data,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
];
|
|
160
|
+
return this.batchUpdate(presentationId, requests);
|
|
161
|
+
},
|
|
162
|
+
insertTableRows(presentationId, data) {
|
|
163
|
+
const requests = [
|
|
164
|
+
{
|
|
165
|
+
insertTableRows: {
|
|
166
|
+
...data,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
];
|
|
170
|
+
return this.batchUpdate(presentationId, requests);
|
|
171
|
+
},
|
|
172
|
+
insertTableColumns(presentationId, data) {
|
|
173
|
+
const requests = [
|
|
174
|
+
{
|
|
175
|
+
insertTableColumns: {
|
|
176
|
+
...data,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
];
|
|
180
|
+
return this.batchUpdate(presentationId, requests);
|
|
181
|
+
},
|
|
182
|
+
deleteTableRow(presentationId, data) {
|
|
183
|
+
const requests = [
|
|
184
|
+
{
|
|
185
|
+
deleteTableRow: {
|
|
186
|
+
...data,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
];
|
|
190
|
+
return this.batchUpdate(presentationId, requests);
|
|
191
|
+
},
|
|
192
|
+
deleteTableColumn(presentationId, data) {
|
|
193
|
+
const requests = [
|
|
194
|
+
{
|
|
195
|
+
deleteTableColumn: {
|
|
196
|
+
...data,
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
];
|
|
200
|
+
return this.batchUpdate(presentationId, requests);
|
|
201
|
+
},
|
|
127
202
|
createImage(presentationId, data) {
|
|
128
203
|
const requests = [
|
|
129
204
|
{
|
|
@@ -151,7 +226,7 @@ export default {
|
|
|
151
226
|
});
|
|
152
227
|
return presentation.data;
|
|
153
228
|
},
|
|
154
|
-
async listPresentationsOptions(driveId, pageToken = null) {
|
|
229
|
+
async listPresentationsOptions(driveId, pageToken = null, limitToMyDrive = false) {
|
|
155
230
|
const q = "mimeType='application/vnd.google-apps.presentation'";
|
|
156
231
|
let request = {
|
|
157
232
|
q,
|
|
@@ -165,6 +240,14 @@ export default {
|
|
|
165
240
|
includeItemsFromAllDrives: true,
|
|
166
241
|
supportsAllDrives: true,
|
|
167
242
|
};
|
|
243
|
+
} else if (!limitToMyDrive) {
|
|
244
|
+
request = {
|
|
245
|
+
...request,
|
|
246
|
+
corpora: "allDrives",
|
|
247
|
+
pageToken,
|
|
248
|
+
includeItemsFromAllDrives: true,
|
|
249
|
+
supportsAllDrives: true,
|
|
250
|
+
};
|
|
168
251
|
}
|
|
169
252
|
return this.listFilesOptions(pageToken, request);
|
|
170
253
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/google_slides",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Pipedream Google Slides Components",
|
|
5
5
|
"main": "google_slides.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@googleapis/drive": "^2.3.0",
|
|
14
14
|
"@googleapis/slides": "^0.7.1",
|
|
15
15
|
"@pipedream/google_drive": "^1.0.3",
|
|
16
|
-
"@pipedream/platform": "^3.1.
|
|
16
|
+
"@pipedream/platform": "^3.1.1",
|
|
17
17
|
"mime-db": "^1.51.0",
|
|
18
18
|
"uuid": "^8.3.2"
|
|
19
19
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import newFilesInstant from "../../../google_drive/sources/new-files-instant/new-files-instant.mjs";
|
|
2
|
+
import googleSlides from "../../google_slides.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
...newFilesInstant,
|
|
@@ -6,7 +7,7 @@ export default {
|
|
|
6
7
|
type: "source",
|
|
7
8
|
name: "New Presentation (Instant)",
|
|
8
9
|
description: "Emit new event each time a new presentation is created in a drive.",
|
|
9
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.5",
|
|
10
11
|
hooks: {
|
|
11
12
|
...newFilesInstant.hooks,
|
|
12
13
|
async deploy() {
|
|
@@ -24,6 +25,7 @@ export default {
|
|
|
24
25
|
},
|
|
25
26
|
props: {
|
|
26
27
|
...newFilesInstant.props,
|
|
28
|
+
googleSlides,
|
|
27
29
|
folders: {
|
|
28
30
|
...newFilesInstant.props.folders,
|
|
29
31
|
description:
|