digital-tools 2.0.1

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 (452) hide show
  1. package/.turbo/turbo-build.log +5 -0
  2. package/CHANGELOG.md +9 -0
  3. package/README.md +1144 -0
  4. package/dist/define.d.ts +109 -0
  5. package/dist/define.d.ts.map +1 -0
  6. package/dist/define.js +268 -0
  7. package/dist/define.js.map +1 -0
  8. package/dist/entities/advertising.d.ts +79 -0
  9. package/dist/entities/advertising.d.ts.map +1 -0
  10. package/dist/entities/advertising.js +1000 -0
  11. package/dist/entities/advertising.js.map +1 -0
  12. package/dist/entities/ai.d.ts +69 -0
  13. package/dist/entities/ai.d.ts.map +1 -0
  14. package/dist/entities/ai.js +757 -0
  15. package/dist/entities/ai.js.map +1 -0
  16. package/dist/entities/analytics.d.ts +83 -0
  17. package/dist/entities/analytics.d.ts.map +1 -0
  18. package/dist/entities/analytics.js +1589 -0
  19. package/dist/entities/analytics.js.map +1 -0
  20. package/dist/entities/automation.d.ts +61 -0
  21. package/dist/entities/automation.d.ts.map +1 -0
  22. package/dist/entities/automation.js +602 -0
  23. package/dist/entities/automation.js.map +1 -0
  24. package/dist/entities/communication.d.ts +96 -0
  25. package/dist/entities/communication.d.ts.map +1 -0
  26. package/dist/entities/communication.js +1151 -0
  27. package/dist/entities/communication.js.map +1 -0
  28. package/dist/entities/crm.d.ts +91 -0
  29. package/dist/entities/crm.d.ts.map +1 -0
  30. package/dist/entities/crm.js +1387 -0
  31. package/dist/entities/crm.js.map +1 -0
  32. package/dist/entities/design.d.ts +61 -0
  33. package/dist/entities/design.d.ts.map +1 -0
  34. package/dist/entities/design.js +547 -0
  35. package/dist/entities/design.js.map +1 -0
  36. package/dist/entities/development.d.ts +145 -0
  37. package/dist/entities/development.d.ts.map +1 -0
  38. package/dist/entities/development.js +2213 -0
  39. package/dist/entities/development.js.map +1 -0
  40. package/dist/entities/document.d.ts +54 -0
  41. package/dist/entities/document.d.ts.map +1 -0
  42. package/dist/entities/document.js +875 -0
  43. package/dist/entities/document.js.map +1 -0
  44. package/dist/entities/ecommerce.d.ts +93 -0
  45. package/dist/entities/ecommerce.d.ts.map +1 -0
  46. package/dist/entities/ecommerce.js +1430 -0
  47. package/dist/entities/ecommerce.js.map +1 -0
  48. package/dist/entities/experiment.d.ts +89 -0
  49. package/dist/entities/experiment.d.ts.map +1 -0
  50. package/dist/entities/experiment.js +1040 -0
  51. package/dist/entities/experiment.js.map +1 -0
  52. package/dist/entities/finance.d.ts +272 -0
  53. package/dist/entities/finance.d.ts.map +1 -0
  54. package/dist/entities/finance.js +3479 -0
  55. package/dist/entities/finance.js.map +1 -0
  56. package/dist/entities/forms.d.ts +91 -0
  57. package/dist/entities/forms.d.ts.map +1 -0
  58. package/dist/entities/forms.js +1893 -0
  59. package/dist/entities/forms.js.map +1 -0
  60. package/dist/entities/hr.d.ts +62 -0
  61. package/dist/entities/hr.d.ts.map +1 -0
  62. package/dist/entities/hr.js +662 -0
  63. package/dist/entities/hr.js.map +1 -0
  64. package/dist/entities/identity.d.ts +90 -0
  65. package/dist/entities/identity.d.ts.map +1 -0
  66. package/dist/entities/identity.js +998 -0
  67. package/dist/entities/identity.js.map +1 -0
  68. package/dist/entities/index.d.ts +410 -0
  69. package/dist/entities/index.d.ts.map +1 -0
  70. package/dist/entities/index.js +283 -0
  71. package/dist/entities/index.js.map +1 -0
  72. package/dist/entities/infrastructure.d.ts +98 -0
  73. package/dist/entities/infrastructure.d.ts.map +1 -0
  74. package/dist/entities/infrastructure.js +1154 -0
  75. package/dist/entities/infrastructure.js.map +1 -0
  76. package/dist/entities/knowledge.d.ts +98 -0
  77. package/dist/entities/knowledge.d.ts.map +1 -0
  78. package/dist/entities/knowledge.js +1439 -0
  79. package/dist/entities/knowledge.js.map +1 -0
  80. package/dist/entities/marketing.d.ts +82 -0
  81. package/dist/entities/marketing.d.ts.map +1 -0
  82. package/dist/entities/marketing.js +1611 -0
  83. package/dist/entities/marketing.js.map +1 -0
  84. package/dist/entities/media.d.ts +83 -0
  85. package/dist/entities/media.d.ts.map +1 -0
  86. package/dist/entities/media.js +1635 -0
  87. package/dist/entities/media.js.map +1 -0
  88. package/dist/entities/notification.d.ts +76 -0
  89. package/dist/entities/notification.d.ts.map +1 -0
  90. package/dist/entities/notification.js +1200 -0
  91. package/dist/entities/notification.js.map +1 -0
  92. package/dist/entities/presentation.d.ts +61 -0
  93. package/dist/entities/presentation.d.ts.map +1 -0
  94. package/dist/entities/presentation.js +1275 -0
  95. package/dist/entities/presentation.js.map +1 -0
  96. package/dist/entities/productivity.d.ts +92 -0
  97. package/dist/entities/productivity.d.ts.map +1 -0
  98. package/dist/entities/productivity.js +1318 -0
  99. package/dist/entities/productivity.js.map +1 -0
  100. package/dist/entities/project-management.d.ts +89 -0
  101. package/dist/entities/project-management.d.ts.map +1 -0
  102. package/dist/entities/project-management.js +1137 -0
  103. package/dist/entities/project-management.js.map +1 -0
  104. package/dist/entities/recruiting.d.ts +54 -0
  105. package/dist/entities/recruiting.d.ts.map +1 -0
  106. package/dist/entities/recruiting.js +737 -0
  107. package/dist/entities/recruiting.js.map +1 -0
  108. package/dist/entities/shipping.d.ts +52 -0
  109. package/dist/entities/shipping.d.ts.map +1 -0
  110. package/dist/entities/shipping.js +510 -0
  111. package/dist/entities/shipping.js.map +1 -0
  112. package/dist/entities/signature.d.ts +83 -0
  113. package/dist/entities/signature.d.ts.map +1 -0
  114. package/dist/entities/signature.js +1103 -0
  115. package/dist/entities/signature.js.map +1 -0
  116. package/dist/entities/site.d.ts +33 -0
  117. package/dist/entities/site.d.ts.map +1 -0
  118. package/dist/entities/site.js +223 -0
  119. package/dist/entities/site.js.map +1 -0
  120. package/dist/entities/spreadsheet.d.ts +68 -0
  121. package/dist/entities/spreadsheet.d.ts.map +1 -0
  122. package/dist/entities/spreadsheet.js +1342 -0
  123. package/dist/entities/spreadsheet.js.map +1 -0
  124. package/dist/entities/storage.d.ts +74 -0
  125. package/dist/entities/storage.d.ts.map +1 -0
  126. package/dist/entities/storage.js +1199 -0
  127. package/dist/entities/storage.js.map +1 -0
  128. package/dist/entities/support.d.ts +83 -0
  129. package/dist/entities/support.d.ts.map +1 -0
  130. package/dist/entities/support.js +1167 -0
  131. package/dist/entities/support.js.map +1 -0
  132. package/dist/entities/video-conferencing.d.ts +129 -0
  133. package/dist/entities/video-conferencing.d.ts.map +1 -0
  134. package/dist/entities/video-conferencing.js +1751 -0
  135. package/dist/entities/video-conferencing.js.map +1 -0
  136. package/dist/entities/video.d.ts +76 -0
  137. package/dist/entities/video.d.ts.map +1 -0
  138. package/dist/entities/video.js +951 -0
  139. package/dist/entities/video.js.map +1 -0
  140. package/dist/entities.d.ts +147 -0
  141. package/dist/entities.d.ts.map +1 -0
  142. package/dist/entities.js +1664 -0
  143. package/dist/entities.js.map +1 -0
  144. package/dist/index.d.ts +29 -0
  145. package/dist/index.d.ts.map +1 -0
  146. package/dist/index.js +75 -0
  147. package/dist/index.js.map +1 -0
  148. package/dist/providers/analytics/index.d.ts +19 -0
  149. package/dist/providers/analytics/index.d.ts.map +1 -0
  150. package/dist/providers/analytics/index.js +18 -0
  151. package/dist/providers/analytics/index.js.map +1 -0
  152. package/dist/providers/analytics/mixpanel.d.ts +25 -0
  153. package/dist/providers/analytics/mixpanel.d.ts.map +1 -0
  154. package/dist/providers/analytics/mixpanel.js +256 -0
  155. package/dist/providers/analytics/mixpanel.js.map +1 -0
  156. package/dist/providers/calendar/cal-com.d.ts +26 -0
  157. package/dist/providers/calendar/cal-com.d.ts.map +1 -0
  158. package/dist/providers/calendar/cal-com.js +304 -0
  159. package/dist/providers/calendar/cal-com.js.map +1 -0
  160. package/dist/providers/calendar/google-calendar.d.ts +25 -0
  161. package/dist/providers/calendar/google-calendar.d.ts.map +1 -0
  162. package/dist/providers/calendar/google-calendar.js +336 -0
  163. package/dist/providers/calendar/google-calendar.js.map +1 -0
  164. package/dist/providers/calendar/index.d.ts +20 -0
  165. package/dist/providers/calendar/index.d.ts.map +1 -0
  166. package/dist/providers/calendar/index.js +21 -0
  167. package/dist/providers/calendar/index.js.map +1 -0
  168. package/dist/providers/crm/hubspot.d.ts +25 -0
  169. package/dist/providers/crm/hubspot.d.ts.map +1 -0
  170. package/dist/providers/crm/hubspot.js +567 -0
  171. package/dist/providers/crm/hubspot.js.map +1 -0
  172. package/dist/providers/crm/index.d.ts +19 -0
  173. package/dist/providers/crm/index.d.ts.map +1 -0
  174. package/dist/providers/crm/index.js +18 -0
  175. package/dist/providers/crm/index.js.map +1 -0
  176. package/dist/providers/development/github.d.ts +25 -0
  177. package/dist/providers/development/github.d.ts.map +1 -0
  178. package/dist/providers/development/github.js +473 -0
  179. package/dist/providers/development/github.js.map +1 -0
  180. package/dist/providers/development/index.d.ts +19 -0
  181. package/dist/providers/development/index.d.ts.map +1 -0
  182. package/dist/providers/development/index.js +18 -0
  183. package/dist/providers/development/index.js.map +1 -0
  184. package/dist/providers/ecommerce/index.d.ts +19 -0
  185. package/dist/providers/ecommerce/index.d.ts.map +1 -0
  186. package/dist/providers/ecommerce/index.js +18 -0
  187. package/dist/providers/ecommerce/index.js.map +1 -0
  188. package/dist/providers/ecommerce/shopify.d.ts +25 -0
  189. package/dist/providers/ecommerce/shopify.d.ts.map +1 -0
  190. package/dist/providers/ecommerce/shopify.js +379 -0
  191. package/dist/providers/ecommerce/shopify.js.map +1 -0
  192. package/dist/providers/email/index.d.ts +20 -0
  193. package/dist/providers/email/index.d.ts.map +1 -0
  194. package/dist/providers/email/index.js +21 -0
  195. package/dist/providers/email/index.js.map +1 -0
  196. package/dist/providers/email/resend.d.ts +25 -0
  197. package/dist/providers/email/resend.d.ts.map +1 -0
  198. package/dist/providers/email/resend.js +259 -0
  199. package/dist/providers/email/resend.js.map +1 -0
  200. package/dist/providers/email/sendgrid.d.ts +25 -0
  201. package/dist/providers/email/sendgrid.d.ts.map +1 -0
  202. package/dist/providers/email/sendgrid.js +162 -0
  203. package/dist/providers/email/sendgrid.js.map +1 -0
  204. package/dist/providers/finance/index.d.ts +19 -0
  205. package/dist/providers/finance/index.d.ts.map +1 -0
  206. package/dist/providers/finance/index.js +18 -0
  207. package/dist/providers/finance/index.js.map +1 -0
  208. package/dist/providers/finance/stripe.d.ts +25 -0
  209. package/dist/providers/finance/stripe.d.ts.map +1 -0
  210. package/dist/providers/finance/stripe.js +550 -0
  211. package/dist/providers/finance/stripe.js.map +1 -0
  212. package/dist/providers/forms/index.d.ts +19 -0
  213. package/dist/providers/forms/index.d.ts.map +1 -0
  214. package/dist/providers/forms/index.js +18 -0
  215. package/dist/providers/forms/index.js.map +1 -0
  216. package/dist/providers/forms/typeform.d.ts +25 -0
  217. package/dist/providers/forms/typeform.d.ts.map +1 -0
  218. package/dist/providers/forms/typeform.js +501 -0
  219. package/dist/providers/forms/typeform.js.map +1 -0
  220. package/dist/providers/index.d.ts +56 -0
  221. package/dist/providers/index.d.ts.map +1 -0
  222. package/dist/providers/index.js +124 -0
  223. package/dist/providers/index.js.map +1 -0
  224. package/dist/providers/knowledge/index.d.ts +19 -0
  225. package/dist/providers/knowledge/index.d.ts.map +1 -0
  226. package/dist/providers/knowledge/index.js +18 -0
  227. package/dist/providers/knowledge/index.js.map +1 -0
  228. package/dist/providers/knowledge/notion.d.ts +25 -0
  229. package/dist/providers/knowledge/notion.d.ts.map +1 -0
  230. package/dist/providers/knowledge/notion.js +390 -0
  231. package/dist/providers/knowledge/notion.js.map +1 -0
  232. package/dist/providers/marketing/index.d.ts +19 -0
  233. package/dist/providers/marketing/index.d.ts.map +1 -0
  234. package/dist/providers/marketing/index.js +18 -0
  235. package/dist/providers/marketing/index.js.map +1 -0
  236. package/dist/providers/marketing/mailchimp.d.ts +25 -0
  237. package/dist/providers/marketing/mailchimp.d.ts.map +1 -0
  238. package/dist/providers/marketing/mailchimp.js +444 -0
  239. package/dist/providers/marketing/mailchimp.js.map +1 -0
  240. package/dist/providers/media/cloudinary.d.ts +25 -0
  241. package/dist/providers/media/cloudinary.d.ts.map +1 -0
  242. package/dist/providers/media/cloudinary.js +319 -0
  243. package/dist/providers/media/cloudinary.js.map +1 -0
  244. package/dist/providers/media/index.d.ts +19 -0
  245. package/dist/providers/media/index.d.ts.map +1 -0
  246. package/dist/providers/media/index.js +18 -0
  247. package/dist/providers/media/index.js.map +1 -0
  248. package/dist/providers/messaging/index.d.ts +24 -0
  249. package/dist/providers/messaging/index.d.ts.map +1 -0
  250. package/dist/providers/messaging/index.js +21 -0
  251. package/dist/providers/messaging/index.js.map +1 -0
  252. package/dist/providers/messaging/slack.d.ts +25 -0
  253. package/dist/providers/messaging/slack.d.ts.map +1 -0
  254. package/dist/providers/messaging/slack.js +394 -0
  255. package/dist/providers/messaging/slack.js.map +1 -0
  256. package/dist/providers/messaging/twilio-sms.d.ts +25 -0
  257. package/dist/providers/messaging/twilio-sms.d.ts.map +1 -0
  258. package/dist/providers/messaging/twilio-sms.js +250 -0
  259. package/dist/providers/messaging/twilio-sms.js.map +1 -0
  260. package/dist/providers/project-management/index.d.ts +19 -0
  261. package/dist/providers/project-management/index.d.ts.map +1 -0
  262. package/dist/providers/project-management/index.js +18 -0
  263. package/dist/providers/project-management/index.js.map +1 -0
  264. package/dist/providers/project-management/linear.d.ts +25 -0
  265. package/dist/providers/project-management/linear.d.ts.map +1 -0
  266. package/dist/providers/project-management/linear.js +576 -0
  267. package/dist/providers/project-management/linear.js.map +1 -0
  268. package/dist/providers/registry.d.ts +41 -0
  269. package/dist/providers/registry.d.ts.map +1 -0
  270. package/dist/providers/registry.js +87 -0
  271. package/dist/providers/registry.js.map +1 -0
  272. package/dist/providers/spreadsheet/google-sheets.d.ts +25 -0
  273. package/dist/providers/spreadsheet/google-sheets.d.ts.map +1 -0
  274. package/dist/providers/spreadsheet/google-sheets.js +376 -0
  275. package/dist/providers/spreadsheet/google-sheets.js.map +1 -0
  276. package/dist/providers/spreadsheet/index.d.ts +20 -0
  277. package/dist/providers/spreadsheet/index.d.ts.map +1 -0
  278. package/dist/providers/spreadsheet/index.js +21 -0
  279. package/dist/providers/spreadsheet/index.js.map +1 -0
  280. package/dist/providers/spreadsheet/xlsx.d.ts +26 -0
  281. package/dist/providers/spreadsheet/xlsx.d.ts.map +1 -0
  282. package/dist/providers/spreadsheet/xlsx.js +424 -0
  283. package/dist/providers/spreadsheet/xlsx.js.map +1 -0
  284. package/dist/providers/storage/index.d.ts +30 -0
  285. package/dist/providers/storage/index.d.ts.map +1 -0
  286. package/dist/providers/storage/index.js +25 -0
  287. package/dist/providers/storage/index.js.map +1 -0
  288. package/dist/providers/storage/s3.d.ts +25 -0
  289. package/dist/providers/storage/s3.d.ts.map +1 -0
  290. package/dist/providers/storage/s3.js +420 -0
  291. package/dist/providers/storage/s3.js.map +1 -0
  292. package/dist/providers/support/index.d.ts +19 -0
  293. package/dist/providers/support/index.d.ts.map +1 -0
  294. package/dist/providers/support/index.js +18 -0
  295. package/dist/providers/support/index.js.map +1 -0
  296. package/dist/providers/support/zendesk.d.ts +25 -0
  297. package/dist/providers/support/zendesk.d.ts.map +1 -0
  298. package/dist/providers/support/zendesk.js +374 -0
  299. package/dist/providers/support/zendesk.js.map +1 -0
  300. package/dist/providers/tasks/index.d.ts +19 -0
  301. package/dist/providers/tasks/index.d.ts.map +1 -0
  302. package/dist/providers/tasks/index.js +18 -0
  303. package/dist/providers/tasks/index.js.map +1 -0
  304. package/dist/providers/tasks/todoist.d.ts +25 -0
  305. package/dist/providers/tasks/todoist.d.ts.map +1 -0
  306. package/dist/providers/tasks/todoist.js +287 -0
  307. package/dist/providers/tasks/todoist.js.map +1 -0
  308. package/dist/providers/types.d.ts +1753 -0
  309. package/dist/providers/types.d.ts.map +1 -0
  310. package/dist/providers/types.js +10 -0
  311. package/dist/providers/types.js.map +1 -0
  312. package/dist/providers/video-conferencing/google-meet.d.ts +26 -0
  313. package/dist/providers/video-conferencing/google-meet.d.ts.map +1 -0
  314. package/dist/providers/video-conferencing/google-meet.js +287 -0
  315. package/dist/providers/video-conferencing/google-meet.js.map +1 -0
  316. package/dist/providers/video-conferencing/index.d.ts +22 -0
  317. package/dist/providers/video-conferencing/index.d.ts.map +1 -0
  318. package/dist/providers/video-conferencing/index.js +32 -0
  319. package/dist/providers/video-conferencing/index.js.map +1 -0
  320. package/dist/providers/video-conferencing/jitsi.d.ts +26 -0
  321. package/dist/providers/video-conferencing/jitsi.d.ts.map +1 -0
  322. package/dist/providers/video-conferencing/jitsi.js +255 -0
  323. package/dist/providers/video-conferencing/jitsi.js.map +1 -0
  324. package/dist/providers/video-conferencing/teams.d.ts +26 -0
  325. package/dist/providers/video-conferencing/teams.d.ts.map +1 -0
  326. package/dist/providers/video-conferencing/teams.js +271 -0
  327. package/dist/providers/video-conferencing/teams.js.map +1 -0
  328. package/dist/providers/video-conferencing/zoom.d.ts +25 -0
  329. package/dist/providers/video-conferencing/zoom.d.ts.map +1 -0
  330. package/dist/providers/video-conferencing/zoom.js +333 -0
  331. package/dist/providers/video-conferencing/zoom.js.map +1 -0
  332. package/dist/providers/voice/vapi.d.ts +27 -0
  333. package/dist/providers/voice/vapi.d.ts.map +1 -0
  334. package/dist/providers/voice/vapi.js +440 -0
  335. package/dist/providers/voice/vapi.js.map +1 -0
  336. package/dist/registry.d.ts +38 -0
  337. package/dist/registry.d.ts.map +1 -0
  338. package/dist/registry.js +129 -0
  339. package/dist/registry.js.map +1 -0
  340. package/dist/tools/communication.d.ts +94 -0
  341. package/dist/tools/communication.d.ts.map +1 -0
  342. package/dist/tools/communication.js +185 -0
  343. package/dist/tools/communication.js.map +1 -0
  344. package/dist/tools/data.d.ts +61 -0
  345. package/dist/tools/data.d.ts.map +1 -0
  346. package/dist/tools/data.js +206 -0
  347. package/dist/tools/data.js.map +1 -0
  348. package/dist/tools/index.d.ts +12 -0
  349. package/dist/tools/index.d.ts.map +1 -0
  350. package/dist/tools/index.js +12 -0
  351. package/dist/tools/index.js.map +1 -0
  352. package/dist/tools/web.d.ts +45 -0
  353. package/dist/tools/web.d.ts.map +1 -0
  354. package/dist/tools/web.js +138 -0
  355. package/dist/tools/web.js.map +1 -0
  356. package/dist/types.d.ts +330 -0
  357. package/dist/types.d.ts.map +1 -0
  358. package/dist/types.js +11 -0
  359. package/dist/types.js.map +1 -0
  360. package/package.json +45 -0
  361. package/src/define.ts +321 -0
  362. package/src/entities/advertising.ts +1086 -0
  363. package/src/entities/ai.ts +835 -0
  364. package/src/entities/analytics.ts +1690 -0
  365. package/src/entities/automation.ts +669 -0
  366. package/src/entities/communication.ts +1255 -0
  367. package/src/entities/crm.ts +1481 -0
  368. package/src/entities/design.ts +606 -0
  369. package/src/entities/development.ts +2392 -0
  370. package/src/entities/document.ts +930 -0
  371. package/src/entities/ecommerce.ts +1539 -0
  372. package/src/entities/experiment.ts +1139 -0
  373. package/src/entities/finance.ts +3907 -0
  374. package/src/entities/forms.ts +2021 -0
  375. package/src/entities/hr.ts +725 -0
  376. package/src/entities/identity.ts +1093 -0
  377. package/src/entities/index.ts +731 -0
  378. package/src/entities/infrastructure.ts +1254 -0
  379. package/src/entities/knowledge.ts +1547 -0
  380. package/src/entities/marketing.ts +1718 -0
  381. package/src/entities/media.ts +1747 -0
  382. package/src/entities/notification.ts +1260 -0
  383. package/src/entities/presentation.ts +1360 -0
  384. package/src/entities/productivity.ts +1411 -0
  385. package/src/entities/project-management.ts +1222 -0
  386. package/src/entities/recruiting.ts +797 -0
  387. package/src/entities/shipping.ts +566 -0
  388. package/src/entities/signature.ts +1204 -0
  389. package/src/entities/site.ts +244 -0
  390. package/src/entities/spreadsheet.ts +1434 -0
  391. package/src/entities/storage.ts +1290 -0
  392. package/src/entities/support.ts +1267 -0
  393. package/src/entities/video-conferencing.ts +1874 -0
  394. package/src/entities/video.ts +1035 -0
  395. package/src/entities.ts +1795 -0
  396. package/src/index.ts +176 -0
  397. package/src/providers/analytics/index.ts +21 -0
  398. package/src/providers/analytics/mixpanel.ts +311 -0
  399. package/src/providers/calendar/cal-com.ts +435 -0
  400. package/src/providers/calendar/google-calendar.ts +412 -0
  401. package/src/providers/calendar/index.ts +24 -0
  402. package/src/providers/crm/hubspot.ts +667 -0
  403. package/src/providers/crm/index.ts +21 -0
  404. package/src/providers/development/github.ts +608 -0
  405. package/src/providers/development/index.ts +21 -0
  406. package/src/providers/ecommerce/index.ts +21 -0
  407. package/src/providers/ecommerce/shopify.ts +451 -0
  408. package/src/providers/email/index.ts +24 -0
  409. package/src/providers/email/resend.ts +301 -0
  410. package/src/providers/email/sendgrid.ts +196 -0
  411. package/src/providers/finance/index.ts +21 -0
  412. package/src/providers/finance/stripe.ts +665 -0
  413. package/src/providers/forms/index.ts +21 -0
  414. package/src/providers/forms/typeform.ts +598 -0
  415. package/src/providers/index.ts +281 -0
  416. package/src/providers/knowledge/index.ts +21 -0
  417. package/src/providers/knowledge/notion.ts +497 -0
  418. package/src/providers/marketing/index.ts +21 -0
  419. package/src/providers/marketing/mailchimp.ts +656 -0
  420. package/src/providers/media/cloudinary.ts +373 -0
  421. package/src/providers/media/index.ts +21 -0
  422. package/src/providers/messaging/index.ts +24 -0
  423. package/src/providers/messaging/slack.ts +487 -0
  424. package/src/providers/messaging/twilio-sms.ts +301 -0
  425. package/src/providers/project-management/index.ts +21 -0
  426. package/src/providers/project-management/linear.ts +693 -0
  427. package/src/providers/registry.ts +119 -0
  428. package/src/providers/spreadsheet/google-sheets.ts +464 -0
  429. package/src/providers/spreadsheet/index.ts +24 -0
  430. package/src/providers/spreadsheet/xlsx.ts +542 -0
  431. package/src/providers/storage/index.ts +35 -0
  432. package/src/providers/storage/s3.ts +513 -0
  433. package/src/providers/support/index.ts +21 -0
  434. package/src/providers/support/zendesk.ts +417 -0
  435. package/src/providers/tasks/index.ts +21 -0
  436. package/src/providers/tasks/todoist.ts +407 -0
  437. package/src/providers/types.ts +2113 -0
  438. package/src/providers/video-conferencing/google-meet.ts +412 -0
  439. package/src/providers/video-conferencing/index.ts +35 -0
  440. package/src/providers/video-conferencing/jitsi.ts +324 -0
  441. package/src/providers/video-conferencing/teams.ts +408 -0
  442. package/src/providers/video-conferencing/zoom.ts +451 -0
  443. package/src/registry.ts +172 -0
  444. package/src/tools/communication.ts +256 -0
  445. package/src/tools/data.ts +236 -0
  446. package/src/tools/index.ts +12 -0
  447. package/src/tools/web.ts +161 -0
  448. package/src/types.ts +539 -0
  449. package/test/define.test.ts +367 -0
  450. package/test/registry.test.ts +444 -0
  451. package/test/tools.test.ts +453 -0
  452. package/tsconfig.json +20 -0
