@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.
Files changed (355) hide show
  1. package/dist/bubble-bundle.d.ts +633 -1658
  2. package/dist/bubble-factory.d.ts.map +1 -1
  3. package/dist/bubble-factory.js +165 -43
  4. package/dist/bubble-factory.js.map +1 -1
  5. package/dist/bubble-flow/bubble-flow-class.d.ts +22 -1
  6. package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -1
  7. package/dist/bubble-flow/bubble-flow-class.js +36 -0
  8. package/dist/bubble-flow/bubble-flow-class.js.map +1 -1
  9. package/dist/bubble-flow/sample/data-analyst-flow.d.ts +1 -1
  10. package/dist/bubble-flow/sample/data-analyst-flow.d.ts.map +1 -1
  11. package/dist/bubble-flow/sample/error-ts.d.ts +1 -1
  12. package/dist/bubble-flow/sample/error-ts.d.ts.map +1 -1
  13. package/dist/bubble-flow/sample/sanitytest.d.ts +1 -1
  14. package/dist/bubble-flow/sample/sanitytest.d.ts.map +1 -1
  15. package/dist/bubble-flow/sample/simple-webhook-2.d.ts +1 -1
  16. package/dist/bubble-flow/sample/simple-webhook-2.d.ts.map +1 -1
  17. package/dist/bubble-flow/sample/simple-webhook.d.ts +1 -1
  18. package/dist/bubble-flow/sample/simple-webhook.d.ts.map +1 -1
  19. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts +1 -1
  20. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -1
  21. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js +6 -3
  22. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js.map +1 -1
  23. package/dist/bubble-flow/sample/slack-v0.1.d.ts +1 -1
  24. package/dist/bubble-flow/sample/slack-v0.1.d.ts.map +1 -1
  25. package/dist/bubble-flow/sample/slackagenttest.d.ts +1 -1
  26. package/dist/bubble-flow/sample/slackagenttest.d.ts.map +1 -1
  27. package/dist/bubbles/service-bubble/agi-inc.d.ts +1121 -0
  28. package/dist/bubbles/service-bubble/agi-inc.d.ts.map +1 -0
  29. package/dist/bubbles/service-bubble/agi-inc.js +730 -0
  30. package/dist/bubbles/service-bubble/agi-inc.js.map +1 -0
  31. package/dist/bubbles/service-bubble/ai-agent.d.ts +297 -85
  32. package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
  33. package/dist/bubbles/service-bubble/ai-agent.js +535 -399
  34. package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
  35. package/dist/bubbles/service-bubble/airtable.d.ts +1753 -0
  36. package/dist/bubbles/service-bubble/airtable.d.ts.map +1 -0
  37. package/dist/bubbles/service-bubble/airtable.js +1173 -0
  38. package/dist/bubbles/service-bubble/airtable.js.map +1 -0
  39. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts +240 -0
  40. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts.map +1 -0
  41. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js +119 -0
  42. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js.map +1 -0
  43. package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +38 -38
  44. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +56 -56
  45. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts +137 -0
  46. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts.map +1 -0
  47. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js +81 -0
  48. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js.map +1 -0
  49. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +27 -27
  50. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +38 -38
  51. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts +488 -0
  52. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts.map +1 -0
  53. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js +463 -0
  54. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js.map +1 -0
  55. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts +262 -0
  56. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts.map +1 -0
  57. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js +291 -0
  58. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js.map +1 -0
  59. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +184 -0
  60. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts.map +1 -0
  61. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js +145 -0
  62. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js.map +1 -0
  63. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts +52 -0
  64. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts.map +1 -0
  65. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js +29 -0
  66. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js.map +1 -0
  67. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +1483 -123
  68. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts.map +1 -1
  69. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js +48 -0
  70. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js.map +1 -1
  71. package/dist/bubbles/service-bubble/apify/apify.d.ts +156 -11
  72. package/dist/bubbles/service-bubble/apify/apify.d.ts.map +1 -1
  73. package/dist/bubbles/service-bubble/apify/apify.js +205 -32
  74. package/dist/bubbles/service-bubble/apify/apify.js.map +1 -1
  75. package/dist/bubbles/service-bubble/apify/index.d.ts +2 -0
  76. package/dist/bubbles/service-bubble/apify/index.d.ts.map +1 -1
  77. package/dist/bubbles/service-bubble/apify/index.js +3 -0
  78. package/dist/bubbles/service-bubble/apify/index.js.map +1 -1
  79. package/dist/bubbles/service-bubble/apify/types.js +1 -2
  80. package/dist/bubbles/service-bubble/apify/types.js.map +1 -1
  81. package/dist/bubbles/service-bubble/eleven-labs.d.ts +421 -0
  82. package/dist/bubbles/service-bubble/eleven-labs.d.ts.map +1 -0
  83. package/dist/bubbles/service-bubble/eleven-labs.js +479 -0
  84. package/dist/bubbles/service-bubble/eleven-labs.js.map +1 -0
  85. package/dist/bubbles/service-bubble/firecrawl.d.ts +37748 -0
  86. package/dist/bubbles/service-bubble/firecrawl.d.ts.map +1 -0
  87. package/dist/bubbles/service-bubble/firecrawl.js +1489 -0
  88. package/dist/bubbles/service-bubble/firecrawl.js.map +1 -0
  89. package/dist/bubbles/service-bubble/followupboss.d.ts +6822 -0
  90. package/dist/bubbles/service-bubble/followupboss.d.ts.map +1 -0
  91. package/dist/bubbles/service-bubble/followupboss.js +1394 -0
  92. package/dist/bubbles/service-bubble/followupboss.js.map +1 -0
  93. package/dist/bubbles/service-bubble/github.d.ts +2399 -0
  94. package/dist/bubbles/service-bubble/github.d.ts.map +1 -0
  95. package/dist/bubbles/service-bubble/github.js +1052 -0
  96. package/dist/bubbles/service-bubble/github.js.map +1 -0
  97. package/dist/bubbles/service-bubble/gmail.d.ts +726 -232
  98. package/dist/bubbles/service-bubble/gmail.d.ts.map +1 -1
  99. package/dist/bubbles/service-bubble/gmail.js +435 -7
  100. package/dist/bubbles/service-bubble/gmail.js.map +1 -1
  101. package/dist/bubbles/service-bubble/google-calendar.d.ts +8 -8
  102. package/dist/bubbles/service-bubble/google-drive.d.ts +270 -40
  103. package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -1
  104. package/dist/bubbles/service-bubble/google-drive.js +100 -78
  105. package/dist/bubbles/service-bubble/google-drive.js.map +1 -1
  106. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +943 -0
  107. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts.map +1 -0
  108. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts +31 -0
  109. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts.map +1 -0
  110. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js +184 -0
  111. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js.map +1 -0
  112. package/dist/bubbles/service-bubble/google-sheets/google-sheets.js +401 -0
  113. package/dist/bubbles/service-bubble/google-sheets/google-sheets.js.map +1 -0
  114. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts +1024 -0
  115. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts.map +1 -0
  116. package/dist/bubbles/service-bubble/{google-sheets.js → google-sheets/google-sheets.schema.js} +45 -409
  117. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.js.map +1 -0
  118. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts +38 -0
  119. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts.map +1 -0
  120. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js +183 -0
  121. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js.map +1 -0
  122. package/dist/bubbles/service-bubble/google-sheets/index.d.ts +4 -0
  123. package/dist/bubbles/service-bubble/google-sheets/index.d.ts.map +1 -0
  124. package/dist/bubbles/service-bubble/google-sheets/index.js +4 -0
  125. package/dist/bubbles/service-bubble/google-sheets/index.js.map +1 -0
  126. package/dist/bubbles/service-bubble/hello-world.js +2 -2
  127. package/dist/bubbles/service-bubble/hello-world.js.map +1 -1
  128. package/dist/bubbles/service-bubble/http.d.ts +6 -6
  129. package/dist/bubbles/service-bubble/http.d.ts.map +1 -1
  130. package/dist/bubbles/service-bubble/http.js +7 -1
  131. package/dist/bubbles/service-bubble/http.js.map +1 -1
  132. package/dist/bubbles/service-bubble/insforge-db.d.ts +140 -0
  133. package/dist/bubbles/service-bubble/insforge-db.d.ts.map +1 -0
  134. package/dist/bubbles/service-bubble/insforge-db.js +260 -0
  135. package/dist/bubbles/service-bubble/insforge-db.js.map +1 -0
  136. package/dist/bubbles/service-bubble/notion/index.d.ts +3 -0
  137. package/dist/bubbles/service-bubble/notion/index.d.ts.map +1 -0
  138. package/dist/bubbles/service-bubble/notion/index.js +3 -0
  139. package/dist/bubbles/service-bubble/notion/index.js.map +1 -0
  140. package/dist/bubbles/service-bubble/notion/notion.d.ts +35405 -0
  141. package/dist/bubbles/service-bubble/notion/notion.d.ts.map +1 -0
  142. package/dist/bubbles/service-bubble/notion/notion.js +1492 -0
  143. package/dist/bubbles/service-bubble/notion/notion.js.map +1 -0
  144. package/dist/bubbles/service-bubble/notion/property-schemas.d.ts +1148 -0
  145. package/dist/bubbles/service-bubble/notion/property-schemas.d.ts.map +1 -0
  146. package/dist/bubbles/service-bubble/notion/property-schemas.js +341 -0
  147. package/dist/bubbles/service-bubble/notion/property-schemas.js.map +1 -0
  148. package/dist/bubbles/service-bubble/postgresql.d.ts +8 -8
  149. package/dist/bubbles/service-bubble/resend.d.ts +30 -9
  150. package/dist/bubbles/service-bubble/resend.d.ts.map +1 -1
  151. package/dist/bubbles/service-bubble/resend.js +133 -2
  152. package/dist/bubbles/service-bubble/resend.js.map +1 -1
  153. package/dist/bubbles/service-bubble/slack.d.ts +525 -525
  154. package/dist/bubbles/service-bubble/slack.d.ts.map +1 -1
  155. package/dist/bubbles/service-bubble/slack.js +2 -2
  156. package/dist/bubbles/service-bubble/slack.js.map +1 -1
  157. package/dist/bubbles/service-bubble/storage.d.ts +21 -17
  158. package/dist/bubbles/service-bubble/storage.d.ts.map +1 -1
  159. package/dist/bubbles/service-bubble/storage.js +59 -7
  160. package/dist/bubbles/service-bubble/storage.js.map +1 -1
  161. package/dist/bubbles/service-bubble/telegram.d.ts +7742 -0
  162. package/dist/bubbles/service-bubble/telegram.d.ts.map +1 -0
  163. package/dist/bubbles/service-bubble/telegram.js +1132 -0
  164. package/dist/bubbles/service-bubble/telegram.js.map +1 -0
  165. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +60 -4
  166. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts.map +1 -1
  167. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js +12 -0
  168. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js.map +1 -1
  169. package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +4 -4
  170. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +188 -0
  171. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts.map +1 -0
  172. package/dist/bubbles/tool-bubble/code-edit-tool.js +321 -0
  173. package/dist/bubbles/tool-bubble/code-edit-tool.js.map +1 -0
  174. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +8 -4
  175. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -1
  176. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +132 -19
  177. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -1
  178. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +455 -0
  179. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts.map +1 -0
  180. package/dist/bubbles/tool-bubble/google-maps-tool.js +205 -0
  181. package/dist/bubbles/tool-bubble/google-maps-tool.js.map +1 -0
  182. package/dist/bubbles/tool-bubble/instagram-tool.d.ts +90 -90
  183. package/dist/bubbles/tool-bubble/instagram-tool.d.ts.map +1 -1
  184. package/dist/bubbles/tool-bubble/instagram-tool.js +2 -2
  185. package/dist/bubbles/tool-bubble/instagram-tool.js.map +1 -1
  186. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +808 -431
  187. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts.map +1 -1
  188. package/dist/bubbles/tool-bubble/linkedin-tool.js +232 -12
  189. package/dist/bubbles/tool-bubble/linkedin-tool.js.map +1 -1
  190. package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
  191. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +21 -16
  192. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts.map +1 -1
  193. package/dist/bubbles/tool-bubble/reddit-scrape-tool.js +97 -22
  194. package/dist/bubbles/tool-bubble/reddit-scrape-tool.js.map +1 -1
  195. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +17 -16
  196. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts.map +1 -1
  197. package/dist/bubbles/tool-bubble/research-agent-tool.js +27 -17
  198. package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -1
  199. package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +4 -4
  200. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +485 -0
  201. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts.map +1 -0
  202. package/dist/bubbles/tool-bubble/tiktok-tool.js +226 -0
  203. package/dist/bubbles/tool-bubble/tiktok-tool.js.map +1 -0
  204. package/dist/bubbles/tool-bubble/twitter-tool.d.ts +947 -0
  205. package/dist/bubbles/tool-bubble/twitter-tool.d.ts.map +1 -0
  206. package/dist/bubbles/tool-bubble/twitter-tool.js +494 -0
  207. package/dist/bubbles/tool-bubble/twitter-tool.js.map +1 -0
  208. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +32 -26
  209. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts.map +1 -1
  210. package/dist/bubbles/tool-bubble/web-crawl-tool.js +58 -59
  211. package/dist/bubbles/tool-bubble/web-crawl-tool.js.map +1 -1
  212. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +4 -4
  213. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts.map +1 -1
  214. package/dist/bubbles/tool-bubble/web-extract-tool.js +17 -17
  215. package/dist/bubbles/tool-bubble/web-extract-tool.js.map +1 -1
  216. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +23 -115
  217. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -1
  218. package/dist/bubbles/tool-bubble/web-scrape-tool.js +51 -72
  219. package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -1
  220. package/dist/bubbles/tool-bubble/web-search-tool.d.ts +18 -6
  221. package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -1
  222. package/dist/bubbles/tool-bubble/web-search-tool.js +46 -32
  223. package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -1
  224. package/dist/bubbles/tool-bubble/youtube-tool.d.ts +394 -0
  225. package/dist/bubbles/tool-bubble/youtube-tool.d.ts.map +1 -0
  226. package/dist/bubbles/tool-bubble/youtube-tool.js +352 -0
  227. package/dist/bubbles/tool-bubble/youtube-tool.js.map +1 -0
  228. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +78 -78
  229. package/dist/bubbles/workflow-bubble/generate-document.workflow.js +1 -1
  230. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +62 -62
  231. package/dist/bubbles/workflow-bubble/parse-document.workflow.js +1 -1
  232. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +80 -80
  233. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -1
  234. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +4 -4
  235. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -1
  236. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +52 -52
  237. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts.map +1 -1
  238. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +2 -2
  239. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js.map +1 -1
  240. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +32 -32
  241. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts.map +1 -1
  242. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +6 -6
  243. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -1
  244. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +46 -46
  245. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts.map +1 -1
  246. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +24 -4
  247. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -1
  248. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +27 -27
  249. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -1
  250. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +8 -8
  251. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -1
  252. package/dist/bubbles.json +251 -88
  253. package/dist/index.d.ts +27 -6
  254. package/dist/index.d.ts.map +1 -1
  255. package/dist/index.js +18 -4
  256. package/dist/index.js.map +1 -1
  257. package/dist/logging/BubbleLogger.d.ts +45 -16
  258. package/dist/logging/BubbleLogger.d.ts.map +1 -1
  259. package/dist/logging/BubbleLogger.js +197 -89
  260. package/dist/logging/BubbleLogger.js.map +1 -1
  261. package/dist/logging/StreamingBubbleLogger.d.ts +13 -1
  262. package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -1
  263. package/dist/logging/StreamingBubbleLogger.js +56 -13
  264. package/dist/logging/StreamingBubbleLogger.js.map +1 -1
  265. package/dist/logging/WebhookStreamLogger.d.ts +66 -0
  266. package/dist/logging/WebhookStreamLogger.d.ts.map +1 -0
  267. package/dist/logging/WebhookStreamLogger.js +291 -0
  268. package/dist/logging/WebhookStreamLogger.js.map +1 -0
  269. package/dist/types/available-tools.d.ts +1 -1
  270. package/dist/types/available-tools.d.ts.map +1 -1
  271. package/dist/types/available-tools.js +1 -0
  272. package/dist/types/available-tools.js.map +1 -1
  273. package/dist/types/base-bubble-class.d.ts +7 -5
  274. package/dist/types/base-bubble-class.d.ts.map +1 -1
  275. package/dist/types/base-bubble-class.js +63 -40
  276. package/dist/types/base-bubble-class.js.map +1 -1
  277. package/dist/types/bubble.d.ts +3 -10
  278. package/dist/types/bubble.d.ts.map +1 -1
  279. package/dist/types/bubble.js +1 -1
  280. package/dist/types/bubble.js.map +1 -1
  281. package/dist/types/service-bubble-class.d.ts +2 -2
  282. package/dist/types/service-bubble-class.d.ts.map +1 -1
  283. package/dist/types/service-bubble-class.js +2 -2
  284. package/dist/types/service-bubble-class.js.map +1 -1
  285. package/dist/types/tool-bubble-class.d.ts +2 -2
  286. package/dist/types/tool-bubble-class.d.ts.map +1 -1
  287. package/dist/types/tool-bubble-class.js +2 -4
  288. package/dist/types/tool-bubble-class.js.map +1 -1
  289. package/dist/types/workflow-bubble-class.d.ts +2 -2
  290. package/dist/types/workflow-bubble-class.d.ts.map +1 -1
  291. package/dist/types/workflow-bubble-class.js +2 -2
  292. package/dist/types/workflow-bubble-class.js.map +1 -1
  293. package/dist/utils/agent-formatter.d.ts +14 -2
  294. package/dist/utils/agent-formatter.d.ts.map +1 -1
  295. package/dist/utils/agent-formatter.js +176 -28
  296. package/dist/utils/agent-formatter.js.map +1 -1
  297. package/dist/utils/bubbleflow-validation.d.ts +7 -0
  298. package/dist/utils/bubbleflow-validation.d.ts.map +1 -1
  299. package/dist/utils/bubbleflow-validation.js +257 -35
  300. package/dist/utils/bubbleflow-validation.js.map +1 -1
  301. package/dist/utils/error-sanitizer.d.ts +12 -0
  302. package/dist/utils/error-sanitizer.d.ts.map +1 -0
  303. package/dist/utils/error-sanitizer.js +77 -0
  304. package/dist/utils/error-sanitizer.js.map +1 -0
  305. package/dist/utils/json-parsing.d.ts.map +1 -1
  306. package/dist/utils/json-parsing.js +146 -0
  307. package/dist/utils/json-parsing.js.map +1 -1
  308. package/dist/utils/safe-gemini-chat.d.ts +31 -0
  309. package/dist/utils/safe-gemini-chat.d.ts.map +1 -0
  310. package/dist/utils/safe-gemini-chat.js +93 -0
  311. package/dist/utils/safe-gemini-chat.js.map +1 -0
  312. package/dist/utils/schema-comparison.d.ts +92 -0
  313. package/dist/utils/schema-comparison.d.ts.map +1 -0
  314. package/dist/utils/schema-comparison.js +716 -0
  315. package/dist/utils/schema-comparison.js.map +1 -0
  316. package/dist/utils/zod-schema.d.ts +24 -0
  317. package/dist/utils/zod-schema.d.ts.map +1 -0
  318. package/dist/utils/zod-schema.js +56 -0
  319. package/dist/utils/zod-schema.js.map +1 -0
  320. package/package.json +7 -6
  321. package/dist/bubble-trigger/index.d.ts +0 -2
  322. package/dist/bubble-trigger/index.d.ts.map +0 -1
  323. package/dist/bubble-trigger/index.js +0 -2
  324. package/dist/bubble-trigger/index.js.map +0 -1
  325. package/dist/bubble-trigger/types.d.ts +0 -87
  326. package/dist/bubble-trigger/types.d.ts.map +0 -1
  327. package/dist/bubble-trigger/types.js +0 -14
  328. package/dist/bubble-trigger/types.js.map +0 -1
  329. package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts +0 -370
  330. package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts.map +0 -1
  331. package/dist/bubbles/service-bubble/apify/api-scraper.schema.js +0 -14
  332. package/dist/bubbles/service-bubble/apify/api-scraper.schema.js.map +0 -1
  333. package/dist/bubbles/service-bubble/apify.d.ts +0 -136
  334. package/dist/bubbles/service-bubble/apify.d.ts.map +0 -1
  335. package/dist/bubbles/service-bubble/apify.js +0 -282
  336. package/dist/bubbles/service-bubble/apify.js.map +0 -1
  337. package/dist/bubbles/service-bubble/google-sheets.d.ts +0 -1811
  338. package/dist/bubbles/service-bubble/google-sheets.d.ts.map +0 -1
  339. package/dist/bubbles/service-bubble/google-sheets.js.map +0 -1
  340. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +0 -114
  341. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +0 -1
  342. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +0 -782
  343. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +0 -1
  344. package/dist/types/ai-models.d.ts +0 -4
  345. package/dist/types/ai-models.d.ts.map +0 -1
  346. package/dist/types/ai-models.js +0 -20
  347. package/dist/types/ai-models.js.map +0 -1
  348. package/dist/types/api-scraper.schema.d.ts +0 -453
  349. package/dist/types/api-scraper.schema.d.ts.map +0 -1
  350. package/dist/types/api-scraper.schema.js +0 -160
  351. package/dist/types/api-scraper.schema.js.map +0 -1
  352. package/dist/utils/param-helper.d.ts +0 -2
  353. package/dist/utils/param-helper.d.ts.map +0 -1
  354. package/dist/utils/param-helper.js +0 -5
  355. 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