@bubblelab/bubble-core 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bubble-bundle.d.ts +803 -351
- package/dist/bubble-factory.d.ts.map +1 -1
- package/dist/bubble-factory.js +130 -35
- package/dist/bubble-factory.js.map +1 -1
- package/dist/bubble-flow/bubble-flow-class.d.ts +5 -0
- package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -1
- package/dist/bubble-flow/bubble-flow-class.js +20 -0
- package/dist/bubble-flow/bubble-flow-class.js.map +1 -1
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -1
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.js +6 -3
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.js.map +1 -1
- package/dist/bubbles/service-bubble/agi-inc.d.ts +1121 -0
- package/dist/bubbles/service-bubble/agi-inc.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/agi-inc.js +730 -0
- package/dist/bubbles/service-bubble/agi-inc.js.map +1 -0
- package/dist/bubbles/service-bubble/ai-agent.d.ts +273 -61
- package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/ai-agent.js +536 -405
- package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
- package/dist/bubbles/service-bubble/airtable.d.ts +1753 -0
- package/dist/bubbles/service-bubble/airtable.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/airtable.js +1173 -0
- package/dist/bubbles/service-bubble/airtable.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts +240 -0
- package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js +119 -0
- package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +4 -4
- package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +14 -14
- package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts +137 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js +81 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +6 -6
- package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +32 -32
- package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts +488 -0
- package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js +463 -0
- package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts +262 -0
- package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js +291 -0
- package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +12 -12
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +1301 -170
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js +32 -0
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js.map +1 -1
- package/dist/bubbles/service-bubble/apify/apify.d.ts +158 -13
- package/dist/bubbles/service-bubble/apify/apify.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/apify/apify.js +222 -37
- package/dist/bubbles/service-bubble/apify/apify.js.map +1 -1
- package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts +542 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.d.ts +37 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.js +203 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.js.map +1 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.js +593 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.js.map +1 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts +518 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.schema.js +311 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/browserbase/index.d.ts +3 -0
- package/dist/bubbles/service-bubble/browserbase/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/browserbase/index.js +3 -0
- package/dist/bubbles/service-bubble/browserbase/index.js.map +1 -0
- package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts +1358 -0
- package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/crustdata/crustdata.js +219 -0
- package/dist/bubbles/service-bubble/crustdata/crustdata.js.map +1 -0
- package/dist/bubbles/service-bubble/crustdata/crustdata.schema.d.ts +1604 -0
- package/dist/bubbles/service-bubble/crustdata/crustdata.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/crustdata/crustdata.schema.js +194 -0
- package/dist/bubbles/service-bubble/crustdata/crustdata.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/crustdata/index.d.ts +3 -0
- package/dist/bubbles/service-bubble/crustdata/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/crustdata/index.js +3 -0
- package/dist/bubbles/service-bubble/crustdata/index.js.map +1 -0
- package/dist/bubbles/service-bubble/eleven-labs.d.ts +421 -0
- package/dist/bubbles/service-bubble/eleven-labs.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/eleven-labs.js +479 -0
- package/dist/bubbles/service-bubble/eleven-labs.js.map +1 -0
- package/dist/bubbles/service-bubble/firecrawl.d.ts +37748 -0
- package/dist/bubbles/service-bubble/firecrawl.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/firecrawl.js +1489 -0
- package/dist/bubbles/service-bubble/firecrawl.js.map +1 -0
- package/dist/bubbles/service-bubble/followupboss.d.ts +6822 -0
- package/dist/bubbles/service-bubble/followupboss.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/followupboss.js +1394 -0
- package/dist/bubbles/service-bubble/followupboss.js.map +1 -0
- package/dist/bubbles/service-bubble/github.d.ts +2393 -0
- package/dist/bubbles/service-bubble/github.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/github.js +1046 -0
- package/dist/bubbles/service-bubble/github.js.map +1 -0
- package/dist/bubbles/service-bubble/gmail.d.ts +180 -180
- package/dist/bubbles/service-bubble/google-calendar.d.ts +60 -60
- package/dist/bubbles/service-bubble/google-drive.d.ts +69 -68
- package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/google-drive.js +35 -3
- package/dist/bubbles/service-bubble/google-drive.js.map +1 -1
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +943 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts +31 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js +184 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.js +401 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts +1024 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/{google-sheets.js → google-sheets/google-sheets.schema.js} +45 -409
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts +38 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js +183 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/index.d.ts +4 -0
- package/dist/bubbles/service-bubble/google-sheets/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/index.js +4 -0
- package/dist/bubbles/service-bubble/google-sheets/index.js.map +1 -0
- package/dist/bubbles/service-bubble/hello-world.d.ts +4 -4
- package/dist/bubbles/service-bubble/http.d.ts +17 -5
- package/dist/bubbles/service-bubble/http.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/http.integration.flow.d.ts +49 -0
- package/dist/bubbles/service-bubble/http.integration.flow.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/http.integration.flow.js +425 -0
- package/dist/bubbles/service-bubble/http.integration.flow.js.map +1 -0
- package/dist/bubbles/service-bubble/http.js +47 -5
- package/dist/bubbles/service-bubble/http.js.map +1 -1
- package/dist/bubbles/service-bubble/insforge-db.d.ts +140 -0
- package/dist/bubbles/service-bubble/insforge-db.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/insforge-db.js +260 -0
- package/dist/bubbles/service-bubble/insforge-db.js.map +1 -0
- package/dist/bubbles/service-bubble/notion/index.d.ts +3 -0
- package/dist/bubbles/service-bubble/notion/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/notion/index.js +3 -0
- package/dist/bubbles/service-bubble/notion/index.js.map +1 -0
- package/dist/bubbles/service-bubble/notion/notion.d.ts +35405 -0
- package/dist/bubbles/service-bubble/notion/notion.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/notion/notion.js +1492 -0
- package/dist/bubbles/service-bubble/notion/notion.js.map +1 -0
- package/dist/bubbles/service-bubble/notion/property-schemas.d.ts +1148 -0
- package/dist/bubbles/service-bubble/notion/property-schemas.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/notion/property-schemas.js +341 -0
- package/dist/bubbles/service-bubble/notion/property-schemas.js.map +1 -0
- package/dist/bubbles/service-bubble/postgresql.d.ts +12 -12
- package/dist/bubbles/service-bubble/resend.d.ts +30 -9
- package/dist/bubbles/service-bubble/resend.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/resend.js +133 -2
- package/dist/bubbles/service-bubble/resend.js.map +1 -1
- package/dist/bubbles/service-bubble/slack.d.ts +1741 -798
- package/dist/bubbles/service-bubble/slack.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/slack.js +322 -28
- package/dist/bubbles/service-bubble/slack.js.map +1 -1
- package/dist/bubbles/service-bubble/storage.d.ts +26 -22
- package/dist/bubbles/service-bubble/storage.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/storage.js +45 -4
- package/dist/bubbles/service-bubble/storage.js.map +1 -1
- package/dist/bubbles/service-bubble/telegram.d.ts +7742 -0
- package/dist/bubbles/service-bubble/telegram.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/telegram.js +1132 -0
- package/dist/bubbles/service-bubble/telegram.js.map +1 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.d.ts +494 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.d.ts +31 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.js +100 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.js.map +1 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.js +1301 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts +473 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.js +230 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.js.map +1 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.d.ts +3 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.js +3 -0
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.js.map +1 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +76 -20
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js +12 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +14 -14
- package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +188 -0
- package/dist/bubbles/tool-bubble/code-edit-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/code-edit-tool.js +321 -0
- package/dist/bubbles/tool-bubble/code-edit-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts +740 -0
- package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/company-enrichment-tool.js +350 -0
- package/dist/bubbles/tool-bubble/company-enrichment-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +8 -4
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +115 -10
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +455 -0
- package/dist/bubbles/tool-bubble/google-maps-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/google-maps-tool.js +206 -0
- package/dist/bubbles/tool-bubble/google-maps-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts +36 -36
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/instagram-tool.js +4 -2
- package/dist/bubbles/tool-bubble/instagram-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +830 -453
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/linkedin-tool.js +236 -14
- package/dist/bubbles/tool-bubble/linkedin-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +66 -66
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +17 -16
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/research-agent-tool.js +32 -17
- package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +485 -0
- package/dist/bubbles/tool-bubble/tiktok-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/tiktok-tool.js +226 -0
- package/dist/bubbles/tool-bubble/tiktok-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/tool-template.d.ts +8 -8
- package/dist/bubbles/tool-bubble/twitter-tool.d.ts +947 -0
- package/dist/bubbles/tool-bubble/twitter-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/twitter-tool.js +497 -0
- package/dist/bubbles/tool-bubble/twitter-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +22 -16
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-crawl-tool.js +58 -59
- package/dist/bubbles/tool-bubble/web-crawl-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-extract-tool.js +17 -17
- package/dist/bubbles/tool-bubble/web-extract-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +21 -113
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-scrape-tool.js +55 -73
- package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts +20 -9
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-search-tool.js +45 -35
- package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/youtube-tool.d.ts +25 -25
- package/dist/bubbles/tool-bubble/youtube-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/youtube-tool.js +8 -5
- package/dist/bubbles/tool-bubble/youtube-tool.js.map +1 -1
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +4 -4
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +30 -30
- package/dist/bubbles/workflow-bubble/generate-document.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +22 -22
- package/dist/bubbles/workflow-bubble/parse-document.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +70 -70
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +4 -4
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +36 -36
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +14 -14
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +6 -6
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +18 -18
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +24 -4
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +19 -19
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +8 -8
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -1
- package/dist/bubbles.json +260 -77
- package/dist/index.d.ts +25 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/logging/BubbleLogger.d.ts +55 -16
- package/dist/logging/BubbleLogger.d.ts.map +1 -1
- package/dist/logging/BubbleLogger.js +192 -77
- package/dist/logging/BubbleLogger.js.map +1 -1
- package/dist/logging/StreamingBubbleLogger.d.ts +21 -1
- package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -1
- package/dist/logging/StreamingBubbleLogger.js +80 -8
- package/dist/logging/StreamingBubbleLogger.js.map +1 -1
- package/dist/logging/WebhookStreamLogger.d.ts +66 -0
- package/dist/logging/WebhookStreamLogger.d.ts.map +1 -0
- package/dist/logging/WebhookStreamLogger.js +291 -0
- package/dist/logging/WebhookStreamLogger.js.map +1 -0
- package/dist/types/available-tools.d.ts +1 -1
- package/dist/types/available-tools.d.ts.map +1 -1
- package/dist/types/available-tools.js +7 -0
- package/dist/types/available-tools.js.map +1 -1
- package/dist/types/base-bubble-class.d.ts +6 -4
- package/dist/types/base-bubble-class.d.ts.map +1 -1
- package/dist/types/base-bubble-class.js +30 -23
- package/dist/types/base-bubble-class.js.map +1 -1
- package/dist/types/bubble.d.ts +2 -0
- package/dist/types/bubble.d.ts.map +1 -1
- package/dist/types/service-bubble-class.d.ts +1 -1
- package/dist/types/service-bubble-class.d.ts.map +1 -1
- package/dist/types/service-bubble-class.js +2 -2
- package/dist/types/service-bubble-class.js.map +1 -1
- package/dist/types/tool-bubble-class.d.ts +1 -1
- package/dist/types/tool-bubble-class.d.ts.map +1 -1
- package/dist/types/tool-bubble-class.js +60 -10
- package/dist/types/tool-bubble-class.js.map +1 -1
- package/dist/types/workflow-bubble-class.d.ts +1 -1
- package/dist/types/workflow-bubble-class.d.ts.map +1 -1
- package/dist/types/workflow-bubble-class.js +2 -2
- package/dist/types/workflow-bubble-class.js.map +1 -1
- package/dist/utils/agent-formatter.d.ts +14 -2
- package/dist/utils/agent-formatter.d.ts.map +1 -1
- package/dist/utils/agent-formatter.js +174 -26
- package/dist/utils/agent-formatter.js.map +1 -1
- package/dist/utils/bubbleflow-validation.d.ts +7 -0
- package/dist/utils/bubbleflow-validation.d.ts.map +1 -1
- package/dist/utils/bubbleflow-validation.js +171 -6
- package/dist/utils/bubbleflow-validation.js.map +1 -1
- package/dist/utils/json-parsing.d.ts.map +1 -1
- package/dist/utils/json-parsing.js +146 -0
- package/dist/utils/json-parsing.js.map +1 -1
- package/dist/utils/safe-gemini-chat.d.ts +31 -0
- package/dist/utils/safe-gemini-chat.d.ts.map +1 -0
- package/dist/utils/safe-gemini-chat.js +93 -0
- package/dist/utils/safe-gemini-chat.js.map +1 -0
- package/dist/utils/schema-comparison.d.ts +92 -0
- package/dist/utils/schema-comparison.d.ts.map +1 -0
- package/dist/utils/schema-comparison.js +716 -0
- package/dist/utils/schema-comparison.js.map +1 -0
- package/dist/utils/zod-schema.d.ts +24 -0
- package/dist/utils/zod-schema.d.ts.map +1 -0
- package/dist/utils/zod-schema.js +56 -0
- package/dist/utils/zod-schema.js.map +1 -0
- package/package.json +6 -4
- package/dist/bubbles/service-bubble/google-sheets.d.ts +0 -1811
- package/dist/bubbles/service-bubble/google-sheets.d.ts.map +0 -1
- package/dist/bubbles/service-bubble/google-sheets.js.map +0 -1
- package/dist/bubbles/service-bubble/x-twitter.d.ts +0 -814
- package/dist/bubbles/service-bubble/x-twitter.d.ts.map +0 -1
- package/dist/bubbles/service-bubble/x-twitter.js +0 -445
- package/dist/bubbles/service-bubble/x-twitter.js.map +0 -1
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +0 -125
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +0 -1
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +0 -808
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +0 -1
- package/dist/test-gm.d.ts +0 -10
- package/dist/test-gm.d.ts.map +0 -1
- package/dist/test-gm.js +0 -95
- package/dist/test-gm.js.map +0 -1
- package/dist/utils/param-helper.d.ts +0 -2
- package/dist/utils/param-helper.d.ts.map +0 -1
- package/dist/utils/param-helper.js +0 -5
- package/dist/utils/param-helper.js.map +0 -1
|
@@ -0,0 +1,1394 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ServiceBubble } from '../../types/service-bubble-class.js';
|
|
3
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
4
|
+
// Define common FUB schemas
|
|
5
|
+
const FUBPersonSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
id: z.number().describe('Unique person identifier'),
|
|
8
|
+
firstName: z.string().optional().describe('First name'),
|
|
9
|
+
lastName: z.string().optional().describe('Last name'),
|
|
10
|
+
emails: z
|
|
11
|
+
.array(z.object({
|
|
12
|
+
value: z.string(),
|
|
13
|
+
type: z.string().optional(),
|
|
14
|
+
isPrimary: z.boolean().optional(),
|
|
15
|
+
}))
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Email addresses'),
|
|
18
|
+
phones: z
|
|
19
|
+
.array(z.object({
|
|
20
|
+
value: z.string(),
|
|
21
|
+
type: z.string().optional(),
|
|
22
|
+
isPrimary: z.boolean().optional(),
|
|
23
|
+
}))
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Phone numbers'),
|
|
26
|
+
stage: z.string().optional().describe('Current stage in pipeline'),
|
|
27
|
+
source: z.string().optional().describe('Lead source'),
|
|
28
|
+
assignedTo: z.number().optional().describe('Assigned user ID'),
|
|
29
|
+
tags: z.array(z.string()).optional().describe('Tags applied to person'),
|
|
30
|
+
created: z.string().optional().describe('Creation timestamp'),
|
|
31
|
+
updated: z.string().optional().describe('Last update timestamp'),
|
|
32
|
+
})
|
|
33
|
+
.passthrough()
|
|
34
|
+
.describe('FUB person/contact object');
|
|
35
|
+
const FUBTaskSchema = z
|
|
36
|
+
.object({
|
|
37
|
+
id: z.number().describe('Unique task identifier'),
|
|
38
|
+
personId: z.number().optional().describe('Associated person ID'),
|
|
39
|
+
name: z.string().describe('Task name/title'),
|
|
40
|
+
description: z.string().optional().describe('Task description'),
|
|
41
|
+
dueDate: z.string().optional().describe('Due date (YYYY-MM-DD)'),
|
|
42
|
+
completed: z.boolean().optional().describe('Whether task is completed'),
|
|
43
|
+
assignedTo: z.number().optional().describe('Assigned user ID'),
|
|
44
|
+
created: z.string().optional().describe('Creation timestamp'),
|
|
45
|
+
})
|
|
46
|
+
.passthrough()
|
|
47
|
+
.describe('FUB task object');
|
|
48
|
+
const FUBNoteSchema = z
|
|
49
|
+
.object({
|
|
50
|
+
id: z.number().describe('Unique note identifier'),
|
|
51
|
+
personId: z.number().describe('Associated person ID'),
|
|
52
|
+
subject: z.string().optional().describe('Note subject'),
|
|
53
|
+
body: z.string().describe('Note content'),
|
|
54
|
+
created: z.string().optional().describe('Creation timestamp'),
|
|
55
|
+
})
|
|
56
|
+
.passthrough()
|
|
57
|
+
.describe('FUB note object');
|
|
58
|
+
const FUBDealSchema = z
|
|
59
|
+
.object({
|
|
60
|
+
id: z.number().describe('Unique deal identifier'),
|
|
61
|
+
personId: z.number().optional().describe('Associated person ID'),
|
|
62
|
+
name: z.string().optional().describe('Deal name'),
|
|
63
|
+
price: z.number().optional().describe('Deal price/value'),
|
|
64
|
+
stage: z.string().optional().describe('Deal stage'),
|
|
65
|
+
closeDate: z.string().optional().describe('Expected close date'),
|
|
66
|
+
created: z.string().optional().describe('Creation timestamp'),
|
|
67
|
+
})
|
|
68
|
+
.passthrough()
|
|
69
|
+
.describe('FUB deal object');
|
|
70
|
+
const FUBEventSchema = z
|
|
71
|
+
.object({
|
|
72
|
+
id: z.number().optional().describe('Event identifier'),
|
|
73
|
+
type: z
|
|
74
|
+
.string()
|
|
75
|
+
.describe('Event type (e.g., "Showing Request", "Registration")'),
|
|
76
|
+
source: z.string().optional().describe('Event source'),
|
|
77
|
+
message: z.string().optional().describe('Event message'),
|
|
78
|
+
person: z
|
|
79
|
+
.object({
|
|
80
|
+
firstName: z.string().optional(),
|
|
81
|
+
lastName: z.string().optional(),
|
|
82
|
+
emails: z.array(z.object({ value: z.string() })).optional(),
|
|
83
|
+
phones: z.array(z.object({ value: z.string() })).optional(),
|
|
84
|
+
tags: z.array(z.string()).optional(),
|
|
85
|
+
})
|
|
86
|
+
.optional()
|
|
87
|
+
.describe('Person data for the event'),
|
|
88
|
+
created: z.string().optional().describe('Creation timestamp'),
|
|
89
|
+
})
|
|
90
|
+
.passthrough()
|
|
91
|
+
.describe('FUB event object');
|
|
92
|
+
const FUBCallSchema = z
|
|
93
|
+
.object({
|
|
94
|
+
id: z.number().describe('Unique call identifier'),
|
|
95
|
+
personId: z.number().describe('Associated person ID'),
|
|
96
|
+
outcome: z.string().optional().describe('Call outcome'),
|
|
97
|
+
note: z.string().optional().describe('Call notes'),
|
|
98
|
+
duration: z.number().optional().describe('Call duration in seconds'),
|
|
99
|
+
created: z.string().optional().describe('Creation timestamp'),
|
|
100
|
+
})
|
|
101
|
+
.passthrough()
|
|
102
|
+
.describe('FUB call object');
|
|
103
|
+
const FUBAppointmentSchema = z
|
|
104
|
+
.object({
|
|
105
|
+
id: z.number().describe('Unique appointment identifier'),
|
|
106
|
+
personId: z.number().optional().describe('Associated person ID'),
|
|
107
|
+
title: z.string().optional().describe('Appointment title'),
|
|
108
|
+
startTime: z.string().optional().describe('Start time'),
|
|
109
|
+
endTime: z.string().optional().describe('End time'),
|
|
110
|
+
location: z.string().optional().describe('Location'),
|
|
111
|
+
created: z.string().optional().describe('Creation timestamp'),
|
|
112
|
+
})
|
|
113
|
+
.passthrough()
|
|
114
|
+
.describe('FUB appointment object');
|
|
115
|
+
const FUBWebhookSchema = z
|
|
116
|
+
.object({
|
|
117
|
+
id: z.number().describe('Unique webhook identifier'),
|
|
118
|
+
event: z.string().describe('Webhook event type'),
|
|
119
|
+
url: z.string().describe('Callback URL'),
|
|
120
|
+
status: z.string().optional().describe('Webhook status (Active/Inactive)'),
|
|
121
|
+
})
|
|
122
|
+
.passthrough()
|
|
123
|
+
.describe('FUB webhook object');
|
|
124
|
+
// Supported webhook event types
|
|
125
|
+
const FUB_WEBHOOK_EVENTS = [
|
|
126
|
+
'peopleCreated',
|
|
127
|
+
'peopleUpdated',
|
|
128
|
+
'peopleDeleted',
|
|
129
|
+
'peopleTagsCreated',
|
|
130
|
+
'peopleStageUpdated',
|
|
131
|
+
'peopleRelationshipCreated',
|
|
132
|
+
'peopleRelationshipUpdated',
|
|
133
|
+
'peopleRelationshipDeleted',
|
|
134
|
+
'notesCreated',
|
|
135
|
+
'notesUpdated',
|
|
136
|
+
'notesDeleted',
|
|
137
|
+
'emailsCreated',
|
|
138
|
+
'emailsUpdated',
|
|
139
|
+
'emailsDeleted',
|
|
140
|
+
'tasksCreated',
|
|
141
|
+
'tasksUpdated',
|
|
142
|
+
'tasksDeleted',
|
|
143
|
+
'appointmentsCreated',
|
|
144
|
+
'appointmentsUpdated',
|
|
145
|
+
'appointmentsDeleted',
|
|
146
|
+
'textMessagesCreated',
|
|
147
|
+
'textMessagesUpdated',
|
|
148
|
+
'textMessagesDeleted',
|
|
149
|
+
'callsCreated',
|
|
150
|
+
'callsUpdated',
|
|
151
|
+
'callsDeleted',
|
|
152
|
+
'dealsCreated',
|
|
153
|
+
'dealsUpdated',
|
|
154
|
+
'dealsDeleted',
|
|
155
|
+
'eventsCreated',
|
|
156
|
+
'stageCreated',
|
|
157
|
+
'stageUpdated',
|
|
158
|
+
'stageDeleted',
|
|
159
|
+
'pipelineCreated',
|
|
160
|
+
'pipelineUpdated',
|
|
161
|
+
'pipelineDeleted',
|
|
162
|
+
'pipelineStageCreated',
|
|
163
|
+
'pipelineStageUpdated',
|
|
164
|
+
'pipelineStageDeleted',
|
|
165
|
+
'customFieldsCreated',
|
|
166
|
+
'customFieldsUpdated',
|
|
167
|
+
'customFieldsDeleted',
|
|
168
|
+
'dealCustomFieldsCreated',
|
|
169
|
+
'dealCustomFieldsUpdated',
|
|
170
|
+
'dealCustomFieldsDeleted',
|
|
171
|
+
'emEventsOpened',
|
|
172
|
+
'emEventsClicked',
|
|
173
|
+
'emEventsUnsubscribed',
|
|
174
|
+
'reactionCreated',
|
|
175
|
+
'reactionDeleted',
|
|
176
|
+
'threadedReplyCreated',
|
|
177
|
+
'threadedReplyUpdated',
|
|
178
|
+
'threadedReplyDeleted',
|
|
179
|
+
];
|
|
180
|
+
// Define the parameters schema for FUB operations
|
|
181
|
+
const FUBParamsSchema = z.discriminatedUnion('operation', [
|
|
182
|
+
// People operations
|
|
183
|
+
z.object({
|
|
184
|
+
operation: z.literal('list_people').describe('List people/contacts'),
|
|
185
|
+
limit: z
|
|
186
|
+
.number()
|
|
187
|
+
.min(1)
|
|
188
|
+
.max(100)
|
|
189
|
+
.optional()
|
|
190
|
+
.default(25)
|
|
191
|
+
.describe('Number of results to return'),
|
|
192
|
+
offset: z
|
|
193
|
+
.number()
|
|
194
|
+
.optional()
|
|
195
|
+
.default(0)
|
|
196
|
+
.describe('Number of results to skip'),
|
|
197
|
+
sort: z.string().optional().describe('Sort field'),
|
|
198
|
+
fields: z
|
|
199
|
+
.string()
|
|
200
|
+
.optional()
|
|
201
|
+
.describe('Comma-separated fields to return (use "allFields" for all)'),
|
|
202
|
+
includeTrash: z
|
|
203
|
+
.boolean()
|
|
204
|
+
.optional()
|
|
205
|
+
.default(false)
|
|
206
|
+
.describe('Include people in Trash stage'),
|
|
207
|
+
credentials: z
|
|
208
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
209
|
+
.optional()
|
|
210
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
211
|
+
}),
|
|
212
|
+
z.object({
|
|
213
|
+
operation: z.literal('get_person').describe('Get a specific person by ID'),
|
|
214
|
+
person_id: z.number().describe('Person ID to retrieve'),
|
|
215
|
+
fields: z.string().optional().describe('Comma-separated fields to return'),
|
|
216
|
+
credentials: z
|
|
217
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
218
|
+
.optional()
|
|
219
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
220
|
+
}),
|
|
221
|
+
z.object({
|
|
222
|
+
operation: z
|
|
223
|
+
.literal('create_person')
|
|
224
|
+
.describe('Create a new person/contact'),
|
|
225
|
+
firstName: z.string().optional().describe('First name'),
|
|
226
|
+
lastName: z.string().optional().describe('Last name'),
|
|
227
|
+
emails: z
|
|
228
|
+
.array(z.object({
|
|
229
|
+
value: z.string().email(),
|
|
230
|
+
type: z.string().optional(),
|
|
231
|
+
isPrimary: z.boolean().optional(),
|
|
232
|
+
}))
|
|
233
|
+
.optional()
|
|
234
|
+
.describe('Email addresses'),
|
|
235
|
+
phones: z
|
|
236
|
+
.array(z.object({
|
|
237
|
+
value: z.string(),
|
|
238
|
+
type: z.string().optional(),
|
|
239
|
+
isPrimary: z.boolean().optional(),
|
|
240
|
+
}))
|
|
241
|
+
.optional()
|
|
242
|
+
.describe('Phone numbers'),
|
|
243
|
+
stage: z.string().optional().describe('Initial stage'),
|
|
244
|
+
source: z.string().optional().describe('Lead source'),
|
|
245
|
+
assignedTo: z.number().optional().describe('Assigned user ID'),
|
|
246
|
+
tags: z.array(z.string()).optional().describe('Tags to apply'),
|
|
247
|
+
credentials: z
|
|
248
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
249
|
+
.optional()
|
|
250
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
251
|
+
}),
|
|
252
|
+
z.object({
|
|
253
|
+
operation: z.literal('update_person').describe('Update an existing person'),
|
|
254
|
+
person_id: z.number().describe('Person ID to update'),
|
|
255
|
+
firstName: z.string().optional().describe('First name'),
|
|
256
|
+
lastName: z.string().optional().describe('Last name'),
|
|
257
|
+
emails: z
|
|
258
|
+
.array(z.object({
|
|
259
|
+
value: z.string().email(),
|
|
260
|
+
type: z.string().optional(),
|
|
261
|
+
isPrimary: z.boolean().optional(),
|
|
262
|
+
}))
|
|
263
|
+
.optional()
|
|
264
|
+
.describe('Email addresses'),
|
|
265
|
+
phones: z
|
|
266
|
+
.array(z.object({
|
|
267
|
+
value: z.string(),
|
|
268
|
+
type: z.string().optional(),
|
|
269
|
+
isPrimary: z.boolean().optional(),
|
|
270
|
+
}))
|
|
271
|
+
.optional()
|
|
272
|
+
.describe('Phone numbers'),
|
|
273
|
+
stage: z.string().optional().describe('Stage'),
|
|
274
|
+
source: z.string().optional().describe('Lead source'),
|
|
275
|
+
assignedTo: z.number().optional().describe('Assigned user ID'),
|
|
276
|
+
tags: z.array(z.string()).optional().describe('Tags'),
|
|
277
|
+
credentials: z
|
|
278
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
279
|
+
.optional()
|
|
280
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
281
|
+
}),
|
|
282
|
+
z.object({
|
|
283
|
+
operation: z.literal('delete_person').describe('Delete a person'),
|
|
284
|
+
person_id: z.number().describe('Person ID to delete'),
|
|
285
|
+
credentials: z
|
|
286
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
287
|
+
.optional()
|
|
288
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
289
|
+
}),
|
|
290
|
+
// Task operations
|
|
291
|
+
z.object({
|
|
292
|
+
operation: z.literal('list_tasks').describe('List tasks'),
|
|
293
|
+
personId: z.number().optional().describe('Filter by person ID'),
|
|
294
|
+
limit: z
|
|
295
|
+
.number()
|
|
296
|
+
.min(1)
|
|
297
|
+
.max(100)
|
|
298
|
+
.optional()
|
|
299
|
+
.default(25)
|
|
300
|
+
.describe('Number of results to return'),
|
|
301
|
+
offset: z
|
|
302
|
+
.number()
|
|
303
|
+
.optional()
|
|
304
|
+
.default(0)
|
|
305
|
+
.describe('Number of results to skip'),
|
|
306
|
+
credentials: z
|
|
307
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
308
|
+
.optional()
|
|
309
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
310
|
+
}),
|
|
311
|
+
z.object({
|
|
312
|
+
operation: z.literal('get_task').describe('Get a specific task by ID'),
|
|
313
|
+
task_id: z.number().describe('Task ID to retrieve'),
|
|
314
|
+
credentials: z
|
|
315
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
316
|
+
.optional()
|
|
317
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
318
|
+
}),
|
|
319
|
+
z.object({
|
|
320
|
+
operation: z.literal('create_task').describe('Create a new task'),
|
|
321
|
+
personId: z.number().optional().describe('Associated person ID'),
|
|
322
|
+
name: z.string().min(1).describe('Task name/title'),
|
|
323
|
+
description: z.string().optional().describe('Task description'),
|
|
324
|
+
dueDate: z.string().optional().describe('Due date (YYYY-MM-DD)'),
|
|
325
|
+
assignedTo: z.number().optional().describe('Assigned user ID'),
|
|
326
|
+
credentials: z
|
|
327
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
328
|
+
.optional()
|
|
329
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
330
|
+
}),
|
|
331
|
+
z.object({
|
|
332
|
+
operation: z.literal('update_task').describe('Update an existing task'),
|
|
333
|
+
task_id: z.number().describe('Task ID to update'),
|
|
334
|
+
name: z.string().optional().describe('Task name/title'),
|
|
335
|
+
description: z.string().optional().describe('Task description'),
|
|
336
|
+
dueDate: z.string().optional().describe('Due date (YYYY-MM-DD)'),
|
|
337
|
+
completed: z.boolean().optional().describe('Whether task is completed'),
|
|
338
|
+
assignedTo: z.number().optional().describe('Assigned user ID'),
|
|
339
|
+
credentials: z
|
|
340
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
341
|
+
.optional()
|
|
342
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
343
|
+
}),
|
|
344
|
+
z.object({
|
|
345
|
+
operation: z.literal('delete_task').describe('Delete a task'),
|
|
346
|
+
task_id: z.number().describe('Task ID to delete'),
|
|
347
|
+
credentials: z
|
|
348
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
349
|
+
.optional()
|
|
350
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
351
|
+
}),
|
|
352
|
+
// Note operations
|
|
353
|
+
z.object({
|
|
354
|
+
operation: z.literal('list_notes').describe('List notes'),
|
|
355
|
+
personId: z.number().optional().describe('Filter by person ID'),
|
|
356
|
+
limit: z
|
|
357
|
+
.number()
|
|
358
|
+
.min(1)
|
|
359
|
+
.max(100)
|
|
360
|
+
.optional()
|
|
361
|
+
.default(25)
|
|
362
|
+
.describe('Number of results to return'),
|
|
363
|
+
offset: z
|
|
364
|
+
.number()
|
|
365
|
+
.optional()
|
|
366
|
+
.default(0)
|
|
367
|
+
.describe('Number of results to skip'),
|
|
368
|
+
credentials: z
|
|
369
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
370
|
+
.optional()
|
|
371
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
372
|
+
}),
|
|
373
|
+
z.object({
|
|
374
|
+
operation: z.literal('create_note').describe('Create a new note'),
|
|
375
|
+
personId: z.number().describe('Associated person ID'),
|
|
376
|
+
subject: z.string().optional().describe('Note subject'),
|
|
377
|
+
body: z.string().min(1).describe('Note content'),
|
|
378
|
+
credentials: z
|
|
379
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
380
|
+
.optional()
|
|
381
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
382
|
+
}),
|
|
383
|
+
z.object({
|
|
384
|
+
operation: z.literal('update_note').describe('Update an existing note'),
|
|
385
|
+
note_id: z.number().describe('Note ID to update'),
|
|
386
|
+
subject: z.string().optional().describe('Note subject'),
|
|
387
|
+
body: z.string().optional().describe('Note content'),
|
|
388
|
+
credentials: z
|
|
389
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
390
|
+
.optional()
|
|
391
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
392
|
+
}),
|
|
393
|
+
z.object({
|
|
394
|
+
operation: z.literal('delete_note').describe('Delete a note'),
|
|
395
|
+
note_id: z.number().describe('Note ID to delete'),
|
|
396
|
+
credentials: z
|
|
397
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
398
|
+
.optional()
|
|
399
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
400
|
+
}),
|
|
401
|
+
// Deal operations
|
|
402
|
+
z.object({
|
|
403
|
+
operation: z.literal('list_deals').describe('List deals'),
|
|
404
|
+
personId: z.number().optional().describe('Filter by person ID'),
|
|
405
|
+
limit: z
|
|
406
|
+
.number()
|
|
407
|
+
.min(1)
|
|
408
|
+
.max(100)
|
|
409
|
+
.optional()
|
|
410
|
+
.default(25)
|
|
411
|
+
.describe('Number of results to return'),
|
|
412
|
+
offset: z
|
|
413
|
+
.number()
|
|
414
|
+
.optional()
|
|
415
|
+
.default(0)
|
|
416
|
+
.describe('Number of results to skip'),
|
|
417
|
+
credentials: z
|
|
418
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
419
|
+
.optional()
|
|
420
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
421
|
+
}),
|
|
422
|
+
z.object({
|
|
423
|
+
operation: z.literal('get_deal').describe('Get a specific deal by ID'),
|
|
424
|
+
deal_id: z.number().describe('Deal ID to retrieve'),
|
|
425
|
+
credentials: z
|
|
426
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
427
|
+
.optional()
|
|
428
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
429
|
+
}),
|
|
430
|
+
z.object({
|
|
431
|
+
operation: z.literal('create_deal').describe('Create a new deal'),
|
|
432
|
+
personId: z.number().optional().describe('Associated person ID'),
|
|
433
|
+
name: z.string().optional().describe('Deal name'),
|
|
434
|
+
price: z.number().optional().describe('Deal price/value'),
|
|
435
|
+
stage: z.string().optional().describe('Deal stage'),
|
|
436
|
+
closeDate: z
|
|
437
|
+
.string()
|
|
438
|
+
.optional()
|
|
439
|
+
.describe('Expected close date (YYYY-MM-DD)'),
|
|
440
|
+
credentials: z
|
|
441
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
442
|
+
.optional()
|
|
443
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
444
|
+
}),
|
|
445
|
+
z.object({
|
|
446
|
+
operation: z.literal('update_deal').describe('Update an existing deal'),
|
|
447
|
+
deal_id: z.number().describe('Deal ID to update'),
|
|
448
|
+
name: z.string().optional().describe('Deal name'),
|
|
449
|
+
price: z.number().optional().describe('Deal price/value'),
|
|
450
|
+
stage: z.string().optional().describe('Deal stage'),
|
|
451
|
+
closeDate: z
|
|
452
|
+
.string()
|
|
453
|
+
.optional()
|
|
454
|
+
.describe('Expected close date (YYYY-MM-DD)'),
|
|
455
|
+
credentials: z
|
|
456
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
457
|
+
.optional()
|
|
458
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
459
|
+
}),
|
|
460
|
+
// Event operations (preferred for new leads)
|
|
461
|
+
z.object({
|
|
462
|
+
operation: z.literal('list_events').describe('List/search events'),
|
|
463
|
+
limit: z
|
|
464
|
+
.number()
|
|
465
|
+
.min(1)
|
|
466
|
+
.max(100)
|
|
467
|
+
.optional()
|
|
468
|
+
.default(25)
|
|
469
|
+
.describe('Number of results to return'),
|
|
470
|
+
offset: z
|
|
471
|
+
.number()
|
|
472
|
+
.optional()
|
|
473
|
+
.default(0)
|
|
474
|
+
.describe('Number of results to skip'),
|
|
475
|
+
personId: z.number().optional().describe('Filter by person ID'),
|
|
476
|
+
credentials: z
|
|
477
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
478
|
+
.optional()
|
|
479
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
480
|
+
}),
|
|
481
|
+
z.object({
|
|
482
|
+
operation: z.literal('get_event').describe('Get a specific event by ID'),
|
|
483
|
+
event_id: z.number().describe('Event ID to retrieve'),
|
|
484
|
+
credentials: z
|
|
485
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
486
|
+
.optional()
|
|
487
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
488
|
+
}),
|
|
489
|
+
z.object({
|
|
490
|
+
operation: z
|
|
491
|
+
.literal('create_event')
|
|
492
|
+
.describe('Create an event (preferred for new leads)'),
|
|
493
|
+
type: z
|
|
494
|
+
.string()
|
|
495
|
+
.min(1)
|
|
496
|
+
.describe('Event type (e.g., "Showing Request", "Registration")'),
|
|
497
|
+
source: z.string().optional().describe('Event source'),
|
|
498
|
+
message: z.string().optional().describe('Event message'),
|
|
499
|
+
person: z
|
|
500
|
+
.object({
|
|
501
|
+
firstName: z.string().optional(),
|
|
502
|
+
lastName: z.string().optional(),
|
|
503
|
+
emails: z.array(z.object({ value: z.string().email() })).optional(),
|
|
504
|
+
phones: z.array(z.object({ value: z.string() })).optional(),
|
|
505
|
+
tags: z.array(z.string()).optional(),
|
|
506
|
+
})
|
|
507
|
+
.describe('Person data for the event'),
|
|
508
|
+
credentials: z
|
|
509
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
510
|
+
.optional()
|
|
511
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
512
|
+
}),
|
|
513
|
+
// Call operations
|
|
514
|
+
z.object({
|
|
515
|
+
operation: z.literal('list_calls').describe('List calls'),
|
|
516
|
+
personId: z.number().optional().describe('Filter by person ID'),
|
|
517
|
+
limit: z
|
|
518
|
+
.number()
|
|
519
|
+
.min(1)
|
|
520
|
+
.max(100)
|
|
521
|
+
.optional()
|
|
522
|
+
.default(25)
|
|
523
|
+
.describe('Number of results to return'),
|
|
524
|
+
offset: z
|
|
525
|
+
.number()
|
|
526
|
+
.optional()
|
|
527
|
+
.default(0)
|
|
528
|
+
.describe('Number of results to skip'),
|
|
529
|
+
credentials: z
|
|
530
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
531
|
+
.optional()
|
|
532
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
533
|
+
}),
|
|
534
|
+
z.object({
|
|
535
|
+
operation: z.literal('create_call').describe('Log a call'),
|
|
536
|
+
personId: z.number().describe('Associated person ID'),
|
|
537
|
+
outcome: z.string().optional().describe('Call outcome'),
|
|
538
|
+
note: z.string().optional().describe('Call notes'),
|
|
539
|
+
duration: z.number().optional().describe('Call duration in seconds'),
|
|
540
|
+
credentials: z
|
|
541
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
542
|
+
.optional()
|
|
543
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
544
|
+
}),
|
|
545
|
+
// Appointment operations
|
|
546
|
+
z.object({
|
|
547
|
+
operation: z.literal('list_appointments').describe('List appointments'),
|
|
548
|
+
personId: z.number().optional().describe('Filter by person ID'),
|
|
549
|
+
limit: z
|
|
550
|
+
.number()
|
|
551
|
+
.min(1)
|
|
552
|
+
.max(100)
|
|
553
|
+
.optional()
|
|
554
|
+
.default(25)
|
|
555
|
+
.describe('Number of results to return'),
|
|
556
|
+
offset: z
|
|
557
|
+
.number()
|
|
558
|
+
.optional()
|
|
559
|
+
.default(0)
|
|
560
|
+
.describe('Number of results to skip'),
|
|
561
|
+
credentials: z
|
|
562
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
563
|
+
.optional()
|
|
564
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
565
|
+
}),
|
|
566
|
+
z.object({
|
|
567
|
+
operation: z
|
|
568
|
+
.literal('create_appointment')
|
|
569
|
+
.describe('Create an appointment'),
|
|
570
|
+
personId: z.number().optional().describe('Associated person ID'),
|
|
571
|
+
title: z.string().min(1).describe('Appointment title'),
|
|
572
|
+
startTime: z.string().describe('Start time (ISO 8601)'),
|
|
573
|
+
endTime: z.string().optional().describe('End time (ISO 8601)'),
|
|
574
|
+
location: z.string().optional().describe('Location'),
|
|
575
|
+
credentials: z
|
|
576
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
577
|
+
.optional()
|
|
578
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
579
|
+
}),
|
|
580
|
+
// Webhook operations
|
|
581
|
+
z.object({
|
|
582
|
+
operation: z.literal('list_webhooks').describe('List registered webhooks'),
|
|
583
|
+
credentials: z
|
|
584
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
585
|
+
.optional()
|
|
586
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
587
|
+
}),
|
|
588
|
+
z.object({
|
|
589
|
+
operation: z
|
|
590
|
+
.literal('get_webhook')
|
|
591
|
+
.describe('Get a specific webhook by ID'),
|
|
592
|
+
webhook_id: z.number().describe('Webhook ID to retrieve'),
|
|
593
|
+
credentials: z
|
|
594
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
595
|
+
.optional()
|
|
596
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
597
|
+
}),
|
|
598
|
+
z.object({
|
|
599
|
+
operation: z.literal('create_webhook').describe('Register a new webhook'),
|
|
600
|
+
event: z
|
|
601
|
+
.enum(FUB_WEBHOOK_EVENTS)
|
|
602
|
+
.describe('Webhook event type to subscribe to'),
|
|
603
|
+
url: z
|
|
604
|
+
.string()
|
|
605
|
+
.url()
|
|
606
|
+
.describe('HTTPS callback URL for webhook notifications'),
|
|
607
|
+
credentials: z
|
|
608
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
609
|
+
.optional()
|
|
610
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
611
|
+
}),
|
|
612
|
+
z.object({
|
|
613
|
+
operation: z
|
|
614
|
+
.literal('update_webhook')
|
|
615
|
+
.describe('Update an existing webhook'),
|
|
616
|
+
webhook_id: z.number().describe('Webhook ID to update'),
|
|
617
|
+
event: z
|
|
618
|
+
.enum(FUB_WEBHOOK_EVENTS)
|
|
619
|
+
.optional()
|
|
620
|
+
.describe('New webhook event type'),
|
|
621
|
+
url: z.string().url().optional().describe('New HTTPS callback URL'),
|
|
622
|
+
credentials: z
|
|
623
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
624
|
+
.optional()
|
|
625
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
626
|
+
}),
|
|
627
|
+
z.object({
|
|
628
|
+
operation: z.literal('delete_webhook').describe('Delete a webhook'),
|
|
629
|
+
webhook_id: z.number().describe('Webhook ID to delete'),
|
|
630
|
+
credentials: z
|
|
631
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
632
|
+
.optional()
|
|
633
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
634
|
+
}),
|
|
635
|
+
]);
|
|
636
|
+
// Define result schemas for different operations
|
|
637
|
+
const FUBResultSchema = z.discriminatedUnion('operation', [
|
|
638
|
+
// People results
|
|
639
|
+
z.object({
|
|
640
|
+
operation: z.literal('list_people'),
|
|
641
|
+
success: z.boolean(),
|
|
642
|
+
people: z.array(FUBPersonSchema).optional(),
|
|
643
|
+
_metadata: z
|
|
644
|
+
.object({
|
|
645
|
+
total: z.number().optional(),
|
|
646
|
+
limit: z.number().optional(),
|
|
647
|
+
offset: z.number().optional(),
|
|
648
|
+
})
|
|
649
|
+
.optional(),
|
|
650
|
+
error: z.string(),
|
|
651
|
+
}),
|
|
652
|
+
z.object({
|
|
653
|
+
operation: z.literal('get_person'),
|
|
654
|
+
success: z.boolean(),
|
|
655
|
+
person: FUBPersonSchema.optional(),
|
|
656
|
+
error: z.string(),
|
|
657
|
+
}),
|
|
658
|
+
z.object({
|
|
659
|
+
operation: z.literal('create_person'),
|
|
660
|
+
success: z.boolean(),
|
|
661
|
+
person: FUBPersonSchema.optional(),
|
|
662
|
+
error: z.string(),
|
|
663
|
+
}),
|
|
664
|
+
z.object({
|
|
665
|
+
operation: z.literal('update_person'),
|
|
666
|
+
success: z.boolean(),
|
|
667
|
+
person: FUBPersonSchema.optional(),
|
|
668
|
+
error: z.string(),
|
|
669
|
+
}),
|
|
670
|
+
z.object({
|
|
671
|
+
operation: z.literal('delete_person'),
|
|
672
|
+
success: z.boolean(),
|
|
673
|
+
deleted_id: z.number().optional(),
|
|
674
|
+
error: z.string(),
|
|
675
|
+
}),
|
|
676
|
+
// Task results
|
|
677
|
+
z.object({
|
|
678
|
+
operation: z.literal('list_tasks'),
|
|
679
|
+
success: z.boolean(),
|
|
680
|
+
tasks: z.array(FUBTaskSchema).optional(),
|
|
681
|
+
_metadata: z
|
|
682
|
+
.object({
|
|
683
|
+
total: z.number().optional(),
|
|
684
|
+
limit: z.number().optional(),
|
|
685
|
+
offset: z.number().optional(),
|
|
686
|
+
})
|
|
687
|
+
.optional(),
|
|
688
|
+
error: z.string(),
|
|
689
|
+
}),
|
|
690
|
+
z.object({
|
|
691
|
+
operation: z.literal('get_task'),
|
|
692
|
+
success: z.boolean(),
|
|
693
|
+
task: FUBTaskSchema.optional(),
|
|
694
|
+
error: z.string(),
|
|
695
|
+
}),
|
|
696
|
+
z.object({
|
|
697
|
+
operation: z.literal('create_task'),
|
|
698
|
+
success: z.boolean(),
|
|
699
|
+
task: FUBTaskSchema.optional(),
|
|
700
|
+
error: z.string(),
|
|
701
|
+
}),
|
|
702
|
+
z.object({
|
|
703
|
+
operation: z.literal('update_task'),
|
|
704
|
+
success: z.boolean(),
|
|
705
|
+
task: FUBTaskSchema.optional(),
|
|
706
|
+
error: z.string(),
|
|
707
|
+
}),
|
|
708
|
+
z.object({
|
|
709
|
+
operation: z.literal('delete_task'),
|
|
710
|
+
success: z.boolean(),
|
|
711
|
+
deleted_id: z.number().optional(),
|
|
712
|
+
error: z.string(),
|
|
713
|
+
}),
|
|
714
|
+
// Note results
|
|
715
|
+
z.object({
|
|
716
|
+
operation: z.literal('list_notes'),
|
|
717
|
+
success: z.boolean(),
|
|
718
|
+
notes: z.array(FUBNoteSchema).optional(),
|
|
719
|
+
_metadata: z
|
|
720
|
+
.object({
|
|
721
|
+
total: z.number().optional(),
|
|
722
|
+
limit: z.number().optional(),
|
|
723
|
+
offset: z.number().optional(),
|
|
724
|
+
})
|
|
725
|
+
.optional(),
|
|
726
|
+
error: z.string(),
|
|
727
|
+
}),
|
|
728
|
+
z.object({
|
|
729
|
+
operation: z.literal('create_note'),
|
|
730
|
+
success: z.boolean(),
|
|
731
|
+
note: FUBNoteSchema.optional(),
|
|
732
|
+
error: z.string(),
|
|
733
|
+
}),
|
|
734
|
+
z.object({
|
|
735
|
+
operation: z.literal('update_note'),
|
|
736
|
+
success: z.boolean(),
|
|
737
|
+
note: FUBNoteSchema.optional(),
|
|
738
|
+
error: z.string(),
|
|
739
|
+
}),
|
|
740
|
+
z.object({
|
|
741
|
+
operation: z.literal('delete_note'),
|
|
742
|
+
success: z.boolean(),
|
|
743
|
+
deleted_id: z.number().optional(),
|
|
744
|
+
error: z.string(),
|
|
745
|
+
}),
|
|
746
|
+
// Deal results
|
|
747
|
+
z.object({
|
|
748
|
+
operation: z.literal('list_deals'),
|
|
749
|
+
success: z.boolean(),
|
|
750
|
+
deals: z.array(FUBDealSchema).optional(),
|
|
751
|
+
_metadata: z
|
|
752
|
+
.object({
|
|
753
|
+
total: z.number().optional(),
|
|
754
|
+
limit: z.number().optional(),
|
|
755
|
+
offset: z.number().optional(),
|
|
756
|
+
})
|
|
757
|
+
.optional(),
|
|
758
|
+
error: z.string(),
|
|
759
|
+
}),
|
|
760
|
+
z.object({
|
|
761
|
+
operation: z.literal('get_deal'),
|
|
762
|
+
success: z.boolean(),
|
|
763
|
+
deal: FUBDealSchema.optional(),
|
|
764
|
+
error: z.string(),
|
|
765
|
+
}),
|
|
766
|
+
z.object({
|
|
767
|
+
operation: z.literal('create_deal'),
|
|
768
|
+
success: z.boolean(),
|
|
769
|
+
deal: FUBDealSchema.optional(),
|
|
770
|
+
error: z.string(),
|
|
771
|
+
}),
|
|
772
|
+
z.object({
|
|
773
|
+
operation: z.literal('update_deal'),
|
|
774
|
+
success: z.boolean(),
|
|
775
|
+
deal: FUBDealSchema.optional(),
|
|
776
|
+
error: z.string(),
|
|
777
|
+
}),
|
|
778
|
+
// Event results
|
|
779
|
+
z.object({
|
|
780
|
+
operation: z.literal('list_events'),
|
|
781
|
+
success: z.boolean(),
|
|
782
|
+
events: z.array(FUBEventSchema).optional(),
|
|
783
|
+
_metadata: z
|
|
784
|
+
.object({
|
|
785
|
+
total: z.number().optional(),
|
|
786
|
+
limit: z.number().optional(),
|
|
787
|
+
offset: z.number().optional(),
|
|
788
|
+
})
|
|
789
|
+
.optional(),
|
|
790
|
+
error: z.string(),
|
|
791
|
+
}),
|
|
792
|
+
z.object({
|
|
793
|
+
operation: z.literal('get_event'),
|
|
794
|
+
success: z.boolean(),
|
|
795
|
+
event: FUBEventSchema.optional(),
|
|
796
|
+
error: z.string(),
|
|
797
|
+
}),
|
|
798
|
+
z.object({
|
|
799
|
+
operation: z.literal('create_event'),
|
|
800
|
+
success: z.boolean(),
|
|
801
|
+
event: FUBEventSchema.optional(),
|
|
802
|
+
error: z.string(),
|
|
803
|
+
}),
|
|
804
|
+
// Call results
|
|
805
|
+
z.object({
|
|
806
|
+
operation: z.literal('list_calls'),
|
|
807
|
+
success: z.boolean(),
|
|
808
|
+
calls: z.array(FUBCallSchema).optional(),
|
|
809
|
+
_metadata: z
|
|
810
|
+
.object({
|
|
811
|
+
total: z.number().optional(),
|
|
812
|
+
limit: z.number().optional(),
|
|
813
|
+
offset: z.number().optional(),
|
|
814
|
+
})
|
|
815
|
+
.optional(),
|
|
816
|
+
error: z.string(),
|
|
817
|
+
}),
|
|
818
|
+
z.object({
|
|
819
|
+
operation: z.literal('create_call'),
|
|
820
|
+
success: z.boolean(),
|
|
821
|
+
call: FUBCallSchema.optional(),
|
|
822
|
+
error: z.string(),
|
|
823
|
+
}),
|
|
824
|
+
// Appointment results
|
|
825
|
+
z.object({
|
|
826
|
+
operation: z.literal('list_appointments'),
|
|
827
|
+
success: z.boolean(),
|
|
828
|
+
appointments: z.array(FUBAppointmentSchema).optional(),
|
|
829
|
+
_metadata: z
|
|
830
|
+
.object({
|
|
831
|
+
total: z.number().optional(),
|
|
832
|
+
limit: z.number().optional(),
|
|
833
|
+
offset: z.number().optional(),
|
|
834
|
+
})
|
|
835
|
+
.optional(),
|
|
836
|
+
error: z.string(),
|
|
837
|
+
}),
|
|
838
|
+
z.object({
|
|
839
|
+
operation: z.literal('create_appointment'),
|
|
840
|
+
success: z.boolean(),
|
|
841
|
+
appointment: FUBAppointmentSchema.optional(),
|
|
842
|
+
error: z.string(),
|
|
843
|
+
}),
|
|
844
|
+
// Webhook results
|
|
845
|
+
z.object({
|
|
846
|
+
operation: z.literal('list_webhooks'),
|
|
847
|
+
success: z.boolean(),
|
|
848
|
+
webhooks: z.array(FUBWebhookSchema).optional(),
|
|
849
|
+
error: z.string(),
|
|
850
|
+
}),
|
|
851
|
+
z.object({
|
|
852
|
+
operation: z.literal('get_webhook'),
|
|
853
|
+
success: z.boolean(),
|
|
854
|
+
webhook: FUBWebhookSchema.optional(),
|
|
855
|
+
error: z.string(),
|
|
856
|
+
}),
|
|
857
|
+
z.object({
|
|
858
|
+
operation: z.literal('create_webhook'),
|
|
859
|
+
success: z.boolean(),
|
|
860
|
+
webhook: FUBWebhookSchema.optional(),
|
|
861
|
+
error: z.string(),
|
|
862
|
+
}),
|
|
863
|
+
z.object({
|
|
864
|
+
operation: z.literal('update_webhook'),
|
|
865
|
+
success: z.boolean(),
|
|
866
|
+
webhook: FUBWebhookSchema.optional(),
|
|
867
|
+
error: z.string(),
|
|
868
|
+
}),
|
|
869
|
+
z.object({
|
|
870
|
+
operation: z.literal('delete_webhook'),
|
|
871
|
+
success: z.boolean(),
|
|
872
|
+
deleted_id: z.number().optional(),
|
|
873
|
+
error: z.string(),
|
|
874
|
+
}),
|
|
875
|
+
]);
|
|
876
|
+
export class FollowUpBossBubble extends ServiceBubble {
|
|
877
|
+
static type = 'service';
|
|
878
|
+
static service = 'followupboss';
|
|
879
|
+
static authType = 'oauth';
|
|
880
|
+
static bubbleName = 'followupboss';
|
|
881
|
+
static schema = FUBParamsSchema;
|
|
882
|
+
static resultSchema = FUBResultSchema;
|
|
883
|
+
static shortDescription = 'Follow Up Boss CRM integration';
|
|
884
|
+
static longDescription = `
|
|
885
|
+
Follow Up Boss CRM integration for real estate professionals.
|
|
886
|
+
Use cases:
|
|
887
|
+
- Manage contacts/people with full CRUD operations
|
|
888
|
+
- Create and track tasks
|
|
889
|
+
- Add notes to contacts
|
|
890
|
+
- Manage deals in the pipeline
|
|
891
|
+
- Log calls and appointments
|
|
892
|
+
- Create events (preferred method for new leads)
|
|
893
|
+
- Automate lead management workflows
|
|
894
|
+
`;
|
|
895
|
+
static alias = 'fub';
|
|
896
|
+
constructor(params = { operation: 'list_people' }, context) {
|
|
897
|
+
super(params, context);
|
|
898
|
+
}
|
|
899
|
+
async testCredential() {
|
|
900
|
+
const credential = this.chooseCredential();
|
|
901
|
+
try {
|
|
902
|
+
const response = await fetch('https://api.followupboss.com/v1/me', {
|
|
903
|
+
headers: {
|
|
904
|
+
Authorization: `Bearer ${credential}`,
|
|
905
|
+
'Content-Type': 'application/json',
|
|
906
|
+
'X-System': process.env.FUB_SYSTEM_NAME || 'Bubble-Lab',
|
|
907
|
+
'X-System-Key': process.env.FUB_SYSTEM_KEY || '',
|
|
908
|
+
},
|
|
909
|
+
});
|
|
910
|
+
return response.ok;
|
|
911
|
+
}
|
|
912
|
+
catch {
|
|
913
|
+
return false;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
async makeFUBApiRequest(endpoint, method = 'GET', body) {
|
|
917
|
+
const url = `https://api.followupboss.com/v1${endpoint}`;
|
|
918
|
+
const requestHeaders = {
|
|
919
|
+
Authorization: `Bearer ${this.chooseCredential()}`,
|
|
920
|
+
'Content-Type': 'application/json',
|
|
921
|
+
'X-System': process.env.FUB_SYSTEM_NAME || 'Bubble-Lab',
|
|
922
|
+
'X-System-Key': process.env.FUB_SYSTEM_KEY || '',
|
|
923
|
+
};
|
|
924
|
+
const requestInit = {
|
|
925
|
+
method,
|
|
926
|
+
headers: requestHeaders,
|
|
927
|
+
};
|
|
928
|
+
if (body && method !== 'GET') {
|
|
929
|
+
requestInit.body = JSON.stringify(body);
|
|
930
|
+
}
|
|
931
|
+
const response = await fetch(url, requestInit);
|
|
932
|
+
if (!response.ok) {
|
|
933
|
+
const errorText = await response.text();
|
|
934
|
+
throw new Error(`FUB API error: ${response.status} ${response.statusText} - ${errorText}`);
|
|
935
|
+
}
|
|
936
|
+
// Handle empty responses
|
|
937
|
+
const contentType = response.headers.get('content-type');
|
|
938
|
+
if (contentType && contentType.includes('application/json')) {
|
|
939
|
+
return await response.json();
|
|
940
|
+
}
|
|
941
|
+
else {
|
|
942
|
+
return await response.text();
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
async performAction(context) {
|
|
946
|
+
void context;
|
|
947
|
+
const { operation } = this.params;
|
|
948
|
+
try {
|
|
949
|
+
const result = await (async () => {
|
|
950
|
+
switch (operation) {
|
|
951
|
+
// People operations
|
|
952
|
+
case 'list_people':
|
|
953
|
+
return await this.listPeople(this.params);
|
|
954
|
+
case 'get_person':
|
|
955
|
+
return await this.getPerson(this.params);
|
|
956
|
+
case 'create_person':
|
|
957
|
+
return await this.createPerson(this.params);
|
|
958
|
+
case 'update_person':
|
|
959
|
+
return await this.updatePerson(this.params);
|
|
960
|
+
case 'delete_person':
|
|
961
|
+
return await this.deletePerson(this.params);
|
|
962
|
+
// Task operations
|
|
963
|
+
case 'list_tasks':
|
|
964
|
+
return await this.listTasks(this.params);
|
|
965
|
+
case 'get_task':
|
|
966
|
+
return await this.getTask(this.params);
|
|
967
|
+
case 'create_task':
|
|
968
|
+
return await this.createTask(this.params);
|
|
969
|
+
case 'update_task':
|
|
970
|
+
return await this.updateTask(this.params);
|
|
971
|
+
case 'delete_task':
|
|
972
|
+
return await this.deleteTask(this.params);
|
|
973
|
+
// Note operations
|
|
974
|
+
case 'list_notes':
|
|
975
|
+
return await this.listNotes(this.params);
|
|
976
|
+
case 'create_note':
|
|
977
|
+
return await this.createNote(this.params);
|
|
978
|
+
case 'update_note':
|
|
979
|
+
return await this.updateNote(this.params);
|
|
980
|
+
case 'delete_note':
|
|
981
|
+
return await this.deleteNote(this.params);
|
|
982
|
+
// Deal operations
|
|
983
|
+
case 'list_deals':
|
|
984
|
+
return await this.listDeals(this.params);
|
|
985
|
+
case 'get_deal':
|
|
986
|
+
return await this.getDeal(this.params);
|
|
987
|
+
case 'create_deal':
|
|
988
|
+
return await this.createDeal(this.params);
|
|
989
|
+
case 'update_deal':
|
|
990
|
+
return await this.updateDeal(this.params);
|
|
991
|
+
// Event operations
|
|
992
|
+
case 'list_events':
|
|
993
|
+
return await this.listEvents(this.params);
|
|
994
|
+
case 'get_event':
|
|
995
|
+
return await this.getEvent(this.params);
|
|
996
|
+
case 'create_event':
|
|
997
|
+
return await this.createEvent(this.params);
|
|
998
|
+
// Call operations
|
|
999
|
+
case 'list_calls':
|
|
1000
|
+
return await this.listCalls(this.params);
|
|
1001
|
+
case 'create_call':
|
|
1002
|
+
return await this.createCall(this.params);
|
|
1003
|
+
// Appointment operations
|
|
1004
|
+
case 'list_appointments':
|
|
1005
|
+
return await this.listAppointments(this.params);
|
|
1006
|
+
case 'create_appointment':
|
|
1007
|
+
return await this.createAppointment(this.params);
|
|
1008
|
+
// Webhook operations
|
|
1009
|
+
case 'list_webhooks':
|
|
1010
|
+
return await this.listWebhooks(this.params);
|
|
1011
|
+
case 'get_webhook':
|
|
1012
|
+
return await this.getWebhook(this.params);
|
|
1013
|
+
case 'create_webhook':
|
|
1014
|
+
return await this.createWebhook(this.params);
|
|
1015
|
+
case 'update_webhook':
|
|
1016
|
+
return await this.updateWebhook(this.params);
|
|
1017
|
+
case 'delete_webhook':
|
|
1018
|
+
return await this.deleteWebhook(this.params);
|
|
1019
|
+
default:
|
|
1020
|
+
throw new Error(`Unsupported operation: ${operation}`);
|
|
1021
|
+
}
|
|
1022
|
+
})();
|
|
1023
|
+
return result;
|
|
1024
|
+
}
|
|
1025
|
+
catch (error) {
|
|
1026
|
+
return {
|
|
1027
|
+
operation,
|
|
1028
|
+
success: false,
|
|
1029
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
// People operations
|
|
1034
|
+
async listPeople(params) {
|
|
1035
|
+
const queryParams = new URLSearchParams();
|
|
1036
|
+
if (params.limit)
|
|
1037
|
+
queryParams.set('limit', params.limit.toString());
|
|
1038
|
+
if (params.offset)
|
|
1039
|
+
queryParams.set('offset', params.offset.toString());
|
|
1040
|
+
if (params.sort)
|
|
1041
|
+
queryParams.set('sort', params.sort);
|
|
1042
|
+
if (params.fields)
|
|
1043
|
+
queryParams.set('fields', params.fields);
|
|
1044
|
+
if (params.includeTrash)
|
|
1045
|
+
queryParams.set('includeTrash', 'true');
|
|
1046
|
+
const response = (await this.makeFUBApiRequest(`/people?${queryParams.toString()}`));
|
|
1047
|
+
return {
|
|
1048
|
+
operation: 'list_people',
|
|
1049
|
+
success: true,
|
|
1050
|
+
people: response.people,
|
|
1051
|
+
_metadata: response._metadata,
|
|
1052
|
+
error: '',
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
async getPerson(params) {
|
|
1056
|
+
const queryParams = params.fields ? `?fields=${params.fields}` : '';
|
|
1057
|
+
const response = (await this.makeFUBApiRequest(`/people/${params.person_id}${queryParams}`));
|
|
1058
|
+
return {
|
|
1059
|
+
operation: 'get_person',
|
|
1060
|
+
success: true,
|
|
1061
|
+
person: response,
|
|
1062
|
+
error: '',
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
async createPerson(params) {
|
|
1066
|
+
const { operation: _, credentials: __, ...personData } = params;
|
|
1067
|
+
const response = (await this.makeFUBApiRequest('/people', 'POST', personData));
|
|
1068
|
+
return {
|
|
1069
|
+
operation: 'create_person',
|
|
1070
|
+
success: true,
|
|
1071
|
+
person: response,
|
|
1072
|
+
error: '',
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
async updatePerson(params) {
|
|
1076
|
+
const { operation: _, credentials: __, person_id, ...personData } = params;
|
|
1077
|
+
const response = (await this.makeFUBApiRequest(`/people/${person_id}`, 'PUT', personData));
|
|
1078
|
+
return {
|
|
1079
|
+
operation: 'update_person',
|
|
1080
|
+
success: true,
|
|
1081
|
+
person: response,
|
|
1082
|
+
error: '',
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
async deletePerson(params) {
|
|
1086
|
+
await this.makeFUBApiRequest(`/people/${params.person_id}`, 'DELETE');
|
|
1087
|
+
return {
|
|
1088
|
+
operation: 'delete_person',
|
|
1089
|
+
success: true,
|
|
1090
|
+
deleted_id: params.person_id,
|
|
1091
|
+
error: '',
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
// Task operations
|
|
1095
|
+
async listTasks(params) {
|
|
1096
|
+
const queryParams = new URLSearchParams();
|
|
1097
|
+
if (params.personId)
|
|
1098
|
+
queryParams.set('personId', params.personId.toString());
|
|
1099
|
+
if (params.limit)
|
|
1100
|
+
queryParams.set('limit', params.limit.toString());
|
|
1101
|
+
if (params.offset)
|
|
1102
|
+
queryParams.set('offset', params.offset.toString());
|
|
1103
|
+
const response = (await this.makeFUBApiRequest(`/tasks?${queryParams.toString()}`));
|
|
1104
|
+
return {
|
|
1105
|
+
operation: 'list_tasks',
|
|
1106
|
+
success: true,
|
|
1107
|
+
tasks: response.tasks,
|
|
1108
|
+
_metadata: response._metadata,
|
|
1109
|
+
error: '',
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
async getTask(params) {
|
|
1113
|
+
const response = (await this.makeFUBApiRequest(`/tasks/${params.task_id}`));
|
|
1114
|
+
return {
|
|
1115
|
+
operation: 'get_task',
|
|
1116
|
+
success: true,
|
|
1117
|
+
task: response,
|
|
1118
|
+
error: '',
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
async createTask(params) {
|
|
1122
|
+
const { operation: _, credentials: __, ...taskData } = params;
|
|
1123
|
+
const response = (await this.makeFUBApiRequest('/tasks', 'POST', taskData));
|
|
1124
|
+
return {
|
|
1125
|
+
operation: 'create_task',
|
|
1126
|
+
success: true,
|
|
1127
|
+
task: response,
|
|
1128
|
+
error: '',
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
async updateTask(params) {
|
|
1132
|
+
const { operation: _, credentials: __, task_id, ...taskData } = params;
|
|
1133
|
+
const response = (await this.makeFUBApiRequest(`/tasks/${task_id}`, 'PUT', taskData));
|
|
1134
|
+
return {
|
|
1135
|
+
operation: 'update_task',
|
|
1136
|
+
success: true,
|
|
1137
|
+
task: response,
|
|
1138
|
+
error: '',
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
async deleteTask(params) {
|
|
1142
|
+
await this.makeFUBApiRequest(`/tasks/${params.task_id}`, 'DELETE');
|
|
1143
|
+
return {
|
|
1144
|
+
operation: 'delete_task',
|
|
1145
|
+
success: true,
|
|
1146
|
+
deleted_id: params.task_id,
|
|
1147
|
+
error: '',
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
// Note operations
|
|
1151
|
+
async listNotes(params) {
|
|
1152
|
+
const queryParams = new URLSearchParams();
|
|
1153
|
+
if (params.personId)
|
|
1154
|
+
queryParams.set('personId', params.personId.toString());
|
|
1155
|
+
if (params.limit)
|
|
1156
|
+
queryParams.set('limit', params.limit.toString());
|
|
1157
|
+
if (params.offset)
|
|
1158
|
+
queryParams.set('offset', params.offset.toString());
|
|
1159
|
+
const response = (await this.makeFUBApiRequest(`/notes?${queryParams.toString()}`));
|
|
1160
|
+
return {
|
|
1161
|
+
operation: 'list_notes',
|
|
1162
|
+
success: true,
|
|
1163
|
+
notes: response.notes,
|
|
1164
|
+
_metadata: response._metadata,
|
|
1165
|
+
error: '',
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
async createNote(params) {
|
|
1169
|
+
const { operation: _, credentials: __, ...noteData } = params;
|
|
1170
|
+
const response = (await this.makeFUBApiRequest('/notes', 'POST', noteData));
|
|
1171
|
+
return {
|
|
1172
|
+
operation: 'create_note',
|
|
1173
|
+
success: true,
|
|
1174
|
+
note: response,
|
|
1175
|
+
error: '',
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
async updateNote(params) {
|
|
1179
|
+
const { operation: _, credentials: __, note_id, ...noteData } = params;
|
|
1180
|
+
const response = (await this.makeFUBApiRequest(`/notes/${note_id}`, 'PUT', noteData));
|
|
1181
|
+
return {
|
|
1182
|
+
operation: 'update_note',
|
|
1183
|
+
success: true,
|
|
1184
|
+
note: response,
|
|
1185
|
+
error: '',
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
async deleteNote(params) {
|
|
1189
|
+
await this.makeFUBApiRequest(`/notes/${params.note_id}`, 'DELETE');
|
|
1190
|
+
return {
|
|
1191
|
+
operation: 'delete_note',
|
|
1192
|
+
success: true,
|
|
1193
|
+
deleted_id: params.note_id,
|
|
1194
|
+
error: '',
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
// Deal operations
|
|
1198
|
+
async listDeals(params) {
|
|
1199
|
+
const queryParams = new URLSearchParams();
|
|
1200
|
+
if (params.personId)
|
|
1201
|
+
queryParams.set('personId', params.personId.toString());
|
|
1202
|
+
if (params.limit)
|
|
1203
|
+
queryParams.set('limit', params.limit.toString());
|
|
1204
|
+
if (params.offset)
|
|
1205
|
+
queryParams.set('offset', params.offset.toString());
|
|
1206
|
+
const response = (await this.makeFUBApiRequest(`/deals?${queryParams.toString()}`));
|
|
1207
|
+
return {
|
|
1208
|
+
operation: 'list_deals',
|
|
1209
|
+
success: true,
|
|
1210
|
+
deals: response.deals,
|
|
1211
|
+
_metadata: response._metadata,
|
|
1212
|
+
error: '',
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
async getDeal(params) {
|
|
1216
|
+
const response = (await this.makeFUBApiRequest(`/deals/${params.deal_id}`));
|
|
1217
|
+
return {
|
|
1218
|
+
operation: 'get_deal',
|
|
1219
|
+
success: true,
|
|
1220
|
+
deal: response,
|
|
1221
|
+
error: '',
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
async createDeal(params) {
|
|
1225
|
+
const { operation: _, credentials: __, ...dealData } = params;
|
|
1226
|
+
const response = (await this.makeFUBApiRequest('/deals', 'POST', dealData));
|
|
1227
|
+
return {
|
|
1228
|
+
operation: 'create_deal',
|
|
1229
|
+
success: true,
|
|
1230
|
+
deal: response,
|
|
1231
|
+
error: '',
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
async updateDeal(params) {
|
|
1235
|
+
const { operation: _, credentials: __, deal_id, ...dealData } = params;
|
|
1236
|
+
const response = (await this.makeFUBApiRequest(`/deals/${deal_id}`, 'PUT', dealData));
|
|
1237
|
+
return {
|
|
1238
|
+
operation: 'update_deal',
|
|
1239
|
+
success: true,
|
|
1240
|
+
deal: response,
|
|
1241
|
+
error: '',
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
// Event operations
|
|
1245
|
+
async listEvents(params) {
|
|
1246
|
+
const queryParams = new URLSearchParams();
|
|
1247
|
+
if (params.limit)
|
|
1248
|
+
queryParams.set('limit', params.limit.toString());
|
|
1249
|
+
if (params.offset)
|
|
1250
|
+
queryParams.set('offset', params.offset.toString());
|
|
1251
|
+
if (params.personId)
|
|
1252
|
+
queryParams.set('personId', params.personId.toString());
|
|
1253
|
+
const response = (await this.makeFUBApiRequest(`/events?${queryParams.toString()}`));
|
|
1254
|
+
return {
|
|
1255
|
+
operation: 'list_events',
|
|
1256
|
+
success: true,
|
|
1257
|
+
events: response.events,
|
|
1258
|
+
_metadata: response._metadata,
|
|
1259
|
+
error: '',
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
async getEvent(params) {
|
|
1263
|
+
const response = (await this.makeFUBApiRequest(`/events/${params.event_id}`));
|
|
1264
|
+
return {
|
|
1265
|
+
operation: 'get_event',
|
|
1266
|
+
success: true,
|
|
1267
|
+
event: response,
|
|
1268
|
+
error: '',
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
async createEvent(params) {
|
|
1272
|
+
const { operation: _, credentials: __, ...eventData } = params;
|
|
1273
|
+
const response = (await this.makeFUBApiRequest('/events', 'POST', eventData));
|
|
1274
|
+
return {
|
|
1275
|
+
operation: 'create_event',
|
|
1276
|
+
success: true,
|
|
1277
|
+
event: response,
|
|
1278
|
+
error: '',
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
// Call operations
|
|
1282
|
+
async listCalls(params) {
|
|
1283
|
+
const queryParams = new URLSearchParams();
|
|
1284
|
+
if (params.personId)
|
|
1285
|
+
queryParams.set('personId', params.personId.toString());
|
|
1286
|
+
if (params.limit)
|
|
1287
|
+
queryParams.set('limit', params.limit.toString());
|
|
1288
|
+
if (params.offset)
|
|
1289
|
+
queryParams.set('offset', params.offset.toString());
|
|
1290
|
+
const response = (await this.makeFUBApiRequest(`/calls?${queryParams.toString()}`));
|
|
1291
|
+
return {
|
|
1292
|
+
operation: 'list_calls',
|
|
1293
|
+
success: true,
|
|
1294
|
+
calls: response.calls,
|
|
1295
|
+
_metadata: response._metadata,
|
|
1296
|
+
error: '',
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1299
|
+
async createCall(params) {
|
|
1300
|
+
const { operation: _, credentials: __, ...callData } = params;
|
|
1301
|
+
const response = (await this.makeFUBApiRequest('/calls', 'POST', callData));
|
|
1302
|
+
return {
|
|
1303
|
+
operation: 'create_call',
|
|
1304
|
+
success: true,
|
|
1305
|
+
call: response,
|
|
1306
|
+
error: '',
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
// Appointment operations
|
|
1310
|
+
async listAppointments(params) {
|
|
1311
|
+
const queryParams = new URLSearchParams();
|
|
1312
|
+
if (params.personId)
|
|
1313
|
+
queryParams.set('personId', params.personId.toString());
|
|
1314
|
+
if (params.limit)
|
|
1315
|
+
queryParams.set('limit', params.limit.toString());
|
|
1316
|
+
if (params.offset)
|
|
1317
|
+
queryParams.set('offset', params.offset.toString());
|
|
1318
|
+
const response = (await this.makeFUBApiRequest(`/appointments?${queryParams.toString()}`));
|
|
1319
|
+
return {
|
|
1320
|
+
operation: 'list_appointments',
|
|
1321
|
+
success: true,
|
|
1322
|
+
appointments: response.appointments,
|
|
1323
|
+
_metadata: response._metadata,
|
|
1324
|
+
error: '',
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
async createAppointment(params) {
|
|
1328
|
+
const { operation: _, credentials: __, ...appointmentData } = params;
|
|
1329
|
+
const response = (await this.makeFUBApiRequest('/appointments', 'POST', appointmentData));
|
|
1330
|
+
return {
|
|
1331
|
+
operation: 'create_appointment',
|
|
1332
|
+
success: true,
|
|
1333
|
+
appointment: response,
|
|
1334
|
+
error: '',
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
// Webhook operations
|
|
1338
|
+
async listWebhooks(params) {
|
|
1339
|
+
void params;
|
|
1340
|
+
const response = (await this.makeFUBApiRequest('/webhooks'));
|
|
1341
|
+
return {
|
|
1342
|
+
operation: 'list_webhooks',
|
|
1343
|
+
success: true,
|
|
1344
|
+
webhooks: response.webhooks,
|
|
1345
|
+
error: '',
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
async getWebhook(params) {
|
|
1349
|
+
const response = (await this.makeFUBApiRequest(`/webhooks/${params.webhook_id}`));
|
|
1350
|
+
return {
|
|
1351
|
+
operation: 'get_webhook',
|
|
1352
|
+
success: true,
|
|
1353
|
+
webhook: response,
|
|
1354
|
+
error: '',
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
async createWebhook(params) {
|
|
1358
|
+
const { operation: _, credentials: __, ...webhookData } = params;
|
|
1359
|
+
const response = (await this.makeFUBApiRequest('/webhooks', 'POST', webhookData));
|
|
1360
|
+
return {
|
|
1361
|
+
operation: 'create_webhook',
|
|
1362
|
+
success: true,
|
|
1363
|
+
webhook: response,
|
|
1364
|
+
error: '',
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
async updateWebhook(params) {
|
|
1368
|
+
const { operation: _, credentials: __, webhook_id, ...webhookData } = params;
|
|
1369
|
+
const response = (await this.makeFUBApiRequest(`/webhooks/${webhook_id}`, 'PUT', webhookData));
|
|
1370
|
+
return {
|
|
1371
|
+
operation: 'update_webhook',
|
|
1372
|
+
success: true,
|
|
1373
|
+
webhook: response,
|
|
1374
|
+
error: '',
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
async deleteWebhook(params) {
|
|
1378
|
+
await this.makeFUBApiRequest(`/webhooks/${params.webhook_id}`, 'DELETE');
|
|
1379
|
+
return {
|
|
1380
|
+
operation: 'delete_webhook',
|
|
1381
|
+
success: true,
|
|
1382
|
+
deleted_id: params.webhook_id,
|
|
1383
|
+
error: '',
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
chooseCredential() {
|
|
1387
|
+
const { credentials } = this.params;
|
|
1388
|
+
if (!credentials || typeof credentials !== 'object') {
|
|
1389
|
+
throw new Error('No Follow Up Boss credentials provided');
|
|
1390
|
+
}
|
|
1391
|
+
return credentials[CredentialType.FUB_CRED];
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
//# sourceMappingURL=followupboss.js.map
|