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,186 @@
1
+ /**
2
+ * Search operations for Attio objects
3
+ * Handles basic and advanced search functionality
4
+ */
5
+ import { getAttioClient } from '../attio-client.js';
6
+ import { ResourceType, } from '../../types/attio.js';
7
+ import { callWithRetry } from './retry.js';
8
+ import { transformFiltersToApiFormat } from '../../utils/record-utils.js';
9
+ import { FilterValidationError } from '../../errors/api-errors.js';
10
+ /**
11
+ * Generic function to search any object type by name, email, or phone (when applicable)
12
+ *
13
+ * @param objectType - The type of object to search (people or companies)
14
+ * @param query - Search query string
15
+ * @param retryConfig - Optional retry configuration
16
+ * @returns Array of matching records
17
+ */
18
+ export async function searchObject(objectType, query, retryConfig) {
19
+ const api = getAttioClient();
20
+ const path = `/objects/${objectType}/records/query`;
21
+ // Use different search logic based on object type
22
+ let filter = {};
23
+ if (objectType === ResourceType.PEOPLE) {
24
+ // For people, search by name, email, or phone
25
+ filter = {
26
+ $or: [
27
+ { name: { $contains: query } },
28
+ { email_addresses: { $contains: query } },
29
+ { phone_numbers: { $contains: query } },
30
+ ],
31
+ };
32
+ }
33
+ else {
34
+ // For other types (like companies), search by name only
35
+ filter = {
36
+ name: { $contains: query },
37
+ };
38
+ }
39
+ return callWithRetry(async () => {
40
+ try {
41
+ const response = await api.post(path, {
42
+ filter,
43
+ });
44
+ return response.data.data || [];
45
+ }
46
+ catch (error) {
47
+ // Handle 404 errors with custom message
48
+ if (error.response && error.response.status === 404) {
49
+ throw new Error(`No ${objectType} found matching '${query}'`);
50
+ }
51
+ // Let upstream handlers create specific, rich error objects from the original Axios error.
52
+ throw error;
53
+ }
54
+ }, retryConfig);
55
+ }
56
+ /**
57
+ * Generic function to search any object type with advanced filtering capabilities
58
+ *
59
+ * @param objectType - The type of object to search (people or companies)
60
+ * @param filters - Optional filters to apply
61
+ * @param limit - Maximum number of results to return (optional)
62
+ * @param offset - Number of results to skip (optional)
63
+ * @param retryConfig - Optional retry configuration
64
+ * @returns Array of matching records
65
+ */
66
+ export async function advancedSearchObject(objectType, filters, limit, offset, retryConfig) {
67
+ const api = getAttioClient();
68
+ const path = `/objects/${objectType}/records/query`;
69
+ // Coerce input parameters to ensure proper types
70
+ const safeLimit = typeof limit === 'number' ? limit : undefined;
71
+ const safeOffset = typeof offset === 'number' ? offset : undefined;
72
+ // Create request body with parameters and filters
73
+ const createRequestBody = async () => {
74
+ // Start with base parameters
75
+ const body = {
76
+ limit: safeLimit !== undefined ? safeLimit : 20, // Default to 20 if not specified
77
+ offset: safeOffset !== undefined ? safeOffset : 0, // Default to 0 if not specified
78
+ };
79
+ try {
80
+ // If filters is undefined, return body without filter
81
+ if (!filters) {
82
+ if (process.env.NODE_ENV === 'development') {
83
+ console.log('[advancedSearchObject] No filters provided, using default parameters only');
84
+ }
85
+ return body;
86
+ }
87
+ // Import validation utilities dynamically to avoid circular dependencies
88
+ const { validateFilters, getFilterExample, ERROR_MESSAGES } = await import('../../utils/filters/validation-utils.js');
89
+ // Use centralized validation with consistent error messages
90
+ try {
91
+ validateFilters(filters);
92
+ }
93
+ catch (validationError) {
94
+ // Enhance error with API operation context, but preserve original message and category
95
+ if (validationError instanceof FilterValidationError) {
96
+ throw new FilterValidationError(`Advanced search filter validation failed: ${validationError.message}`, validationError.category);
97
+ }
98
+ throw validationError;
99
+ }
100
+ // Use our shared utility to transform filters to API format
101
+ const filterObject = transformFiltersToApiFormat(filters, true);
102
+ // Add filter to body if it exists
103
+ if (filterObject.filter) {
104
+ body.filter = filterObject.filter;
105
+ // Log filter transformation for debugging in development
106
+ if (process.env.NODE_ENV === 'development') {
107
+ console.log('[advancedSearchObject] Transformed filters:', {
108
+ originalFilters: JSON.stringify(filters),
109
+ transformedFilters: JSON.stringify(filterObject.filter),
110
+ useOrLogic: filters?.matchAny === true,
111
+ filterCount: filters?.filters?.length || 0,
112
+ });
113
+ }
114
+ }
115
+ }
116
+ catch (err) {
117
+ // Enhanced error handling with detailed context and examples
118
+ if (err instanceof FilterValidationError) {
119
+ // Log the full details for debugging
120
+ if (process.env.NODE_ENV === 'development') {
121
+ console.error('[advancedSearchObject] Filter validation error:', {
122
+ error: err.message,
123
+ providedFilters: JSON.stringify(filters, (key, value) =>
124
+ // Handle circular references in error logging
125
+ typeof value === 'object' && value !== null
126
+ ? Object.keys(value).length > 0
127
+ ? value
128
+ : '[Empty Object]'
129
+ : value),
130
+ });
131
+ }
132
+ // The error message may already include examples, so just rethrow
133
+ throw err;
134
+ }
135
+ // For other error types
136
+ const errorMessage = err instanceof Error
137
+ ? `Error processing search filters: ${err.message}`
138
+ : 'Unknown error processing search filters';
139
+ throw new Error(errorMessage);
140
+ }
141
+ return body;
142
+ };
143
+ return callWithRetry(async () => {
144
+ try {
145
+ const requestBody = await createRequestBody();
146
+ const response = await api.post(path, requestBody);
147
+ return response.data.data || [];
148
+ }
149
+ catch (error) {
150
+ // Let upstream handlers create specific, rich error objects.
151
+ throw error;
152
+ }
153
+ }, retryConfig);
154
+ }
155
+ /**
156
+ * Generic function to list any object type with pagination and sorting
157
+ *
158
+ * @param objectType - The type of object to list (people or companies)
159
+ * @param limit - Maximum number of results to return
160
+ * @param retryConfig - Optional retry configuration
161
+ * @returns Array of records
162
+ */
163
+ export async function listObjects(objectType, limit, retryConfig) {
164
+ const api = getAttioClient();
165
+ const path = `/objects/${objectType}/records/query`;
166
+ return callWithRetry(async () => {
167
+ try {
168
+ const body = {
169
+ limit: limit || 20,
170
+ sorts: [
171
+ {
172
+ attribute: 'last_interaction',
173
+ field: 'interacted_at',
174
+ direction: 'desc',
175
+ },
176
+ ],
177
+ };
178
+ const response = await api.post(path, body);
179
+ return response.data.data || [];
180
+ }
181
+ catch (error) {
182
+ throw error;
183
+ }
184
+ }, retryConfig);
185
+ }
186
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/api/operations/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAEL,YAAY,GAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAe,MAAM,YAAY,CAAC;AAExD,OAAO,EAAE,2B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AI,GAAQ;gBAChB,KAAK,EAAE,KAAK,IAAI,EAAE;gBAClB,KAAK,EAAE;oBACL;wBACE,SAAS,EAAE,kBAAkB;wBAC7B,KAAK,EAAE,eAAe;wBACtB,SAAS,EAAE,MAAM;qBAClB;iBACF;aACF,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAuB,IAAI,EAAE,IAAI,CAAC,CAAC;YAClE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAClC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,EAAE,WAAW,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { AttioTask } from '../../types/attio.js';
2
+ import { RetryConfig } from './retry.js';
3
+ export declare function listTasks(status?: string, assigneeId?: string, page?: number, pageSize?: number, retryConfig?: Partial<RetryConfig>): Promise<AttioTask[]>;
4
+ export declare function getTask(taskId: string, retryConfig?: Partial<RetryConfig>): Promise<AttioTask>;
5
+ export declare function createTask(content: string, options?: {
6
+ assigneeId?: string;
7
+ dueDate?: string;
8
+ recordId?: string;
9
+ }, retryConfig?: Partial<RetryConfig>): Promise<AttioTask>;
10
+ export declare function updateTask(taskId: string, updates: {
11
+ content?: string;
12
+ status?: string;
13
+ assigneeId?: string;
14
+ dueDate?: string;
15
+ recordIds?: string[];
16
+ }, retryConfig?: Partial<RetryConfig>): Promise<AttioTask>;
17
+ export declare function deleteTask(taskId: string, retryConfig?: Partial<RetryConfig>): Promise<boolean>;
18
+ export declare function linkRecordToTask(taskId: string, recordId: string, retryConfig?: Partial<RetryConfig>): Promise<boolean>;
19
+ export declare function unlinkRecordFromTask(taskId: string, recordId: string, retryConfig?: Partial<RetryConfig>): Promise<boolean>;
20
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src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pC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GACjC,OAAO,CAAC,OAAO,CAAC,CAOlB"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Task operations for Attio
3
+ */
4
+ import { getAttioClient } from '../attio-client.js';
5
+ import { callWithRetry } from './retry.js';
6
+ export async function listTasks(status, assigneeId, page = 1, pageSize = 25, retryConfig) {
7
+ const api = getAttioClient();
8
+ const params = new URLSearchParams();
9
+ params.append('page', String(page));
10
+ params.append('pageSize', String(pageSize));
11
+ if (status)
12
+ params.append('status', status);
13
+ if (assigneeId)
14
+ params.append('assignee', assigneeId);
15
+ const path = `/tasks?${params.toString()}`;
16
+ return callWithRetry(async () => {
17
+ const res = await api.get(path);
18
+ return res.data.data || [];
19
+ }, retryConfig);
20
+ }
21
+ export async function getTask(taskId, retryConfig) {
22
+ const api = getAttioClient();
23
+ const path = `/tasks/${taskId}`;
24
+ return callWithRetry(async () => {
25
+ const res = await api.get(path);
26
+ return res.data.data || res.data;
27
+ }, retryConfig);
28
+ }
29
+ export async function createTask(content, options = {}, retryConfig) {
30
+ const api = getAttioClient();
31
+ const path = '/tasks';
32
+ const data = { content };
33
+ if (options.assigneeId)
34
+ data.assignee = { id: options.assigneeId, type: 'workspace-member' };
35
+ if (options.dueDate)
36
+ data.due_date = options.dueDate;
37
+ if (options.recordId)
38
+ data.linked_records = [{ id: options.recordId }];
39
+ return callWithRetry(async () => {
40
+ const res = await api.post(path, data);
41
+ return res.data.data || res.data;
42
+ }, retryConfig);
43
+ }
44
+ export async function updateTask(taskId, updates, retryConfig) {
45
+ const api = getAttioClient();
46
+ const path = `/tasks/${taskId}`;
47
+ const data = {};
48
+ if (updates.content)
49
+ data.content = updates.content;
50
+ if (updates.status)
51
+ data.status = updates.status;
52
+ if (updates.assigneeId)
53
+ data.assignee = { id: updates.assigneeId, type: 'workspace-member' };
54
+ if (updates.dueDate)
55
+ data.due_date = updates.dueDate;
56
+ if (updates.recordIds)
57
+ data.linked_records = updates.recordIds.map((id) => ({ id }));
58
+ return callWithRetry(async () => {
59
+ const res = await api.patch(path, data);
60
+ return res.data.data || res.data;
61
+ }, retryConfig);
62
+ }
63
+ export async function deleteTask(taskId, retryConfig) {
64
+ const api = getAttioClient();
65
+ const path = `/tasks/${taskId}`;
66
+ return callWithRetry(async () => {
67
+ await api.delete(path);
68
+ return true;
69
+ }, retryConfig);
70
+ }
71
+ export async function linkRecordToTask(taskId, recordId, retryConfig) {
72
+ const api = getAttioClient();
73
+ const path = `/tasks/${taskId}/linked-records`;
74
+ return callWithRetry(async () => {
75
+ await api.post(path, { record_id: recordId });
76
+ return true;
77
+ }, retryConfig);
78
+ }
79
+ export async function unlinkRecordFromTask(taskId, recordId, retryConfig) {
80
+ const api = getAttioClient();
81
+ const path = `/tasks/${taskId}/linked-records/${recordId}`;
82
+ return callWithRetry(async () => {
83
+ await api.delete(path);
84
+ return true;
85
+ }, retryConfig);
86
+ }
87
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/api/operations/tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMpD,OAAO,EAAE,aAAa,EAAe,MAAM,YAAY,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,MAAe,EACf,UAAmB,EACnB,OAAe,CAAC,EAChB,WAAmB,EAAE,EACrB,WAAkC;IAElC,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IACrC,MAAM,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Aa,CAAC,KAAK,IAAI,EAAE;QAC9B,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,WAAW,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Shared types for API operations
3
+ * Re-exports and additional type definitions used across modules
4
+ */
5
+ import { BatchRequestItem as BatchRequestItemType, BatchItemResult as BatchItemResultType, BatchResponse as BatchResponseType, BatchConfig as BatchConfigType } from '../../types/attio.js';
6
+ export type BatchRequestItem<T> = BatchRequestItemType<T>;
7
+ export type BatchItemResult<R> = BatchItemResultType<R>;
8
+ export type BatchResponse<R> = BatchResponseType<R>;
9
+ export type BatchConfig = BatchConfigType;
10
+ /**
11
+ * Filter definition for list entries
12
+ */
13
+ export interface ListEntryFilter {
14
+ attribute: {
15
+ slug: string;
16
+ };
17
+ condition: string;
18
+ value: any;
19
+ /**
20
+ * Optional logical operator to use when combined with other filters
21
+ * If not provided, default is 'and'
22
+ */
23
+ logicalOperator?: 'and' | 'or';
24
+ }
25
+ /**
26
+ * Parameters for filtering list entries
27
+ */
28
+ export interface ListEntryFilters {
29
+ /**
30
+ * Individual filter conditions to apply
31
+ */
32
+ filters?: ListEntryFilter[];
33
+ /**
34
+ * When true, at least one filter must match (equivalent to OR)
35
+ * When false or omitted, all filters must match (equivalent to AND)
36
+ */
37
+ matchAny?: boolean;
38
+ /**
39
+ * Optional array of attribute groups for complex nested conditions
40
+ * Each group is treated as a unit with its own logical operator
41
+ */
42
+ groups?: {
43
+ attributes: ListEntryFilter[];
44
+ logicalOperator?: 'and' | 'or';
45
+ }[];
46
+ [key: string]: any;
47
+ }
48
+ /**
49
+ * Validated filter parameters where filters array is guaranteed to exist
50
+ * Used internally after validation to ensure type safety
51
+ */
52
+ export interface ValidatedListEntryFilters extends ListEntryFilters {
53
+ /**
54
+ * Individual filter conditions to apply (guaranteed to exist after validation)
55
+ */
56
+ filters: ListEntryFilter[];
57
+ }
58
+ /**
59
+ * Common types and interfaces shared across API operations
60
+ */
61
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/operations/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,gBAAgB,IAAI,oBAAoB,EACxC,eAAe,IAAI,mBAAmB,EACtC,aAAa,IAAI,iBAAiB,EAClC,WAAW,IAAI,eAAe,EAC/B,MAAM,sBAAsB,CAAC;AAG9B,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAC1D,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC;AACxD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC;AACpD,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,GAAG,CAAC;IACX;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE;QACP,UAAU,EAAE,eAAe,EAAE,CAAC;QAC9B,eAAe,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;KAChC,EAAE,CAAC;IACJ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IACjE;;OAEG;IACH,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED;;GAEG"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Shared types for API operations
3
+ * Re-exports and additional type definitions used across modules
4
+ */
5
+ export {};
6
+ /**
7
+ * Common types and interfaces shared across API operations
8
+ */
9
+ // Additional shared types can be added here as needed
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/operations/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAkEH;;GAEG;AAEH,sDAAsD"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Interface for command arguments
3
+ */
4
+ interface AttributesCommandArgs {
5
+ object?: string;
6
+ all?: boolean;
7
+ output?: string;
8
+ reset?: boolean;
9
+ apiKey?: string;
10
+ [key: string]: unknown;
11
+ }
12
+ /**
13
+ * Gets all available objects from Attio
14
+ *
15
+ * @param apiKey - The Attio API key
16
+ * @returns Array of object slugs
17
+ */
18
+ export declare function getAvailableObjects(apiKey: string): Promise<string[]>;
19
+ /**
20
+ * Discovers attributes for a specific object
21
+ *
22
+ * @param objectSlug - The object slug (e.g., 'companies')
23
+ * @param apiKey - The Attio API key
24
+ * @returns Map of attribute titles to API slugs
25
+ */
26
+ export declare function getObjectAttributes(objectSlug: string, apiKey: string): Promise<Record<string, string>>;
27
+ /**
28
+ * Command handler for discovering attributes
29
+ *
30
+ * @param argv - Command arguments
31
+ */
32
+ export declare function discoverAttributes(argv: AttributesCommandArgs): Promise<void>;
33
+ export {};
34
+ //# sourceMappingURL=attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/attributes.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,UAAU,qBAAqB;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAiCD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAqB3E;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA+BjC;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CA0Hf"}
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Command handler for discovering Attio attributes
3
+ */
4
+ import axios from 'axios';
5
+ import ora from 'ora';
6
+ import chalk from 'chalk';
7
+ import { loadMappingConfig, writeMappingConfig, } from '../../utils/config-loader.js';
8
+ /**
9
+ * Creates an Axios instance for the Attio API
10
+ *
11
+ * @param apiKey - The Attio API key
12
+ * @returns Configured Axios instance
13
+ */
14
+ function createAttioClient(apiKey) {
15
+ return axios.create({
16
+ baseURL: 'https://api.attio.com/v2',
17
+ headers: {
18
+ Authorization: `Bearer ${apiKey}`,
19
+ 'Content-Type': 'application/json',
20
+ },
21
+ });
22
+ }
23
+ /**
24
+ * Gets all available objects from Attio
25
+ *
26
+ * @param apiKey - The Attio API key
27
+ * @returns Array of object slugs
28
+ */
29
+ export async function getAvailableObjects(apiKey) {
30
+ const client = createAttioClient(apiKey);
31
+ try {
32
+ const response = await client.get('/objects');
33
+ const objects = response.data.data || [];
34
+ // Extract API slugs from the objects
35
+ return objects
36
+ .filter((obj) => obj.api_slug)
37
+ .map((obj) => obj.api_slug);
38
+ }
39
+ catch (error) {
40
+ if (axios.isAxiosError(error) && error.response) {
41
+ throw new Error(`Failed to get objects: ${error.response.status} ${error.response.statusText}\n${JSON.stringify(error.response.data, null, 2)}`);
42
+ }
43
+ throw error;
44
+ }
45
+ }
46
+ /**
47
+ * Discovers attributes for a specific object
48
+ *
49
+ * @param objectSlug - The object slug (e.g., 'companies')
50
+ * @param apiKey - The Attio API key
51
+ * @returns Map of attribute titles to API slugs
52
+ */
53
+ export async function getObjectAttributes(objectSlug, apiKey) {
54
+ const client = createAttioClient(apiKey);
55
+ try {
56
+ const response = await client.get(`/objects/${objectSlug}/attributes`);
57
+ const attributes = response.data.data || [];
58
+ // Create mapping from title to api_slug
59
+ const mappings = {};
60
+ attributes.forEach((attr) => {
61
+ if (attr.title && attr.api_slug) {
62
+ mappings[attr.title] = attr.api_slug;
63
+ }
64
+ });
65
+ return mappings;
66
+ }
67
+ catch (error) {
68
+ if (axios.isAxiosError(error) && error.response) {
69
+ throw new Error(`Failed to get attributes for object ${objectSlug}: ${error.response.status} ${error.response.statusText}\n${JSON.stringify(error.response.data, null, 2)}`);
70
+ }
71
+ throw error;
72
+ }
73
+ }
74
+ /**
75
+ * Command handler for discovering attributes
76
+ *
77
+ * @param argv - Command arguments
78
+ */
79
+ export async function discoverAttributes(argv) {
80
+ const spinner = ora('Initializing...').start();
81
+ try {
82
+ // Get API key from args or environment
83
+ const apiKey = argv.apiKey || process.env.ATTIO_API_KEY;
84
+ if (!apiKey) {
85
+ spinner.fail('No API key provided. Set ATTIO_API_KEY env var or pass --api-key');
86
+ process.exit(1);
87
+ }
88
+ // Initialize config
89
+ let config;
90
+ try {
91
+ config = loadMappingConfig();
92
+ }
93
+ catch (error) {
94
+ spinner.warn('Failed to load existing configuration, creating new one...');
95
+ config = {
96
+ version: '1.0',
97
+ metadata: {
98
+ generated: new Date().toISOString(),
99
+ description: 'Generated by attribute discovery tool',
100
+ },
101
+ mappings: {
102
+ attributes: {
103
+ common: {},
104
+ objects: {},
105
+ custom: {},
106
+ },
107
+ objects: {},
108
+ lists: {},
109
+ relationships: {},
110
+ },
111
+ };
112
+ }
113
+ // Prepare the objects to process
114
+ let objectsToProcess = [];
115
+ if (argv.all) {
116
+ spinner.text = 'Fetching available objects...';
117
+ objectsToProcess = await getAvailableObjects(apiKey);
118
+ spinner.succeed(`Found ${objectsToProcess.length} objects in Attio workspace`);
119
+ }
120
+ else if (argv.object) {
121
+ objectsToProcess = [argv.object];
122
+ }
123
+ // Process each object
124
+ for (const objectSlug of objectsToProcess) {
125
+ spinner.start(`Discovering attributes for ${chalk.cyan(objectSlug)}...`);
126
+ try {
127
+ const attributeMappings = await getObjectAttributes(objectSlug, apiKey);
128
+ const attributeCount = Object.keys(attributeMappings).length;
129
+ if (attributeCount > 0) {
130
+ // Ensure the object section exists
131
+ if (!config.mappings.attributes.objects[objectSlug]) {
132
+ config.mappings.attributes.objects[objectSlug] = {};
133
+ }
134
+ // Reset or merge mappings
135
+ if (argv.reset) {
136
+ config.mappings.attributes.objects[objectSlug] = attributeMappings;
137
+ }
138
+ else {
139
+ // Merge with existing mappings
140
+ config.mappings.attributes.objects[objectSlug] = {
141
+ ...config.mappings.attributes.objects[objectSlug],
142
+ ...attributeMappings,
143
+ };
144
+ }
145
+ spinner.succeed(`Found ${chalk.green(attributeCount.toString())} attributes for ${chalk.cyan(objectSlug)}`);
146
+ }
147
+ else {
148
+ spinner.warn(`No attributes found for ${chalk.cyan(objectSlug)}`);
149
+ }
150
+ }
151
+ catch (error) {
152
+ spinner.fail(`Error fetching attributes for ${chalk.cyan(objectSlug)}: ${error instanceof Error ? error.message : String(error)}`);
153
+ }
154
+ }
155
+ // Update metadata
156
+ config.metadata = {
157
+ ...config.metadata,
158
+ generated: new Date().toISOString(),
159
+ lastDiscovery: new Date().toISOString(),
160
+ };
161
+ // Write the updated config
162
+ spinner.start(`Writing configuration to ${chalk.cyan(argv.output || 'config/mappings/user.json')}...`);
163
+ await writeMappingConfig(config, argv.output);
164
+ spinner.succeed(chalk.green('✓ Attribute discovery completed successfully!'));
165
+ }
166
+ catch (error) {
167
+ spinner.fail(`Discovery failed: ${error instanceof Error ? error.message : String(error)}`);
168
+ process.exit(1);
169
+ }
170
+ }
171
+ //# sourceMappingURL=attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../src/cli/commands/attributes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,8BAA8B,CAAC;AA6BtC;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,MAAc;IACvC,OAAO,KAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,0BAA0B;QACnC,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,MAAM,EAAE;YACjC,cAAc,EAAE,kBAAkB;SACnC;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAAc;IACtD,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEzC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAEzC,qCAAqC;QACrC,OAAO,OAAO;aACX,MAAM,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;aAClC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CACb,0BAA0B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
2
+ export {};
3
+ //# sourceMappingURL=discover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/cli/discover.ts"],"names":[],"mappings":""}