Skip to content

New Components - google_slides #17812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

New Components - google_slides #17812

wants to merge 2 commits into from

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jul 25, 2025

Resolves #17404

Summary by CodeRabbit

  • New Features

    • Added actions for Google Slides to create slides, shapes, images, insert text, and delete slides or page elements.
    • Enhanced shape creation with support for various shape types and transformation options.
    • Enabled text insertion into specific shapes within slides.
  • Improvements

    • Improved slide, layout, and shape selection with dynamic options.
    • Centralized and expanded slide manipulation capabilities for better API coverage.
  • Chores

    • Updated package dependencies and incremented version numbers for several actions and sources.

Copy link

vercel bot commented Jul 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Jul 25, 2025 8:39pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 25, 2025 8:39pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 25, 2025 8:39pm

Copy link
Contributor

coderabbitai bot commented Jul 25, 2025

Walkthrough

This update introduces comprehensive CRUD (Create, Read, Update, Delete) actions for Google Slides presentations, slides, and page elements. New modules enable creating and deleting slides, shapes, images, and inserting text. The core app logic is refactored to centralize batch update operations and expose new methods for manipulating slide content. Version bumps and new constants support these enhancements.

Changes

Files/Groups Change Summary
components/google_slides/actions/create-image/create-image.mjs New action: Create Image—adds images to slides with transformation options.
components/google_slides/actions/create-page-element/create-page-element.mjs New action: Create Page Element—adds shapes to slides with type and transformation controls.
components/google_slides/actions/create-slide/create-slide.mjs New action: Create Slide—adds slides to presentations with layout and position options.
components/google_slides/actions/delete-page-element/delete-page-element.mjs New action: Delete Page Element—removes specific page elements from slides.
components/google_slides/actions/delete-slide/delete-slide.mjs New action: Delete Slide—removes slides from presentations.
components/google_slides/actions/insert-text/insert-text.mjs New action: Insert Text—inserts text into shapes within slides.
components/google_slides/google_slides.app.mjs Refactored: Centralized batchUpdate logic; added methods for slide, shape, image, text, and deletion operations.
components/google_slides/common/constants.mjs New: Exports SHAPE_TYPES array for supported shape types.
components/google_slides/actions/create-presentation/create-presentation.mjs Version bump only.
components/google_slides/actions/find-presentation/find-presentation.mjs Version bump only.
components/google_slides/actions/merge-data/merge-data.mjs Version bump only.
components/google_slides/actions/refresh-chart/refresh-chart.mjs Version bump only.
components/google_slides/package.json Version bump; dependency updates.
components/google_slides/sources/new-presentation/new-presentation.mjs Version bump only.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant GoogleSlidesApp
    participant GoogleSlidesAPI

    User->>Action: Initiate CRUD operation (e.g., create slide, insert text)
    Action->>GoogleSlidesApp: Call corresponding method (e.g., createSlide, insertText)
    GoogleSlidesApp->>GoogleSlidesAPI: Send batchUpdate or direct API request
    GoogleSlidesAPI-->>GoogleSlidesApp: Return API response
    GoogleSlidesApp-->>Action: Return processed response
    Action-->>User: Provide summary and results
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Poem

In the warren of code, new slides appear,
Shapes and images, text drawing near.
With CRUD in our paws, we hop and we play,
Building presentations the rabbit way.
Batch updates abound, shapes take their place,
A burrow of features—fast, full of grace! 🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/google_slides/actions/create-page-element/create-page-element.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/google_slides/actions/find-presentation/find-presentation.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/google_slides/actions/delete-slide/delete-slide.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

  • 10 others
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-17404

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (9)
components/google_slides/actions/create-presentation/create-presentation.mjs (1)

7-7: Version bump looks correct – please sync changelog

The increment to 0.0.3 aligns with the other action bumps in this PR. Just make sure the public changelog / marketplace description is updated so users understand what changed.

components/google_slides/actions/merge-data/merge-data.mjs (1)

7-7: Patch bump to 0.0.2

Looks fine; just double-check that any new placeholder-handling features introduced elsewhere are reflected in the docs for this action.

components/google_slides/common/constants.mjs (1)

1-143: Comprehensive shape types definition looks good.

The extensive list of shape types covers all major categories (basic shapes, arrows, flowchart symbols, callouts, etc.) and follows consistent naming conventions. This centralized approach will ensure consistency across actions that create shapes.

Consider adding JSDoc documentation to describe the purpose and usage:

