diff --git a/components/google_slides/actions/create-image/create-image.mjs b/components/google_slides/actions/create-image/create-image.mjs index 0254ad9bef65b..a9053c8ffd2d5 100644 --- a/components/google_slides/actions/create-image/create-image.mjs +++ b/components/google_slides/actions/create-image/create-image.mjs @@ -4,7 +4,7 @@ export default { key: "google_slides-create-image", name: "Create Image", description: "Creates an image in a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateImageRequest)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { googleSlides, diff --git a/components/google_slides/actions/create-page-element/create-page-element.mjs b/components/google_slides/actions/create-page-element/create-page-element.mjs index b67a3929f8950..ee0b828442da4 100644 --- a/components/google_slides/actions/create-page-element/create-page-element.mjs +++ b/components/google_slides/actions/create-page-element/create-page-element.mjs @@ -5,7 +5,7 @@ export default { key: "google_slides-create-page-element", name: "Create Page Element", 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)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { googleSlides, diff --git a/components/google_slides/actions/create-presentation/create-presentation.mjs b/components/google_slides/actions/create-presentation/create-presentation.mjs index 28dbd90555e31..c6e4f26d8bfee 100644 --- a/components/google_slides/actions/create-presentation/create-presentation.mjs +++ b/components/google_slides/actions/create-presentation/create-presentation.mjs @@ -4,7 +4,7 @@ export default { key: "google_slides-create-presentation", name: "Create Presentation", 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)", - version: "0.0.4", + version: "0.0.5", type: "action", props: { app, diff --git a/components/google_slides/actions/create-slide/create-slide.mjs b/components/google_slides/actions/create-slide/create-slide.mjs index b05cae756374d..ec105eb6c0cf9 100644 --- a/components/google_slides/actions/create-slide/create-slide.mjs +++ b/components/google_slides/actions/create-slide/create-slide.mjs @@ -5,7 +5,7 @@ export default { key: "google_slides-create-slide", name: "Create Slide", description: "Create a new slide in a presentation. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateSlideRequest)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { googleSlides, diff --git a/components/google_slides/actions/create-table/create-table.mjs b/components/google_slides/actions/create-table/create-table.mjs new file mode 100644 index 0000000000000..b3a88ff537cbf --- /dev/null +++ b/components/google_slides/actions/create-table/create-table.mjs @@ -0,0 +1,88 @@ +import googleSlides from "../../google_slides.app.mjs"; + +export default { + key: "google_slides-create-table", + name: "Create Table", + description: "Create a new table in a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateTableRequest)", + version: "0.0.1", + type: "action", + props: { + googleSlides, + presentationId: { + propDefinition: [ + googleSlides, + "presentationId", + ], + }, + slideId: { + propDefinition: [ + googleSlides, + "slideId", + (c) => ({ + presentationId: c.presentationId, + }), + ], + }, + rows: { + type: "integer", + label: "Rows", + description: "The number of rows in the table", + }, + columns: { + type: "integer", + label: "Columns", + description: "The number of columns in the table", + }, + height: { + type: "integer", + label: "Height", + description: "The height of the shape in points (1/72 of an inch)", + }, + width: { + type: "integer", + label: "Width", + description: "The width of the shape in points (1/72 of an inch)", + }, + translateX: { + type: "integer", + label: "Translate X", + description: "The translation of the table on the x-axis", + optional: true, + }, + translateY: { + type: "integer", + label: "Translate Y", + description: "The translation of the table on the y-axis", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.googleSlides.createTable(this.presentationId, { + elementProperties: { + pageObjectId: this.slideId, + size: { + height: { + magnitude: this.height, + unit: "PT", + }, + width: { + magnitude: this.width, + unit: "PT", + }, + }, + transform: { + scaleX: 1, + scaleY: 1, + translateX: this.translateX, + translateY: this.translateY, + unit: "PT", + }, + }, + rows: this.rows, + columns: this.columns, + }); + + $.export("$summary", "Successfully created table in the slide"); + return response.data; + }, +}; diff --git a/components/google_slides/actions/delete-page-element/delete-page-element.mjs b/components/google_slides/actions/delete-page-element/delete-page-element.mjs index a0cbe4d405283..335978c04c2b9 100644 --- a/components/google_slides/actions/delete-page-element/delete-page-element.mjs +++ b/components/google_slides/actions/delete-page-element/delete-page-element.mjs @@ -4,7 +4,7 @@ export default { key: "google_slides-delete-page-element", name: "Delete Page Element", description: "Deletes a page element from a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteObjectRequest)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { googleSlides, diff --git a/components/google_slides/actions/delete-slide/delete-slide.mjs b/components/google_slides/actions/delete-slide/delete-slide.mjs index 685d5f5697f08..35ec17f781194 100644 --- a/components/google_slides/actions/delete-slide/delete-slide.mjs +++ b/components/google_slides/actions/delete-slide/delete-slide.mjs @@ -4,7 +4,7 @@ export default { key: "google_slides-delete-slide", name: "Delete Slide", description: "Deletes a slide from a presentation. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteObjectRequest)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { googleSlides, diff --git a/components/google_slides/actions/delete-table-column/delete-table-column.mjs b/components/google_slides/actions/delete-table-column/delete-table-column.mjs new file mode 100644 index 0000000000000..8510d8b7fab05 --- /dev/null +++ b/components/google_slides/actions/delete-table-column/delete-table-column.mjs @@ -0,0 +1,52 @@ +import googleSlides from "../../google_slides.app.mjs"; + +export default { + key: "google_slides-delete-table-column", + name: "Delete Table Column", + description: "Delete column from a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteTableColumnRequest)", + version: "0.0.1", + type: "action", + props: { + googleSlides, + presentationId: { + propDefinition: [ + googleSlides, + "presentationId", + ], + }, + slideId: { + propDefinition: [ + googleSlides, + "slideId", + (c) => ({ + presentationId: c.presentationId, + }), + ], + }, + tableId: { + propDefinition: [ + googleSlides, + "tableId", + (c) => ({ + presentationId: c.presentationId, + slideId: c.slideId, + }), + ], + }, + columnIndex: { + type: "integer", + label: "Column Index", + description: "The index of the column to delete", + }, + }, + async run({ $ }) { + const response = await this.googleSlides.deleteTableColumn(this.presentationId, { + tableObjectId: this.tableId, + cellLocation: { + columnIndex: this.columnIndex, + }, + }); + $.export("$summary", "Successfully deleted table column"); + return response.data; + }, +}; diff --git a/components/google_slides/actions/delete-table-row/delete-table-row.mjs b/components/google_slides/actions/delete-table-row/delete-table-row.mjs new file mode 100644 index 0000000000000..817e74683983c --- /dev/null +++ b/components/google_slides/actions/delete-table-row/delete-table-row.mjs @@ -0,0 +1,52 @@ +import googleSlides from "../../google_slides.app.mjs"; + +export default { + key: "google_slides-delete-table-row", + name: "Delete Table Row", + description: "Delete row from a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteTableRowRequest)", + version: "0.0.1", + type: "action", + props: { + googleSlides, + presentationId: { + propDefinition: [ + googleSlides, + "presentationId", + ], + }, + slideId: { + propDefinition: [ + googleSlides, + "slideId", + (c) => ({ + presentationId: c.presentationId, + }), + ], + }, + tableId: { + propDefinition: [ + googleSlides, + "tableId", + (c) => ({ + presentationId: c.presentationId, + slideId: c.slideId, + }), + ], + }, + rowIndex: { + type: "integer", + label: "Row Index", + description: "The index of the row to delete", + }, + }, + async run({ $ }) { + const response = await this.googleSlides.deleteTableRow(this.presentationId, { + tableObjectId: this.tableId, + cellLocation: { + rowIndex: this.rowIndex, + }, + }); + $.export("$summary", "Successfully deleted table row"); + return response.data; + }, +}; diff --git a/components/google_slides/actions/find-presentation/find-presentation.mjs b/components/google_slides/actions/find-presentation/find-presentation.mjs index a7563123636f0..4abd47563fdb3 100644 --- a/components/google_slides/actions/find-presentation/find-presentation.mjs +++ b/components/google_slides/actions/find-presentation/find-presentation.mjs @@ -4,7 +4,7 @@ export default { key: "google_slides-find-presentation", name: "Find a Presentation", description: "Find a presentation on Google Drive. [See the docs here](https://developers.google.com/slides/api/samples/presentation#list_existing_presentation_files)", - version: "0.0.4", + version: "0.0.5", type: "action", props: { app, diff --git a/components/google_slides/actions/insert-table-columns/insert-table-columns.mjs b/components/google_slides/actions/insert-table-columns/insert-table-columns.mjs new file mode 100644 index 0000000000000..29186363c062f --- /dev/null +++ b/components/google_slides/actions/insert-table-columns/insert-table-columns.mjs @@ -0,0 +1,68 @@ +import googleSlides from "../../google_slides.app.mjs"; + +export default { + key: "google_slides-insert-table-columns", + name: "Insert Table Columns", + description: "Insert new columns into a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTableColumnsRequest)", + version: "0.0.1", + type: "action", + props: { + googleSlides, + presentationId: { + propDefinition: [ + googleSlides, + "presentationId", + ], + }, + slideId: { + propDefinition: [ + googleSlides, + "slideId", + (c) => ({ + presentationId: c.presentationId, + }), + ], + }, + tableId: { + propDefinition: [ + googleSlides, + "tableId", + (c) => ({ + presentationId: c.presentationId, + slideId: c.slideId, + }), + ], + }, + columnIndex: { + type: "integer", + label: "Column Index", + description: "The column index of an existing cell used as the insertion reference point", + optional: true, + }, + insertRight: { + type: "boolean", + label: "Insert Right", + description: "Whether to insert the column to the right of the specified cell location", + optional: true, + }, + number: { + type: "integer", + label: "Number", + description: "The number of columns to be inserted. Maximum 20 per request.", + default: 1, + optional: true, + }, + }, + async run({ $ }) { + const response = await this.googleSlides.insertTableColumns(this.presentationId, { + tableObjectId: this.tableId, + cellLocation: { + columnIndex: this.columnIndex, + }, + insertRight: this.insertRight, + number: this.number, + }); + $.export("$summary", "Successfully inserted table column"); + return response.data; + }, +}; diff --git a/components/google_slides/actions/insert-table-rows/insert-table-rows.mjs b/components/google_slides/actions/insert-table-rows/insert-table-rows.mjs new file mode 100644 index 0000000000000..c30ba83cafb7f --- /dev/null +++ b/components/google_slides/actions/insert-table-rows/insert-table-rows.mjs @@ -0,0 +1,68 @@ +import googleSlides from "../../google_slides.app.mjs"; + +export default { + key: "google_slides-insert-table-rows", + name: "Insert Table Rows", + description: "Insert new rows into a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTableRowsRequest)", + version: "0.0.1", + type: "action", + props: { + googleSlides, + presentationId: { + propDefinition: [ + googleSlides, + "presentationId", + ], + }, + slideId: { + propDefinition: [ + googleSlides, + "slideId", + (c) => ({ + presentationId: c.presentationId, + }), + ], + }, + tableId: { + propDefinition: [ + googleSlides, + "tableId", + (c) => ({ + presentationId: c.presentationId, + slideId: c.slideId, + }), + ], + }, + rowIndex: { + type: "integer", + label: "Row Index", + description: "The row index of an existing cell used as the insertion reference point", + optional: true, + }, + insertBelow: { + type: "boolean", + label: "Insert Below", + description: "Whether to insert the row below the specified cell location", + optional: true, + }, + number: { + type: "integer", + label: "Number", + description: "The number of rows to be inserted. Maximum 20 per request.", + default: 1, + optional: true, + }, + }, + async run({ $ }) { + const response = await this.googleSlides.insertTableRows(this.presentationId, { + tableObjectId: this.tableId, + cellLocation: { + rowIndex: this.rowIndex, + }, + insertBelow: this.insertBelow, + number: this.number, + }); + $.export("$summary", "Successfully inserted table row"); + return response.data; + }, +}; diff --git a/components/google_slides/actions/insert-text-into-table/insert-text-into-table.mjs b/components/google_slides/actions/insert-text-into-table/insert-text-into-table.mjs new file mode 100644 index 0000000000000..e2e839790375b --- /dev/null +++ b/components/google_slides/actions/insert-text-into-table/insert-text-into-table.mjs @@ -0,0 +1,73 @@ +import googleSlides from "../../google_slides.app.mjs"; + +export default { + key: "google_slides-insert-text-into-table", + name: "Insert Text into Table", + description: "Insert text into a table cell. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTextRequest)", + version: "0.0.1", + type: "action", + props: { + googleSlides, + presentationId: { + propDefinition: [ + googleSlides, + "presentationId", + ], + }, + slideId: { + propDefinition: [ + googleSlides, + "slideId", + (c) => ({ + presentationId: c.presentationId, + }), + ], + }, + tableId: { + propDefinition: [ + googleSlides, + "tableId", + (c) => ({ + presentationId: c.presentationId, + slideId: c.slideId, + }), + ], + }, + rowIndex: { + type: "integer", + label: "Row Index", + description: "The 0-based table row index of the target cell", + optional: true, + }, + columnIndex: { + type: "integer", + label: "Column Index", + description: "The 0-based table column index of the target cell", + optional: true, + }, + text: { + type: "string", + label: "Text", + description: "The text to insert", + }, + insertionIndex: { + type: "integer", + label: "Insertion Index", + description: "The index where the text will be inserted", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.googleSlides.insertText(this.presentationId, { + objectId: this.tableId, + cellLocation: { + rowIndex: this.rowIndex, + columnIndex: this.columnIndex, + }, + text: this.text, + insertionIndex: this.insertionIndex, + }); + $.export("$summary", "Successfully inserted text into table cell"); + return response.data; + }, +}; diff --git a/components/google_slides/actions/insert-text/insert-text.mjs b/components/google_slides/actions/insert-text/insert-text.mjs index 4dce3c21b57bf..fd2ce6e50fcf9 100644 --- a/components/google_slides/actions/insert-text/insert-text.mjs +++ b/components/google_slides/actions/insert-text/insert-text.mjs @@ -4,7 +4,7 @@ export default { key: "google_slides-insert-text", name: "Insert Text", description: "Insert text into a shape. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTextRequest)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { googleSlides, diff --git a/components/google_slides/actions/merge-data/merge-data.mjs b/components/google_slides/actions/merge-data/merge-data.mjs index 98e93e327d99d..fccd73d59b189 100644 --- a/components/google_slides/actions/merge-data/merge-data.mjs +++ b/components/google_slides/actions/merge-data/merge-data.mjs @@ -4,7 +4,7 @@ export default { key: "google_slides-merge-data", name: "Merge Data", description: "Merge data into a presentation. [See the docs here](https://developers.google.com/slides/api/guides/merge)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { app, diff --git a/components/google_slides/actions/refresh-chart/refresh-chart.mjs b/components/google_slides/actions/refresh-chart/refresh-chart.mjs index 3e9203c874389..55c76965403ce 100644 --- a/components/google_slides/actions/refresh-chart/refresh-chart.mjs +++ b/components/google_slides/actions/refresh-chart/refresh-chart.mjs @@ -4,7 +4,7 @@ export default { key: "google_slides-refresh-chart", name: "Refresh a chart", description: "Refresh a chart from Sheets. [See the docs here](https://developers.google.com/slides/api/samples/elements#refresh_a_chart_from_sheets)", - version: "0.0.4", + version: "0.0.5", type: "action", props: { app, diff --git a/components/google_slides/actions/replace-all-text/replace-all-text.mjs b/components/google_slides/actions/replace-all-text/replace-all-text.mjs new file mode 100644 index 0000000000000..67df22629a985 --- /dev/null +++ b/components/google_slides/actions/replace-all-text/replace-all-text.mjs @@ -0,0 +1,59 @@ +import googleSlides from "../../google_slides.app.mjs"; + +export default { + key: "google_slides-replace-all-text", + name: "Replace All Text", + description: "Replace all text in a presentation. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#ReplaceAllTextRequest)", + version: "0.0.1", + type: "action", + props: { + googleSlides, + presentationId: { + propDefinition: [ + googleSlides, + "presentationId", + ], + }, + text: { + type: "string", + label: "Text", + description: "The text to replace", + }, + replaceText: { + type: "string", + label: "Replace Text", + description: "The text that will replace the matched text", + }, + slideIds: { + propDefinition: [ + googleSlides, + "slideId", + (c) => ({ + presentationId: c.presentationId, + }), + ], + type: "string[]", + label: "Slide IDs", + description: "Limits the matches to page elements only on the given pages", + optional: true, + }, + matchCase: { + type: "boolean", + label: "Match Case", + description: "Whether to match case", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.googleSlides.replaceAllText(this.presentationId, { + replaceText: this.replaceText, + pageObjectIds: this.slideIds, + containsText: { + text: this.text, + matchCase: this.matchCase, + }, + }); + $.export("$summary", "Successfully replaced text in the presentation"); + return response.data; + }, +}; diff --git a/components/google_slides/google_slides.app.mjs b/components/google_slides/google_slides.app.mjs index 2bef086c29ba3..326fa6ff96daa 100644 --- a/components/google_slides/google_slides.app.mjs +++ b/components/google_slides/google_slides.app.mjs @@ -62,6 +62,21 @@ export default { })); }, }, + tableId: { + type: "string", + label: "Table ID", + description: "The ID of a table", + async options({ + presentationId, slideId, + }) { + const { pageElements } = await this.getSlide(presentationId, slideId); + let tables = pageElements.filter((element) => element?.table); + return tables.map((element) => ({ + label: `${element.table.rows} x ${element.table.columns} Table`, + value: element.objectId, + })); + }, + }, }, methods: { ...googleDrive.methods, @@ -124,6 +139,66 @@ export default { ]; return this.batchUpdate(presentationId, requests); }, + replaceAllText(presentationId, data) { + const requests = [ + { + replaceAllText: { + ...data, + }, + }, + ]; + return this.batchUpdate(presentationId, requests); + }, + createTable(presentationId, data) { + const requests = [ + { + createTable: { + ...data, + }, + }, + ]; + return this.batchUpdate(presentationId, requests); + }, + insertTableRows(presentationId, data) { + const requests = [ + { + insertTableRows: { + ...data, + }, + }, + ]; + return this.batchUpdate(presentationId, requests); + }, + insertTableColumns(presentationId, data) { + const requests = [ + { + insertTableColumns: { + ...data, + }, + }, + ]; + return this.batchUpdate(presentationId, requests); + }, + deleteTableRow(presentationId, data) { + const requests = [ + { + deleteTableRow: { + ...data, + }, + }, + ]; + return this.batchUpdate(presentationId, requests); + }, + deleteTableColumn(presentationId, data) { + const requests = [ + { + deleteTableColumn: { + ...data, + }, + }, + ]; + return this.batchUpdate(presentationId, requests); + }, createImage(presentationId, data) { const requests = [ { diff --git a/components/google_slides/package.json b/components/google_slides/package.json index 4c54fd188aa30..ad4900016d131 100644 --- a/components/google_slides/package.json +++ b/components/google_slides/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/google_slides", - "version": "0.2.0", + "version": "0.3.0", "description": "Pipedream Google Slides Components", "main": "google_slides.app.mjs", "keywords": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2ee19ea6e775f..3eee5ba2a17ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1340,8 +1340,7 @@ importers: specifier: ^3.1.0 version: 3.1.0 - components/azure_devops_microsoft_entra_id_oauth: - specifiers: {} + components/azure_devops_microsoft_entra_id_oauth: {} components/azure_openai_service: dependencies: @@ -3220,8 +3219,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/cortex: - specifiers: {} + components/cortex: {} components/countdown_api: dependencies: @@ -10798,8 +10796,7 @@ importers: specifier: ^3.1.0 version: 3.1.0 - components/plentyone: - specifiers: {} + components/plentyone: {} components/plisio: {} @@ -11193,8 +11190,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/pulumi: - specifiers: {} + components/pulumi: {} components/pumble: dependencies: @@ -13633,8 +13629,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/strapi: - specifiers: {} + components/strapi: {} components/strava: dependencies: @@ -13902,8 +13897,7 @@ importers: components/taggun: {} - components/taiga: - specifiers: {} + components/taiga: {} components/tailscale: {} @@ -15484,8 +15478,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/wekan: - specifiers: {} + components/wekan: {} components/welcome: dependencies: @@ -16010,8 +16003,7 @@ importers: components/zagomail: {} - components/zammad: - specifiers: {} + components/zammad: {} components/zamzar: dependencies: