@aglyn/plugins-crm 1.0.0-beta.218 → 1.0.0-beta.219

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 (249) hide show
  1. package/package.json +14 -13
  2. package/src/index.d.ts +1 -0
  3. package/src/index.js.map +1 -1
  4. package/src/lib/components/companies-bulk-bar.js +12 -4
  5. package/src/lib/components/companies-bulk-bar.js.map +1 -1
  6. package/src/lib/components/company-detail-page.js +11 -0
  7. package/src/lib/components/company-detail-page.js.map +1 -1
  8. package/src/lib/components/company-edit-drawer.js +12 -2
  9. package/src/lib/components/company-edit-drawer.js.map +1 -1
  10. package/src/lib/components/company-import-drawer.d.ts +1 -1
  11. package/src/lib/components/company-picker.js +10 -3
  12. package/src/lib/components/company-picker.js.map +1 -1
  13. package/src/lib/components/contact-detail-page.d.ts +4 -4
  14. package/src/lib/components/contact-detail-page.js +50 -53
  15. package/src/lib/components/contact-detail-page.js.map +1 -1
  16. package/src/lib/components/contact-list-columns.d.ts +3 -0
  17. package/src/lib/components/contact-list-columns.js +21 -5
  18. package/src/lib/components/contact-list-columns.js.map +1 -1
  19. package/src/lib/components/contact-merge-dialog.js +2 -1
  20. package/src/lib/components/contact-merge-dialog.js.map +1 -1
  21. package/src/lib/components/contact-timeline-card.js +4 -3
  22. package/src/lib/components/contact-timeline-card.js.map +1 -1
  23. package/src/lib/components/contacts-bulk-bar.d.ts +3 -3
  24. package/src/lib/components/contacts-bulk-bar.js +24 -51
  25. package/src/lib/components/contacts-bulk-bar.js.map +1 -1
  26. package/src/lib/components/contacts-section.js +9 -3
  27. package/src/lib/components/contacts-section.js.map +1 -1
  28. package/src/lib/components/crm-export-all-button.d.ts +1 -1
  29. package/src/lib/components/crm-export-all-button.js.map +1 -1
  30. package/src/lib/components/crm-send-email-dialog.js +9 -6
  31. package/src/lib/components/crm-send-email-dialog.js.map +1 -1
  32. package/src/lib/components/csv-import-drawer.js +2 -2
  33. package/src/lib/components/csv-import-drawer.js.map +1 -1
  34. package/src/lib/components/deal-detail-page.js +18 -2
  35. package/src/lib/components/deal-detail-page.js.map +1 -1
  36. package/src/lib/components/deal-edit-drawer.js +10 -0
  37. package/src/lib/components/deal-edit-drawer.js.map +1 -1
  38. package/src/lib/components/deals-bulk-bar.js +13 -5
  39. package/src/lib/components/deals-bulk-bar.js.map +1 -1
  40. package/src/lib/components/lead-campaigns-card.js +6 -0
  41. package/src/lib/components/lead-campaigns-card.js.map +1 -1
  42. package/src/lib/components/lead-detail-page.js +25 -5
  43. package/src/lib/components/lead-detail-page.js.map +1 -1
  44. package/src/lib/components/lead-properties-card.js +6 -0
  45. package/src/lib/components/lead-properties-card.js.map +1 -1
  46. package/src/lib/components/lead-surfaces-note.js +4 -5
  47. package/src/lib/components/lead-surfaces-note.js.map +1 -1
  48. package/src/lib/components/lead-unqualify-dialog.js +6 -0
  49. package/src/lib/components/lead-unqualify-dialog.js.map +1 -1
  50. package/src/lib/components/leads-bulk-bar.js +28 -3
  51. package/src/lib/components/leads-bulk-bar.js.map +1 -1
  52. package/src/lib/components/leads-section.js +36 -7
  53. package/src/lib/components/leads-section.js.map +1 -1
  54. package/src/lib/components/org-lead-surfaces-note.js +6 -2
  55. package/src/lib/components/org-lead-surfaces-note.js.map +1 -1
  56. package/src/lib/components/recipes-card.js +9 -4
  57. package/src/lib/components/recipes-card.js.map +1 -1
  58. package/src/lib/components/record-sharing-card.d.ts +57 -0
  59. package/src/lib/components/record-sharing-card.js +244 -0
  60. package/src/lib/components/record-sharing-card.js.map +1 -0
  61. package/src/lib/components/settings-section.js +7 -0
  62. package/src/lib/components/settings-section.js.map +1 -1
  63. package/src/lib/components/share-records-dialog.d.ts +28 -0
  64. package/src/lib/components/share-records-dialog.js +184 -0
  65. package/src/lib/components/share-records-dialog.js.map +1 -0
  66. package/src/lib/components/sharing-rule-drawer.d.ts +37 -0
  67. package/src/lib/components/sharing-rule-drawer.js +374 -0
  68. package/src/lib/components/sharing-rule-drawer.js.map +1 -0
  69. package/src/lib/components/sharing-rules-card.d.ts +24 -0
  70. package/src/lib/components/sharing-rules-card.js +287 -0
  71. package/src/lib/components/sharing-rules-card.js.map +1 -0
  72. package/src/lib/components/use-crm-api.d.ts +1 -1
  73. package/src/lib/components/use-crm-api.js.map +1 -1
  74. package/src/lib/components/use-site-route-context.d.ts +25 -0
  75. package/src/lib/components/use-site-route-context.js +58 -0
  76. package/src/lib/components/use-site-route-context.js.map +1 -0
  77. package/src/lib/constants/api-routes.d.ts +31 -0
  78. package/src/lib/constants/api-routes.js +27 -1
  79. package/src/lib/constants/api-routes.js.map +1 -1
  80. package/src/lib/declarations.console-server.d.ts +37 -0
  81. package/src/lib/declarations.console-server.js +103 -0
  82. package/src/lib/declarations.console-server.js.map +1 -0
  83. package/src/lib/declarations.server.d.ts +6 -0
  84. package/src/lib/declarations.server.js +33 -0
  85. package/src/lib/declarations.server.js.map +1 -1
  86. package/src/lib/hooks/use-contact-remove.d.ts +35 -0
  87. package/src/lib/hooks/use-contact-remove.js +77 -0
  88. package/src/lib/hooks/use-contact-remove.js.map +1 -0
  89. package/src/lib/hooks/use-crm-sharing.d.ts +30 -0
  90. package/src/lib/hooks/use-crm-sharing.js +109 -0
  91. package/src/lib/hooks/use-crm-sharing.js.map +1 -0
  92. package/src/lib/model/companies-csv.d.ts +1 -1
  93. package/src/lib/model/companies-csv.js +2 -2
  94. package/src/lib/model/companies-csv.js.map +1 -1
  95. package/src/lib/model/contact-holder.d.ts +68 -0
  96. package/src/lib/model/contact-holder.js +129 -0
  97. package/src/lib/model/contact-holder.js.map +1 -0
  98. package/src/lib/model/contact-interaction-links.d.ts +46 -0
  99. package/src/lib/model/contact-interaction-links.js +65 -0
  100. package/src/lib/model/contact-interaction-links.js.map +1 -0
  101. package/src/lib/model/contact-merge.d.ts +136 -0
  102. package/src/lib/model/contact-merge.js +412 -0
  103. package/src/lib/model/contact-merge.js.map +1 -0
  104. package/src/lib/model/contact-record.d.ts +7 -1
  105. package/src/lib/model/contact-record.js +6 -5
  106. package/src/lib/model/contact-record.js.map +1 -1
  107. package/src/lib/model/contact-remove.d.ts +48 -0
  108. package/src/lib/model/contact-remove.js +22 -0
  109. package/src/lib/model/contact-remove.js.map +1 -0
  110. package/src/lib/model/contacts-bulk-writes.d.ts +2 -71
  111. package/src/lib/model/contacts-bulk-writes.js +2 -82
  112. package/src/lib/model/contacts-bulk-writes.js.map +1 -1
  113. package/src/lib/model/contacts-csv.d.ts +2 -2
  114. package/src/lib/model/contacts-csv.js +2 -2
  115. package/src/lib/model/contacts-csv.js.map +1 -1
  116. package/src/lib/model/crm-csv.d.ts +239 -0
  117. package/src/lib/model/crm-csv.js +467 -0
  118. package/src/lib/model/crm-csv.js.map +1 -0
  119. package/src/lib/model/crm-digest.d.ts +185 -0
  120. package/src/lib/model/crm-digest.js +272 -0
  121. package/src/lib/model/crm-digest.js.map +1 -0
  122. package/src/lib/model/crm-import.d.ts +7 -1
  123. package/src/lib/model/crm-import.js +2 -1
  124. package/src/lib/model/crm-import.js.map +1 -1
  125. package/src/lib/model/crm-record-routes.d.ts +5 -0
  126. package/src/lib/model/crm-record-routes.js +7 -0
  127. package/src/lib/model/crm-record-routes.js.map +1 -1
  128. package/src/lib/model/crm-routes.d.ts +6 -5
  129. package/src/lib/model/crm-routes.js +7 -7
  130. package/src/lib/model/crm-routes.js.map +1 -1
  131. package/src/lib/model/crm-search-sources.d.ts +15 -0
  132. package/src/lib/model/crm-search-sources.js +162 -0
  133. package/src/lib/model/crm-search-sources.js.map +1 -0
  134. package/src/lib/model/crm-sharing-api.d.ts +32 -0
  135. package/src/lib/model/crm-sharing-api.js +59 -0
  136. package/src/lib/model/crm-sharing-api.js.map +1 -0
  137. package/src/lib/model/crm-sharing.d.ts +333 -0
  138. package/src/lib/model/crm-sharing.js +603 -0
  139. package/src/lib/model/crm-sharing.js.map +1 -0
  140. package/src/lib/model/deals-csv.d.ts +1 -1
  141. package/src/lib/model/deals-csv.js +4 -5
  142. package/src/lib/model/deals-csv.js.map +1 -1
  143. package/src/lib/model/lead-filters.d.ts +1 -1
  144. package/src/lib/model/leads-csv.d.ts +1 -1
  145. package/src/lib/model/leads-csv.js +1 -1
  146. package/src/lib/model/leads-csv.js.map +1 -1
  147. package/src/lib/model/tasks-csv.d.ts +1 -1
  148. package/src/lib/model/tasks-csv.js +1 -1
  149. package/src/lib/model/tasks-csv.js.map +1 -1
  150. package/src/lib/plan-entitlements.d.ts +75 -0
  151. package/src/lib/plan-entitlements.js +56 -0
  152. package/src/lib/plan-entitlements.js.map +1 -0
  153. package/src/lib/plugin.js +3 -0
  154. package/src/lib/plugin.js.map +1 -1
  155. package/src/lib/server/api-v1/contacts-merge.d.ts +20 -0
  156. package/src/lib/server/api-v1/contacts-merge.js +120 -0
  157. package/src/lib/server/api-v1/contacts-merge.js.map +1 -0
  158. package/src/lib/server/api-v1/contacts.d.ts +18 -0
  159. package/src/lib/server/api-v1/contacts.js +1076 -0
  160. package/src/lib/server/api-v1/contacts.js.map +1 -0
  161. package/src/lib/server/api-v1/crm-activities.d.ts +18 -0
  162. package/src/lib/server/api-v1/crm-activities.js +269 -0
  163. package/src/lib/server/api-v1/crm-activities.js.map +1 -0
  164. package/src/lib/server/api-v1/crm-companies.d.ts +18 -0
  165. package/src/lib/server/api-v1/crm-companies.js +391 -0
  166. package/src/lib/server/api-v1/crm-companies.js.map +1 -0
  167. package/src/lib/server/api-v1/crm-deals.d.ts +18 -0
  168. package/src/lib/server/api-v1/crm-deals.js +631 -0
  169. package/src/lib/server/api-v1/crm-deals.js.map +1 -0
  170. package/src/lib/server/api-v1/crm-email-templates.d.ts +18 -0
  171. package/src/lib/server/api-v1/crm-email-templates.js +336 -0
  172. package/src/lib/server/api-v1/crm-email-templates.js.map +1 -0
  173. package/src/lib/server/api-v1/crm-leads.d.ts +18 -0
  174. package/src/lib/server/api-v1/crm-leads.js +832 -0
  175. package/src/lib/server/api-v1/crm-leads.js.map +1 -0
  176. package/src/lib/server/api-v1/crm-pipelines.d.ts +76 -0
  177. package/src/lib/server/api-v1/crm-pipelines.js +146 -0
  178. package/src/lib/server/api-v1/crm-pipelines.js.map +1 -0
  179. package/src/lib/server/api-v1/crm-shared.d.ts +271 -0
  180. package/src/lib/server/api-v1/crm-shared.js +436 -0
  181. package/src/lib/server/api-v1/crm-shared.js.map +1 -0
  182. package/src/lib/server/api-v1/crm-tasks.d.ts +18 -0
  183. package/src/lib/server/api-v1/crm-tasks.js +398 -0
  184. package/src/lib/server/api-v1/crm-tasks.js.map +1 -0
  185. package/src/lib/server/api-v1/openapi.d.ts +29 -0
  186. package/src/lib/server/api-v1/openapi.js +985 -0
  187. package/src/lib/server/api-v1/openapi.js.map +1 -0
  188. package/src/lib/server/api-v1/usage.d.ts +26 -0
  189. package/src/lib/server/api-v1/usage.js +73 -0
  190. package/src/lib/server/api-v1/usage.js.map +1 -0
  191. package/src/lib/server/consent-group-participant.js +1 -1
  192. package/src/lib/server/consent-group-participant.js.map +1 -1
  193. package/src/lib/server/contact-lifecycle-floor.d.ts +89 -0
  194. package/src/lib/server/contact-lifecycle-floor.js +91 -0
  195. package/src/lib/server/contact-lifecycle-floor.js.map +1 -0
  196. package/src/lib/server/contact-remove.d.ts +75 -0
  197. package/src/lib/server/contact-remove.js +244 -0
  198. package/src/lib/server/contact-remove.js.map +1 -0
  199. package/src/lib/server/contact-update.js +2 -1
  200. package/src/lib/server/contact-update.js.map +1 -1
  201. package/src/lib/server/contacts-import.d.ts +47 -11
  202. package/src/lib/server/contacts-import.js +171 -71
  203. package/src/lib/server/contacts-import.js.map +1 -1
  204. package/src/lib/server/contacts-merge.d.ts +1 -1
  205. package/src/lib/server/contacts-merge.js +3 -2
  206. package/src/lib/server/contacts-merge.js.map +1 -1
  207. package/src/lib/server/convert-host-lead.d.ts +189 -0
  208. package/src/lib/server/convert-host-lead.js +518 -0
  209. package/src/lib/server/convert-host-lead.js.map +1 -0
  210. package/src/lib/server/crm-sharing.d.ts +108 -0
  211. package/src/lib/server/crm-sharing.js +790 -0
  212. package/src/lib/server/crm-sharing.js.map +1 -0
  213. package/src/lib/server/daily-digest-route.d.ts +107 -0
  214. package/src/lib/server/daily-digest-route.js +588 -0
  215. package/src/lib/server/daily-digest-route.js.map +1 -0
  216. package/src/lib/server/export-route.d.ts +60 -0
  217. package/src/lib/server/export-route.js +447 -0
  218. package/src/lib/server/export-route.js.map +1 -0
  219. package/src/lib/server/inbound-route.d.ts +74 -0
  220. package/src/lib/server/inbound-route.js +257 -0
  221. package/src/lib/server/inbound-route.js.map +1 -0
  222. package/src/lib/server/lead-convert.d.ts +1 -1
  223. package/src/lib/server/lead-convert.js +2 -2
  224. package/src/lib/server/lead-convert.js.map +1 -1
  225. package/src/lib/server/merge-contacts.d.ts +55 -0
  226. package/src/lib/server/merge-contacts.js +274 -0
  227. package/src/lib/server/merge-contacts.js.map +1 -0
  228. package/src/lib/server/pipeline-record-index.d.ts +36 -0
  229. package/src/lib/server/pipeline-record-index.js +87 -0
  230. package/src/lib/server/pipeline-record-index.js.map +1 -0
  231. package/src/lib/server/record-facts.js +2 -1
  232. package/src/lib/server/record-facts.js.map +1 -1
  233. package/src/lib/server/task-reminders-route.d.ts +82 -0
  234. package/src/lib/server/task-reminders-route.js +497 -0
  235. package/src/lib/server/task-reminders-route.js.map +1 -0
  236. package/src/lib/server-deal-stage.js +2 -1
  237. package/src/lib/server-deal-stage.js.map +1 -1
  238. package/src/lib/server.d.ts +5 -2
  239. package/src/lib/server.js +47 -2
  240. package/src/lib/server.js.map +1 -1
  241. package/src/lib/testing/stand-in-site-record-routes.d.ts +26 -0
  242. package/src/lib/testing/stand-in-site-record-routes.js +55 -0
  243. package/src/lib/testing/stand-in-site-record-routes.js.map +1 -0
  244. package/src/lib/usage-axes.d.ts +35 -0
  245. package/src/lib/usage-axes.js +68 -0
  246. package/src/lib/usage-axes.js.map +1 -0
  247. package/src/lib/components/use-emails-hub-path.d.ts +0 -24
  248. package/src/lib/components/use-emails-hub-path.js +0 -59
  249. package/src/lib/components/use-emails-hub-path.js.map +0 -1
