attio-mcp 0.1.0

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 (644) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/LICENSE +236 -0
  3. package/README.md +105 -0
  4. package/dist/api/attio-client.d.ts +25 -0
  5. package/dist/api/attio-client.d.ts.map +1 -0
  6. package/dist/api/attio-client.js +64 -0
  7. package/dist/api/attio-client.js.map +1 -0
  8. package/dist/api/attribute-types.d.ts +119 -0
  9. package/dist/api/attribute-types.d.ts.map +1 -0
  10. package/dist/api/attribute-types.js +320 -0
  11. package/dist/api/attribute-types.js.map +1 -0
  12. package/dist/api/client.d.ts +3 -0
  13. package/dist/api/client.d.ts.map +1 -0
  14. package/dist/api/client.js +61 -0
  15. package/dist/api/client.js.map +1 -0
  16. package/dist/api/operations/batch.d.ts +55 -0
  17. package/dist/api/operations/batch.d.ts.map +1 -0
  18. package/dist/api/operations/batch.js +176 -0
  19. package/dist/api/operations/batch.js.map +1 -0
  20. package/dist/api/operations/crud.d.ts +61 -0
  21. package/dist/api/operations/crud.d.ts.map +1 -0
  22. package/dist/api/operations/crud.js +192 -0
  23. package/dist/api/operations/crud.js.map +1 -0
  24. package/dist/api/operations/index.d.ts +14 -0
  25. package/dist/api/operations/index.d.ts.map +1 -0
  26. package/dist/api/operations/index.js +18 -0
  27. package/dist/api/operations/index.js.map +1 -0
  28. package/dist/api/operations/lists.d.ts +66 -0
  29. package/dist/api/operations/lists.d.ts.map +1 -0
  30. package/dist/api/operations/lists.js +300 -0
  31. package/dist/api/operations/lists.js.map +1 -0
  32. package/dist/api/operations/notes.d.ts +29 -0
  33. package/dist/api/operations/notes.d.ts.map +1 -0
  34. package/dist/api/operations/notes.js +63 -0
  35. package/dist/api/operations/notes.js.map +1 -0
  36. package/dist/api/operations/retry.d.ts +48 -0
  37. package/dist/api/operations/retry.d.ts.map +1 -0
  38. package/dist/api/operations/retry.js +98 -0
  39. package/dist/api/operations/retry.js.map +1 -0
  40. package/dist/api/operations/search.d.ts +37 -0
  41. package/dist/api/operations/search.d.ts.map +1 -0
  42. package/dist/api/operations/search.js +186 -0
  43. package/dist/api/operations/search.js.map +1 -0
  44. package/dist/api/operations/tasks.d.ts +20 -0
  45. package/dist/api/operations/tasks.d.ts.map +1 -0
  46. package/dist/api/operations/tasks.js +87 -0
  47. package/dist/api/operations/tasks.js.map +1 -0
  48. package/dist/api/operations/types.d.ts +61 -0
  49. package/dist/api/operations/types.d.ts.map +1 -0
  50. package/dist/api/operations/types.js +10 -0
  51. package/dist/api/operations/types.js.map +1 -0
  52. package/dist/cli/commands/attributes.d.ts +34 -0
  53. package/dist/cli/commands/attributes.d.ts.map +1 -0
  54. package/dist/cli/commands/attributes.js +171 -0
  55. package/dist/cli/commands/attributes.js.map +1 -0
  56. package/dist/cli/discover.d.ts +3 -0
  57. package/dist/cli/discover.d.ts.map +1 -0
  58. package/dist/cli/discover.js +72 -0
  59. package/dist/cli/discover.js.map +1 -0
  60. package/dist/errors/api-errors.d.ts +191 -0
  61. package/dist/errors/api-errors.d.ts.map +1 -0
  62. package/dist/errors/api-errors.js +305 -0
  63. package/dist/errors/api-errors.js.map +1 -0
  64. package/dist/errors/company-errors.d.ts +40 -0
  65. package/dist/errors/company-errors.d.ts.map +1 -0
  66. package/dist/errors/company-errors.js +62 -0
  67. package/dist/errors/company-errors.js.map +1 -0
  68. package/dist/errors/value-match-error.d.ts +15 -0
  69. package/dist/errors/value-match-error.d.ts.map +1 -0
  70. package/dist/errors/value-match-error.js +40 -0
  71. package/dist/errors/value-match-error.js.map +1 -0
  72. package/dist/handlers/error-interceptor.d.ts +6 -0
  73. package/dist/handlers/error-interceptor.d.ts.map +1 -0
  74. package/dist/handlers/error-interceptor.js +17 -0
  75. package/dist/handlers/error-interceptor.js.map +1 -0
  76. package/dist/handlers/rate-limited-handler.d.ts +17 -0
  77. package/dist/handlers/rate-limited-handler.d.ts.map +1 -0
  78. package/dist/handlers/rate-limited-handler.js +126 -0
  79. package/dist/handlers/rate-limited-handler.js.map +1 -0
  80. package/dist/handlers/resources.d.ts +11 -0
  81. package/dist/handlers/resources.d.ts.map +1 -0
  82. package/dist/handlers/resources.js +109 -0
  83. package/dist/handlers/resources.js.map +1 -0
  84. package/dist/handlers/tool-configs/companies/attributes.d.ts +85 -0
  85. package/dist/handlers/tool-configs/companies/attributes.d.ts.map +1 -0
  86. package/dist/handlers/tool-configs/companies/attributes.js +203 -0
  87. package/dist/handlers/tool-configs/companies/attributes.js.map +1 -0
  88. package/dist/handlers/tool-configs/companies/batch.d.ts +145 -0
  89. package/dist/handlers/tool-configs/companies/batch.d.ts.map +1 -0
  90. package/dist/handlers/tool-configs/companies/batch.js +249 -0
  91. package/dist/handlers/tool-configs/companies/batch.js.map +1 -0
  92. package/dist/handlers/tool-configs/companies/crud.d.ts +103 -0
  93. package/dist/handlers/tool-configs/companies/crud.d.ts.map +1 -0
  94. package/dist/handlers/tool-configs/companies/crud.js +157 -0
  95. package/dist/handlers/tool-configs/companies/crud.js.map +1 -0
  96. package/dist/handlers/tool-configs/companies/definitions.d.ts +5 -0
  97. package/dist/handlers/tool-configs/companies/definitions.d.ts.map +1 -0
  98. package/dist/handlers/tool-configs/companies/definitions.js +9 -0
  99. package/dist/handlers/tool-configs/companies/definitions.js.map +1 -0
  100. package/dist/handlers/tool-configs/companies/formatters.d.ts +42 -0
  101. package/dist/handlers/tool-configs/companies/formatters.d.ts.map +1 -0
  102. package/dist/handlers/tool-configs/companies/formatters.js +324 -0
  103. package/dist/handlers/tool-configs/companies/formatters.js.map +1 -0
  104. package/dist/handlers/tool-configs/companies/index.d.ts +642 -0
  105. package/dist/handlers/tool-configs/companies/index.d.ts.map +1 -0
  106. package/dist/handlers/tool-configs/companies/index.js +86 -0
  107. package/dist/handlers/tool-configs/companies/index.js.map +1 -0
  108. package/dist/handlers/tool-configs/companies/notes.d.ts +61 -0
  109. package/dist/handlers/tool-configs/companies/notes.d.ts.map +1 -0
  110. package/dist/handlers/tool-configs/companies/notes.js +109 -0
  111. package/dist/handlers/tool-configs/companies/notes.js.map +1 -0
  112. package/dist/handlers/tool-configs/companies/relationships.d.ts +137 -0
  113. package/dist/handlers/tool-configs/companies/relationships.d.ts.map +1 -0
  114. package/dist/handlers/tool-configs/companies/relationships.js +163 -0
  115. package/dist/handlers/tool-configs/companies/relationships.js.map +1 -0
  116. package/dist/handlers/tool-configs/companies/search.d.ts +101 -0
  117. package/dist/handlers/tool-configs/companies/search.d.ts.map +1 -0
  118. package/dist/handlers/tool-configs/companies/search.js +163 -0
  119. package/dist/handlers/tool-configs/companies/search.js.map +1 -0
  120. package/dist/handlers/tool-configs/companies/types.d.ts +6 -0
  121. package/dist/handlers/tool-configs/companies/types.d.ts.map +1 -0
  122. package/dist/handlers/tool-configs/companies/types.js +2 -0
  123. package/dist/handlers/tool-configs/companies/types.js.map +1 -0
  124. package/dist/handlers/tool-configs/index.d.ts +12 -0
  125. package/dist/handlers/tool-configs/index.d.ts.map +1 -0
  126. package/dist/handlers/tool-configs/index.js +12 -0
  127. package/dist/handlers/tool-configs/index.js.map +1 -0
  128. package/dist/handlers/tool-configs/lists.d.ts +459 -0
  129. package/dist/handlers/tool-configs/lists.d.ts.map +1 -0
  130. package/dist/handlers/tool-configs/lists.js +597 -0
  131. package/dist/handlers/tool-configs/lists.js.map +1 -0
  132. package/dist/handlers/tool-configs/paginated-people.d.ts +197 -0
  133. package/dist/handlers/tool-configs/paginated-people.d.ts.map +1 -0
  134. package/dist/handlers/tool-configs/paginated-people.js +256 -0
  135. package/dist/handlers/tool-configs/paginated-people.js.map +1 -0
  136. package/dist/handlers/tool-configs/people/activity-search.d.ts +98 -0
  137. package/dist/handlers/tool-configs/people/activity-search.d.ts.map +1 -0
  138. package/dist/handlers/tool-configs/people/activity-search.js +113 -0
  139. package/dist/handlers/tool-configs/people/activity-search.js.map +1 -0
  140. package/dist/handlers/tool-configs/people/advanced-search.d.ts +62 -0
  141. package/dist/handlers/tool-configs/people/advanced-search.d.ts.map +1 -0
  142. package/dist/handlers/tool-configs/people/advanced-search.js +74 -0
  143. package/dist/handlers/tool-configs/people/advanced-search.js.map +1 -0
  144. package/dist/handlers/tool-configs/people/crud.d.ts +63 -0
  145. package/dist/handlers/tool-configs/people/crud.d.ts.map +1 -0
  146. package/dist/handlers/tool-configs/people/crud.js +71 -0
  147. package/dist/handlers/tool-configs/people/crud.js.map +1 -0
  148. package/dist/handlers/tool-configs/people/date-search.d.ts +42 -0
  149. package/dist/handlers/tool-configs/people/date-search.d.ts.map +1 -0
  150. package/dist/handlers/tool-configs/people/date-search.js +93 -0
  151. package/dist/handlers/tool-configs/people/date-search.js.map +1 -0
  152. package/dist/handlers/tool-configs/people/formatters.d.ts +19 -0
  153. package/dist/handlers/tool-configs/people/formatters.d.ts.map +1 -0
  154. package/dist/handlers/tool-configs/people/formatters.js +98 -0
  155. package/dist/handlers/tool-configs/people/formatters.js.map +1 -0
  156. package/dist/handlers/tool-configs/people/index.d.ts +407 -0
  157. package/dist/handlers/tool-configs/people/index.d.ts.map +1 -0
  158. package/dist/handlers/tool-configs/people/index.js +30 -0
  159. package/dist/handlers/tool-configs/people/index.js.map +1 -0
  160. package/dist/handlers/tool-configs/people/notes.d.ts +38 -0
  161. package/dist/handlers/tool-configs/people/notes.d.ts.map +1 -0
  162. package/dist/handlers/tool-configs/people/notes.js +57 -0
  163. package/dist/handlers/tool-configs/people/notes.js.map +1 -0
  164. package/dist/handlers/tool-configs/people/relationships.d.ts +112 -0
  165. package/dist/handlers/tool-configs/people/relationships.d.ts.map +1 -0
  166. package/dist/handlers/tool-configs/people/relationships.js +173 -0
  167. package/dist/handlers/tool-configs/people/relationships.js.map +1 -0
  168. package/dist/handlers/tool-configs/people/search.d.ts +53 -0
  169. package/dist/handlers/tool-configs/people/search.d.ts.map +1 -0
  170. package/dist/handlers/tool-configs/people/search.js +61 -0
  171. package/dist/handlers/tool-configs/people/search.js.map +1 -0
  172. package/dist/handlers/tool-configs/people-fix-complete.d.ts +6 -0
  173. package/dist/handlers/tool-configs/people-fix-complete.d.ts.map +1 -0
  174. package/dist/handlers/tool-configs/people-fix-complete.js +76 -0
  175. package/dist/handlers/tool-configs/people-fix-complete.js.map +1 -0
  176. package/dist/handlers/tool-configs/people-fixed.d.ts +12 -0
  177. package/dist/handlers/tool-configs/people-fixed.d.ts.map +1 -0
  178. package/dist/handlers/tool-configs/people-fixed.js +58 -0
  179. package/dist/handlers/tool-configs/people-fixed.js.map +1 -0
  180. package/dist/handlers/tool-configs/people-types.d.ts +32 -0
  181. package/dist/handlers/tool-configs/people-types.d.ts.map +1 -0
  182. package/dist/handlers/tool-configs/people-types.js +5 -0
  183. package/dist/handlers/tool-configs/people-types.js.map +1 -0
  184. package/dist/handlers/tool-configs/people.d.ts +599 -0
  185. package/dist/handlers/tool-configs/people.d.ts.map +1 -0
  186. package/dist/handlers/tool-configs/people.js +817 -0
  187. package/dist/handlers/tool-configs/people.js.map +1 -0
  188. package/dist/handlers/tool-configs/prompts.d.ts +69 -0
  189. package/dist/handlers/tool-configs/prompts.d.ts.map +1 -0
  190. package/dist/handlers/tool-configs/prompts.js +90 -0
  191. package/dist/handlers/tool-configs/prompts.js.map +1 -0
  192. package/dist/handlers/tool-configs/rate-limited-people.d.ts +203 -0
  193. package/dist/handlers/tool-configs/rate-limited-people.d.ts.map +1 -0
  194. package/dist/handlers/tool-configs/rate-limited-people.js +44 -0
  195. package/dist/handlers/tool-configs/rate-limited-people.js.map +1 -0
  196. package/dist/handlers/tool-configs/records/index.d.ts +282 -0
  197. package/dist/handlers/tool-configs/records/index.d.ts.map +1 -0
  198. package/dist/handlers/tool-configs/records/index.js +277 -0
  199. package/dist/handlers/tool-configs/records/index.js.map +1 -0
  200. package/dist/handlers/tool-configs/records.d.ts +282 -0
  201. package/dist/handlers/tool-configs/records.d.ts.map +1 -0
  202. package/dist/handlers/tool-configs/records.js +277 -0
  203. package/dist/handlers/tool-configs/records.js.map +1 -0
  204. package/dist/handlers/tool-configs/resource-specific-tools.d.ts +15 -0
  205. package/dist/handlers/tool-configs/resource-specific-tools.d.ts.map +1 -0
  206. package/dist/handlers/tool-configs/resource-specific-tools.js +33 -0
  207. package/dist/handlers/tool-configs/resource-specific-tools.js.map +1 -0
  208. package/dist/handlers/tool-configs/tasks.d.ts +127 -0
  209. package/dist/handlers/tool-configs/tasks.d.ts.map +1 -0
  210. package/dist/handlers/tool-configs/tasks.js +95 -0
  211. package/dist/handlers/tool-configs/tasks.js.map +1 -0
  212. package/dist/handlers/tool-types.d.ts +47 -0
  213. package/dist/handlers/tool-types.d.ts.map +1 -0
  214. package/dist/handlers/tool-types.js +2 -0
  215. package/dist/handlers/tool-types.js.map +1 -0
  216. package/dist/handlers/tools/config-verifier.d.ts +27 -0
  217. package/dist/handlers/tools/config-verifier.d.ts.map +1 -0
  218. package/dist/handlers/tools/config-verifier.js +108 -0
  219. package/dist/handlers/tools/config-verifier.js.map +1 -0
  220. package/dist/handlers/tools/dispatcher/core.d.ts +12 -0
  221. package/dist/handlers/tools/dispatcher/core.d.ts.map +1 -0
  222. package/dist/handlers/tools/dispatcher/core.js +276 -0
  223. package/dist/handlers/tools/dispatcher/core.js.map +1 -0
  224. package/dist/handlers/tools/dispatcher/formatting.d.ts +17 -0
  225. package/dist/handlers/tools/dispatcher/formatting.d.ts.map +1 -0
  226. package/dist/handlers/tools/dispatcher/formatting.js +25 -0
  227. package/dist/handlers/tools/dispatcher/formatting.js.map +1 -0
  228. package/dist/handlers/tools/dispatcher/logging.d.ts +63 -0
  229. package/dist/handlers/tools/dispatcher/logging.d.ts.map +1 -0
  230. package/dist/handlers/tools/dispatcher/logging.js +108 -0
  231. package/dist/handlers/tools/dispatcher/logging.js.map +1 -0
  232. package/dist/handlers/tools/dispatcher/operations/batch.d.ts +29 -0
  233. package/dist/handlers/tools/dispatcher/operations/batch.d.ts.map +1 -0
  234. package/dist/handlers/tools/dispatcher/operations/batch.js +137 -0
  235. package/dist/handlers/tools/dispatcher/operations/batch.js.map +1 -0
  236. package/dist/handlers/tools/dispatcher/operations/crud.d.ts +25 -0
  237. package/dist/handlers/tools/dispatcher/operations/crud.d.ts.map +1 -0
  238. package/dist/handlers/tools/dispatcher/operations/crud.js +110 -0
  239. package/dist/handlers/tools/dispatcher/operations/crud.js.map +1 -0
  240. package/dist/handlers/tools/dispatcher/operations/details.d.ts +13 -0
  241. package/dist/handlers/tools/dispatcher/operations/details.d.ts.map +1 -0
  242. package/dist/handlers/tools/dispatcher/operations/details.js +52 -0
  243. package/dist/handlers/tools/dispatcher/operations/details.js.map +1 -0
  244. package/dist/handlers/tools/dispatcher/operations/info.d.ts +25 -0
  245. package/dist/handlers/tools/dispatcher/operations/info.d.ts.map +1 -0
  246. package/dist/handlers/tools/dispatcher/operations/info.js +82 -0
  247. package/dist/handlers/tools/dispatcher/operations/info.js.map +1 -0
  248. package/dist/handlers/tools/dispatcher/operations/lists.d.ts +62 -0
  249. package/dist/handlers/tools/dispatcher/operations/lists.d.ts.map +1 -0
  250. package/dist/handlers/tools/dispatcher/operations/lists.js +283 -0
  251. package/dist/handlers/tools/dispatcher/operations/lists.js.map +1 -0
  252. package/dist/handlers/tools/dispatcher/operations/notes.d.ts +17 -0
  253. package/dist/handlers/tools/dispatcher/operations/notes.d.ts.map +1 -0
  254. package/dist/handlers/tools/dispatcher/operations/notes.js +102 -0
  255. package/dist/handlers/tools/dispatcher/operations/notes.js.map +1 -0
  256. package/dist/handlers/tools/dispatcher/operations/search.d.ts +43 -0
  257. package/dist/handlers/tools/dispatcher/operations/search.d.ts.map +1 -0
  258. package/dist/handlers/tools/dispatcher/operations/search.js +190 -0
  259. package/dist/handlers/tools/dispatcher/operations/search.js.map +1 -0
  260. package/dist/handlers/tools/dispatcher/validation.d.ts +27 -0
  261. package/dist/handlers/tools/dispatcher/validation.d.ts.map +1 -0
  262. package/dist/handlers/tools/dispatcher/validation.js +47 -0
  263. package/dist/handlers/tools/dispatcher/validation.js.map +1 -0
  264. package/dist/handlers/tools/dispatcher.d.ts +11 -0
  265. package/dist/handlers/tools/dispatcher.d.ts.map +1 -0
  266. package/dist/handlers/tools/dispatcher.js +15 -0
  267. package/dist/handlers/tools/dispatcher.js.map +1 -0
  268. package/dist/handlers/tools/error-types.d.ts +33 -0
  269. package/dist/handlers/tools/error-types.d.ts.map +1 -0
  270. package/dist/handlers/tools/error-types.js +21 -0
  271. package/dist/handlers/tools/error-types.js.map +1 -0
  272. package/dist/handlers/tools/formatters.d.ts +43 -0
  273. package/dist/handlers/tools/formatters.d.ts.map +1 -0
  274. package/dist/handlers/tools/formatters.js +170 -0
  275. package/dist/handlers/tools/formatters.js.map +1 -0
  276. package/dist/handlers/tools/index.d.ts +15 -0
  277. package/dist/handlers/tools/index.d.ts.map +1 -0
  278. package/dist/handlers/tools/index.js +34 -0
  279. package/dist/handlers/tools/index.js.map +1 -0
  280. package/dist/handlers/tools/registry.d.ts +1874 -0
  281. package/dist/handlers/tools/registry.d.ts.map +1 -0
  282. package/dist/handlers/tools/registry.js +103 -0
  283. package/dist/handlers/tools/registry.js.map +1 -0
  284. package/dist/health/http-server.d.ts +24 -0
  285. package/dist/health/http-server.d.ts.map +1 -0
  286. package/dist/health/http-server.js +106 -0
  287. package/dist/health/http-server.js.map +1 -0
  288. package/dist/index.d.ts +3 -0
  289. package/dist/index.d.ts.map +1 -0
  290. package/dist/index.js +238 -0
  291. package/dist/index.js.map +1 -0
  292. package/dist/objects/base-operations.d.ts +41 -0
  293. package/dist/objects/base-operations.d.ts.map +1 -0
  294. package/dist/objects/base-operations.js +116 -0
  295. package/dist/objects/base-operations.js.map +1 -0
  296. package/dist/objects/batch-companies.d.ts +112 -0
  297. package/dist/objects/batch-companies.d.ts.map +1 -0
  298. package/dist/objects/batch-companies.js +347 -0
  299. package/dist/objects/batch-companies.js.map +1 -0
  300. package/dist/objects/companies/attributes.d.ts +83 -0
  301. package/dist/objects/companies/attributes.d.ts.map +1 -0
  302. package/dist/objects/companies/attributes.js +426 -0
  303. package/dist/objects/companies/attributes.js.map +1 -0
  304. package/dist/objects/companies/basic.d.ts +117 -0
  305. package/dist/objects/companies/basic.d.ts.map +1 -0
  306. package/dist/objects/companies/basic.js +367 -0
  307. package/dist/objects/companies/basic.js.map +1 -0
  308. package/dist/objects/companies/batch.d.ts +6 -0
  309. package/dist/objects/companies/batch.d.ts.map +1 -0
  310. package/dist/objects/companies/batch.js +6 -0
  311. package/dist/objects/companies/batch.js.map +1 -0
  312. package/dist/objects/companies/index.d.ts +13 -0
  313. package/dist/objects/companies/index.d.ts.map +1 -0
  314. package/dist/objects/companies/index.js +17 -0
  315. package/dist/objects/companies/index.js.map +1 -0
  316. package/dist/objects/companies/notes.d.ts +26 -0
  317. package/dist/objects/companies/notes.d.ts.map +1 -0
  318. package/dist/objects/companies/notes.js +199 -0
  319. package/dist/objects/companies/notes.js.map +1 -0
  320. package/dist/objects/companies/relationships.d.ts +41 -0
  321. package/dist/objects/companies/relationships.d.ts.map +1 -0
  322. package/dist/objects/companies/relationships.js +142 -0
  323. package/dist/objects/companies/relationships.js.map +1 -0
  324. package/dist/objects/companies/search.d.ts +158 -0
  325. package/dist/objects/companies/search.d.ts.map +1 -0
  326. package/dist/objects/companies/search.js +463 -0
  327. package/dist/objects/companies/search.js.map +1 -0
  328. package/dist/objects/companies/types.d.ts +27 -0
  329. package/dist/objects/companies/types.d.ts.map +1 -0
  330. package/dist/objects/companies/types.js +3 -0
  331. package/dist/objects/companies/types.js.map +1 -0
  332. package/dist/objects/lists.d.ts +148 -0
  333. package/dist/objects/lists.d.ts.map +1 -0
  334. package/dist/objects/lists.js +586 -0
  335. package/dist/objects/lists.js.map +1 -0
  336. package/dist/objects/paginated-people.d.ts +50 -0
  337. package/dist/objects/paginated-people.d.ts.map +1 -0
  338. package/dist/objects/paginated-people.js +171 -0
  339. package/dist/objects/paginated-people.js.map +1 -0
  340. package/dist/objects/people/basic.d.ts +90 -0
  341. package/dist/objects/people/basic.d.ts.map +1 -0
  342. package/dist/objects/people/basic.js +157 -0
  343. package/dist/objects/people/basic.js.map +1 -0
  344. package/dist/objects/people/batch.d.ts +24 -0
  345. package/dist/objects/people/batch.d.ts.map +1 -0
  346. package/dist/objects/people/batch.js +145 -0
  347. package/dist/objects/people/batch.js.map +1 -0
  348. package/dist/objects/people/index.d.ts +11 -0
  349. package/dist/objects/people/index.d.ts.map +1 -0
  350. package/dist/objects/people/index.js +17 -0
  351. package/dist/objects/people/index.js.map +1 -0
  352. package/dist/objects/people/notes.d.ts +20 -0
  353. package/dist/objects/people/notes.d.ts.map +1 -0
  354. package/dist/objects/people/notes.js +60 -0
  355. package/dist/objects/people/notes.js.map +1 -0
  356. package/dist/objects/people/relationships.d.ts +23 -0
  357. package/dist/objects/people/relationships.d.ts.map +1 -0
  358. package/dist/objects/people/relationships.js +116 -0
  359. package/dist/objects/people/relationships.js.map +1 -0
  360. package/dist/objects/people/search.d.ts +83 -0
  361. package/dist/objects/people/search.d.ts.map +1 -0
  362. package/dist/objects/people/search.js +286 -0
  363. package/dist/objects/people/search.js.map +1 -0
  364. package/dist/objects/people/types.d.ts +37 -0
  365. package/dist/objects/people/types.d.ts.map +1 -0
  366. package/dist/objects/people/types.js +71 -0
  367. package/dist/objects/people/types.js.map +1 -0
  368. package/dist/objects/people-write.d.ts +71 -0
  369. package/dist/objects/people-write.d.ts.map +1 -0
  370. package/dist/objects/people-write.js +261 -0
  371. package/dist/objects/people-write.js.map +1 -0
  372. package/dist/objects/records/formatters.d.ts +20 -0
  373. package/dist/objects/records/formatters.d.ts.map +1 -0
  374. package/dist/objects/records/formatters.js +47 -0
  375. package/dist/objects/records/formatters.js.map +1 -0
  376. package/dist/objects/records/index.d.ts +74 -0
  377. package/dist/objects/records/index.d.ts.map +1 -0
  378. package/dist/objects/records/index.js +374 -0
  379. package/dist/objects/records/index.js.map +1 -0
  380. package/dist/objects/records.d.ts +88 -0
  381. package/dist/objects/records.d.ts.map +1 -0
  382. package/dist/objects/records.js +432 -0
  383. package/dist/objects/records.js.map +1 -0
  384. package/dist/objects/tasks.d.ts +19 -0
  385. package/dist/objects/tasks.d.ts.map +1 -0
  386. package/dist/objects/tasks.js +23 -0
  387. package/dist/objects/tasks.js.map +1 -0
  388. package/dist/prompts/error-handler.d.ts +28 -0
  389. package/dist/prompts/error-handler.d.ts.map +1 -0
  390. package/dist/prompts/error-handler.js +47 -0
  391. package/dist/prompts/error-handler.js.map +1 -0
  392. package/dist/prompts/handlers.d.ts +49 -0
  393. package/dist/prompts/handlers.d.ts.map +1 -0
  394. package/dist/prompts/handlers.js +353 -0
  395. package/dist/prompts/handlers.js.map +1 -0
  396. package/dist/prompts/index.d.ts +11 -0
  397. package/dist/prompts/index.d.ts.map +1 -0
  398. package/dist/prompts/index.js +15 -0
  399. package/dist/prompts/index.js.map +1 -0
  400. package/dist/prompts/templates/companies.d.ts +10 -0
  401. package/dist/prompts/templates/companies.d.ts.map +1 -0
  402. package/dist/prompts/templates/companies.js +128 -0
  403. package/dist/prompts/templates/companies.js.map +1 -0
  404. package/dist/prompts/templates/index.d.ts +42 -0
  405. package/dist/prompts/templates/index.d.ts.map +1 -0
  406. package/dist/prompts/templates/index.js +58 -0
  407. package/dist/prompts/templates/index.js.map +1 -0
  408. package/dist/prompts/templates/lists.d.ts +10 -0
  409. package/dist/prompts/templates/lists.d.ts.map +1 -0
  410. package/dist/prompts/templates/lists.js +127 -0
  411. package/dist/prompts/templates/lists.js.map +1 -0
  412. package/dist/prompts/templates/notes.d.ts +10 -0
  413. package/dist/prompts/templates/notes.d.ts.map +1 -0
  414. package/dist/prompts/templates/notes.js +119 -0
  415. package/dist/prompts/templates/notes.js.map +1 -0
  416. package/dist/prompts/templates/people.d.ts +10 -0
  417. package/dist/prompts/templates/people.d.ts.map +1 -0
  418. package/dist/prompts/templates/people.js +127 -0
  419. package/dist/prompts/templates/people.js.map +1 -0
  420. package/dist/prompts/types.d.ts +52 -0
  421. package/dist/prompts/types.d.ts.map +1 -0
  422. package/dist/prompts/types.js +5 -0
  423. package/dist/prompts/types.js.map +1 -0
  424. package/dist/types/attio.d.ts +424 -0
  425. package/dist/types/attio.d.ts.map +1 -0
  426. package/dist/types/attio.js +116 -0
  427. package/dist/types/attio.js.map +1 -0
  428. package/dist/types/company-types.d.ts +52 -0
  429. package/dist/types/company-types.d.ts.map +1 -0
  430. package/dist/types/company-types.js +5 -0
  431. package/dist/types/company-types.js.map +1 -0
  432. package/dist/types/tool-types.d.ts +262 -0
  433. package/dist/types/tool-types.d.ts.map +1 -0
  434. package/dist/types/tool-types.js +6 -0
  435. package/dist/types/tool-types.js.map +1 -0
  436. package/dist/utils/api-fallback.d.ts +39 -0
  437. package/dist/utils/api-fallback.d.ts.map +1 -0
  438. package/dist/utils/api-fallback.js +94 -0
  439. package/dist/utils/api-fallback.js.map +1 -0
  440. package/dist/utils/attribute-mapping/attribute-mappers.d.ts +39 -0
  441. package/dist/utils/attribute-mapping/attribute-mappers.d.ts.map +1 -0
  442. package/dist/utils/attribute-mapping/attribute-mappers.js +394 -0
  443. package/dist/utils/attribute-mapping/attribute-mappers.js.map +1 -0
  444. package/dist/utils/attribute-mapping/filter-translator.d.ts +9 -0
  445. package/dist/utils/attribute-mapping/filter-translator.d.ts.map +1 -0
  446. package/dist/utils/attribute-mapping/filter-translator.js +104 -0
  447. package/dist/utils/attribute-mapping/filter-translator.js.map +1 -0
  448. package/dist/utils/attribute-mapping/index.d.ts +10 -0
  449. package/dist/utils/attribute-mapping/index.d.ts.map +1 -0
  450. package/dist/utils/attribute-mapping/index.js +12 -0
  451. package/dist/utils/attribute-mapping/index.js.map +1 -0
  452. package/dist/utils/attribute-mapping/legacy-maps.d.ts +11 -0
  453. package/dist/utils/attribute-mapping/legacy-maps.d.ts.map +1 -0
  454. package/dist/utils/attribute-mapping/legacy-maps.js +54 -0
  455. package/dist/utils/attribute-mapping/legacy-maps.js.map +1 -0
  456. package/dist/utils/attribute-mapping/mapping-utils.d.ts +90 -0
  457. package/dist/utils/attribute-mapping/mapping-utils.d.ts.map +1 -0
  458. package/dist/utils/attribute-mapping/mapping-utils.js +145 -0
  459. package/dist/utils/attribute-mapping/mapping-utils.js.map +1 -0
  460. package/dist/utils/auto-discovery.d.ts +22 -0
  461. package/dist/utils/auto-discovery.d.ts.map +1 -0
  462. package/dist/utils/auto-discovery.js +143 -0
  463. package/dist/utils/auto-discovery.js.map +1 -0
  464. package/dist/utils/cli-colors.d.ts +36 -0
  465. package/dist/utils/cli-colors.d.ts.map +1 -0
  466. package/dist/utils/cli-colors.js +35 -0
  467. package/dist/utils/cli-colors.js.map +1 -0
  468. package/dist/utils/config-loader.d.ts +41 -0
  469. package/dist/utils/config-loader.d.ts.map +1 -0
  470. package/dist/utils/config-loader.js +167 -0
  471. package/dist/utils/config-loader.js.map +1 -0
  472. package/dist/utils/config-migration.d.ts +140 -0
  473. package/dist/utils/config-migration.d.ts.map +1 -0
  474. package/dist/utils/config-migration.js +310 -0
  475. package/dist/utils/config-migration.js.map +1 -0
  476. package/dist/utils/date-utils.d.ts +63 -0
  477. package/dist/utils/date-utils.d.ts.map +1 -0
  478. package/dist/utils/date-utils.js +329 -0
  479. package/dist/utils/date-utils.js.map +1 -0
  480. package/dist/utils/debug-b2b-segment.d.ts +2 -0
  481. package/dist/utils/debug-b2b-segment.d.ts.map +1 -0
  482. package/dist/utils/debug-b2b-segment.js +67 -0
  483. package/dist/utils/debug-b2b-segment.js.map +1 -0
  484. package/dist/utils/domain-utils.d.ts +46 -0
  485. package/dist/utils/domain-utils.d.ts.map +1 -0
  486. package/dist/utils/domain-utils.js +143 -0
  487. package/dist/utils/domain-utils.js.map +1 -0
  488. package/dist/utils/dynamic-import.d.ts +33 -0
  489. package/dist/utils/dynamic-import.d.ts.map +1 -0
  490. package/dist/utils/dynamic-import.js +41 -0
  491. package/dist/utils/dynamic-import.js.map +1 -0
  492. package/dist/utils/error-enhancer.d.ts +23 -0
  493. package/dist/utils/error-enhancer.d.ts.map +1 -0
  494. package/dist/utils/error-enhancer.js +188 -0
  495. package/dist/utils/error-enhancer.js.map +1 -0
  496. package/dist/utils/error-handler.d.ts +89 -0
  497. package/dist/utils/error-handler.d.ts.map +1 -0
  498. package/dist/utils/error-handler.js +336 -0
  499. package/dist/utils/error-handler.js.map +1 -0
  500. package/dist/utils/filters/builders/activity.d.ts +13 -0
  501. package/dist/utils/filters/builders/activity.d.ts.map +1 -0
  502. package/dist/utils/filters/builders/activity.js +65 -0
  503. package/dist/utils/filters/builders/activity.js.map +1 -0
  504. package/dist/utils/filters/builders/basic.d.ts +13 -0
  505. package/dist/utils/filters/builders/basic.d.ts.map +1 -0
  506. package/dist/utils/filters/builders/basic.js +36 -0
  507. package/dist/utils/filters/builders/basic.js.map +1 -0
  508. package/dist/utils/filters/builders/complex.d.ts +31 -0
  509. package/dist/utils/filters/builders/complex.d.ts.map +1 -0
  510. package/dist/utils/filters/builders/complex.js +92 -0
  511. package/dist/utils/filters/builders/complex.js.map +1 -0
  512. package/dist/utils/filters/builders/date.d.ts +17 -0
  513. package/dist/utils/filters/builders/date.d.ts.map +1 -0
  514. package/dist/utils/filters/builders/date.js +51 -0
  515. package/dist/utils/filters/builders/date.js.map +1 -0
  516. package/dist/utils/filters/builders/index.d.ts +8 -0
  517. package/dist/utils/filters/builders/index.d.ts.map +1 -0
  518. package/dist/utils/filters/builders/index.js +8 -0
  519. package/dist/utils/filters/builders/index.js.map +1 -0
  520. package/dist/utils/filters/builders/numeric.d.ts +17 -0
  521. package/dist/utils/filters/builders/numeric.d.ts.map +1 -0
  522. package/dist/utils/filters/builders/numeric.js +61 -0
  523. package/dist/utils/filters/builders/numeric.js.map +1 -0
  524. package/dist/utils/filters/builders/text.d.ts +17 -0
  525. package/dist/utils/filters/builders/text.d.ts.map +1 -0
  526. package/dist/utils/filters/builders/text.js +47 -0
  527. package/dist/utils/filters/builders/text.js.map +1 -0
  528. package/dist/utils/filters/builders/types.d.ts +2 -0
  529. package/dist/utils/filters/builders/types.d.ts.map +1 -0
  530. package/dist/utils/filters/builders/types.js +2 -0
  531. package/dist/utils/filters/builders/types.js.map +1 -0
  532. package/dist/utils/filters/builders.d.ts +2 -0
  533. package/dist/utils/filters/builders.d.ts.map +1 -0
  534. package/dist/utils/filters/builders.js +2 -0
  535. package/dist/utils/filters/builders.js.map +1 -0
  536. package/dist/utils/filters/cache.d.ts +80 -0
  537. package/dist/utils/filters/cache.d.ts.map +1 -0
  538. package/dist/utils/filters/cache.js +212 -0
  539. package/dist/utils/filters/cache.js.map +1 -0
  540. package/dist/utils/filters/index.d.ts +51 -0
  541. package/dist/utils/filters/index.d.ts.map +1 -0
  542. package/dist/utils/filters/index.js +67 -0
  543. package/dist/utils/filters/index.js.map +1 -0
  544. package/dist/utils/filters/operators.d.ts +65 -0
  545. package/dist/utils/filters/operators.d.ts.map +1 -0
  546. package/dist/utils/filters/operators.js +214 -0
  547. package/dist/utils/filters/operators.js.map +1 -0
  548. package/dist/utils/filters/relationship.d.ts +81 -0
  549. package/dist/utils/filters/relationship.d.ts.map +1 -0
  550. package/dist/utils/filters/relationship.js +393 -0
  551. package/dist/utils/filters/relationship.js.map +1 -0
  552. package/dist/utils/filters/translators.d.ts +120 -0
  553. package/dist/utils/filters/translators.d.ts.map +1 -0
  554. package/dist/utils/filters/translators.js +397 -0
  555. package/dist/utils/filters/translators.js.map +1 -0
  556. package/dist/utils/filters/types.d.ts +77 -0
  557. package/dist/utils/filters/types.d.ts.map +1 -0
  558. package/dist/utils/filters/types.js +85 -0
  559. package/dist/utils/filters/types.js.map +1 -0
  560. package/dist/utils/filters/utils.d.ts +86 -0
  561. package/dist/utils/filters/utils.d.ts.map +1 -0
  562. package/dist/utils/filters/utils.js +142 -0
  563. package/dist/utils/filters/utils.js.map +1 -0
  564. package/dist/utils/filters/validation-utils.d.ts +123 -0
  565. package/dist/utils/filters/validation-utils.d.ts.map +1 -0
  566. package/dist/utils/filters/validation-utils.js +282 -0
  567. package/dist/utils/filters/validation-utils.js.map +1 -0
  568. package/dist/utils/filters/validators.d.ts +73 -0
  569. package/dist/utils/filters/validators.d.ts.map +1 -0
  570. package/dist/utils/filters/validators.js +311 -0
  571. package/dist/utils/filters/validators.js.map +1 -0
  572. package/dist/utils/json-serializer.d.ts +68 -0
  573. package/dist/utils/json-serializer.d.ts.map +1 -0
  574. package/dist/utils/json-serializer.js +235 -0
  575. package/dist/utils/json-serializer.js.map +1 -0
  576. package/dist/utils/logger.d.ts +226 -0
  577. package/dist/utils/logger.d.ts.map +1 -0
  578. package/dist/utils/logger.js +323 -0
  579. package/dist/utils/logger.js.map +1 -0
  580. package/dist/utils/numeric-utils.d.ts +27 -0
  581. package/dist/utils/numeric-utils.d.ts.map +1 -0
  582. package/dist/utils/numeric-utils.js +83 -0
  583. package/dist/utils/numeric-utils.js.map +1 -0
  584. package/dist/utils/pagination.d.ts +85 -0
  585. package/dist/utils/pagination.d.ts.map +1 -0
  586. package/dist/utils/pagination.js +169 -0
  587. package/dist/utils/pagination.js.map +1 -0
  588. package/dist/utils/person-lookup.d.ts +35 -0
  589. package/dist/utils/person-lookup.d.ts.map +1 -0
  590. package/dist/utils/person-lookup.js +67 -0
  591. package/dist/utils/person-lookup.js.map +1 -0
  592. package/dist/utils/rate-limiter.d.ts +82 -0
  593. package/dist/utils/rate-limiter.d.ts.map +1 -0
  594. package/dist/utils/rate-limiter.js +159 -0
  595. package/dist/utils/rate-limiter.js.map +1 -0
  596. package/dist/utils/record-utils.d.ts +74 -0
  597. package/dist/utils/record-utils.d.ts.map +1 -0
  598. package/dist/utils/record-utils.js +312 -0
  599. package/dist/utils/record-utils.js.map +1 -0
  600. package/dist/utils/relationship-utils.d.ts +61 -0
  601. package/dist/utils/relationship-utils.d.ts.map +1 -0
  602. package/dist/utils/relationship-utils.js +242 -0
  603. package/dist/utils/relationship-utils.js.map +1 -0
  604. package/dist/utils/response-formatter.d.ts +121 -0
  605. package/dist/utils/response-formatter.d.ts.map +1 -0
  606. package/dist/utils/response-formatter.js +188 -0
  607. package/dist/utils/response-formatter.js.map +1 -0
  608. package/dist/utils/uri-parser.d.ts +18 -0
  609. package/dist/utils/uri-parser.d.ts.map +1 -0
  610. package/dist/utils/uri-parser.js +31 -0
  611. package/dist/utils/uri-parser.js.map +1 -0
  612. package/dist/utils/validation.d.ts +59 -0
  613. package/dist/utils/validation.d.ts.map +1 -0
  614. package/dist/utils/validation.js +264 -0
  615. package/dist/utils/validation.js.map +1 -0
  616. package/dist/utils/value-matcher.d.ts +58 -0
  617. package/dist/utils/value-matcher.d.ts.map +1 -0
  618. package/dist/utils/value-matcher.js +131 -0
  619. package/dist/utils/value-matcher.js.map +1 -0
  620. package/dist/validators/attribute-validator.d.ts +59 -0
  621. package/dist/validators/attribute-validator.d.ts.map +1 -0
  622. package/dist/validators/attribute-validator.js +531 -0
  623. package/dist/validators/attribute-validator.js.map +1 -0
  624. package/dist/validators/company/field_detector.d.ts +5 -0
  625. package/dist/validators/company/field_detector.d.ts.map +1 -0
  626. package/dist/validators/company/field_detector.js +95 -0
  627. package/dist/validators/company/field_detector.js.map +1 -0
  628. package/dist/validators/company/index.d.ts +26 -0
  629. package/dist/validators/company/index.d.ts.map +1 -0
  630. package/dist/validators/company/index.js +433 -0
  631. package/dist/validators/company/index.js.map +1 -0
  632. package/dist/validators/company/type_cache.d.ts +14 -0
  633. package/dist/validators/company/type_cache.d.ts.map +1 -0
  634. package/dist/validators/company/type_cache.js +28 -0
  635. package/dist/validators/company/type_cache.js.map +1 -0
  636. package/dist/validators/company/types.d.ts +8 -0
  637. package/dist/validators/company/types.d.ts.map +1 -0
  638. package/dist/validators/company/types.js +2 -0
  639. package/dist/validators/company/types.js.map +1 -0
  640. package/dist/validators/company-validator.d.ts +2 -0
  641. package/dist/validators/company-validator.d.ts.map +1 -0
  642. package/dist/validators/company-validator.js +2 -0
  643. package/dist/validators/company-validator.js.map +1 -0
  644. package/package.json +167 -0
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Base operations for all Attio objects with dynamic field detection
3
+ */
4
+ import { formatAllAttributes } from '../api/attribute-types.js';
5
+ import { createObjectRecord, updateObjectRecord, deleteObjectRecord, } from './records/index.js';
6
+ import { getAttributeSlug } from '../utils/attribute-mapping/index.js';
7
+ /**
8
+ * Translates all attribute names in a record using the attribute mapping system
9
+ *
10
+ * @param objectType - The type of object (companies, people, etc.)
11
+ * @param attributes - Raw attributes object with user-friendly names
12
+ * @returns Attributes object with API-compatible attribute names
13
+ */
14
+ function translateAttributeNames(objectType, attributes) {
15
+ const translated = {};
16
+ for (const [userKey, value] of Object.entries(attributes)) {
17
+ // Translate the attribute name using the mapping system
18
+ const apiKey = getAttributeSlug(userKey, objectType);
19
+ // Log the translation in development mode
20
+ if (process.env.NODE_ENV === 'development' && userKey !== apiKey) {
21
+ console.log(`[translateAttributeNames:${objectType}] Mapped "${userKey}" -> "${apiKey}"`);
22
+ }
23
+ translated[apiKey] = value;
24
+ }
25
+ return translated;
26
+ }
27
+ /**
28
+ * Creates a new object record with dynamic field formatting
29
+ *
30
+ * @param objectType - The type of object (companies, people, etc.)
31
+ * @param attributes - Raw attributes for object creation
32
+ * @param validator - Optional validator function
33
+ * @returns Created object record
34
+ */
35
+ export async function createObjectWithDynamicFields(objectType, attributes, validator) {
36
+ // Validate if validator provided
37
+ const validatedAttributes = validator
38
+ ? await validator(attributes)
39
+ : attributes;
40
+ // Translate attribute names using the mapping system (e.g., "b2b_segment" -> "type_persona")
41
+ const mappedAttributes = translateAttributeNames(objectType, validatedAttributes);
42
+ // Use dynamic field type detection to format attributes correctly
43
+ const transformedAttributes = await formatAllAttributes(objectType, mappedAttributes);
44
+ // Debug log to help diagnose issues
45
+ if (process.env.NODE_ENV === 'development') {
46
+ console.log(`[createObjectWithDynamicFields:${objectType}] Original attributes:`, JSON.stringify(validatedAttributes, null, 2));
47
+ console.log(`[createObjectWithDynamicFields:${objectType}] Mapped attributes:`, JSON.stringify(mappedAttributes, null, 2));
48
+ console.log(`[createObjectWithDynamicFields:${objectType}] Final transformed attributes:`, JSON.stringify(transformedAttributes, null, 2));
49
+ }
50
+ try {
51
+ // Create the object
52
+ return await createObjectRecord(objectType, transformedAttributes);
53
+ }
54
+ catch (error) {
55
+ console.error(`[createObjectWithDynamicFields:${objectType}] Error creating record:`, error instanceof Error ? error.message : String(error));
56
+ throw error;
57
+ }
58
+ }
59
+ /**
60
+ * Updates an existing object record with dynamic field formatting
61
+ *
62
+ * @param objectType - The type of object (companies, people, etc.)
63
+ * @param recordId - ID of the record to update
64
+ * @param attributes - Raw attributes to update
65
+ * @param validator - Optional validator function
66
+ * @returns Updated object record
67
+ */
68
+ export async function updateObjectWithDynamicFields(objectType, recordId, attributes, validator) {
69
+ // Validate if validator provided
70
+ const validatedAttributes = validator
71
+ ? await validator(recordId, attributes)
72
+ : attributes;
73
+ // Translate attribute names using the mapping system (e.g., "b2b_segment" -> "type_persona")
74
+ const mappedAttributes = translateAttributeNames(objectType, validatedAttributes);
75
+ // Use dynamic field type detection to format attributes correctly
76
+ const transformedAttributes = await formatAllAttributes(objectType, mappedAttributes);
77
+ if (process.env.NODE_ENV === 'development') {
78
+ console.log(`[updateObjectWithDynamicFields:${objectType}] Original attributes:`, JSON.stringify(validatedAttributes, null, 2));
79
+ console.log(`[updateObjectWithDynamicFields:${objectType}] Mapped attributes:`, JSON.stringify(mappedAttributes, null, 2));
80
+ console.log(`[updateObjectWithDynamicFields:${objectType}] Final transformed attributes:`, JSON.stringify(transformedAttributes, null, 2));
81
+ }
82
+ // Update the object
83
+ return await updateObjectRecord(objectType, recordId, transformedAttributes);
84
+ }
85
+ /**
86
+ * Updates a specific attribute of an object with dynamic field formatting
87
+ *
88
+ * @param objectType - The type of object (companies, people, etc.)
89
+ * @param recordId - ID of the record to update
90
+ * @param attributeName - Name of the attribute to update
91
+ * @param attributeValue - New value for the attribute
92
+ * @param updateFn - The update function to use
93
+ * @returns Updated object record
94
+ */
95
+ export async function updateObjectAttributeWithDynamicFields(objectType, recordId, attributeName, attributeValue, updateFn) {
96
+ // Update the specific attribute using the provided update function
97
+ const attributes = { [attributeName]: attributeValue };
98
+ return await updateFn(recordId, attributes);
99
+ }
100
+ /**
101
+ * Deletes an object record
102
+ *
103
+ * @param objectType - The type of object (companies, people, etc.)
104
+ * @param recordId - ID of the record to delete
105
+ * @param validator - Optional validator function
106
+ * @returns True if deletion was successful
107
+ */
108
+ export async function deleteObjectWithValidation(objectType, recordId, validator) {
109
+ // Validate if validator provided
110
+ if (validator) {
111
+ validator(recordId);
112
+ }
113
+ // Delete the object
114
+ return await deleteObjectRecord(objectType, recordId);
115
+ }
116
+ //# sourceMappingURL=base-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-operations.js","sourceRoot":"","sources":["../../src/objects/base-operations.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvE;;;;;;GAMG;AACH,SAAS,uBAAuB,CAC9B,UAAwB,EACxB,UAA+B;IAE/B,MAAM,UAAU,GAAwB,EAAE,CAAC;IAE3C,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1D,wDAAwD;QACxD,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAErD,0CAA0C;QAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;YACjE,OAAO,CAAC,GAAG,CACT,4BAA4B,UAAU,aAAa,OAAO,SAAS,MAAM,GAAG,CAC7E,CAAC;QACJ,CAAC;QAED,UAAU,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;;GA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AM,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,UAAwB,EACxB,QAAgB,EAChB,SAAgC;IAEhC,iCAAiC;IACjC,IAAI,SAAS,EAAE,CAAC;QACd,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtB,CAAC;IAED,oBAAoB;IACpB,OAAO,MAAM,kBAAkB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Batch operations for company records
3
+ */
4
+ import { Company, BatchResponse, BatchConfig, RecordAttributes } from '../types/attio.js';
5
+ /**
6
+ * Creates multiple company records in batch operation
7
+ *
8
+ * This function creates multiple company records in a single API call, with automatic
9
+ * fallback to individual operations if the batch API is unavailable. All input data
10
+ * is validated before processing.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * // Create multiple companies
15
+ * const companies = [
16
+ * { name: "Acme Corp", website: "https://acme.com", industry: "Technology" },
17
+ * { name: "Umbrella Inc", website: "https://umbrella.com", industry: "Manufacturing" }
18
+ * ];
19
+ *
20
+ * const result = await batchCreateCompanies({ companies });
21
+ * console.error(`Created ${result.summary.succeeded} of ${result.summary.total} companies`);
22
+ * ```
23
+ *
24
+ * Note on parameter structure:
25
+ * This function expects a different parameter structure compared to generic record batch operations.
26
+ * While generic batch operations take (objectSlug, records, objectId), company-specific batch operations
27
+ * expect an object with {companies, config} to match the structure expected by the MCP tool schema.
28
+ *
29
+ * @param params - Object containing array of companies and optional config
30
+ * @returns Batch response with created companies
31
+ */
32
+ export declare function batchCreateCompanies(params: {
33
+ companies: RecordAttributes[];
34
+ config?: Partial<BatchConfig>;
35
+ }): Promise<BatchResponse<Company>>;
36
+ /**
37
+ * Updates multiple company records in batch operation
38
+ *
39
+ * This function updates multiple company records in a single API call, with automatic
40
+ * fallback to individual operations if the batch API is unavailable. It performs extensive
41
+ * validation to ensure all required fields are present and properly formatted.
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * // Update multiple companies
46
+ * const updates = [
47
+ * { id: "3bdf5c9d-aa78-492a-a4c1-5a143e94ef0e", attributes: { industry: "New Industry" } },
48
+ * { id: "e252e8df-d6b6-4909-a03c-6c9f144c4580", attributes: { website: "https://new-site.com" } }
49
+ * ];
50
+ *
51
+ * const result = await batchUpdateCompanies({ updates });
52
+ * console.error(`Updated ${result.summary.succeeded} of ${result.summary.total} companies`);
53
+ * ```
54
+ *
55
+ * Note on parameter structure:
56
+ * This function expects a different parameter structure compared to generic record batch operations.
57
+ * While generic batch operations take (objectSlug, records, objectId), company-specific batch operations
58
+ * expect an object with {updates, config} to match the structure expected by the MCP tool schema.
59
+ *
60
+ * @param params - Object containing array of updates and optional config
61
+ * @returns Batch response with updated companies
62
+ */
63
+ export declare function batchUpdateCompanies(params: {
64
+ updates: Array<{
65
+ id: string;
66
+ attributes: RecordAttributes;
67
+ }>;
68
+ config?: Partial<BatchConfig>;
69
+ }): Promise<BatchResponse<Company>>;
70
+ /**
71
+ * Deletes multiple company records in batch
72
+ *
73
+ * @param companyIds - Array of company IDs to delete
74
+ * @param batchConfig - Optional batch configuration
75
+ * @returns Batch response with deletion results
76
+ */
77
+ export declare function batchDeleteCompanies(companyIds: string[], batchConfig?: Partial<BatchConfig>): Promise<BatchResponse<boolean>>;
78
+ /**
79
+ * Performs batch searches for companies by name
80
+ *
81
+ * @param queries - Array of search query strings
82
+ * @param batchConfig - Optional batch configuration
83
+ * @returns Batch response with search results for each query
84
+ */
85
+ export declare function batchSearchCompanies(queries: string[], batchConfig?: Partial<BatchConfig>): Promise<BatchResponse<Company[]>>;
86
+ /**
87
+ * Gets details for multiple companies in batch
88
+ *
89
+ * @param companyIds - Array of company IDs or URIs to fetch
90
+ * @param batchConfig - Optional batch configuration
91
+ * @returns Batch response with company details for each ID
92
+ */
93
+ export declare function batchGetCompanyDetails(companyIds: string[], batchConfig?: Partial<BatchConfig>): Promise<BatchResponse<Company>>;
94
+ /**
95
+ * Performs mixed batch operations on companies
96
+ *
97
+ * @param operations - Array of mixed operations (create, update, delete)
98
+ * @param batchConfig - Optional batch configuration
99
+ * @returns Batch response with results for each operation
100
+ */
101
+ export declare function batchCompanyOperations(operations: Array<{
102
+ type: 'create' | 'update' | 'delete';
103
+ data: any;
104
+ }>, batchConfig?: Partial<BatchConfig>): Promise<BatchResponse<Company | boolean>>;
105
+ /**
106
+ * Helper to create batch operation items for companies
107
+ */
108
+ export declare function createBatchItems<T>(items: T[], prefix?: string): Array<{
109
+ id: string;
110
+ data: T;
111
+ }>;
112
+ //# sourceMappingURL=batch-companies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-companies.d.ts","sourceRoot":"","sources":["../../src/objects/batch-companies.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAEL,OAAO,EACP,aAAa,EACb,WAAW,EACX,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AA6F3B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE;IACjD,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CA0ElC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE;IACjD,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,gBAAgB,CAAA;KAAE,CAAC,CAAC;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAqElC;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAAE,EACpB,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAUjC;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CASnC;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAAE,EACpB,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CASjC;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACrC,IAAI,EAAE,GAAG,CAAC;CACX,CAAC,EACF,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CA4F3C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,KAAK,EAAE,CAAC,EAAE,EACV,MAAM,GAAE,MAAe,GACtB,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAKhC"}
@@ -0,0 +1,347 @@
1
+ /**
2
+ * Batch operations for company records
3
+ */
4
+ import { ResourceType, } from '../types/attio.js';
5
+ import { executeBatchOperations, batchCreateRecords, batchUpdateRecords, } from '../api/operations/index.js';
6
+ import { createCompany, updateCompany, deleteCompany, searchCompanies, getCompanyDetails, } from './companies/index.js';
7
+ import { CompanyValidator } from '../validators/company-validator.js';
8
+ /**
9
+ * Helper function to execute a batch operation with improved error handling
10
+ *
11
+ * This function centralizes batch operations for companies, providing consistent
12
+ * error handling, proper object type setting, and fallback to individual operations
13
+ * when the batch API is unavailable.
14
+ *
15
+ * @template T - The type of input records (e.g., RecordAttributes for create, {id, attributes} for update)
16
+ * @template R - The type of output records (typically Company)
17
+ * @param operationType - The type of operation (create, update, delete, etc.)
18
+ * @param records - The records to process
19
+ * @param batchFunction - The batch API function to call
20
+ * @param singleFunction - The single-record fallback function
21
+ * @param batchConfig - Optional batch configuration
22
+ * @returns Batch response with results for each record and summary statistics
23
+ * @throws Error if records is not an array or validation fails
24
+ */
25
+ async function executeBatchCompanyOperation(operationType, records, batchFunction, singleFunction, batchConfig) {
26
+ // Validation check
27
+ if (!Array.isArray(records) || records.length === 0) {
28
+ throw new Error(`Invalid ${operationType} parameters: records must be a non-empty array`);
29
+ }
30
+ try {
31
+ // Attempt to use the batch API
32
+ const results = await batchFunction({
33
+ objectSlug: ResourceType.COMPANIES, // Always explicitly set the resource type
34
+ records: operationType === 'create'
35
+ ? records.map((r) => ({ attributes: r }))
36
+ : records,
37
+ });
38
+ // Format the response
39
+ return {
40
+ results: results.map((result, index) => ({
41
+ id: `${operationType}_company_${index}`,
42
+ success: true,
43
+ data: result,
44
+ })),
45
+ summary: {
46
+ total: records.length,
47
+ succeeded: results.length,
48
+ failed: records.length - results.length,
49
+ },
50
+ };
51
+ }
52
+ catch (error) {
53
+ // Log the error for debugging
54
+ console.error(`[batchCompany${operationType.charAt(0).toUpperCase() + operationType.slice(1)}] ` +
55
+ `Batch API failed with error: ${error instanceof Error ? error.message : String(error)}`);
56
+ // Fall back to individual operations
57
+ return executeBatchOperations(records.map((record, index) => ({
58
+ id: `${operationType}_company_${index}`,
59
+ params: record,
60
+ })), singleFunction, batchConfig);
61
+ }
62
+ }
63
+ /**
64
+ * Creates multiple company records in batch operation
65
+ *
66
+ * This function creates multiple company records in a single API call, with automatic
67
+ * fallback to individual operations if the batch API is unavailable. All input data
68
+ * is validated before processing.
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * // Create multiple companies
73
+ * const companies = [
74
+ * { name: "Acme Corp", website: "https://acme.com", industry: "Technology" },
75
+ * { name: "Umbrella Inc", website: "https://umbrella.com", industry: "Manufacturing" }
76
+ * ];
77
+ *
78
+ * const result = await batchCreateCompanies({ companies });
79
+ * console.error(`Created ${result.summary.succeeded} of ${result.summary.total} companies`);
80
+ * ```
81
+ *
82
+ * Note on parameter structure:
83
+ * This function expects a different parameter structure compared to generic record batch operations.
84
+ * While generic batch operations take (objectSlug, records, objectId), company-specific batch operations
85
+ * expect an object with {companies, config} to match the structure expected by the MCP tool schema.
86
+ *
87
+ * @param params - Object containing array of companies and optional config
88
+ * @returns Batch response with created companies
89
+ */
90
+ export async function batchCreateCompanies(params) {
91
+ // Early validation of parameters - fail fast
92
+ if (!params) {
93
+ throw new Error('Invalid request: params object is required');
94
+ }
95
+ // Extract and validate companies array
96
+ const { companies, config: batchConfig } = params;
97
+ if (!companies) {
98
+ throw new Error("Invalid request: 'companies' parameter is required");
99
+ }
100
+ if (!Array.isArray(companies)) {
101
+ throw new Error("Invalid request: 'companies' parameter must be an array");
102
+ }
103
+ if (companies.length === 0) {
104
+ throw new Error("Invalid request: 'companies' array cannot be empty");
105
+ }
106
+ // Validate array contents - ensure each item is a valid object
107
+ companies.forEach((company, index) => {
108
+ if (!company || typeof company !== 'object') {
109
+ throw new Error(`Invalid company data at index ${index}: must be a non-null object`);
110
+ }
111
+ // Basic validation: name property must exist (but can be empty - that will be handled gracefully)
112
+ if (!('name' in company)) {
113
+ throw new Error(`Invalid company data at index ${index}: 'name' is required`);
114
+ }
115
+ });
116
+ try {
117
+ // Use the generic batch create with graceful validation
118
+ // Attempt validation for each company, but allow individual failures
119
+ const validatedCompanies = await Promise.all(companies.map(async (company, index) => {
120
+ try {
121
+ return await CompanyValidator.validateCreate(company);
122
+ }
123
+ catch (error) {
124
+ // Log validation error but allow operation to continue for individual handling
125
+ console.warn(`Validation failed for company at index ${index}:`, error instanceof Error ? error.message : String(error));
126
+ return company; // Pass through for individual handling in fallback operations
127
+ }
128
+ }));
129
+ // Use the shared helper function for consistent handling
130
+ return executeBatchCompanyOperation('create', validatedCompanies, batchCreateRecords, createCompany, batchConfig);
131
+ }
132
+ catch (error) {
133
+ if (error instanceof Error && error.message.includes('validation')) {
134
+ // Re-throw validation errors with more context
135
+ throw new Error(`Company validation failed: ${error.message}`);
136
+ }
137
+ // For other errors, log and then rethrow
138
+ // Error occurred during batch creation
139
+ throw error;
140
+ }
141
+ }
142
+ /**
143
+ * Updates multiple company records in batch operation
144
+ *
145
+ * This function updates multiple company records in a single API call, with automatic
146
+ * fallback to individual operations if the batch API is unavailable. It performs extensive
147
+ * validation to ensure all required fields are present and properly formatted.
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * // Update multiple companies
152
+ * const updates = [
153
+ * { id: "3bdf5c9d-aa78-492a-a4c1-5a143e94ef0e", attributes: { industry: "New Industry" } },
154
+ * { id: "e252e8df-d6b6-4909-a03c-6c9f144c4580", attributes: { website: "https://new-site.com" } }
155
+ * ];
156
+ *
157
+ * const result = await batchUpdateCompanies({ updates });
158
+ * console.error(`Updated ${result.summary.succeeded} of ${result.summary.total} companies`);
159
+ * ```
160
+ *
161
+ * Note on parameter structure:
162
+ * This function expects a different parameter structure compared to generic record batch operations.
163
+ * While generic batch operations take (objectSlug, records, objectId), company-specific batch operations
164
+ * expect an object with {updates, config} to match the structure expected by the MCP tool schema.
165
+ *
166
+ * @param params - Object containing array of updates and optional config
167
+ * @returns Batch response with updated companies
168
+ */
169
+ export async function batchUpdateCompanies(params) {
170
+ // Early validation of parameters - fail fast
171
+ if (!params) {
172
+ throw new Error('Invalid request: params object is required');
173
+ }
174
+ // Extract and validate updates array
175
+ const { updates, config: batchConfig } = params;
176
+ if (!updates) {
177
+ throw new Error("Invalid request: 'updates' parameter is required");
178
+ }
179
+ if (!Array.isArray(updates)) {
180
+ throw new Error("Invalid request: 'updates' parameter must be an array");
181
+ }
182
+ if (updates.length === 0) {
183
+ throw new Error("Invalid request: 'updates' array cannot be empty");
184
+ }
185
+ // Validate array contents - ensure each item has required fields
186
+ updates.forEach((update, index) => {
187
+ if (!update || typeof update !== 'object') {
188
+ throw new Error(`Invalid update data at index ${index}: must be a non-null object`);
189
+ }
190
+ if (!update.id) {
191
+ throw new Error(`Invalid update data at index ${index}: 'id' is required`);
192
+ }
193
+ if (!update.attributes || typeof update.attributes !== 'object') {
194
+ throw new Error(`Invalid update data at index ${index}: 'attributes' must be a non-null object`);
195
+ }
196
+ });
197
+ try {
198
+ // Use the shared helper function for consistent handling
199
+ return executeBatchCompanyOperation('update', updates, batchUpdateRecords, (params) => updateCompany(params.id, params.attributes), batchConfig);
200
+ }
201
+ catch (error) {
202
+ // Enhanced error handling with more context
203
+ if (error instanceof Error) {
204
+ if (error.message.includes('not found')) {
205
+ throw new Error(`Company update failed: One or more company IDs do not exist`);
206
+ }
207
+ else {
208
+ // Provide more detailed error
209
+ throw new Error(`Company batch update failed: ${error.message}`);
210
+ }
211
+ }
212
+ // For other errors, log and then rethrow
213
+ console.error('[batchUpdateCompanies] Error updating companies:', error);
214
+ throw error;
215
+ }
216
+ }
217
+ /**
218
+ * Deletes multiple company records in batch
219
+ *
220
+ * @param companyIds - Array of company IDs to delete
221
+ * @param batchConfig - Optional batch configuration
222
+ * @returns Batch response with deletion results
223
+ */
224
+ export async function batchDeleteCompanies(companyIds, batchConfig) {
225
+ // The Attio API doesn't have a batch delete endpoint, so use individual operations
226
+ return executeBatchOperations(companyIds.map((id, index) => ({
227
+ id: `delete_company_${index}`,
228
+ params: id,
229
+ })), (params) => deleteCompany(params), batchConfig);
230
+ }
231
+ /**
232
+ * Performs batch searches for companies by name
233
+ *
234
+ * @param queries - Array of search query strings
235
+ * @param batchConfig - Optional batch configuration
236
+ * @returns Batch response with search results for each query
237
+ */
238
+ export async function batchSearchCompanies(queries, batchConfig) {
239
+ return executeBatchOperations(queries.map((query, index) => ({
240
+ id: `search_companies_${index}`,
241
+ params: query,
242
+ })), (params) => searchCompanies(params), batchConfig);
243
+ }
244
+ /**
245
+ * Gets details for multiple companies in batch
246
+ *
247
+ * @param companyIds - Array of company IDs or URIs to fetch
248
+ * @param batchConfig - Optional batch configuration
249
+ * @returns Batch response with company details for each ID
250
+ */
251
+ export async function batchGetCompanyDetails(companyIds, batchConfig) {
252
+ return executeBatchOperations(companyIds.map((id, index) => ({
253
+ id: `get_company_details_${index}`,
254
+ params: id,
255
+ })), (params) => getCompanyDetails(params), batchConfig);
256
+ }
257
+ /**
258
+ * Performs mixed batch operations on companies
259
+ *
260
+ * @param operations - Array of mixed operations (create, update, delete)
261
+ * @param batchConfig - Optional batch configuration
262
+ * @returns Batch response with results for each operation
263
+ */
264
+ export async function batchCompanyOperations(operations, batchConfig) {
265
+ const results = [];
266
+ let succeeded = 0;
267
+ let failed = 0;
268
+ // Process operations with chunking
269
+ const config = {
270
+ maxBatchSize: 10,
271
+ continueOnError: true,
272
+ ...batchConfig,
273
+ };
274
+ const chunks = [];
275
+ for (let i = 0; i < operations.length; i += config.maxBatchSize) {
276
+ chunks.push(operations.slice(i, i + config.maxBatchSize));
277
+ }
278
+ for (const chunk of chunks) {
279
+ const chunkResults = await Promise.allSettled(chunk.map(async (operation, index) => {
280
+ const opId = `${operation.type}_company_${index}`;
281
+ try {
282
+ let result;
283
+ switch (operation.type) {
284
+ case 'create':
285
+ result = await createCompany(operation.data);
286
+ break;
287
+ case 'update':
288
+ result = await updateCompany(operation.data.id, operation.data.attributes);
289
+ break;
290
+ case 'delete':
291
+ result = await deleteCompany(operation.data);
292
+ break;
293
+ default:
294
+ throw new Error(`Unknown operation type: ${operation.type}`);
295
+ }
296
+ succeeded++;
297
+ return {
298
+ id: opId,
299
+ success: true,
300
+ data: result,
301
+ };
302
+ }
303
+ catch (error) {
304
+ failed++;
305
+ if (!config.continueOnError) {
306
+ throw error;
307
+ }
308
+ return {
309
+ id: opId,
310
+ success: false,
311
+ error,
312
+ };
313
+ }
314
+ }));
315
+ // Collect results
316
+ chunkResults.forEach((result, index) => {
317
+ if (result.status === 'fulfilled') {
318
+ results.push(result.value);
319
+ }
320
+ else {
321
+ results.push({
322
+ id: `operation_${index}`,
323
+ success: false,
324
+ error: result.reason,
325
+ });
326
+ }
327
+ });
328
+ }
329
+ return {
330
+ results,
331
+ summary: {
332
+ total: operations.length,
333
+ succeeded,
334
+ failed,
335
+ },
336
+ };
337
+ }
338
+ /**
339
+ * Helper to create batch operation items for companies
340
+ */
341
+ export function createBatchItems(items, prefix = 'item') {
342
+ return items.map((item, index) => ({
343
+ id: `${prefix}_${index}`,
344
+ data: item,
345
+ }));
346
+ }
347
+ //# sourceMappingURL=batch-companies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-companies.js","sourceRoot":"","sources":["../../src/objects/batch-companies.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,YAAY,GAKb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE;;;;;;;;;;;;;;;;GAgBG;AACH,KAAK,UAAU,4BAA4B,CACzC,aAAgE,EAChE,OAAY,EACZ,aAA4C,EAC5C,cAAyC,EACzC,WAAkC;IAElC,mBAAmB;IACnB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CACb,WAAW,aAAa,gDAAgD,CACzE,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,+BAA+B;QAC/B,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC;YAClC,UAAU,EAAE,YAAY,CAAC,SAAS,EAAE,0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