+/**
+ * Supported shape types for Google Slides page elements
+ * @see https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/requests#ShapeType
+ */
 export const SHAPE_TYPES = [
components/google_slides/actions/insert-text/insert-text.mjs (1)

37-47: Consider adding validation for the text parameter.

While the text parameter is required, consider adding length validation or format checks to provide better user experience.

 text: {
   type: "string",
   label: "Text",
   description: "The text to insert",
+  validate: (value) => {
+    if (!value?.trim()) {
+      throw new Error("Text cannot be empty or contain only whitespace");
+    }
+    return true;
+  },
 },
components/google_slides/actions/create-image/create-image.mjs (1)

26-30: Add URL validation for the image parameter.

Consider validating that the URL is accessible and points to a valid image format to prevent API errors.

 url: {
   type: "string",
   label: "URL",
   description: "The URL of the image to insert",
+  validate: (value) => {
+    try {
+      new URL(value);
+      return true;
+    } catch {
+      throw new Error("Please provide a valid URL");
+    }
+  },
 },
components/google_slides/actions/delete-slide/delete-slide.mjs (1)

27-31: Consider adding confirmation for destructive operation.

While the implementation is correct, consider adding a confirmation step or warning for this destructive operation to prevent accidental slide deletion.

 async run({ $ }) {
+  // Note: This is a destructive operation that cannot be undone
   const response = await this.googleSlides.deleteObject(this.presentationId, this.slideId);
   $.export("$summary", `Successfully deleted slide with ID: ${this.slideId}`);
   return response.data;
 },

Alternatively, consider adding a confirmation prop:

 props: {
   googleSlides,
   presentationId: { /* existing */ },
   slideId: { /* existing */ },
+  confirm: {
+    type: "boolean",
+    label: "Confirm Deletion",
+    description: "Confirm that you want to permanently delete this slide",
+    default: false,
+  },
 },
components/google_slides/actions/create-page-element/create-page-element.mjs (1)

57-70: Consider using number type for translation properties.

While translation values are often whole numbers, the Google Slides API accepts decimal values for precise positioning. Consider changing to number type for flexibility.

     translateX: {
-      type: "integer",
+      type: "number",
       label: "Translate X",
-      description: "The translation of the shape on the x-axis",
+      description: "The translation of the shape on the x-axis in points (1/72 of an inch)",
       default: 0,
       optional: true,
     },
     translateY: {
-      type: "integer",
+      type: "number",
       label: "Translate Y",
-      description: "The translation of the shape on the y-axis",
+      description: "The translation of the shape on the y-axis in points (1/72 of an inch)",
       default: 0,
       optional: true,
     },
components/google_slides/actions/create-slide/create-slide.mjs (1)

42-43: Add null-safe response parsing.

While the error handling is good, the response parsing could be more defensive against unexpected API response structures.

-      $.export("$summary", `Successfully created slide with ID: ${response.data.replies[0].createSlide.objectId}`);
+      const objectId = response.data?.replies?.[0]?.createSlide?.objectId;
+      if (!objectId) {
+        throw new ConfigurationError("Unexpected API response: slide ID not found");
+      }
+      $.export("$summary", `Successfully created slide with ID: ${objectId}`);
components/google_slides/google_slides.app.mjs (1)

137-146: Consider adding JSDoc documentation for the deleteObject method.

The deleteObject method name is generic and could benefit from documentation explaining that it can delete both slides and page elements.

+    /**
+     * Deletes an object (slide or page element) from a presentation
+     * @param {string} presentationId - The ID of the presentation
+     * @param {string} objectId - The ID of the object to delete (can be a slide ID or page element ID)
+     * @returns {Promise} The API response
+     */
     deleteObject(presentationId, objectId) {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dae0a6a and 33ad765.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • components/google_slides/actions/create-image/create-image.mjs (1 hunks)
  • components/google_slides/actions/create-page-element/create-page-element.mjs (1 hunks)
  • components/google_slides/actions/create-presentation/create-presentation.mjs (1 hunks)
  • components/google_slides/actions/create-slide/create-slide.mjs (1 hunks)
  • components/google_slides/actions/delete-page-element/delete-page-element.mjs (1 hunks)
  • components/google_slides/actions/delete-slide/delete-slide.mjs (1 hunks)
  • components/google_slides/actions/find-presentation/find-presentation.mjs (1 hunks)
  • components/google_slides/actions/insert-text/insert-text.mjs (1 hunks)
  • components/google_slides/actions/merge-data/merge-data.mjs (1 hunks)
  • components/google_slides/actions/refresh-chart/refresh-chart.mjs (1 hunks)
  • components/google_slides/common/constants.mjs (1 hunks)
  • components/google_slides/google_slides.app.mjs (3 hunks)
  • components/google_slides/package.json (2 hunks)
  • components/google_slides/sources/new-presentation/new-presentation.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
components/google_slides/package.json (1)

Learnt from: jcortes
PR: #14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like fs to package.json dependencies, as they are native modules provided by the Node.js runtime.

components/google_slides/actions/create-image/create-image.mjs (1)

Learnt from: js07
PR: #17375
File: components/tinypng/actions/compress-image/compress-image.mjs:18-23
Timestamp: 2025-07-01T17:01:46.327Z
Learning: In TinyPNG compress-image action (components/tinypng/actions/compress-image/compress-image.mjs), the syncDir property uses accessMode: "read" because this action only reads input files and returns API responses without writing files to /tmp, unlike other TinyPNG actions that save processed files to disk.

🧬 Code Graph Analysis (5)
components/google_slides/actions/insert-text/insert-text.mjs (6)
components/google_slides/actions/create-image/create-image.mjs (1)
  • response (71-93)
components/google_slides/actions/create-slide/create-slide.mjs (1)
  • response (36-41)
components/google_slides/actions/create-page-element/create-page-element.mjs (1)
  • response (73-95)
components/google_slides/actions/delete-page-element/delete-page-element.mjs (1)
  • response (38-38)
components/google_slides/actions/delete-slide/delete-slide.mjs (1)
  • response (28-28)
components/google_slides/actions/merge-data/merge-data.mjs (1)
  • response (96-104)
components/google_slides/actions/create-page-element/create-page-element.mjs (2)
components/google_slides/common/constants.mjs (2)
  • SHAPE_TYPES (1-143)
  • SHAPE_TYPES (1-143)
components/google_slides/actions/create-image/create-image.mjs (1)
  • response (71-93)
components/google_slides/actions/create-slide/create-slide.mjs (5)
components/google_slides/actions/create-image/create-image.mjs (1)
  • response (71-93)
components/google_slides/actions/create-page-element/create-page-element.mjs (1)
  • response (73-95)
components/google_slides/actions/delete-page-element/delete-page-element.mjs (1)
  • response (38-38)
components/google_slides/actions/delete-slide/delete-slide.mjs (1)
  • response (28-28)
components/google_slides/actions/insert-text/insert-text.mjs (1)
  • response (50-54)
components/google_slides/actions/delete-slide/delete-slide.mjs (1)
components/google_slides/actions/delete-page-element/delete-page-element.mjs (1)
  • response (38-38)
components/google_slides/actions/delete-page-element/delete-page-element.mjs (1)
components/google_slides/actions/delete-slide/delete-slide.mjs (1)
  • response (28-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (12)
components/google_slides/actions/find-presentation/find-presentation.mjs (1)

7-7: Consistent versioning – good

The 0.0.3 bump keeps this action in lock-step with the rest of the Google Slides package. No further action required.

components/google_slides/actions/refresh-chart/refresh-chart.mjs (1)

7-7: Version update acknowledged

0.0.3 matches the coordinated release. Confirm that the underlying refactor to batchUpdate() is already covered in tests so this action still works as expected.

components/google_slides/sources/new-presentation/new-presentation.mjs (1)

9-9: Minor bump to 0.0.4 OK

Source version leads the pack by one patch – makes sense given the additional logic extensions. Ensure downstream automation (e.g., import paths in templates) tolerates mixed patch versions.

components/google_slides/package.json (2)

3-3: Appropriate version bump for new features.

The minor version bump from 0.1.1 to 0.2.0 correctly reflects the addition of new CRUD functionality for Google Slides.


15-15: Verify @pipedream/platform v3.1.0 Breaking Changes

We scanned the codebase for @pipedream/platform usage and found multiple sources importing
DEFAULT_POLLING_SOURCE_TIMER_INTERVAL. This major bump (0.x → 3.x) could rename, remove or alter that export or default polling behavior.

Please confirm in the v3.1.0 changelog or source that:

DEFAULT_POLLING_SOURCE_TIMER_INTERVAL is still exported and behaves as before
• No other exports or method signatures you rely on have changed

Key files to check:

  • components/uservoice/sources/new-nps-ratings/new-nps-ratings.js
  • components/stack_exchange/sources/new-question-for-keywords/new-question-for-keywords.js
  • components/stack_exchange/sources/new-answers-from-users/new-answers-from-users.js
  • components/stack_exchange/sources/new-answers-for-questions/new-answers-for-questions.js
  • components/here/sources/weather-for-zip/weather-for-zip.js
  • components/hacker_news/sources/new-stories-by-keyword/new-stories-by-keyword.js
  • components/hacker_news/sources/new-comments-by-keyword/new-comments-by-keyword.js

If anything has changed, update imports or replace usages accordingly before merging.

components/google_slides/actions/insert-text/insert-text.mjs (2)

26-35: Good use of textOnly filter for shape selection.

The textOnly: true parameter in the shapeId prop definition is excellent for preventing users from selecting non-text shapes, which would cause API errors.


49-57: Proper API integration and response handling.

The method call to insertText and response handling follow the established patterns. The summary export provides useful feedback to users.

components/google_slides/actions/create-image/create-image.mjs (2)

31-68: Well-designed transformation properties with sensible defaults.

The dimension and transformation properties provide comprehensive control over image placement. The default values (scale: 1, translate: 0) are appropriate and the descriptions clearly explain the points measurement system.


70-96: Proper API integration and response handling.

The object structure correctly matches the Google Slides API requirements, and the response handling appropriately extracts the object ID from the nested reply structure.

components/google_slides/actions/delete-slide/delete-slide.mjs (1)

11-25: Proper prop dependency structure.

The slideId prop correctly depends on presentationId, ensuring slides are loaded dynamically based on the selected presentation.

components/google_slides/actions/create-slide/create-slide.mjs (1)

34-47: Good error handling implementation!

The try-catch block with ConfigurationError provides clear feedback to users about potential permission issues.

components/google_slides/google_slides.app.mjs (1)

78-96: Excellent refactoring with the centralized batchUpdate method!

The introduction of batchUpdate as a central method for API calls is a great architectural decision. It reduces code duplication and makes the codebase more maintainable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Google Slide - Pages / Slides CRUD
1 participant