-
Notifications
You must be signed in to change notification settings - Fork 5.4k
17338 components joggai #17503
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
17338 components joggai #17503
Conversation
Actions - Create AI Avatar Photo - Crate Avatar Video - Create Product From Product Info - Create Product From URL - Update Product Info Sources - Video Status Changed (Instant)
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis update introduces a comprehensive JoggAI integration, adding multiple actions for product and avatar creation, a webhook source for video status changes, shared constants and utilities, and a fully implemented API client. Each action and source is modularized, with validation and response handling, enabling seamless interaction with the JoggAI API for media and avatar management. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action
participant JoggAI API
User->>Action: Trigger action (e.g., create-product-from-url)
Action->>JoggAI API: Send API request with parameters
JoggAI API-->>Action: Respond with result/status
Action-->>User: Return response and summary
sequenceDiagram
participant JoggAI
participant Webhook Source
participant External Service
JoggAI-->>Webhook Source: Send video status event (success/failure)
Webhook Source->>External Service: Emit event with summary and details
Assessment against linked issues
Poem
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
components/joggai/actions/update-product-info/update-product-info.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/joggai/sources/common/base.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 (4)
components/joggai/common/utils.mjs (3)
8-9
: Consider adding an upper bound validation for mediaQuantity.Without an upper limit, users could potentially create an excessive number of dynamic properties, which could impact performance and user experience.
Consider adding validation:
export const prepareAdditionalProps = (props) => { const newProps = {}; if (props.mediaQuantity) { + const MAX_MEDIA_ITEMS = 50; // or another reasonable limit + const quantity = Math.min(props.mediaQuantity, MAX_MEDIA_ITEMS); - for (let i = 0; i < props.mediaQuantity; i++) { + for (let i = 0; i < quantity; i++) {
54-79
: Add error handling for individual media uploads.If one media upload fails, the entire operation will fail. Consider adding try-catch for individual uploads to handle partial failures gracefully.
Wrap the media upload logic in a try-catch block:
for (let i = 0; i < props.mediaQuantity; i++) { + try { const media = await props.joggai.createUrl({ data: { filename: props[`mediaUrl${i}`], }, }); // ... rest of the upload logic ... data.media.push({ type: props[`mediaType${i}`], name: props[`mediaName${i}`], url: media.data.asset_id, description: props[`mediaDescription${i}`], }); + } catch (error) { + console.error(`Failed to upload media item ${i}:`, error); + // Optionally continue with other uploads or throw + } }
83-87
: Consider validating response structure.The error checking logic is good, but consider adding a null check for defensive programming.
export const checkResponse = (response) => { - if (response.code) { + if (response?.code) { - throw new ConfigurationError(response.msg); + throw new ConfigurationError(response.msg || "Unknown error occurred"); } };components/joggai/common/constants.mjs (1)
1-105
: Consider standardizing constant structures for consistency.Some constants use objects with
label
andvalue
properties while others use plain strings. This inconsistency might cause confusion when consuming these constants.For example,
AGE_OPTIONS
,AVATAR_STYLE_OPTIONS
,GENDER_OPTIONS
,MODEL_OPTIONS
, andETHNICITY_OPTIONS
use plain strings, whileMEDIA_TYPES
,ASPECT_RATIO_OPTIONS
, etc. use objects. Consider standardizing to one format based on how they're consumed by the API.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
components/joggai/actions/create-ai-avatar-photo/create-ai-avatar-photo.mjs
(1 hunks)components/joggai/actions/create-avatar-video/create-avatar-video.mjs
(1 hunks)components/joggai/actions/create-product-from-product-info/create-product-from-product-info.mjs
(1 hunks)components/joggai/actions/create-product-from-url/create-product-from-url.mjs
(1 hunks)components/joggai/actions/update-product-info/update-product-info.mjs
(1 hunks)components/joggai/common/constants.mjs
(1 hunks)components/joggai/common/utils.mjs
(1 hunks)components/joggai/joggai.app.mjs
(1 hunks)components/joggai/package.json
(1 hunks)components/joggai/sources/common/base.mjs
(1 hunks)components/joggai/sources/video-status-changed/test-event.mjs
(1 hunks)components/joggai/sources/video-status-changed/video-status-changed.mjs
(1 hunks)
🧰 Additional context used
🧠 Learnings (10)
components/joggai/actions/create-ai-avatar-photo/create-ai-avatar-photo.mjs (4)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Learnt from: js07
PR: PipedreamHQ/pipedream#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.
components/joggai/sources/video-status-changed/test-event.mjs (1)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
components/joggai/package.json (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#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/joggai/actions/update-product-info/update-product-info.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/joggai/actions/create-avatar-video/create-avatar-video.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/joggai/common/utils.mjs (2)
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: For "dir" props in Pipedream components, whether to mark them as optional depends on the action's file I/O behavior - if an action always writes files as output, the "dir" prop should not be marked as optional.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#13961
File: components/fakturoid/actions/create-invoice/create-invoice.mjs:95-99
Timestamp: 2024-10-15T15:07:38.361Z
Learning: An "object array" type is not yet supported for Pipedream props.
components/joggai/sources/common/base.mjs (3)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
components/joggai/joggai.app.mjs (3)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: The Salesloft API list endpoints (listPeople, listCadences, listUsers, listAccounts) return arrays directly in the response body, not wrapped in a metadata object with a nested data property. The _makeRequest method correctly returns response.data which contains the arrays that can be mapped over directly in propDefinitions.
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: "dir" props in Pipedream components are hidden in the component form and not user-facing, so they don't require labels or descriptions for user clarity.
components/joggai/actions/create-product-from-product-info/create-product-from-product-info.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/joggai/sources/video-status-changed/video-status-changed.mjs (3)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
⏰ 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: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: pnpm publish
🔇 Additional comments (23)
components/joggai/common/utils.mjs (1)
36-43
: LGTM!Clean and efficient stream-to-buffer conversion implementation with proper error handling.
components/joggai/package.json (1)
3-16
: LGTM!Version bump to 0.1.0 is appropriate for the new features being added, and the @pipedream/platform dependency is correctly specified.
components/joggai/sources/video-status-changed/test-event.mjs (1)
1-10
: Verify the timestamp value.The timestamp
1751909260
corresponds to a date in 2025. Please confirm if this is intentional for testing purposes.components/joggai/actions/update-product-info/update-product-info.mjs (1)
8-65
: LGTM!Well-structured action module with proper error handling and consistent use of shared utilities. The implementation follows Pipedream best practices.
components/joggai/actions/create-avatar-video/create-avatar-video.mjs (4)
1-8
: LGTM on imports and structureThe imports are well-organized and follow the expected pattern for JoggAI actions, importing constants, utilities, and the app client appropriately.
10-15
: LGTM on action metadataThe action metadata follows the standard Pipedream pattern with clear key, name, description, version, and type definitions.
86-91
: Good validation logic for mutually exclusive parametersThe validation correctly ensures that either script OR audio URL is provided, but not both, which aligns with the API requirements described in the property descriptions.
108-112
: LGTM on response handlingThe response handling follows the established pattern using
checkResponse
utility and proper export of summary message.components/joggai/sources/video-status-changed/video-status-changed.mjs (4)
1-3
: LGTM on importsThe imports are appropriate, bringing in the base module and test event sample.
4-11
: LGTM on source metadataThe source metadata follows Pipedream conventions with proper key, name, description, version, type, and dedupe strategy.
12-22
: Good implementation of required methodsThe
getEvents()
andgetSummary()
methods are properly implemented as required by the base class pattern. The events returned match typical video processing workflow states.
23-24
: LGTM on sample emitThe sample emit is properly included for testing purposes, following the established pattern.
components/joggai/actions/create-ai-avatar-photo/create-ai-avatar-photo.mjs (4)
1-10
: LGTM on imports and structureThe imports are well-organized and consistent with other JoggAI actions.
12-17
: LGTM on action metadataGood action metadata with proper documentation link included.
18-75
: LGTM on property definitionsThe property definitions are comprehensive and well-structured, using appropriate constants for option sets and proper optional flags.
92-96
: LGTM on response handlingThe response handling follows the established pattern correctly.
components/joggai/sources/common/base.mjs (3)
1-8
: LGTM on structure and propsThe base module properly defines the essential props for webhook sources: app instance, database, and HTTP interface.
10-19
: Good webhook activation logicThe activation hook properly creates the webhook and stores the ID for later cleanup. The use of
this.getEvents()
correctly delegates to the implementing class.
25-31
: LGTM on event emissionThe event emission logic properly uses the event body and includes appropriate metadata with ID, summary, and timestamp.
components/joggai/actions/create-product-from-url/create-product-from-url.mjs (3)
1-3
: LGTM on importsThe imports are minimal and appropriate for this action.
4-17
: LGTM on action structureThe action metadata and property definitions are clean and well-documented with appropriate API documentation link.
18-31
: LGTM on implementationThe implementation is straightforward and follows the established pattern with proper response handling and summary export.
components/joggai/actions/create-product-from-product-info/create-product-from-product-info.mjs (1)
41-57
: Well-structured action implementation!The code properly uses utility functions for media data preparation and response validation, follows async patterns correctly, and provides clear user feedback.
components/joggai/actions/create-ai-avatar-photo/create-ai-avatar-photo.mjs
Show resolved
Hide resolved
components/joggai/actions/create-product-from-product-info/create-product-from-product-info.mjs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…nalProps and mediaQuantity definitions. Update base source to handle string body input gracefully.
/approve |
Resolves #17338
Summary by CodeRabbit
New Features
Enhancements
Chores