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,37 @@
1
+ /**
2
+ * Shared types for people module
3
+ */
4
+ /**
5
+ * Interface for attributes when creating or updating a person
6
+ */
7
+ export interface PersonAttributes {
8
+ /** Person's full name */
9
+ name?: string;
10
+ /** Email addresses (array of strings) */
11
+ email_addresses?: string[];
12
+ /** Phone numbers (array of strings) */
13
+ phone_numbers?: string[];
14
+ /** Job title */
15
+ job_title?: string;
16
+ /** Associated company ID */
17
+ company?: {
18
+ record_id: string;
19
+ };
20
+ /** Custom attributes */
21
+ [key: string]: any;
22
+ }
23
+ export declare class PersonOperationError extends Error {
24
+ operation: string;
25
+ personId?: string | undefined;
26
+ constructor(operation: string, personId?: string | undefined, message?: string);
27
+ }
28
+ export declare class InvalidPersonDataError extends Error {
29
+ constructor(message: string);
30
+ }
31
+ export declare class PersonValidator {
32
+ static validateCreate(attributes: PersonAttributes): Promise<PersonAttributes>;
33
+ static validateUpdate(personId: string, attributes: PersonAttributes): Promise<PersonAttributes>;
34
+ static validateAttributeUpdate(personId: string, attributeName: string, attributeValue: any): Promise<void>;
35
+ static validateDelete(personId: string): void;
36
+ }
37
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/objects/people/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB,gBAAgB;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,4BAA4B;IAC5B,OAAO,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAEhC,wBAAwB;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAGD,qBAAa,oBAAqB,SAAQ,KAAK;IAEpC,SAAS,EAAE,MAAM;IACjB,QAAQ,CAAC,EAAE,MAAM;gBADjB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,YAAA,EACxB,OAAO,CAAC,EAAE,MAAM;CASnB;AAED,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAGD,qBAAa,eAAe;WACb,cAAc,CACzB,UAAU,EAAE,gBAAgB,GAC3B,OAAO,CAAC,gBAAgB,CAAC;WAmBf,cAAc,CACzB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,gBAAgB,GAC3B,OAAO,CAAC,gBAAgB,CAAC;WAef,uBAAuB,CAClC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,GAAG,GAClB,OAAO,CAAC,IAAI,CAAC;IA0BhB,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAK9C"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Shared types for people module
3
+ */
4
+ // Error classes for people operations
5
+ export class PersonOperationError extends Error {
6
+ operation;
7
+ personId;
8
+ constructor(operation, personId, message) {
9
+ super(`Person ${operation} failed${personId ? ` for ${personId}` : ''}: ${message}`);
10
+ this.operation = operation;
11
+ this.personId = personId;
12
+ this.name = 'PersonOperationError';
13
+ }
14
+ }
15
+ export class InvalidPersonDataError extends Error {
16
+ constructor(message) {
17
+ super(`Invalid person data: ${message}`);
18
+ this.name = 'InvalidPersonDataError';
19
+ }
20
+ }
21
+ // Validator for person data
22
+ export class PersonValidator {
23
+ static async validateCreate(attributes) {
24
+ // Basic validation - ensure we have at least an email or name
25
+ if (!attributes.email_addresses && !attributes.name) {
26
+ throw new InvalidPersonDataError('Must provide at least an email address or name');
27
+ }
28
+ // Ensure email_addresses is an array if provided
29
+ if (attributes.email_addresses &&
30
+ !Array.isArray(attributes.email_addresses)) {
31
+ attributes.email_addresses = [attributes.email_addresses];
32
+ }
33
+ return attributes;
34
+ }
35
+ static async validateUpdate(personId, attributes) {
36
+ if (!personId || typeof personId !== 'string') {
37
+ throw new InvalidPersonDataError('Person ID must be a non-empty string');
38
+ }
39
+ // Ensure at least one attribute is being updated
40
+ if (!attributes || Object.keys(attributes).length === 0) {
41
+ throw new InvalidPersonDataError('Must provide at least one attribute to update');
42
+ }
43
+ return attributes;
44
+ }
45
+ static async validateAttributeUpdate(personId, attributeName, attributeValue) {
46
+ if (!personId || typeof personId !== 'string') {
47
+ throw new InvalidPersonDataError('Person ID must be a non-empty string');
48
+ }
49
+ if (!attributeName || typeof attributeName !== 'string') {
50
+ throw new InvalidPersonDataError('Attribute name must be a non-empty string');
51
+ }
52
+ // Special validation for email_addresses
53
+ if (attributeName === 'email_addresses' && attributeValue) {
54
+ const emails = Array.isArray(attributeValue)
55
+ ? attributeValue
56
+ : [attributeValue];
57
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
58
+ for (const email of emails) {
59
+ if (!emailRegex.test(email)) {
60
+ throw new InvalidPersonDataError(`Invalid email format: ${email}`);
61
+ }
62
+ }
63
+ }
64
+ }
65
+ static validateDelete(personId) {
66
+ if (!personId || typeof personId !== 'string') {
67
+ throw new InvalidPersonDataError('Person ID must be a non-empty string');
68
+ }
69
+ }
70
+ }
71
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/objects/people/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyBH,sCAAsC;AACtC,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAEpC;IACA;IAFT,YACS,SAAiB,EACjB,QAAiB,EACxB,OAAgB;QAEhB,KAAK,CACH,UAAU,SAAS,UACjB,QAAQ,CAAC,CAAC,CAAC,QAAQ,QAAQ,EAAE,CAAC,CAAC,CAAC,EAClC,KAAK,OAAO,EAAE,CACf,CAAC;QARK,cAAS,GAAT,SAAS,CAAQ;QACjB,aAAQ,GAAR,QAAQ,CAAS;QAQxB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,M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sB,CAAC,sCAAsC,CAAC,CAAC;QAC3E,CAAC;QAED,IAAI,CAAC,aAAa,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;YACxD,MAAM,IAAI,sBAAsB,CAC9B,2CAA2C,CAC5C,CAAC;QACJ,CAAC;QAED,yCAAyC;QACzC,IAAI,aAAa,KAAK,iBAAiB,IAAI,cAAc,EAAE,CAAC;YAC1D,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC;gBAC1C,CAAC,CAAC,cAAc;gBAChB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;YACrB,MAAM,UAAU,GAAG,4BAA4B,CAAC;YAEhD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC3B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC5B,MAAM,IAAI,sBAAsB,CAAC,yBAAyB,KAAK,EAAE,CAAC,CAAC;gBACrE,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,QAAgB;QACpC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC9C,MAAM,IAAI,sBAAsB,CAAC,sCAAsC,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Write operations for People with dynamic field detection
3
+ */
4
+ import { Person, PersonCreateAttributes } from '../types/attio.js';
5
+ export declare class PersonOperationError extends Error {
6
+ operation: string;
7
+ personId?: string | undefined;
8
+ constructor(operation: string, personId?: string | undefined, message?: string);
9
+ }
10
+ export declare class InvalidPersonDataError extends Error {
11
+ constructor(message: string);
12
+ }
13
+ /**
14
+ * Batch email validation for performance optimization
15
+ * Instead of multiple individual API calls, use a single query to check multiple emails
16
+ */
17
+ export declare function searchPeopleByEmails(emails: string[]): Promise<{
18
+ email: string;
19
+ exists: boolean;
20
+ personId?: string;
21
+ }[]>;
22
+ /**
23
+ * Simple validator for person data
24
+ * Can be enhanced with more specific validation rules
25
+ */
26
+ export declare class PersonValidator {
27
+ static validateCreate(attributes: PersonCreateAttributes): Promise<PersonCreateAttributes>;
28
+ static validateUpdate(personId: string, attributes: any): Promise<any>;
29
+ static validateAttributeUpdate(personId: string, attributeName: string, attributeValue: any): Promise<void>;
30
+ static validateDelete(personId: string): void;
31
+ }
32
+ /**
33
+ * Creates a new person
34
+ *
35
+ * @param attributes - Person attributes as key-value pairs
36
+ * @returns Created person record
37
+ * @throws InvalidPersonDataError if validation fails
38
+ * @throws PersonOperationError if creation fails
39
+ */
40
+ export declare function createPerson(attributes: PersonCreateAttributes): Promise<Person>;
41
+ /**
42
+ * Updates an existing person
43
+ *
44
+ * @param personId - ID of the person to update
45
+ * @param attributes - Person attributes to update
46
+ * @returns Updated person record
47
+ * @throws InvalidPersonDataError if validation fails
48
+ * @throws PersonOperationError if update fails
49
+ */
50
+ export declare function updatePerson(personId: string, attributes: any): Promise<Person>;
51
+ /**
52
+ * Updates a specific attribute of a person
53
+ *
54
+ * @param personId - ID of the person to update
55
+ * @param attributeName - Name of the attribute to update
56
+ * @param attributeValue - New value for the attribute
57
+ * @returns Updated person record
58
+ * @throws InvalidPersonDataError if validation fails
59
+ * @throws PersonOperationError if update fails
60
+ */
61
+ export declare function updatePersonAttribute(personId: string, attributeName: string, attributeValue: any): Promise<Person>;
62
+ /**
63
+ * Deletes a person
64
+ *
65
+ * @param personId - ID of the person to delete
66
+ * @returns True if deletion was successful
67
+ * @throws InvalidPersonDataError if validation fails
68
+ * @throws PersonOperationError if deletion fails
69
+ */
70
+ export declare function deletePerson(personId: string): Promise<boolean>;
71
+ //# sourceMappingURL=people-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"people-write.d.ts","sourceRoot":"","sources":["../../src/objects/people-write.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,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CAAC,CA6BjB;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiBrE"}
@@ -0,0 +1,261 @@
1
+ import { ResourceType } from '../types/attio.js';
2
+ import { createObjectWithDynamicFields, updateObjectWithDynamicFields, updateObjectAttributeWithDynamicFields, deleteObjectWithValidation, } from './base-operations.js';
3
+ import { AttioApiError } from '../utils/error-handler.js';
4
+ import { getAttributeSlugById } from '../api/attribute-types.js';
5
+ import { searchPeopleByEmail } from './people/search.js';
6
+ import { searchCompaniesByName } from './companies/search.js';
7
+ import { getAttioClient } from '../api/attio-client.js';
8
+ // Error classes for people operations
9
+ export class PersonOperationError extends Error {
10
+ operation;
11
+ personId;
12
+ constructor(operation, personId, message) {
13
+ super(`Person ${operation} failed${personId ? ` for ${personId}` : ''}: ${message}`);
14
+ this.operation = operation;
15
+ this.personId = personId;
16
+ this.name = 'PersonOperationError';
17
+ }
18
+ }
19
+ export class InvalidPersonDataError extends Error {
20
+ constructor(message) {
21
+ super(`Invalid person data: ${message}`);
22
+ this.name = 'InvalidPersonDataError';
23
+ }
24
+ }
25
+ /**
26
+ * Batch email validation for performance optimization
27
+ * Instead of multiple individual API calls, use a single query to check multiple emails
28
+ */
29
+ export async function searchPeopleByEmails(emails) {
30
+ if (!emails || emails.length === 0) {
31
+ return [];
32
+ }
33
+ const client = getAttioClient();
34
+ const results = [];
35
+ try {
36
+ // Create a filter that searches for any of the provided email addresses
37
+ const response = await client.post('/objects/people/records/query', {
38
+ filter: {
39
+ $or: emails.map((email) => ({
40
+ email_addresses: { $contains: email },
41
+ })),
42
+ },
43
+ limit: emails.length * 2, // Allow for potential duplicates
44
+ });
45
+ // Create a map of found emails to person data
46
+ const foundEmails = new Map();
47
+ if (response.data?.data) {
48
+ for (const person of response.data.data) {
49
+ const personEmails = person.values?.email_addresses || [];
50
+ for (const emailObj of personEmails) {
51
+ if (emailObj.value && emails.includes(emailObj.value)) {
52
+ foundEmails.set(emailObj.value, person.id?.record_id);
53
+ }
54
+ }
55
+ }
56
+ }
57
+ // Build results for all requested emails
58
+ for (const email of emails) {
59
+ const personId = foundEmails.get(email);
60
+ results.push({
61
+ email,
62
+ exists: !!personId,
63
+ personId,
64
+ });
65
+ }
66
+ return results;
67
+ }
68
+ catch (error) {
69
+ // Fallback to individual searches if batch query fails
70
+ console.warn('[batchEmailValidation] Batch query failed, falling back to individual searches:', error);
71
+ for (const email of emails) {
72
+ try {
73
+ const existing = await searchPeopleByEmail(email);
74
+ results.push({
75
+ email,
76
+ exists: existing.length > 0,
77
+ personId: existing[0]?.id?.record_id,
78
+ });
79
+ }
80
+ catch (individualError) {
81
+ console.error(`[batchEmailValidation] Failed to search for email ${email}:`, individualError);
82
+ results.push({
83
+ email,
84
+ exists: false, // Assume doesn't exist if we can't check
85
+ });
86
+ }
87
+ }
88
+ return results;
89
+ }
90
+ }
91
+ /**
92
+ * Simple validator for person data
93
+ * Can be enhanced with more specific validation rules
94
+ */
95
+ export class PersonValidator {
96
+ static async validateCreate(attributes) {
97
+ // Basic validation - ensure we have at least an email or name
98
+ if (!attributes.email_addresses && !attributes.name) {
99
+ throw new InvalidPersonDataError('Must provide at least an email address or name');
100
+ }
101
+ // Ensure email_addresses is an array if provided
102
+ if (attributes.email_addresses &&
103
+ !Array.isArray(attributes.email_addresses)) {
104
+ attributes.email_addresses = [attributes.email_addresses];
105
+ }
106
+ // Check for duplicate emails using batch validation for better performance
107
+ if (attributes.email_addresses) {
108
+ const emailResults = await searchPeopleByEmails(attributes.email_addresses);
109
+ const duplicateEmails = emailResults.filter((result) => result.exists);
110
+ if (duplicateEmails.length > 0) {
111
+ const duplicateList = duplicateEmails
112
+ .map((result) => result.email)
113
+ .join(', ');
114
+ throw new InvalidPersonDataError(`Person(s) with email(s) ${duplicateList} already exist`);
115
+ }
116
+ }
117
+ // Resolve company name to record reference
118
+ if (attributes.company && typeof attributes.company === 'string') {
119
+ const results = await searchCompaniesByName(attributes.company);
120
+ if (results.length === 1) {
121
+ attributes.company = { record_id: results[0].id?.record_id };
122
+ }
123
+ else if (results.length === 0) {
124
+ throw new InvalidPersonDataError(`Company '${attributes.company}' not found. Provide a valid company ID.`);
125
+ }
126
+ else {
127
+ throw new InvalidPersonDataError(`Multiple companies match '${attributes.company}'. Please specify the company ID.`);
128
+ }
129
+ }
130
+ return attributes;
131
+ }
132
+ static async validateUpdate(personId, attributes) {
133
+ if (!personId || typeof personId !== 'string') {
134
+ throw new InvalidPersonDataError('Person ID must be a non-empty string');
135
+ }
136
+ // Ensure at least one attribute is being updated
137
+ if (!attributes || Object.keys(attributes).length === 0) {
138
+ throw new InvalidPersonDataError('Must provide at least one attribute to update');
139
+ }
140
+ return attributes;
141
+ }
142
+ static async validateAttributeUpdate(personId, attributeName, attributeValue) {
143
+ if (!personId || typeof personId !== 'string') {
144
+ throw new InvalidPersonDataError('Person ID must be a non-empty string');
145
+ }
146
+ if (!attributeName || typeof attributeName !== 'string') {
147
+ throw new InvalidPersonDataError('Attribute name must be a non-empty string');
148
+ }
149
+ // Special validation for email_addresses
150
+ if (attributeName === 'email_addresses' && attributeValue) {
151
+ const emails = Array.isArray(attributeValue)
152
+ ? attributeValue
153
+ : [attributeValue];
154
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
155
+ for (const email of emails) {
156
+ if (!emailRegex.test(email)) {
157
+ throw new InvalidPersonDataError(`Invalid email format: ${email}`);
158
+ }
159
+ }
160
+ }
161
+ }
162
+ static validateDelete(personId) {
163
+ if (!personId || typeof personId !== 'string') {
164
+ throw new InvalidPersonDataError('Person ID must be a non-empty string');
165
+ }
166
+ }
167
+ }
168
+ /**
169
+ * Creates a new person
170
+ *
171
+ * @param attributes - Person attributes as key-value pairs
172
+ * @returns Created person record
173
+ * @throws InvalidPersonDataError if validation fails
174
+ * @throws PersonOperationError if creation fails
175
+ */
176
+ export async function createPerson(attributes) {
177
+ try {
178
+ return await createObjectWithDynamicFields(ResourceType.PEOPLE, attributes, PersonValidator.validateCreate);
179
+ }
180
+ catch (error) {
181
+ if (error instanceof InvalidPersonDataError) {
182
+ throw error;
183
+ }
184
+ if (error instanceof AttioApiError) {
185
+ const detail = typeof error.detail === 'string' ? error.detail : '';
186
+ const match = detail.match(/attribute with ID "([^"]+)"/);
187
+ if (match) {
188
+ const slug = await getAttributeSlugById(ResourceType.PEOPLE, match[1]);
189
+ if (slug) {
190
+ const friendly = detail.replace(match[1], slug);
191
+ throw new PersonOperationError('create', undefined, friendly);
192
+ }
193
+ }
194
+ }
195
+ throw new PersonOperationError('create', undefined, error instanceof Error ? error.message : String(error));
196
+ }
197
+ }
198
+ /**
199
+ * Updates an existing person
200
+ *
201
+ * @param personId - ID of the person to update
202
+ * @param attributes - Person attributes to update
203
+ * @returns Updated person record
204
+ * @throws InvalidPersonDataError if validation fails
205
+ * @throws PersonOperationError if update fails
206
+ */
207
+ export async function updatePerson(personId, attributes) {
208
+ try {
209
+ return await updateObjectWithDynamicFields(ResourceType.PEOPLE, personId, attributes, PersonValidator.validateUpdate);
210
+ }
211
+ catch (error) {
212
+ if (error instanceof InvalidPersonDataError) {
213
+ throw error;
214
+ }
215
+ throw new PersonOperationError('update', personId, error instanceof Error ? error.message : String(error));
216
+ }
217
+ }
218
+ /**
219
+ * Updates a specific attribute of a person
220
+ *
221
+ * @param personId - ID of the person to update
222
+ * @param attributeName - Name of the attribute to update
223
+ * @param attributeValue - New value for the attribute
224
+ * @returns Updated person record
225
+ * @throws InvalidPersonDataError if validation fails
226
+ * @throws PersonOperationError if update fails
227
+ */
228
+ export async function updatePersonAttribute(personId, attributeName, attributeValue) {
229
+ try {
230
+ // Validate attribute update
231
+ await PersonValidator.validateAttributeUpdate(personId, attributeName, attributeValue);
232
+ return await updateObjectAttributeWithDynamicFields(ResourceType.PEOPLE, personId, attributeName, attributeValue, updatePerson);
233
+ }
234
+ catch (error) {
235
+ if (error instanceof InvalidPersonDataError ||
236
+ error instanceof PersonOperationError) {
237
+ throw error;
238
+ }
239
+ throw new PersonOperationError('update attribute', personId, error instanceof Error ? error.message : String(error));
240
+ }
241
+ }
242
+ /**
243
+ * Deletes a person
244
+ *
245
+ * @param personId - ID of the person to delete
246
+ * @returns True if deletion was successful
247
+ * @throws InvalidPersonDataError if validation fails
248
+ * @throws PersonOperationError if deletion fails
249
+ */
250
+ export async function deletePerson(personId) {
251
+ try {
252
+ return await deleteObjectWithValidation(ResourceType.PEOPLE, personId, PersonValidator.validateDelete);
253
+ }
254
+ catch (error) {
255
+ if (error instanceof InvalidPersonDataError) {
256
+ throw error;
257
+ }
258
+ throw new PersonOperationError('delete', personId, error instanceof Error ? error.message : String(error));
259
+ }
260
+ }
261
+ //# sourceMappingURL=people-write.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"people-write.js","sourceRoot":"","sources":["../../src/objects/people-write.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,sCAAsC,EACtC,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,sCAAsC;AACtC,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAEpC;IACA;IAFT,YACS,SAAiB,EACjB,QAAiB,EACxB,OAAgB;QAEhB,KAAK,CACH,UAAU,SAAS,UACjB,QAAQ,CAAC,CAAC,CAAC,QAAQ,QAAQ,EAAE,CAAC,CAAC,CAAC,EAClC,KAAK,OAAO,EAAE,CACf,CAAC;QARK,cAAS,GAAT,SAAS,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c,EACd,YAAY,CACb,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IACE,KAAK,YAAY,sBAAsB;YACvC,KAAK,YAAY,oBAAoB,EACrC,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,oBAAoB,CAC5B,kBAAkB,EAClB,QAAQ,EACR,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,IAAI,CAAC;QACH,OAAO,MAAM,0BAA0B,CACrC,YAAY,CAAC,MAAM,EACnB,QAAQ,EACR,eAAe,CAAC,cAAc,CAC/B,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,sBAAsB,EAAE,CAAC;YAC5C,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,oBAAoB,CAC5B,QAAQ,EACR,QAAQ,EACR,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Record formatting utilities
3
+ */
4
+ import { RecordAttributes } from '../../types/attio.js';
5
+ /**
6
+ * Helper function to format a single record attribute based on type
7
+ *
8
+ * @param key - Attribute key
9
+ * @param value - Attribute value to format
10
+ * @returns Properly formatted attribute value for the API
11
+ */
12
+ export declare function formatRecordAttribute(key: string, value: any): any;
13
+ /**
14
+ * Formats a full set of record attributes for API requests
15
+ *
16
+ * @param attributes - Raw attribute key-value pairs
17
+ * @returns Formatted attributes object ready for API submission
18
+ */
19
+ export declare function formatRecordAttributes(attributes: Record<string, any>): RecordAttributes;
20
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/objects/records/formatters.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,CAkClE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC9B,gBAAgB,CAQlB"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Helper function to format a single record attribute based on type
3
+ *
4
+ * @param key - Attribute key
5
+ * @param value - Attribute value to format
6
+ * @returns Properly formatted attribute value for the API
7
+ */
8
+ export function formatRecordAttribute(key, value) {
9
+ if (value === null || value === undefined) {
10
+ return value;
11
+ }
12
+ if (value instanceof Date) {
13
+ return value.toISOString();
14
+ }
15
+ if (typeof value === 'number' &&
16
+ (key.includes('price') || key.includes('revenue') || key.includes('cost'))) {
17
+ return value;
18
+ }
19
+ if (typeof value === 'object' &&
20
+ value !== null &&
21
+ !Array.isArray(value) &&
22
+ (key.includes('address') || key.includes('location'))) {
23
+ if ('street' in value || 'city' in value || 'country' in value) {
24
+ return value;
25
+ }
26
+ }
27
+ if (typeof value === 'string' && value.match(/^record_[a-z0-9]+$/)) {
28
+ return {
29
+ record_id: value,
30
+ };
31
+ }
32
+ return value;
33
+ }
34
+ /**
35
+ * Formats a full set of record attributes for API requests
36
+ *
37
+ * @param attributes - Raw attribute key-value pairs
38
+ * @returns Formatted attributes object ready for API submission
39
+ */
40
+ export function formatRecordAttributes(attributes) {
41
+ const formattedAttributes = {};
42
+ for (const [key, value] of Object.entries(attributes)) {
43
+ formattedAttributes[key] = formatRecordAttribute(key, value);
44
+ }
45
+ return formattedAttributes;
46
+ }
47
+ //# sourceMappingURL=formatters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/objects/records/formatters.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW,EAAE,KAAU;IAC3D,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;IAED,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAC1E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACrB,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EACrD,CAAC;QACD,IAAI,QAAQ,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC/D,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACnE,OAAO;YACL,SAAS,EAAE,KAAK;SACjB,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,UAA+B;IAE/B,MAAM,mBAAmB,GAAqB,EAAE,CAAC;IAEjD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACtD,mBAAmB,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { BatchConfig, BatchResponse } from '../../api/operations/index.js';
2
+ import { ResourceType, AttioRecord, RecordAttributes, RecordListParams } from '../../types/attio.js';
3
+ /**
4
+ * Creates a new record for a specific object type
5
+ *
6
+ * @param objectSlug - Object slug (e.g., 'companies', 'people')
7
+ * @param attributes - Record attributes as key-value pairs
8
+ * @param objectId - Optional object ID (alternative to slug)
9
+ * @returns Created record
10
+ */
11
+ export declare function createObjectRecord<T extends AttioRecord>(objectSlug: string | ResourceType, attributes: RecordAttributes, objectId?: string): Promise<T>;
12
+ /**
13
+ * Gets details for a specific record
14
+ *
15
+ * @param objectSlug - Object slug (e.g., 'companies', 'people')
16
+ * @param recordId - ID of the record to retrieve
17
+ * @param attributes - Optional list of attribute slugs to include
18
+ * @param objectId - Optional object ID (alternative to slug)
19
+ * @returns Record details
20
+ */
21
+ export declare function getObjectRecord<T extends AttioRecord>(objectSlug: string, recordId: string, attributes?: string[], objectId?: string): Promise<T>;
22
+ /**
23
+ * Updates a specific record
24
+ *
25
+ * @param objectSlug - Object slug (e.g., 'companies', 'people')
26
+ * @param recordId - ID of the record to update
27
+ * @param attributes - Record attributes to update
28
+ * @param objectId - Optional object ID (alternative to slug)
29
+ * @returns Updated record
30
+ */
31
+ export declare function updateObjectRecord<T extends AttioRecord>(objectSlug: string, recordId: string, attributes: RecordAttributes, objectId?: string): Promise<T>;
32
+ /**
33
+ * Deletes a specific record
34
+ *
35
+ * @param objectSlug - Object slug (e.g., 'companies', 'people')
36
+ * @param recordId - ID of the record to delete
37
+ * @param objectId - Optional object ID (alternative to slug)
38
+ * @returns True if deletion was successful
39
+ */
40
+ export declare function deleteObjectRecord(objectSlug: string, recordId: string, objectId?: string): Promise<boolean>;
41
+ /**
42
+ * Lists records for a specific object type with filtering options
43
+ *
44
+ * @param objectSlug - Object slug (e.g., 'companies', 'people')
45
+ * @param options - Optional listing options (pagination, filtering, etc.)
46
+ * @param objectId - Optional object ID (alternative to slug)
47
+ * @returns Array of records
48
+ */
49
+ export declare function listObjectRecords<T extends AttioRecord>(objectSlug: string, options?: Omit<RecordListParams, 'objectSlug' | 'objectId'>, objectId?: string): Promise<T[]>;
50
+ /**
51
+ * Creates multiple records in a batch operation
52
+ *
53
+ * @param objectSlug - Object slug (e.g., 'companies', 'people')
54
+ * @param records - Array of record attributes to create
55
+ * @param objectId - Optional object ID (alternative to slug)
56
+ * @param batchConfig - Optional batch configuration
57
+ * @returns Batch response with created records
58
+ */
59
+ export declare function batchCreateObjectRecords<T extends AttioRecord>(objectSlug: string, records: RecordAttributes[], objectId?: string, batchConfig?: Partial<BatchConfig>): Promise<BatchResponse<T>>;
60
+ /**
61
+ * Updates multiple records in a batch operation
62
+ *
63
+ * @param objectSlug - Object slug (e.g., 'companies', 'people')
64
+ * @param records - Array of records with IDs and attributes to update
65
+ * @param objectId - Optional object ID (alternative to slug)
66
+ * @param batchConfig - Optional batch configuration
67
+ * @returns Batch response with updated records
68
+ */
69
+ export declare function batchUpdateObjectRecords<T extends AttioRecord>(objectSlug: string, records: Array<{
70
+ id: string;
71
+ attributes: RecordAttributes;
72
+ }>, objectId?: string, batchConfig?: Partial<BatchConfig>): Promise<BatchResponse<T>>;
73
+ export { formatRecordAttribute, formatRecordAttributes } from './formatters.js';
74
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/objects/records/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,WAAW,EACX,aAAa,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO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