@@ -0,0 +1,35 @@
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 { PluginUsageAxesDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-usage-axes';
18
+ /**
19
+ * THE CRM'S METER (AGL-3080): the records band — contacts, companies and
20
+ * deals, counted together — in the platform's cost model and utilization
21
+ * table. Compiled into core by the manifest generator (`register.usageAxes`).
22
+ *
23
+ * Priced at `perContactMonth`. The rate was measured on a contact, the most
24
+ * expensive of the three to hold, so it over-covers a company or a deal
25
+ * rather than under-pricing one. `crmRecordsCount` REPLACES `contactsCount`
26
+ * when a rollup carries it — the contacts are inside the sum, and pricing
27
+ * both would charge the same people twice — and `contactsCount` alone is
28
+ * read only on a month written before the band was widened (AGL-2611). The
29
+ * two components are recorded so the sum stays legible.
30
+ *
31
+ * The band is org-wide despite the entitlement's name: the records gate
32
+ * compares `contactsPerHost` against an org-wide headcount, and the tier
33
+ * model costs it unexpanded.
34
+ */
35
+ export declare function crmUsageAxes(): PluginUsageAxesDeclaration;
@@ -0,0 +1,68 @@
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 CRM'S METER (AGL-3080): the records band — contacts, companies and
18
+ * deals, counted together — in the platform's cost model and utilization
19
+ * table. Compiled into core by the manifest generator (`register.usageAxes`).
20
+ *
21
+ * Priced at `perContactMonth`. The rate was measured on a contact, the most
22
+ * expensive of the three to hold, so it over-covers a company or a deal
23
+ * rather than under-pricing one. `crmRecordsCount` REPLACES `contactsCount`
24
+ * when a rollup carries it — the contacts are inside the sum, and pricing
25
+ * both would charge the same people twice — and `contactsCount` alone is
26
+ * read only on a month written before the band was widened (AGL-2611). The
27
+ * two components are recorded so the sum stays legible.
28
+ *
29
+ * The band is org-wide despite the entitlement's name: the records gate
30
+ * compares `contactsPerHost` against an org-wide headcount, and the tier
31
+ * model costs it unexpanded.
32
+ */ export function crmUsageAxes() {
33
+ return {
34
+ costAxes: [
35
+ {
36
+ id: 'contacts',
37
+ order: 60,
38
+ fields: [
39
+ 'crmRecordsCount'
40
+ ],
41
+ fallbackFields: [
42
+ 'contactsCount'
43
+ ],
44
+ recordedFields: [
45
+ 'companiesCount',
46
+ 'dealsCount'
47
+ ],
48
+ rate: 'perContactMonth'
49
+ }
50
+ ],
51
+ bands: [
52
+ {
53
+ id: 'contactsCount',
54
+ label: 'CRM records',
55
+ order: 70,
56
+ fields: [
57
+ 'crmRecordsCount'
58
+ ],
59
+ fallbackFields: [
60
+ 'contactsCount'
61
+ ],
62
+ entitlement: 'contactsPerHost'
63
+ }
64
+ ]
65
+ };
66
+ }
67
+
68
+ //# sourceMappingURL=usage-axes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/plugins/crm/src/lib/usage-axes.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\nimport type { PluginUsageAxesDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-usage-axes'\n\n/**\n * THE CRM'S METER (AGL-3080): the records band — contacts, companies and\n * deals, counted together — in the platform's cost model and utilization\n * table. Compiled into core by the manifest generator (`register.usageAxes`).\n *\n * Priced at `perContactMonth`. The rate was measured on a contact, the most\n * expensive of the three to hold, so it over-covers a company or a deal\n * rather than under-pricing one. `crmRecordsCount` REPLACES `contactsCount`\n * when a rollup carries it — the contacts are inside the sum, and pricing\n * both would charge the same people twice — and `contactsCount` alone is\n * read only on a month written before the band was widened (AGL-2611). The\n * two components are recorded so the sum stays legible.\n *\n * The band is org-wide despite the entitlement's name: the records gate\n * compares `contactsPerHost` against an org-wide headcount, and the tier\n * model costs it unexpanded.\n */\nexport function crmUsageAxes(): PluginUsageAxesDeclaration {\n return {\n costAxes: [\n {\n id: 'contacts',\n order: 60,\n fields: ['crmRecordsCount'],\n fallbackFields: ['contactsCount'],\n recordedFields: ['companiesCount', 'dealsCount'],\n rate: 'perContactMonth',\n },\n ],\n bands: [\n {\n id: 'contactsCount',\n label: 'CRM records',\n order: 70,\n fields: ['crmRecordsCount'],\n fallbackFields: ['contactsCount'],\n entitlement: 'contactsPerHost',\n },\n ],\n }\n}\n"],"names":["crmUsageAxes","costAxes","id","order","fields","fallbackFields","recordedFields","rate","bands","label","entitlement"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAID;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASA;IACd,OAAO;QACLC,UAAU;YACR;gBACEC,IAAI;gBACJC,OAAO;gBACPC,QAAQ;oBAAC;iBAAkB;gBAC3BC,gBAAgB;oBAAC;iBAAgB;gBACjCC,gBAAgB;oBAAC;oBAAkB;iBAAa;gBAChDC,MAAM;YACR;SACD;QACDC,OAAO;YACL;gBACEN,IAAI;gBACJO,OAAO;gBACPN,OAAO;gBACPC,QAAQ;oBAAC;iBAAkB;gBAC3BC,gBAAgB;oBAAC;iBAAgB;gBACjCK,aAAa;YACf;SACD;IACH;AACF"}
@@ -1,24 +0,0 @@
1
- /**
2
- * The Emails hub of the site this page is on — `/{org}/hosts/{site}/emails`
3
- * — or `null` when the page is not under a site.
4
- *
5
- * The sibling-hub pattern the Emails console uses to reach Marketing, in the
6
- * other direction: a CRM record page links a campaign entry to the email's
7
- * own report, which lives on the Emails surface, and the shell's `basePath`
8
- * names only this surface. Read off the URL rather than derived from
9
- * `basePath`, because the `[host]` segment is the site's subdomain and
10
- * nothing a CRM component holds says what that is.
11
- *
12
- * ⚠️ Under a site, THIS SITE's hub only. A record page under one site cannot
13
- * address a sibling site's Emails console without that site's subdomain,
14
- * which a contact document does not carry.
15
- *
16
- * At the ORGANIZATION level (AGL-2634) the URL names no site, and the mount
17
- * holds the org's site list instead: handed a `hostId`, this answers that
18
- * site's hub — `${hostsPath}/${subdomain}/emails` — or `null` for a site
19
- * whose subdomain the list could not answer, which is named and not linked.
20
- * Handed none, `null`: an org-level page has no hub of its own to fall
21
- * back to.
22
- */
23
- export declare function useEmailsHubPath(hostId?: string | null): string | null;
24
- export default useEmailsHubPath;
@@ -1,59 +0,0 @@
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
- */ 'use client';
17
- import { buildRoute, Route } from "@aglyn/aglyn";
18
- import { useParams } from "next/navigation";
19
- import { useCrmOrgMount } from "../hooks/use-crm-org-mount.js";
20
- /**
21
- * The Emails hub of the site this page is on — `/{org}/hosts/{site}/emails`
22
- * — or `null` when the page is not under a site.
23
- *
24
- * The sibling-hub pattern the Emails console uses to reach Marketing, in the
25
- * other direction: a CRM record page links a campaign entry to the email's
26
- * own report, which lives on the Emails surface, and the shell's `basePath`
27
- * names only this surface. Read off the URL rather than derived from
28
- * `basePath`, because the `[host]` segment is the site's subdomain and
29
- * nothing a CRM component holds says what that is.
30
- *
31
- * ⚠️ Under a site, THIS SITE's hub only. A record page under one site cannot
32
- * address a sibling site's Emails console without that site's subdomain,
33
- * which a contact document does not carry.
34
- *
35
- * At the ORGANIZATION level (AGL-2634) the URL names no site, and the mount
36
- * holds the org's site list instead: handed a `hostId`, this answers that
37
- * site's hub — `${hostsPath}/${subdomain}/emails` — or `null` for a site
38
- * whose subdomain the list could not answer, which is named and not linked.
39
- * Handed none, `null`: an org-level page has no hub of its own to fall
40
- * back to.
41
- */ export function useEmailsHubPath(hostId) {
42
- const params = useParams();
43
- const mount = useCrmOrgMount();
44
- const orgSlug = params == null ? void 0 : params.orgSlug;
45
- const host = params == null ? void 0 : params.host;
46
- if (orgSlug && host) {
47
- return buildRoute(Route.HOST_PLUGIN, {
48
- orgSlug,
49
- host,
50
- pluginSlug: 'emails'
51
- });
52
- }
53
- if (!mount || !hostId) return null;
54
- const subdomain = mount.siteSubdomain(hostId);
55
- return subdomain ? `${mount.hostsPath}/${encodeURIComponent(subdomain)}/emails` : null;
56
- }
57
- export default useEmailsHubPath;
58
-
59
- //# sourceMappingURL=use-emails-hub-path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/use-emails-hub-path.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'use client'\n\nimport { buildRoute, Route } from '@aglyn/aglyn'\nimport { useParams } from 'next/navigation'\nimport { useCrmOrgMount } from '../hooks/use-crm-org-mount'\n\n/**\n * The Emails hub of the site this page is on — `/{org}/hosts/{site}/emails`\n * — or `null` when the page is not under a site.\n *\n * The sibling-hub pattern the Emails console uses to reach Marketing, in the\n * other direction: a CRM record page links a campaign entry to the email's\n * own report, which lives on the Emails surface, and the shell's `basePath`\n * names only this surface. Read off the URL rather than derived from\n * `basePath`, because the `[host]` segment is the site's subdomain and\n * nothing a CRM component holds says what that is.\n *\n * ⚠️ Under a site, THIS SITE's hub only. A record page under one site cannot\n * address a sibling site's Emails console without that site's subdomain,\n * which a contact document does not carry.\n *\n * At the ORGANIZATION level (AGL-2634) the URL names no site, and the mount\n * holds the org's site list instead: handed a `hostId`, this answers that\n * site's hub — `${hostsPath}/${subdomain}/emails` — or `null` for a site\n * whose subdomain the list could not answer, which is named and not linked.\n * Handed none, `null`: an org-level page has no hub of its own to fall\n * back to.\n */\nexport function useEmailsHubPath(hostId?: string | null): string | null {\n const params = useParams<{ orgSlug: string; host: string }>()\n const mount = useCrmOrgMount()\n const orgSlug = params?.orgSlug\n const host = params?.host\n if (orgSlug && host) {\n return buildRoute(Route.HOST_PLUGIN, { orgSlug, host, pluginSlug: 'emails' })\n }\n if (!mount || !hostId) return null\n const subdomain = mount.siteSubdomain(hostId)\n return subdomain ? `${mount.hostsPath}/${encodeURIComponent(subdomain)}/emails` : null\n}\n\nexport default useEmailsHubPath\n"],"names":["buildRoute","Route","useParams","useCrmOrgMount","useEmailsHubPath","hostId","params","mount","orgSlug","host","HOST_PLUGIN","pluginSlug","subdomain","siteSubdomain","hostsPath","encodeURIComponent"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;AAEA,SAASA,UAAU,EAAEC,KAAK,QAAQ,eAAc;AAChD,SAASC,SAAS,QAAQ,kBAAiB;AAC3C,SAASC,cAAc,QAAQ,gCAA4B;AAE3D;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASC,iBAAiBC,MAAsB;IACrD,MAAMC,SAASJ;IACf,MAAMK,QAAQJ;IACd,MAAMK,UAAUF,0BAAAA,OAAQE,OAAO;IAC/B,MAAMC,OAAOH,0BAAAA,OAAQG,IAAI;IACzB,IAAID,WAAWC,MAAM;QACnB,OAAOT,WAAWC,MAAMS,WAAW,EAAE;YAAEF;YAASC;YAAME,YAAY;QAAS;IAC7E;IACA,IAAI,CAACJ,SAAS,CAACF,QAAQ,OAAO;IAC9B,MAAMO,YAAYL,MAAMM,aAAa,CAACR;IACtC,OAAOO,YAAY,GAAGL,MAAMO,SAAS,CAAC,CAAC,EAAEC,mBAAmBH,WAAW,OAAO,CAAC,GAAG;AACpF;AAEA,eAAeR,iBAAgB"}