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,72 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * CLI tool for discovering Attio attributes and generating mapping files
4
+ */
5
+ import yargs from 'yargs';
6
+ import { hideBin } from 'yargs/helpers';
7
+ import { discoverAttributes } from './commands/attributes.js';
8
+ import dotenv from 'dotenv';
9
+ // Load environment variables from .env file
10
+ dotenv.config();
11
+ /**
12
+ * Main CLI entrypoint
13
+ */
14
+ yargs(hideBin(process.argv))
15
+ .scriptName('attio-discover')
16
+ .usage('$0 <cmd> [args]')
17
+ .command('attributes', 'Discover Attio attribute mappings', (yargs) => {
18
+ return yargs
19
+ .option('object', {
20
+ alias: 'o',
21
+ description: 'Object type to discover attributes for (e.g., companies, people)',
22
+ type: 'string',
23
+ })
24
+ .option('all', {
25
+ alias: 'a',
26
+ description: 'Discover attributes for all objects',
27
+ type: 'boolean',
28
+ default: false,
29
+ })
30
+ .option('output', {
31
+ alias: 'f',
32
+ description: 'Output file path',
33
+ default: 'config/mappings/user.json',
34
+ type: 'string',
35
+ })
36
+ .option('reset', {
37
+ alias: 'r',
38
+ description: 'Reset existing mappings instead of merging',
39
+ type: 'boolean',
40
+ default: false,
41
+ })
42
+ .option('api-key', {
43
+ alias: 'k',
44
+ description: 'Attio API key (defaults to ATTIO_API_KEY env var)',
45
+ type: 'string',
46
+ })
47
+ .conflicts('object', 'all')
48
+ .check((argv) => {
49
+ if (!argv.object && !argv.all) {
50
+ throw new Error('You must specify either --object or --all');
51
+ }
52
+ return true;
53
+ });
54
+ }, discoverAttributes)
55
+ /*
56
+ // These commands will be implemented in future phases
57
+ .command('objects', 'Discover object mappings', (yargs) => {
58
+ // ... object discovery options
59
+ }, discoverObjects)
60
+ .command('lists', 'Discover list mappings', (yargs) => {
61
+ // ... list discovery options
62
+ }, discoverLists)
63
+ .command('all', 'Discover all mappings', (yargs) => {
64
+ // ... options for discovering everything
65
+ }, discoverAll)
66
+ */
67
+ .demandCommand(1, 'You must specify a discovery command')
68
+ .help()
69
+ .alias('help', 'h')
70
+ .epilog('For more information, visit https://github.com/hmk/attio-mcp-server')
71
+ .parse();
72
+ //# sourceMappingURL=discover.js.map
@@ -0,0 +1 @@
1
+ {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AC,IAAI,EAAE,EAAE;QACd,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACP,CAAC,EACD,kBAAkB,CACnB;IACD;;;;;;;;;;;MAWE;KACD,aAAa,CAAC,CAAC,EAAE,sCAAsC,CAAC;KACxD,IAAI,EAAE;KACN,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;KAClB,MAAM,CAAC,qEAAqE,CAAC;KAC7E,KAAK,EAAE,CAAC"}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Error class hierarchy for Attio API errors
3
+ * Includes specialized error types for API interactions and validation
4
+ */
5
+ /**
6
+ * Base class for all Attio API errors
7
+ */
8
+ export declare class AttioApiError extends Error {
9
+ readonly statusCode: number;
10
+ readonly endpoint: string;
11
+ readonly method: string;
12
+ readonly details?: any | undefined;
13
+ /**
14
+ * Create an AttioApiError
15
+ *
16
+ * @param message - Error message
17
+ * @param statusCode - HTTP status code
18
+ * @param endpoint - API endpoint that was called
19
+ * @param details - Additional error details
20
+ */
21
+ constructor(message: string, statusCode: number, endpoint: string, method: string, details?: any | undefined);
22
+ /**
23
+ * Get a formatted representation of the error for logging
24
+ */
25
+ toFormattedString(): string;
26
+ }
27
+ /**
28
+ * Error for authentication issues (401)
29
+ */
30
+ export declare class AuthenticationError extends AttioApiError {
31
+ constructor(message: string | undefined, endpoint: string, method: string, details?: any);
32
+ }
33
+ /**
34
+ * Error for authorization issues (403)
35
+ */
36
+ export declare class AuthorizationError extends AttioApiError {
37
+ constructor(message: string | undefined, endpoint: string, method: string, details?: any);
38
+ }
39
+ /**
40
+ * Error for resource not found issues (404)
41
+ */
42
+ export declare class ResourceNotFoundError extends AttioApiError {
43
+ constructor(resourceType: string, resourceId: string, endpoint: string, method: string, details?: any);
44
+ }
45
+ /**
46
+ * Error for invalid request issues (400)
47
+ */
48
+ export declare class InvalidRequestError extends AttioApiError {
49
+ constructor(message: string, endpoint: string, method: string, details?: any);
50
+ }
51
+ /**
52
+ * Error for rate limit issues (429)
53
+ */
54
+ export declare class RateLimitError extends AttioApiError {
55
+ constructor(message: string | undefined, endpoint: string, method: string, details?: any);
56
+ }
57
+ /**
58
+ * Error for server-side issues (500, 502, 503, 504)
59
+ */
60
+ export declare class ServerError extends AttioApiError {
61
+ constructor(statusCode: number, message: string | undefined, endpoint: string, method: string, details?: any);
62
+ }
63
+ /**
64
+ * Factory function to create the appropriate error type based on status code
65
+ *
66
+ * @param statusCode - HTTP status code
67
+ * @param message - Error message
68
+ * @param endpoint - API endpoint that was called
69
+ * @param method - HTTP method used
70
+ * @param details - Additional error details
71
+ * @returns The appropriate error instance
72
+ */
73
+ export declare function createApiErrorFromStatus(statusCode: number, message: string, endpoint: string, method: string, details?: any): AttioApiError;
74
+ /**
75
+ * Create an appropriate error from Axios error response
76
+ *
77
+ * @param error - The caught error
78
+ * @param endpoint - API endpoint that was called
79
+ * @param method - HTTP method used
80
+ * @returns The appropriate error instance
81
+ */
82
+ export declare function createApiErrorFromAxiosError(error: any, endpoint: string, method: string): AttioApiError;
83
+ /**
84
+ * Filter error categories for more targeted error handling
85
+ */
86
+ export declare enum FilterErrorCategory {
87
+ STRUCTURE = "structure",// Basic structure issues (missing filters array)
88
+ ATTRIBUTE = "attribute",// Attribute-related issues
89
+ CONDITION = "condition",// Condition-related issues
90
+ VALUE = "value",// Value-related issues
91
+ TRANSFORMATION = "transformation"
92
+ }
93
+ /**
94
+ * Error class for filter validation issues
95
+ *
96
+ * Used when validating filter conditions and structures to ensure they meet
97
+ * the requirements of the Attio API format.
98
+ *
99
+ * @example
100
+ * ```typescript
101
+ * try {
102
+ * // Validate filter conditions
103
+ * if (!isValidFilterCondition(condition)) {
104
+ * throw new FilterValidationError(
105
+ * `Invalid filter condition: ${condition}`,
106
+ * FilterErrorCategory.CONDITION
107
+ * );
108
+ * }
109
+ * } catch (error) {
110
+ * if (error instanceof FilterValidationError) {
111
+ * // Handle filter validation error based on category
112
+ * if (error.category === FilterErrorCategory.CONDITION) {
113
+ * // Handle condition-specific error
114
+ * }
115
+ * }
116
+ * }
117
+ * ```
118
+ */
119
+ export declare class FilterValidationError extends Error {
120
+ readonly category: FilterErrorCategory;
121
+ /**
122
+ * Create a new FilterValidationError
123
+ *
124
+ * @param message - Detailed error message explaining the validation issue
125
+ * @param category - Error category for targeted handling (default: STRUCTURE)
126
+ */
127
+ constructor(message: string, category?: FilterErrorCategory);
128
+ }
129
+ /**
130
+ * Error for relationship filter validation issues
131
+ *
132
+ * @example
133
+ * ```typescript
134
+ * try {
135
+ * if (!isValidRelationshipType(type)) {
136
+ * throw new RelationshipFilterError(
137
+ * `Invalid relationship type: ${type}`,
138
+ * 'people',
139
+ * 'companies'
140
+ * );
141
+ * }
142
+ * } catch (error) {
143
+ * if (error instanceof RelationshipFilterError) {
144
+ * // Handle relationship filter error
145
+ * console.log(`Relationship error between ${error.sourceType} and ${error.targetType}`);
146
+ * }
147
+ * }
148
+ * ```
149
+ */
150
+ export declare class RelationshipFilterError extends FilterValidationError {
151
+ readonly sourceType?: string | undefined;
152
+ readonly targetType?: string | undefined;
153
+ readonly relationshipType?: string | undefined;
154
+ /**
155
+ * Create a RelationshipFilterError
156
+ *
157
+ * @param message - Error message
158
+ * @param sourceType - The source entity type (e.g., 'people', 'companies')
159
+ * @param targetType - The target entity type (e.g., 'companies', 'lists')
160
+ * @param relationshipType - The type of relationship that failed validation
161
+ */
162
+ constructor(message: string, sourceType?: string | undefined, targetType?: string | undefined, relationshipType?: string | undefined);
163
+ }
164
+ /**
165
+ * Error specifically for list relationship issues
166
+ *
167
+ * @example
168
+ * ```typescript
169
+ * try {
170
+ * if (!isValidListId(listId)) {
171
+ * throw new ListRelationshipError(`Invalid list ID: ${listId}`, 'people', listId);
172
+ * }
173
+ * } catch (error) {
174
+ * if (error instanceof ListRelationshipError) {
175
+ * // Handle list relationship error
176
+ * }
177
+ * }
178
+ * ```
179
+ */
180
+ export declare class ListRelationshipError extends RelationshipFilterError {
181
+ readonly listId?: string | undefined;
182
+ /**
183
+ * Create a ListRelationshipError
184
+ *
185
+ * @param message - Error message
186
+ * @param sourceType - The source entity type (e.g., 'people', 'companies')
187
+ * @param listId - The list ID that caused the error
188
+ */
189
+ constructor(message: string, sourceType?: string, listId?: string | undefined);
190
+ }
191
+ //# sourceMappingURL=api-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-errors.d.ts","sourceRoot":"","sources":["../../src/errors/api-errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK;aAWpB,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM;aAChB,MAAM,EAAE,MAAM;aACd,OAAO,CAAC,EAAE,GAAG;IAb/B;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,GAAG,YAAA;IAS/B;;OAEG;IACH,iBAAiB,IAAI,MAAM;CAO5B;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,aAAa;gBAElD,OAAO,EAAE,MAAM,YAAsD,EACrE,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,GAAG;CAQhB;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;gBAEjD,OAAO,EAAE,MAAM,YAAwE,EACvF,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,GAAG;CAQhB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;gBAEpD,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,M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AmD;CAQhF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,uBAAwB,SAAQ,qBAAqB;aAW9C,UAAU,CAAC,EAAE,MAAM;aACnB,UAAU,CAAC,EAAE,MAAM;aACnB,gBAAgB,CAAC,EAAE,MAAM;IAZ3C;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,EACC,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,gBAAgB,CAAC,EAAE,MAAM,YAAA;CAS5C;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,qBAAsB,SAAQ,uBAAuB;aAW9C,MAAM,CAAC,EAAE,MAAM;IAVjC;;;;;;OAMG;gBAED,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,EACH,MAAM,CAAC,EAAE,MAAM,YAAA;CAQlC"}
@@ -0,0 +1,305 @@
1
+ /**
2
+ * Error class hierarchy for Attio API errors
3
+ * Includes specialized error types for API interactions and validation
4
+ */
5
+ /**
6
+ * Base class for all Attio API errors
7
+ */
8
+ export class AttioApiError extends Error {
9
+ statusCode;
10
+ endpoint;
11
+ method;
12
+ details;
13
+ /**
14
+ * Create an AttioApiError
15
+ *
16
+ * @param message - Error message
17
+ * @param statusCode - HTTP status code
18
+ * @param endpoint - API endpoint that was called
19
+ * @param details - Additional error details
20
+ */
21
+ constructor(message, statusCode, endpoint, method, details) {
22
+ super(message);
23
+ this.statusCode = statusCode;
24
+ this.endpoint = endpoint;
25
+ this.method = method;
26
+ this.details = details;
27
+ this.name = 'AttioApiError';
28
+ // This line is needed to properly capture the stack trace in derived classes
29
+ Object.setPrototypeOf(this, AttioApiError.prototype);
30
+ }
31
+ /**
32
+ * Get a formatted representation of the error for logging
33
+ */
34
+ toFormattedString() {
35
+ return (`${this.name} (${this.statusCode}): ${this.message}\n` +
36
+ `Endpoint: ${this.method} ${this.endpoint}\n` +
37
+ `Details: ${JSON.stringify(this.details || {}, null, 2)}`);
38
+ }
39
+ }
40
+ /**
41
+ * Error for authentication issues (401)
42
+ */
43
+ export class AuthenticationError extends AttioApiError {
44
+ constructor(message = 'Authentication failed. Please check your API key.', endpoint, method, details) {
45
+ super(message, 401, endpoint, method, details);
46
+ this.name = 'AuthenticationError';
47
+ // This line is needed to properly capture the stack trace
48
+ Object.setPrototypeOf(this, AuthenticationError.prototype);
49
+ }
50
+ }
51
+ /**
52
+ * Error for authorization issues (403)
53
+ */
54
+ export class AuthorizationError extends AttioApiError {
55
+ constructor(message = 'Authorization failed. Your API key lacks the necessary permissions.', endpoint, method, details) {
56
+ super(message, 403, endpoint, method, details);
57
+ this.name = 'AuthorizationError';
58
+ // This line is needed to properly capture the stack trace
59
+ Object.setPrototypeOf(this, AuthorizationError.prototype);
60
+ }
61
+ }
62
+ /**
63
+ * Error for resource not found issues (404)
64
+ */
65
+ export class ResourceNotFoundError extends AttioApiError {
66
+ constructor(resourceType, resourceId, endpoint, method, details) {
67
+ super(`${resourceType} with ID '${resourceId}' not found`, 404, endpoint, method, details);
68
+ this.name = 'ResourceNotFoundError';
69
+ // This line is needed to properly capture the stack trace
70
+ Object.setPrototypeOf(this, ResourceNotFoundError.prototype);
71
+ }
72
+ }
73
+ /**
74
+ * Error for invalid request issues (400)
75
+ */
76
+ export class InvalidRequestError extends AttioApiError {
77
+ constructor(message, endpoint, method, details) {
78
+ super(message, 400, endpoint, method, details);
79
+ this.name = 'InvalidRequestError';
80
+ // This line is needed to properly capture the stack trace
81
+ Object.setPrototypeOf(this, InvalidRequestError.prototype);
82
+ }
83
+ }
84
+ /**
85
+ * Error for rate limit issues (429)
86
+ */
87
+ export class RateLimitError extends AttioApiError {
88
+ constructor(message = 'Rate limit exceeded. Please try again later.', endpoint, method, details) {
89
+ super(message, 429, endpoint, method, details);
90
+ this.name = 'RateLimitError';
91
+ // This line is needed to properly capture the stack trace
92
+ Object.setPrototypeOf(this, RateLimitError.prototype);
93
+ }
94
+ }
95
+ /**
96
+ * Error for server-side issues (500, 502, 503, 504)
97
+ */
98
+ export class ServerError extends AttioApiError {
99
+ constructor(statusCode, message = 'Server error occurred', endpoint, method, details) {
100
+ super(`Server error (${statusCode}): ${message}`, statusCode, endpoint, method, details);
101
+ this.name = 'ServerError';
102
+ // This line is needed to properly capture the stack trace
103
+ Object.setPrototypeOf(this, ServerError.prototype);
104
+ }
105
+ }
106
+ /**
107
+ * Factory function to create the appropriate error type based on status code
108
+ *
109
+ * @param statusCode - HTTP status code
110
+ * @param message - Error message
111
+ * @param endpoint - API endpoint that was called
112
+ * @param method - HTTP method used
113
+ * @param details - Additional error details
114
+ * @returns The appropriate error instance
115
+ */
116
+ export function createApiErrorFromStatus(statusCode, message, endpoint, method, details) {
117
+ switch (statusCode) {
118
+ case 400:
119
+ return new InvalidRequestError(message, endpoint, method, details);
120
+ case 401:
121
+ return new AuthenticationError(message, endpoint, method, details);
122
+ case 403:
123
+ return new AuthorizationError(message, endpoint, method, details);
124
+ case 404:
125
+ // This is a generic case - for specific resources, use ResourceNotFoundError constructor directly
126
+ return new ResourceNotFoundError('Resource', 'unknown', endpoint, method, details);
127
+ case 429:
128
+ return new RateLimitError(message, endpoint, method, details);
129
+ case 500:
130
+ case 502:
131
+ case 503:
132
+ case 504:
133
+ return new ServerError(statusCode, message, endpoint, method, details);
134
+ default:
135
+ return new AttioApiError(message, statusCode, endpoint, method, details);
136
+ }
137
+ }
138
+ /**
139
+ * Create an appropriate error from Axios error response
140
+ *
141
+ * @param error - The caught error
142
+ * @param endpoint - API endpoint that was called
143
+ * @param method - HTTP method used
144
+ * @returns The appropriate error instance
145
+ */
146
+ export function createApiErrorFromAxiosError(error, endpoint, method) {
147
+ const statusCode = error.response?.status || 500;
148
+ const message = error.response?.data?.message || error.message || 'Unknown API error';
149
+ const details = error.response?.data || {};
150
+ // Special case for ResourceNotFoundError with object types
151
+ if (statusCode === 404 && endpoint.includes('/objects/')) {
152
+ // Extract resource type and ID from endpoint
153
+ // Assuming endpoint format like /objects/{type}/records/{id}
154
+ const matches = endpoint.match(/\/objects\/([^\/]+)\/records\/([^\/]+)/);
155
+ if (matches && matches.length >= 3) {
156
+ const [, resourceType, resourceId] = matches;
157
+ // Format resource type properly: 'people' -> 'Person', 'companies' -> 'Company'
158
+ let formattedType;
159
+ if (resourceType === 'people') {
160
+ formattedType = 'Person';
161
+ }
162
+ else if (resourceType === 'companies') {
163
+ formattedType = 'Company';
164
+ }
165
+ else {
166
+ // Default formatting for other types
167
+ formattedType =
168
+ resourceType.charAt(0).toUpperCase() + resourceType.slice(1, -1);
169
+ }
170
+ return new ResourceNotFoundError(formattedType, resourceId, endpoint, method, details);
171
+ }
172
+ }
173
+ return createApiErrorFromStatus(statusCode, message, endpoint, method, details);
174
+ }
175
+ /**
176
+ * Filter error categories for more targeted error handling
177
+ */
178
+ export var FilterErrorCategory;
179
+ (function (FilterErrorCategory) {
180
+ FilterErrorCategory["STRUCTURE"] = "structure";
181
+ FilterErrorCategory["ATTRIBUTE"] = "attribute";
182
+ FilterErrorCategory["CONDITION"] = "condition";
183
+ FilterErrorCategory["VALUE"] = "value";
184
+ FilterErrorCategory["TRANSFORMATION"] = "transformation";
185
+ })(FilterErrorCategory || (FilterErrorCategory = {}));
186
+ /**
187
+ * Error class for filter validation issues
188
+ *
189
+ * Used when validating filter conditions and structures to ensure they meet
190
+ * the requirements of the Attio API format.
191
+ *
192
+ * @example
193
+ * ```typescript
194
+ * try {
195
+ * // Validate filter conditions
196
+ * if (!isValidFilterCondition(condition)) {
197
+ * throw new FilterValidationError(
198
+ * `Invalid filter condition: ${condition}`,
199
+ * FilterErrorCategory.CONDITION
200
+ * );
201
+ * }
202
+ * } catch (error) {
203
+ * if (error instanceof FilterValidationError) {
204
+ * // Handle filter validation error based on category
205
+ * if (error.category === FilterErrorCategory.CONDITION) {
206
+ * // Handle condition-specific error
207
+ * }
208
+ * }
209
+ * }
210
+ * ```
211
+ */
212
+ export class FilterValidationError extends Error {
213
+ category;
214
+ /**
215
+ * Create a new FilterValidationError
216
+ *
217
+ * @param message - Detailed error message explaining the validation issue
218
+ * @param category - Error category for targeted handling (default: STRUCTURE)
219
+ */
220
+ constructor(message, category = FilterErrorCategory.STRUCTURE) {
221
+ super(message);
222
+ this.category = category;
223
+ this.name = 'FilterValidationError';
224
+ // This line is needed to properly capture the stack trace
225
+ Object.setPrototypeOf(this, FilterValidationError.prototype);
226
+ }
227
+ }
228
+ /**
229
+ * Error for relationship filter validation issues
230
+ *
231
+ * @example
232
+ * ```typescript
233
+ * try {
234
+ * if (!isValidRelationshipType(type)) {
235
+ * throw new RelationshipFilterError(
236
+ * `Invalid relationship type: ${type}`,
237
+ * 'people',
238
+ * 'companies'
239
+ * );
240
+ * }
241
+ * } catch (error) {
242
+ * if (error instanceof RelationshipFilterError) {
243
+ * // Handle relationship filter error
244
+ * console.log(`Relationship error between ${error.sourceType} and ${error.targetType}`);
245
+ * }
246
+ * }
247
+ * ```
248
+ */
249
+ export class RelationshipFilterError extends FilterValidationError {
250
+ sourceType;
251
+ targetType;
252
+ relationshipType;
253
+ /**
254
+ * Create a RelationshipFilterError
255
+ *
256
+ * @param message - Error message
257
+ * @param sourceType - The source entity type (e.g., 'people', 'companies')
258
+ * @param targetType - The target entity type (e.g., 'companies', 'lists')
259
+ * @param relationshipType - The type of relationship that failed validation
260
+ */
261
+ constructor(message, sourceType, targetType, relationshipType) {
262
+ // Relationships are a special type of filter condition
263
+ super(message, FilterErrorCategory.CONDITION);
264
+ this.sourceType = sourceType;
265
+ this.targetType = targetType;
266
+ this.relationshipType = relationshipType;
267
+ this.name = 'RelationshipFilterError';
268
+ // This line is needed to properly capture the stack trace in derived classes
269
+ Object.setPrototypeOf(this, RelationshipFilterError.prototype);
270
+ }
271
+ }
272
+ /**
273
+ * Error specifically for list relationship issues
274
+ *
275
+ * @example
276
+ * ```typescript
277
+ * try {
278
+ * if (!isValidListId(listId)) {
279
+ * throw new ListRelationshipError(`Invalid list ID: ${listId}`, 'people', listId);
280
+ * }
281
+ * } catch (error) {
282
+ * if (error instanceof ListRelationshipError) {
283
+ * // Handle list relationship error
284
+ * }
285
+ * }
286
+ * ```
287
+ */
288
+ export class ListRelationshipError extends RelationshipFilterError {
289
+ listId;
290
+ /**
291
+ * Create a ListRelationshipError
292
+ *
293
+ * @param message - Error message
294
+ * @param sourceType - The source entity type (e.g., 'people', 'companies')
295
+ * @param listId - The list ID that caused the error
296
+ */
297
+ constructor(message, sourceType, listId) {
298
+ super(message, sourceType, 'lists', 'in_list');
299
+ this.listId = listId;
300
+ this.name = 'ListRelationshipError';
301
+ // This line is needed to properly capture the stack trace
302
+ Object.setPrototypeOf(this, ListRelationshipError.prototype);
303
+ }
304
+ }
305
+ //# sourceMappingURL=api-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-errors.js","sourceRoot":"","sources":["../../src/errors/api-errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAWpB;IACA;IACA;IACA;IAblB;;;;;;;OAOG;IACH,YACE,OAAe,EACC,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,OAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QALC,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,YAAO,GAAP,OAAO,CAAM;QAG7B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAE5B,6EAA6E;QAC7E,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,CACL,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,UAAU,MAAM,IAAI,CAAC,OAAO,IAAI;YACtD,aAAa,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,IAAI;YAC7C,YAAY,IAAI,CAAC,SAAS,CAAC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,aAAQ,GAAR,QAAQ,CAAqD;QAG7E,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QAEpC,0DAA0D;QAC1D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,uBAAwB,SAAQ,qBAAqB;IAW9C;IACA;IACA;IAZlB;;;;;;;OAOG;IACH,YACE,OAAe,EACC,UAAmB,EACnB,UAAmB,EACnB,gBAAyB;QAEzC,uDAAuD;QACvD,KAAK,CAAC,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAL9B,eAAU,GAAV,UAAU,CAAS;QACnB,eAAU,GAAV,UAAU,CAAS;QACnB,qBAAgB,GAAhB,gBAAgB,CAAS;QAIzC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QAEtC,6EAA6E;QAC7E,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC;CACF;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,qBAAsB,SAAQ,uBAAuB;IAW9C;IAVlB;;;;;;OAMG;IACH,YACE,OAAe,EACf,UAAmB,EACH,MAAe;QAE/B,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QAF/B,WAAM,GAAN,MAAM,CAAS;QAG/B,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QAEpC,0DAA0D;QAC1D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;CACF"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Domain-specific error classes for company operations
3
+ */
4
+ /**
5
+ * Base error class for company-related errors
6
+ */
7
+ export declare class CompanyError extends Error {
8
+ constructor(message: string);
9
+ }
10
+ /**
11
+ * Error thrown when a company is not found
12
+ */
13
+ export declare class CompanyNotFoundError extends CompanyError {
14
+ constructor(companyId: string);
15
+ }
16
+ /**
17
+ * Error thrown when company data is invalid
18
+ */
19
+ export declare class InvalidCompanyDataError extends CompanyError {
20
+ constructor(message: string);
21
+ }
22
+ /**
23
+ * Error thrown when a company operation fails
24
+ */
25
+ export declare class CompanyOperationError extends CompanyError {
26
+ constructor(operation: string, companyId?: string, details?: string);
27
+ }
28
+ /**
29
+ * Error thrown when a required company field is missing
30
+ */
31
+ export declare class MissingCompanyFieldError extends InvalidCompanyDataError {
32
+ constructor(fieldName: string);
33
+ }
34
+ /**
35
+ * Error thrown when a company field has an invalid type
36
+ */
37
+ export declare class InvalidCompanyFieldTypeError extends InvalidCompanyDataError {
38
+ constructor(fieldName: string, expectedType: string, actualType: string);
39
+ }
40
+ //# sourceMappingURL=company-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company-errors.d.ts","sourceRoot":"","sources":["../../src/errors/company-errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,YAAY;gBACxC,SAAS,EAAE,MAAM;CAI9B;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,YAAY;gBAC3C,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;gBACzC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAUpE;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,uBAAuB;gBACvD,SAAS,EAAE,MAAM;CAI9B;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,uBAAuB;gBAC3D,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAMxE"}