@bubblelab/bubble-core 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/dist/bubble-bundle.d.ts +803 -351
  2. package/dist/bubble-factory.d.ts.map +1 -1
  3. package/dist/bubble-factory.js +130 -35
  4. package/dist/bubble-factory.js.map +1 -1
  5. package/dist/bubble-flow/bubble-flow-class.d.ts +5 -0
  6. package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -1
  7. package/dist/bubble-flow/bubble-flow-class.js +20 -0
  8. package/dist/bubble-flow/bubble-flow-class.js.map +1 -1
  9. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -1
  10. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js +6 -3
  11. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js.map +1 -1
  12. package/dist/bubbles/service-bubble/agi-inc.d.ts +1121 -0
  13. package/dist/bubbles/service-bubble/agi-inc.d.ts.map +1 -0
  14. package/dist/bubbles/service-bubble/agi-inc.js +730 -0
  15. package/dist/bubbles/service-bubble/agi-inc.js.map +1 -0
  16. package/dist/bubbles/service-bubble/ai-agent.d.ts +273 -61
  17. package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
  18. package/dist/bubbles/service-bubble/ai-agent.js +536 -405
  19. package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
  20. package/dist/bubbles/service-bubble/airtable.d.ts +1753 -0
  21. package/dist/bubbles/service-bubble/airtable.d.ts.map +1 -0
  22. package/dist/bubbles/service-bubble/airtable.js +1173 -0
  23. package/dist/bubbles/service-bubble/airtable.js.map +1 -0
  24. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts +240 -0
  25. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts.map +1 -0
  26. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js +119 -0
  27. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js.map +1 -0
  28. package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +4 -4
  29. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +14 -14
  30. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts +137 -0
  31. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts.map +1 -0
  32. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js +81 -0
  33. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js.map +1 -0
  34. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +6 -6
  35. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +32 -32
  36. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts +488 -0
  37. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts.map +1 -0
  38. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js +463 -0
  39. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js.map +1 -0
  40. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts +262 -0
  41. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts.map +1 -0
  42. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js +291 -0
  43. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js.map +1 -0
  44. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +12 -12
  45. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +1301 -170
  46. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts.map +1 -1
  47. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js +32 -0
  48. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js.map +1 -1
  49. package/dist/bubbles/service-bubble/apify/apify.d.ts +158 -13
  50. package/dist/bubbles/service-bubble/apify/apify.d.ts.map +1 -1
  51. package/dist/bubbles/service-bubble/apify/apify.js +222 -37
  52. package/dist/bubbles/service-bubble/apify/apify.js.map +1 -1
  53. package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts +542 -0
  54. package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts.map +1 -0
  55. package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.d.ts +37 -0
  56. package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.d.ts.map +1 -0
  57. package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.js +203 -0
  58. package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.js.map +1 -0
  59. package/dist/bubbles/service-bubble/browserbase/browserbase.js +593 -0
  60. package/dist/bubbles/service-bubble/browserbase/browserbase.js.map +1 -0
  61. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts +518 -0
  62. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts.map +1 -0
  63. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.js +311 -0
  64. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.js.map +1 -0
  65. package/dist/bubbles/service-bubble/browserbase/index.d.ts +3 -0
  66. package/dist/bubbles/service-bubble/browserbase/index.d.ts.map +1 -0
  67. package/dist/bubbles/service-bubble/browserbase/index.js +3 -0
  68. package/dist/bubbles/service-bubble/browserbase/index.js.map +1 -0
  69. package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts +1358 -0
  70. package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts.map +1 -0
  71. package/dist/bubbles/service-bubble/crustdata/crustdata.js +219 -0
  72. package/dist/bubbles/service-bubble/crustdata/crustdata.js.map +1 -0
  73. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.d.ts +1604 -0
  74. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.d.ts.map +1 -0
  75. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.js +194 -0
  76. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.js.map +1 -0
  77. package/dist/bubbles/service-bubble/crustdata/index.d.ts +3 -0
  78. package/dist/bubbles/service-bubble/crustdata/index.d.ts.map +1 -0
  79. package/dist/bubbles/service-bubble/crustdata/index.js +3 -0
  80. package/dist/bubbles/service-bubble/crustdata/index.js.map +1 -0
  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 +2393 -0
  94. package/dist/bubbles/service-bubble/github.d.ts.map +1 -0
  95. package/dist/bubbles/service-bubble/github.js +1046 -0
  96. package/dist/bubbles/service-bubble/github.js.map +1 -0
  97. package/dist/bubbles/service-bubble/gmail.d.ts +180 -180
  98. package/dist/bubbles/service-bubble/google-calendar.d.ts +60 -60
  99. package/dist/bubbles/service-bubble/google-drive.d.ts +69 -68
  100. package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -1
  101. package/dist/bubbles/service-bubble/google-drive.js +35 -3
  102. package/dist/bubbles/service-bubble/google-drive.js.map +1 -1
  103. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +943 -0
  104. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts.map +1 -0
  105. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts +31 -0
  106. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts.map +1 -0
  107. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js +184 -0
  108. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js.map +1 -0
  109. package/dist/bubbles/service-bubble/google-sheets/google-sheets.js +401 -0
  110. package/dist/bubbles/service-bubble/google-sheets/google-sheets.js.map +1 -0
  111. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts +1024 -0
  112. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts.map +1 -0
  113. package/dist/bubbles/service-bubble/{google-sheets.js → google-sheets/google-sheets.schema.js} +45 -409
  114. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.js.map +1 -0
  115. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts +38 -0
  116. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts.map +1 -0
  117. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js +183 -0
  118. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js.map +1 -0
  119. package/dist/bubbles/service-bubble/google-sheets/index.d.ts +4 -0
  120. package/dist/bubbles/service-bubble/google-sheets/index.d.ts.map +1 -0
  121. package/dist/bubbles/service-bubble/google-sheets/index.js +4 -0
  122. package/dist/bubbles/service-bubble/google-sheets/index.js.map +1 -0
  123. package/dist/bubbles/service-bubble/hello-world.d.ts +4 -4
  124. package/dist/bubbles/service-bubble/http.d.ts +17 -5
  125. package/dist/bubbles/service-bubble/http.d.ts.map +1 -1
  126. package/dist/bubbles/service-bubble/http.integration.flow.d.ts +49 -0
  127. package/dist/bubbles/service-bubble/http.integration.flow.d.ts.map +1 -0
  128. package/dist/bubbles/service-bubble/http.integration.flow.js +425 -0
  129. package/dist/bubbles/service-bubble/http.integration.flow.js.map +1 -0
  130. package/dist/bubbles/service-bubble/http.js +47 -5
  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 +12 -12
  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 +1741 -798
  154. package/dist/bubbles/service-bubble/slack.d.ts.map +1 -1
  155. package/dist/bubbles/service-bubble/slack.js +322 -28
  156. package/dist/bubbles/service-bubble/slack.js.map +1 -1
  157. package/dist/bubbles/service-bubble/storage.d.ts +26 -22
  158. package/dist/bubbles/service-bubble/storage.d.ts.map +1 -1
  159. package/dist/bubbles/service-bubble/storage.js +45 -4
  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/amazon-shopping-tool/amazon-shopping-tool.d.ts +494 -0
  166. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.d.ts.map +1 -0
  167. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.d.ts +31 -0
  168. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.d.ts.map +1 -0
  169. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.js +100 -0
  170. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.js.map +1 -0
  171. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.js +1301 -0
  172. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.js.map +1 -0
  173. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts +473 -0
  174. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts.map +1 -0
  175. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.js +230 -0
  176. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.js.map +1 -0
  177. package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.d.ts +3 -0
  178. package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.d.ts.map +1 -0
  179. package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.js +3 -0
  180. package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.js.map +1 -0
  181. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +76 -20
  182. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts.map +1 -1
  183. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js +12 -0
  184. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js.map +1 -1
  185. package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +14 -14
  186. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +188 -0
  187. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts.map +1 -0
  188. package/dist/bubbles/tool-bubble/code-edit-tool.js +321 -0
  189. package/dist/bubbles/tool-bubble/code-edit-tool.js.map +1 -0
  190. package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts +740 -0
  191. package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts.map +1 -0
  192. package/dist/bubbles/tool-bubble/company-enrichment-tool.js +350 -0
  193. package/dist/bubbles/tool-bubble/company-enrichment-tool.js.map +1 -0
  194. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +8 -4
  195. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -1
  196. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +115 -10
  197. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -1
  198. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +455 -0
  199. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts.map +1 -0
  200. package/dist/bubbles/tool-bubble/google-maps-tool.js +206 -0
  201. package/dist/bubbles/tool-bubble/google-maps-tool.js.map +1 -0
  202. package/dist/bubbles/tool-bubble/instagram-tool.d.ts +36 -36
  203. package/dist/bubbles/tool-bubble/instagram-tool.d.ts.map +1 -1
  204. package/dist/bubbles/tool-bubble/instagram-tool.js +4 -2
  205. package/dist/bubbles/tool-bubble/instagram-tool.js.map +1 -1
  206. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +830 -453
  207. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts.map +1 -1
  208. package/dist/bubbles/tool-bubble/linkedin-tool.js +236 -14
  209. package/dist/bubbles/tool-bubble/linkedin-tool.js.map +1 -1
  210. package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
  211. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +66 -66
  212. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +17 -16
  213. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts.map +1 -1
  214. package/dist/bubbles/tool-bubble/research-agent-tool.js +32 -17
  215. package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -1
  216. package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +8 -8
  217. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +485 -0
  218. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts.map +1 -0
  219. package/dist/bubbles/tool-bubble/tiktok-tool.js +226 -0
  220. package/dist/bubbles/tool-bubble/tiktok-tool.js.map +1 -0
  221. package/dist/bubbles/tool-bubble/tool-template.d.ts +8 -8
  222. package/dist/bubbles/tool-bubble/twitter-tool.d.ts +947 -0
  223. package/dist/bubbles/tool-bubble/twitter-tool.d.ts.map +1 -0
  224. package/dist/bubbles/tool-bubble/twitter-tool.js +497 -0
  225. package/dist/bubbles/tool-bubble/twitter-tool.js.map +1 -0
  226. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +22 -16
  227. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts.map +1 -1
  228. package/dist/bubbles/tool-bubble/web-crawl-tool.js +58 -59
  229. package/dist/bubbles/tool-bubble/web-crawl-tool.js.map +1 -1
  230. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +8 -8
  231. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts.map +1 -1
  232. package/dist/bubbles/tool-bubble/web-extract-tool.js +17 -17
  233. package/dist/bubbles/tool-bubble/web-extract-tool.js.map +1 -1
  234. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +21 -113
  235. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -1
  236. package/dist/bubbles/tool-bubble/web-scrape-tool.js +55 -73
  237. package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -1
  238. package/dist/bubbles/tool-bubble/web-search-tool.d.ts +20 -9
  239. package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -1
  240. package/dist/bubbles/tool-bubble/web-search-tool.js +45 -35
  241. package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -1
  242. package/dist/bubbles/tool-bubble/youtube-tool.d.ts +25 -25
  243. package/dist/bubbles/tool-bubble/youtube-tool.d.ts.map +1 -1
  244. package/dist/bubbles/tool-bubble/youtube-tool.js +8 -5
  245. package/dist/bubbles/tool-bubble/youtube-tool.js.map +1 -1
  246. package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +4 -4
  247. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +30 -30
  248. package/dist/bubbles/workflow-bubble/generate-document.workflow.js +1 -1
  249. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +22 -22
  250. package/dist/bubbles/workflow-bubble/parse-document.workflow.js +1 -1
  251. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +70 -70
  252. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -1
  253. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +4 -4
  254. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -1
  255. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +36 -36
  256. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +1 -1
  257. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +14 -14
  258. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts.map +1 -1
  259. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +6 -6
  260. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -1
  261. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +18 -18
  262. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts.map +1 -1
  263. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +24 -4
  264. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -1
  265. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +19 -19
  266. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -1
  267. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +8 -8
  268. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -1
  269. package/dist/bubbles.json +260 -77
  270. package/dist/index.d.ts +25 -4
  271. package/dist/index.d.ts.map +1 -1
  272. package/dist/index.js +18 -3
  273. package/dist/index.js.map +1 -1
  274. package/dist/logging/BubbleLogger.d.ts +55 -16
  275. package/dist/logging/BubbleLogger.d.ts.map +1 -1
  276. package/dist/logging/BubbleLogger.js +192 -77
  277. package/dist/logging/BubbleLogger.js.map +1 -1
  278. package/dist/logging/StreamingBubbleLogger.d.ts +21 -1
  279. package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -1
  280. package/dist/logging/StreamingBubbleLogger.js +80 -8
  281. package/dist/logging/StreamingBubbleLogger.js.map +1 -1
  282. package/dist/logging/WebhookStreamLogger.d.ts +66 -0
  283. package/dist/logging/WebhookStreamLogger.d.ts.map +1 -0
  284. package/dist/logging/WebhookStreamLogger.js +291 -0
  285. package/dist/logging/WebhookStreamLogger.js.map +1 -0
  286. package/dist/types/available-tools.d.ts +1 -1
  287. package/dist/types/available-tools.d.ts.map +1 -1
  288. package/dist/types/available-tools.js +7 -0
  289. package/dist/types/available-tools.js.map +1 -1
  290. package/dist/types/base-bubble-class.d.ts +6 -4
  291. package/dist/types/base-bubble-class.d.ts.map +1 -1
  292. package/dist/types/base-bubble-class.js +30 -23
  293. package/dist/types/base-bubble-class.js.map +1 -1
  294. package/dist/types/bubble.d.ts +2 -0
  295. package/dist/types/bubble.d.ts.map +1 -1
  296. package/dist/types/service-bubble-class.d.ts +1 -1
  297. package/dist/types/service-bubble-class.d.ts.map +1 -1
  298. package/dist/types/service-bubble-class.js +2 -2
  299. package/dist/types/service-bubble-class.js.map +1 -1
  300. package/dist/types/tool-bubble-class.d.ts +1 -1
  301. package/dist/types/tool-bubble-class.d.ts.map +1 -1
  302. package/dist/types/tool-bubble-class.js +60 -10
  303. package/dist/types/tool-bubble-class.js.map +1 -1
  304. package/dist/types/workflow-bubble-class.d.ts +1 -1
  305. package/dist/types/workflow-bubble-class.d.ts.map +1 -1
  306. package/dist/types/workflow-bubble-class.js +2 -2
  307. package/dist/types/workflow-bubble-class.js.map +1 -1
  308. package/dist/utils/agent-formatter.d.ts +14 -2
  309. package/dist/utils/agent-formatter.d.ts.map +1 -1
  310. package/dist/utils/agent-formatter.js +174 -26
  311. package/dist/utils/agent-formatter.js.map +1 -1
  312. package/dist/utils/bubbleflow-validation.d.ts +7 -0
  313. package/dist/utils/bubbleflow-validation.d.ts.map +1 -1
  314. package/dist/utils/bubbleflow-validation.js +171 -6
  315. package/dist/utils/bubbleflow-validation.js.map +1 -1
  316. package/dist/utils/json-parsing.d.ts.map +1 -1
  317. package/dist/utils/json-parsing.js +146 -0
  318. package/dist/utils/json-parsing.js.map +1 -1
  319. package/dist/utils/safe-gemini-chat.d.ts +31 -0
  320. package/dist/utils/safe-gemini-chat.d.ts.map +1 -0
  321. package/dist/utils/safe-gemini-chat.js +93 -0
  322. package/dist/utils/safe-gemini-chat.js.map +1 -0
  323. package/dist/utils/schema-comparison.d.ts +92 -0
  324. package/dist/utils/schema-comparison.d.ts.map +1 -0
  325. package/dist/utils/schema-comparison.js +716 -0
  326. package/dist/utils/schema-comparison.js.map +1 -0
  327. package/dist/utils/zod-schema.d.ts +24 -0
  328. package/dist/utils/zod-schema.d.ts.map +1 -0
  329. package/dist/utils/zod-schema.js +56 -0
  330. package/dist/utils/zod-schema.js.map +1 -0
  331. package/package.json +6 -4
  332. package/dist/bubbles/service-bubble/google-sheets.d.ts +0 -1811
  333. package/dist/bubbles/service-bubble/google-sheets.d.ts.map +0 -1
  334. package/dist/bubbles/service-bubble/google-sheets.js.map +0 -1
  335. package/dist/bubbles/service-bubble/x-twitter.d.ts +0 -814
  336. package/dist/bubbles/service-bubble/x-twitter.d.ts.map +0 -1
  337. package/dist/bubbles/service-bubble/x-twitter.js +0 -445
  338. package/dist/bubbles/service-bubble/x-twitter.js.map +0 -1
  339. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +0 -125
  340. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +0 -1
  341. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +0 -808
  342. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +0 -1
  343. package/dist/test-gm.d.ts +0 -10
  344. package/dist/test-gm.d.ts.map +0 -1
  345. package/dist/test-gm.js +0 -95
  346. package/dist/test-gm.js.map +0 -1
  347. package/dist/utils/param-helper.d.ts +0 -2
  348. package/dist/utils/param-helper.d.ts.map +0 -1
  349. package/dist/utils/param-helper.js +0 -5
  350. package/dist/utils/param-helper.js.map +0 -1
