Skip to content

feat(emailbison): block, tools, sharepoint v2 block with cleaner code#4470

Merged
icecrasher321 merged 7 commits intostagingfrom
feat/emailbison
May 6, 2026
Merged

feat(emailbison): block, tools, sharepoint v2 block with cleaner code#4470
icecrasher321 merged 7 commits intostagingfrom
feat/emailbison

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

@icecrasher321 icecrasher321 commented May 6, 2026

Summary

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 6, 2026 7:33pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 6, 2026

PR Summary

Medium Risk
Medium risk due to adding a new Email Bison block/tool surface plus webhook subscription handling, and changing SharePoint upload URL construction which could affect file upload behavior for existing workflows.

Overview
Adds a full Email Bison integration across docs and the Sim app: new icon + icon mappings, new tools (emailbison_*) for leads/campaigns/replies/tags, a new EmailBisonBlock wired into the block registry, and a new webhook provider (emailbison) that creates/deletes Email Bison webhooks and formats incoming events for 17 trigger IDs.

Introduces SharePoint v2 by hiding the existing SharepointBlock from the toolbar and adding SharepointV2Block (sharepoint_v2) with a redesigned UI/config layer (file selectors, JSON parsing, pagination via nextPageUrl, and updated operation naming). Updates SharePoint docs/type keys to sharepoint_v2 and tweaks the SharePoint upload API route to upload either via drives/{driveId} or sites/{siteId}/drive and to use toError(error).message for error reporting.

Includes small docs fixes/alignments: PostHog docs rename personalApiKey to apiKey, and adds new Email Bison tool/trigger documentation + meta entries so it appears in docs navigation and integration listings.

Reviewed by Cursor Bugbot for commit 5950a96. Configure here.

Comment thread apps/sim/tools/emailbison/update_campaign.ts Outdated
Comment thread apps/sim/tools/emailbison/update_campaign_status.ts
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR adds a full EmailBison integration (block, 13 tools, 17 triggers, and a webhook provider) and rewrites the SharePoint tools with cleaner, shared utility code. The EmailBison webhook handler, tools, and trigger files are well-structured and follow the patterns established by other integrations in the repo.

  • EmailBison: New block exposes lead/campaign/reply/tag operations; the webhook provider correctly validates HTTP responses and properly encodes IDs in URLs. The emailBisonData helper (noted in a prior review) still calls response.json() unconditionally without checking response.ok, masking API error details from callers.
  • SharePoint upload route: Rebuilt with auth, request validation, and per-file conflict retry, but files exceeding 250 MB are silently skipped — if some files succeed the response is a 200 with a lower fileCount, giving callers no indication that files were dropped.
  • SharePoint utils: The extractTextFromCanvasLayout helper logs raw innerHtml and the full extracted text from SharePoint pages at info level, which can include sensitive document content.

Confidence Score: 4/5

Safe to merge with attention to the SharePoint upload partial-failure path and the SharePoint utils logging of page content.

The EmailBison integration is well-built: the webhook provider checks response.ok before parsing, IDs are encoded in DELETE URLs, and all tools share consistent param and output definitions. The SharePoint upload rewrite introduces a silent partial-failure case — files over 250 MB are skipped without any indication in the success response — which could confuse callers. The SharePoint utils file also logs full HTML and extracted text from pages at info level, which risks emitting sensitive SharePoint content into production logs.

apps/sim/app/api/tools/sharepoint/upload/route.ts (silent partial upload) and apps/sim/tools/sharepoint/utils.ts (page content in logs)

Security Review

  • SharePoint utils (apps/sim/tools/sharepoint/utils.ts): extractTextFromCanvasLayout emits raw webpart.innerHtml and fully extracted page text to info-level logs on every invocation. SharePoint pages can contain PII or confidential business data; these values should not be logged at info verbosity.

Important Files Changed

