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,83 @@
1
+ /**
2
+ * Attribute management for companies
3
+ */
4
+ import { Company } from '../../types/attio.js';
5
+ /**
6
+ * Gets specific company fields based on a field list
7
+ *
8
+ * @param companyIdOrUri - The ID of the company or its URI (attio://companies/{id})
9
+ * @param fields - Array of field names to retrieve
10
+ * @returns Partial company data with only requested fields
11
+ */
12
+ export declare function getCompanyFields(companyIdOrUri: string, fields: string[]): Promise<Partial<Company>>;
13
+ /**
14
+ * Gets basic company information (limited fields for performance)
15
+ *
16
+ * @param companyIdOrUri - The ID of the company or its URI
17
+ * @returns Basic company information
18
+ */
19
+ export declare function getCompanyBasicInfo(companyIdOrUri: string): Promise<Partial<Company>>;
20
+ /**
21
+ * Gets company contact information
22
+ *
23
+ * @param companyIdOrUri - The ID of the company or its URI
24
+ * @returns Company contact information
25
+ */
26
+ export declare function getCompanyContactInfo(companyIdOrUri: string): Promise<Partial<Company>>;
27
+ /**
28
+ * Gets company business information
29
+ *
30
+ * @param companyIdOrUri - The ID of the company or its URI
31
+ * @returns Company business information
32
+ */
33
+ export declare function getCompanyBusinessInfo(companyIdOrUri: string): Promise<Partial<Company>>;
34
+ /**
35
+ * Gets company social media and online presence
36
+ *
37
+ * @param companyIdOrUri - The ID of the company or its URI
38
+ * @returns Company social media information
39
+ */
40
+ export declare function getCompanySocialInfo(companyIdOrUri: string): Promise<Partial<Company>>;
41
+ /**
42
+ * Gets custom fields for a company, filtering out standard fields
43
+ *
44
+ * @param companyIdOrUri - The ID of the company or its URI
45
+ * @param customFieldNames - Optional array of specific custom field names to retrieve
46
+ * @returns Company object with only custom fields populated
47
+ * @example
48
+ * ```typescript
49
+ * // Get all custom fields
50
+ * const custom = await getCompanyCustomFields("comp_123");
51
+ *
52
+ * // Get specific custom fields
53
+ * const selected = await getCompanyCustomFields("comp_123", ["contract_value", "lead_source"]);
54
+ * ```
55
+ */
56
+ export declare function getCompanyCustomFields(companyIdOrUri: string, customFieldNames?: string[]): Promise<Partial<Company>>;
57
+ /**
58
+ * Discovers all available attributes for companies in the workspace
59
+ *
60
+ * @returns List of all company attributes with metadata
61
+ */
62
+ export declare function discoverCompanyAttributes(): Promise<{
63
+ standard: string[];
64
+ custom: string[];
65
+ all: Array<{
66
+ name: string;
67
+ type: string;
68
+ isCustom: boolean;
69
+ }>;
70
+ }>;
71
+ /**
72
+ * Gets specific attributes for a company or lists available attributes
73
+ *
74
+ * @param companyIdOrUri - The ID of the company or its URI (attio://companies/{id})
75
+ * @param attributeName - Optional name of specific attribute to retrieve
76
+ * @returns If attributeName provided: specific attribute value, otherwise list of available attributes
77
+ */
78
+ export declare function getCompanyAttributes(companyIdOrUri: string, attributeName?: string): Promise<{
79
+ attributes?: string[];
80
+ value?: any;
81
+ company: string;
82
+ }>;
83
+ //# sourceMappingURL=attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/objects/companies/attributes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAqC/C;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAoD3B;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAe3B;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAgB3B;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAe3B;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAc3B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,sBAAsB,CAC1C,cAAc,EAAE,MAAM,EACtB,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAC1B,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CA4E3B;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC;IACzD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,GAAG,EAAE,KAAK,CAAC;QACT,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;CACJ,CAAC,CAwJD;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC;IACT,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CA2DD"}
@@ -0,0 +1,426 @@
1
+ import { getCompanyDetails, extractCompanyId } from './basic.js';
2
+ import { listCompanies } from './basic.js';
3
+ /**
4
+ * Logs attribute operation errors in a consistent format
5
+ *
6
+ * @param functionName - The name of the function where the error occurred
7
+ * @param error - The error that was caught
8
+ * @param context - Optional additional context about the operation
9
+ */
10
+ function logAttributeError(functionName, error, context = {}) {
11
+ console.error(`[${functionName}] Error:`, error);
12
+ console.error(`- Error type: ${error instanceof Error ? error.constructor.name : typeof error}`);
13
+ console.error(`- Message: ${error instanceof Error ? error.message : String(error)}`);
14
+ if (error instanceof Error && error.stack) {
15
+ console.error(`- Stack trace: ${error.stack}`);
16
+ }
17
+ else {
18
+ console.error('- No stack trace available');
19
+ }
20
+ if (Object.keys(context).length > 0) {
21
+ console.error('- Context:', context);
22
+ }
23
+ }
24
+ /**
25
+ * Gets specific company fields based on a field list
26
+ *
27
+ * @param companyIdOrUri - The ID of the company or its URI (attio://companies/{id})
28
+ * @param fields - Array of field names to retrieve
29
+ * @returns Partial company data with only requested fields
30
+ */
31
+ export async function getCompanyFields(companyIdOrUri, fields) {
32
+ let companyId;
33
+ try {
34
+ // Extract company ID from URI if needed
35
+ companyId = extractCompanyId(companyIdOrUri);
36
+ if (process.env.NODE_ENV === 'development') {
37
+ console.log(`[getCompanyFields] Fetching fields for company ${companyId}:`, fields);
38
+ }
39
+ // Fetch all company data first
40
+ const fullCompany = await getCompanyDetails(companyIdOrUri);
41
+ // Filter to only requested fields
42
+ const filteredValues = {};
43
+ const allValues = fullCompany.values || {};
44
+ for (const field of fields) {
45
+ if (field in allValues) {
46
+ filteredValues[field] = allValues[field];
47
+ }
48
+ }
49
+ // Always include basic identifiers
50
+ if (!('name' in filteredValues) && 'name' in allValues) {
51
+ filteredValues.name = allValues.name;
52
+ }
53
+ const result = {
54
+ id: fullCompany.id,
55
+ values: filteredValues,
56
+ };
57
+ if (process.env.NODE_ENV === 'development') {
58
+ console.log(`[getCompanyFields] Filtered to ${Object.keys(filteredValues).length} fields`);
59
+ }
60
+ return result;
61
+ }
62
+ catch (error) {
63
+ if (error instanceof Error) {
64
+ throw new Error(`Could not retrieve company fields: ${error.message}`);
65
+ }
66
+ throw error;
67
+ }
68
+ }
69
+ /**
70
+ * Gets basic company information (limited fields for performance)
71
+ *
72
+ * @param companyIdOrUri - The ID of the company or its URI
73
+ * @returns Basic company information
74
+ */
75
+ export async function getCompanyBasicInfo(companyIdOrUri) {
76
+ const basicFields = [
77
+ 'name',
78
+ 'website',
79
+ 'industry',
80
+ 'type',
81
+ 'type_persona',
82
+ 'employee_range',
83
+ 'foundation_date',
84
+ 'primary_location',
85
+ 'description',
86
+ 'logo_url',
87
+ ];
88
+ return getCompanyFields(companyIdOrUri, basicFields);
89
+ }
90
+ /**
91
+ * Gets company contact information
92
+ *
93
+ * @param companyIdOrUri - The ID of the company or its URI
94
+ * @returns Company contact information
95
+ */
96
+ export async function getCompanyContactInfo(companyIdOrUri) {
97
+ const contactFields = [
98
+ 'name',
99
+ 'website',
100
+ 'company_phone_5',
101
+ 'primary_location',
102
+ 'street_address',
103
+ 'street_address_2',
104
+ 'city',
105
+ 'state',
106
+ 'postal_code',
107
+ 'country',
108
+ 'main_contact',
109
+ ];
110
+ return getCompanyFields(companyIdOrUri, contactFields);
111
+ }
112
+ /**
113
+ * Gets company business information
114
+ *
115
+ * @param companyIdOrUri - The ID of the company or its URI
116
+ * @returns Company business information
117
+ */
118
+ export async function getCompanyBusinessInfo(companyIdOrUri) {
119
+ const businessFields = [
120
+ 'name',
121
+ 'type',
122
+ 'type_persona',
123
+ 'services',
124
+ 'categories',
125
+ 'industry',
126
+ 'estimated_arr_usd',
127
+ 'funding_raised_usd',
128
+ 'employee_range',
129
+ 'foundation_date',
130
+ ];
131
+ return getCompanyFields(companyIdOrUri, businessFields);
132
+ }
133
+ /**
134
+ * Gets company social media and online presence
135
+ *
136
+ * @param companyIdOrUri - The ID of the company or its URI
137
+ * @returns Company social media information
138
+ */
139
+ export async function getCompanySocialInfo(companyIdOrUri) {
140
+ const socialFields = [
141
+ 'name',
142
+ 'website',
143
+ 'linkedin',
144
+ 'twitter',
145
+ 'facebook',
146
+ 'instagram',
147
+ 'angellist',
148
+ 'twitter_follower_count',
149
+ 'logo_url',
150
+ ];
151
+ return getCompanyFields(companyIdOrUri, socialFields);
152
+ }
153
+ /**
154
+ * Gets custom fields for a company, filtering out standard fields
155
+ *
156
+ * @param companyIdOrUri - The ID of the company or its URI
157
+ * @param customFieldNames - Optional array of specific custom field names to retrieve
158
+ * @returns Company object with only custom fields populated
159
+ * @example
160
+ * ```typescript
161
+ * // Get all custom fields
162
+ * const custom = await getCompanyCustomFields("comp_123");
163
+ *
164
+ * // Get specific custom fields
165
+ * const selected = await getCompanyCustomFields("comp_123", ["contract_value", "lead_source"]);
166
+ * ```
167
+ */
168
+ export async function getCompanyCustomFields(companyIdOrUri, customFieldNames) {
169
+ // If specific custom fields are requested, fetch only those
170
+ if (customFieldNames && customFieldNames.length > 0) {
171
+ // Always include name for context
172
+ const fieldsToFetch = ['name', ...customFieldNames];
173
+ return getCompanyFields(companyIdOrUri, fieldsToFetch);
174
+ }
175
+ // Otherwise, we need to fetch all fields first to identify custom ones
176
+ const allData = await getCompanyDetails(companyIdOrUri);
177
+ // Standard fields that are NOT custom
178
+ const standardFields = new Set([
179
+ 'name',
180
+ 'website',
181
+ 'industry',
182
+ 'domains',
183
+ 'description',
184
+ 'logo_url',
185
+ 'primary_location',
186
+ 'employee_range',
187
+ 'foundation_date',
188
+ 'created_at',
189
+ 'created_by',
190
+ 'matching_id',
191
+ 'record_id',
192
+ 'linkedin',
193
+ 'twitter',
194
+ 'facebook',
195
+ 'instagram',
196
+ 'angellist',
197
+ 'twitter_follower_count',
198
+ 'estimated_arr_usd',
199
+ 'funding_raised_usd',
200
+ 'categories',
201
+ 'about',
202
+ 'notes',
203
+ 'team',
204
+ 'main_contact',
205
+ 'street_address',
206
+ 'street_address_2',
207
+ 'city',
208
+ 'state',
209
+ 'postal_code',
210
+ 'country',
211
+ 'first_interaction',
212
+ 'last_interaction',
213
+ 'next_interaction',
214
+ 'first_email_interaction',
215
+ 'last_email_interaction',
216
+ 'first_calendar_interaction',
217
+ 'last_calendar_interaction',
218
+ 'next_calendar_interaction',
219
+ 'strongest_connection_strength',
220
+ 'strongest_connection_user',
221
+ 'associated_deals',
222
+ 'associated_workspaces',
223
+ ]);
224
+ // Extract custom fields
225
+ const customFields = {};
226
+ const values = allData.values || {};
227
+ for (const [fieldName, fieldValue] of Object.entries(values)) {
228
+ if (!standardFields.has(fieldName)) {
229
+ customFields[fieldName] = fieldValue;
230
+ }
231
+ }
232
+ return {
233
+ id: allData.id,
234
+ values: {
235
+ name: values.name,
236
+ ...customFields,
237
+ },
238
+ };
239
+ }
240
+ /**
241
+ * Discovers all available attributes for companies in the workspace
242
+ *
243
+ * @returns List of all company attributes with metadata
244
+ */
245
+ export async function discoverCompanyAttributes() {
246
+ // This is a simplified version - in reality, Attio likely has an API endpoint
247
+ // to list all available attributes for an object type
248
+ // For now, we'll fetch a sample company and examine its fields
249
+ if (process.env.NODE_ENV === 'development') {
250
+ console.log('[discoverCompanyAttributes] Starting attribute discovery...');
251
+ }
252
+ try {
253
+ // Get a sample company to see what fields are available
254
+ const companies = await listCompanies(1);
255
+ if (companies.length === 0) {
256
+ console.warn('[discoverCompanyAttributes] No companies found to discover attributes');
257
+ // Return an empty structure rather than throwing an error
258
+ return {
259
+ standard: [],
260
+ custom: [],
261
+ all: [],
262
+ };
263
+ }
264
+ const sampleCompanyId = companies[0].id?.record_id;
265
+ if (!sampleCompanyId) {
266
+ console.warn('[discoverCompanyAttributes] Sample company has no record ID');
267
+ return {
268
+ standard: [],
269
+ custom: [],
270
+ all: [],
271
+ };
272
+ }
273
+ if (process.env.NODE_ENV === 'development') {
274
+ console.log(`[discoverCompanyAttributes] Using sample company ID: ${sampleCompanyId}`);
275
+ }
276
+ const sampleCompany = await getCompanyDetails(sampleCompanyId);
277
+ const values = sampleCompany.values || {};
278
+ if (process.env.NODE_ENV === 'development') {
279
+ console.log(`[discoverCompanyAttributes] Retrieved ${Object.keys(values).length} fields from sample company`);
280
+ }
281
+ const standardFields = new Set([
282
+ 'name',
283
+ 'website',
284
+ 'industry',
285
+ 'domains',
286
+ 'description',
287
+ 'logo_url',
288
+ 'primary_location',
289
+ 'employee_range',
290
+ 'foundation_date',
291
+ 'created_at',
292
+ 'created_by',
293
+ 'matching_id',
294
+ 'record_id',
295
+ 'linkedin',
296
+ 'twitter',
297
+ 'facebook',
298
+ 'instagram',
299
+ 'angellist',
300
+ 'twitter_follower_count',
301
+ 'estimated_arr_usd',
302
+ 'funding_raised_usd',
303
+ 'categories',
304
+ 'about',
305
+ 'notes',
306
+ 'team',
307
+ 'main_contact',
308
+ 'street_address',
309
+ 'street_address_2',
310
+ 'city',
311
+ 'state',
312
+ 'postal_code',
313
+ 'country',
314
+ 'first_interaction',
315
+ 'last_interaction',
316
+ 'next_interaction',
317
+ 'first_email_interaction',
318
+ 'last_email_interaction',
319
+ 'first_calendar_interaction',
320
+ 'last_calendar_interaction',
321
+ 'next_calendar_interaction',
322
+ 'strongest_connection_strength',
323
+ 'strongest_connection_user',
324
+ 'associated_deals',
325
+ 'associated_workspaces',
326
+ ]);
327
+ const standard = [];
328
+ const custom = [];
329
+ const all = [];
330
+ for (const [fieldName, fieldValue] of Object.entries(values)) {
331
+ const isCustom = !standardFields.has(fieldName);
332
+ const fieldType = Array.isArray(fieldValue) && fieldValue.length > 0
333
+ ? fieldValue[0].attribute_type || 'unknown'
334
+ : 'unknown';
335
+ if (isCustom) {
336
+ custom.push(fieldName);
337
+ }
338
+ else {
339
+ standard.push(fieldName);
340
+ }
341
+ all.push({
342
+ name: fieldName,
343
+ type: fieldType,
344
+ isCustom,
345
+ });
346
+ }
347
+ const result = {
348
+ standard: standard.sort(),
349
+ custom: custom.sort(),
350
+ all: all.sort((a, b) => a.name.localeCompare(b.name)),
351
+ };
352
+ if (process.env.NODE_ENV === 'development') {
353
+ console.log(`[discoverCompanyAttributes] Discovery complete. Found ${standard.length} standard fields and ${custom.length} custom fields.`);
354
+ }
355
+ return result;
356
+ }
357
+ catch (error) {
358
+ // Use consistent error logging pattern
359
+ logAttributeError('discoverCompanyAttributes', error, {
360
+ operation: 'attribute discovery',
361
+ context: 'company attributes',
362
+ });
363
+ // Throw with more context
364
+ throw new Error(`Failed to discover company attributes: ${error instanceof Error ? error.message : String(error)}`);
365
+ }
366
+ }
367
+ /**
368
+ * Gets specific attributes for a company or lists available attributes
369
+ *
370
+ * @param companyIdOrUri - The ID of the company or its URI (attio://companies/{id})
371
+ * @param attributeName - Optional name of specific attribute to retrieve
372
+ * @returns If attributeName provided: specific attribute value, otherwise list of available attributes
373
+ */
374
+ export async function getCompanyAttributes(companyIdOrUri, attributeName) {
375
+ const companyId = extractCompanyId(companyIdOrUri);
376
+ const fullCompany = await getCompanyDetails(companyIdOrUri);
377
+ try {
378
+ if (attributeName) {
379
+ // Return specific attribute value
380
+ const values = fullCompany.values || {};
381
+ const value = values[attributeName];
382
+ const companyName = fullCompany.values?.name?.[0]?.value || companyId;
383
+ if (value === undefined) {
384
+ throw new Error(`Attribute '${attributeName}' not found for company ${companyName}`);
385
+ }
386
+ // Extract simple value from array structure if applicable
387
+ let simplifiedValue = value;
388
+ if (Array.isArray(value) && value.length > 0) {
389
+ const firstItem = value[0];
390
+ if (firstItem && firstItem.value !== undefined) {
391
+ simplifiedValue = firstItem.value;
392
+ }
393
+ else if (firstItem && firstItem.option?.title) {
394
+ simplifiedValue = firstItem.option.title;
395
+ }
396
+ else if (firstItem && firstItem.target_record_id) {
397
+ simplifiedValue = `Reference: ${firstItem.target_record_id}`;
398
+ }
399
+ }
400
+ return {
401
+ value: simplifiedValue,
402
+ company: companyName,
403
+ };
404
+ }
405
+ else {
406
+ // Return list of available attributes
407
+ const values = fullCompany.values || {};
408
+ const attributes = Object.keys(values).sort();
409
+ return {
410
+ attributes,
411
+ company: fullCompany.values?.name?.[0]?.value || companyId,
412
+ };
413
+ }
414
+ }
415
+ catch (error) {
416
+ // Use consistent error logging pattern
417
+ logAttributeError('getCompanyAttributes', error, {
418
+ companyId,
419
+ attributeName,
420
+ operation: 'get attributes',
421
+ });
422
+ // Re-throw with enhanced context
423
+ throw new Error(`Failed to get company attribute: ${error instanceof Error ? error.message : String(error)}`);
424
+ }
425
+ }
426
+ //# sourceMappingURL=attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../src/objects/companies/attributes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;GAMG;AACH,SAAS,iBAAiB,CACxB,YAAoB,EACpB,KAAc,EACd,UAA+B,EAAE;IAEjC,OAAO,CAAC,KAAK,CAAC,IAAI,YAAY,UAAU,EAAE,KAAK,CAA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EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,SAAS;aAC3D,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,uCAAuC;QACvC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,EAAE;YAC/C,SAAS;YACT,aAAa;YACb,SAAS,EAAE,gBAAgB;SAC5B,CAAC,CAAC;QAEH,iCAAiC;QACjC,MAAM,IAAI,KAAK,CACb,oCACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,117 @@
1
+ import { Company } from '../../types/attio.js';
2
+ import { CompanyAttributes } from './types.js';
3
+ /**
4
+ * Lists companies sorted by most recent interaction
5
+ *
6
+ * @param limit - Maximum number of companies to return (default: 20)
7
+ * @returns Array of company results
8
+ */
9
+ export declare function listCompanies(limit?: number): Promise<Company[]>;
10
+ /**
11
+ * Gets full details for a specific company (all fields)
12
+ *
13
+ * @param companyIdOrUri - The ID of the company or its URI (attio://companies/{id})
14
+ * @returns Company details
15
+ */
16
+ export declare function getCompanyDetails(companyIdOrUri: string): Promise<Company>;
17
+ /**
18
+ * Creates a new company with the specified attributes
19
+ *
20
+ * @param attributes - Company attributes to set
21
+ * @returns The created company object
22
+ * @throws InvalidCompanyDataError if validation fails
23
+ * @throws CompanyOperationError if creation fails
24
+ * @example
25
+ * ```typescript
26
+ * const company = await createCompany({
27
+ * name: "Acme Corp",
28
+ * website: "https://acme.com",
29
+ * industry: "Technology"
30
+ * });
31
+ * ```
32
+ */
33
+ export declare function createCompany(attributes: CompanyAttributes): Promise<Company>;
34
+ /**
35
+ * Updates an existing company with new attributes
36
+ *
37
+ * @param companyId - ID of the company to update
38
+ * @param attributes - Company attributes to update (partial update supported)
39
+ * @returns The updated company object
40
+ * @throws InvalidCompanyDataError if validation fails
41
+ * @throws CompanyOperationError if update fails
42
+ * @example
43
+ * ```typescript
44
+ * const updated = await updateCompany("comp_123", {
45
+ * industry: "Healthcare",
46
+ * employee_range: "100-500"
47
+ * });
48
+ * ```
49
+ */
50
+ export declare function updateCompany(companyId: string, attributes: Partial<CompanyAttributes>): Promise<Company>;
51
+ /**
52
+ * Updates a specific attribute of a company
53
+ *
54
+ * @param companyId - ID of the company to update
55
+ * @param attributeName - Name of the attribute to update
56
+ * @param attributeValue - New value for the attribute
57
+ * @returns Updated company record
58
+ * @throws InvalidCompanyDataError if validation fails
59
+ * @throws CompanyOperationError if update fails
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * // Update a simple string attribute
64
+ * const updated = await updateCompanyAttribute(
65
+ * "company_123",
66
+ * "website",
67
+ * "https://example.com"
68
+ * );
69
+ *
70
+ * // Update main_contact with Person Record ID
71
+ * const withPerson = await updateCompanyAttribute(
72
+ * "company_123",
73
+ * "main_contact",
74
+ * "person_01h8g3j5k7m9n1p3r"
75
+ * );
76
+ *
77
+ * // Update main_contact with person name (will be looked up)
78
+ * const byName = await updateCompanyAttribute(
79
+ * "company_123",
80
+ * "main_contact",
81
+ * "John Smith"
82
+ * );
83
+ *
84
+ * // Clear an attribute
85
+ * const cleared = await updateCompanyAttribute(
86
+ * "company_123",
87
+ * "website",
88
+ * null
89
+ * );
90
+ * ```
91
+ */
92
+ export declare function updateCompanyAttribute(companyId: string, attributeName: string, attributeValue: any): Promise<Company>;
93
+ /**
94
+ * Deletes a company permanently from the system
95
+ *
96
+ * @param companyId - ID of the company to delete
97
+ * @returns True if deletion was successful
98
+ * @throws InvalidCompanyDataError if validation fails
99
+ * @throws CompanyOperationError if deletion fails
100
+ * @example
101
+ * ```typescript
102
+ * const success = await deleteCompany("comp_123");
103
+ * if (success) {
104
+ * console.log("Company deleted successfully");
105
+ * }
106
+ * ```
107
+ */
108
+ export declare function deleteCompany(companyId: string): Promise<boolean>;
109
+ /**
110
+ * Extracts company ID from a URI or returns the ID directly
111
+ *
112
+ * @param companyIdOrUri - Either a direct ID or URI format (attio://companies/{id})
113
+ * @returns The extracted company ID
114
+ * @throws Error if the URI format is invalid
115
+ */
116
+ export declare function extractCompanyId(companyIdOrUri: string): string;
117
+ //# sourceMappingURL=basic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/objects/companies/basic.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,OAAO,EAAU,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAc/C;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAqB1E;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC,CA0JlB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,iBAAiB,GAC5B,OAAO,CAAC,OAAO,CAAC,CAiBlB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACrC,OAAO,CAAC,OAAO,CAAC,CAkBlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,GAAG,GAClB,OAAO,CAAC,OAAO,CAAC,CA2DlB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiBvE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAmD/D"}