@@ -0,0 +1,1132 @@
1
+ import { z } from 'zod';
2
+ import { ServiceBubble } from '../../types/service-bubble-class.js';
3
+ import { CredentialType } from '@bubblelab/shared-schemas';
4
+ // Telegram Bot API base URL
5
+ const TELEGRAM_API_BASE = 'https://api.telegram.org/bot';
6
+ // Define parse mode for message formatting
7
+ const ParseMode = z
8
+ .enum(['HTML', 'Markdown', 'MarkdownV2'])
9
+ .optional()
10
+ .describe('Text formatting mode (HTML, Markdown, or MarkdownV2)');
11
+ // Define inline keyboard button schema
12
+ const InlineKeyboardButtonSchema = z.object({
13
+ text: z.string().describe('Button text'),
14
+ url: z.string().url().optional().describe('HTTP or tg:// URL to open'),
15
+ callback_data: z
16
+ .string()
17
+ .max(64)
18
+ .optional()
19
+ .describe('Callback data (max 64 bytes)'),
20
+ web_app: z.record(z.unknown()).optional().describe('Web App information'),
21
+ login_url: z.record(z.unknown()).optional().describe('Login URL information'),
22
+ switch_inline_query: z.string().optional().describe('Switch to inline query'),
23
+ switch_inline_query_current_chat: z
24
+ .string()
25
+ .optional()
26
+ .describe('Switch to inline query in current chat'),
27
+ callback_game: z.record(z.unknown()).optional().describe('Callback game'),
28
+ pay: z.boolean().optional().describe('Pay button'),
29
+ });
30
+ // Define inline keyboard markup schema
31
+ const InlineKeyboardMarkupSchema = z.object({
32
+ inline_keyboard: z
33
+ .array(z.array(InlineKeyboardButtonSchema))
34
+ .describe('Array of button rows'),
35
+ });
36
+ // Define reply keyboard button schema
37
+ const KeyboardButtonSchema = z.object({
38
+ text: z.string().describe('Button text'),
39
+ request_contact: z.boolean().optional().describe('Request user contact'),
40
+ request_location: z.boolean().optional().describe('Request user location'),
41
+ request_poll: z
42
+ .object({
43
+ type: z.enum(['quiz', 'regular']).optional(),
44
+ })
45
+ .optional()
46
+ .describe('Request poll'),
47
+ web_app: z.record(z.unknown()).optional().describe('Web App information'),
48
+ });
49
+ // Define reply keyboard markup schema
50
+ const ReplyKeyboardMarkupSchema = z.object({
51
+ keyboard: z
52
+ .array(z.array(KeyboardButtonSchema))
53
+ .describe('Array of button rows'),
54
+ is_persistent: z.boolean().optional().describe('Show keyboard to all users'),
55
+ resize_keyboard: z
56
+ .boolean()
57
+ .optional()
58
+ .describe('Resize keyboard to fit buttons'),
59
+ one_time_keyboard: z.boolean().optional().describe('Hide keyboard after use'),
60
+ input_field_placeholder: z
61
+ .string()
62
+ .optional()
63
+ .describe('Placeholder for input field'),
64
+ selective: z
65
+ .boolean()
66
+ .optional()
67
+ .describe('Show keyboard to specific users only'),
68
+ });
69
+ // Define reply markup union
70
+ const ReplyMarkupSchema = z
71
+ .union([InlineKeyboardMarkupSchema, ReplyKeyboardMarkupSchema])
72
+ .optional()
73
+ .describe('Inline keyboard or reply keyboard markup');
74
+ // Define the parameters schema for different Telegram operations
75
+ const TelegramParamsSchema = z.discriminatedUnion('operation', [
76
+ // Send message operation
77
+ z.object({
78
+ operation: z
79
+ .literal('send_message')
80
+ .describe('Send a text message to a Telegram chat'),
81
+ chat_id: z
82
+ .union([z.string(), z.number()])
83
+ .describe('Unique identifier for the target chat or username (e.g., @channelusername)'),
84
+ text: z
85
+ .string()
86
+ .min(1, 'Message text is required')
87
+ .describe('Text of the message to be sent'),
88
+ parse_mode: ParseMode,
89
+ entities: z
90
+ .array(z.unknown())
91
+ .optional()
92
+ .describe('List of special entities in the message text'),
93
+ disable_web_page_preview: z
94
+ .boolean()
95
+ .optional()
96
+ .describe('Disable link previews for links in this message'),
97
+ disable_notification: z
98
+ .boolean()
99
+ .optional()
100
+ .describe('Sends the message silently'),
101
+ protect_content: z
102
+ .boolean()
103
+ .optional()
104
+ .describe('Protects the content from forwarding and saving'),
105
+ reply_to_message_id: z
106
+ .number()
107
+ .optional()
108
+ .describe('If the message is a reply, ID of the original message'),
109
+ allow_sending_without_reply: z
110
+ .boolean()
111
+ .optional()
112
+ .describe('Allow sending message even if the replied message is not found'),
113
+ reply_markup: ReplyMarkupSchema,
114
+ credentials: z
115
+ .record(z.nativeEnum(CredentialType), z.string())
116
+ .optional()
117
+ .describe('Object mapping credential types to values (injected at runtime)'),
118
+ }),
119
+ // Send photo operation
120
+ z.object({
121
+ operation: z
122
+ .literal('send_photo')
123
+ .describe('Send a photo to a Telegram chat'),
124
+ chat_id: z
125
+ .union([z.string(), z.number()])
126
+ .describe('Unique identifier for the target chat or username'),
127
+ photo: z
128
+ .union([z.string().url(), z.string()])
129
+ .describe('Photo to send (file_id, HTTP URL, or file path)'),
130
+ caption: z.string().optional().describe('Photo caption'),
131
+ parse_mode: ParseMode,
132
+ caption_entities: z
133
+ .array(z.unknown())
134
+ .optional()
135
+ .describe('List of special entities in the caption'),
136
+ has_spoiler: z.boolean().optional().describe('Mark photo as spoiler'),
137
+ disable_notification: z
138
+ .boolean()
139
+ .optional()
140
+ .describe('Sends the message silently'),
141
+ protect_content: z
142
+ .boolean()
143
+ .optional()
144
+ .describe('Protects the content from forwarding and saving'),
145
+ reply_to_message_id: z
146
+ .number()
147
+ .optional()
148
+ .describe('If the message is a reply, ID of the original message'),
149
+ allow_sending_without_reply: z
150
+ .boolean()
151
+ .optional()
152
+ .describe('Allow sending message even if the replied message is not found'),
153
+ reply_markup: ReplyMarkupSchema,
154
+ credentials: z
155
+ .record(z.nativeEnum(CredentialType), z.string())
156
+ .optional()
157
+ .describe('Object mapping credential types to values (injected at runtime)'),
158
+ }),
159
+ // Send document operation
160
+ z.object({
161
+ operation: z
162
+ .literal('send_document')
163
+ .describe('Send a document to a Telegram chat'),
164
+ chat_id: z
165
+ .union([z.string(), z.number()])
166
+ .describe('Unique identifier for the target chat or username'),
167
+ document: z
168
+ .union([z.string().url(), z.string()])
169
+ .describe('File to send (file_id, HTTP URL, or file path)'),
170
+ thumbnail: z
171
+ .union([z.string().url(), z.string()])
172
+ .optional()
173
+ .describe('Thumbnail of the file'),
174
+ caption: z.string().optional().describe('Document caption'),
175
+ parse_mode: ParseMode,
176
+ caption_entities: z
177
+ .array(z.unknown())
178
+ .optional()
179
+ .describe('List of special entities in the caption'),
180
+ disable_content_type_detection: z
181
+ .boolean()
182
+ .optional()
183
+ .describe('Disable automatic file type detection'),
184
+ disable_notification: z
185
+ .boolean()
186
+ .optional()
187
+ .describe('Sends the message silently'),
188
+ protect_content: z
189
+ .boolean()
190
+ .optional()
191
+ .describe('Protects the content from forwarding and saving'),
192
+ reply_to_message_id: z
193
+ .number()
194
+ .optional()
195
+ .describe('If the message is a reply, ID of the original message'),
196
+ allow_sending_without_reply: z
197
+ .boolean()
198
+ .optional()
199
+ .describe('Allow sending message even if the replied message is not found'),
200
+ reply_markup: ReplyMarkupSchema,
201
+ credentials: z
202
+ .record(z.nativeEnum(CredentialType), z.string())
203
+ .optional()
204
+ .describe('Object mapping credential types to values (injected at runtime)'),
205
+ }),
206
+ // Edit message operation
207
+ z.object({
208
+ operation: z
209
+ .literal('edit_message')
210
+ .describe('Edit a previously sent message'),
211
+ chat_id: z
212
+ .union([z.string(), z.number()])
213
+ .optional()
214
+ .describe('Unique identifier for the target chat or username'),
215
+ message_id: z
216
+ .number()
217
+ .optional()
218
+ .describe('Identifier of the message to edit'),
219
+ inline_message_id: z
220
+ .string()
221
+ .optional()
222
+ .describe('Identifier of the inline message to edit'),
223
+ text: z.string().min(1).describe('New text of the message'),
224
+ parse_mode: ParseMode,
225
+ entities: z
226
+ .array(z.unknown())
227
+ .optional()
228
+ .describe('List of special entities in the message text'),
229
+ disable_web_page_preview: z
230
+ .boolean()
231
+ .optional()
232
+ .describe('Disable link previews for links in this message'),
233
+ reply_markup: InlineKeyboardMarkupSchema.optional(),
234
+ credentials: z
235
+ .record(z.nativeEnum(CredentialType), z.string())
236
+ .optional()
237
+ .describe('Object mapping credential types to values (injected at runtime)'),
238
+ }),
239
+ // Delete message operation
240
+ z.object({
241
+ operation: z.literal('delete_message').describe('Delete a message'),
242
+ chat_id: z
243
+ .union([z.string(), z.number()])
244
+ .describe('Unique identifier for the target chat or username'),
245
+ message_id: z.number().describe('Identifier of the message to delete'),
246
+ credentials: z
247
+ .record(z.nativeEnum(CredentialType), z.string())
248
+ .optional()
249
+ .describe('Object mapping credential types to values (injected at runtime)'),
250
+ }),
251
+ // Get me operation
252
+ z.object({
253
+ operation: z.literal('get_me').describe('Get bot information'),
254
+ credentials: z
255
+ .record(z.nativeEnum(CredentialType), z.string())
256
+ .optional()
257
+ .describe('Object mapping credential types to values (injected at runtime)'),
258
+ }),
259
+ // Get chat operation
260
+ z.object({
261
+ operation: z.literal('get_chat').describe('Get information about a chat'),
262
+ chat_id: z
263
+ .union([z.string(), z.number()])
264
+ .describe('Unique identifier for the target chat or username'),
265
+ credentials: z
266
+ .record(z.nativeEnum(CredentialType), z.string())
267
+ .optional()
268
+ .describe('Object mapping credential types to values (injected at runtime)'),
269
+ }),
270
+ // Get updates operation
271
+ z.object({
272
+ operation: z
273
+ .literal('get_updates')
274
+ .describe('Receive incoming updates using long polling'),
275
+ offset: z
276
+ .number()
277
+ .optional()
278
+ .describe('Identifier of the first update to be returned'),
279
+ limit: z
280
+ .number()
281
+ .min(1)
282
+ .max(100)
283
+ .optional()
284
+ .default(100)
285
+ .describe('Limits the number of updates to be retrieved (1-100)'),
286
+ timeout: z
287
+ .number()
288
+ .optional()
289
+ .describe('Timeout in seconds for long polling'),
290
+ allowed_updates: z
291
+ .array(z.string())
292
+ .optional()
293
+ .describe('List of update types to receive'),
294
+ credentials: z
295
+ .record(z.nativeEnum(CredentialType), z.string())
296
+ .optional()
297
+ .describe('Object mapping credential types to values (injected at runtime)'),
298
+ }),
299
+ // Send chat action operation
300
+ z.object({
301
+ operation: z
302
+ .literal('send_chat_action')
303
+ .describe("Tell the user that something is happening on the bot's side (typing, uploading photo, etc.)"),
304
+ chat_id: z
305
+ .union([z.string(), z.number()])
306
+ .describe('Unique identifier for the target chat or username'),
307
+ action: z
308
+ .enum([
309
+ 'typing',
310
+ 'upload_photo',
311
+ 'record_video',
312
+ 'upload_video',
313
+ 'record_voice',
314
+ 'upload_voice',
315
+ 'upload_document',
316
+ 'find_location',
317
+ 'record_video_note',
318
+ 'upload_video_note',
319
+ 'choose_sticker',
320
+ ])
321
+ .describe('Type of action to broadcast'),
322
+ message_thread_id: z
323
+ .number()
324
+ .optional()
325
+ .describe('Unique identifier for the target message thread (for forum topics)'),
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
+ // Set message reaction operation
332
+ z.object({
333
+ operation: z
334
+ .literal('set_message_reaction')
335
+ .describe('Add a reaction to a message'),
336
+ chat_id: z
337
+ .union([z.string(), z.number()])
338
+ .describe('Unique identifier for the target chat or username'),
339
+ message_id: z.number().describe('Identifier of the message to react to'),
340
+ reaction: z
341
+ .array(z.union([
342
+ z.object({
343
+ type: z.literal('emoji'),
344
+ emoji: z.string().describe('Emoji reaction (e.g., "👍", "❤️")'),
345
+ }),
346
+ z.object({
347
+ type: z.literal('custom_emoji'),
348
+ custom_emoji_id: z.string().describe('Custom emoji identifier'),
349
+ }),
350
+ ]))
351
+ .optional()
352
+ .describe('Array of reactions to set (empty array to remove reactions)'),
353
+ is_big: z
354
+ .boolean()
355
+ .optional()
356
+ .describe('Pass True to set the reaction with a bigger animation'),
357
+ credentials: z
358
+ .record(z.nativeEnum(CredentialType), z.string())
359
+ .optional()
360
+ .describe('Object mapping credential types to values (injected at runtime)'),
361
+ }),
362
+ // Set webhook operation
363
+ z.object({
364
+ operation: z
365
+ .literal('set_webhook')
366
+ .describe('Specify a URL to receive incoming updates via webhook'),
367
+ url: z
368
+ .union([z.literal(''), z.string().url()])
369
+ .describe('HTTPS URL to send updates to. Use an empty string to remove webhook integration'),
370
+ ip_address: z
371
+ .string()
372
+ .optional()
373
+ .describe('The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS'),
374
+ max_connections: z
375
+ .number()
376
+ .min(1)
377
+ .max(100)
378
+ .optional()
379
+ .describe('Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery (1-100). Defaults to 40'),
380
+ allowed_updates: z
381
+ .array(z.string())
382
+ .optional()
383
+ .describe('A list of update types you want your bot to receive (e.g., ["message", "callback_query"])'),
384
+ drop_pending_updates: z
385
+ .boolean()
386
+ .optional()
387
+ .describe('Pass True to drop all pending updates'),
388
+ secret_token: z
389
+ .string()
390
+ .min(1)
391
+ .max(256)
392
+ .regex(/^[A-Za-z0-9_-]+$/)
393
+ .optional()
394
+ .describe('A secret token to be sent in the X-Telegram-Bot-Api-Secret-Token header (1-256 characters, A-Z, a-z, 0-9, _, -)'),
395
+ credentials: z
396
+ .record(z.nativeEnum(CredentialType), z.string())
397
+ .optional()
398
+ .describe('Object mapping credential types to values (injected at runtime)'),
399
+ }),
400
+ // Delete webhook operation
401
+ z.object({
402
+ operation: z
403
+ .literal('delete_webhook')
404
+ .describe('Remove webhook integration to switch back to getUpdates'),
405
+ drop_pending_updates: z
406
+ .boolean()
407
+ .optional()
408
+ .describe('Pass True to drop all pending updates'),
409
+ credentials: z
410
+ .record(z.nativeEnum(CredentialType), z.string())
411
+ .optional()
412
+ .describe('Object mapping credential types to values (injected at runtime)'),
413
+ }),
414
+ // Get webhook info operation
415
+ z.object({
416
+ operation: z
417
+ .literal('get_webhook_info')
418
+ .describe('Get current webhook status and information'),
419
+ credentials: z
420
+ .record(z.nativeEnum(CredentialType), z.string())
421
+ .optional()
422
+ .describe('Object mapping credential types to values (injected at runtime)'),
423
+ }),
424
+ ]);
425
+ // Define WebhookInfo schema
426
+ const TelegramWebhookInfoSchema = z.object({
427
+ url: z
428
+ .string()
429
+ .describe('Webhook URL, may be empty if webhook is not set up'),
430
+ has_custom_certificate: z
431
+ .boolean()
432
+ .describe('True, if a custom certificate was provided for webhook certificate checks'),
433
+ pending_update_count: z
434
+ .number()
435
+ .describe('Number of updates awaiting delivery'),
436
+ ip_address: z
437
+ .string()
438
+ .optional()
439
+ .describe('Currently used webhook IP address'),
440
+ last_error_date: z
441
+ .number()
442
+ .optional()
443
+ .describe('Unix time for the most recent error that happened when trying to deliver an update via webhook'),
444
+ last_error_message: z
445
+ .string()
446
+ .optional()
447
+ .describe('Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook'),
448
+ last_synchronization_error_date: z
449
+ .number()
450
+ .optional()
451
+ .describe('Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters'),
452
+ max_connections: z
453
+ .number()
454
+ .optional()
455
+ .describe('The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery'),
456
+ allowed_updates: z
457
+ .array(z.string())
458
+ .optional()
459
+ .describe('A list of update types the bot is subscribed to. Defaults to all update types except chat_member'),
460
+ });
461
+ // Define result schemas for different operations
462
+ const TelegramMessageSchema = z.object({
463
+ message_id: z.number().describe('Unique message identifier'),
464
+ from: z
465
+ .object({
466
+ id: z.number().describe('User identifier'),
467
+ is_bot: z.boolean().describe('True if user is a bot'),
468
+ first_name: z.string().describe('User first name'),
469
+ last_name: z.string().optional().describe('User last name'),
470
+ username: z.string().optional().describe('User username'),
471
+ language_code: z.string().optional().describe('User language code'),
472
+ })
473
+ .optional()
474
+ .describe('Sender information'),
475
+ date: z.number().describe('Date the message was sent (Unix time)'),
476
+ chat: z
477
+ .object({
478
+ id: z.number().describe('Chat identifier'),
479
+ type: z
480
+ .enum(['private', 'group', 'supergroup', 'channel'])
481
+ .describe('Chat type'),
482
+ title: z.string().optional().describe('Chat title'),
483
+ username: z.string().optional().describe('Chat username'),
484
+ first_name: z
485
+ .string()
486
+ .optional()
487
+ .describe('First name (for private chats)'),
488
+ last_name: z
489
+ .string()
490
+ .optional()
491
+ .describe('Last name (for private chats)'),
492
+ })
493
+ .describe('Chat information'),
494
+ text: z.string().optional().describe('Message text'),
495
+ photo: z
496
+ .array(z.object({
497
+ file_id: z.string().describe('File identifier'),
498
+ file_unique_id: z.string().describe('Unique file identifier'),
499
+ width: z.number().describe('Photo width'),
500
+ height: z.number().describe('Photo height'),
501
+ file_size: z.number().optional().describe('File size in bytes'),
502
+ }))
503
+ .optional()
504
+ .describe('Message photo'),
505
+ document: z
506
+ .object({
507
+ file_id: z.string().describe('File identifier'),
508
+ file_unique_id: z.string().describe('Unique file identifier'),
509
+ file_name: z.string().optional().describe('Original filename'),
510
+ mime_type: z.string().optional().describe('MIME type'),
511
+ file_size: z.number().optional().describe('File size in bytes'),
512
+ })
513
+ .optional()
514
+ .describe('Message document'),
515
+ });
516
+ const TelegramUserSchema = z.object({
517
+ id: z.number().describe('User identifier'),
518
+ is_bot: z.boolean().describe('True if user is a bot'),
519
+ first_name: z.string().describe('User first name'),
520
+ last_name: z.string().optional().describe('User last name'),
521
+ username: z.string().optional().describe('User username'),
522
+ language_code: z.string().optional().describe('User language code'),
523
+ });
524
+ const TelegramChatSchema = z.object({
525
+ id: z.number().describe('Chat identifier'),
526
+ type: z
527
+ .enum(['private', 'group', 'supergroup', 'channel'])
528
+ .describe('Chat type'),
529
+ title: z.string().optional().describe('Chat title'),
530
+ username: z.string().optional().describe('Chat username'),
531
+ first_name: z.string().optional().describe('First name (for private chats)'),
532
+ last_name: z.string().optional().describe('Last name (for private chats)'),
533
+ description: z.string().optional().describe('Chat description'),
534
+ invite_link: z.string().optional().describe('Chat invite link'),
535
+ });
536
+ const TelegramUpdateSchema = z.object({
537
+ update_id: z.number().describe('Update identifier'),
538
+ message: TelegramMessageSchema.optional().describe('New incoming message'),
539
+ edited_message: TelegramMessageSchema.optional().describe('Edited message'),
540
+ channel_post: TelegramMessageSchema.optional().describe('New channel post'),
541
+ edited_channel_post: TelegramMessageSchema.optional().describe('Edited channel post'),
542
+ callback_query: z
543
+ .object({
544
+ id: z.string().describe('Callback query identifier'),
545
+ from: TelegramUserSchema.describe('User who sent the callback'),
546
+ message: TelegramMessageSchema.optional().describe('Message with the callback button'),
547
+ inline_message_id: z
548
+ .string()
549
+ .optional()
550
+ .describe('Inline message identifier'),
551
+ chat_instance: z.string().describe('Global identifier for the chat'),
552
+ data: z.string().optional().describe('Callback data'),
553
+ game_short_name: z.string().optional().describe('Game short name'),
554
+ })
555
+ .optional()
556
+ .describe('New incoming callback query'),
557
+ });
558
+ const TelegramResultSchema = z.discriminatedUnion('operation', [
559
+ z.object({
560
+ operation: z
561
+ .literal('send_message')
562
+ .describe('Send a text message to a Telegram chat'),
563
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
564
+ message: TelegramMessageSchema.optional().describe('Sent message object'),
565
+ error: z.string().describe('Error message if operation failed'),
566
+ success: z.boolean().describe('Whether the operation was successful'),
567
+ }),
568
+ z.object({
569
+ operation: z
570
+ .literal('send_photo')
571
+ .describe('Send a photo to a Telegram chat'),
572
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
573
+ message: TelegramMessageSchema.optional().describe('Sent message object'),
574
+ error: z.string().describe('Error message if operation failed'),
575
+ success: z.boolean().describe('Whether the operation was successful'),
576
+ }),
577
+ z.object({
578
+ operation: z
579
+ .literal('send_document')
580
+ .describe('Send a document to a Telegram chat'),
581
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
582
+ message: TelegramMessageSchema.optional().describe('Sent message object'),
583
+ error: z.string().describe('Error message if operation failed'),
584
+ success: z.boolean().describe('Whether the operation was successful'),
585
+ }),
586
+ z.object({
587
+ operation: z
588
+ .literal('edit_message')
589
+ .describe('Edit a previously sent message'),
590
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
591
+ message: TelegramMessageSchema.optional().describe('Edited message object'),
592
+ error: z.string().describe('Error message if operation failed'),
593
+ success: z.boolean().describe('Whether the operation was successful'),
594
+ }),
595
+ z.object({
596
+ operation: z.literal('delete_message').describe('Delete a message'),
597
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
598
+ error: z.string().describe('Error message if operation failed'),
599
+ success: z.boolean().describe('Whether the operation was successful'),
600
+ }),
601
+ z.object({
602
+ operation: z.literal('get_me').describe('Get bot information'),
603
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
604
+ user: TelegramUserSchema.optional().describe('Bot user object'),
605
+ error: z.string().describe('Error message if operation failed'),
606
+ success: z.boolean().describe('Whether the operation was successful'),
607
+ }),
608
+ z.object({
609
+ operation: z.literal('get_chat').describe('Get information about a chat'),
610
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
611
+ chat: TelegramChatSchema.optional().describe('Chat object'),
612
+ error: z.string().describe('Error message if operation failed'),
613
+ success: z.boolean().describe('Whether the operation was successful'),
614
+ }),
615
+ z.object({
616
+ operation: z
617
+ .literal('get_updates')
618
+ .describe('Receive incoming updates using long polling'),
619
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
620
+ updates: z
621
+ .array(TelegramUpdateSchema)
622
+ .optional()
623
+ .describe('Array of Update objects'),
624
+ error: z.string().describe('Error message if operation failed'),
625
+ success: z.boolean().describe('Whether the operation was successful'),
626
+ }),
627
+ z.object({
628
+ operation: z
629
+ .literal('send_chat_action')
630
+ .describe("Tell the user that something is happening on the bot's side"),
631
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
632
+ error: z.string().describe('Error message if operation failed'),
633
+ success: z.boolean().describe('Whether the operation was successful'),
634
+ }),
635
+ z.object({
636
+ operation: z
637
+ .literal('set_message_reaction')
638
+ .describe('Add a reaction to a message'),
639
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
640
+ error: z.string().describe('Error message if operation failed'),
641
+ success: z.boolean().describe('Whether the operation was successful'),
642
+ }),
643
+ z.object({
644
+ operation: z
645
+ .literal('set_webhook')
646
+ .describe('Specify a URL to receive incoming updates via webhook'),
647
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
648
+ error: z.string().describe('Error message if operation failed'),
649
+ success: z.boolean().describe('Whether the operation was successful'),
650
+ }),
651
+ z.object({
652
+ operation: z
653
+ .literal('delete_webhook')
654
+ .describe('Remove webhook integration to switch back to getUpdates'),
655
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
656
+ error: z.string().describe('Error message if operation failed'),
657
+ success: z.boolean().describe('Whether the operation was successful'),
658
+ }),
659
+ z.object({
660
+ operation: z
661
+ .literal('get_webhook_info')
662
+ .describe('Get current webhook status and information'),
663
+ ok: z.boolean().describe('Whether the Telegram API call was successful'),
664
+ webhook_info: TelegramWebhookInfoSchema.optional().describe('Webhook information object'),
665
+ error: z.string().describe('Error message if operation failed'),
666
+ success: z.boolean().describe('Whether the operation was successful'),
667
+ }),
668
+ ]);
669
+ export class TelegramBubble extends ServiceBubble {
670
+ async testCredential() {
671
+ // Make a test API call to the Telegram API
672
+ const response = await this.makeTelegramApiCall('getMe', {});
673
+ if (response.ok) {
674
+ return true;
675
+ }
676
+ return false;
677
+ }
678
+ static type = 'service';
679
+ static service = 'telegram';
680
+ static authType = 'apikey';
681
+ static bubbleName = 'telegram';
682
+ static schema = TelegramParamsSchema;
683
+ static resultSchema = TelegramResultSchema;
684
+ static shortDescription = 'Telegram Bot API integration for messaging and bot management';
685
+ static longDescription = `
686
+ Comprehensive Telegram Bot API integration bubble for managing messages, chats, and bot operations.
687
+ Use cases:
688
+ - Send text messages, photos, and documents to chats
689
+ - Edit and delete messages
690
+ - Get bot and chat information
691
+ - Receive updates via polling or webhooks
692
+ - Support for inline keyboards and reply keyboards
693
+
694
+ Security Features:
695
+ - Bot token-based authentication
696
+ - Parameter validation and sanitization
697
+ - Rate limiting awareness
698
+ - Comprehensive error handling
699
+ `;
700
+ static alias = 'telegram';
701
+ constructor(params = {
702
+ operation: 'get_me',
703
+ }, context, instanceId) {
704
+ super(params, context, instanceId);
705
+ }
706
+ chooseCredential() {
707
+ const { credentials } = this.params;
708
+ // If no credentials were injected, return undefined
709
+ if (!credentials || typeof credentials !== 'object') {
710
+ return undefined;
711
+ }
712
+ // Telegram bubble always uses Telegram bot token credentials
713
+ // Using string literal since CredentialType enum may not be updated in type system yet
714
+ return credentials['TELEGRAM_BOT_TOKEN'];
715
+ }
716
+ async performAction(context) {
717
+ void context;
718
+ const { operation } = this.params;
719
+ try {
720
+ const result = await (async () => {
721
+ switch (operation) {
722
+ case 'send_message':
723
+ return await this.sendMessage(this.params);
724
+ case 'send_photo':
725
+ return await this.sendPhoto(this.params);
726
+ case 'send_document':
727
+ return await this.sendDocument(this.params);
728
+ case 'edit_message':
729
+ return await this.editMessage(this.params);
730
+ case 'delete_message':
731
+ return await this.deleteMessage(this.params);
732
+ case 'get_me':
733
+ return await this.getMe(this.params);
734
+ case 'get_chat':
735
+ return await this.getChat(this.params);
736
+ case 'get_updates':
737
+ return await this.getUpdates(this.params);
738
+ case 'send_chat_action':
739
+ return await this.sendChatAction(this.params);
740
+ case 'set_message_reaction':
741
+ return await this.setMessageReaction(this.params);
742
+ case 'set_webhook':
743
+ return await this.setWebhook(this.params);
744
+ case 'delete_webhook':
745
+ return await this.deleteWebhook(this.params);
746
+ case 'get_webhook_info':
747
+ return await this.getWebhookInfo(this.params);
748
+ default:
749
+ throw new Error(`Unsupported operation: ${operation}`);
750
+ }
751
+ })();
752
+ return result;
753
+ }
754
+ catch (error) {
755
+ const failedOperation = this.params.operation;
756
+ return {
757
+ success: false,
758
+ ok: false,
759
+ operation: failedOperation,
760
+ error: error instanceof Error ? error.message : String(error),
761
+ };
762
+ }
763
+ }
764
+ /**
765
+ * Make an API call to the Telegram Bot API
766
+ */
767
+ async makeTelegramApiCall(method, body) {
768
+ const token = this.chooseCredential();
769
+ if (!token) {
770
+ throw new Error('Telegram bot token is required');
771
+ }
772
+ const url = `${TELEGRAM_API_BASE}${token}/${method}`;
773
+ try {
774
+ const response = await fetch(url, {
775
+ method: 'POST',
776
+ headers: {
777
+ 'Content-Type': 'application/json',
778
+ },
779
+ body: JSON.stringify(body),
780
+ });
781
+ const data = (await response.json());
782
+ if (!response.ok) {
783
+ return {
784
+ ok: false,
785
+ error_code: data.error_code,
786
+ description: data.description || 'Unknown error',
787
+ };
788
+ }
789
+ return data;
790
+ }
791
+ catch (error) {
792
+ throw new Error(`Telegram API call failed: ${error instanceof Error ? error.message : String(error)}`);
793
+ }
794
+ }
795
+ async sendMessage(params) {
796
+ const { chat_id, text, parse_mode, entities, disable_web_page_preview, disable_notification, protect_content, reply_to_message_id, allow_sending_without_reply, reply_markup, } = params;
797
+ const body = {
798
+ chat_id,
799
+ text,
800
+ };
801
+ if (parse_mode)
802
+ body.parse_mode = parse_mode;
803
+ if (entities)
804
+ body.entities = entities;
805
+ if (disable_web_page_preview !== undefined)
806
+ body.disable_web_page_preview = disable_web_page_preview;
807
+ if (disable_notification !== undefined)
808
+ body.disable_notification = disable_notification;
809
+ if (protect_content !== undefined)
810
+ body.protect_content = protect_content;
811
+ if (reply_to_message_id !== undefined)
812
+ body.reply_to_message_id = reply_to_message_id;
813
+ if (allow_sending_without_reply !== undefined)
814
+ body.allow_sending_without_reply = allow_sending_without_reply;
815
+ if (reply_markup)
816
+ body.reply_markup = reply_markup;
817
+ const response = await this.makeTelegramApiCall('sendMessage', body);
818
+ return {
819
+ operation: 'send_message',
820
+ ok: response.ok,
821
+ message: response.ok && response.result
822
+ ? response.result
823
+ : undefined,
824
+ error: !response.ok
825
+ ? response.description ||
826
+ `Error code: ${response.error_code || 'unknown'}`
827
+ : '',
828
+ success: response.ok,
829
+ };
830
+ }
831
+ async sendPhoto(params) {
832
+ const { chat_id, photo, caption, parse_mode, caption_entities, has_spoiler, disable_notification, protect_content, reply_to_message_id, allow_sending_without_reply, reply_markup, } = params;
833
+ const body = {
834
+ chat_id,
835
+ photo,
836
+ };
837
+ if (caption)
838
+ body.caption = caption;
839
+ if (parse_mode)
840
+ body.parse_mode = parse_mode;
841
+ if (caption_entities)
842
+ body.caption_entities = caption_entities;
843
+ if (has_spoiler !== undefined)
844
+ body.has_spoiler = has_spoiler;
845
+ if (disable_notification !== undefined)
846
+ body.disable_notification = disable_notification;
847
+ if (protect_content !== undefined)
848
+ body.protect_content = protect_content;
849
+ if (reply_to_message_id !== undefined)
850
+ body.reply_to_message_id = reply_to_message_id;
851
+ if (allow_sending_without_reply !== undefined)
852
+ body.allow_sending_without_reply = allow_sending_without_reply;
853
+ if (reply_markup)
854
+ body.reply_markup = reply_markup;
855
+ const response = await this.makeTelegramApiCall('sendPhoto', body);
856
+ return {
857
+ operation: 'send_photo',
858
+ ok: response.ok,
859
+ message: response.ok && response.result
860
+ ? response.result
861
+ : undefined,
862
+ error: !response.ok
863
+ ? response.description ||
864
+ `Error code: ${response.error_code || 'unknown'}`
865
+ : '',
866
+ success: response.ok,
867
+ };
868
+ }
869
+ async sendDocument(params) {
870
+ const { chat_id, document, thumbnail, caption, parse_mode, caption_entities, disable_content_type_detection, disable_notification, protect_content, reply_to_message_id, allow_sending_without_reply, reply_markup, } = params;
871
+ const body = {
872
+ chat_id,
873
+ document,
874
+ };
875
+ if (thumbnail)
876
+ body.thumbnail = thumbnail;
877
+ if (caption)
878
+ body.caption = caption;
879
+ if (parse_mode)
880
+ body.parse_mode = parse_mode;
881
+ if (caption_entities)
882
+ body.caption_entities = caption_entities;
883
+ if (disable_content_type_detection !== undefined)
884
+ body.disable_content_type_detection = disable_content_type_detection;
885
+ if (disable_notification !== undefined)
886
+ body.disable_notification = disable_notification;
887
+ if (protect_content !== undefined)
888
+ body.protect_content = protect_content;
889
+ if (reply_to_message_id !== undefined)
890
+ body.reply_to_message_id = reply_to_message_id;
891
+ if (allow_sending_without_reply !== undefined)
892
+ body.allow_sending_without_reply = allow_sending_without_reply;
893
+ if (reply_markup)
894
+ body.reply_markup = reply_markup;
895
+ const response = await this.makeTelegramApiCall('sendDocument', body);
896
+ return {
897
+ operation: 'send_document',
898
+ ok: response.ok,
899
+ message: response.ok && response.result
900
+ ? response.result
901
+ : undefined,
902
+ error: !response.ok
903
+ ? response.description ||
904
+ `Error code: ${response.error_code || 'unknown'}`
905
+ : '',
906
+ success: response.ok,
907
+ };
908
+ }
909
+ async editMessage(params) {
910
+ const { chat_id, message_id, inline_message_id, text, parse_mode, entities, disable_web_page_preview, reply_markup, } = params;
911
+ const body = {
912
+ text,
913
+ };
914
+ if (chat_id)
915
+ body.chat_id = chat_id;
916
+ if (message_id !== undefined)
917
+ body.message_id = message_id;
918
+ if (inline_message_id)
919
+ body.inline_message_id = inline_message_id;
920
+ if (parse_mode)
921
+ body.parse_mode = parse_mode;
922
+ if (entities)
923
+ body.entities = entities;
924
+ if (disable_web_page_preview !== undefined)
925
+ body.disable_web_page_preview = disable_web_page_preview;
926
+ if (reply_markup)
927
+ body.reply_markup = reply_markup;
928
+ const response = await this.makeTelegramApiCall('editMessageText', body);
929
+ return {
930
+ operation: 'edit_message',
931
+ ok: response.ok,
932
+ message: response.ok && response.result
933
+ ? response.result
934
+ : undefined,
935
+ error: !response.ok
936
+ ? response.description ||
937
+ `Error code: ${response.error_code || 'unknown'}`
938
+ : '',
939
+ success: response.ok,
940
+ };
941
+ }
942
+ async deleteMessage(params) {
943
+ const { chat_id, message_id } = params;
944
+ const body = {
945
+ chat_id,
946
+ message_id,
947
+ };
948
+ const response = await this.makeTelegramApiCall('deleteMessage', body);
949
+ return {
950
+ operation: 'delete_message',
951
+ ok: response.ok,
952
+ error: !response.ok
953
+ ? response.description ||
954
+ `Error code: ${response.error_code || 'unknown'}`
955
+ : '',
956
+ success: response.ok,
957
+ };
958
+ }
959
+ async getMe(params) {
960
+ void params;
961
+ const response = await this.makeTelegramApiCall('getMe', {});
962
+ return {
963
+ operation: 'get_me',
964
+ ok: response.ok,
965
+ user: response.ok && response.result
966
+ ? response.result
967
+ : undefined,
968
+ error: !response.ok
969
+ ? response.description ||
970
+ `Error code: ${response.error_code || 'unknown'}`
971
+ : '',
972
+ success: response.ok,
973
+ };
974
+ }
975
+ async getChat(params) {
976
+ const { chat_id } = params;
977
+ const body = {
978
+ chat_id,
979
+ };
980
+ const response = await this.makeTelegramApiCall('getChat', body);
981
+ return {
982
+ operation: 'get_chat',
983
+ ok: response.ok,
984
+ chat: response.ok && response.result
985
+ ? response.result
986
+ : undefined,
987
+ error: !response.ok
988
+ ? response.description ||
989
+ `Error code: ${response.error_code || 'unknown'}`
990
+ : '',
991
+ success: response.ok,
992
+ };
993
+ }
994
+ async getUpdates(params) {
995
+ const parsed = TelegramParamsSchema.parse(params);
996
+ const { offset, limit, timeout, allowed_updates } = parsed;
997
+ const body = {};
998
+ if (offset !== undefined)
999
+ body.offset = offset;
1000
+ if (limit !== undefined)
1001
+ body.limit = limit;
1002
+ if (timeout !== undefined)
1003
+ body.timeout = timeout;
1004
+ if (allowed_updates)
1005
+ body.allowed_updates = allowed_updates;
1006
+ const response = await this.makeTelegramApiCall('getUpdates', body);
1007
+ return {
1008
+ operation: 'get_updates',
1009
+ ok: response.ok,
1010
+ updates: response.ok && response.result
1011
+ ? response.result
1012
+ : undefined,
1013
+ error: !response.ok
1014
+ ? response.description ||
1015
+ `Error code: ${response.error_code || 'unknown'}`
1016
+ : '',
1017
+ success: response.ok,
1018
+ };
1019
+ }
1020
+ async sendChatAction(params) {
1021
+ const { chat_id, action, message_thread_id } = params;
1022
+ const body = {
1023
+ chat_id,
1024
+ action,
1025
+ };
1026
+ if (message_thread_id !== undefined)
1027
+ body.message_thread_id = message_thread_id;
1028
+ const response = await this.makeTelegramApiCall('sendChatAction', body);
1029
+ return {
1030
+ operation: 'send_chat_action',
1031
+ ok: response.ok,
1032
+ error: !response.ok
1033
+ ? response.description ||
1034
+ `Error code: ${response.error_code || 'unknown'}`
1035
+ : '',
1036
+ success: response.ok,
1037
+ };
1038
+ }
1039
+ async setMessageReaction(params) {
1040
+ const { chat_id, message_id, reaction, is_big } = params;
1041
+ const body = {
1042
+ chat_id,
1043
+ message_id,
1044
+ };
1045
+ // Format reactions for Telegram API
1046
+ if (reaction !== undefined) {
1047
+ body.reaction = reaction.map((r) => {
1048
+ if (r.type === 'emoji') {
1049
+ return { type: 'emoji', emoji: r.emoji };
1050
+ }
1051
+ else {
1052
+ return { type: 'custom_emoji', custom_emoji_id: r.custom_emoji_id };
1053
+ }
1054
+ });
1055
+ }
1056
+ else {
1057
+ // Empty array to remove reactions
1058
+ body.reaction = [];
1059
+ }
1060
+ if (is_big !== undefined)
1061
+ body.is_big = is_big;
1062
+ const response = await this.makeTelegramApiCall('setMessageReaction', body);
1063
+ return {
1064
+ operation: 'set_message_reaction',
1065
+ ok: response.ok,
1066
+ error: !response.ok
1067
+ ? response.description ||
1068
+ `Error code: ${response.error_code || 'unknown'}`
1069
+ : '',
1070
+ success: response.ok,
1071
+ };
1072
+ }
1073
+ async setWebhook(params) {
1074
+ const { url, ip_address, max_connections, allowed_updates, drop_pending_updates, secret_token, } = params;
1075
+ const body = {
1076
+ url,
1077
+ };
1078
+ if (ip_address !== undefined)
1079
+ body.ip_address = ip_address;
1080
+ if (max_connections !== undefined)
1081
+ body.max_connections = max_connections;
1082
+ if (allowed_updates !== undefined)
1083
+ body.allowed_updates = allowed_updates;
1084
+ if (drop_pending_updates !== undefined)
1085
+ body.drop_pending_updates = drop_pending_updates;
1086
+ if (secret_token !== undefined)
1087
+ body.secret_token = secret_token;
1088
+ const response = await this.makeTelegramApiCall('setWebhook', body);
1089
+ return {
1090
+ operation: 'set_webhook',
1091
+ ok: response.ok,
1092
+ error: !response.ok
1093
+ ? response.description ||
1094
+ `Error code: ${response.error_code || 'unknown'}`
1095
+ : '',
1096
+ success: response.ok,
1097
+ };
1098
+ }
1099
+ async deleteWebhook(params) {
1100
+ const { drop_pending_updates } = params;
1101
+ const body = {};
1102
+ if (drop_pending_updates !== undefined)
1103
+ body.drop_pending_updates = drop_pending_updates;
1104
+ const response = await this.makeTelegramApiCall('deleteWebhook', body);
1105
+ return {
1106
+ operation: 'delete_webhook',
1107
+ ok: response.ok,
1108
+ error: !response.ok
1109
+ ? response.description ||
1110
+ `Error code: ${response.error_code || 'unknown'}`
1111
+ : '',
1112
+ success: response.ok,
1113
+ };
1114
+ }
1115
+ async getWebhookInfo(params) {
1116
+ void params;
1117
+ const response = await this.makeTelegramApiCall('getWebhookInfo', {});
1118
+ return {
1119
+ operation: 'get_webhook_info',
1120
+ ok: response.ok,
1121
+ webhook_info: response.ok && response.result
1122
+ ? response.result
1123
+ : undefined,
1124
+ error: !response.ok
1125
+ ? response.description ||
1126
+ `Error code: ${response.error_code || 'unknown'}`
1127
+ : '',
1128
+ success: response.ok,
1129
+ };
1130
+ }
1131
+ }
1132
+ //# sourceMappingURL=telegram.js.map