@pipedream/google_slides 0.3.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.
@@ -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.2",
7
+ version: "0.0.5",
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.2",
8
+ version: "0.0.5",
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.5",
7
+ version: "0.0.8",
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.2",
8
+ version: "0.0.5",
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-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.1",
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,
@@ -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.2",
7
+ version: "0.0.5",
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.2",
7
+ version: "0.0.5",
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-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.1",
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-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.1",
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-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.5",
7
+ version: "0.0.8",
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,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,12 @@ 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.1",
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,
@@ -4,7 +4,12 @@ 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.1",
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,
@@ -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.2",
7
+ version: "0.0.5",
8
+ annotations: {
9
+ destructiveHint: false,
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-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.1",
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,
@@ -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.4",
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,
@@ -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.5",
7
+ version: "0.0.8",
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-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.1",
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,
@@ -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
 
@@ -226,7 +227,7 @@ export default {
226
227
  });
227
228
  return presentation.data;
228
229
  },
229
- async listPresentationsOptions(driveId, pageToken = null) {
230
+ async listPresentationsOptions(driveId, pageToken = null, limitToMyDrive = false) {
230
231
  const q = "mimeType='application/vnd.google-apps.presentation'";
231
232
  let request = {
232
233
  q,
@@ -240,13 +241,42 @@ export default {
240
241
  includeItemsFromAllDrives: true,
241
242
  supportsAllDrives: true,
242
243
  };
244
+ } else if (!limitToMyDrive) {
245
+ request = {
246
+ ...request,
247
+ corpora: "allDrives",
248
+ pageToken,
249
+ includeItemsFromAllDrives: true,
250
+ supportsAllDrives: true,
251
+ };
243
252
  }
244
253
  return this.listFilesOptions(pageToken, request);
245
254
  },
246
- async getPresentation(presentationId) {
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) {
247
274
  const slides = this.slides();
248
275
  const request = {
249
276
  presentationId,
277
+ ...fields && {
278
+ fields,
279
+ },
250
280
  };
251
281
  return (await slides.presentations.get(request)).data;
252
282
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/google_slides",
3
- "version": "0.3.0",
3
+ "version": "0.5.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.0",
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.4",
10
+ version: "0.0.6",
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: