Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Jun 16, 2025

Resolves #17095

Summary by CodeRabbit

  • New Features
    • Added actions for Offorte integration to create contact organisations, create contact people, create proposals, get contact details, list proposal templates, list proposals, list users, search contact organisations, search contact people, and send proposals.
    • Introduced an instant event source to trigger workflows on new Offorte events.
  • Enhancements
    • Expanded Offorte integration with comprehensive API support and dynamic property selection.
    • Added utility functions for data parsing, cleaning, and string formatting.
    • Included predefined option lists for statuses, send methods, and event types.
  • Chores
    • Updated package version and dependencies.

Sources
 - New Event (Instant)

Actions
 - Create Contact Organisation
 - Create Contact Person
 - Create Proposal
 - List Proposal Temaplates
 - List Proposals
 - List Users
 - Search Contact Organisation
 - Search Contact People
 - Send Proposal
@luancazarine luancazarine linked an issue Jun 16, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Jun 16, 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 Jun 18, 2025 2:29pm
pipedream-docs ⬜️ Ignored (Inspect) Jun 18, 2025 2:29pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jun 18, 2025 2:29pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 16, 2025

Walkthrough

This update introduces a comprehensive Offorte integration, adding new actions, utility modules, and a webhook-based event source. The changes implement API interactions for contacts, proposals, users, templates, and events, providing both CRUD operations and search capabilities. Utility and constants modules support data handling and option standardization.

Changes

File(s) Change Summary
components/offorte/offorte.app.mjs Implemented full Offorte API client, property definitions, and all required API methods.
components/offorte/actions/create-contact-organisation/create-contact-organisation.mjs Added "Create Contact Organisation" action with all relevant props and API call logic.
components/offorte/actions/create-contact-person/create-contact-person.mjs Added "Create Contact Person" action with required and optional fields, tags, and API call.
components/offorte/actions/get-contact-details/get-contact-details.mjs Added "Get Contact Details" action to fetch contact details by ID.
components/offorte/actions/search-contact-organisation/search-contact-organisation.mjs Added "Search Contact Organisation" action using query string.
components/offorte/actions/search-contact-people/search-contact-people.mjs Added "Search Contact People" action using query string.
components/offorte/actions/create-proposal/create-proposal.mjs Added "Create Proposal" action with all required/optional props and API call.
components/offorte/actions/list-proposal-templates/list-proposal-templates.mjs Added "List Proposal Templates" action to fetch templates.
components/offorte/actions/list-proposals/list-proposals.mjs Added "List Proposals" action with status filter.
components/offorte/actions/list-users/list-users.mjs Added "List Users" action to fetch all account users.
components/offorte/actions/send-proposal/send-proposal.mjs Added "Send Proposal" action with validation and API call.
components/offorte/common/constants.mjs Added constants for status, send methods, and event types.
components/offorte/common/utils.mjs Added utility functions for object parsing, cleaning, and string case conversion.
components/offorte/sources/new-event-instant/new-event-instant.mjs Added "New Event (Instant)" source for webhook event listening and emitting.
components/offorte/sources/new-event-instant/test-event.mjs Added test event sample for the event source.
components/offorte/package.json Updated package version and added @pipedream/platform dependency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant OfforteApp
    participant OfforteAPI

    User->>Action: Provide input parameters
    Action->>OfforteApp: Call relevant method with inputs
    OfforteApp->>OfforteAPI: Make HTTP request
    OfforteAPI-->>OfforteApp: Return API response
    OfforteApp-->>Action: Return processed data
    Action-->>User: Output summary and data
Loading
sequenceDiagram
    participant OfforteAPI
    participant WebhookSource
    participant PD_HTTP
    participant PD_DB

    WebhookSource->>PD_HTTP: Register webhook endpoint
    WebhookSource->>OfforteAPI: Create webhook with events
    OfforteAPI-->>WebhookSource: Return webhook ID
    WebhookSource->>PD_DB: Store webhook ID

    OfforteAPI-->>WebhookSource: Send event to endpoint
    WebhookSource->>PD_DB: Retrieve webhook ID
    WebhookSource-->>PD_HTTP: Emit event with summary and timestamp

    WebhookSource->>OfforteAPI: Delete webhook on deactivate
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement "List Users" action to fetch account users (#17095)
Implement "Create Contact Organisation" action with all specified props and tags options (#17095)
Implement "Create Contact Person" action with all specified props and tags options (#17095)
Implement "Get Contact Details" action by ID (#17095)
Implement "Search Contact Organisations" and "Search Contact People" actions by name (#17095)
Implement "List Proposal Templates", "Create Proposal", "List Proposals", and "Send Proposal" actions (#17095)

Suggested labels

ai-assisted

Poem

Hopping through code with nimble delight,
Offorte’s features now take flight!
Contacts and proposals, users galore,
Webhooks and searches—so much more!
With every new action, integrations bloom,
This rabbit’s proud—Offorte fills the room!
🐇✨

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/offorte/actions/get-contact-details/get-contact-details.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:201: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 ae1b72e and dd6ba18.

📒 Files selected for processing (1)
  • components/offorte/actions/get-contact-details/get-contact-details.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/offorte/actions/get-contact-details/get-contact-details.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
✨ Finishing Touches
  • 📝 Generate Docstrings

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 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

🔭 Outside diff range comments (1)
components/offorte/package.json (1)

3-17: Pin platform dependency to an exact minor to avoid future breakage

Using a caret (^3.1.0) means any 3.x release will be installed. Pipedream platform updates sometimes introduce breaking changes; consider pinning to ~3.1.0 (patch-level) or an exact version until the integration is proven compatible.

-    "@pipedream/platform": "^3.1.0"
+    "@pipedream/platform": "~3.1.0"
♻️ Duplicate comments (3)
components/offorte/actions/list-proposals/list-proposals.mjs (1)

20-26: Handle non-array API responses as with templates action

Similar to the template listing action, guard against the API returning an object envelope.

-    $.export("$summary", `Successfully fetched ${response.length} proposals`);
+    const count = Array.isArray(response) ? response.length : response?.data?.length ?? 0;
+    $.export("$summary", `Successfully fetched ${count} proposals`);
components/offorte/actions/create-contact-person/create-contact-person.mjs (1)

140-155: Same array-vs-parseObject concern for tags

See previous comments – using parseObject on an already-array input will throw.

components/offorte/actions/search-contact-organisation/search-contact-organisation.mjs (1)

17-26: Same response-shape concern as contact people search

Mirrors the previous comment – double-check the API returns an array.

🧹 Nitpick comments (13)
components/offorte/sources/new-event-instant/test-event.mjs (1)

1-5: Confirm epoch accuracy and add newline

The hard-coded timestamp (1718534400) represents seconds, whereas other integrations sometimes expect milliseconds. Double-check the downstream consumer of ts; if milliseconds are required, multiply by 1_000.

Also add a trailing newline to adhere to POSIX text-file conventions.

components/offorte/package.json (1)

12-14: Add missing fields for public NPM packages

repository, license, and engines are currently absent. Including them improves discoverability and compliance with open-source requirements.

components/offorte/actions/list-proposals/list-proposals.mjs (1)

13-17: Expose default / required value for status prop

If status is optional at the API level, consider adding optional: true or setting a sensible default; otherwise mark it required: true to guide users in the UI.

components/offorte/actions/create-contact-organisation/create-contact-organisation.mjs (1)

122-149: Minor: many address fields are required by default

street, zipcode, city, state, country are most likely optional in Offorte.
Not marking them with optional: true forces the UI to ask for unnecessary data and blocks valid requests.

components/offorte/actions/create-proposal/create-proposal.mjs (1)

61-72: status is mandatory but undocumented as required

Unlike other optional props, status lacks optional: true, making it compulsory in the UI even though the API accepts a default (concept). Either mark it optional or document the requirement explicitly.

components/offorte/actions/create-contact-person/create-contact-person.mjs (1)

1-3: Shadowing the imported offorte identifier

You import offorte (the app) and later destructure offorte from this, shadowing the original binding. While it works, it decreases readability and may trip IDE tooling. Recommend renaming the destructured variable:

-const {
-  offorte,
+const {
+  offorte: offorteClient,
components/offorte/sources/new-event-instant/new-event-instant.mjs (2)

25-35: Consider persisting the full webhook object

Only the webhook_id is stored. Persisting the full response (or at least the secret) aids debugging and later updates.


41-46: Use numeric timestamp not Date.parse

Date.parse returns NaN on invalid input and assumes UTC.
If body.date_created is already ISO-8601, convert with new Date(...).
Otherwise expose parsing failures.

-  ts: Date.parse(body.date_created),
+  ts: new Date(body.date_created).getTime(),
components/offorte/common/constants.mjs (1)

1-116: Consider freezing exported option arrays to prevent accidental runtime mutation

These option arrays are intended to be treated as enums. Freezing them (e.g. export const STATUS_OPTIONS = Object.freeze([...])) makes accidental writes during runtime impossible and signals immutability to future maintainers.

-export const STATUS_OPTIONS = [
+export const STATUS_OPTIONS = Object.freeze([
   { label: "Edit",  value: "edit"  },
   ...
-];
+]);

Replicate for the other two arrays.

This is a low-effort, forward-looking hardening step.

components/offorte/common/utils.mjs (1)

1-24: parseObject silently swallows JSON.parse errors – log or bubble?

If malformed JSON is passed, the current implementation eats the exception and returns the original string, making debugging hard. At minimum, consider console.debug-level logging so integrators can trace bad input.

components/offorte/actions/send-proposal/send-proposal.mjs (1)

59-61: Error message typo – align prop name

The thrown message uses back-ticks around Send Message Id, but the prop is Send Message ID (sendMessageId). Consistency helps users map UI → error.

components/offorte/offorte.app.mjs (2)

33-41: Consider returning consistent option format for tags.

The tags prop returns an array of strings (names only), while other prop definitions return objects with label and value properties. For consistency, consider returning the same format.

     tags: {
       type: "string[]",
       label: "Tags",
       description: "The tags of the contact",
       async options() {
         const response = await this.listTags();
-        return response.map(({ name }) => name);
+        return response.map(({ name }) => ({
+          label: name,
+          value: name,
+        }));
       },
     },

226-233: Remove unnecessary trailing slash in the API path.

The path includes a trailing slash which might cause issues or be redundant.

     listProposals({
       status, ...opts
     }) {
       return this._makeRequest({
-        path: `/proposals/${status}/`,
+        path: `/proposals/${status}`,
         ...opts,
       });
     },
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 30b97f4 and 9953424.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • components/offorte/actions/create-contact-organisation/create-contact-organisation.mjs (1 hunks)
  • components/offorte/actions/create-contact-person/create-contact-person.mjs (1 hunks)
  • components/offorte/actions/create-proposal/create-proposal.mjs (1 hunks)
  • components/offorte/actions/get-contact-details/get-contact-details.mjs (1 hunks)
  • components/offorte/actions/list-proposal-templates/list-proposal-templates.mjs (1 hunks)
  • components/offorte/actions/list-proposals/list-proposals.mjs (1 hunks)
  • components/offorte/actions/list-users/list-users.mjs (1 hunks)
  • components/offorte/actions/search-contact-organisation/search-contact-organisation.mjs (1 hunks)
  • components/offorte/actions/search-contact-people/search-contact-people.mjs (1 hunks)
  • components/offorte/actions/send-proposal/send-proposal.mjs (1 hunks)
  • components/offorte/common/constants.mjs (1 hunks)
  • components/offorte/common/utils.mjs (1 hunks)
  • components/offorte/offorte.app.mjs (1 hunks)
  • components/offorte/package.json (2 hunks)
  • components/offorte/sources/new-event-instant/new-event-instant.mjs (1 hunks)
  • components/offorte/sources/new-event-instant/test-event.mjs (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
components/offorte/common/utils.mjs

[error] 36-36: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

🔇 Additional comments (7)
components/offorte/actions/list-proposal-templates/list-proposal-templates.mjs (1)

12-18: ```shell
#!/bin/bash
set -e

echo "🔍 Displaying first 50 lines of components/offorte/offorte.app.mjs for import context:"
head -n 50 components/offorte/offorte.app.mjs


</details>
<details>
<summary>components/offorte/actions/list-users/list-users.mjs (1)</summary>

`12-18`: I’ll locate the implementation of `listUsers` to confirm its return shape.


```bash
#!/bin/bash
# Search for listUsers definitions and calls
rg -n "listUsers(" -C3
components/offorte/actions/create-contact-organisation/create-contact-organisation.mjs (1)

114-120: Let’s inspect the parseObject implementation in the Offorte utils:

#!/bin/bash
set -e
file="components/offorte/common/utils.mjs"
echo "→ File: $file"
# Show parseObject definition with context
grep -R -n "parseObject" -C5 "$file"
components/offorte/actions/create-proposal/create-proposal.mjs (1)

111-113: ```shell
#!/bin/bash
set -e

Locate offorte.app.mjs

file=$(fd offorte.app.mjs)
echo "offorte.app.mjs found at: $file"

Display entire file content around createProposal

echo "-------- Entire offorte.app.mjs --------"
sed -n '1,300p' "$file"


</details>
<details>
<summary>components/offorte/actions/search-contact-people/search-contact-people.mjs (1)</summary>

`17-26`: **Verify response shape – assumes array with `.length`**

`listContacts` may return `{ data: [...] }` (common pattern in this code-base). `response.length` will then be `undefined`, producing `"Successfully found undefined contact(s)"`.

Please confirm the SDK returns a plain array; if not, adjust:

```js
const { data } = response;
$.export("$summary", `Successfully found ${data.length} contact(s)`);
return data;
components/offorte/offorte.app.mjs (2)

11-16: Verify the fieldId parameter usage and fullname field casing.

The fieldId parameter in the options function is not documented in the prop description. Additionally, verify that the API returns fullname (all lowercase) rather than fullName (camelCase).

#!/bin/bash
# Description: Search for usage of fieldId parameter and fullname field in the codebase

# Check for fieldId usage in contactId prop
rg -A 5 'fieldId.*=.*"id"' --type js

# Check for fullname vs fullName usage
rg -i 'fullname|fullName' --type js

130-134: Verify the authorization header format.

The authorization header is set to just the API key value. Most APIs expect a specific format like Bearer ${token} or Token ${token}.

What is the correct authorization header format for the Offorte API?

luancazarine and others added 2 commits June 16, 2025 16:55
…ails.mjs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
….mjs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
jcortes
jcortes previously approved these changes Jun 16, 2025
Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @luancazarine lgtm! Ready for QA!

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: 2

♻️ Duplicate comments (1)
components/offorte/offorte.app.mjs (1)

152-157: listUsers (and all list helpers) lack pagination and filtering*

With the _makeRequest fix you’ll now get an array, but large workspaces can exceed default limits.
Introduce page/page_size parameters or document their absence.

This was raised in an earlier review and is still outstanding.

🧹 Nitpick comments (1)
components/offorte/offorte.app.mjs (1)

234-237: Trailing slash in listProposals path may break some HTTP clients

/proposals/${status}/ produces a double “//” when status is empty and an unnecessary trailing slash otherwise. Safe variant:

-return this._makeRequest({
-  path: `/proposals/${status}/`,
+return this._makeRequest({
+  path: `/proposals/${status}`,

Minor, but avoids 301s/404s depending on the API router.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9953424 and 0de8e69.

📒 Files selected for processing (3)
  • components/offorte/actions/get-contact-details/get-contact-details.mjs (1 hunks)
  • components/offorte/offorte.app.mjs (1 hunks)
  • components/offorte/sources/new-event-instant/new-event-instant.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/offorte/actions/get-contact-details/get-contact-details.mjs
  • components/offorte/sources/new-event-instant/new-event-instant.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
🔇 Additional comments (1)
components/offorte/offorte.app.mjs (1)

135-139: Header casing and missing content-type

  1. HTTP headers are case-insensitive, but most APIs/documentation use Authorization, not authorization.
  2. For JSON POST/PUT calls you should explicitly set Content-Type: application/json to avoid surprises.
-_headers() {
-  return {
-    "authorization": `${this.$auth.api_key}`,
-  };
+_headers() {
+  return {
+    "Authorization": this.$auth.api_key,
+    "Content-Type": "application/json",
+  };
}

Please confirm Offorte’s auth scheme (Bearer vs. raw key) and adjust accordingly.

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: 0

🧹 Nitpick comments (1)
components/offorte/sources/new-event-instant/test-event.mjs (1)

1-1: Nit: add trailing newline at EOF for POSIX compatibility

While harmless at runtime, adding a terminal newline keeps git diff noise down and aligns with the repo’s style.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0de8e69 and e9ee933.

📒 Files selected for processing (1)
  • components/offorte/sources/new-event-instant/test-event.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (1)
components/offorte/sources/new-event-instant/test-event.mjs (1)

1-31: Sample looks correct – please just confirm it mirrors the real webhook payload

Nothing functionally wrong here.
Since this object will be surfaced to users as the “Example Event”, double-check that:

  1. Field names / casing exactly match Offorte’s webhook (e.g. "type" vs "event_type", "date_created" precision, etc.).
  2. Numeric identifiers are returned as strings in the live API (they’re currently quoted).

If the payload is confirmed, no further action needed. 👍

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: 1

♻️ Duplicate comments (2)
components/offorte/offorte.app.mjs (2)

11-17: response.map still explodes – option loader expects an array but receives the raw Axios response

this.listContacts() returns the full Axios response object, so response.map throws TypeError: response.map is not a function.
Root cause is _makeRequest returning the whole response instead of response.data.


203-211: Return response.data and add basic error handling in _makeRequest

Without unwrapping the data, every consumer must remember to access response.data, which is already causing runtime crashes in the option loaders.
Wrapping the call in a try/catch also surfaces meaningful errors.

-    _makeRequest({
-      $ = this, path, ...opts
-    }) {
-      return axios($, {
-        url: this._baseUrl() + path,
-        headers: this._headers(),
-        ...opts,
-      });
-    },
+    async _makeRequest({
+      $ = this, path, ...opts
+    }) {
+      try {
+        const { data } = await axios($, {
+          url: this._baseUrl() + path,
+          headers: this._headers(),
+          ...opts,
+        });
+        return data;
+      } catch (error) {
+        const msg = error.response
+          ? `${error.response.status} ${error.response.statusText}`
+          : error.message;
+        throw new Error(`Offorte API request failed: ${msg}`);
+      }
+    },
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e9ee933 and ae1b72e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • components/offorte/offorte.app.mjs (1 hunks)
⏰ 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 (1)
components/offorte/offorte.app.mjs (1)

196-199: Verify header format – Offorte appears to expect Authorization: Bearer <token> (or X-Api-Key)

The header key is lowercase and the value is the raw API key. Double-check the API docs – many endpoints require either an Authorization: Bearer … header or a custom X-Api-Key header.

@luancazarine
Copy link
Collaborator Author

/approve

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @luancazarine please fix gh action errors first!

@luancazarine
Copy link
Collaborator Author

/approve

@luancazarine luancazarine merged commit 7851ded into master Jun 18, 2025
11 checks passed
@luancazarine luancazarine deleted the 17095-components-offorte branch June 18, 2025 15:31
joy-chanboop pushed a commit to joy-chanboop/pipedream that referenced this pull request Jun 21, 2025
* [Components] offorte PipedreamHQ#17095
Sources
 - New Event (Instant)

Actions
 - Create Contact Organisation
 - Create Contact Person
 - Create Proposal
 - List Proposal Temaplates
 - List Proposals
 - List Users
 - Search Contact Organisation
 - Search Contact People
 - Send Proposal

* pnpm update

* Update components/offorte/actions/get-contact-details/get-contact-details.mjs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update components/offorte/sources/new-event-instant/new-event-instant.mjs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* add prop name

* fix test-event file

* some adjusts

* pnpm update

* pnpm update

* Fix export key in get-contact-details action

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

[Components] offorte

3 participants