Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jul 25, 2025

Resolves #17404

Summary by CodeRabbit

  • New Features

    • Added actions for Google Slides integration: create slide, create image, create shape, insert text into shapes, delete slides, and delete page elements.
    • Enhanced shape support with a comprehensive list of shape types.
    • Enabled selection of slide layouts, slides, and shapes with improved property options.
  • Improvements

    • Centralized and expanded Google Slides API capabilities for slide and object manipulation.
    • Upgraded Google Slides integration dependencies.
  • Bug Fixes

    • Minor formatting corrections in unrelated components (no user-facing impact).

@vercel
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) Visit Preview Jul 29, 2025 5:16pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 29, 2025 5:16pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 29, 2025 5:16pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 25, 2025

Walkthrough

This update introduces multiple new Google Slides actions for CRUD operations on slides and page elements, including creating and deleting slides, shapes, images, and text elements. It also adds utility methods and prop definitions to the Google Slides app module, a new constants file for shape types, and increments versions for existing actions. Minor non-functional changes are made to other app files.

Changes

Cohort / File(s) Change Summary
Google Slides CRUD Actions
components/google_slides/actions/create-slide/create-slide.mjs, components/google_slides/actions/delete-slide/delete-slide.mjs, components/google_slides/actions/create-page-element/create-page-element.mjs, components/google_slides/actions/create-image/create-image.mjs, components/google_slides/actions/delete-page-element/delete-page-element.mjs, components/google_slides/actions/insert-text/insert-text.mjs
Added new actions for creating/deleting slides, creating shapes/images, deleting page elements, and inserting text.
Google Slides App Enhancements
components/google_slides/google_slides.app.mjs
Added prop definitions and methods for layouts, slides, shapes, batch updates, slide/image/shape/text creation, deletion, and slide retrieval. Refactored refreshChart to use batch update.
Constants
components/google_slides/common/constants.mjs
Added a new constants file exporting supported shape types.
Action Version Bumps
components/google_slides/actions/create-presentation/create-presentation.mjs, components/google_slides/actions/find-presentation/find-presentation.mjs, components/google_slides/actions/merge-data/merge-data.mjs, components/google_slides/actions/refresh-chart/refresh-chart.mjs
Incremented version numbers in action metadata only; no logic changes.
Package Metadata
components/google_slides/package.json
Updated package version and upgraded @pipedream/platform dependency.
Whitespace Changes
components/hospitable/hospitable.app.mjs, components/ionos_hosting_services/ionos_hosting_services.app.mjs
Added trailing newlines; no functional changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GoogleSlidesApp
    participant GoogleSlidesAPI

    User->>GoogleSlidesApp: createSlide(presentationId, layoutId, insertionIndex)
    GoogleSlidesApp->>GoogleSlidesAPI: batchUpdate(CreateSlideRequest)
    GoogleSlidesAPI-->>GoogleSlidesApp: Slide creation response
    GoogleSlidesApp-->>User: Slide details

    User->>GoogleSlidesApp: createShape(presentationId, slideId, type, ...)
    GoogleSlidesApp->>GoogleSlidesAPI: batchUpdate(CreateShapeRequest)
    GoogleSlidesAPI-->>GoogleSlidesApp: Shape creation response
    GoogleSlidesApp-->>User: Shape details

    User->>GoogleSlidesApp: createImage(presentationId, slideId, url, ...)
    GoogleSlidesApp->>GoogleSlidesAPI: batchUpdate(CreateImageRequest)
    GoogleSlidesAPI-->>GoogleSlidesApp: Image creation response
    GoogleSlidesApp-->>User: Image details

    User->>GoogleSlidesApp: insertText(presentationId, shapeId, text, ...)
    GoogleSlidesApp->>GoogleSlidesAPI: batchUpdate(InsertTextRequest)
    GoogleSlidesAPI-->>GoogleSlidesApp: Text insertion response
    GoogleSlidesApp-->>User: Insertion result

    User->>GoogleSlidesApp: deleteObject(presentationId, objectId)
    GoogleSlidesApp->>GoogleSlidesAPI: batchUpdate(DeleteObjectRequest)
    GoogleSlidesAPI-->>GoogleSlidesApp: Deletion response
    GoogleSlidesApp-->>User: Deletion result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
Implement Google Slides CRUD for pages/slides (create, delete, update, read) (#17404)
Add actions for creating/deleting slides, and adding/removing content (shapes, images, text) (#17404)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Version bump and dependency update in package.json (components/google_slides/package.json) Not directly related to CRUD actions; likely for compatibility, but not specified in issue.
Trailing newline addition (components/hospitable/hospitable.app.mjs, components/ionos_hosting_services/ionos_hosting_services.app.mjs) Purely formatting; unrelated to Google Slides CRUD objectives.

Poem

Oh, what a hop through Slides today,
CRUD for pages—now we play!
Shapes and images leap in line,
Texts inserted, all so fine.
With every slide, a bunny cheer—
Google Slides, your spring is here!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 331feeb and 2ec41f2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • components/google_slides/actions/create-presentation/create-presentation.mjs (1 hunks)
  • components/google_slides/actions/find-presentation/find-presentation.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/google_slides.app.mjs (3 hunks)
  • components/google_slides/package.json (2 hunks)
  • components/hospitable/hospitable.app.mjs (1 hunks)
  • components/ionos_hosting_services/ionos_hosting_services.app.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (6)
  • components/hospitable/hospitable.app.mjs
  • components/google_slides/actions/find-presentation/find-presentation.mjs
  • components/google_slides/actions/create-presentation/create-presentation.mjs
  • components/ionos_hosting_services/ionos_hosting_services.app.mjs
  • components/google_slides/actions/merge-data/merge-data.mjs
  • components/google_slides/actions/refresh-chart/refresh-chart.mjs
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/google_slides/package.json
  • components/google_slides/google_slides.app.mjs
⏰ 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). (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
✨ 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.

lcaresia
lcaresia previously approved these changes Jul 28, 2025
@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 2138df9 into master Jul 31, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-17404 branch July 31, 2025 19:20
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

2 participants