@aglyn/plugins-crm 1.0.0-beta.143

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 (669) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +57 -0
  4. package/src/index.d.ts +21 -0
  5. package/src/index.js +29 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/activity-list.d.ts +98 -0
  8. package/src/lib/components/activity-list.js +321 -0
  9. package/src/lib/components/activity-list.js.map +1 -0
  10. package/src/lib/components/activity-queries.d.ts +117 -0
  11. package/src/lib/components/activity-queries.js +198 -0
  12. package/src/lib/components/activity-queries.js.map +1 -0
  13. package/src/lib/components/add-to-list-button.d.ts +25 -0
  14. package/src/lib/components/add-to-list-button.js +64 -0
  15. package/src/lib/components/add-to-list-button.js.map +1 -0
  16. package/src/lib/components/add-to-list-dialog.d.ts +24 -0
  17. package/src/lib/components/add-to-list-dialog.js +327 -0
  18. package/src/lib/components/add-to-list-dialog.js.map +1 -0
  19. package/src/lib/components/assignment-rule-drawer.d.ts +43 -0
  20. package/src/lib/components/assignment-rule-drawer.js +293 -0
  21. package/src/lib/components/assignment-rule-drawer.js.map +1 -0
  22. package/src/lib/components/companies-bulk-bar.d.ts +29 -0
  23. package/src/lib/components/companies-bulk-bar.js +274 -0
  24. package/src/lib/components/companies-bulk-bar.js.map +1 -0
  25. package/src/lib/components/companies-section.d.ts +54 -0
  26. package/src/lib/components/companies-section.js +522 -0
  27. package/src/lib/components/companies-section.js.map +1 -0
  28. package/src/lib/components/company-contacts-card.d.ts +49 -0
  29. package/src/lib/components/company-contacts-card.js +435 -0
  30. package/src/lib/components/company-contacts-card.js.map +1 -0
  31. package/src/lib/components/company-deals-card.d.ts +20 -0
  32. package/src/lib/components/company-deals-card.js +38 -0
  33. package/src/lib/components/company-deals-card.js.map +1 -0
  34. package/src/lib/components/company-detail-page.d.ts +20 -0
  35. package/src/lib/components/company-detail-page.js +165 -0
  36. package/src/lib/components/company-detail-page.js.map +1 -0
  37. package/src/lib/components/company-edit-drawer.d.ts +65 -0
  38. package/src/lib/components/company-edit-drawer.js +433 -0
  39. package/src/lib/components/company-edit-drawer.js.map +1 -0
  40. package/src/lib/components/company-import-drawer.d.ts +42 -0
  41. package/src/lib/components/company-import-drawer.js +99 -0
  42. package/src/lib/components/company-import-drawer.js.map +1 -0
  43. package/src/lib/components/company-picker.d.ts +127 -0
  44. package/src/lib/components/company-picker.js +323 -0
  45. package/src/lib/components/company-picker.js.map +1 -0
  46. package/src/lib/components/company-properties-card.d.ts +47 -0
  47. package/src/lib/components/company-properties-card.js +289 -0
  48. package/src/lib/components/company-properties-card.js.map +1 -0
  49. package/src/lib/components/contact-address-fields.d.ts +29 -0
  50. package/src/lib/components/contact-address-fields.js +149 -0
  51. package/src/lib/components/contact-address-fields.js.map +1 -0
  52. package/src/lib/components/contact-associations-card.d.ts +72 -0
  53. package/src/lib/components/contact-associations-card.js +296 -0
  54. package/src/lib/components/contact-associations-card.js.map +1 -0
  55. package/src/lib/components/contact-custom-columns.d.ts +38 -0
  56. package/src/lib/components/contact-custom-columns.js +102 -0
  57. package/src/lib/components/contact-custom-columns.js.map +1 -0
  58. package/src/lib/components/contact-custom-fields-card.d.ts +39 -0
  59. package/src/lib/components/contact-custom-fields-card.js +204 -0
  60. package/src/lib/components/contact-custom-fields-card.js.map +1 -0
  61. package/src/lib/components/contact-deals-card.d.ts +20 -0
  62. package/src/lib/components/contact-deals-card.js +38 -0
  63. package/src/lib/components/contact-deals-card.js.map +1 -0
  64. package/src/lib/components/contact-detail-page.d.ts +46 -0
  65. package/src/lib/components/contact-detail-page.js +535 -0
  66. package/src/lib/components/contact-detail-page.js.map +1 -0
  67. package/src/lib/components/contact-duplicates-card.d.ts +42 -0
  68. package/src/lib/components/contact-duplicates-card.js +167 -0
  69. package/src/lib/components/contact-duplicates-card.js.map +1 -0
  70. package/src/lib/components/contact-field-drawer.d.ts +64 -0
  71. package/src/lib/components/contact-field-drawer.js +251 -0
  72. package/src/lib/components/contact-field-drawer.js.map +1 -0
  73. package/src/lib/components/contact-import-drawer.d.ts +46 -0
  74. package/src/lib/components/contact-import-drawer.js +149 -0
  75. package/src/lib/components/contact-import-drawer.js.map +1 -0
  76. package/src/lib/components/contact-known-by-card.d.ts +39 -0
  77. package/src/lib/components/contact-known-by-card.js +142 -0
  78. package/src/lib/components/contact-known-by-card.js.map +1 -0
  79. package/src/lib/components/contact-list-columns.d.ts +53 -0
  80. package/src/lib/components/contact-list-columns.js +288 -0
  81. package/src/lib/components/contact-list-columns.js.map +1 -0
  82. package/src/lib/components/contact-merge-dialog.d.ts +79 -0
  83. package/src/lib/components/contact-merge-dialog.js +405 -0
  84. package/src/lib/components/contact-merge-dialog.js.map +1 -0
  85. package/src/lib/components/contact-properties-card.d.ts +89 -0
  86. package/src/lib/components/contact-properties-card.js +492 -0
  87. package/src/lib/components/contact-properties-card.js.map +1 -0
  88. package/src/lib/components/contact-timeline-card.d.ts +68 -0
  89. package/src/lib/components/contact-timeline-card.js +435 -0
  90. package/src/lib/components/contact-timeline-card.js.map +1 -0
  91. package/src/lib/components/contacts-bulk-bar.d.ts +91 -0
  92. package/src/lib/components/contacts-bulk-bar.js +493 -0
  93. package/src/lib/components/contacts-bulk-bar.js.map +1 -0
  94. package/src/lib/components/contacts-section.d.ts +26 -0
  95. package/src/lib/components/contacts-section.js +1025 -0
  96. package/src/lib/components/contacts-section.js.map +1 -0
  97. package/src/lib/components/copy-capture-address-button.d.ts +33 -0
  98. package/src/lib/components/copy-capture-address-button.js +60 -0
  99. package/src/lib/components/copy-capture-address-button.js.map +1 -0
  100. package/src/lib/components/crm-attribution-zone.d.ts +38 -0
  101. package/src/lib/components/crm-attribution-zone.js +36 -0
  102. package/src/lib/components/crm-attribution-zone.js.map +1 -0
  103. package/src/lib/components/crm-booking-zone.d.ts +61 -0
  104. package/src/lib/components/crm-booking-zone.js +50 -0
  105. package/src/lib/components/crm-booking-zone.js.map +1 -0
  106. package/src/lib/components/crm-bulk-bar-frame.d.ts +47 -0
  107. package/src/lib/components/crm-bulk-bar-frame.js +137 -0
  108. package/src/lib/components/crm-bulk-bar-frame.js.map +1 -0
  109. package/src/lib/components/crm-call-actions.d.ts +65 -0
  110. package/src/lib/components/crm-call-actions.js +110 -0
  111. package/src/lib/components/crm-call-actions.js.map +1 -0
  112. package/src/lib/components/crm-column-menu.d.ts +21 -0
  113. package/src/lib/components/crm-column-menu.js +103 -0
  114. package/src/lib/components/crm-column-menu.js.map +1 -0
  115. package/src/lib/components/crm-console-page.d.ts +19 -0
  116. package/src/lib/components/crm-console-page.js +151 -0
  117. package/src/lib/components/crm-console-page.js.map +1 -0
  118. package/src/lib/components/crm-console-sections.d.ts +52 -0
  119. package/src/lib/components/crm-console-sections.js +83 -0
  120. package/src/lib/components/crm-console-sections.js.map +1 -0
  121. package/src/lib/components/crm-custom-field-control.d.ts +26 -0
  122. package/src/lib/components/crm-custom-field-control.js +131 -0
  123. package/src/lib/components/crm-custom-field-control.js.map +1 -0
  124. package/src/lib/components/crm-email-template-tools.d.ts +69 -0
  125. package/src/lib/components/crm-email-template-tools.js +240 -0
  126. package/src/lib/components/crm-email-template-tools.js.map +1 -0
  127. package/src/lib/components/crm-export-all-button.d.ts +39 -0
  128. package/src/lib/components/crm-export-all-button.js +98 -0
  129. package/src/lib/components/crm-export-all-button.js.map +1 -0
  130. package/src/lib/components/crm-filter-bar.d.ts +53 -0
  131. package/src/lib/components/crm-filter-bar.js +294 -0
  132. package/src/lib/components/crm-filter-bar.js.map +1 -0
  133. package/src/lib/components/crm-glance-card.d.ts +54 -0
  134. package/src/lib/components/crm-glance-card.js +219 -0
  135. package/src/lib/components/crm-glance-card.js.map +1 -0
  136. package/src/lib/components/crm-next-activity-column.d.ts +35 -0
  137. package/src/lib/components/crm-next-activity-column.js +100 -0
  138. package/src/lib/components/crm-next-activity-column.js.map +1 -0
  139. package/src/lib/components/crm-record-header.d.ts +97 -0
  140. package/src/lib/components/crm-record-header.js +160 -0
  141. package/src/lib/components/crm-record-header.js.map +1 -0
  142. package/src/lib/components/crm-record-insights-zone.d.ts +50 -0
  143. package/src/lib/components/crm-record-insights-zone.js +169 -0
  144. package/src/lib/components/crm-record-insights-zone.js.map +1 -0
  145. package/src/lib/components/crm-record-picker.d.ts +42 -0
  146. package/src/lib/components/crm-record-picker.js +104 -0
  147. package/src/lib/components/crm-record-picker.js.map +1 -0
  148. package/src/lib/components/crm-send-email-button.d.ts +39 -0
  149. package/src/lib/components/crm-send-email-button.js +81 -0
  150. package/src/lib/components/crm-send-email-button.js.map +1 -0
  151. package/src/lib/components/crm-send-email-dialog.d.ts +61 -0
  152. package/src/lib/components/crm-send-email-dialog.js +851 -0
  153. package/src/lib/components/crm-send-email-dialog.js.map +1 -0
  154. package/src/lib/components/crm-site-picker.d.ts +61 -0
  155. package/src/lib/components/crm-site-picker.js +99 -0
  156. package/src/lib/components/crm-site-picker.js.map +1 -0
  157. package/src/lib/components/crm-suite-lock.d.ts +29 -0
  158. package/src/lib/components/crm-suite-lock.js +114 -0
  159. package/src/lib/components/crm-suite-lock.js.map +1 -0
  160. package/src/lib/components/crm-tasks-due-card.d.ts +42 -0
  161. package/src/lib/components/crm-tasks-due-card.js +225 -0
  162. package/src/lib/components/crm-tasks-due-card.js.map +1 -0
  163. package/src/lib/components/crm-views-control.d.ts +65 -0
  164. package/src/lib/components/crm-views-control.js +518 -0
  165. package/src/lib/components/crm-views-control.js.map +1 -0
  166. package/src/lib/components/csv-import-drawer.d.ts +132 -0
  167. package/src/lib/components/csv-import-drawer.js +746 -0
  168. package/src/lib/components/csv-import-drawer.js.map +1 -0
  169. package/src/lib/components/deal-board.d.ts +70 -0
  170. package/src/lib/components/deal-board.js +478 -0
  171. package/src/lib/components/deal-board.js.map +1 -0
  172. package/src/lib/components/deal-detail-page.d.ts +18 -0
  173. package/src/lib/components/deal-detail-page.js +323 -0
  174. package/src/lib/components/deal-detail-page.js.map +1 -0
  175. package/src/lib/components/deal-edit-drawer.d.ts +59 -0
  176. package/src/lib/components/deal-edit-drawer.js +640 -0
  177. package/src/lib/components/deal-edit-drawer.js.map +1 -0
  178. package/src/lib/components/deal-import-drawer.d.ts +24 -0
  179. package/src/lib/components/deal-import-drawer.js +83 -0
  180. package/src/lib/components/deal-import-drawer.js.map +1 -0
  181. package/src/lib/components/deal-products-card.d.ts +48 -0
  182. package/src/lib/components/deal-products-card.js +614 -0
  183. package/src/lib/components/deal-products-card.js.map +1 -0
  184. package/src/lib/components/deal-properties-card.d.ts +29 -0
  185. package/src/lib/components/deal-properties-card.js +144 -0
  186. package/src/lib/components/deal-properties-card.js.map +1 -0
  187. package/src/lib/components/deal-stage-card.d.ts +24 -0
  188. package/src/lib/components/deal-stage-card.js +199 -0
  189. package/src/lib/components/deal-stage-card.js.map +1 -0
  190. package/src/lib/components/deals-bulk-bar.d.ts +31 -0
  191. package/src/lib/components/deals-bulk-bar.js +340 -0
  192. package/src/lib/components/deals-bulk-bar.js.map +1 -0
  193. package/src/lib/components/deals-section.d.ts +49 -0
  194. package/src/lib/components/deals-section.js +767 -0
  195. package/src/lib/components/deals-section.js.map +1 -0
  196. package/src/lib/components/email-capture-card.d.ts +42 -0
  197. package/src/lib/components/email-capture-card.js +134 -0
  198. package/src/lib/components/email-capture-card.js.map +1 -0
  199. package/src/lib/components/email-template-drawer.d.ts +33 -0
  200. package/src/lib/components/email-template-drawer.js +209 -0
  201. package/src/lib/components/email-template-drawer.js.map +1 -0
  202. package/src/lib/components/email-templates-card.d.ts +33 -0
  203. package/src/lib/components/email-templates-card.js +370 -0
  204. package/src/lib/components/email-templates-card.js.map +1 -0
  205. package/src/lib/components/erase-person-action.d.ts +92 -0
  206. package/src/lib/components/erase-person-action.js +261 -0
  207. package/src/lib/components/erase-person-action.js.map +1 -0
  208. package/src/lib/components/fields-section.d.ts +37 -0
  209. package/src/lib/components/fields-section.js +641 -0
  210. package/src/lib/components/fields-section.js.map +1 -0
  211. package/src/lib/components/form-contact-fields-card.d.ts +46 -0
  212. package/src/lib/components/form-contact-fields-card.js +253 -0
  213. package/src/lib/components/form-contact-fields-card.js.map +1 -0
  214. package/src/lib/components/insert-link-at-caret.d.ts +28 -0
  215. package/src/lib/components/insert-link-at-caret.js +37 -0
  216. package/src/lib/components/insert-link-at-caret.js.map +1 -0
  217. package/src/lib/components/lead-convert-dialog.d.ts +32 -0
  218. package/src/lib/components/lead-convert-dialog.js +493 -0
  219. package/src/lib/components/lead-convert-dialog.js.map +1 -0
  220. package/src/lib/components/lead-detail-page.d.ts +16 -0
  221. package/src/lib/components/lead-detail-page.js +163 -0
  222. package/src/lib/components/lead-detail-page.js.map +1 -0
  223. package/src/lib/components/lead-history-card.d.ts +32 -0
  224. package/src/lib/components/lead-history-card.js +165 -0
  225. package/src/lib/components/lead-history-card.js.map +1 -0
  226. package/src/lib/components/lead-import-drawer.d.ts +24 -0
  227. package/src/lib/components/lead-import-drawer.js +95 -0
  228. package/src/lib/components/lead-import-drawer.js.map +1 -0
  229. package/src/lib/components/lead-owner-select.d.ts +35 -0
  230. package/src/lib/components/lead-owner-select.js +91 -0
  231. package/src/lib/components/lead-owner-select.js.map +1 -0
  232. package/src/lib/components/lead-properties-card.d.ts +61 -0
  233. package/src/lib/components/lead-properties-card.js +395 -0
  234. package/src/lib/components/lead-properties-card.js.map +1 -0
  235. package/src/lib/components/lead-status-chip.d.ts +12 -0
  236. package/src/lib/components/lead-status-chip.js +43 -0
  237. package/src/lib/components/lead-status-chip.js.map +1 -0
  238. package/src/lib/components/lead-surfaces-note.d.ts +126 -0
  239. package/src/lib/components/lead-surfaces-note.js +262 -0
  240. package/src/lib/components/lead-surfaces-note.js.map +1 -0
  241. package/src/lib/components/lead-unqualify-dialog.d.ts +24 -0
  242. package/src/lib/components/lead-unqualify-dialog.js +125 -0
  243. package/src/lib/components/lead-unqualify-dialog.js.map +1 -0
  244. package/src/lib/components/leads-bulk-bar.d.ts +58 -0
  245. package/src/lib/components/leads-bulk-bar.js +307 -0
  246. package/src/lib/components/leads-bulk-bar.js.map +1 -0
  247. package/src/lib/components/leads-section.d.ts +23 -0
  248. package/src/lib/components/leads-section.js +664 -0
  249. package/src/lib/components/leads-section.js.map +1 -0
  250. package/src/lib/components/linked-deals-card.d.ts +32 -0
  251. package/src/lib/components/linked-deals-card.js +163 -0
  252. package/src/lib/components/linked-deals-card.js.map +1 -0
  253. package/src/lib/components/log-activity-dialog.d.ts +60 -0
  254. package/src/lib/components/log-activity-dialog.js +368 -0
  255. package/src/lib/components/log-activity-dialog.js.map +1 -0
  256. package/src/lib/components/lost-reason-dialog.d.ts +26 -0
  257. package/src/lib/components/lost-reason-dialog.js +95 -0
  258. package/src/lib/components/lost-reason-dialog.js.map +1 -0
  259. package/src/lib/components/new-contact-drawer.d.ts +78 -0
  260. package/src/lib/components/new-contact-drawer.js +343 -0
  261. package/src/lib/components/new-contact-drawer.js.map +1 -0
  262. package/src/lib/components/org-lead-surfaces-note.d.ts +57 -0
  263. package/src/lib/components/org-lead-surfaces-note.js +172 -0
  264. package/src/lib/components/org-lead-surfaces-note.js.map +1 -0
  265. package/src/lib/components/owner-avatar.d.ts +18 -0
  266. package/src/lib/components/owner-avatar.js +61 -0
  267. package/src/lib/components/owner-avatar.js.map +1 -0
  268. package/src/lib/components/pipeline-stages-dialog.d.ts +43 -0
  269. package/src/lib/components/pipeline-stages-dialog.js +339 -0
  270. package/src/lib/components/pipeline-stages-dialog.js.map +1 -0
  271. package/src/lib/components/pipelines-dialog.d.ts +55 -0
  272. package/src/lib/components/pipelines-dialog.js +517 -0
  273. package/src/lib/components/pipelines-dialog.js.map +1 -0
  274. package/src/lib/components/recent-activity-feed.d.ts +39 -0
  275. package/src/lib/components/recent-activity-feed.js +103 -0
  276. package/src/lib/components/recent-activity-feed.js.map +1 -0
  277. package/src/lib/components/recipes-card.d.ts +39 -0
  278. package/src/lib/components/recipes-card.js +485 -0
  279. package/src/lib/components/recipes-card.js.map +1 -0
  280. package/src/lib/components/record-activity-card.d.ts +26 -0
  281. package/src/lib/components/record-activity-card.js +121 -0
  282. package/src/lib/components/record-activity-card.js.map +1 -0
  283. package/src/lib/components/record-files-card.d.ts +67 -0
  284. package/src/lib/components/record-files-card.js +290 -0
  285. package/src/lib/components/record-files-card.js.map +1 -0
  286. package/src/lib/components/record-tasks-card.d.ts +32 -0
  287. package/src/lib/components/record-tasks-card.js +306 -0
  288. package/src/lib/components/record-tasks-card.js.map +1 -0
  289. package/src/lib/components/reports/activity-card.d.ts +57 -0
  290. package/src/lib/components/reports/activity-card.js +281 -0
  291. package/src/lib/components/reports/activity-card.js.map +1 -0
  292. package/src/lib/components/reports/closed-deals-card.d.ts +20 -0
  293. package/src/lib/components/reports/closed-deals-card.js +194 -0
  294. package/src/lib/components/reports/closed-deals-card.js.map +1 -0
  295. package/src/lib/components/reports/contacts-mix-card.d.ts +27 -0
  296. package/src/lib/components/reports/contacts-mix-card.js +161 -0
  297. package/src/lib/components/reports/contacts-mix-card.js.map +1 -0
  298. package/src/lib/components/reports/contacts-trend-card.d.ts +31 -0
  299. package/src/lib/components/reports/contacts-trend-card.js +144 -0
  300. package/src/lib/components/reports/contacts-trend-card.js.map +1 -0
  301. package/src/lib/components/reports/forecast-card.d.ts +22 -0
  302. package/src/lib/components/reports/forecast-card.js +251 -0
  303. package/src/lib/components/reports/forecast-card.js.map +1 -0
  304. package/src/lib/components/reports/lead-counts.d.ts +32 -0
  305. package/src/lib/components/reports/lead-counts.js +44 -0
  306. package/src/lib/components/reports/lead-counts.js.map +1 -0
  307. package/src/lib/components/reports/lead-funnel-card.d.ts +38 -0
  308. package/src/lib/components/reports/lead-funnel-card.js +375 -0
  309. package/src/lib/components/reports/lead-funnel-card.js.map +1 -0
  310. package/src/lib/components/reports/pipeline-card.d.ts +19 -0
  311. package/src/lib/components/reports/pipeline-card.js +338 -0
  312. package/src/lib/components/reports/pipeline-card.js.map +1 -0
  313. package/src/lib/components/reports/report-bar-chart.d.ts +39 -0
  314. package/src/lib/components/reports/report-bar-chart.js +133 -0
  315. package/src/lib/components/reports/report-bar-chart.js.map +1 -0
  316. package/src/lib/components/reports/report-breakdown.d.ts +32 -0
  317. package/src/lib/components/reports/report-breakdown.js +105 -0
  318. package/src/lib/components/reports/report-breakdown.js.map +1 -0
  319. package/src/lib/components/reports/report-export.d.ts +37 -0
  320. package/src/lib/components/reports/report-export.js +66 -0
  321. package/src/lib/components/reports/report-export.js.map +1 -0
  322. package/src/lib/components/reports/report-format.d.ts +36 -0
  323. package/src/lib/components/reports/report-format.js +43 -0
  324. package/src/lib/components/reports/report-format.js.map +1 -0
  325. package/src/lib/components/reports/report-scope.d.ts +81 -0
  326. package/src/lib/components/reports/report-scope.js +58 -0
  327. package/src/lib/components/reports/report-scope.js.map +1 -0
  328. package/src/lib/components/reports/report-stat-tile.d.ts +47 -0
  329. package/src/lib/components/reports/report-stat-tile.js +96 -0
  330. package/src/lib/components/reports/report-stat-tile.js.map +1 -0
  331. package/src/lib/components/reports/source-conversion-card.d.ts +28 -0
  332. package/src/lib/components/reports/source-conversion-card.js +205 -0
  333. package/src/lib/components/reports/source-conversion-card.js.map +1 -0
  334. package/src/lib/components/reports/tasks-card.d.ts +26 -0
  335. package/src/lib/components/reports/tasks-card.js +279 -0
  336. package/src/lib/components/reports/tasks-card.js.map +1 -0
  337. package/src/lib/components/reports/use-aggregate-read.d.ts +99 -0
  338. package/src/lib/components/reports/use-aggregate-read.js +195 -0
  339. package/src/lib/components/reports/use-aggregate-read.js.map +1 -0
  340. package/src/lib/components/reports/won-lost-by-owner-card.d.ts +30 -0
  341. package/src/lib/components/reports/won-lost-by-owner-card.js +168 -0
  342. package/src/lib/components/reports/won-lost-by-owner-card.js.map +1 -0
  343. package/src/lib/components/reports-section.d.ts +42 -0
  344. package/src/lib/components/reports-section.js +308 -0
  345. package/src/lib/components/reports-section.js.map +1 -0
  346. package/src/lib/components/sending-addresses-card.d.ts +49 -0
  347. package/src/lib/components/sending-addresses-card.js +262 -0
  348. package/src/lib/components/sending-addresses-card.js.map +1 -0
  349. package/src/lib/components/settings-section.d.ts +151 -0
  350. package/src/lib/components/settings-section.js +783 -0
  351. package/src/lib/components/settings-section.js.map +1 -0
  352. package/src/lib/components/task-cells.d.ts +51 -0
  353. package/src/lib/components/task-cells.js +139 -0
  354. package/src/lib/components/task-cells.js.map +1 -0
  355. package/src/lib/components/task-edit-drawer.d.ts +53 -0
  356. package/src/lib/components/task-edit-drawer.js +483 -0
  357. package/src/lib/components/task-edit-drawer.js.map +1 -0
  358. package/src/lib/components/task-import-drawer.d.ts +24 -0
  359. package/src/lib/components/task-import-drawer.js +82 -0
  360. package/src/lib/components/task-import-drawer.js.map +1 -0
  361. package/src/lib/components/task-snooze-menu.d.ts +65 -0
  362. package/src/lib/components/task-snooze-menu.js +207 -0
  363. package/src/lib/components/task-snooze-menu.js.map +1 -0
  364. package/src/lib/components/tasks-bulk-bar.d.ts +25 -0
  365. package/src/lib/components/tasks-bulk-bar.js +348 -0
  366. package/src/lib/components/tasks-bulk-bar.js.map +1 -0
  367. package/src/lib/components/tasks-calendar.d.ts +38 -0
  368. package/src/lib/components/tasks-calendar.js +228 -0
  369. package/src/lib/components/tasks-calendar.js.map +1 -0
  370. package/src/lib/components/tasks-section.d.ts +27 -0
  371. package/src/lib/components/tasks-section.js +579 -0
  372. package/src/lib/components/tasks-section.js.map +1 -0
  373. package/src/lib/components/use-contact-campaign-emails.d.ts +32 -0
  374. package/src/lib/components/use-contact-campaign-emails.js +83 -0
  375. package/src/lib/components/use-contact-campaign-emails.js.map +1 -0
  376. package/src/lib/components/use-crm-api.d.ts +44 -0
  377. package/src/lib/components/use-crm-api.js +84 -0
  378. package/src/lib/components/use-crm-api.js.map +1 -0
  379. package/src/lib/components/use-crm-inbound-address.d.ts +60 -0
  380. package/src/lib/components/use-crm-inbound-address.js +124 -0
  381. package/src/lib/components/use-crm-inbound-address.js.map +1 -0
  382. package/src/lib/components/use-emails-hub-path.d.ts +24 -0
  383. package/src/lib/components/use-emails-hub-path.js +59 -0
  384. package/src/lib/components/use-emails-hub-path.js.map +1 -0
  385. package/src/lib/components/use-member-email-aliases.d.ts +54 -0
  386. package/src/lib/components/use-member-email-aliases.js +186 -0
  387. package/src/lib/components/use-member-email-aliases.js.map +1 -0
  388. package/src/lib/components/use-org-members.d.ts +40 -0
  389. package/src/lib/components/use-org-members.js +100 -0
  390. package/src/lib/components/use-org-members.js.map +1 -0
  391. package/src/lib/constants/api-routes.d.ts +109 -0
  392. package/src/lib/constants/api-routes.js +74 -0
  393. package/src/lib/constants/api-routes.js.map +1 -0
  394. package/src/lib/constants/bundle-common.d.ts +14 -0
  395. package/src/lib/constants/bundle-common.js +14 -0
  396. package/src/lib/constants/bundle-common.js.map +1 -0
  397. package/src/lib/constants/company-filters.d.ts +18 -0
  398. package/src/lib/constants/company-filters.js +51 -0
  399. package/src/lib/constants/company-filters.js.map +1 -0
  400. package/src/lib/constants/contact-filters.d.ts +38 -0
  401. package/src/lib/constants/contact-filters.js +294 -0
  402. package/src/lib/constants/contact-filters.js.map +1 -0
  403. package/src/lib/hooks/use-contact-field-definitions.d.ts +48 -0
  404. package/src/lib/hooks/use-contact-field-definitions.js +72 -0
  405. package/src/lib/hooks/use-contact-field-definitions.js.map +1 -0
  406. package/src/lib/hooks/use-contact-update.d.ts +25 -0
  407. package/src/lib/hooks/use-contact-update.js +80 -0
  408. package/src/lib/hooks/use-contact-update.js.map +1 -0
  409. package/src/lib/hooks/use-crm-activity-logger.d.ts +73 -0
  410. package/src/lib/hooks/use-crm-activity-logger.js +101 -0
  411. package/src/lib/hooks/use-crm-activity-logger.js.map +1 -0
  412. package/src/lib/hooks/use-crm-bulk-apply.d.ts +52 -0
  413. package/src/lib/hooks/use-crm-bulk-apply.js +112 -0
  414. package/src/lib/hooks/use-crm-bulk-apply.js.map +1 -0
  415. package/src/lib/hooks/use-crm-default-view.d.ts +24 -0
  416. package/src/lib/hooks/use-crm-default-view.js +64 -0
  417. package/src/lib/hooks/use-crm-default-view.js.map +1 -0
  418. package/src/lib/hooks/use-crm-email-templates.d.ts +59 -0
  419. package/src/lib/hooks/use-crm-email-templates.js +103 -0
  420. package/src/lib/hooks/use-crm-email-templates.js.map +1 -0
  421. package/src/lib/hooks/use-crm-hub-path.d.ts +29 -0
  422. package/src/lib/hooks/use-crm-hub-path.js +41 -0
  423. package/src/lib/hooks/use-crm-hub-path.js.map +1 -0
  424. package/src/lib/hooks/use-crm-org-mount.d.ts +97 -0
  425. package/src/lib/hooks/use-crm-org-mount.js +215 -0
  426. package/src/lib/hooks/use-crm-org-mount.js.map +1 -0
  427. package/src/lib/hooks/use-crm-record-names.d.ts +52 -0
  428. package/src/lib/hooks/use-crm-record-names.js +126 -0
  429. package/src/lib/hooks/use-crm-record-names.js.map +1 -0
  430. package/src/lib/hooks/use-crm-records-quota.d.ts +68 -0
  431. package/src/lib/hooks/use-crm-records-quota.js +118 -0
  432. package/src/lib/hooks/use-crm-records-quota.js.map +1 -0
  433. package/src/lib/hooks/use-crm-saved-view.d.ts +96 -0
  434. package/src/lib/hooks/use-crm-saved-view.js +329 -0
  435. package/src/lib/hooks/use-crm-saved-view.js.map +1 -0
  436. package/src/lib/hooks/use-crm-scope.d.ts +117 -0
  437. package/src/lib/hooks/use-crm-scope.js +147 -0
  438. package/src/lib/hooks/use-crm-scope.js.map +1 -0
  439. package/src/lib/hooks/use-crm-tasks.d.ts +85 -0
  440. package/src/lib/hooks/use-crm-tasks.js +153 -0
  441. package/src/lib/hooks/use-crm-tasks.js.map +1 -0
  442. package/src/lib/hooks/use-crm-view-grid.d.ts +55 -0
  443. package/src/lib/hooks/use-crm-view-grid.js +170 -0
  444. package/src/lib/hooks/use-crm-view-grid.js.map +1 -0
  445. package/src/lib/hooks/use-crm-views.d.ts +42 -0
  446. package/src/lib/hooks/use-crm-views.js +84 -0
  447. package/src/lib/hooks/use-crm-views.js.map +1 -0
  448. package/src/lib/hooks/use-deal-stage-api.d.ts +69 -0
  449. package/src/lib/hooks/use-deal-stage-api.js +78 -0
  450. package/src/lib/hooks/use-deal-stage-api.js.map +1 -0
  451. package/src/lib/hooks/use-deals.d.ts +47 -0
  452. package/src/lib/hooks/use-deals.js +105 -0
  453. package/src/lib/hooks/use-deals.js.map +1 -0
  454. package/src/lib/hooks/use-org-leads.d.ts +53 -0
  455. package/src/lib/hooks/use-org-leads.js +114 -0
  456. package/src/lib/hooks/use-org-leads.js.map +1 -0
  457. package/src/lib/hooks/use-org-member-directory.d.ts +36 -0
  458. package/src/lib/hooks/use-org-member-directory.js +116 -0
  459. package/src/lib/hooks/use-org-member-directory.js.map +1 -0
  460. package/src/lib/hooks/use-org-member-options.d.ts +38 -0
  461. package/src/lib/hooks/use-org-member-options.js +131 -0
  462. package/src/lib/hooks/use-org-member-options.js.map +1 -0
  463. package/src/lib/hooks/use-pipeline.d.ts +71 -0
  464. package/src/lib/hooks/use-pipeline.js +159 -0
  465. package/src/lib/hooks/use-pipeline.js.map +1 -0
  466. package/src/lib/model/companies-bulk-writes.d.ts +40 -0
  467. package/src/lib/model/companies-bulk-writes.js +103 -0
  468. package/src/lib/model/companies-bulk-writes.js.map +1 -0
  469. package/src/lib/model/companies-csv.d.ts +36 -0
  470. package/src/lib/model/companies-csv.js +38 -0
  471. package/src/lib/model/companies-csv.js.map +1 -0
  472. package/src/lib/model/companies.d.ts +99 -0
  473. package/src/lib/model/companies.js +168 -0
  474. package/src/lib/model/companies.js.map +1 -0
  475. package/src/lib/model/company-delete-route.d.ts +43 -0
  476. package/src/lib/model/company-delete-route.js +31 -0
  477. package/src/lib/model/company-delete-route.js.map +1 -0
  478. package/src/lib/model/company-delete.d.ts +42 -0
  479. package/src/lib/model/company-delete.js +52 -0
  480. package/src/lib/model/company-delete.js.map +1 -0
  481. package/src/lib/model/contact-duplicates.d.ts +58 -0
  482. package/src/lib/model/contact-duplicates.js +67 -0
  483. package/src/lib/model/contact-duplicates.js.map +1 -0
  484. package/src/lib/model/contact-record.d.ts +113 -0
  485. package/src/lib/model/contact-record.js +70 -0
  486. package/src/lib/model/contact-record.js.map +1 -0
  487. package/src/lib/model/contact-update.d.ts +93 -0
  488. package/src/lib/model/contact-update.js +50 -0
  489. package/src/lib/model/contact-update.js.map +1 -0
  490. package/src/lib/model/contacts-bulk-writes.d.ts +173 -0
  491. package/src/lib/model/contacts-bulk-writes.js +196 -0
  492. package/src/lib/model/contacts-bulk-writes.js.map +1 -0
  493. package/src/lib/model/contacts-csv.d.ts +54 -0
  494. package/src/lib/model/contacts-csv.js +67 -0
  495. package/src/lib/model/contacts-csv.js.map +1 -0
  496. package/src/lib/model/contacts-list-seed.d.ts +51 -0
  497. package/src/lib/model/contacts-list-seed.js +63 -0
  498. package/src/lib/model/contacts-list-seed.js.map +1 -0
  499. package/src/lib/model/crm-activity-report.d.ts +27 -0
  500. package/src/lib/model/crm-activity-report.js +56 -0
  501. package/src/lib/model/crm-activity-report.js.map +1 -0
  502. package/src/lib/model/crm-api.d.ts +49 -0
  503. package/src/lib/model/crm-api.js +47 -0
  504. package/src/lib/model/crm-api.js.map +1 -0
  505. package/src/lib/model/crm-bulk-writes.d.ts +147 -0
  506. package/src/lib/model/crm-bulk-writes.js +207 -0
  507. package/src/lib/model/crm-bulk-writes.js.map +1 -0
  508. package/src/lib/model/crm-company-import.d.ts +154 -0
  509. package/src/lib/model/crm-company-import.js +331 -0
  510. package/src/lib/model/crm-company-import.js.map +1 -0
  511. package/src/lib/model/crm-custom-draft.d.ts +62 -0
  512. package/src/lib/model/crm-custom-draft.js +67 -0
  513. package/src/lib/model/crm-custom-draft.js.map +1 -0
  514. package/src/lib/model/crm-deal-import.d.ts +112 -0
  515. package/src/lib/model/crm-deal-import.js +263 -0
  516. package/src/lib/model/crm-deal-import.js.map +1 -0
  517. package/src/lib/model/crm-import.d.ts +244 -0
  518. package/src/lib/model/crm-import.js +466 -0
  519. package/src/lib/model/crm-import.js.map +1 -0
  520. package/src/lib/model/crm-lead-import.d.ts +105 -0
  521. package/src/lib/model/crm-lead-import.js +255 -0
  522. package/src/lib/model/crm-lead-import.js.map +1 -0
  523. package/src/lib/model/crm-record-routes.d.ts +21 -0
  524. package/src/lib/model/crm-record-routes.js +70 -0
  525. package/src/lib/model/crm-record-routes.js.map +1 -0
  526. package/src/lib/model/crm-routes.d.ts +101 -0
  527. package/src/lib/model/crm-routes.js +92 -0
  528. package/src/lib/model/crm-routes.js.map +1 -0
  529. package/src/lib/model/crm-task-import.d.ts +94 -0
  530. package/src/lib/model/crm-task-import.js +275 -0
  531. package/src/lib/model/crm-task-import.js.map +1 -0
  532. package/src/lib/model/crm-view-param.d.ts +43 -0
  533. package/src/lib/model/crm-view-param.js +49 -0
  534. package/src/lib/model/crm-view-param.js.map +1 -0
  535. package/src/lib/model/deal-board-model.d.ts +241 -0
  536. package/src/lib/model/deal-board-model.js +439 -0
  537. package/src/lib/model/deal-board-model.js.map +1 -0
  538. package/src/lib/model/deal-form-model.d.ts +114 -0
  539. package/src/lib/model/deal-form-model.js +218 -0
  540. package/src/lib/model/deal-form-model.js.map +1 -0
  541. package/src/lib/model/deals-csv.d.ts +32 -0
  542. package/src/lib/model/deals-csv.js +37 -0
  543. package/src/lib/model/deals-csv.js.map +1 -0
  544. package/src/lib/model/import-column-shapes.d.ts +36 -0
  545. package/src/lib/model/import-column-shapes.js +76 -0
  546. package/src/lib/model/import-column-shapes.js.map +1 -0
  547. package/src/lib/model/lead-company-suggestion.d.ts +61 -0
  548. package/src/lib/model/lead-company-suggestion.js +65 -0
  549. package/src/lib/model/lead-company-suggestion.js.map +1 -0
  550. package/src/lib/model/lead-filters.d.ts +29 -0
  551. package/src/lib/model/lead-filters.js +39 -0
  552. package/src/lib/model/lead-filters.js.map +1 -0
  553. package/src/lib/model/lead-surfaces.d.ts +58 -0
  554. package/src/lib/model/lead-surfaces.js +67 -0
  555. package/src/lib/model/lead-surfaces.js.map +1 -0
  556. package/src/lib/model/leads-csv.d.ts +40 -0
  557. package/src/lib/model/leads-csv.js +40 -0
  558. package/src/lib/model/leads-csv.js.map +1 -0
  559. package/src/lib/model/next-activity-api.d.ts +31 -0
  560. package/src/lib/model/next-activity-api.js +57 -0
  561. package/src/lib/model/next-activity-api.js.map +1 -0
  562. package/src/lib/model/next-activity.d.ts +64 -0
  563. package/src/lib/model/next-activity.js +47 -0
  564. package/src/lib/model/next-activity.js.map +1 -0
  565. package/src/lib/model/person-key-web.d.ts +43 -0
  566. package/src/lib/model/person-key-web.js +52 -0
  567. package/src/lib/model/person-key-web.js.map +1 -0
  568. package/src/lib/model/record-facts.d.ts +282 -0
  569. package/src/lib/model/record-facts.js +434 -0
  570. package/src/lib/model/record-facts.js.map +1 -0
  571. package/src/lib/model/task-api.d.ts +28 -0
  572. package/src/lib/model/task-api.js +57 -0
  573. package/src/lib/model/task-api.js.map +1 -0
  574. package/src/lib/model/task-calendar.d.ts +108 -0
  575. package/src/lib/model/task-calendar.js +139 -0
  576. package/src/lib/model/task-calendar.js.map +1 -0
  577. package/src/lib/model/task-routes.d.ts +177 -0
  578. package/src/lib/model/task-routes.js +197 -0
  579. package/src/lib/model/task-routes.js.map +1 -0
  580. package/src/lib/model/task-scope.d.ts +45 -0
  581. package/src/lib/model/task-scope.js +51 -0
  582. package/src/lib/model/task-scope.js.map +1 -0
  583. package/src/lib/model/task-views.d.ts +149 -0
  584. package/src/lib/model/task-views.js +286 -0
  585. package/src/lib/model/task-views.js.map +1 -0
  586. package/src/lib/model/tasks-csv.d.ts +28 -0
  587. package/src/lib/model/tasks-csv.js +28 -0
  588. package/src/lib/model/tasks-csv.js.map +1 -0
  589. package/src/lib/plugin.d.ts +32 -0
  590. package/src/lib/plugin.js +208 -0
  591. package/src/lib/plugin.js.map +1 -0
  592. package/src/lib/server/companies-import.d.ts +57 -0
  593. package/src/lib/server/companies-import.js +242 -0
  594. package/src/lib/server/companies-import.js.map +1 -0
  595. package/src/lib/server/company-delete.d.ts +59 -0
  596. package/src/lib/server/company-delete.js +146 -0
  597. package/src/lib/server/company-delete.js.map +1 -0
  598. package/src/lib/server/contact-email-history.d.ts +82 -0
  599. package/src/lib/server/contact-email-history.js +264 -0
  600. package/src/lib/server/contact-email-history.js.map +1 -0
  601. package/src/lib/server/contact-profile.d.ts +41 -0
  602. package/src/lib/server/contact-profile.js +45 -0
  603. package/src/lib/server/contact-profile.js.map +1 -0
  604. package/src/lib/server/contact-update.d.ts +92 -0
  605. package/src/lib/server/contact-update.js +512 -0
  606. package/src/lib/server/contact-update.js.map +1 -0
  607. package/src/lib/server/contacts-import.d.ts +73 -0
  608. package/src/lib/server/contacts-import.js +263 -0
  609. package/src/lib/server/contacts-import.js.map +1 -0
  610. package/src/lib/server/contacts-merge.d.ts +86 -0
  611. package/src/lib/server/contacts-merge.js +206 -0
  612. package/src/lib/server/contacts-merge.js.map +1 -0
  613. package/src/lib/server/deals-import.d.ts +76 -0
  614. package/src/lib/server/deals-import.js +246 -0
  615. package/src/lib/server/deals-import.js.map +1 -0
  616. package/src/lib/server/email-send.d.ts +119 -0
  617. package/src/lib/server/email-send.js +667 -0
  618. package/src/lib/server/email-send.js.map +1 -0
  619. package/src/lib/server/email-template-duplicate.d.ts +19 -0
  620. package/src/lib/server/email-template-duplicate.js +206 -0
  621. package/src/lib/server/email-template-duplicate.js.map +1 -0
  622. package/src/lib/server/erase-person.d.ts +108 -0
  623. package/src/lib/server/erase-person.js +309 -0
  624. package/src/lib/server/erase-person.js.map +1 -0
  625. package/src/lib/server/import-context.d.ts +85 -0
  626. package/src/lib/server/import-context.js +181 -0
  627. package/src/lib/server/import-context.js.map +1 -0
  628. package/src/lib/server/inbound-address.d.ts +61 -0
  629. package/src/lib/server/inbound-address.js +188 -0
  630. package/src/lib/server/inbound-address.js.map +1 -0
  631. package/src/lib/server/lead-convert.d.ts +78 -0
  632. package/src/lib/server/lead-convert.js +250 -0
  633. package/src/lib/server/lead-convert.js.map +1 -0
  634. package/src/lib/server/leads-import.d.ts +84 -0
  635. package/src/lib/server/leads-import.js +261 -0
  636. package/src/lib/server/leads-import.js.map +1 -0
  637. package/src/lib/server/next-activity-routes.d.ts +33 -0
  638. package/src/lib/server/next-activity-routes.js +110 -0
  639. package/src/lib/server/next-activity-routes.js.map +1 -0
  640. package/src/lib/server/org-activity.d.ts +61 -0
  641. package/src/lib/server/org-activity.js +120 -0
  642. package/src/lib/server/org-activity.js.map +1 -0
  643. package/src/lib/server/org-caller.d.ts +110 -0
  644. package/src/lib/server/org-caller.js +154 -0
  645. package/src/lib/server/org-caller.js.map +1 -0
  646. package/src/lib/server/recipe-routes.d.ts +75 -0
  647. package/src/lib/server/recipe-routes.js +442 -0
  648. package/src/lib/server/recipe-routes.js.map +1 -0
  649. package/src/lib/server/record-facts.d.ts +65 -0
  650. package/src/lib/server/record-facts.js +337 -0
  651. package/src/lib/server/record-facts.js.map +1 -0
  652. package/src/lib/server/record-timeline.d.ts +51 -0
  653. package/src/lib/server/record-timeline.js +215 -0
  654. package/src/lib/server/record-timeline.js.map +1 -0
  655. package/src/lib/server/suite-gate.d.ts +42 -0
  656. package/src/lib/server/suite-gate.js +87 -0
  657. package/src/lib/server/suite-gate.js.map +1 -0
  658. package/src/lib/server/task-routes.d.ts +132 -0
  659. package/src/lib/server/task-routes.js +699 -0
  660. package/src/lib/server/task-routes.js.map +1 -0
  661. package/src/lib/server/tasks-import.d.ts +54 -0
  662. package/src/lib/server/tasks-import.js +157 -0
  663. package/src/lib/server/tasks-import.js.map +1 -0
  664. package/src/lib/server-deal-stage.d.ts +88 -0
  665. package/src/lib/server-deal-stage.js +316 -0
  666. package/src/lib/server-deal-stage.js.map +1 -0
  667. package/src/lib/server.d.ts +149 -0
  668. package/src/lib/server.js +615 -0
  669. package/src/lib/server.js.map +1 -0
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { CrmBulkPlan } from './crm-bulk-writes';
18
+ /** The drawer's cap on a company's tags — the same number, so the two agree. */
19
+ export declare const COMPANY_TAGS_CAP = 20;
20
+ /** As much of a companies row as a bulk write reads. */
21
+ export interface CompanyBulkRow {
22
+ $id: string;
23
+ name?: string;
24
+ tags?: string[];
25
+ ownerUid?: string;
26
+ }
27
+ /**
28
+ * Add one tag to every row. A row that already carries it is skipped
29
+ * silently — `arrayUnion` would write nothing; a row at the cap without it
30
+ * is skipped AND named, so the bar cannot slip past the drawer's limit.
31
+ */
32
+ export declare function planCompanyAddTag(rows: readonly CompanyBulkRow[], tag: string, nowMs: number): CrmBulkPlan;
33
+ /** Take one tag off every row that has it; the rest are left alone. */
34
+ export declare function planCompanyRemoveTag(rows: readonly CompanyBulkRow[], tag: string, nowMs: number): CrmBulkPlan;
35
+ /**
36
+ * Set the owner on every row. An empty owner DELETES the field rather than
37
+ * writing an empty string — the drawer clears it the same way, and the
38
+ * Owner column filter is an equality that must not find `''`.
39
+ */
40
+ export declare function planCompanySetOwner(rows: readonly CompanyBulkRow[], ownerUid: string | null, nowMs: number): CrmBulkPlan;
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * What a bulk action on the companies table WRITES (AGL-2621).
18
+ *
19
+ * A company is one holder's record — there is no facet to patch, the way a
20
+ * contact has — so each plan is a plain top-level update per row: the owner
21
+ * as the drawer stores it, the tags by `arrayUnion`/`arrayRemove` rather
22
+ * than a rewritten array, because the rows the bar reads came off a
23
+ * listener that may be behind the server and a bulk action must not roll
24
+ * back what another console just saved. Deleting is not a plan here: a
25
+ * company's delete is a detach pass and then a delete (`company-delete.ts`),
26
+ * and the bar runs that per row.
27
+ */ import { arrayRemove, arrayUnion, deleteField } from "firebase/firestore";
28
+ /** The drawer's cap on a company's tags — the same number, so the two agree. */ export const COMPANY_TAGS_CAP = 20;
29
+ /** The name a report lists a company under, falling back to the id. */ const labelOf = (row)=>String(row.name || row.$id);
30
+ /**
31
+ * Add one tag to every row. A row that already carries it is skipped
32
+ * silently — `arrayUnion` would write nothing; a row at the cap without it
33
+ * is skipped AND named, so the bar cannot slip past the drawer's limit.
34
+ */ export function planCompanyAddTag(rows, tag, nowMs) {
35
+ const writes = [];
36
+ const skipped = [];
37
+ for (const row of rows){
38
+ var _row_tags;
39
+ const held = ((_row_tags = row.tags) != null ? _row_tags : []).map((held)=>held.toLowerCase());
40
+ if (held.includes(tag)) continue;
41
+ if (held.length >= COMPANY_TAGS_CAP) {
42
+ skipped.push({
43
+ label: labelOf(row),
44
+ reason: `already has ${COMPANY_TAGS_CAP} tags`
45
+ });
46
+ continue;
47
+ }
48
+ writes.push({
49
+ id: row.$id,
50
+ label: labelOf(row),
51
+ kind: 'update',
52
+ data: {
53
+ tags: arrayUnion(tag),
54
+ updatedAt: new Date(nowMs)
55
+ }
56
+ });
57
+ }
58
+ return {
59
+ writes,
60
+ skipped
61
+ };
62
+ }
63
+ /** Take one tag off every row that has it; the rest are left alone. */ export function planCompanyRemoveTag(rows, tag, nowMs) {
64
+ const writes = [];
65
+ for (const row of rows){
66
+ var _row_tags;
67
+ const held = ((_row_tags = row.tags) != null ? _row_tags : []).map((held)=>held.toLowerCase());
68
+ if (!held.includes(tag)) continue;
69
+ writes.push({
70
+ id: row.$id,
71
+ label: labelOf(row),
72
+ kind: 'update',
73
+ data: {
74
+ tags: arrayRemove(tag),
75
+ updatedAt: new Date(nowMs)
76
+ }
77
+ });
78
+ }
79
+ return {
80
+ writes,
81
+ skipped: []
82
+ };
83
+ }
84
+ /**
85
+ * Set the owner on every row. An empty owner DELETES the field rather than
86
+ * writing an empty string — the drawer clears it the same way, and the
87
+ * Owner column filter is an equality that must not find `''`.
88
+ */ export function planCompanySetOwner(rows, ownerUid, nowMs) {
89
+ return {
90
+ writes: rows.map((row)=>({
91
+ id: row.$id,
92
+ label: labelOf(row),
93
+ kind: 'update',
94
+ data: {
95
+ ownerUid: ownerUid ? ownerUid : deleteField(),
96
+ updatedAt: new Date(nowMs)
97
+ }
98
+ })),
99
+ skipped: []
100
+ };
101
+ }
102
+
103
+ //# sourceMappingURL=companies-bulk-writes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/companies-bulk-writes.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * What a bulk action on the companies table WRITES (AGL-2621).\n *\n * A company is one holder's record — there is no facet to patch, the way a\n * contact has — so each plan is a plain top-level update per row: the owner\n * as the drawer stores it, the tags by `arrayUnion`/`arrayRemove` rather\n * than a rewritten array, because the rows the bar reads came off a\n * listener that may be behind the server and a bulk action must not roll\n * back what another console just saved. Deleting is not a plan here: a\n * company's delete is a detach pass and then a delete (`company-delete.ts`),\n * and the bar runs that per row.\n */\n\nimport { arrayRemove, arrayUnion, deleteField } from 'firebase/firestore'\nimport type { CrmBulkPlan, CrmBulkSkip, CrmBulkWrite } from './crm-bulk-writes'\n\n/** The drawer's cap on a company's tags — the same number, so the two agree. */\nexport const COMPANY_TAGS_CAP = 20\n\n/** As much of a companies row as a bulk write reads. */\nexport interface CompanyBulkRow {\n $id: string\n name?: string\n tags?: string[]\n ownerUid?: string\n}\n\n/** The name a report lists a company under, falling back to the id. */\nconst labelOf = (row: CompanyBulkRow): string => String(row.name || row.$id)\n\n/**\n * Add one tag to every row. A row that already carries it is skipped\n * silently — `arrayUnion` would write nothing; a row at the cap without it\n * is skipped AND named, so the bar cannot slip past the drawer's limit.\n */\nexport function planCompanyAddTag(\n rows: readonly CompanyBulkRow[],\n tag: string,\n nowMs: number,\n): CrmBulkPlan {\n const writes: CrmBulkWrite[] = []\n const skipped: CrmBulkSkip[] = []\n for (const row of rows) {\n const held = (row.tags ?? []).map((held) => held.toLowerCase())\n if (held.includes(tag)) continue\n if (held.length >= COMPANY_TAGS_CAP) {\n skipped.push({ label: labelOf(row), reason: `already has ${COMPANY_TAGS_CAP} tags` })\n continue\n }\n writes.push({\n id: row.$id,\n label: labelOf(row),\n kind: 'update',\n data: { tags: arrayUnion(tag), updatedAt: new Date(nowMs) },\n })\n }\n return { writes, skipped }\n}\n\n/** Take one tag off every row that has it; the rest are left alone. */\nexport function planCompanyRemoveTag(\n rows: readonly CompanyBulkRow[],\n tag: string,\n nowMs: number,\n): CrmBulkPlan {\n const writes: CrmBulkWrite[] = []\n for (const row of rows) {\n const held = (row.tags ?? []).map((held) => held.toLowerCase())\n if (!held.includes(tag)) continue\n writes.push({\n id: row.$id,\n label: labelOf(row),\n kind: 'update',\n data: { tags: arrayRemove(tag), updatedAt: new Date(nowMs) },\n })\n }\n return { writes, skipped: [] }\n}\n\n/**\n * Set the owner on every row. An empty owner DELETES the field rather than\n * writing an empty string — the drawer clears it the same way, and the\n * Owner column filter is an equality that must not find `''`.\n */\nexport function planCompanySetOwner(\n rows: readonly CompanyBulkRow[],\n ownerUid: string | null,\n nowMs: number,\n): CrmBulkPlan {\n return {\n writes: rows.map((row) => ({\n id: row.$id,\n label: labelOf(row),\n kind: 'update' as const,\n data: {\n ownerUid: ownerUid ? ownerUid : deleteField(),\n updatedAt: new Date(nowMs),\n },\n })),\n skipped: [],\n }\n}\n"],"names":["arrayRemove","arrayUnion","deleteField","COMPANY_TAGS_CAP","labelOf","row","String","name","$id","planCompanyAddTag","rows","tag","nowMs","writes","skipped","held","tags","map","toLowerCase","includes","length","push","label","reason","id","kind","data","updatedAt","Date","planCompanyRemoveTag","planCompanySetOwner","ownerUid"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;CAWC,GAED,SAASA,WAAW,EAAEC,UAAU,EAAEC,WAAW,QAAQ,qBAAoB;AAGzE,8EAA8E,GAC9E,OAAO,MAAMC,mBAAmB,GAAE;AAUlC,qEAAqE,GACrE,MAAMC,UAAU,CAACC,MAAgCC,OAAOD,IAAIE,IAAI,IAAIF,IAAIG,GAAG;AAE3E;;;;CAIC,GACD,OAAO,SAASC,kBACdC,IAA+B,EAC/BC,GAAW,EACXC,KAAa;IAEb,MAAMC,SAAyB,EAAE;IACjC,MAAMC,UAAyB,EAAE;IACjC,KAAK,MAAMT,OAAOK,KAAM;YACRL;QAAd,MAAMU,OAAO,EAACV,YAAAA,IAAIW,IAAI,YAARX,YAAY,EAAE,EAAEY,GAAG,CAAC,CAACF,OAASA,KAAKG,WAAW;QAC5D,IAAIH,KAAKI,QAAQ,CAACR,MAAM;QACxB,IAAII,KAAKK,MAAM,IAAIjB,kBAAkB;YACnCW,QAAQO,IAAI,CAAC;gBAAEC,OAAOlB,QAAQC;gBAAMkB,QAAQ,CAAC,YAAY,EAAEpB,iBAAiB,KAAK,CAAC;YAAC;YACnF;QACF;QACAU,OAAOQ,IAAI,CAAC;YACVG,IAAInB,IAAIG,GAAG;YACXc,OAAOlB,QAAQC;YACfoB,MAAM;YACNC,MAAM;gBAAEV,MAAMf,WAAWU;gBAAMgB,WAAW,IAAIC,KAAKhB;YAAO;QAC5D;IACF;IACA,OAAO;QAAEC;QAAQC;IAAQ;AAC3B;AAEA,qEAAqE,GACrE,OAAO,SAASe,qBACdnB,IAA+B,EAC/BC,GAAW,EACXC,KAAa;IAEb,MAAMC,SAAyB,EAAE;IACjC,KAAK,MAAMR,OAAOK,KAAM;YACRL;QAAd,MAAMU,OAAO,EAACV,YAAAA,IAAIW,IAAI,YAARX,YAAY,EAAE,EAAEY,GAAG,CAAC,CAACF,OAASA,KAAKG,WAAW;QAC5D,IAAI,CAACH,KAAKI,QAAQ,CAACR,MAAM;QACzBE,OAAOQ,IAAI,CAAC;YACVG,IAAInB,IAAIG,GAAG;YACXc,OAAOlB,QAAQC;YACfoB,MAAM;YACNC,MAAM;gBAAEV,MAAMhB,YAAYW;gBAAMgB,WAAW,IAAIC,KAAKhB;YAAO;QAC7D;IACF;IACA,OAAO;QAAEC;QAAQC,SAAS,EAAE;IAAC;AAC/B;AAEA;;;;CAIC,GACD,OAAO,SAASgB,oBACdpB,IAA+B,EAC/BqB,QAAuB,EACvBnB,KAAa;IAEb,OAAO;QACLC,QAAQH,KAAKO,GAAG,CAAC,CAACZ,MAAS,CAAA;gBACzBmB,IAAInB,IAAIG,GAAG;gBACXc,OAAOlB,QAAQC;gBACfoB,MAAM;gBACNC,MAAM;oBACJK,UAAUA,WAAWA,WAAW7B;oBAChCyB,WAAW,IAAIC,KAAKhB;gBACtB;YACF,CAAA;QACAE,SAAS,EAAE;IACb;AACF"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * The companies CSV — one file from the table's Export button and the bulk
19
+ * bar's (AGL-2621).
20
+ *
21
+ * The same rule the contacts file follows: the header is the companies
22
+ * IMPORT's own vocabulary — the first alias of every field
23
+ * `guessCompanyImportMapping` reads — so an export re-imports without a
24
+ * hand mapping, and the template the Import drawer hands out IS this header
25
+ * over no rows. The owner is written by ADDRESS, because the import resolves
26
+ * an owner by email and a uid is nothing a spreadsheet can read. The one
27
+ * column the import has no field for, the contacts count, is written last
28
+ * because it is what a merchant reads the file for, and maps to "Do not
29
+ * import" on the way back.
30
+ */
31
+ export { COMPANY_CSV_COLUMNS, companiesCsv, type CompanyCsvOptions, type CompanyCsvRow, } from '@aglyn/aglyn';
32
+ /**
33
+ * The file the Import drawer hands out to start from: the export's header
34
+ * and nothing under it.
35
+ */
36
+ export declare function companyImportTemplateCsv(): string;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * The companies CSV — one file from the table's Export button and the bulk
18
+ * bar's (AGL-2621).
19
+ *
20
+ * The same rule the contacts file follows: the header is the companies
21
+ * IMPORT's own vocabulary — the first alias of every field
22
+ * `guessCompanyImportMapping` reads — so an export re-imports without a
23
+ * hand mapping, and the template the Import drawer hands out IS this header
24
+ * over no rows. The owner is written by ADDRESS, because the import resolves
25
+ * an owner by email and a uid is nothing a spreadsheet can read. The one
26
+ * column the import has no field for, the contacts count, is written last
27
+ * because it is what a merchant reads the file for, and maps to "Do not
28
+ * import" on the way back.
29
+ */ /* The writer moved to `@aglyn/aglyn` under AGL-2662 — see `deals-csv.ts`. */ export { COMPANY_CSV_COLUMNS, companiesCsv } from "@aglyn/aglyn";
30
+ import { companiesCsv } from "@aglyn/aglyn";
31
+ /**
32
+ * The file the Import drawer hands out to start from: the export's header
33
+ * and nothing under it.
34
+ */ export function companyImportTemplateCsv() {
35
+ return companiesCsv([]);
36
+ }
37
+
38
+ //# sourceMappingURL=companies-csv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/companies-csv.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The companies CSV — one file from the table's Export button and the bulk\n * bar's (AGL-2621).\n *\n * The same rule the contacts file follows: the header is the companies\n * IMPORT's own vocabulary — the first alias of every field\n * `guessCompanyImportMapping` reads — so an export re-imports without a\n * hand mapping, and the template the Import drawer hands out IS this header\n * over no rows. The owner is written by ADDRESS, because the import resolves\n * an owner by email and a uid is nothing a spreadsheet can read. The one\n * column the import has no field for, the contacts count, is written last\n * because it is what a merchant reads the file for, and maps to \"Do not\n * import\" on the way back.\n */\n\n/* The writer moved to `@aglyn/aglyn` under AGL-2662 — see `deals-csv.ts`. */\nexport {\n COMPANY_CSV_COLUMNS,\n companiesCsv,\n type CompanyCsvOptions,\n type CompanyCsvRow,\n} from '@aglyn/aglyn'\n\nimport { companiesCsv } from '@aglyn/aglyn'\n\n/**\n * The file the Import drawer hands out to start from: the export's header\n * and nothing under it.\n */\nexport function companyImportTemplateCsv(): string {\n return companiesCsv([])\n}\n"],"names":["COMPANY_CSV_COLUMNS","companiesCsv","companyImportTemplateCsv"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;CAaC,GAED,2EAA2E,GAC3E,SACEA,mBAAmB,EACnBC,YAAY,QAGP,eAAc;AAErB,SAASA,YAAY,QAAQ,eAAc;AAE3C;;;CAGC,GACD,OAAO,SAASC;IACd,OAAOD,aAAa,EAAE;AACxB"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Companies (AGL-2597): the rules every surface that writes a company, or
19
+ * suggests one for a contact, has to agree on.
20
+ *
21
+ * A contact's link to a company is the server's to write (AGL-2804): the
22
+ * link lives in a holder's facet, `crm/contact-update` plans it with
23
+ * `planContactCompanyLink`, and `crm/company-delete` unlinks a company being
24
+ * deleted. What stays here is the company's own document — the draft a form
25
+ * holds, what it is stored as, and the company an address suggests — each
26
+ * rule once, as a function of the document and nothing else, so a spec can
27
+ * pin it without mounting a card.
28
+ */
29
+ import { type AglynPostalAddress, CONTACT_COMPANY_IDS_FIELD, type CrmCompany } from '@aglyn/aglyn';
30
+ export { CONTACT_COMPANY_IDS_FIELD };
31
+ export { COMPANY_DETACH_LIMIT } from './company-delete-route';
32
+ /** One company as a picker or a suggestion needs it. */
33
+ export interface CompanyOption {
34
+ id: string;
35
+ name: string;
36
+ domain?: string | null;
37
+ }
38
+ /**
39
+ * The company a contact's email address implies, from a list the caller
40
+ * already holds, or `null`.
41
+ *
42
+ * `companyDomainForEmail` already refuses the public mailbox providers, so
43
+ * `jane@gmail.com` suggests nothing rather than whichever company somebody
44
+ * once filed under "gmail.com". The match is on the normalized domain both
45
+ * sides store, so `www.acme.com` on the company and `jane@ACME.com` on the
46
+ * contact still meet.
47
+ */
48
+ export declare function suggestCompanyForEmail(email: unknown, companies: readonly CompanyOption[]): CompanyOption | null;
49
+ /** What the form holds — every field as text, the address as its parts. */
50
+ export interface CompanyDraft {
51
+ name: string;
52
+ domain: string;
53
+ website: string;
54
+ phone: string;
55
+ industry: string;
56
+ ownerUid: string;
57
+ address: AglynPostalAddress;
58
+ /** Comma-separated as typed; stored as the list `companyDraftFields` reads. */
59
+ tags: string;
60
+ notes: string;
61
+ }
62
+ export declare const EMPTY_COMPANY_DRAFT: CompanyDraft;
63
+ /** The drawer's cap on a company's tags — a contact's, so the two agree. */
64
+ export declare const COMPANY_TAGS_MAX = 20;
65
+ /**
66
+ * A typed tag list as the document stores one: split on `,` or `|`,
67
+ * lowercased and trimmed, deduplicated, capped — the same shape a contact's
68
+ * tags take, so the bulk bar's "Add tag" over companies and the drawer's
69
+ * field write one kind of value.
70
+ */
71
+ export declare function normalizeCompanyTags(input: string): string[];
72
+ /** A stored company, as the form should start from it. */
73
+ export declare function companyDraftFrom(company: Partial<CrmCompany> | null | undefined): CompanyDraft;
74
+ export type CompanyDraftResult = {
75
+ ok: true;
76
+ /** Fields with a value, ready to `setDoc` or `updateDoc`. */
77
+ set: Record<string, unknown>;
78
+ /**
79
+ * Optional fields the draft left blank. A create omits them; an edit
80
+ * has to DELETE them, or clearing the domain would leave the old one
81
+ * stored and still matching contacts by email.
82
+ */
83
+ cleared: string[];
84
+ } | {
85
+ ok: false;
86
+ error: string;
87
+ };
88
+ /**
89
+ * The document a draft becomes — normalized, keyed for search, and refused
90
+ * as a whole when one field cannot be stored honestly.
91
+ *
92
+ * Refused rather than silently dropped: a domain typed as `acme` is not a
93
+ * domain, and storing nothing while the form said something is how a company
94
+ * comes to match no contact by email with no indication why. The name is
95
+ * the one required field, and it is spread through `nameSearchFields` so the
96
+ * list's name filter — a range over `nameLower` — can find the record; a
97
+ * company written without those keys still lists and cannot be searched.
98
+ */
99
+ export declare function companyDraftFields(draft: CompanyDraft): CompanyDraftResult;
@@ -0,0 +1,168 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ /**
3
+ * @license
4
+ * Copyright 2026 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ /**
18
+ * Companies (AGL-2597): the rules every surface that writes a company, or
19
+ * suggests one for a contact, has to agree on.
20
+ *
21
+ * A contact's link to a company is the server's to write (AGL-2804): the
22
+ * link lives in a holder's facet, `crm/contact-update` plans it with
23
+ * `planContactCompanyLink`, and `crm/company-delete` unlinks a company being
24
+ * deleted. What stays here is the company's own document — the draft a form
25
+ * holds, what it is stored as, and the company an address suggests — each
26
+ * rule once, as a function of the document and nothing else, so a spec can
27
+ * pin it without mounting a card.
28
+ */ import { CONTACT_COMPANY_IDS_FIELD, companyDomainForEmail, isBlankAddress, nameSearchFields, normalizeAddress, normalizeCompanyDomain, normalizeCompanyWebsite, normalizePhone } from "@aglyn/aglyn";
29
+ /*
30
+ * The mirror field lives with the planner in `@aglyn/aglyn` now, because the
31
+ * server doors that link on capture read it too; it is re-exported here so
32
+ * the surfaces that always imported it from this module keep one name.
33
+ */ export { CONTACT_COMPANY_IDS_FIELD };
34
+ /*
35
+ * The delete pass's bound lives with `crm/company-delete`'s contract, which
36
+ * the route and the console both import; re-exported here for the surfaces
37
+ * that say it.
38
+ */ export { COMPANY_DETACH_LIMIT } from "./company-delete-route.js";
39
+ /**
40
+ * The company a contact's email address implies, from a list the caller
41
+ * already holds, or `null`.
42
+ *
43
+ * `companyDomainForEmail` already refuses the public mailbox providers, so
44
+ * `jane@gmail.com` suggests nothing rather than whichever company somebody
45
+ * once filed under "gmail.com". The match is on the normalized domain both
46
+ * sides store, so `www.acme.com` on the company and `jane@ACME.com` on the
47
+ * contact still meet.
48
+ */ export function suggestCompanyForEmail(email, companies) {
49
+ var _companies_find;
50
+ const domain = companyDomainForEmail(email);
51
+ if (!domain) return null;
52
+ return (_companies_find = companies.find((company)=>company.domain === domain)) != null ? _companies_find : null;
53
+ }
54
+ export const EMPTY_COMPANY_DRAFT = {
55
+ name: '',
56
+ domain: '',
57
+ website: '',
58
+ phone: '',
59
+ industry: '',
60
+ ownerUid: '',
61
+ address: {},
62
+ tags: '',
63
+ notes: ''
64
+ };
65
+ /** The drawer's cap on a company's tags — a contact's, so the two agree. */ export const COMPANY_TAGS_MAX = 20;
66
+ /**
67
+ * A typed tag list as the document stores one: split on `,` or `|`,
68
+ * lowercased and trimmed, deduplicated, capped — the same shape a contact's
69
+ * tags take, so the bulk bar's "Add tag" over companies and the drawer's
70
+ * field write one kind of value.
71
+ */ export function normalizeCompanyTags(input) {
72
+ return [
73
+ ...new Set(String(input != null ? input : '').split(/[|,]/).map((tag)=>tag.trim().toLowerCase().slice(0, 60)).filter(Boolean))
74
+ ].slice(0, COMPANY_TAGS_MAX);
75
+ }
76
+ /** A stored company, as the form should start from it. */ export function companyDraftFrom(company) {
77
+ var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
78
+ return {
79
+ name: String((_ref = company == null ? void 0 : company.name) != null ? _ref : ''),
80
+ domain: String((_ref1 = company == null ? void 0 : company.domain) != null ? _ref1 : ''),
81
+ website: String((_ref2 = company == null ? void 0 : company.website) != null ? _ref2 : ''),
82
+ phone: String((_ref3 = company == null ? void 0 : company.phone) != null ? _ref3 : ''),
83
+ industry: String((_ref4 = company == null ? void 0 : company.industry) != null ? _ref4 : ''),
84
+ ownerUid: String((_ref5 = company == null ? void 0 : company.ownerUid) != null ? _ref5 : ''),
85
+ address: _extends({}, (_ref6 = company == null ? void 0 : company.address) != null ? _ref6 : {}),
86
+ tags: ((_ref7 = company == null ? void 0 : company.tags) != null ? _ref7 : []).join(', '),
87
+ notes: String((_ref8 = company == null ? void 0 : company.notes) != null ? _ref8 : '')
88
+ };
89
+ }
90
+ const INDUSTRY_MAX = 80;
91
+ const NOTES_MAX = 4000;
92
+ /**
93
+ * The document a draft becomes — normalized, keyed for search, and refused
94
+ * as a whole when one field cannot be stored honestly.
95
+ *
96
+ * Refused rather than silently dropped: a domain typed as `acme` is not a
97
+ * domain, and storing nothing while the form said something is how a company
98
+ * comes to match no contact by email with no indication why. The name is
99
+ * the one required field, and it is spread through `nameSearchFields` so the
100
+ * list's name filter — a range over `nameLower` — can find the record; a
101
+ * company written without those keys still lists and cannot be searched.
102
+ */ export function companyDraftFields(draft) {
103
+ const name = draft.name.trim().replace(/\s+/g, ' ');
104
+ if (!name) return {
105
+ ok: false,
106
+ error: 'A company needs a name.'
107
+ };
108
+ const set = _extends({}, nameSearchFields(name));
109
+ const cleared = [];
110
+ const rawDomain = draft.domain.trim();
111
+ if (rawDomain) {
112
+ const domain = normalizeCompanyDomain(rawDomain);
113
+ if (!domain) {
114
+ return {
115
+ ok: false,
116
+ error: 'The domain should be a bare hostname such as acme.com — a ' + 'single word or an IP address is not one.'
117
+ };
118
+ }
119
+ set['domain'] = domain;
120
+ } else {
121
+ cleared.push('domain');
122
+ }
123
+ const website = normalizeCompanyWebsite(draft.website);
124
+ if (website === null) {
125
+ return {
126
+ ok: false,
127
+ error: 'The website is not a web address.'
128
+ };
129
+ }
130
+ if (website) set['website'] = website;
131
+ else cleared.push('website');
132
+ const rawPhone = draft.phone.trim();
133
+ if (rawPhone) {
134
+ const phone = normalizePhone(rawPhone);
135
+ if (!phone) {
136
+ return {
137
+ ok: false,
138
+ error: 'The phone number could not be read. Include the country code, ' + 'as in +1 512 555 0123.'
139
+ };
140
+ }
141
+ set['phone'] = phone;
142
+ } else {
143
+ cleared.push('phone');
144
+ }
145
+ const industry = draft.industry.trim().slice(0, INDUSTRY_MAX);
146
+ if (industry) set['industry'] = industry;
147
+ else cleared.push('industry');
148
+ const ownerUid = draft.ownerUid.trim();
149
+ if (ownerUid) set['ownerUid'] = ownerUid;
150
+ else cleared.push('ownerUid');
151
+ // Nullable rather than absent, so "no address" has one stored shape and
152
+ // an edit that clears it does not need a delete: `normalizeAddress`
153
+ // already answers `null` for a form with nothing in it.
154
+ set['address'] = isBlankAddress(draft.address) ? null : normalizeAddress(draft.address);
155
+ const tags = normalizeCompanyTags(draft.tags);
156
+ if (tags.length) set['tags'] = tags;
157
+ else cleared.push('tags');
158
+ const notes = draft.notes.trim().slice(0, NOTES_MAX);
159
+ if (notes) set['notes'] = notes;
160
+ else cleared.push('notes');
161
+ return {
162
+ ok: true,
163
+ set,
164
+ cleared
165
+ };
166
+ }
167
+
168
+ //# sourceMappingURL=companies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/companies.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Companies (AGL-2597): the rules every surface that writes a company, or\n * suggests one for a contact, has to agree on.\n *\n * A contact's link to a company is the server's to write (AGL-2804): the\n * link lives in a holder's facet, `crm/contact-update` plans it with\n * `planContactCompanyLink`, and `crm/company-delete` unlinks a company being\n * deleted. What stays here is the company's own document — the draft a form\n * holds, what it is stored as, and the company an address suggests — each\n * rule once, as a function of the document and nothing else, so a spec can\n * pin it without mounting a card.\n */\n\nimport {\n type AglynPostalAddress,\n CONTACT_COMPANY_IDS_FIELD,\n type CrmCompany,\n companyDomainForEmail,\n isBlankAddress,\n nameSearchFields,\n normalizeAddress,\n normalizeCompanyDomain,\n normalizeCompanyWebsite,\n normalizePhone,\n} from '@aglyn/aglyn'\n\n/*\n * The mirror field lives with the planner in `@aglyn/aglyn` now, because the\n * server doors that link on capture read it too; it is re-exported here so\n * the surfaces that always imported it from this module keep one name.\n */\nexport { CONTACT_COMPANY_IDS_FIELD }\n\n/*\n * The delete pass's bound lives with `crm/company-delete`'s contract, which\n * the route and the console both import; re-exported here for the surfaces\n * that say it.\n */\nexport { COMPANY_DETACH_LIMIT } from './company-delete-route'\n\n/** One company as a picker or a suggestion needs it. */\nexport interface CompanyOption {\n id: string\n name: string\n domain?: string | null\n}\n\n/**\n * The company a contact's email address implies, from a list the caller\n * already holds, or `null`.\n *\n * `companyDomainForEmail` already refuses the public mailbox providers, so\n * `jane@gmail.com` suggests nothing rather than whichever company somebody\n * once filed under \"gmail.com\". The match is on the normalized domain both\n * sides store, so `www.acme.com` on the company and `jane@ACME.com` on the\n * contact still meet.\n */\nexport function suggestCompanyForEmail(\n email: unknown,\n companies: readonly CompanyOption[],\n): CompanyOption | null {\n const domain = companyDomainForEmail(email)\n if (!domain) return null\n return companies.find((company) => company.domain === domain) ?? null\n}\n\n/** What the form holds — every field as text, the address as its parts. */\nexport interface CompanyDraft {\n name: string\n domain: string\n website: string\n phone: string\n industry: string\n ownerUid: string\n address: AglynPostalAddress\n /** Comma-separated as typed; stored as the list `companyDraftFields` reads. */\n tags: string\n notes: string\n}\n\nexport const EMPTY_COMPANY_DRAFT: CompanyDraft = {\n name: '',\n domain: '',\n website: '',\n phone: '',\n industry: '',\n ownerUid: '',\n address: {},\n tags: '',\n notes: '',\n}\n\n/** The drawer's cap on a company's tags — a contact's, so the two agree. */\nexport const COMPANY_TAGS_MAX = 20\n\n/**\n * A typed tag list as the document stores one: split on `,` or `|`,\n * lowercased and trimmed, deduplicated, capped — the same shape a contact's\n * tags take, so the bulk bar's \"Add tag\" over companies and the drawer's\n * field write one kind of value.\n */\nexport function normalizeCompanyTags(input: string): string[] {\n return [\n ...new Set(\n String(input ?? '')\n .split(/[|,]/)\n .map((tag) => tag.trim().toLowerCase().slice(0, 60))\n .filter(Boolean),\n ),\n ].slice(0, COMPANY_TAGS_MAX)\n}\n\n/** A stored company, as the form should start from it. */\nexport function companyDraftFrom(\n company: Partial<CrmCompany> | null | undefined,\n): CompanyDraft {\n return {\n name: String(company?.name ?? ''),\n domain: String(company?.domain ?? ''),\n website: String(company?.website ?? ''),\n phone: String(company?.phone ?? ''),\n industry: String(company?.industry ?? ''),\n ownerUid: String(company?.ownerUid ?? ''),\n address: { ...(company?.address ?? {}) },\n tags: (company?.tags ?? []).join(', '),\n notes: String(company?.notes ?? ''),\n }\n}\n\nexport type CompanyDraftResult =\n | {\n ok: true\n /** Fields with a value, ready to `setDoc` or `updateDoc`. */\n set: Record<string, unknown>\n /**\n * Optional fields the draft left blank. A create omits them; an edit\n * has to DELETE them, or clearing the domain would leave the old one\n * stored and still matching contacts by email.\n */\n cleared: string[]\n }\n | { ok: false; error: string }\n\nconst INDUSTRY_MAX = 80\nconst NOTES_MAX = 4000\n\n/**\n * The document a draft becomes — normalized, keyed for search, and refused\n * as a whole when one field cannot be stored honestly.\n *\n * Refused rather than silently dropped: a domain typed as `acme` is not a\n * domain, and storing nothing while the form said something is how a company\n * comes to match no contact by email with no indication why. The name is\n * the one required field, and it is spread through `nameSearchFields` so the\n * list's name filter — a range over `nameLower` — can find the record; a\n * company written without those keys still lists and cannot be searched.\n */\nexport function companyDraftFields(draft: CompanyDraft): CompanyDraftResult {\n const name = draft.name.trim().replace(/\\s+/g, ' ')\n if (!name) return { ok: false, error: 'A company needs a name.' }\n const set: Record<string, unknown> = { ...nameSearchFields(name) }\n const cleared: string[] = []\n\n const rawDomain = draft.domain.trim()\n if (rawDomain) {\n const domain = normalizeCompanyDomain(rawDomain)\n if (!domain) {\n return {\n ok: false,\n error:\n 'The domain should be a bare hostname such as acme.com — a ' +\n 'single word or an IP address is not one.',\n }\n }\n set['domain'] = domain\n } else {\n cleared.push('domain')\n }\n\n const website = normalizeCompanyWebsite(draft.website)\n if (website === null) {\n return { ok: false, error: 'The website is not a web address.' }\n }\n if (website) set['website'] = website\n else cleared.push('website')\n\n const rawPhone = draft.phone.trim()\n if (rawPhone) {\n const phone = normalizePhone(rawPhone)\n if (!phone) {\n return {\n ok: false,\n error:\n 'The phone number could not be read. Include the country code, ' +\n 'as in +1 512 555 0123.',\n }\n }\n set['phone'] = phone\n } else {\n cleared.push('phone')\n }\n\n const industry = draft.industry.trim().slice(0, INDUSTRY_MAX)\n if (industry) set['industry'] = industry\n else cleared.push('industry')\n\n const ownerUid = draft.ownerUid.trim()\n if (ownerUid) set['ownerUid'] = ownerUid\n else cleared.push('ownerUid')\n\n // Nullable rather than absent, so \"no address\" has one stored shape and\n // an edit that clears it does not need a delete: `normalizeAddress`\n // already answers `null` for a form with nothing in it.\n set['address'] = isBlankAddress(draft.address)\n ? null\n : normalizeAddress(draft.address)\n\n const tags = normalizeCompanyTags(draft.tags)\n if (tags.length) set['tags'] = tags\n else cleared.push('tags')\n\n const notes = draft.notes.trim().slice(0, NOTES_MAX)\n if (notes) set['notes'] = notes\n else cleared.push('notes')\n\n return { ok: true, set, cleared }\n}\n"],"names":["CONTACT_COMPANY_IDS_FIELD","companyDomainForEmail","isBlankAddress","nameSearchFields","normalizeAddress","normalizeCompanyDomain","normalizeCompanyWebsite","normalizePhone","COMPANY_DETACH_LIMIT","suggestCompanyForEmail","email","companies","domain","find","company","EMPTY_COMPANY_DRAFT","name","website","phone","industry","ownerUid","address","tags","notes","COMPANY_TAGS_MAX","normalizeCompanyTags","input","Set","String","split","map","tag","trim","toLowerCase","slice","filter","Boolean","companyDraftFrom","join","INDUSTRY_MAX","NOTES_MAX","companyDraftFields","draft","replace","ok","error","set","cleared","rawDomain","push","rawPhone","length"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;CAWC,GAED,SAEEA,yBAAyB,EAEzBC,qBAAqB,EACrBC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,sBAAsB,EACtBC,uBAAuB,EACvBC,cAAc,QACT,eAAc;AAErB;;;;CAIC,GACD,SAASP,yBAAyB,GAAE;AAEpC;;;;CAIC,GACD,SAASQ,oBAAoB,QAAQ,4BAAwB;AAS7D;;;;;;;;;CASC,GACD,OAAO,SAASC,uBACdC,KAAc,EACdC,SAAmC;QAI5BA;IAFP,MAAMC,SAASX,sBAAsBS;IACrC,IAAI,CAACE,QAAQ,OAAO;IACpB,QAAOD,kBAAAA,UAAUE,IAAI,CAAC,CAACC,UAAYA,QAAQF,MAAM,KAAKA,mBAA/CD,kBAA0D;AACnE;AAgBA,OAAO,MAAMI,sBAAoC;IAC/CC,MAAM;IACNJ,QAAQ;IACRK,SAAS;IACTC,OAAO;IACPC,UAAU;IACVC,UAAU;IACVC,SAAS,CAAC;IACVC,MAAM;IACNC,OAAO;AACT,EAAC;AAED,0EAA0E,GAC1E,OAAO,MAAMC,mBAAmB,GAAE;AAElC;;;;;CAKC,GACD,OAAO,SAASC,qBAAqBC,KAAa;IAChD,OAAO;WACF,IAAIC,IACLC,OAAOF,gBAAAA,QAAS,IACbG,KAAK,CAAC,QACNC,GAAG,CAAC,CAACC,MAAQA,IAAIC,IAAI,GAAGC,WAAW,GAAGC,KAAK,CAAC,GAAG,KAC/CC,MAAM,CAACC;KAEb,CAACF,KAAK,CAAC,GAAGV;AACb;AAEA,wDAAwD,GACxD,OAAO,SAASa,iBACdvB,OAA+C;;IAE/C,OAAO;QACLE,MAAMY,eAAOd,2BAAAA,QAASE,IAAI,mBAAI;QAC9BJ,QAAQgB,gBAAOd,2BAAAA,QAASF,MAAM,oBAAI;QAClCK,SAASW,gBAAOd,2BAAAA,QAASG,OAAO,oBAAI;QACpCC,OAAOU,gBAAOd,2BAAAA,QAASI,KAAK,oBAAI;QAChCC,UAAUS,gBAAOd,2BAAAA,QAASK,QAAQ,oBAAI;QACtCC,UAAUQ,gBAAOd,2BAAAA,QAASM,QAAQ,oBAAI;QACtCC,SAAS,sBAAMP,2BAAAA,QAASO,OAAO,oBAAI,CAAC;QACpCC,MAAM,UAACR,2BAAAA,QAASQ,IAAI,oBAAI,EAAE,EAAEgB,IAAI,CAAC;QACjCf,OAAOK,gBAAOd,2BAAAA,QAASS,KAAK,oBAAI;IAClC;AACF;AAgBA,MAAMgB,eAAe;AACrB,MAAMC,YAAY;AAElB;;;;;;;;;;CAUC,GACD,OAAO,SAASC,mBAAmBC,KAAmB;IACpD,MAAM1B,OAAO0B,MAAM1B,IAAI,CAACgB,IAAI,GAAGW,OAAO,CAAC,QAAQ;IAC/C,IAAI,CAAC3B,MAAM,OAAO;QAAE4B,IAAI;QAAOC,OAAO;IAA0B;IAChE,MAAMC,MAA+B,aAAK3C,iBAAiBa;IAC3D,MAAM+B,UAAoB,EAAE;IAE5B,MAAMC,YAAYN,MAAM9B,MAAM,CAACoB,IAAI;IACnC,IAAIgB,WAAW;QACb,MAAMpC,SAASP,uBAAuB2C;QACtC,IAAI,CAACpC,QAAQ;YACX,OAAO;gBACLgC,IAAI;gBACJC,OACE,+DACA;YACJ;QACF;QACAC,GAAG,CAAC,SAAS,GAAGlC;IAClB,OAAO;QACLmC,QAAQE,IAAI,CAAC;IACf;IAEA,MAAMhC,UAAUX,wBAAwBoC,MAAMzB,OAAO;IACrD,IAAIA,YAAY,MAAM;QACpB,OAAO;YAAE2B,IAAI;YAAOC,OAAO;QAAoC;IACjE;IACA,IAAI5B,SAAS6B,GAAG,CAAC,UAAU,GAAG7B;SACzB8B,QAAQE,IAAI,CAAC;IAElB,MAAMC,WAAWR,MAAMxB,KAAK,CAACc,IAAI;IACjC,IAAIkB,UAAU;QACZ,MAAMhC,QAAQX,eAAe2C;QAC7B,IAAI,CAAChC,OAAO;YACV,OAAO;gBACL0B,IAAI;gBACJC,OACE,mEACA;YACJ;QACF;QACAC,GAAG,CAAC,QAAQ,GAAG5B;IACjB,OAAO;QACL6B,QAAQE,IAAI,CAAC;IACf;IAEA,MAAM9B,WAAWuB,MAAMvB,QAAQ,CAACa,IAAI,GAAGE,KAAK,CAAC,GAAGK;IAChD,IAAIpB,UAAU2B,GAAG,CAAC,WAAW,GAAG3B;SAC3B4B,QAAQE,IAAI,CAAC;IAElB,MAAM7B,WAAWsB,MAAMtB,QAAQ,CAACY,IAAI;IACpC,IAAIZ,UAAU0B,GAAG,CAAC,WAAW,GAAG1B;SAC3B2B,QAAQE,IAAI,CAAC;IAElB,wEAAwE;IACxE,oEAAoE;IACpE,wDAAwD;IACxDH,GAAG,CAAC,UAAU,GAAG5C,eAAewC,MAAMrB,OAAO,IACzC,OACAjB,iBAAiBsC,MAAMrB,OAAO;IAElC,MAAMC,OAAOG,qBAAqBiB,MAAMpB,IAAI;IAC5C,IAAIA,KAAK6B,MAAM,EAAEL,GAAG,CAAC,OAAO,GAAGxB;SAC1ByB,QAAQE,IAAI,CAAC;IAElB,MAAM1B,QAAQmB,MAAMnB,KAAK,CAACS,IAAI,GAAGE,KAAK,CAAC,GAAGM;IAC1C,IAAIjB,OAAOuB,GAAG,CAAC,QAAQ,GAAGvB;SACrBwB,QAAQE,IAAI,CAAC;IAElB,OAAO;QAAEL,IAAI;QAAME;QAAKC;IAAQ;AAClC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * `crm/company-delete`'s contract (AGL-2804), in one module both halves
19
+ * import.
20
+ *
21
+ * Deleting a company unlinks every contact that names it before the company
22
+ * goes: the id leaves each contact's `companyIds` mirror, and every holder's
23
+ * facet that named it is cleared. A facet is the server's to write, so the
24
+ * pass runs in the route rather than in the browser — bounded, and honest
25
+ * past the bound.
26
+ */
27
+ /**
28
+ * How many contacts one delete pass detaches: a batch's worth, one update per
29
+ * contact. A company past this many links is detached in passes and stands
30
+ * until the last one, so no contact is ever left naming a record that is gone.
31
+ */
32
+ export declare const COMPANY_DETACH_LIMIT = 500;
33
+ export interface CompanyDeleteOutcome {
34
+ /** The document is gone. False when a pass detached and more remain. */
35
+ deleted: boolean;
36
+ /** How many contacts this pass unlinked. */
37
+ detached: number;
38
+ /** The pass hit its bound; the company stands until the next delete. */
39
+ moreRemain: boolean;
40
+ }
41
+ export interface CompanyDeleteResponse extends CompanyDeleteOutcome {
42
+ ok: true;
43
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * `crm/company-delete`'s contract (AGL-2804), in one module both halves
18
+ * import.
19
+ *
20
+ * Deleting a company unlinks every contact that names it before the company
21
+ * goes: the id leaves each contact's `companyIds` mirror, and every holder's
22
+ * facet that named it is cleared. A facet is the server's to write, so the
23
+ * pass runs in the route rather than in the browser — bounded, and honest
24
+ * past the bound.
25
+ */ /**
26
+ * How many contacts one delete pass detaches: a batch's worth, one update per
27
+ * contact. A company past this many links is detached in passes and stands
28
+ * until the last one, so no contact is ever left naming a record that is gone.
29
+ */ export const COMPANY_DETACH_LIMIT = 500;
30
+
31
+ //# sourceMappingURL=company-delete-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/company-delete-route.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * `crm/company-delete`'s contract (AGL-2804), in one module both halves\n * import.\n *\n * Deleting a company unlinks every contact that names it before the company\n * goes: the id leaves each contact's `companyIds` mirror, and every holder's\n * facet that named it is cleared. A facet is the server's to write, so the\n * pass runs in the route rather than in the browser — bounded, and honest\n * past the bound.\n */\n\n/**\n * How many contacts one delete pass detaches: a batch's worth, one update per\n * contact. A company past this many links is detached in passes and stands\n * until the last one, so no contact is ever left naming a record that is gone.\n */\nexport const COMPANY_DETACH_LIMIT = 500\n\nexport interface CompanyDeleteOutcome {\n /** The document is gone. False when a pass detached and more remain. */\n deleted: boolean\n /** How many contacts this pass unlinked. */\n detached: number\n /** The pass hit its bound; the company stands until the next delete. */\n moreRemain: boolean\n}\n\nexport interface CompanyDeleteResponse extends CompanyDeleteOutcome {\n ok: true\n}\n"],"names":["COMPANY_DETACH_LIMIT"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;CASC,GAED;;;;CAIC,GACD,OAAO,MAAMA,uBAAuB,IAAG"}