Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Apr 7, 2025

Resolves #16094

High Level

  • New Form Submission
  • New Contact Created
  • Add Contact to Campaign

Eleven Labs

  • Create Agent
  • Make Outbound Call

Summary by CodeRabbit

  • New Features

    • Expanded ElevenLabs integration with new modules for agent creation, outbound calling, and enhanced audio management.
    • Broadened HighLevel OAuth functionality with new actions for managing contacts, campaigns, and event tracking for new contacts and form submissions.
    • Introduced new methods for listing phone numbers and agents within the ElevenLabs app.
  • Chores

    • Upgraded versions and dependencies to ensure improved performance.
    • Streamlined options and property labels for a more consistent user experience.

@vercel
Copy link

vercel bot commented Apr 7, 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 Apr 7, 2025 4:31pm
pipedream-docs ⬜️ Ignored (Inspect) Apr 7, 2025 4:31pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Apr 7, 2025 4:31pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 7, 2025

Walkthrough

This pull request makes several version updates and introduces new modules across two integrations: ElevenLabs and HighLevel OAuth. For ElevenLabs, existing action modules have their version numbers incremented while new modules for creating agents and making outbound calls are added. In the HighLevel OAuth integration, new modules for adding contacts to campaigns and handling new contact and form submission events have been introduced, along with refactors in common functionalities, updates to method signatures, and property enhancements. Package dependency versions have also been updated accordingly.

Changes

File/s Change Summary
components/elevenlabs/actions/add-voice.mjs
components/elevenlabs/actions/download-history-items.mjs
components/elevenlabs/actions/get-audio-from-history-item.mjs
components/elevenlabs/actions/list-models.mjs
components/elevenlabs/actions/text-to-speech.mjs
components/elevenlabs/sources/new-history-item/new-history-item.mjs
Version updates (e.g., from "0.0.1"/"0.0.2" to "0.0.2"/"0.0.3") with no functionality changes.
components/elevenlabs/actions/create-agent/create-agent.mjs
components/elevenlabs/actions/make-outbound-call/make-outbound-call.mjs
New modules added for creating an agent and making outbound calls using ElevenLabs.
components/elevenlabs/elevenlabs.app.mjs
components/elevenlabs/package.json
Enhancements: new properties (phoneNumberId, agentId) and methods (listPhoneNumbers, listAgents, createAgent, makeOutboundCall); version bump and dependency update.
components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjs
components/highlevel_oauth/actions/create-contact/create-contact.mjs
components/highlevel_oauth/actions/update-contact/update-contact.mjs
components/highlevel_oauth/actions/upsert-contact/upsert-contact.mjs
New module for adding contacts to campaigns and version updates/refactored imports for contact-related actions.
components/highlevel_oauth/common/base.mjs
components/highlevel_oauth/actions/common/common-contacts.mjs
Refactor: common functionalities consolidated; removed redundant error handling; updated to use a common base module.
components/highlevel_oauth/highlevel_oauth.app.mjs
components/highlevel_oauth/package.json
New property (campaignId), new methods (listCampaigns, listFormSubmissions, addContactToCampaign), method signature updates, version bump, and dependency update.
components/highlevel_oauth/sources/common/base-polling.mjs
components/highlevel_oauth/sources/new-contact-created/new-contact-created.mjs
components/highlevel_oauth/sources/new-contact-created/test-event.mjs
components/highlevel_oauth/sources/new-form-submission/new-form-submission.mjs
components/highlevel_oauth/sources/new-form-submission/test-event.mjs
New modules for enhanced polling, and event sources for new contact and new form submission events with associated test events.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as External Trigger
    participant EApp as ElevenLabs App
    participant API as ElevenLabs API
    participant Twilio as Twilio Service
    Caller->>EApp: Invoke outbound call action
    EApp->>API: Call makeOutboundCall with agent & call info
    API->>Twilio: Initiate outbound call
    Twilio-->>API: Return call response
    API-->>EApp: Pass response
    EApp-->>Caller: Return summary message
