@pipedream/google_slides 0.4.0 → 0.5.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 +1 -1
- package/actions/create-page-element/create-page-element.mjs +1 -1
- package/actions/create-presentation/create-presentation.mjs +1 -1
- package/actions/create-slide/create-slide.mjs +1 -1
- package/actions/create-table/create-table.mjs +1 -1
- package/actions/delete-page-element/delete-page-element.mjs +1 -1
- package/actions/delete-slide/delete-slide.mjs +1 -1
- package/actions/delete-table-column/delete-table-column.mjs +1 -1
- package/actions/delete-table-row/delete-table-row.mjs +1 -1
- package/actions/find-presentation/find-presentation.mjs +1 -1
- package/actions/get-presentation/get-presentation.mjs +34 -0
- package/actions/insert-table-columns/insert-table-columns.mjs +1 -1
- package/actions/insert-table-rows/insert-table-rows.mjs +1 -1
- package/actions/insert-text/insert-text.mjs +1 -1
- package/actions/insert-text-into-table/insert-text-into-table.mjs +1 -1
- package/actions/merge-data/merge-data.mjs +1 -1
- package/actions/refresh-chart/refresh-chart.mjs +1 -1
- package/actions/replace-all-text/replace-all-text.mjs +1 -1
- package/google_slides.app.mjs +23 -1
- package/package.json +1 -1
- package/sources/new-presentation/new-presentation.mjs +1 -1
|
@@ -4,7 +4,7 @@ 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.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ 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.5",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ 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.8",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ 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.5",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_slides-create-table",
|
|
5
5
|
name: "Create Table",
|
|
6
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.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ 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.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ 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.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_slides-delete-table-column",
|
|
5
5
|
name: "Delete Table Column",
|
|
6
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.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_slides-delete-table-row",
|
|
5
5
|
name: "Delete Table Row",
|
|
6
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.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ 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.8",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import app from "../../google_slides.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_slides-get-presentation",
|
|
5
|
+
name: "Get Presentation",
|
|
6
|
+
description: "Get a Google Slides presentation by its ID. Returns the presentation's metadata and structure (title, slides, masters, layouts, page size, etc.) according to requested `fields`. Use **Find a Presentation** first to resolve a presentation's name to its ID. [See the documentation](https://developers.google.com/slides/api/reference/rest/v1/presentations/get)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
app,
|
|
16
|
+
presentationId: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Presentation ID",
|
|
19
|
+
description: "The ID of the presentation to retrieve. This is the long string in the presentation's URL: `https://docs.google.com/presentation/d/{PRESENTATION_ID}/edit`. You can also paste the full URL. Use **Find a Presentation** to resolve a presentation's name to its ID.",
|
|
20
|
+
},
|
|
21
|
+
fields: {
|
|
22
|
+
type: "string",
|
|
23
|
+
label: "Fields",
|
|
24
|
+
description: "Optional partial-response [field mask](https://developers.google.com/slides/api/guides/field-masks) to limit the response to specific fields. Comma-separated, e.g. `presentationId,title` for just basic metadata, or `slides.objectId,title` to also list slide IDs. Omit to return the full presentation.",
|
|
25
|
+
optional: true,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
async run({ $ }) {
|
|
29
|
+
const presentationId = this.app.getPresentationId(this.presentationId);
|
|
30
|
+
const presentation = await this.app.getPresentation(presentationId, this.fields);
|
|
31
|
+
$.export("$summary", `Successfully retrieved presentation with ID: ${presentationId}`);
|
|
32
|
+
return presentation;
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_slides-insert-table-columns",
|
|
5
5
|
name: "Insert Table Columns",
|
|
6
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.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_slides-insert-table-rows",
|
|
5
5
|
name: "Insert Table Rows",
|
|
6
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.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ 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.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_slides-insert-text-into-table",
|
|
5
5
|
name: "Insert Text into Table",
|
|
6
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.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ 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.7",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ 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.8",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_slides-replace-all-text",
|
|
5
5
|
name: "Replace All Text",
|
|
6
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.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
package/google_slides.app.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
1
2
|
import slides from "@googleapis/slides";
|
|
2
3
|
import googleDrive from "@pipedream/google_drive";
|
|
3
4
|
|
|
@@ -251,10 +252,31 @@ export default {
|
|
|
251
252
|
}
|
|
252
253
|
return this.listFilesOptions(pageToken, request);
|
|
253
254
|
},
|
|
254
|
-
|
|
255
|
+
getPresentationId(idOrUrl) {
|
|
256
|
+
const input = String(idOrUrl).trim();
|
|
257
|
+
if (!input) {
|
|
258
|
+
throw new ConfigurationError("Presentation ID is required.");
|
|
259
|
+
}
|
|
260
|
+
// Published presentations use /presentation/d/e/{token}/pub and have no
|
|
261
|
+
// editable ID that presentations.get accepts, so reject them explicitly
|
|
262
|
+
// rather than extracting the literal "e" segment as the ID.
|
|
263
|
+
if (/\/presentation\/d\/e\//.test(input)) {
|
|
264
|
+
throw new ConfigurationError("Published presentation URLs (`/presentation/d/e/...`) are not supported. Provide the presentation's ID or its editable URL (`https://docs.google.com/presentation/d/{ID}/edit`).");
|
|
265
|
+
}
|
|
266
|
+
// Accept a plain presentation ID or a full Slides URL
|
|
267
|
+
// (e.g. https://docs.google.com/presentation/d/{ID}/edit).
|
|
268
|
+
const match = input.match(/\/presentation\/d\/([a-zA-Z0-9-_]+)/);
|
|
269
|
+
return match
|
|
270
|
+
? match[1]
|
|
271
|
+
: input;
|
|
272
|
+
},
|
|
273
|
+
async getPresentation(presentationId, fields) {
|
|
255
274
|
const slides = this.slides();
|
|
256
275
|
const request = {
|
|
257
276
|
presentationId,
|
|
277
|
+
...fields && {
|
|
278
|
+
fields,
|
|
279
|
+
},
|
|
258
280
|
};
|
|
259
281
|
return (await slides.presentations.get(request)).data;
|
|
260
282
|
},
|
package/package.json
CHANGED