@bubblelab/bubble-core 0.1.9 → 0.1.11
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 +633 -1658
- package/dist/bubble-factory.d.ts.map +1 -1
- package/dist/bubble-factory.js +165 -43
- package/dist/bubble-factory.js.map +1 -1
- package/dist/bubble-flow/bubble-flow-class.d.ts +22 -1
- package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -1
- package/dist/bubble-flow/bubble-flow-class.js +36 -0
- package/dist/bubble-flow/bubble-flow-class.js.map +1 -1
- package/dist/bubble-flow/sample/data-analyst-flow.d.ts +1 -1
- package/dist/bubble-flow/sample/data-analyst-flow.d.ts.map +1 -1
- package/dist/bubble-flow/sample/error-ts.d.ts +1 -1
- package/dist/bubble-flow/sample/error-ts.d.ts.map +1 -1
- package/dist/bubble-flow/sample/sanitytest.d.ts +1 -1
- package/dist/bubble-flow/sample/sanitytest.d.ts.map +1 -1
- package/dist/bubble-flow/sample/simple-webhook-2.d.ts +1 -1
- package/dist/bubble-flow/sample/simple-webhook-2.d.ts.map +1 -1
- package/dist/bubble-flow/sample/simple-webhook.d.ts +1 -1
- package/dist/bubble-flow/sample/simple-webhook.d.ts.map +1 -1
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts +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/bubble-flow/sample/slack-v0.1.d.ts +1 -1
- package/dist/bubble-flow/sample/slack-v0.1.d.ts.map +1 -1
- package/dist/bubble-flow/sample/slackagenttest.d.ts +1 -1
- package/dist/bubble-flow/sample/slackagenttest.d.ts.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 +297 -85
- package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/ai-agent.js +535 -399
- 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 +38 -38
- package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +56 -56
- 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 +27 -27
- package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +38 -38
- 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 +184 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js +145 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts +52 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js +29 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +1483 -123
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js +48 -0
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js.map +1 -1
- package/dist/bubbles/service-bubble/apify/apify.d.ts +156 -11
- package/dist/bubbles/service-bubble/apify/apify.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/apify/apify.js +205 -32
- package/dist/bubbles/service-bubble/apify/apify.js.map +1 -1
- package/dist/bubbles/service-bubble/apify/index.d.ts +2 -0
- package/dist/bubbles/service-bubble/apify/index.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/apify/index.js +3 -0
- package/dist/bubbles/service-bubble/apify/index.js.map +1 -1
- package/dist/bubbles/service-bubble/apify/types.js +1 -2
- package/dist/bubbles/service-bubble/apify/types.js.map +1 -1
- 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 +2399 -0
- package/dist/bubbles/service-bubble/github.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/github.js +1052 -0
- package/dist/bubbles/service-bubble/github.js.map +1 -0
- package/dist/bubbles/service-bubble/gmail.d.ts +726 -232
- package/dist/bubbles/service-bubble/gmail.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/gmail.js +435 -7
- package/dist/bubbles/service-bubble/gmail.js.map +1 -1
- package/dist/bubbles/service-bubble/google-calendar.d.ts +8 -8
- package/dist/bubbles/service-bubble/google-drive.d.ts +270 -40
- package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/google-drive.js +100 -78
- 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.js +2 -2
- package/dist/bubbles/service-bubble/hello-world.js.map +1 -1
- package/dist/bubbles/service-bubble/http.d.ts +6 -6
- package/dist/bubbles/service-bubble/http.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/http.js +7 -1
- 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 +8 -8
- 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 +525 -525
- package/dist/bubbles/service-bubble/slack.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/slack.js +2 -2
- package/dist/bubbles/service-bubble/slack.js.map +1 -1
- package/dist/bubbles/service-bubble/storage.d.ts +21 -17
- package/dist/bubbles/service-bubble/storage.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/storage.js +59 -7
- 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/bubbleflow-validation-tool.d.ts +60 -4
- 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 +4 -4
- 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/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 +132 -19
- 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 +205 -0
- package/dist/bubbles/tool-bubble/google-maps-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts +90 -90
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/instagram-tool.js +2 -2
- package/dist/bubbles/tool-bubble/instagram-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +808 -431
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/linkedin-tool.js +232 -12
- 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 +21 -16
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.js +97 -22
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.js.map +1 -1
- 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 +27 -17
- package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +4 -4
- 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/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 +494 -0
- package/dist/bubbles/tool-bubble/twitter-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +32 -26
- 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 +4 -4
- 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 +23 -115
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-scrape-tool.js +51 -72
- package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts +18 -6
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-search-tool.js +46 -32
- package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/youtube-tool.d.ts +394 -0
- package/dist/bubbles/tool-bubble/youtube-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/youtube-tool.js +352 -0
- package/dist/bubbles/tool-bubble/youtube-tool.js.map +1 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +78 -78
- package/dist/bubbles/workflow-bubble/generate-document.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +62 -62
- package/dist/bubbles/workflow-bubble/parse-document.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +80 -80
- 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 +52 -52
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +2 -2
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +32 -32
- 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 +46 -46
- 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 +27 -27
- 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 +251 -88
- package/dist/index.d.ts +27 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/logging/BubbleLogger.d.ts +45 -16
- package/dist/logging/BubbleLogger.d.ts.map +1 -1
- package/dist/logging/BubbleLogger.js +197 -89
- package/dist/logging/BubbleLogger.js.map +1 -1
- package/dist/logging/StreamingBubbleLogger.d.ts +13 -1
- package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -1
- package/dist/logging/StreamingBubbleLogger.js +56 -13
- 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 +1 -0
- package/dist/types/available-tools.js.map +1 -1
- package/dist/types/base-bubble-class.d.ts +7 -5
- package/dist/types/base-bubble-class.d.ts.map +1 -1
- package/dist/types/base-bubble-class.js +63 -40
- package/dist/types/base-bubble-class.js.map +1 -1
- package/dist/types/bubble.d.ts +3 -10
- package/dist/types/bubble.d.ts.map +1 -1
- package/dist/types/bubble.js +1 -1
- package/dist/types/bubble.js.map +1 -1
- package/dist/types/service-bubble-class.d.ts +2 -2
- 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 +2 -2
- package/dist/types/tool-bubble-class.d.ts.map +1 -1
- package/dist/types/tool-bubble-class.js +2 -4
- package/dist/types/tool-bubble-class.js.map +1 -1
- package/dist/types/workflow-bubble-class.d.ts +2 -2
- 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 +176 -28
- 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 +257 -35
- package/dist/utils/bubbleflow-validation.js.map +1 -1
- package/dist/utils/error-sanitizer.d.ts +12 -0
- package/dist/utils/error-sanitizer.d.ts.map +1 -0
- package/dist/utils/error-sanitizer.js +77 -0
- package/dist/utils/error-sanitizer.js.map +1 -0
- 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 +7 -6
- package/dist/bubble-trigger/index.d.ts +0 -2
- package/dist/bubble-trigger/index.d.ts.map +0 -1
- package/dist/bubble-trigger/index.js +0 -2
- package/dist/bubble-trigger/index.js.map +0 -1
- package/dist/bubble-trigger/types.d.ts +0 -87
- package/dist/bubble-trigger/types.d.ts.map +0 -1
- package/dist/bubble-trigger/types.js +0 -14
- package/dist/bubble-trigger/types.js.map +0 -1
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts +0 -370
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts.map +0 -1
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.js +0 -14
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.js.map +0 -1
- package/dist/bubbles/service-bubble/apify.d.ts +0 -136
- package/dist/bubbles/service-bubble/apify.d.ts.map +0 -1
- package/dist/bubbles/service-bubble/apify.js +0 -282
- package/dist/bubbles/service-bubble/apify.js.map +0 -1
- 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/workflow-bubble/bubbleflow-generator.workflow.d.ts +0 -114
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +0 -1
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +0 -782
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +0 -1
- package/dist/types/ai-models.d.ts +0 -4
- package/dist/types/ai-models.d.ts.map +0 -1
- package/dist/types/ai-models.js +0 -20
- package/dist/types/ai-models.js.map +0 -1
- package/dist/types/api-scraper.schema.d.ts +0 -453
- package/dist/types/api-scraper.schema.d.ts.map +0 -1
- package/dist/types/api-scraper.schema.js +0 -160
- package/dist/types/api-scraper.schema.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../../../src/bubbles/service-bubble/gmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../../../src/bubbles/service-bubble/gmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,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AM,GAAG,SAAS;CAYjD"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ServiceBubble } from '../../types/service-bubble-class.js';
|
|
3
3
|
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
4
|
+
// Essential headers that users typically care about
|
|
5
|
+
const ESSENTIAL_HEADERS = [
|
|
6
|
+
'Subject',
|
|
7
|
+
'From',
|
|
8
|
+
'To',
|
|
9
|
+
'Cc',
|
|
10
|
+
'Bcc',
|
|
11
|
+
'Date',
|
|
12
|
+
'Reply-To',
|
|
13
|
+
'Message-ID',
|
|
14
|
+
'In-Reply-To',
|
|
15
|
+
'References',
|
|
16
|
+
];
|
|
4
17
|
// Define email header schema
|
|
5
18
|
const EmailHeaderSchema = z
|
|
6
19
|
.object({
|
|
@@ -12,7 +25,10 @@ const EmailHeaderSchema = z
|
|
|
12
25
|
const GmailMessageSchema = z
|
|
13
26
|
.object({
|
|
14
27
|
id: z.string().describe('Unique message identifier'),
|
|
15
|
-
threadId: z
|
|
28
|
+
threadId: z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Thread identifier this message belongs to'),
|
|
16
32
|
labelIds: z
|
|
17
33
|
.array(z.string())
|
|
18
34
|
.optional()
|
|
@@ -21,6 +37,10 @@ const GmailMessageSchema = z
|
|
|
21
37
|
.string()
|
|
22
38
|
.optional()
|
|
23
39
|
.describe('Short snippet of the message text'),
|
|
40
|
+
textContent: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Clean, readable email text content'),
|
|
24
44
|
historyId: z
|
|
25
45
|
.string()
|
|
26
46
|
.optional()
|
|
@@ -43,7 +63,7 @@ const GmailMessageSchema = z
|
|
|
43
63
|
headers: z
|
|
44
64
|
.array(EmailHeaderSchema)
|
|
45
65
|
.optional()
|
|
46
|
-
.describe('
|
|
66
|
+
.describe('Essential email headers only (Subject, From, To, Cc, Bcc, Date, Reply-To, Message-ID, In-Reply-To, References)'),
|
|
47
67
|
body: z
|
|
48
68
|
.object({
|
|
49
69
|
data: z
|
|
@@ -89,6 +109,25 @@ const GmailThreadSchema = z
|
|
|
89
109
|
snippet: z.string().optional().describe('Thread snippet'),
|
|
90
110
|
})
|
|
91
111
|
.describe('Gmail thread object');
|
|
112
|
+
// Define label schema
|
|
113
|
+
const GmailLabelSchema = z
|
|
114
|
+
.object({
|
|
115
|
+
id: z.string().describe('Label ID'),
|
|
116
|
+
name: z.string().describe('Label name'),
|
|
117
|
+
type: z
|
|
118
|
+
.enum(['system', 'user'])
|
|
119
|
+
.optional()
|
|
120
|
+
.describe('Label type: system (built-in) or user (custom)'),
|
|
121
|
+
messageListVisibility: z
|
|
122
|
+
.enum(['show', 'hide'])
|
|
123
|
+
.optional()
|
|
124
|
+
.describe('Visibility in message list'),
|
|
125
|
+
labelListVisibility: z
|
|
126
|
+
.enum(['labelShow', 'labelShowIfUnread', 'labelHide'])
|
|
127
|
+
.optional()
|
|
128
|
+
.describe('Visibility in label list'),
|
|
129
|
+
})
|
|
130
|
+
.describe('Gmail label object');
|
|
92
131
|
// Define the parameters schema for Gmail operations
|
|
93
132
|
const GmailParamsSchema = z.discriminatedUnion('operation', [
|
|
94
133
|
// Send email operation
|
|
@@ -151,6 +190,10 @@ const GmailParamsSchema = z.discriminatedUnion('operation', [
|
|
|
151
190
|
.string()
|
|
152
191
|
.optional()
|
|
153
192
|
.describe('Token for pagination to get next page'),
|
|
193
|
+
include_details: z
|
|
194
|
+
.boolean()
|
|
195
|
+
.default(true)
|
|
196
|
+
.describe('Whether to fetch full message details including snippet, headers, and body'),
|
|
154
197
|
credentials: z
|
|
155
198
|
.record(z.nativeEnum(CredentialType), z.string())
|
|
156
199
|
.optional()
|
|
@@ -357,6 +400,88 @@ const GmailParamsSchema = z.discriminatedUnion('operation', [
|
|
|
357
400
|
.optional()
|
|
358
401
|
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
359
402
|
}),
|
|
403
|
+
// List labels operation
|
|
404
|
+
z.object({
|
|
405
|
+
operation: z.literal('list_labels').describe('List all labels in mailbox'),
|
|
406
|
+
credentials: z
|
|
407
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
408
|
+
.optional()
|
|
409
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
410
|
+
}),
|
|
411
|
+
// Create label operation
|
|
412
|
+
z.object({
|
|
413
|
+
operation: z.literal('create_label').describe('Create a new custom label'),
|
|
414
|
+
name: z
|
|
415
|
+
.string()
|
|
416
|
+
.min(1, 'Label name is required')
|
|
417
|
+
.describe('Label name (display name)'),
|
|
418
|
+
label_list_visibility: z
|
|
419
|
+
.enum(['labelShow', 'labelShowIfUnread', 'labelHide'])
|
|
420
|
+
.optional()
|
|
421
|
+
.default('labelShow')
|
|
422
|
+
.describe('Visibility in label list'),
|
|
423
|
+
message_list_visibility: z
|
|
424
|
+
.enum(['show', 'hide'])
|
|
425
|
+
.optional()
|
|
426
|
+
.default('show')
|
|
427
|
+
.describe('Visibility in message list'),
|
|
428
|
+
background_color: z
|
|
429
|
+
.string()
|
|
430
|
+
.optional()
|
|
431
|
+
.describe('Background color in hex format (e.g., #000000)'),
|
|
432
|
+
text_color: z
|
|
433
|
+
.string()
|
|
434
|
+
.optional()
|
|
435
|
+
.describe('Text color in hex format (e.g., #ffffff)'),
|
|
436
|
+
credentials: z
|
|
437
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
438
|
+
.optional()
|
|
439
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
440
|
+
}),
|
|
441
|
+
// Modify message labels operation
|
|
442
|
+
z.object({
|
|
443
|
+
operation: z
|
|
444
|
+
.literal('modify_message_labels')
|
|
445
|
+
.describe('Add or remove labels from a message'),
|
|
446
|
+
message_id: z
|
|
447
|
+
.string()
|
|
448
|
+
.min(1, 'Message ID is required')
|
|
449
|
+
.describe('Gmail message ID to modify'),
|
|
450
|
+
add_label_ids: z
|
|
451
|
+
.array(z.string())
|
|
452
|
+
.optional()
|
|
453
|
+
.describe('List of label IDs to add (max 100)'),
|
|
454
|
+
remove_label_ids: z
|
|
455
|
+
.array(z.string())
|
|
456
|
+
.optional()
|
|
457
|
+
.describe('List of label IDs to remove (max 100)'),
|
|
458
|
+
credentials: z
|
|
459
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
460
|
+
.optional()
|
|
461
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
462
|
+
}),
|
|
463
|
+
// Modify thread labels operation
|
|
464
|
+
z.object({
|
|
465
|
+
operation: z
|
|
466
|
+
.literal('modify_thread_labels')
|
|
467
|
+
.describe('Add or remove labels from all messages in a thread'),
|
|
468
|
+
thread_id: z
|
|
469
|
+
.string()
|
|
470
|
+
.min(1, 'Thread ID is required')
|
|
471
|
+
.describe('Gmail thread ID to modify'),
|
|
472
|
+
add_label_ids: z
|
|
473
|
+
.array(z.string())
|
|
474
|
+
.optional()
|
|
475
|
+
.describe('List of label IDs to add to all messages in thread (max 100)'),
|
|
476
|
+
remove_label_ids: z
|
|
477
|
+
.array(z.string())
|
|
478
|
+
.optional()
|
|
479
|
+
.describe('List of label IDs to remove from all messages in thread (max 100)'),
|
|
480
|
+
credentials: z
|
|
481
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
482
|
+
.optional()
|
|
483
|
+
.describe('Object mapping credential types to values (injected at runtime)'),
|
|
484
|
+
}),
|
|
360
485
|
]);
|
|
361
486
|
// Define result schemas for different operations
|
|
362
487
|
const GmailResultSchema = z.discriminatedUnion('operation', [
|
|
@@ -509,6 +634,47 @@ const GmailResultSchema = z.discriminatedUnion('operation', [
|
|
|
509
634
|
.describe('Estimated total number of results'),
|
|
510
635
|
error: z.string().describe('Error message if operation failed'),
|
|
511
636
|
}),
|
|
637
|
+
z.object({
|
|
638
|
+
operation: z.literal('list_labels').describe('List all labels in mailbox'),
|
|
639
|
+
success: z
|
|
640
|
+
.boolean()
|
|
641
|
+
.describe('Whether the label list was retrieved successfully'),
|
|
642
|
+
labels: z
|
|
643
|
+
.array(GmailLabelSchema)
|
|
644
|
+
.optional()
|
|
645
|
+
.describe('List of labels (both system and user labels)'),
|
|
646
|
+
error: z.string().describe('Error message if operation failed'),
|
|
647
|
+
}),
|
|
648
|
+
z.object({
|
|
649
|
+
operation: z.literal('create_label').describe('Create a new custom label'),
|
|
650
|
+
success: z.boolean().describe('Whether the label was created successfully'),
|
|
651
|
+
label: GmailLabelSchema.optional().describe('Created label details'),
|
|
652
|
+
error: z.string().describe('Error message if operation failed'),
|
|
653
|
+
}),
|
|
654
|
+
z.object({
|
|
655
|
+
operation: z
|
|
656
|
+
.literal('modify_message_labels')
|
|
657
|
+
.describe('Add or remove labels from a message'),
|
|
658
|
+
success: z
|
|
659
|
+
.boolean()
|
|
660
|
+
.describe('Whether the labels were modified successfully'),
|
|
661
|
+
message_id: z.string().optional().describe('Modified message ID'),
|
|
662
|
+
label_ids: z
|
|
663
|
+
.array(z.string())
|
|
664
|
+
.optional()
|
|
665
|
+
.describe('Current label IDs after modification'),
|
|
666
|
+
error: z.string().describe('Error message if operation failed'),
|
|
667
|
+
}),
|
|
668
|
+
z.object({
|
|
669
|
+
operation: z
|
|
670
|
+
.literal('modify_thread_labels')
|
|
671
|
+
.describe('Add or remove labels from all messages in a thread'),
|
|
672
|
+
success: z
|
|
673
|
+
.boolean()
|
|
674
|
+
.describe('Whether the thread labels were modified successfully'),
|
|
675
|
+
thread_id: z.string().optional().describe('Modified thread ID'),
|
|
676
|
+
error: z.string().describe('Error message if operation failed'),
|
|
677
|
+
}),
|
|
512
678
|
]);
|
|
513
679
|
export class GmailBubble extends ServiceBubble {
|
|
514
680
|
static type = 'service';
|
|
@@ -584,6 +750,148 @@ export class GmailBubble extends ServiceBubble {
|
|
|
584
750
|
return await response.text();
|
|
585
751
|
}
|
|
586
752
|
}
|
|
753
|
+
/**
|
|
754
|
+
* Extract clean, readable text content from a Gmail message
|
|
755
|
+
*/
|
|
756
|
+
extractEmailTextContent(message) {
|
|
757
|
+
if (!message.payload)
|
|
758
|
+
return '';
|
|
759
|
+
// Handle simple emails with direct body content
|
|
760
|
+
if (message.payload.body && message.payload.body.data) {
|
|
761
|
+
return this.decodeBase64(message.payload.body.data);
|
|
762
|
+
}
|
|
763
|
+
// Handle multipart emails - look for text/plain content
|
|
764
|
+
if (message.payload.parts) {
|
|
765
|
+
for (const part of message.payload.parts) {
|
|
766
|
+
if (part.mimeType === 'text/plain' && part.body && part.body.data) {
|
|
767
|
+
return this.decodeBase64(part.body.data);
|
|
768
|
+
}
|
|
769
|
+
// Handle nested multipart (e.g., multipart/alternative)
|
|
770
|
+
if (part.mimeType?.startsWith('multipart/') && part.parts) {
|
|
771
|
+
for (const subPart of part.parts) {
|
|
772
|
+
if (subPart.mimeType === 'text/plain' &&
|
|
773
|
+
subPart.body &&
|
|
774
|
+
subPart.body.data) {
|
|
775
|
+
return this.decodeBase64(subPart.body.data);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
return '';
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Decode base64url encoded content to UTF-8 string
|
|
785
|
+
*/
|
|
786
|
+
decodeBase64(base64String) {
|
|
787
|
+
try {
|
|
788
|
+
// Convert base64url to base64
|
|
789
|
+
const base64 = base64String.replace(/-/g, '+').replace(/_/g, '/');
|
|
790
|
+
return Buffer.from(base64, 'base64').toString('utf-8');
|
|
791
|
+
}
|
|
792
|
+
catch (error) {
|
|
793
|
+
console.warn('Failed to decode base64 content:', error);
|
|
794
|
+
return '';
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Clean up email content by removing forwarded/replied content and excessive whitespace
|
|
799
|
+
*/
|
|
800
|
+
cleanEmailContent(content) {
|
|
801
|
+
if (!content)
|
|
802
|
+
return '';
|
|
803
|
+
// Remove excessive whitespace and normalize line breaks
|
|
804
|
+
const cleaned = content
|
|
805
|
+
.replace(/\r\n/g, '\n')
|
|
806
|
+
.replace(/\r/g, '\n')
|
|
807
|
+
.replace(/\n{3,}/g, '\n\n')
|
|
808
|
+
.trim();
|
|
809
|
+
// Optional: Remove forwarded message indicators (uncomment if needed)
|
|
810
|
+
// cleaned = cleaned.replace(/^[\s\S]*?----- Forwarded message -----[\s\S]*$/gm, '');
|
|
811
|
+
return cleaned;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Clean up a body part by removing base64 data fields
|
|
815
|
+
*/
|
|
816
|
+
cleanBodyPart(part) {
|
|
817
|
+
if (!part)
|
|
818
|
+
return part;
|
|
819
|
+
const cleanedPart = { ...part };
|
|
820
|
+
// Remove base64 data from body
|
|
821
|
+
if (cleanedPart.body && cleanedPart.body.data) {
|
|
822
|
+
cleanedPart.body = {
|
|
823
|
+
...cleanedPart.body,
|
|
824
|
+
data: undefined,
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
// Recursively clean nested parts
|
|
828
|
+
if (cleanedPart.parts && Array.isArray(cleanedPart.parts)) {
|
|
829
|
+
cleanedPart.parts = cleanedPart.parts.map((subPart) => this.cleanBodyPart(subPart));
|
|
830
|
+
}
|
|
831
|
+
return cleanedPart;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Filter headers to only keep essential ones that users care about
|
|
835
|
+
*/
|
|
836
|
+
filterEssentialHeaders(headers) {
|
|
837
|
+
if (!headers || !Array.isArray(headers))
|
|
838
|
+
return [];
|
|
839
|
+
return headers.filter((header) => ESSENTIAL_HEADERS.includes(header.name));
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Clean up payload by removing base64 data fields to reduce response size
|
|
843
|
+
*/
|
|
844
|
+
cleanPayloadData(payload) {
|
|
845
|
+
if (!payload)
|
|
846
|
+
return payload;
|
|
847
|
+
const cleanedPayload = { ...payload };
|
|
848
|
+
// Filter headers to only essential ones
|
|
849
|
+
if (cleanedPayload.headers && Array.isArray(cleanedPayload.headers)) {
|
|
850
|
+
cleanedPayload.headers = this.filterEssentialHeaders(cleanedPayload.headers);
|
|
851
|
+
}
|
|
852
|
+
// Remove base64 data from main body
|
|
853
|
+
if (cleanedPayload.body && cleanedPayload.body.data) {
|
|
854
|
+
cleanedPayload.body = {
|
|
855
|
+
...cleanedPayload.body,
|
|
856
|
+
data: undefined,
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
// Clean up parts recursively
|
|
860
|
+
if (cleanedPayload.parts && Array.isArray(cleanedPayload.parts)) {
|
|
861
|
+
cleanedPayload.parts = cleanedPayload.parts.map((part) => this.cleanBodyPart(part));
|
|
862
|
+
}
|
|
863
|
+
return cleanedPayload;
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* Process and clean a Gmail message by extracting text content and removing heavy fields
|
|
867
|
+
*/
|
|
868
|
+
async processAndCleanMessage(messageIdOrMessage) {
|
|
869
|
+
try {
|
|
870
|
+
// If we only have an ID, fetch the full message
|
|
871
|
+
const fullMessage = typeof messageIdOrMessage === 'string'
|
|
872
|
+
? await this.makeGmailApiRequest(`/messages/${messageIdOrMessage}?format=full`)
|
|
873
|
+
: messageIdOrMessage;
|
|
874
|
+
// Extract clean text content
|
|
875
|
+
const rawTextContent = this.extractEmailTextContent(fullMessage);
|
|
876
|
+
const cleanTextContent = this.cleanEmailContent(rawTextContent);
|
|
877
|
+
// Clean up the payload by removing base64 data fields
|
|
878
|
+
const cleanedPayload = this.cleanPayloadData(fullMessage.payload);
|
|
879
|
+
// Return message with clean content and remove heavy fields
|
|
880
|
+
return {
|
|
881
|
+
...fullMessage,
|
|
882
|
+
textContent: cleanTextContent,
|
|
883
|
+
payload: cleanedPayload,
|
|
884
|
+
raw: undefined, // Remove the heavy raw field to reduce payload size
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
catch (error) {
|
|
888
|
+
// If processing fails, return the original message/ID
|
|
889
|
+
console.warn(`Failed to process message:`, error);
|
|
890
|
+
return typeof messageIdOrMessage === 'string'
|
|
891
|
+
? { id: messageIdOrMessage }
|
|
892
|
+
: messageIdOrMessage;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
587
895
|
async performAction(context) {
|
|
588
896
|
void context;
|
|
589
897
|
const { operation } = this.params;
|
|
@@ -614,6 +922,14 @@ export class GmailBubble extends ServiceBubble {
|
|
|
614
922
|
return await this.trashEmail(this.params);
|
|
615
923
|
case 'list_threads':
|
|
616
924
|
return await this.listThreads(this.params);
|
|
925
|
+
case 'list_labels':
|
|
926
|
+
return await this.listLabels(this.params);
|
|
927
|
+
case 'create_label':
|
|
928
|
+
return await this.createLabel(this.params);
|
|
929
|
+
case 'modify_message_labels':
|
|
930
|
+
return await this.modifyMessageLabels(this.params);
|
|
931
|
+
case 'modify_thread_labels':
|
|
932
|
+
return await this.modifyThreadLabels(this.params);
|
|
617
933
|
default:
|
|
618
934
|
throw new Error(`Unsupported operation: ${operation}`);
|
|
619
935
|
}
|
|
@@ -708,7 +1024,7 @@ export class GmailBubble extends ServiceBubble {
|
|
|
708
1024
|
};
|
|
709
1025
|
}
|
|
710
1026
|
async listEmails(params) {
|
|
711
|
-
const { query, label_ids, include_spam_trash, max_results, page_token } = params;
|
|
1027
|
+
const { query, label_ids, include_spam_trash, max_results, page_token, include_details, } = params;
|
|
712
1028
|
const queryParams = new URLSearchParams({
|
|
713
1029
|
maxResults: max_results.toString(),
|
|
714
1030
|
});
|
|
@@ -722,10 +1038,15 @@ export class GmailBubble extends ServiceBubble {
|
|
|
722
1038
|
if (page_token)
|
|
723
1039
|
queryParams.set('pageToken', page_token);
|
|
724
1040
|
const response = await this.makeGmailApiRequest(`/messages?${queryParams.toString()}`);
|
|
1041
|
+
let messages = response.messages || [];
|
|
1042
|
+
// If include_details is true, fetch full message details and extract clean content
|
|
1043
|
+
if (include_details && messages.length > 0) {
|
|
1044
|
+
messages = await Promise.all(messages.map((msg) => this.processAndCleanMessage(msg.id)));
|
|
1045
|
+
}
|
|
725
1046
|
return {
|
|
726
1047
|
operation: 'list_emails',
|
|
727
1048
|
success: true,
|
|
728
|
-
messages
|
|
1049
|
+
messages,
|
|
729
1050
|
next_page_token: response.nextPageToken,
|
|
730
1051
|
result_size_estimate: response.resultSizeEstimate,
|
|
731
1052
|
error: '',
|
|
@@ -740,10 +1061,14 @@ export class GmailBubble extends ServiceBubble {
|
|
|
740
1061
|
metadata_headers.forEach((header) => queryParams.append('metadataHeaders', header));
|
|
741
1062
|
}
|
|
742
1063
|
const response = await this.makeGmailApiRequest(`/messages/${message_id}?${queryParams.toString()}`);
|
|
1064
|
+
// Clean up the message by removing heavy fields and adding clean text content
|
|
1065
|
+
const cleanedMessage = format === 'full' || format === 'raw'
|
|
1066
|
+
? await this.processAndCleanMessage(response)
|
|
1067
|
+
: response;
|
|
743
1068
|
return {
|
|
744
1069
|
operation: 'get_email',
|
|
745
1070
|
success: true,
|
|
746
|
-
message:
|
|
1071
|
+
message: cleanedMessage,
|
|
747
1072
|
error: '',
|
|
748
1073
|
};
|
|
749
1074
|
}
|
|
@@ -756,10 +1081,16 @@ export class GmailBubble extends ServiceBubble {
|
|
|
756
1081
|
if (include_spam_trash)
|
|
757
1082
|
queryParams.set('includeSpamTrash', 'true');
|
|
758
1083
|
const response = await this.makeGmailApiRequest(`/messages?${queryParams.toString()}`);
|
|
1084
|
+
let messages = response.messages || [];
|
|
1085
|
+
// Since search_emails returns the same basic structure as list_emails,
|
|
1086
|
+
// we should apply the same cleaning logic for consistency
|
|
1087
|
+
if (messages.length > 0) {
|
|
1088
|
+
messages = await Promise.all(messages.map((msg) => this.processAndCleanMessage(msg.id)));
|
|
1089
|
+
}
|
|
759
1090
|
return {
|
|
760
1091
|
operation: 'search_emails',
|
|
761
1092
|
success: true,
|
|
762
|
-
messages
|
|
1093
|
+
messages,
|
|
763
1094
|
result_size_estimate: response.resultSizeEstimate,
|
|
764
1095
|
error: '',
|
|
765
1096
|
};
|
|
@@ -843,10 +1174,24 @@ export class GmailBubble extends ServiceBubble {
|
|
|
843
1174
|
if (page_token)
|
|
844
1175
|
queryParams.set('pageToken', page_token);
|
|
845
1176
|
const response = await this.makeGmailApiRequest(`/drafts?${queryParams.toString()}`);
|
|
1177
|
+
let drafts = response.drafts || [];
|
|
1178
|
+
// Clean up draft messages to remove heavy fields
|
|
1179
|
+
if (drafts.length > 0) {
|
|
1180
|
+
drafts = await Promise.all(drafts.map(async (draft) => {
|
|
1181
|
+
if (draft.message) {
|
|
1182
|
+
const cleanedMessage = await this.processAndCleanMessage(draft.message);
|
|
1183
|
+
return {
|
|
1184
|
+
...draft,
|
|
1185
|
+
message: cleanedMessage,
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
return draft;
|
|
1189
|
+
}));
|
|
1190
|
+
}
|
|
846
1191
|
return {
|
|
847
1192
|
operation: 'list_drafts',
|
|
848
1193
|
success: true,
|
|
849
|
-
drafts
|
|
1194
|
+
drafts,
|
|
850
1195
|
next_page_token: response.nextPageToken,
|
|
851
1196
|
result_size_estimate: response.resultSizeEstimate,
|
|
852
1197
|
error: '',
|
|
@@ -896,6 +1241,89 @@ export class GmailBubble extends ServiceBubble {
|
|
|
896
1241
|
error: '',
|
|
897
1242
|
};
|
|
898
1243
|
}
|
|
1244
|
+
async listLabels(params) {
|
|
1245
|
+
void params;
|
|
1246
|
+
const response = await this.makeGmailApiRequest('/labels');
|
|
1247
|
+
return {
|
|
1248
|
+
operation: 'list_labels',
|
|
1249
|
+
success: true,
|
|
1250
|
+
labels: response.labels || [],
|
|
1251
|
+
error: '',
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
async createLabel(params) {
|
|
1255
|
+
const { name, label_list_visibility, message_list_visibility, background_color, text_color, } = params;
|
|
1256
|
+
const requestBody = {
|
|
1257
|
+
name,
|
|
1258
|
+
};
|
|
1259
|
+
if (label_list_visibility) {
|
|
1260
|
+
requestBody.labelListVisibility = label_list_visibility;
|
|
1261
|
+
}
|
|
1262
|
+
if (message_list_visibility) {
|
|
1263
|
+
requestBody.messageListVisibility = message_list_visibility;
|
|
1264
|
+
}
|
|
1265
|
+
if (background_color || text_color) {
|
|
1266
|
+
requestBody.color = {};
|
|
1267
|
+
if (background_color) {
|
|
1268
|
+
requestBody.color.backgroundColor = background_color;
|
|
1269
|
+
}
|
|
1270
|
+
if (text_color) {
|
|
1271
|
+
requestBody.color.textColor = text_color;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
const response = await this.makeGmailApiRequest('/labels', 'POST', requestBody);
|
|
1275
|
+
return {
|
|
1276
|
+
operation: 'create_label',
|
|
1277
|
+
success: true,
|
|
1278
|
+
label: response,
|
|
1279
|
+
error: '',
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
async modifyMessageLabels(params) {
|
|
1283
|
+
const { message_id, add_label_ids, remove_label_ids } = params;
|
|
1284
|
+
// Validate that at least one operation is specified
|
|
1285
|
+
if ((!add_label_ids || add_label_ids.length === 0) &&
|
|
1286
|
+
(!remove_label_ids || remove_label_ids.length === 0)) {
|
|
1287
|
+
throw new Error('At least one of add_label_ids or remove_label_ids must be provided');
|
|
1288
|
+
}
|
|
1289
|
+
const requestBody = {};
|
|
1290
|
+
if (add_label_ids && add_label_ids.length > 0) {
|
|
1291
|
+
requestBody.addLabelIds = add_label_ids;
|
|
1292
|
+
}
|
|
1293
|
+
if (remove_label_ids && remove_label_ids.length > 0) {
|
|
1294
|
+
requestBody.removeLabelIds = remove_label_ids;
|
|
1295
|
+
}
|
|
1296
|
+
const response = await this.makeGmailApiRequest(`/messages/${message_id}/modify`, 'POST', requestBody);
|
|
1297
|
+
return {
|
|
1298
|
+
operation: 'modify_message_labels',
|
|
1299
|
+
success: true,
|
|
1300
|
+
message_id: response.id,
|
|
1301
|
+
label_ids: response.labelIds || [],
|
|
1302
|
+
error: '',
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
async modifyThreadLabels(params) {
|
|
1306
|
+
const { thread_id, add_label_ids, remove_label_ids } = params;
|
|
1307
|
+
// Validate that at least one operation is specified
|
|
1308
|
+
if ((!add_label_ids || add_label_ids.length === 0) &&
|
|
1309
|
+
(!remove_label_ids || remove_label_ids.length === 0)) {
|
|
1310
|
+
throw new Error('At least one of add_label_ids or remove_label_ids must be provided');
|
|
1311
|
+
}
|
|
1312
|
+
const requestBody = {};
|
|
1313
|
+
if (add_label_ids && add_label_ids.length > 0) {
|
|
1314
|
+
requestBody.addLabelIds = add_label_ids;
|
|
1315
|
+
}
|
|
1316
|
+
if (remove_label_ids && remove_label_ids.length > 0) {
|
|
1317
|
+
requestBody.removeLabelIds = remove_label_ids;
|
|
1318
|
+
}
|
|
1319
|
+
const response = await this.makeGmailApiRequest(`/threads/${thread_id}/modify`, 'POST', requestBody);
|
|
1320
|
+
return {
|
|
1321
|
+
operation: 'modify_thread_labels',
|
|
1322
|
+
success: true,
|
|
1323
|
+
thread_id: response.id,
|
|
1324
|
+
error: '',
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
899
1327
|
chooseCredential() {
|
|
900
1328
|
const { credentials } = this.params;
|
|
901
1329
|
if (!credentials || typeof credentials !== 'object') {
|