Loading
sequenceDiagram
    participant HL as HighLevel OAuth App
    participant DB as Database (Last Date)
    participant API as HighLevel API
    participant Emitter as Event Emitter
    HL->>DB: Retrieve last processed date
    HL->>API: Query new contacts/form submissions
    API-->>HL: Return fetched data
    HL->>Emitter: Emit event with generated metadata
    HL->>DB: Update last processed date
Loading

Assessment against linked issues

Objective Addressed Explanation
Integrate ElevenLabs functionality (agent creation and outbound calls) with go high level (#16094)
Support go high level CRM automation triggers (new lead events) and campaign management (#16094)

Suggested labels

ai-assisted

Suggested reviewers

  • lcaresia
  • jcortes

Poem

I’m a happy rabbit on the run,
Hopping through code under the sun.
New agents and calls now take flight,
Integrations gleam in the bright light.
With each change, my heart skips a beat—
Code magic makes every hop so sweet! 🐇✨

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/elevenlabs/actions/add-voice/add-voice.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 packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

components/elevenlabs/elevenlabs.app.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 packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.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 packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)


📜 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 e0d31bb and 71037cf.

📒 Files selected for processing (3)
  • components/elevenlabs/actions/add-voice/add-voice.mjs (2 hunks)
  • components/elevenlabs/elevenlabs.app.mjs (5 hunks)
  • components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/elevenlabs/actions/add-voice/add-voice.mjs
  • components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (7)
components/elevenlabs/elevenlabs.app.mjs (7)

9-9: Improved label consistency.

Good change to standardize on "ID" (uppercase) in label fields for identifiers across the component.

Also applies to: 37-37, 52-52


65-78: Well-implemented phoneNumberId property.

The new phoneNumberId property is well-structured with appropriate type, label, and description. The options method correctly retrieves phone numbers from the API and transforms them into the expected format for UI selection.


79-105: Well-implemented agentId property with pagination support.

The agentId property implementation follows best practices with:

  • Proper cursor-based pagination
  • Good naming consistency
  • Defensive programming with the || [] fallback for null/undefined agents

The pagination handling through the context object will work well for large collections of agents.


183-188: LGTM: listPhoneNumbers method.

The implementation follows the established pattern of the other API methods in this file.


189-194: LGTM: listAgents method.

The implementation follows the established pattern of the other API methods in this file.


195-201: LGTM: createAgent method.

The implementation is consistent with other API methods in this file.


202-208: LGTM: makeOutboundCall method.

The implementation follows the established pattern and is aligned with the PR objective to add outbound call functionality.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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: 4

🧹 Nitpick comments (9)
components/elevenlabs/actions/add-voice/add-voice.mjs (1)

62-62: Typo in Exported Summary

There's a typo in the summary message at line 62: "Sucessfully" should be corrected to "Successfully" to maintain professionalism and clarity in user-facing messages.
Consider applying the following diff:

-    $.export("$summary", `Sucessfully added voice (ID: ${response.voice_id})`);
+    $.export("$summary", `Successfully added voice (ID: ${response.voice_id})`);
components/elevenlabs/actions/make-outbound-call/make-outbound-call.mjs (1)

38-41: Consider enhancing error handling

The success case is handled, but there's no specific error handling or user feedback if the call fails. Consider adding an else case with a descriptive error message.

    if (response?.success) {
      $.export("$summary", `Successfully made outbound call to ${this.toNumber}`);
+    } else {
+      $.export("$summary", `Failed to make outbound call to ${this.toNumber}${response?.error ? `: ${response.error}` : ''}`);
    }
components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjs (1)

31-33: Fix typo in success message.

There's a typo in the success message: "conatct" should be "contact".

- $.export("$summary", `Successfully added conatct to campaign with ID: ${this.campaignId}`);
+ $.export("$summary", `Successfully added contact to campaign with ID: ${this.campaignId}`);
components/elevenlabs/actions/create-agent/create-agent.mjs (1)

99-132: Consider adding error handling.

The implementation correctly uses the ElevenLabs API to create an agent and exports a summary on success. However, you might want to add explicit error handling for cases when the API call fails or returns unexpected responses.

 async run({ $ }) {
-    const response = await this.elevenlabs.createAgent({
-      $,
-      data: {
-        conversation_config: {
-          conversation: {
-            max_duration_seconds: this.maxDurationSeconds,
-          },
-          turn: {
-            turn_timeout: this.turnTimeout && +this.turnTimeout,
-          },
-          agent: {
-            first_message: this.firstMessage,
-            language: this.language,
-            prompt: {
-              prompt: this.prompt,
-              llm: this.llm,
-              temperature: this.temperature && +this.temperature,
-              max_tokens: this.maxTokens,
-            },
-          },
-          tts: {
-            voice_id: this.voiceId,
-            model_id: this.modelId,
-          },
-        },
-        name: this.name,
-      },
-    });
+    try {
+      const response = await this.elevenlabs.createAgent({
+        $,
+        data: {
+          conversation_config: {
+            conversation: {
+              max_duration_seconds: this.maxDurationSeconds,
+            },
+            turn: {
+              turn_timeout: this.turnTimeout && +this.turnTimeout,
+            },
+            agent: {
+              first_message: this.firstMessage,
+              language: this.language,
+              prompt: {
+                prompt: this.prompt,
+                llm: this.llm,
+                temperature: this.temperature && +this.temperature,
+                max_tokens: this.maxTokens,
+              },
+            },
+            tts: {
+              voice_id: this.voiceId,
+              model_id: this.ttsModelId,
+            },
+          },
+          name: this.name,
+        },
+      });
+      
+      if (!response) {
+        throw new Error("No response received from ElevenLabs API");
+      }
+      
+      if (response?.agent_id) {
+        $.export("$summary", `Successfully created agent with ID: ${response.agent_id}`);
+      } else {
+        $.export("$summary", "Agent created, but no agent ID was returned");
+      }
+      return response;
+    } catch (error) {
+      throw new Error(`Failed to create agent: ${error.message}`);
+    }
-    if (response?.agent_id) {
-      $.export("$summary", `Successfully created agent with ID: ${response.agent_id}`);
-    }
-    return response;
components/highlevel_oauth/sources/new-form-submission/new-form-submission.mjs (1)

43-45: Consider using full ISO date string for maxDate.

Slicing the date string to 10 characters (YYYY-MM-DD) removes time information that might be important for precise chronological ordering.

-  maxDate = submission.createdAt.slice(0, 10);
+  maxDate = submission.createdAt;
components/elevenlabs/elevenlabs.app.mjs (4)

183-188: Path inconsistency in listPhoneNumbers method.

The path in the listPhoneNumbers method starts with a forward slash, while other API paths in this file don't include the leading slash. Consider removing it for consistency.

-    listPhoneNumbers(args = {}) {
-      return this._makeRequest({
-        path: "/convai/phone-numbers/",
-        ...args,
-      });
-    },
+    listPhoneNumbers(args = {}) {
+      return this._makeRequest({
+        path: "convai/phone-numbers/",
+        ...args,
+      });
+    },

189-194: Path inconsistency in listAgents method.

Similar to the previous comment, the path in the listAgents method starts with a forward slash, which differs from the pattern used in other methods in this file.

-    listAgents(args = {}) {
-      return this._makeRequest({
-        path: "/convai/agents",
-        ...args,
-      });
-    },
+    listAgents(args = {}) {
+      return this._makeRequest({
+        path: "convai/agents",
+        ...args,
+      });
+    },

195-201: Path inconsistency in createAgent method.

The path in the createAgent method starts with a forward slash, which is inconsistent with the pattern used in most other methods in this file.

-    createAgent(args = {}) {
-      return this._makeRequest({
-        method: "POST",
-        path: "/convai/agents/create",
-        ...args,
-      });
-    },
+    createAgent(args = {}) {
+      return this._makeRequest({
+        method: "POST",
+        path: "convai/agents/create",
+        ...args,
+      });
+    },

202-208: Path inconsistency in makeOutboundCall method.

The path in the makeOutboundCall method starts with a forward slash, which is inconsistent with the pattern used in most other methods in this file.

-    makeOutboundCall(args = {}) {
-      return this._makeRequest({
-        method: "POST",
-        path: "/convai/twilio/outbound_call",
-        ...args,
-      });
-    },
+    makeOutboundCall(args = {}) {
+      return this._makeRequest({
+        method: "POST",
+        path: "convai/twilio/outbound_call",
+        ...args,
+      });
+    },
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between aba3eb5 and 0423fd7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • components/elevenlabs/actions/add-voice/add-voice.mjs (1 hunks)
  • components/elevenlabs/actions/create-agent/create-agent.mjs (1 hunks)
  • components/elevenlabs/actions/download-history-items/download-history-items.mjs (1 hunks)
  • components/elevenlabs/actions/get-audio-from-history-item/get-audio-from-history-item.mjs (1 hunks)
  • components/elevenlabs/actions/list-models/list-models.mjs (1 hunks)
  • components/elevenlabs/actions/make-outbound-call/make-outbound-call.mjs (1 hunks)
  • components/elevenlabs/actions/text-to-speech/text-to-speech.mjs (1 hunks)
  • components/elevenlabs/elevenlabs.app.mjs (5 hunks)
  • components/elevenlabs/package.json (2 hunks)
  • components/elevenlabs/sources/new-history-item/new-history-item.mjs (1 hunks)
  • components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjs (1 hunks)
  • components/highlevel_oauth/actions/common/common-contacts.mjs (2 hunks)
  • components/highlevel_oauth/actions/create-contact/create-contact.mjs (2 hunks)
  • components/highlevel_oauth/actions/update-contact/update-contact.mjs (2 hunks)
  • components/highlevel_oauth/actions/upsert-contact/upsert-contact.mjs (2 hunks)
  • components/highlevel_oauth/common/base.mjs (1 hunks)
  • components/highlevel_oauth/highlevel_oauth.app.mjs (4 hunks)
  • components/highlevel_oauth/package.json (2 hunks)
  • components/highlevel_oauth/sources/common/base-polling.mjs (1 hunks)
  • components/highlevel_oauth/sources/new-contact-created/new-contact-created.mjs (1 hunks)
  • components/highlevel_oauth/sources/new-contact-created/test-event.mjs (1 hunks)
  • components/highlevel_oauth/sources/new-form-submission/new-form-submission.mjs (1 hunks)
  • components/highlevel_oauth/sources/new-form-submission/test-event.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: pnpm publish
🔇 Additional comments (41)
components/elevenlabs/sources/new-history-item/new-history-item.mjs (1)

7-7: Version Update Confirmation

The version property has been updated from "0.0.2" to "0.0.3", which aligns with the coordinated versioning changes across the ElevenLabs modules. Make sure that any downstream dependencies referencing this module now use the updated version.

components/elevenlabs/actions/add-voice/add-voice.mjs (1)

8-8: Version Update Consistency

The version change from "0.0.1" to "0.0.2" is clear and consistent with the coordinated updates in other ElevenLabs components.

components/elevenlabs/actions/get-audio-from-history-item/get-audio-from-history-item.mjs (1)

9-9: Version Update Confirmation

The version number has been updated from "0.0.2" to "0.0.3", maintaining consistency within the ElevenLabs action modules. No further functional changes were necessary in this update.

components/elevenlabs/actions/download-history-items/download-history-items.mjs (1)

9-9: Consistent Version Increment

The update of the version property from "0.0.2" to "0.0.3" is consistent with similar changes in the repository. This helps ensure uniform versioning across modules.

components/elevenlabs/actions/list-models/list-models.mjs (1)

6-6: Version Alignment Confirmed

The version for this module has been updated to "0.0.3", which is in line with the recent updates across the ElevenLabs components. This maintains clarity and consistency regarding module iterations.

components/elevenlabs/actions/text-to-speech/text-to-speech.mjs (1)

9-9: Version bump looks good

The version increment from "0.0.2" to "0.0.3" is appropriate and consistent with the versioning updates across other ElevenLabs components in this PR.

components/highlevel_oauth/package.json (2)

3-3: Version increment is appropriate

The version bump from "0.1.0" to "0.2.0" correctly reflects the addition of new HighLevel components being introduced in this PR.


16-16: Platform dependency updated to latest version

The update to @pipedream/platform from "^1.6.2" to "^3.0.3" is significant. This ensures compatibility with the latest platform features and matches the same dependency version used in the ElevenLabs package.

components/highlevel_oauth/common/base.mjs (1)

1-19: Good implementation of a base module for code reuse

This new base module effectively centralizes common functionality for HighLevel OAuth components, following best practices for code organization in Pipedream. The implementation:

  1. Properly handles the authentication validation
  2. Provides a clear error message when users authenticate incorrectly (as agency instead of location)
  3. Sets up reloadProps for dynamic property refreshing

This will help standardize behavior across HighLevel components while reducing code duplication.

components/elevenlabs/package.json (2)

3-3: Version increment is appropriate

The version bump from "0.2.0" to "0.3.0" correctly reflects the addition of new ElevenLabs components (Create Agent and Make Outbound Call) being introduced in this PR.


16-16: Platform dependency updated to latest version

The update to @pipedream/platform from "^1.6.0" to "^3.0.3" is significant. This ensures compatibility with the latest platform features and maintains consistency with other components in this PR.

components/elevenlabs/actions/make-outbound-call/make-outbound-call.mjs (1)

1-43: Well-structured new component for ElevenLabs outbound calling!

The implementation is clean and follows the expected patterns for Pipedream components. The code properly references the ElevenLabs app and makes an outbound call with the required parameters.

components/highlevel_oauth/actions/upsert-contact/upsert-contact.mjs (2)

1-1: Appropriate module refactoring to common-contacts

The import path change reflects better modularization by moving contact-specific functionality to a dedicated module.


14-14: Version bump correctly reflects structural changes

The version increment from 0.0.1 to 0.0.2 properly indicates the module structure changes without functional modifications.

components/highlevel_oauth/actions/update-contact/update-contact.mjs (2)

1-1: Consistent refactoring to common-contacts module

The import path change maintains consistency with other contact components and improves code organization.


14-14: Appropriate version increment

The version update from 0.0.1 to 0.0.2 correctly reflects the import path changes without functional modifications.

components/highlevel_oauth/actions/create-contact/create-contact.mjs (2)

1-1: Consistent module refactoring across contact components

The import path update maintains consistency with other HighLevel contact-related components and improves code organization.


14-14: Appropriate version increment

The version update from 0.0.1 to 0.0.2 properly reflects the structural changes without functional modifications.

components/highlevel_oauth/sources/new-form-submission/test-event.mjs (1)

1-59: Well-structured test event for form submissions.

The test event structure is comprehensive and includes all essential data needed for form submission processing, including identifiers, form data, user information, and metadata. The structure appears well-organized and properly formatted.

A couple of observations:

  • Future-dated timestamp (2025-04-04) is appropriate for test data
  • The signature hash is properly included for verification purposes
  • All necessary fields for form submission processing are present
components/highlevel_oauth/sources/common/base-polling.mjs (1)

1-25: Good implementation of polling base module.

The module correctly extends the common base functionality and implements the necessary components for a polling source:

  1. Proper import of the default polling interval from the platform
  2. Well-structured database access methods for tracking the last poll date
  3. Timer configuration with appropriate default settings

This implementation follows best practices for creating reusable polling source components.

components/highlevel_oauth/actions/add-contact-to-campaign/add-contact-to-campaign.mjs (1)

1-36: Well-structured action component with proper documentation link.

The action component follows the proper structure for Pipedream actions:

  • Extends common base functionality
  • Properly defines required properties (contactId and campaignId)
  • Includes appropriate documentation reference
  • Handles the API call and response correctly

The implementation is clean and straightforward.

components/highlevel_oauth/sources/new-contact-created/test-event.mjs (1)

1-35: Comprehensive test event for new contact creation.

The test contact data structure includes all relevant fields for contact processing:

  • Personal and company information
  • Contact details (phone number is properly formatted)
  • Status fields and metadata
  • Appropriate tags for testing tag functionality

Note that the email field is set to null, which is valid but might be worth considering if you want to test email-related functionality.

components/elevenlabs/actions/create-agent/create-agent.mjs (2)

1-8: LGTM! The module imports and metadata look good.

The import statement properly references the ElevenLabs app module, and the action metadata (key, name, description, version, and type) is clear and well-documented with a link to the API documentation.


9-98: Props configuration is comprehensive and well-structured.

The properties configuration provides all the necessary parameters for the ElevenLabs agent creation with appropriate types, labels, descriptions, and optional flags. The LLM options are extensive and up-to-date.

components/highlevel_oauth/actions/common/common-contacts.mjs (4)

1-3: Good refactoring of imports.

The change to import the common module from base.mjs improves code organization and reuse.


4-8: Well-structured component composition.

Using the spread operator to include properties from the common module promotes code reuse and maintainability.


34-36: Good method reuse from common module.

Properly extending common methods while keeping the specialized functionality in this module.


36-48:

✅ Verification successful

Ensure app property availability after refactoring.

The getData method references app in both the destructuring and the return value. Make sure this property is properly available after the refactoring from common.


🏁 Script executed:

#!/bin/bash
# Check the common/base.mjs file to verify if it exports an app property
cat components/highlevel_oauth/common/base.mjs | grep -A 5 "props" | grep "app"

Length of output: 102


App property availability verified

The verification confirms that the app property is still available in the common module. Specifically, the output from components/highlevel_oauth/common/base.mjs shows the app property being spread as expected. No further changes are necessary regarding the availability of app after the refactoring.

components/highlevel_oauth/sources/new-contact-created/new-contact-created.mjs (3)

1-11: LGTM! Source configuration is well-defined.

The imports, metadata, and deduplication strategy are appropriate for a contact creation event source.


12-21: Metadata generation looks good.

The generateMeta method properly extracts the necessary information from contact objects to create appropriate event metadata.


31-40: ⚠️ Potential issue

Fix potential infinite loop in pagination logic.

If meta?.total is undefined, the total variable would be undefined, and the condition results.length < total would always be true, potentially causing an infinite loop.

 do {
   const {
     contacts, meta,
   } = await this.app.searchContacts({
     params,
   });
   results.push(...contacts);
   params.startAfter = meta?.startAfter;
   total = meta?.total;
-} while (results.length < total);
+} while (total !== undefined && results.length < total && contacts.length > 0);

Likely an incorrect or invalid review comment.

components/highlevel_oauth/sources/new-form-submission/new-form-submission.mjs (2)

1-11: LGTM! Source configuration is well-defined.

The imports, metadata, and deduplication strategy are appropriate for a form submission event source.


12-21: Metadata generation looks good.

The generateMeta method properly extracts the necessary information from submission objects to create appropriate event metadata.

components/elevenlabs/elevenlabs.app.mjs (3)

9-9: Good consistency improvement in property labels.

Changing the labels to use "ID" consistently across all properties improves readability and maintains a standard format throughout the codebase.

Also applies to: 37-37, 52-52


65-78: The phoneNumberId property is well-defined.

This property is properly structured with appropriate type, label, and description. The options method correctly uses the new listPhoneNumbers method and handles possible null responses with the || [] fallback, which is a good defensive programming practice.


79-105: Well-implemented agentId property with pagination support.

The agentId property is properly defined with appropriate metadata. The options method correctly implements pagination using a cursor-based approach, with a specified page_size. The null-checking with || [] is a good defensive measure.

components/highlevel_oauth/highlevel_oauth.app.mjs (5)

34-51: Well-implemented campaignId property with options fetching.

The campaignId property is properly defined with appropriate type, label, and description. The options method correctly retrieves and formats campaigns from the API, including a defensive check with || [] to handle potential null values.


60-60: Good refactoring of method signatures.

Removing the async keyword from methods that don't directly use await is an appropriate optimization. The signature changes, including adding default empty object parameters and better parameter destructuring in updateContact, improve code clarity and consistency.

Also applies to: 75-75, 82-84, 91-91, 98-98


104-109: The listCampaigns method supports the new campaignId property.

This method aligns with the PR objective to add "Add Contact to Campaign" functionality by providing the necessary API integration to retrieve available campaigns.


110-115: The listFormSubmissions method supports the Form Submission functionality.

This method supports the PR objective to add "New Form Submission" functionality by providing the necessary API integration.


116-124: The addContactToCampaign method directly implements a PR objective.

This method directly implements the "Add Contact to Campaign" functionality mentioned in the PR objectives. The implementation is clean and follows the established patterns in the file.

@michelle0927 michelle0927 merged commit 60a9be6 into master Apr 9, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-16094 branch April 9, 2025 14: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.

go high level

3 participants