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,300 @@
1
+ /**
2
+ * List operations for Attio
3
+ * Handles list management and list entry operations
4
+ */
5
+ import { getAttioClient } from '../attio-client.js';
6
+ import { callWithRetry } from './retry.js';
7
+ import { processListEntries, transformFiltersToApiFormat, } from '../../utils/record-utils.js';
8
+ import { FilterValidationError } from '../../errors/api-errors.js';
9
+ import { executeWithListFallback } from '../../utils/api-fallback.js';
10
+ /**
11
+ * Gets all lists in the workspace
12
+ *
13
+ * @param objectSlug - Optional object type to filter lists by (e.g., 'companies', 'people')
14
+ * @param limit - Maximum number of lists to fetch (default: 20)
15
+ * @param retryConfig - Optional retry configuration
16
+ * @returns Array of list objects
17
+ */
18
+ export async function getAllLists(objectSlug, limit = 20, retryConfig) {
19
+ const api = getAttioClient();
20
+ let path = `/lists?limit=${limit}`;
21
+ if (objectSlug) {
22
+ path += `&objectSlug=${objectSlug}`;
23
+ }
24
+ return callWithRetry(async () => {
25
+ try {
26
+ const response = await api.get(path);
27
+ return response.data.data || [];
28
+ }
29
+ catch (error) {
30
+ // Let upstream handlers create specific, rich error objects.
31
+ throw error;
32
+ }
33
+ }, retryConfig);
34
+ }
35
+ /**
36
+ * Gets details for a specific list
37
+ *
38
+ * @param listId - The ID of the list
39
+ * @param retryConfig - Optional retry configuration
40
+ * @returns List details
41
+ */
42
+ export async function getListDetails(listId, retryConfig) {
43
+ const api = getAttioClient();
44
+ const path = `/lists/${listId}`;
45
+ return callWithRetry(async () => {
46
+ try {
47
+ const response = await api.get(path);
48
+ return response.data.data || response.data;
49
+ }
50
+ catch (error) {
51
+ // Let upstream handlers create specific, rich error objects.
52
+ throw error;
53
+ }
54
+ }, retryConfig);
55
+ }
56
+ /**
57
+ * Gets entries in a list with pagination and filtering
58
+ *
59
+ * @param listId - The ID of the list
60
+ * @param limit - Maximum number of entries to fetch
61
+ * @param offset - Number of entries to skip
62
+ * @param filters - Optional filters to apply
63
+ * @param retryConfig - Optional retry configuration
64
+ * @returns Array of list entries
65
+ */
66
+ export async function getListEntries(listId, limit, offset, filters, retryConfig) {
67
+ const api = getAttioClient();
68
+ // Input validation - make sure we have a valid listId
69
+ if (!listId) {
70
+ throw new Error('Invalid list ID: No ID provided');
71
+ }
72
+ // Coerce input parameters to ensure proper types
73
+ const safeLimit = typeof limit === 'number' ? limit : undefined;
74
+ const safeOffset = typeof offset === 'number' ? offset : undefined;
75
+ // Create request body with parameters and filters
76
+ const createRequestBody = () => {
77
+ // Start with base parameters
78
+ const body = {
79
+ expand: ['record'],
80
+ limit: safeLimit !== undefined ? safeLimit : 20, // Default to 20 if not specified
81
+ offset: safeOffset !== undefined ? safeOffset : 0, // Default to 0 if not specified
82
+ };
83
+ try {
84
+ // Use our shared utility to transform filters to API format
85
+ const filterObject = transformFiltersToApiFormat(filters, true);
86
+ // Add filter to body if it exists
87
+ if (filterObject.filter) {
88
+ body.filter = filterObject.filter;
89
+ // Log filter transformation for debugging in development
90
+ if (process.env.NODE_ENV === 'development') {
91
+ console.error('[getListEntries] Transformed filters:', {
92
+ originalFilters: JSON.stringify(filters),
93
+ transformedFilters: JSON.stringify(filterObject.filter),
94
+ useOrLogic: filters?.matchAny === true,
95
+ filterCount: filters?.filters?.length || 0,
96
+ });
97
+ }
98
+ }
99
+ }
100
+ catch (err) {
101
+ const error = err;
102
+ if (error instanceof FilterValidationError) {
103
+ // Log the problematic filters for debugging
104
+ if (process.env.NODE_ENV === 'development') {
105
+ console.error('[getListEntries] Filter validation error:', {
106
+ error: error.message,
107
+ providedFilters: JSON.stringify(filters),
108
+ });
109
+ }
110
+ // Rethrow with more context
111
+ throw new Error(`Filter validation failed: ${error.message}`);
112
+ }
113
+ throw error; // Rethrow other errors
114
+ }
115
+ return body;
116
+ };
117
+ // Enhanced logging function
118
+ const logOperation = (stage, details, isError = false) => {
119
+ if (process.env.NODE_ENV === 'development') {
120
+ const prefix = isError
121
+ ? 'ERROR'
122
+ : stage.includes('failed')
123
+ ? 'WARNING'
124
+ : 'INFO';
125
+ console.error(`[getListEntries] ${prefix} - ${stage}`, {
126
+ ...details,
127
+ listId,
128
+ limit: safeLimit,
129
+ offset: safeOffset,
130
+ hasFilters: filters && filters.filters ? filters.filters.length > 0 : false,
131
+ timestamp: new Date().toISOString(),
132
+ });
133
+ }
134
+ };
135
+ // Define a function to try all endpoints with proper retry logic
136
+ return callWithRetry(async () => {
137
+ return executeWithListFallback(api, { listId, filters, limit: safeLimit, offset: safeOffset }, createRequestBody, processListEntries, logOperation);
138
+ }, retryConfig);
139
+ }
140
+ /**
141
+ * Adds a record to a list
142
+ *
143
+ * @param listId - The ID of the list
144
+ * @param recordId - The ID of the record to add
145
+ * @param objectType - Optional object type ('companies', 'people', etc.)
146
+ * @param initialValues - Optional initial values for the list entry (e.g., stage)
147
+ * @param retryConfig - Optional retry configuration
148
+ * @returns The created list entry
149
+ */
150
+ export async function addRecordToList(listId, recordId, objectType, initialValues, retryConfig) {
151
+ const api = getAttioClient();
152
+ const path = `/lists/${listId}/entries`;
153
+ // Input validation to ensure required parameters
154
+ if (!listId || typeof listId !== 'string') {
155
+ throw new Error('Invalid list ID: Must be a non-empty string');
156
+ }
157
+ if (!recordId || typeof recordId !== 'string') {
158
+ throw new Error('Invalid record ID: Must be a non-empty string');
159
+ }
160
+ // Default object type to 'companies' if not specified
161
+ const safeObjectType = objectType || 'companies';
162
+ return callWithRetry(async () => {
163
+ try {
164
+ // Construct proper API payload according to Attio API requirements
165
+ // The API expects parent_record_id, parent_object, and optionally entry_values
166
+ const payload = {
167
+ data: {
168
+ parent_record_id: recordId,
169
+ parent_object: safeObjectType,
170
+ // Only include entry_values if initialValues is provided
171
+ ...(initialValues && { entry_values: initialValues }),
172
+ },
173
+ };
174
+ if (process.env.NODE_ENV === 'development') {
175
+ console.error(`[addRecordToList] Adding record to list at ${path}`);
176
+ console.error(`- List ID: ${listId}`);
177
+ console.error(`- Record ID: ${recordId}`);
178
+ console.error(`- Object Type: ${safeObjectType}`);
179
+ console.error(`- Initial Values: ${initialValues ? JSON.stringify(initialValues) : 'none'}`);
180
+ console.error(`- Request payload: ${JSON.stringify(payload)}`);
181
+ }
182
+ const response = await api.post(path, payload);
183
+ if (process.env.NODE_ENV === 'development') {
184
+ console.error(`[addRecordToList] Success: ${JSON.stringify(response.data)}`);
185
+ }
186
+ return response.data.data || response.data;
187
+ }
188
+ catch (error) {
189
+ // Enhanced error logging with detailed information
190
+ if (process.env.NODE_ENV === 'development') {
191
+ console.error(`[addRecordToList] Error adding record ${recordId} to list ${listId}:`, error.message || 'Unknown error');
192
+ console.error('Status:', error.response?.status);
193
+ console.error('Response data:', JSON.stringify(error.response?.data || {}));
194
+ // Add additional debug information for validation errors
195
+ if (error.response?.data?.validation_errors) {
196
+ console.error('Validation errors:', JSON.stringify(error.response.data.validation_errors));
197
+ }
198
+ }
199
+ // Add more context to the error message
200
+ if (error.response?.status === 400) {
201
+ const validationErrors = error.response?.data?.validation_errors || [];
202
+ const errorDetails = validationErrors
203
+ .map((e) => `${e.path.join('.')}: ${e.message}`)
204
+ .join('; ');
205
+ throw new Error(`Validation error adding record to list: ${errorDetails || error.message}`);
206
+ }
207
+ // Let upstream handlers create specific, rich error objects.
208
+ throw error;
209
+ }
210
+ }, retryConfig);
211
+ }
212
+ /**
213
+ * Updates a list entry (e.g., changing stage)
214
+ *
215
+ * @param listId - The ID of the list
216
+ * @param entryId - The ID of the list entry to update
217
+ * @param attributes - The attributes to update (e.g., { stage: "Demo Scheduling" })
218
+ * @param retryConfig - Optional retry configuration
219
+ * @returns The updated list entry
220
+ */
221
+ export async function updateListEntry(listId, entryId, attributes, retryConfig) {
222
+ const api = getAttioClient();
223
+ const path = `/lists/${listId}/entries/${entryId}`;
224
+ // Input validation
225
+ if (!listId || typeof listId !== 'string') {
226
+ throw new Error('Invalid list ID: Must be a non-empty string');
227
+ }
228
+ if (!entryId || typeof entryId !== 'string') {
229
+ throw new Error('Invalid entry ID: Must be a non-empty string');
230
+ }
231
+ if (!attributes ||
232
+ typeof attributes !== 'object' ||
233
+ Array.isArray(attributes)) {
234
+ throw new Error('Invalid attributes: Must be a non-empty object');
235
+ }
236
+ return callWithRetry(async () => {
237
+ try {
238
+ if (process.env.NODE_ENV === 'development') {
239
+ console.error(`[updateListEntry] Updating list entry at ${path}`);
240
+ console.error(`- List ID: ${listId}`);
241
+ console.error(`- Entry ID: ${entryId}`);
242
+ console.error(`- Attributes: ${JSON.stringify(attributes)}`);
243
+ }
244
+ // Attio API expects updates to list entries in the 'data.values' structure
245
+ // This follows the same pattern as record updates in crud.ts
246
+ const response = await api.patch(path, {
247
+ data: {
248
+ values: attributes,
249
+ },
250
+ });
251
+ if (process.env.NODE_ENV === 'development') {
252
+ console.error(`[updateListEntry] Success: ${JSON.stringify(response.data)}`);
253
+ }
254
+ return response.data.data || response.data;
255
+ }
256
+ catch (error) {
257
+ // Enhanced error logging with specific error types
258
+ if (process.env.NODE_ENV === 'development') {
259
+ console.error(`[updateListEntry] Error updating entry ${entryId} in list ${listId}:`, error.message || 'Unknown error');
260
+ console.error('Status:', error.response?.status);
261
+ console.error('Response data:', JSON.stringify(error.response?.data || {}));
262
+ }
263
+ // Add more specific error types based on status codes
264
+ if (error.response?.status === 404) {
265
+ throw new Error(`List entry ${entryId} not found in list ${listId}`);
266
+ }
267
+ else if (error.response?.status === 400) {
268
+ throw new Error(`Invalid attributes for list entry update: ${error.response?.data?.message || 'Bad request'}`);
269
+ }
270
+ else if (error.response?.status === 403) {
271
+ throw new Error(`Insufficient permissions to update list entry ${entryId} in list ${listId}`);
272
+ }
273
+ // Let upstream handlers create specific, rich error objects.
274
+ throw error;
275
+ }
276
+ }, retryConfig);
277
+ }
278
+ /**
279
+ * Removes a record from a list
280
+ *
281
+ * @param listId - The ID of the list
282
+ * @param entryId - The ID of the list entry to remove
283
+ * @param retryConfig - Optional retry configuration
284
+ * @returns True if successful
285
+ */
286
+ export async function removeRecordFromList(listId, entryId, retryConfig) {
287
+ const api = getAttioClient();
288
+ const path = `/lists/${listId}/entries/${entryId}`;
289
+ return callWithRetry(async () => {
290
+ try {
291
+ await api.delete(path);
292
+ return true;
293
+ }
294
+ catch (error) {
295
+ // Let upstream handlers create specific, rich error objects.
296
+ throw error;
297
+ }
298
+ }, retryConfig);
299
+ }
300
+ //# sourceMappingURL=lists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lists.js","sourceRoot":"","sources":["../../../src/api/operations/lists.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOpD,OAAO,EAAE,aAAa,EAAe,MAAM,YAAY,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,UAAmB,EACnB,QAAgB,EAAE,EAClB,WAAkC;IAElC,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;IAC7B,IAAI,IAAI,GAAG,gBAAgB,KAAK,EAAE,CAAC;IAEnC,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,IAAI,eAAe,UAAU,EAAE,CAAC;IACtC,CAAC;IAED,OAAO,aAAa,CAAC,KAAK,IAAI,EAAE;QAC9B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAA+B,IAAI,CAAC,CAAC;YACnE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAClC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,6DAA6D;YAC7D,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,EAAE,WAAW,CAAC,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,WAAkC;IAElC,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,UAAU,MAAM,EAAE,CAAC;IAEhC,OAAO,aAAa,CAAC,K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QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,aACnC,EAAE,CACH,CAAC;YACJ,CAAC;iBAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC1C,MAAM,IAAI,KAAK,CACb,iDAAiD,OAAO,YAAY,MAAM,EAAE,CAC7E,CAAC;YACJ,CAAC;YAED,6DAA6D;YAC7D,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,EAAE,WAAW,CAAC,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,OAAe,EACf,WAAkC;IAElC,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,UAAU,MAAM,YAAY,OAAO,EAAE,CAAC;IAEnD,OAAO,aAAa,CAAC,KAAK,IAAI,EAAE;QAC9B,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,6DAA6D;YAC7D,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,EAAE,WAAW,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Note operations for Attio objects
3
+ * Handles note creation and retrieval
4
+ */
5
+ import { AttioNote, ResourceType } from '../../types/attio.js';
6
+ import { RetryConfig } from './retry.js';
7
+ /**
8
+ * Generic function to get notes for a specific record
9
+ *
10
+ * @param objectType - The type of parent object (people or companies)
11
+ * @param recordId - ID of the parent record
12
+ * @param limit - Maximum number of notes to return
13
+ * @param offset - Number of notes to skip
14
+ * @param retryConfig - Optional retry configuration
15
+ * @returns Array of notes
16
+ */
17
+ export declare function getObjectNotes(objectType: ResourceType, recordId: string, limit?: number, offset?: number, retryConfig?: Partial<RetryConfig>): Promise<AttioNote[]>;
18
+ /**
19
+ * Generic function to create a note for any object type
20
+ *
21
+ * @param objectType - The type of parent object (people or companies)
22
+ * @param recordId - ID of the parent record
23
+ * @param noteTitle - Title of the note
24
+ * @param noteText - Content of the note
25
+ * @param retryConfig - Optional retry configuration
26
+ * @returns Created note
27
+ */
28
+ export declare function createObjectNote(objectType: ResourceType, recordId: string, noteTitle: string, noteText: string, retryConfig?: Partial<RetryConfig>): Promise<AttioNote>;
29
+ //# sourceMappingURL=notes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../../src/api/operations/notes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,SAAS,EACT,YAAY,EAGb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,MAAW,EAClB,MAAM,GAAE,MAAU,EAClB,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC,CAatB;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,SAAS,CAAC,CAqBpB"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Note operations for Attio objects
3
+ * Handles note creation and retrieval
4
+ */
5
+ import { getAttioClient } from '../attio-client.js';
6
+ import { callWithRetry } from './retry.js';
7
+ /**
8
+ * Generic function to get notes for a specific record
9
+ *
10
+ * @param objectType - The type of parent object (people or companies)
11
+ * @param recordId - ID of the parent record
12
+ * @param limit - Maximum number of notes to return
13
+ * @param offset - Number of notes to skip
14
+ * @param retryConfig - Optional retry configuration
15
+ * @returns Array of notes
16
+ */
17
+ export async function getObjectNotes(objectType, recordId, limit = 10, offset = 0, retryConfig) {
18
+ const api = getAttioClient();
19
+ const path = `/notes?limit=${limit}&offset=${offset}&parent_object=${objectType}&parent_record_id=${recordId}`;
20
+ return callWithRetry(async () => {
21
+ try {
22
+ const response = await api.get(path);
23
+ return response.data.data || [];
24
+ }
25
+ catch (error) {
26
+ // Let upstream handlers create specific, rich error objects.
27
+ throw error;
28
+ }
29
+ }, retryConfig);
30
+ }
31
+ /**
32
+ * Generic function to create a note for any object type
33
+ *
34
+ * @param objectType - The type of parent object (people or companies)
35
+ * @param recordId - ID of the parent record
36
+ * @param noteTitle - Title of the note
37
+ * @param noteText - Content of the note
38
+ * @param retryConfig - Optional retry configuration
39
+ * @returns Created note
40
+ */
41
+ export async function createObjectNote(objectType, recordId, noteTitle, noteText, retryConfig) {
42
+ const api = getAttioClient();
43
+ const path = '/notes';
44
+ return callWithRetry(async () => {
45
+ try {
46
+ const response = await api.post(path, {
47
+ data: {
48
+ format: 'plaintext',
49
+ parent_object: objectType,
50
+ parent_record_id: recordId,
51
+ title: `[AI] ${noteTitle}`,
52
+ content: noteText,
53
+ },
54
+ });
55
+ return response.data.data || response.data;
56
+ }
57
+ catch (error) {
58
+ // Let upstream handlers create specific, rich error objects.
59
+ throw error;
60
+ }
61
+ }, retryConfig);
62
+ }
63
+ //# sourceMappingURL=notes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes.js","sourceRoot":"","sources":["../../../src/api/operations/notes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOpD,OAAO,EAAE,aAAa,EAAe,MAAM,YAAY,CAAC;AAExD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,UAAwB,EACxB,QAAgB,EAChB,QAAgB,EAAE,EAClB,SAAiB,CAAC,EAClB,WAA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@@
1
+ /**
2
+ * Retry logic for API operations
3
+ * Handles retryable errors with configurable backoff strategies
4
+ */
5
+ /**
6
+ * Configuration options for API call retry
7
+ */
8
+ export interface RetryConfig {
9
+ /** Maximum number of retry attempts */
10
+ maxRetries: number;
11
+ /** Initial delay in milliseconds before the first retry */
12
+ initialDelay: number;
13
+ /** Maximum delay in milliseconds between retries */
14
+ maxDelay: number;
15
+ /** Whether to use exponential backoff for retry delays */
16
+ useExponentialBackoff: boolean;
17
+ /** HTTP status codes that should trigger a retry */
18
+ retryableStatusCodes: number[];
19
+ }
20
+ /**
21
+ * Default retry configuration
22
+ */
23
+ export declare const DEFAULT_RETRY_CONFIG: RetryConfig;
24
+ /**
25
+ * Calculate delay time for retry with optional exponential backoff
26
+ *
27
+ * @param attempt - Current attempt number (0-based)
28
+ * @param config - Retry configuration
29
+ * @returns Delay time in milliseconds
30
+ */
31
+ export declare function calculateRetryDelay(attempt: number, config: RetryConfig): number;
32
+ /**
33
+ * Determines if an error should trigger a retry
34
+ *
35
+ * @param error - Error to check
36
+ * @param config - Retry configuration
37
+ * @returns Whether the error should trigger a retry
38
+ */
39
+ export declare function isRetryableError(error: any, config: RetryConfig): boolean;
40
+ /**
41
+ * Execute an API call with retry logic
42
+ *
43
+ * @param fn - Function that returns a promise for the API call
44
+ * @param config - Retry configuration
45
+ * @returns Promise that resolves with the API response
46
+ */
47
+ export declare function callWithRetry<T>(fn: () => Promise<T>, config?: Partial<RetryConfig>): Promise<T>;
48
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/api/operations/retry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,qBAAqB,EAAE,OAAO,CAAC;IAC/B,oDAAoD;IACpD,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAMlC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,GAClB,MAAM,CAYR;AAYD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CASzE;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,CAAC,EACnC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAChC,OAAO,CAAC,CAAC,CAAC,CA0CZ"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Retry logic for API operations
3
+ * Handles retryable errors with configurable backoff strategies
4
+ */
5
+ /**
6
+ * Default retry configuration
7
+ */
8
+ export const DEFAULT_RETRY_CONFIG = {
9
+ maxRetries: 3,
10
+ initialDelay: 1000, // 1 second
11
+ maxDelay: 10000, // 10 seconds
12
+ useExponentialBackoff: true,
13
+ retryableStatusCodes: [408, 429, 500, 502, 503, 504],
14
+ };
15
+ /**
16
+ * Calculate delay time for retry with optional exponential backoff
17
+ *
18
+ * @param attempt - Current attempt number (0-based)
19
+ * @param config - Retry configuration
20
+ * @returns Delay time in milliseconds
21
+ */
22
+ export function calculateRetryDelay(attempt, config) {
23
+ if (!config.useExponentialBackoff) {
24
+ return config.initialDelay;
25
+ }
26
+ // Exponential backoff with jitter
27
+ const exponentialDelay = config.initialDelay * Math.pow(2, attempt);
28
+ const jitter = Math.random() * 0.5 + 0.75; // Random value between 0.75 and 1.25
29
+ const delay = exponentialDelay * jitter;
30
+ // Cap at maximum delay
31
+ return Math.min(delay, config.maxDelay);
32
+ }
33
+ /**
34
+ * Sleep for a specified duration
35
+ *
36
+ * @param ms - Duration in milliseconds
37
+ * @returns Promise that resolves after the specified duration
38
+ */
39
+ function sleep(ms) {
40
+ return new Promise((resolve) => setTimeout(resolve, ms));
41
+ }
42
+ /**
43
+ * Determines if an error should trigger a retry
44
+ *
45
+ * @param error - Error to check
46
+ * @param config - Retry configuration
47
+ * @returns Whether the error should trigger a retry
48
+ */
49
+ export function isRetryableError(error, config) {
50
+ // Network errors should be retried
51
+ if (!error.response) {
52
+ return true;
53
+ }
54
+ // Check if status code is in the retryable list
55
+ const statusCode = error.response.status;
56
+ return config.retryableStatusCodes.includes(statusCode);
57
+ }
58
+ /**
59
+ * Execute an API call with retry logic
60
+ *
61
+ * @param fn - Function that returns a promise for the API call
62
+ * @param config - Retry configuration
63
+ * @returns Promise that resolves with the API response
64
+ */
65
+ export async function callWithRetry(fn, config = {}) {
66
+ // Merge with default config
67
+ const retryConfig = {
68
+ ...DEFAULT_RETRY_CONFIG,
69
+ ...config,
70
+ };
71
+ let attempt = 0;
72
+ let lastError;
73
+ while (attempt <= retryConfig.maxRetries) {
74
+ try {
75
+ return await fn();
76
+ }
77
+ catch (error) {
78
+ lastError = error;
79
+ // Check if we should retry
80
+ if (attempt >= retryConfig.maxRetries ||
81
+ !isRetryableError(error, retryConfig)) {
82
+ throw error;
83
+ }
84
+ // Calculate delay and wait before retrying
85
+ const delay = calculateRetryDelay(attempt, retryConfig);
86
+ await sleep(delay);
87
+ attempt++;
88
+ // Log retry attempt if in development
89
+ if (process.env.NODE_ENV === 'development') {
90
+ console.log(`Retrying API call (attempt ${attempt}/${retryConfig.maxRetries}) after ${delay}ms delay`);
91
+ }
92
+ }
93
+ }
94
+ // This should never be reached due to the throw in the catch block,
95
+ // but TypeScript needs it for type safety
96
+ throw lastError;
97
+ }
98
+ //# sourceMappingURL=retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../../src/api/operations/retry.ts"],"names":[],"mappings":"AAA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C,MAAM,CAAC;IACzC,OAAO,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,EAAoB,EACpB,SAA+B,EAAE;IAEjC,4BAA4B;IAC5B,MAAM,WAAW,GAAgB;QAC/B,GAAG,oBAAoB;QACvB,GAAG,MAAM;KACV,CAAC;IAEF,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,SAAc,CAAC;IAEnB,OAAO,OAAO,IAAI,WAAW,CAAC,UAAU,EAAE,CAAC;QACzC,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS,GAAG,KAAK,CAAC;YAElB,2BAA2B;YAC3B,IACE,OAAO,IAAI,WAAW,CAAC,UAAU;gBACjC,CAAC,gBAAgB,CAAC,KAAK,EAAE,WAAW,CAAC,EACrC,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;YAED,2CAA2C;YAC3C,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YACxD,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC;YAEnB,OAAO,EAAE,CAAC;YAEV,sCAAsC;YACtC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;gBAC3C,OAAO,CAAC,GAAG,CACT,8BAA8B,OAAO,IAAI,WAAW,CAAC,UAAU,WAAW,KAAK,UAAU,CAC1F,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,oEAAoE;IACpE,0CAA0C;IAC1C,MAAM,SAAS,CAAC;AAClB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Search operations for Attio objects
3
+ * Handles basic and advanced search functionality
4
+ */
5
+ import { AttioRecord, ResourceType } from '../../types/attio.js';
6
+ import { RetryConfig } from './retry.js';
7
+ import { ListEntryFilters } from './types.js';
8
+ /**
9
+ * Generic function to search any object type by name, email, or phone (when applicable)
10
+ *
11
+ * @param objectType - The type of object to search (people or companies)
12
+ * @param query - Search query string
13
+ * @param retryConfig - Optional retry configuration
14
+ * @returns Array of matching records
15
+ */
16
+ export declare function searchObject<T extends AttioRecord>(objectType: ResourceType, query: string, retryConfig?: Partial<RetryConfig>): Promise<T[]>;
17
+ /**
18
+ * Generic function to search any object type with advanced filtering capabilities
19
+ *
20
+ * @param objectType - The type of object to search (people or companies)
21
+ * @param filters - Optional filters to apply
22
+ * @param limit - Maximum number of results to return (optional)
23
+ * @param offset - Number of results to skip (optional)
24
+ * @param retryConfig - Optional retry configuration
25
+ * @returns Array of matching records
26
+ */
27
+ export declare function advancedSearchObject<T extends AttioRecord>(objectType: ResourceType, filters?: ListEntryFilters, limit?: number, offset?: number, retryConfig?: Partial<RetryConfig>): Promise<T[]>;
28
+ /**
29
+ * Generic function to list any object type with pagination and sorting
30
+ *
31
+ * @param objectType - The type of object to list (people or companies)
32
+ * @param limit - Maximum number of results to return
33
+ * @param retryConfig - Optional retry configuration
34
+ * @returns Array of records
35
+ */
36
+ export declare function listObjects<T extends AttioRecord>(objectType: ResourceType, limit?: number, retryConfig?: Partial<RetryConfig>): Promise<T[]>;
37
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/api/operations/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,WAAW,EACX,YAAY,EAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI9C;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,CAAC,SAAS,WAAW,EACtD,UAAU,EAAE,YAAY,EACxB,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,CAAC,EAAE,CAAC,CAsCd;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,SAAS,WAAW,EAC9D,UAAU,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,gBAAgB,EAC1B,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,CAAC,EAAE,CAAC,CA0Gd;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,CAAC,SAAS,WAAW,EACrD,UAAU,EAAE,YAAY,EACxB,KAAK,CAAC,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,CAAC,EAAE,CAAC,CAuBd"}