@@ -0,0 +1,667 @@
1
+ /**
2
+ * HubSpot CRM Provider
3
+ *
4
+ * Concrete implementation of CRMProvider using HubSpot CRM API v3.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+
9
+ import type {
10
+ CRMProvider,
11
+ ProviderConfig,
12
+ ProviderHealth,
13
+ ProviderInfo,
14
+ CreateContactOptions,
15
+ CRMContactData,
16
+ ContactListOptions,
17
+ PaginatedResult,
18
+ CreateDealOptions,
19
+ DealData,
20
+ DealListOptions,
21
+ CreateActivityOptions,
22
+ CRMActivityData,
23
+ } from '../types.js'
24
+ import { defineProvider } from '../registry.js'
25
+
26
+ const HUBSPOT_API_URL = 'https://api.hubapi.com/crm/v3'
27
+
28
+ /**
29
+ * HubSpot provider info
30
+ */
31
+ export const hubspotInfo: ProviderInfo = {
32
+ id: 'crm.hubspot',
33
+ name: 'HubSpot',
34
+ description: 'HubSpot CRM platform for managing contacts, deals, and activities',
35
+ category: 'crm',
36
+ website: 'https://www.hubspot.com',
37
+ docsUrl: 'https://developers.hubspot.com/docs/api/overview',
38
+ requiredConfig: ['accessToken'],
39
+ optionalConfig: ['baseUrl'],
40
+ }
41
+
42
+ /**
43
+ * Map HubSpot contact properties to CRMContactData
44
+ */
45
+ function mapContactFromHubSpot(contact: any): CRMContactData {
46
+ const props = contact.properties || {}
47
+ return {
48
+ id: contact.id,
49
+ firstName: props.firstname || '',
50
+ lastName: props.lastname || '',
51
+ email: props.email,
52
+ phone: props.phone,
53
+ company: props.company,
54
+ title: props.jobtitle,
55
+ ownerId: props.hubspot_owner_id,
56
+ createdAt: new Date(props.createdate || contact.createdAt),
57
+ updatedAt: new Date(props.lastmodifieddate || contact.updatedAt),
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Map HubSpot deal properties to DealData
63
+ */
64
+ function mapDealFromHubSpot(deal: any): DealData {
65
+ const props = deal.properties || {}
66
+ return {
67
+ id: deal.id,
68
+ name: props.dealname || '',
69
+ value: props.amount ? parseFloat(props.amount) : undefined,
70
+ currency: props.deal_currency_code,
71
+ stage: props.dealstage || '',
72
+ probability: props.hs_deal_stage_probability ? parseFloat(props.hs_deal_stage_probability) : undefined,
73
+ contactId: props.associatedcontactid,
74
+ companyId: props.associatedcompanyid,
75
+ ownerId: props.hubspot_owner_id,
76
+ closeDate: props.closedate ? new Date(props.closedate) : undefined,
77
+ createdAt: new Date(props.createdate || deal.createdAt),
78
+ updatedAt: new Date(props.hs_lastmodifieddate || deal.updatedAt),
79
+ wonAt: props.hs_date_entered_closedwon ? new Date(props.hs_date_entered_closedwon) : undefined,
80
+ lostAt: props.hs_date_entered_closedlost ? new Date(props.hs_date_entered_closedlost) : undefined,
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Map HubSpot engagement to CRMActivityData
86
+ */
87
+ function mapActivityFromHubSpot(engagement: any, contactId: string): CRMActivityData {
88
+ const props = engagement.properties || {}
89
+ return {
90
+ id: engagement.id,
91
+ type: props.hs_engagement_type || 'note',
92
+ subject: props.hs_engagement_subject || '',
93
+ body: props.hs_note_body || props.hs_email_text || '',
94
+ contactId,
95
+ ownerId: props.hubspot_owner_id || '',
96
+ dueDate: props.hs_task_due_date ? new Date(props.hs_task_due_date) : undefined,
97
+ completedAt: props.hs_engagement_completed_at ? new Date(props.hs_engagement_completed_at) : undefined,
98
+ createdAt: new Date(props.hs_createdate || engagement.createdAt),
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Create HubSpot CRM provider
104
+ */
105
+ export function createHubSpotProvider(config: ProviderConfig): CRMProvider {
106
+ let accessToken: string
107
+ let baseUrl: string
108
+
109
+ // Helper function to associate deal with contact
110
+ async function associateDealWithContact(dealId: string, contactId: string): Promise<void> {
111
+ try {
112
+ const response = await fetch(
113
+ `${baseUrl}/objects/deals/${dealId}/associations/contacts/${contactId}/deal_to_contact`,
114
+ {
115
+ method: 'PUT',
116
+ headers: {
117
+ Authorization: `Bearer ${accessToken}`,
118
+ 'Content-Type': 'application/json',
119
+ },
120
+ }
121
+ )
122
+
123
+ if (!response.ok) {
124
+ throw new Error(`HTTP ${response.status}`)
125
+ }
126
+ } catch (error) {
127
+ // Log but don't throw - association is optional
128
+ console.warn('Failed to associate deal with contact:', error)
129
+ }
130
+ }
131
+
132
+ // Helper function to associate deal with company
133
+ async function associateDealWithCompany(dealId: string, companyId: string): Promise<void> {
134
+ try {
135
+ const response = await fetch(
136
+ `${baseUrl}/objects/deals/${dealId}/associations/companies/${companyId}/deal_to_company`,
137
+ {
138
+ method: 'PUT',
139
+ headers: {
140
+ Authorization: `Bearer ${accessToken}`,
141
+ 'Content-Type': 'application/json',
142
+ },
143
+ }
144
+ )
145
+
146
+ if (!response.ok) {
147
+ throw new Error(`HTTP ${response.status}`)
148
+ }
149
+ } catch (error) {
150
+ // Log but don't throw - association is optional
151
+ console.warn('Failed to associate deal with company:', error)
152
+ }
153
+ }
154
+
155
+ // Helper function to associate engagement with contact
156
+ async function associateEngagementWithContact(engagementId: string, contactId: string): Promise<void> {
157
+ try {
158
+ const response = await fetch(
159
+ `${baseUrl}/objects/engagements/${engagementId}/associations/contacts/${contactId}/engagement_to_contact`,
160
+ {
161
+ method: 'PUT',
162
+ headers: {
163
+ Authorization: `Bearer ${accessToken}`,
164
+ 'Content-Type': 'application/json',
165
+ },
166
+ }
167
+ )
168
+
169
+ if (!response.ok) {
170
+ throw new Error(`HTTP ${response.status}`)
171
+ }
172
+ } catch (error) {
173
+ console.warn('Failed to associate engagement with contact:', error)
174
+ }
175
+ }
176
+
177
+ return {
178
+ info: hubspotInfo,
179
+
180
+ async initialize(cfg: ProviderConfig): Promise<void> {
181
+ accessToken = cfg.accessToken as string
182
+ baseUrl = (cfg.baseUrl as string) || HUBSPOT_API_URL
183
+
184
+ if (!accessToken) {
185
+ throw new Error('HubSpot access token is required')
186
+ }
187
+ },
188
+
189
+ async healthCheck(): Promise<ProviderHealth> {
190
+ const start = Date.now()
191
+ try {
192
+ const response = await fetch(`${baseUrl}/objects/contacts?limit=1`, {
193
+ headers: {
194
+ Authorization: `Bearer ${accessToken}`,
195
+ 'Content-Type': 'application/json',
196
+ },
197
+ })
198
+
199
+ return {
200
+ healthy: response.ok,
201
+ latencyMs: Date.now() - start,
202
+ message: response.ok ? 'Connected' : `HTTP ${response.status}`,
203
+ checkedAt: new Date(),
204
+ }
205
+ } catch (error) {
206
+ return {
207
+ healthy: false,
208
+ latencyMs: Date.now() - start,
209
+ message: error instanceof Error ? error.message : 'Unknown error',
210
+ checkedAt: new Date(),
211
+ }
212
+ }
213
+ },
214
+
215
+ async dispose(): Promise<void> {
216
+ // No cleanup needed
217
+ },
218
+
219
+ async createContact(contact: CreateContactOptions): Promise<CRMContactData> {
220
+ const properties: Record<string, any> = {
221
+ firstname: contact.firstName,
222
+ lastname: contact.lastName,
223
+ }
224
+
225
+ if (contact.email) properties.email = contact.email
226
+ if (contact.phone) properties.phone = contact.phone
227
+ if (contact.company) properties.company = contact.company
228
+ if (contact.title) properties.jobtitle = contact.title
229
+
230
+ // Add custom fields
231
+ if (contact.customFields) {
232
+ Object.assign(properties, contact.customFields)
233
+ }
234
+
235
+ try {
236
+ const response = await fetch(`${baseUrl}/objects/contacts`, {
237
+ method: 'POST',
238
+ headers: {
239
+ Authorization: `Bearer ${accessToken}`,
240
+ 'Content-Type': 'application/json',
241
+ },
242
+ body: JSON.stringify({ properties }),
243
+ })
244
+
245
+ if (!response.ok) {
246
+ const errorData = await response.json().catch(() => ({}))
247
+ throw new Error((errorData as any)?.message || `HTTP ${response.status}`)
248
+ }
249
+
250
+ const data: any = await response.json()
251
+ return mapContactFromHubSpot(data)
252
+ } catch (error) {
253
+ throw new Error(
254
+ `Failed to create contact: ${error instanceof Error ? error.message : 'Unknown error'}`
255
+ )
256
+ }
257
+ },
258
+
259
+ async getContact(contactId: string): Promise<CRMContactData | null> {
260
+ try {
261
+ const response = await fetch(`${baseUrl}/objects/contacts/${contactId}`, {
262
+ headers: {
263
+ Authorization: `Bearer ${accessToken}`,
264
+ 'Content-Type': 'application/json',
265
+ },
266
+ })
267
+
268
+ if (response.status === 404) {
269
+ return null
270
+ }
271
+
272
+ if (!response.ok) {
273
+ throw new Error(`HTTP ${response.status}`)
274
+ }
275
+
276
+ const data: any = await response.json()
277
+ return mapContactFromHubSpot(data)
278
+ } catch (error) {
279
+ if (error instanceof Error && error.message.includes('404')) {
280
+ return null
281
+ }
282
+ throw new Error(
283
+ `Failed to get contact: ${error instanceof Error ? error.message : 'Unknown error'}`
284
+ )
285
+ }
286
+ },
287
+
288
+ async updateContact(
289
+ contactId: string,
290
+ updates: Partial<CreateContactOptions>
291
+ ): Promise<CRMContactData> {
292
+ const properties: Record<string, any> = {}
293
+
294
+ if (updates.firstName !== undefined) properties.firstname = updates.firstName
295
+ if (updates.lastName !== undefined) properties.lastname = updates.lastName
296
+ if (updates.email !== undefined) properties.email = updates.email
297
+ if (updates.phone !== undefined) properties.phone = updates.phone
298
+ if (updates.company !== undefined) properties.company = updates.company
299
+ if (updates.title !== undefined) properties.jobtitle = updates.title
300
+
301
+ // Add custom fields
302
+ if (updates.customFields) {
303
+ Object.assign(properties, updates.customFields)
304
+ }
305
+
306
+ try {
307
+ const response = await fetch(`${baseUrl}/objects/contacts/${contactId}`, {
308
+ method: 'PATCH',
309
+ headers: {
310
+ Authorization: `Bearer ${accessToken}`,
311
+ 'Content-Type': 'application/json',
312
+ },
313
+ body: JSON.stringify({ properties }),
314
+ })
315
+
316
+ if (!response.ok) {
317
+ const errorData = await response.json().catch(() => ({}))
318
+ throw new Error((errorData as any)?.message || `HTTP ${response.status}`)
319
+ }
320
+
321
+ const data: any = await response.json()
322
+ return mapContactFromHubSpot(data)
323
+ } catch (error) {
324
+ throw new Error(
325
+ `Failed to update contact: ${error instanceof Error ? error.message : 'Unknown error'}`
326
+ )
327
+ }
328
+ },
329
+
330
+ async listContacts(options?: ContactListOptions): Promise<PaginatedResult<CRMContactData>> {
331
+ const params = new URLSearchParams({
332
+ limit: String(options?.limit || 100),
333
+ })
334
+
335
+ if (options?.cursor) {
336
+ params.set('after', options.cursor)
337
+ }
338
+
339
+ try {
340
+ const response = await fetch(`${baseUrl}/objects/contacts?${params}`, {
341
+ headers: {
342
+ Authorization: `Bearer ${accessToken}`,
343
+ 'Content-Type': 'application/json',
344
+ },
345
+ })
346
+
347
+ if (!response.ok) {
348
+ throw new Error(`HTTP ${response.status}`)
349
+ }
350
+
351
+ const data: any = await response.json()
352
+ return {
353
+ items: (data.results || []).map(mapContactFromHubSpot),
354
+ total: data.total,
355
+ hasMore: !!data.paging?.next,
356
+ nextCursor: data.paging?.next?.after,
357
+ }
358
+ } catch (error) {
359
+ throw new Error(
360
+ `Failed to list contacts: ${error instanceof Error ? error.message : 'Unknown error'}`
361
+ )
362
+ }
363
+ },
364
+
365
+ async searchContacts(query: string): Promise<CRMContactData[]> {
366
+ try {
367
+ const response = await fetch(`${baseUrl}/objects/contacts/search`, {
368
+ method: 'POST',
369
+ headers: {
370
+ Authorization: `Bearer ${accessToken}`,
371
+ 'Content-Type': 'application/json',
372
+ },
373
+ body: JSON.stringify({
374
+ filterGroups: [
375
+ {
376
+ filters: [
377
+ {
378
+ propertyName: 'email',
379
+ operator: 'CONTAINS_TOKEN',
380
+ value: query,
381
+ },
382
+ {
383
+ propertyName: 'firstname',
384
+ operator: 'CONTAINS_TOKEN',
385
+ value: query,
386
+ },
387
+ {
388
+ propertyName: 'lastname',
389
+ operator: 'CONTAINS_TOKEN',
390
+ value: query,
391
+ },
392
+ ],
393
+ },
394
+ ],
395
+ limit: 100,
396
+ }),
397
+ })
398
+
399
+ if (!response.ok) {
400
+ throw new Error(`HTTP ${response.status}`)
401
+ }
402
+
403
+ const data: any = await response.json()
404
+ return (data.results || []).map(mapContactFromHubSpot)
405
+ } catch (error) {
406
+ throw new Error(
407
+ `Failed to search contacts: ${error instanceof Error ? error.message : 'Unknown error'}`
408
+ )
409
+ }
410
+ },
411
+
412
+ async createDeal(deal: CreateDealOptions): Promise<DealData> {
413
+ const properties: Record<string, any> = {
414
+ dealname: deal.name,
415
+ dealstage: deal.stage,
416
+ }
417
+
418
+ if (deal.value !== undefined) properties.amount = String(deal.value)
419
+ if (deal.currency) properties.deal_currency_code = deal.currency
420
+ if (deal.closeDate) properties.closedate = deal.closeDate.toISOString()
421
+ if (deal.probability !== undefined) properties.hs_deal_stage_probability = String(deal.probability)
422
+
423
+ try {
424
+ const response = await fetch(`${baseUrl}/objects/deals`, {
425
+ method: 'POST',
426
+ headers: {
427
+ Authorization: `Bearer ${accessToken}`,
428
+ 'Content-Type': 'application/json',
429
+ },
430
+ body: JSON.stringify({ properties }),
431
+ })
432
+
433
+ if (!response.ok) {
434
+ const errorData = await response.json().catch(() => ({}))
435
+ throw new Error((errorData as any)?.message || `HTTP ${response.status}`)
436
+ }
437
+
438
+ const data: any = await response.json()
439
+ const dealData = mapDealFromHubSpot(data)
440
+
441
+ // Associate with contact if specified
442
+ if (deal.contactId) {
443
+ await associateDealWithContact(dealData.id, deal.contactId)
444
+ }
445
+
446
+ // Associate with company if specified
447
+ if (deal.companyId) {
448
+ await associateDealWithCompany(dealData.id, deal.companyId)
449
+ }
450
+
451
+ return dealData
452
+ } catch (error) {
453
+ throw new Error(
454
+ `Failed to create deal: ${error instanceof Error ? error.message : 'Unknown error'}`
455
+ )
456
+ }
457
+ },
458
+
459
+ async getDeal(dealId: string): Promise<DealData | null> {
460
+ try {
461
+ const response = await fetch(`${baseUrl}/objects/deals/${dealId}`, {
462
+ headers: {
463
+ Authorization: `Bearer ${accessToken}`,
464
+ 'Content-Type': 'application/json',
465
+ },
466
+ })
467
+
468
+ if (response.status === 404) {
469
+ return null
470
+ }
471
+
472
+ if (!response.ok) {
473
+ throw new Error(`HTTP ${response.status}`)
474
+ }
475
+
476
+ const data: any = await response.json()
477
+ return mapDealFromHubSpot(data)
478
+ } catch (error) {
479
+ if (error instanceof Error && error.message.includes('404')) {
480
+ return null
481
+ }
482
+ throw new Error(
483
+ `Failed to get deal: ${error instanceof Error ? error.message : 'Unknown error'}`
484
+ )
485
+ }
486
+ },
487
+
488
+ async updateDeal(dealId: string, updates: Partial<CreateDealOptions>): Promise<DealData> {
489
+ const properties: Record<string, any> = {}
490
+
491
+ if (updates.name !== undefined) properties.dealname = updates.name
492
+ if (updates.stage !== undefined) properties.dealstage = updates.stage
493
+ if (updates.value !== undefined) properties.amount = String(updates.value)
494
+ if (updates.currency !== undefined) properties.deal_currency_code = updates.currency
495
+ if (updates.closeDate !== undefined) properties.closedate = updates.closeDate.toISOString()
496
+ if (updates.probability !== undefined) properties.hs_deal_stage_probability = String(updates.probability)
497
+
498
+ try {
499
+ const response = await fetch(`${baseUrl}/objects/deals/${dealId}`, {
500
+ method: 'PATCH',
501
+ headers: {
502
+ Authorization: `Bearer ${accessToken}`,
503
+ 'Content-Type': 'application/json',
504
+ },
505
+ body: JSON.stringify({ properties }),
506
+ })
507
+
508
+ if (!response.ok) {
509
+ const errorData = await response.json().catch(() => ({}))
510
+ throw new Error((errorData as any)?.message || `HTTP ${response.status}`)
511
+ }
512
+
513
+ const data: any = await response.json()
514
+ return mapDealFromHubSpot(data)
515
+ } catch (error) {
516
+ throw new Error(
517
+ `Failed to update deal: ${error instanceof Error ? error.message : 'Unknown error'}`
518
+ )
519
+ }
520
+ },
521
+
522
+ async listDeals(options?: DealListOptions): Promise<PaginatedResult<DealData>> {
523
+ const params = new URLSearchParams({
524
+ limit: String(options?.limit || 100),
525
+ })
526
+
527
+ if (options?.cursor) {
528
+ params.set('after', options.cursor)
529
+ }
530
+
531
+ try {
532
+ const response = await fetch(`${baseUrl}/objects/deals?${params}`, {
533
+ headers: {
534
+ Authorization: `Bearer ${accessToken}`,
535
+ 'Content-Type': 'application/json',
536
+ },
537
+ })
538
+
539
+ if (!response.ok) {
540
+ throw new Error(`HTTP ${response.status}`)
541
+ }
542
+
543
+ const data: any = await response.json()
544
+ return {
545
+ items: (data.results || []).map(mapDealFromHubSpot),
546
+ total: data.total,
547
+ hasMore: !!data.paging?.next,
548
+ nextCursor: data.paging?.next?.after,
549
+ }
550
+ } catch (error) {
551
+ throw new Error(
552
+ `Failed to list deals: ${error instanceof Error ? error.message : 'Unknown error'}`
553
+ )
554
+ }
555
+ },
556
+
557
+ async logActivity(contactId: string, activity: CreateActivityOptions): Promise<CRMActivityData> {
558
+ // Map activity type to HubSpot engagement type
559
+ const engagementType = activity.type === 'email' ? 'EMAIL' :
560
+ activity.type === 'call' ? 'CALL' :
561
+ activity.type === 'meeting' ? 'MEETING' :
562
+ activity.type === 'task' ? 'TASK' :
563
+ 'NOTE'
564
+
565
+ const properties: Record<string, any> = {
566
+ hs_engagement_type: engagementType.toLowerCase(),
567
+ hs_engagement_subject: activity.subject,
568
+ }
569
+
570
+ if (activity.body) {
571
+ if (engagementType === 'NOTE') {
572
+ properties.hs_note_body = activity.body
573
+ } else if (engagementType === 'EMAIL') {
574
+ properties.hs_email_text = activity.body
575
+ }
576
+ }
577
+
578
+ if (activity.dueDate) {
579
+ properties.hs_task_due_date = activity.dueDate.toISOString()
580
+ }
581
+
582
+ try {
583
+ const response = await fetch(`${baseUrl}/objects/engagements`, {
584
+ method: 'POST',
585
+ headers: {
586
+ Authorization: `Bearer ${accessToken}`,
587
+ 'Content-Type': 'application/json',
588
+ },
589
+ body: JSON.stringify({ properties }),
590
+ })
591
+
592
+ if (!response.ok) {
593
+ const errorData = await response.json().catch(() => ({}))
594
+ throw new Error((errorData as any)?.message || `HTTP ${response.status}`)
595
+ }
596
+
597
+ const data: any = await response.json()
598
+
599
+ // Associate engagement with contact
600
+ await associateEngagementWithContact(data.id, contactId)
601
+
602
+ return mapActivityFromHubSpot(data, contactId)
603
+ } catch (error) {
604
+ throw new Error(
605
+ `Failed to log activity: ${error instanceof Error ? error.message : 'Unknown error'}`
606
+ )
607
+ }
608
+ },
609
+
610
+ async listActivities(contactId: string): Promise<CRMActivityData[]> {
611
+ try {
612
+ // Get associated engagements for the contact
613
+ const response = await fetch(
614
+ `${baseUrl}/objects/contacts/${contactId}/associations/engagements`,
615
+ {
616
+ headers: {
617
+ Authorization: `Bearer ${accessToken}`,
618
+ 'Content-Type': 'application/json',
619
+ },
620
+ }
621
+ )
622
+
623
+ if (!response.ok) {
624
+ throw new Error(`HTTP ${response.status}`)
625
+ }
626
+
627
+ const data: any = await response.json()
628
+ const engagementIds = (data.results || []).map((r: any) => r.id)
629
+
630
+ if (engagementIds.length === 0) {
631
+ return []
632
+ }
633
+
634
+ // Fetch engagement details in batch
635
+ const engagements = await Promise.all(
636
+ engagementIds.map(async (id: string) => {
637
+ const engResponse = await fetch(`${baseUrl}/objects/engagements/${id}`, {
638
+ headers: {
639
+ Authorization: `Bearer ${accessToken}`,
640
+ 'Content-Type': 'application/json',
641
+ },
642
+ })
643
+ if (engResponse.ok) {
644
+ return engResponse.json()
645
+ }
646
+ return null
647
+ })
648
+ )
649
+
650
+ return engagements
651
+ .filter((eng: any) => eng !== null)
652
+ .map((eng: any) => mapActivityFromHubSpot(eng, contactId))
653
+ } catch (error) {
654
+ throw new Error(
655
+ `Failed to list activities: ${error instanceof Error ? error.message : 'Unknown error'}`
656
+ )
657
+ }
658
+ },
659
+ }
660
+ }
661
+
662
+ /**
663
+ * HubSpot provider definition
664
+ */
665
+ export const hubspotProvider = defineProvider(hubspotInfo, async (config) =>
666
+ createHubSpotProvider(config)
667
+ )
@@ -0,0 +1,21 @@
1
+ /**
2
+ * CRM Providers
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+
7
+ export { hubspotInfo, hubspotProvider, createHubSpotProvider } from './hubspot.js'
8
+
9
+ import { hubspotProvider } from './hubspot.js'
10
+
11
+ /**
12
+ * Register all CRM providers
13
+ */
14
+ export function registerCRMProviders(): void {
15
+ hubspotProvider.register()
16
+ }
17
+
18
+ /**
19
+ * All CRM providers
20
+ */
21
+ export const crmProviders = [hubspotProvider]