Filename Overview
apps/sim/tools/emailbison/utils.ts Shared helpers for URL construction, auth headers, and response mapping; emailBisonData silently returns null on HTTP errors (flagged in a prior review)
apps/sim/tools/emailbison/update_campaign_status.ts Pause/resume/archive tool; validates action via Set before URL interpolation; uses full campaignOutputs shape which may not match lightweight action-endpoint responses (flagged in prior review)
apps/sim/app/api/tools/sharepoint/upload/route.ts Rewrites SharePoint upload route; silently skips files >250 MB without surfacing the reason to callers, causing partial success to look identical to full success
apps/sim/tools/sharepoint/utils.ts Adds SharePoint utility helpers; logs full SharePoint page HTML and extracted text content at info level, risking sensitive data exposure in logs
apps/sim/lib/webhooks/providers/emailbison.ts New EmailBison webhook provider; correctly checks response.ok before parsing, properly handles 401/403 with actionable messages, and safely encodes the externalId in DELETE URL
apps/sim/blocks/blocks/emailbison.ts New EmailBison block definition with 13 operations; well-structured with shared param/output constants; name ternary mapping is complex but functional
apps/sim/tools/emailbison/attach_leads_to_campaign.ts Correctly uses actionOutputs/actionOutput pair for the attach-leads endpoint response shape

Sequence Diagram

sequenceDiagram
    participant EB as EmailBison
    participant WH as Webhook Handler
    participant PR as emailBisonProvider
    participant TU as triggers/emailbison/utils
    participant WF as Workflow Engine

    EB->>WH: POST /api/webhooks/{webhookId}
    WH->>PR: matchEvent(body, providerConfig)
    PR->>TU: isEmailBisonEventMatch(triggerId, payload)
    TU-->>PR: true / false
    PR-->>WH: matched

    WH->>PR: formatInput(body, webhook)
    PR->>PR: unwrapEmailBisonPayload(body)
    PR->>PR: build trigger-specific input fields
    PR-->>WH: { input }

    WH->>WF: execute workflow with input

    note over PR,EB: Subscription lifecycle
    PR->>EB: POST /api/webhook-url (createSubscription)
    EB-->>PR: { data: { id: externalId } }
    PR->>EB: DELETE /api/webhook-url/{externalId} (deleteSubscription)
Loading

Comments Outside Diff (1)

  1. apps/sim/app/api/tools/sharepoint/upload/route.ts, line 88-95 (link)

    P1 Silent partial upload returns success with no indication of skipped files

    When a file exceeds 250 MB the loop silently continues. If at least one other file succeeds, the handler returns HTTP 200 with success: true and a fileCount that is lower than the number of files the caller submitted — no field in the response indicates that a file was dropped. The caller has no way to tell whether all files were uploaded or some were silently discarded due to the size limit. The all-fail path surfaces a generic "No files were uploaded successfully" message that still omits the size-limit reason.

Reviews (2): Last reviewed commit: "address comments" | Re-trigger Greptile

Comment thread apps/sim/tools/emailbison/utils.ts
Comment thread apps/sim/tools/emailbison/update_campaign_status.ts Outdated
Comment thread apps/sim/tools/emailbison/update_campaign_status.ts
@icecrasher321 icecrasher321 changed the title feat(emailbison): block, tools feat(emailbison): block, tools, sharepoint v2 block with cleaner code May 6, 2026
@icecrasher321
Copy link
Copy Markdown
Collaborator Author

bugbot run

@icecrasher321
Copy link
Copy Markdown
Collaborator Author

@greptile

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5950a96. Configure here.

@icecrasher321 icecrasher321 merged commit 79ffccc into staging May 6, 2026
13 checks passed
waleedlatif1 pushed a commit that referenced this pull request May 7, 2026
…#4470)

* feat(emailbison): block, tools

* type improvments

* typecheck issue

* add email bison trigger, cleanup sharepoint block

* address comments

* fix tests

* error on partial upload failures
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.

1 participant