@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.
- package/LICENSE +201 -0
- package/README.md +7 -0
- package/package.json +57 -0
- package/src/index.d.ts +21 -0
- package/src/index.js +29 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/activity-list.d.ts +98 -0
- package/src/lib/components/activity-list.js +321 -0
- package/src/lib/components/activity-list.js.map +1 -0
- package/src/lib/components/activity-queries.d.ts +117 -0
- package/src/lib/components/activity-queries.js +198 -0
- package/src/lib/components/activity-queries.js.map +1 -0
- package/src/lib/components/add-to-list-button.d.ts +25 -0
- package/src/lib/components/add-to-list-button.js +64 -0
- package/src/lib/components/add-to-list-button.js.map +1 -0
- package/src/lib/components/add-to-list-dialog.d.ts +24 -0
- package/src/lib/components/add-to-list-dialog.js +327 -0
- package/src/lib/components/add-to-list-dialog.js.map +1 -0
- package/src/lib/components/assignment-rule-drawer.d.ts +43 -0
- package/src/lib/components/assignment-rule-drawer.js +293 -0
- package/src/lib/components/assignment-rule-drawer.js.map +1 -0
- package/src/lib/components/companies-bulk-bar.d.ts +29 -0
- package/src/lib/components/companies-bulk-bar.js +274 -0
- package/src/lib/components/companies-bulk-bar.js.map +1 -0
- package/src/lib/components/companies-section.d.ts +54 -0
- package/src/lib/components/companies-section.js +522 -0
- package/src/lib/components/companies-section.js.map +1 -0
- package/src/lib/components/company-contacts-card.d.ts +49 -0
- package/src/lib/components/company-contacts-card.js +435 -0
- package/src/lib/components/company-contacts-card.js.map +1 -0
- package/src/lib/components/company-deals-card.d.ts +20 -0
- package/src/lib/components/company-deals-card.js +38 -0
- package/src/lib/components/company-deals-card.js.map +1 -0
- package/src/lib/components/company-detail-page.d.ts +20 -0
- package/src/lib/components/company-detail-page.js +165 -0
- package/src/lib/components/company-detail-page.js.map +1 -0
- package/src/lib/components/company-edit-drawer.d.ts +65 -0
- package/src/lib/components/company-edit-drawer.js +433 -0
- package/src/lib/components/company-edit-drawer.js.map +1 -0
- package/src/lib/components/company-import-drawer.d.ts +42 -0
- package/src/lib/components/company-import-drawer.js +99 -0
- package/src/lib/components/company-import-drawer.js.map +1 -0
- package/src/lib/components/company-picker.d.ts +127 -0
- package/src/lib/components/company-picker.js +323 -0
- package/src/lib/components/company-picker.js.map +1 -0
- package/src/lib/components/company-properties-card.d.ts +47 -0
- package/src/lib/components/company-properties-card.js +289 -0
- package/src/lib/components/company-properties-card.js.map +1 -0
- package/src/lib/components/contact-address-fields.d.ts +29 -0
- package/src/lib/components/contact-address-fields.js +149 -0
- package/src/lib/components/contact-address-fields.js.map +1 -0
- package/src/lib/components/contact-associations-card.d.ts +72 -0
- package/src/lib/components/contact-associations-card.js +296 -0
- package/src/lib/components/contact-associations-card.js.map +1 -0
- package/src/lib/components/contact-custom-columns.d.ts +38 -0
- package/src/lib/components/contact-custom-columns.js +102 -0
- package/src/lib/components/contact-custom-columns.js.map +1 -0
- package/src/lib/components/contact-custom-fields-card.d.ts +39 -0
- package/src/lib/components/contact-custom-fields-card.js +204 -0
- package/src/lib/components/contact-custom-fields-card.js.map +1 -0
- package/src/lib/components/contact-deals-card.d.ts +20 -0
- package/src/lib/components/contact-deals-card.js +38 -0
- package/src/lib/components/contact-deals-card.js.map +1 -0
- package/src/lib/components/contact-detail-page.d.ts +46 -0
- package/src/lib/components/contact-detail-page.js +535 -0
- package/src/lib/components/contact-detail-page.js.map +1 -0
- package/src/lib/components/contact-duplicates-card.d.ts +42 -0
- package/src/lib/components/contact-duplicates-card.js +167 -0
- package/src/lib/components/contact-duplicates-card.js.map +1 -0
- package/src/lib/components/contact-field-drawer.d.ts +64 -0
- package/src/lib/components/contact-field-drawer.js +251 -0
- package/src/lib/components/contact-field-drawer.js.map +1 -0
- package/src/lib/components/contact-import-drawer.d.ts +46 -0
- package/src/lib/components/contact-import-drawer.js +149 -0
- package/src/lib/components/contact-import-drawer.js.map +1 -0
- package/src/lib/components/contact-known-by-card.d.ts +39 -0
- package/src/lib/components/contact-known-by-card.js +142 -0
- package/src/lib/components/contact-known-by-card.js.map +1 -0
- package/src/lib/components/contact-list-columns.d.ts +53 -0
- package/src/lib/components/contact-list-columns.js +288 -0
- package/src/lib/components/contact-list-columns.js.map +1 -0
- package/src/lib/components/contact-merge-dialog.d.ts +79 -0
- package/src/lib/components/contact-merge-dialog.js +405 -0
- package/src/lib/components/contact-merge-dialog.js.map +1 -0
- package/src/lib/components/contact-properties-card.d.ts +89 -0
- package/src/lib/components/contact-properties-card.js +492 -0
- package/src/lib/components/contact-properties-card.js.map +1 -0
- package/src/lib/components/contact-timeline-card.d.ts +68 -0
- package/src/lib/components/contact-timeline-card.js +435 -0
- package/src/lib/components/contact-timeline-card.js.map +1 -0
- package/src/lib/components/contacts-bulk-bar.d.ts +91 -0
- package/src/lib/components/contacts-bulk-bar.js +493 -0
- package/src/lib/components/contacts-bulk-bar.js.map +1 -0
- package/src/lib/components/contacts-section.d.ts +26 -0
- package/src/lib/components/contacts-section.js +1025 -0
- package/src/lib/components/contacts-section.js.map +1 -0
- package/src/lib/components/copy-capture-address-button.d.ts +33 -0
- package/src/lib/components/copy-capture-address-button.js +60 -0
- package/src/lib/components/copy-capture-address-button.js.map +1 -0
- package/src/lib/components/crm-attribution-zone.d.ts +38 -0
- package/src/lib/components/crm-attribution-zone.js +36 -0
- package/src/lib/components/crm-attribution-zone.js.map +1 -0
- package/src/lib/components/crm-booking-zone.d.ts +61 -0
- package/src/lib/components/crm-booking-zone.js +50 -0
- package/src/lib/components/crm-booking-zone.js.map +1 -0
- package/src/lib/components/crm-bulk-bar-frame.d.ts +47 -0
- package/src/lib/components/crm-bulk-bar-frame.js +137 -0
- package/src/lib/components/crm-bulk-bar-frame.js.map +1 -0
- package/src/lib/components/crm-call-actions.d.ts +65 -0
- package/src/lib/components/crm-call-actions.js +110 -0
- package/src/lib/components/crm-call-actions.js.map +1 -0
- package/src/lib/components/crm-column-menu.d.ts +21 -0
- package/src/lib/components/crm-column-menu.js +103 -0
- package/src/lib/components/crm-column-menu.js.map +1 -0
- package/src/lib/components/crm-console-page.d.ts +19 -0
- package/src/lib/components/crm-console-page.js +151 -0
- package/src/lib/components/crm-console-page.js.map +1 -0
- package/src/lib/components/crm-console-sections.d.ts +52 -0
- package/src/lib/components/crm-console-sections.js +83 -0
- package/src/lib/components/crm-console-sections.js.map +1 -0
- package/src/lib/components/crm-custom-field-control.d.ts +26 -0
- package/src/lib/components/crm-custom-field-control.js +131 -0
- package/src/lib/components/crm-custom-field-control.js.map +1 -0
- package/src/lib/components/crm-email-template-tools.d.ts +69 -0
- package/src/lib/components/crm-email-template-tools.js +240 -0
- package/src/lib/components/crm-email-template-tools.js.map +1 -0
- package/src/lib/components/crm-export-all-button.d.ts +39 -0
- package/src/lib/components/crm-export-all-button.js +98 -0
- package/src/lib/components/crm-export-all-button.js.map +1 -0
- package/src/lib/components/crm-filter-bar.d.ts +53 -0
- package/src/lib/components/crm-filter-bar.js +294 -0
- package/src/lib/components/crm-filter-bar.js.map +1 -0
- package/src/lib/components/crm-glance-card.d.ts +54 -0
- package/src/lib/components/crm-glance-card.js +219 -0
- package/src/lib/components/crm-glance-card.js.map +1 -0
- package/src/lib/components/crm-next-activity-column.d.ts +35 -0
- package/src/lib/components/crm-next-activity-column.js +100 -0
- package/src/lib/components/crm-next-activity-column.js.map +1 -0
- package/src/lib/components/crm-record-header.d.ts +97 -0
- package/src/lib/components/crm-record-header.js +160 -0
- package/src/lib/components/crm-record-header.js.map +1 -0
- package/src/lib/components/crm-record-insights-zone.d.ts +50 -0
- package/src/lib/components/crm-record-insights-zone.js +169 -0
- package/src/lib/components/crm-record-insights-zone.js.map +1 -0
- package/src/lib/components/crm-record-picker.d.ts +42 -0
- package/src/lib/components/crm-record-picker.js +104 -0
- package/src/lib/components/crm-record-picker.js.map +1 -0
- package/src/lib/components/crm-send-email-button.d.ts +39 -0
- package/src/lib/components/crm-send-email-button.js +81 -0
- package/src/lib/components/crm-send-email-button.js.map +1 -0
- package/src/lib/components/crm-send-email-dialog.d.ts +61 -0
- package/src/lib/components/crm-send-email-dialog.js +851 -0
- package/src/lib/components/crm-send-email-dialog.js.map +1 -0
- package/src/lib/components/crm-site-picker.d.ts +61 -0
- package/src/lib/components/crm-site-picker.js +99 -0
- package/src/lib/components/crm-site-picker.js.map +1 -0
- package/src/lib/components/crm-suite-lock.d.ts +29 -0
- package/src/lib/components/crm-suite-lock.js +114 -0
- package/src/lib/components/crm-suite-lock.js.map +1 -0
- package/src/lib/components/crm-tasks-due-card.d.ts +42 -0
- package/src/lib/components/crm-tasks-due-card.js +225 -0
- package/src/lib/components/crm-tasks-due-card.js.map +1 -0
- package/src/lib/components/crm-views-control.d.ts +65 -0
- package/src/lib/components/crm-views-control.js +518 -0
- package/src/lib/components/crm-views-control.js.map +1 -0
- package/src/lib/components/csv-import-drawer.d.ts +132 -0
- package/src/lib/components/csv-import-drawer.js +746 -0
- package/src/lib/components/csv-import-drawer.js.map +1 -0
- package/src/lib/components/deal-board.d.ts +70 -0
- package/src/lib/components/deal-board.js +478 -0
- package/src/lib/components/deal-board.js.map +1 -0
- package/src/lib/components/deal-detail-page.d.ts +18 -0
- package/src/lib/components/deal-detail-page.js +323 -0
- package/src/lib/components/deal-detail-page.js.map +1 -0
- package/src/lib/components/deal-edit-drawer.d.ts +59 -0
- package/src/lib/components/deal-edit-drawer.js +640 -0
- package/src/lib/components/deal-edit-drawer.js.map +1 -0
- package/src/lib/components/deal-import-drawer.d.ts +24 -0
- package/src/lib/components/deal-import-drawer.js +83 -0
- package/src/lib/components/deal-import-drawer.js.map +1 -0
- package/src/lib/components/deal-products-card.d.ts +48 -0
- package/src/lib/components/deal-products-card.js +614 -0
- package/src/lib/components/deal-products-card.js.map +1 -0
- package/src/lib/components/deal-properties-card.d.ts +29 -0
- package/src/lib/components/deal-properties-card.js +144 -0
- package/src/lib/components/deal-properties-card.js.map +1 -0
- package/src/lib/components/deal-stage-card.d.ts +24 -0
- package/src/lib/components/deal-stage-card.js +199 -0
- package/src/lib/components/deal-stage-card.js.map +1 -0
- package/src/lib/components/deals-bulk-bar.d.ts +31 -0
- package/src/lib/components/deals-bulk-bar.js +340 -0
- package/src/lib/components/deals-bulk-bar.js.map +1 -0
- package/src/lib/components/deals-section.d.ts +49 -0
- package/src/lib/components/deals-section.js +767 -0
- package/src/lib/components/deals-section.js.map +1 -0
- package/src/lib/components/email-capture-card.d.ts +42 -0
- package/src/lib/components/email-capture-card.js +134 -0
- package/src/lib/components/email-capture-card.js.map +1 -0
- package/src/lib/components/email-template-drawer.d.ts +33 -0
- package/src/lib/components/email-template-drawer.js +209 -0
- package/src/lib/components/email-template-drawer.js.map +1 -0
- package/src/lib/components/email-templates-card.d.ts +33 -0
- package/src/lib/components/email-templates-card.js +370 -0
- package/src/lib/components/email-templates-card.js.map +1 -0
- package/src/lib/components/erase-person-action.d.ts +92 -0
- package/src/lib/components/erase-person-action.js +261 -0
- package/src/lib/components/erase-person-action.js.map +1 -0
- package/src/lib/components/fields-section.d.ts +37 -0
- package/src/lib/components/fields-section.js +641 -0
- package/src/lib/components/fields-section.js.map +1 -0
- package/src/lib/components/form-contact-fields-card.d.ts +46 -0
- package/src/lib/components/form-contact-fields-card.js +253 -0
- package/src/lib/components/form-contact-fields-card.js.map +1 -0
- package/src/lib/components/insert-link-at-caret.d.ts +28 -0
- package/src/lib/components/insert-link-at-caret.js +37 -0
- package/src/lib/components/insert-link-at-caret.js.map +1 -0
- package/src/lib/components/lead-convert-dialog.d.ts +32 -0
- package/src/lib/components/lead-convert-dialog.js +493 -0
- package/src/lib/components/lead-convert-dialog.js.map +1 -0
- package/src/lib/components/lead-detail-page.d.ts +16 -0
- package/src/lib/components/lead-detail-page.js +163 -0
- package/src/lib/components/lead-detail-page.js.map +1 -0
- package/src/lib/components/lead-history-card.d.ts +32 -0
- package/src/lib/components/lead-history-card.js +165 -0
- package/src/lib/components/lead-history-card.js.map +1 -0
- package/src/lib/components/lead-import-drawer.d.ts +24 -0
- package/src/lib/components/lead-import-drawer.js +95 -0
- package/src/lib/components/lead-import-drawer.js.map +1 -0
- package/src/lib/components/lead-owner-select.d.ts +35 -0
- package/src/lib/components/lead-owner-select.js +91 -0
- package/src/lib/components/lead-owner-select.js.map +1 -0
- package/src/lib/components/lead-properties-card.d.ts +61 -0
- package/src/lib/components/lead-properties-card.js +395 -0
- package/src/lib/components/lead-properties-card.js.map +1 -0
- package/src/lib/components/lead-status-chip.d.ts +12 -0
- package/src/lib/components/lead-status-chip.js +43 -0
- package/src/lib/components/lead-status-chip.js.map +1 -0
- package/src/lib/components/lead-surfaces-note.d.ts +126 -0
- package/src/lib/components/lead-surfaces-note.js +262 -0
- package/src/lib/components/lead-surfaces-note.js.map +1 -0
- package/src/lib/components/lead-unqualify-dialog.d.ts +24 -0
- package/src/lib/components/lead-unqualify-dialog.js +125 -0
- package/src/lib/components/lead-unqualify-dialog.js.map +1 -0
- package/src/lib/components/leads-bulk-bar.d.ts +58 -0
- package/src/lib/components/leads-bulk-bar.js +307 -0
- package/src/lib/components/leads-bulk-bar.js.map +1 -0
- package/src/lib/components/leads-section.d.ts +23 -0
- package/src/lib/components/leads-section.js +664 -0
- package/src/lib/components/leads-section.js.map +1 -0
- package/src/lib/components/linked-deals-card.d.ts +32 -0
- package/src/lib/components/linked-deals-card.js +163 -0
- package/src/lib/components/linked-deals-card.js.map +1 -0
- package/src/lib/components/log-activity-dialog.d.ts +60 -0
- package/src/lib/components/log-activity-dialog.js +368 -0
- package/src/lib/components/log-activity-dialog.js.map +1 -0
- package/src/lib/components/lost-reason-dialog.d.ts +26 -0
- package/src/lib/components/lost-reason-dialog.js +95 -0
- package/src/lib/components/lost-reason-dialog.js.map +1 -0
- package/src/lib/components/new-contact-drawer.d.ts +78 -0
- package/src/lib/components/new-contact-drawer.js +343 -0
- package/src/lib/components/new-contact-drawer.js.map +1 -0
- package/src/lib/components/org-lead-surfaces-note.d.ts +57 -0
- package/src/lib/components/org-lead-surfaces-note.js +172 -0
- package/src/lib/components/org-lead-surfaces-note.js.map +1 -0
- package/src/lib/components/owner-avatar.d.ts +18 -0
- package/src/lib/components/owner-avatar.js +61 -0
- package/src/lib/components/owner-avatar.js.map +1 -0
- package/src/lib/components/pipeline-stages-dialog.d.ts +43 -0
- package/src/lib/components/pipeline-stages-dialog.js +339 -0
- package/src/lib/components/pipeline-stages-dialog.js.map +1 -0
- package/src/lib/components/pipelines-dialog.d.ts +55 -0
- package/src/lib/components/pipelines-dialog.js +517 -0
- package/src/lib/components/pipelines-dialog.js.map +1 -0
- package/src/lib/components/recent-activity-feed.d.ts +39 -0
- package/src/lib/components/recent-activity-feed.js +103 -0
- package/src/lib/components/recent-activity-feed.js.map +1 -0
- package/src/lib/components/recipes-card.d.ts +39 -0
- package/src/lib/components/recipes-card.js +485 -0
- package/src/lib/components/recipes-card.js.map +1 -0
- package/src/lib/components/record-activity-card.d.ts +26 -0
- package/src/lib/components/record-activity-card.js +121 -0
- package/src/lib/components/record-activity-card.js.map +1 -0
- package/src/lib/components/record-files-card.d.ts +67 -0
- package/src/lib/components/record-files-card.js +290 -0
- package/src/lib/components/record-files-card.js.map +1 -0
- package/src/lib/components/record-tasks-card.d.ts +32 -0
- package/src/lib/components/record-tasks-card.js +306 -0
- package/src/lib/components/record-tasks-card.js.map +1 -0
- package/src/lib/components/reports/activity-card.d.ts +57 -0
- package/src/lib/components/reports/activity-card.js +281 -0
- package/src/lib/components/reports/activity-card.js.map +1 -0
- package/src/lib/components/reports/closed-deals-card.d.ts +20 -0
- package/src/lib/components/reports/closed-deals-card.js +194 -0
- package/src/lib/components/reports/closed-deals-card.js.map +1 -0
- package/src/lib/components/reports/contacts-mix-card.d.ts +27 -0
- package/src/lib/components/reports/contacts-mix-card.js +161 -0
- package/src/lib/components/reports/contacts-mix-card.js.map +1 -0
- package/src/lib/components/reports/contacts-trend-card.d.ts +31 -0
- package/src/lib/components/reports/contacts-trend-card.js +144 -0
- package/src/lib/components/reports/contacts-trend-card.js.map +1 -0
- package/src/lib/components/reports/forecast-card.d.ts +22 -0
- package/src/lib/components/reports/forecast-card.js +251 -0
- package/src/lib/components/reports/forecast-card.js.map +1 -0
- package/src/lib/components/reports/lead-counts.d.ts +32 -0
- package/src/lib/components/reports/lead-counts.js +44 -0
- package/src/lib/components/reports/lead-counts.js.map +1 -0
- package/src/lib/components/reports/lead-funnel-card.d.ts +38 -0
- package/src/lib/components/reports/lead-funnel-card.js +375 -0
- package/src/lib/components/reports/lead-funnel-card.js.map +1 -0
- package/src/lib/components/reports/pipeline-card.d.ts +19 -0
- package/src/lib/components/reports/pipeline-card.js +338 -0
- package/src/lib/components/reports/pipeline-card.js.map +1 -0
- package/src/lib/components/reports/report-bar-chart.d.ts +39 -0
- package/src/lib/components/reports/report-bar-chart.js +133 -0
- package/src/lib/components/reports/report-bar-chart.js.map +1 -0
- package/src/lib/components/reports/report-breakdown.d.ts +32 -0
- package/src/lib/components/reports/report-breakdown.js +105 -0
- package/src/lib/components/reports/report-breakdown.js.map +1 -0
- package/src/lib/components/reports/report-export.d.ts +37 -0
- package/src/lib/components/reports/report-export.js +66 -0
- package/src/lib/components/reports/report-export.js.map +1 -0
- package/src/lib/components/reports/report-format.d.ts +36 -0
- package/src/lib/components/reports/report-format.js +43 -0
- package/src/lib/components/reports/report-format.js.map +1 -0
- package/src/lib/components/reports/report-scope.d.ts +81 -0
- package/src/lib/components/reports/report-scope.js +58 -0
- package/src/lib/components/reports/report-scope.js.map +1 -0
- package/src/lib/components/reports/report-stat-tile.d.ts +47 -0
- package/src/lib/components/reports/report-stat-tile.js +96 -0
- package/src/lib/components/reports/report-stat-tile.js.map +1 -0
- package/src/lib/components/reports/source-conversion-card.d.ts +28 -0
- package/src/lib/components/reports/source-conversion-card.js +205 -0
- package/src/lib/components/reports/source-conversion-card.js.map +1 -0
- package/src/lib/components/reports/tasks-card.d.ts +26 -0
- package/src/lib/components/reports/tasks-card.js +279 -0
- package/src/lib/components/reports/tasks-card.js.map +1 -0
- package/src/lib/components/reports/use-aggregate-read.d.ts +99 -0
- package/src/lib/components/reports/use-aggregate-read.js +195 -0
- package/src/lib/components/reports/use-aggregate-read.js.map +1 -0
- package/src/lib/components/reports/won-lost-by-owner-card.d.ts +30 -0
- package/src/lib/components/reports/won-lost-by-owner-card.js +168 -0
- package/src/lib/components/reports/won-lost-by-owner-card.js.map +1 -0
- package/src/lib/components/reports-section.d.ts +42 -0
- package/src/lib/components/reports-section.js +308 -0
- package/src/lib/components/reports-section.js.map +1 -0
- package/src/lib/components/sending-addresses-card.d.ts +49 -0
- package/src/lib/components/sending-addresses-card.js +262 -0
- package/src/lib/components/sending-addresses-card.js.map +1 -0
- package/src/lib/components/settings-section.d.ts +151 -0
- package/src/lib/components/settings-section.js +783 -0
- package/src/lib/components/settings-section.js.map +1 -0
- package/src/lib/components/task-cells.d.ts +51 -0
- package/src/lib/components/task-cells.js +139 -0
- package/src/lib/components/task-cells.js.map +1 -0
- package/src/lib/components/task-edit-drawer.d.ts +53 -0
- package/src/lib/components/task-edit-drawer.js +483 -0
- package/src/lib/components/task-edit-drawer.js.map +1 -0
- package/src/lib/components/task-import-drawer.d.ts +24 -0
- package/src/lib/components/task-import-drawer.js +82 -0
- package/src/lib/components/task-import-drawer.js.map +1 -0
- package/src/lib/components/task-snooze-menu.d.ts +65 -0
- package/src/lib/components/task-snooze-menu.js +207 -0
- package/src/lib/components/task-snooze-menu.js.map +1 -0
- package/src/lib/components/tasks-bulk-bar.d.ts +25 -0
- package/src/lib/components/tasks-bulk-bar.js +348 -0
- package/src/lib/components/tasks-bulk-bar.js.map +1 -0
- package/src/lib/components/tasks-calendar.d.ts +38 -0
- package/src/lib/components/tasks-calendar.js +228 -0
- package/src/lib/components/tasks-calendar.js.map +1 -0
- package/src/lib/components/tasks-section.d.ts +27 -0
- package/src/lib/components/tasks-section.js +579 -0
- package/src/lib/components/tasks-section.js.map +1 -0
- package/src/lib/components/use-contact-campaign-emails.d.ts +32 -0
- package/src/lib/components/use-contact-campaign-emails.js +83 -0
- package/src/lib/components/use-contact-campaign-emails.js.map +1 -0
- package/src/lib/components/use-crm-api.d.ts +44 -0
- package/src/lib/components/use-crm-api.js +84 -0
- package/src/lib/components/use-crm-api.js.map +1 -0
- package/src/lib/components/use-crm-inbound-address.d.ts +60 -0
- package/src/lib/components/use-crm-inbound-address.js +124 -0
- package/src/lib/components/use-crm-inbound-address.js.map +1 -0
- package/src/lib/components/use-emails-hub-path.d.ts +24 -0
- package/src/lib/components/use-emails-hub-path.js +59 -0
- package/src/lib/components/use-emails-hub-path.js.map +1 -0
- package/src/lib/components/use-member-email-aliases.d.ts +54 -0
- package/src/lib/components/use-member-email-aliases.js +186 -0
- package/src/lib/components/use-member-email-aliases.js.map +1 -0
- package/src/lib/components/use-org-members.d.ts +40 -0
- package/src/lib/components/use-org-members.js +100 -0
- package/src/lib/components/use-org-members.js.map +1 -0
- package/src/lib/constants/api-routes.d.ts +109 -0
- package/src/lib/constants/api-routes.js +74 -0
- package/src/lib/constants/api-routes.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +14 -0
- package/src/lib/constants/bundle-common.js +14 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/constants/company-filters.d.ts +18 -0
- package/src/lib/constants/company-filters.js +51 -0
- package/src/lib/constants/company-filters.js.map +1 -0
- package/src/lib/constants/contact-filters.d.ts +38 -0
- package/src/lib/constants/contact-filters.js +294 -0
- package/src/lib/constants/contact-filters.js.map +1 -0
- package/src/lib/hooks/use-contact-field-definitions.d.ts +48 -0
- package/src/lib/hooks/use-contact-field-definitions.js +72 -0
- package/src/lib/hooks/use-contact-field-definitions.js.map +1 -0
- package/src/lib/hooks/use-contact-update.d.ts +25 -0
- package/src/lib/hooks/use-contact-update.js +80 -0
- package/src/lib/hooks/use-contact-update.js.map +1 -0
- package/src/lib/hooks/use-crm-activity-logger.d.ts +73 -0
- package/src/lib/hooks/use-crm-activity-logger.js +101 -0
- package/src/lib/hooks/use-crm-activity-logger.js.map +1 -0
- package/src/lib/hooks/use-crm-bulk-apply.d.ts +52 -0
- package/src/lib/hooks/use-crm-bulk-apply.js +112 -0
- package/src/lib/hooks/use-crm-bulk-apply.js.map +1 -0
- package/src/lib/hooks/use-crm-default-view.d.ts +24 -0
- package/src/lib/hooks/use-crm-default-view.js +64 -0
- package/src/lib/hooks/use-crm-default-view.js.map +1 -0
- package/src/lib/hooks/use-crm-email-templates.d.ts +59 -0
- package/src/lib/hooks/use-crm-email-templates.js +103 -0
- package/src/lib/hooks/use-crm-email-templates.js.map +1 -0
- package/src/lib/hooks/use-crm-hub-path.d.ts +29 -0
- package/src/lib/hooks/use-crm-hub-path.js +41 -0
- package/src/lib/hooks/use-crm-hub-path.js.map +1 -0
- package/src/lib/hooks/use-crm-org-mount.d.ts +97 -0
- package/src/lib/hooks/use-crm-org-mount.js +215 -0
- package/src/lib/hooks/use-crm-org-mount.js.map +1 -0
- package/src/lib/hooks/use-crm-record-names.d.ts +52 -0
- package/src/lib/hooks/use-crm-record-names.js +126 -0
- package/src/lib/hooks/use-crm-record-names.js.map +1 -0
- package/src/lib/hooks/use-crm-records-quota.d.ts +68 -0
- package/src/lib/hooks/use-crm-records-quota.js +118 -0
- package/src/lib/hooks/use-crm-records-quota.js.map +1 -0
- package/src/lib/hooks/use-crm-saved-view.d.ts +96 -0
- package/src/lib/hooks/use-crm-saved-view.js +329 -0
- package/src/lib/hooks/use-crm-saved-view.js.map +1 -0
- package/src/lib/hooks/use-crm-scope.d.ts +117 -0
- package/src/lib/hooks/use-crm-scope.js +147 -0
- package/src/lib/hooks/use-crm-scope.js.map +1 -0
- package/src/lib/hooks/use-crm-tasks.d.ts +85 -0
- package/src/lib/hooks/use-crm-tasks.js +153 -0
- package/src/lib/hooks/use-crm-tasks.js.map +1 -0
- package/src/lib/hooks/use-crm-view-grid.d.ts +55 -0
- package/src/lib/hooks/use-crm-view-grid.js +170 -0
- package/src/lib/hooks/use-crm-view-grid.js.map +1 -0
- package/src/lib/hooks/use-crm-views.d.ts +42 -0
- package/src/lib/hooks/use-crm-views.js +84 -0
- package/src/lib/hooks/use-crm-views.js.map +1 -0
- package/src/lib/hooks/use-deal-stage-api.d.ts +69 -0
- package/src/lib/hooks/use-deal-stage-api.js +78 -0
- package/src/lib/hooks/use-deal-stage-api.js.map +1 -0
- package/src/lib/hooks/use-deals.d.ts +47 -0
- package/src/lib/hooks/use-deals.js +105 -0
- package/src/lib/hooks/use-deals.js.map +1 -0
- package/src/lib/hooks/use-org-leads.d.ts +53 -0
- package/src/lib/hooks/use-org-leads.js +114 -0
- package/src/lib/hooks/use-org-leads.js.map +1 -0
- package/src/lib/hooks/use-org-member-directory.d.ts +36 -0
- package/src/lib/hooks/use-org-member-directory.js +116 -0
- package/src/lib/hooks/use-org-member-directory.js.map +1 -0
- package/src/lib/hooks/use-org-member-options.d.ts +38 -0
- package/src/lib/hooks/use-org-member-options.js +131 -0
- package/src/lib/hooks/use-org-member-options.js.map +1 -0
- package/src/lib/hooks/use-pipeline.d.ts +71 -0
- package/src/lib/hooks/use-pipeline.js +159 -0
- package/src/lib/hooks/use-pipeline.js.map +1 -0
- package/src/lib/model/companies-bulk-writes.d.ts +40 -0
- package/src/lib/model/companies-bulk-writes.js +103 -0
- package/src/lib/model/companies-bulk-writes.js.map +1 -0
- package/src/lib/model/companies-csv.d.ts +36 -0
- package/src/lib/model/companies-csv.js +38 -0
- package/src/lib/model/companies-csv.js.map +1 -0
- package/src/lib/model/companies.d.ts +99 -0
- package/src/lib/model/companies.js +168 -0
- package/src/lib/model/companies.js.map +1 -0
- package/src/lib/model/company-delete-route.d.ts +43 -0
- package/src/lib/model/company-delete-route.js +31 -0
- package/src/lib/model/company-delete-route.js.map +1 -0
- package/src/lib/model/company-delete.d.ts +42 -0
- package/src/lib/model/company-delete.js +52 -0
- package/src/lib/model/company-delete.js.map +1 -0
- package/src/lib/model/contact-duplicates.d.ts +58 -0
- package/src/lib/model/contact-duplicates.js +67 -0
- package/src/lib/model/contact-duplicates.js.map +1 -0
- package/src/lib/model/contact-record.d.ts +113 -0
- package/src/lib/model/contact-record.js +70 -0
- package/src/lib/model/contact-record.js.map +1 -0
- package/src/lib/model/contact-update.d.ts +93 -0
- package/src/lib/model/contact-update.js +50 -0
- package/src/lib/model/contact-update.js.map +1 -0
- package/src/lib/model/contacts-bulk-writes.d.ts +173 -0
- package/src/lib/model/contacts-bulk-writes.js +196 -0
- package/src/lib/model/contacts-bulk-writes.js.map +1 -0
- package/src/lib/model/contacts-csv.d.ts +54 -0
- package/src/lib/model/contacts-csv.js +67 -0
- package/src/lib/model/contacts-csv.js.map +1 -0
- package/src/lib/model/contacts-list-seed.d.ts +51 -0
- package/src/lib/model/contacts-list-seed.js +63 -0
- package/src/lib/model/contacts-list-seed.js.map +1 -0
- package/src/lib/model/crm-activity-report.d.ts +27 -0
- package/src/lib/model/crm-activity-report.js +56 -0
- package/src/lib/model/crm-activity-report.js.map +1 -0
- package/src/lib/model/crm-api.d.ts +49 -0
- package/src/lib/model/crm-api.js +47 -0
- package/src/lib/model/crm-api.js.map +1 -0
- package/src/lib/model/crm-bulk-writes.d.ts +147 -0
- package/src/lib/model/crm-bulk-writes.js +207 -0
- package/src/lib/model/crm-bulk-writes.js.map +1 -0
- package/src/lib/model/crm-company-import.d.ts +154 -0
- package/src/lib/model/crm-company-import.js +331 -0
- package/src/lib/model/crm-company-import.js.map +1 -0
- package/src/lib/model/crm-custom-draft.d.ts +62 -0
- package/src/lib/model/crm-custom-draft.js +67 -0
- package/src/lib/model/crm-custom-draft.js.map +1 -0
- package/src/lib/model/crm-deal-import.d.ts +112 -0
- package/src/lib/model/crm-deal-import.js +263 -0
- package/src/lib/model/crm-deal-import.js.map +1 -0
- package/src/lib/model/crm-import.d.ts +244 -0
- package/src/lib/model/crm-import.js +466 -0
- package/src/lib/model/crm-import.js.map +1 -0
- package/src/lib/model/crm-lead-import.d.ts +105 -0
- package/src/lib/model/crm-lead-import.js +255 -0
- package/src/lib/model/crm-lead-import.js.map +1 -0
- package/src/lib/model/crm-record-routes.d.ts +21 -0
- package/src/lib/model/crm-record-routes.js +70 -0
- package/src/lib/model/crm-record-routes.js.map +1 -0
- package/src/lib/model/crm-routes.d.ts +101 -0
- package/src/lib/model/crm-routes.js +92 -0
- package/src/lib/model/crm-routes.js.map +1 -0
- package/src/lib/model/crm-task-import.d.ts +94 -0
- package/src/lib/model/crm-task-import.js +275 -0
- package/src/lib/model/crm-task-import.js.map +1 -0
- package/src/lib/model/crm-view-param.d.ts +43 -0
- package/src/lib/model/crm-view-param.js +49 -0
- package/src/lib/model/crm-view-param.js.map +1 -0
- package/src/lib/model/deal-board-model.d.ts +241 -0
- package/src/lib/model/deal-board-model.js +439 -0
- package/src/lib/model/deal-board-model.js.map +1 -0
- package/src/lib/model/deal-form-model.d.ts +114 -0
- package/src/lib/model/deal-form-model.js +218 -0
- package/src/lib/model/deal-form-model.js.map +1 -0
- package/src/lib/model/deals-csv.d.ts +32 -0
- package/src/lib/model/deals-csv.js +37 -0
- package/src/lib/model/deals-csv.js.map +1 -0
- package/src/lib/model/import-column-shapes.d.ts +36 -0
- package/src/lib/model/import-column-shapes.js +76 -0
- package/src/lib/model/import-column-shapes.js.map +1 -0
- package/src/lib/model/lead-company-suggestion.d.ts +61 -0
- package/src/lib/model/lead-company-suggestion.js +65 -0
- package/src/lib/model/lead-company-suggestion.js.map +1 -0
- package/src/lib/model/lead-filters.d.ts +29 -0
- package/src/lib/model/lead-filters.js +39 -0
- package/src/lib/model/lead-filters.js.map +1 -0
- package/src/lib/model/lead-surfaces.d.ts +58 -0
- package/src/lib/model/lead-surfaces.js +67 -0
- package/src/lib/model/lead-surfaces.js.map +1 -0
- package/src/lib/model/leads-csv.d.ts +40 -0
- package/src/lib/model/leads-csv.js +40 -0
- package/src/lib/model/leads-csv.js.map +1 -0
- package/src/lib/model/next-activity-api.d.ts +31 -0
- package/src/lib/model/next-activity-api.js +57 -0
- package/src/lib/model/next-activity-api.js.map +1 -0
- package/src/lib/model/next-activity.d.ts +64 -0
- package/src/lib/model/next-activity.js +47 -0
- package/src/lib/model/next-activity.js.map +1 -0
- package/src/lib/model/person-key-web.d.ts +43 -0
- package/src/lib/model/person-key-web.js +52 -0
- package/src/lib/model/person-key-web.js.map +1 -0
- package/src/lib/model/record-facts.d.ts +282 -0
- package/src/lib/model/record-facts.js +434 -0
- package/src/lib/model/record-facts.js.map +1 -0
- package/src/lib/model/task-api.d.ts +28 -0
- package/src/lib/model/task-api.js +57 -0
- package/src/lib/model/task-api.js.map +1 -0
- package/src/lib/model/task-calendar.d.ts +108 -0
- package/src/lib/model/task-calendar.js +139 -0
- package/src/lib/model/task-calendar.js.map +1 -0
- package/src/lib/model/task-routes.d.ts +177 -0
- package/src/lib/model/task-routes.js +197 -0
- package/src/lib/model/task-routes.js.map +1 -0
- package/src/lib/model/task-scope.d.ts +45 -0
- package/src/lib/model/task-scope.js +51 -0
- package/src/lib/model/task-scope.js.map +1 -0
- package/src/lib/model/task-views.d.ts +149 -0
- package/src/lib/model/task-views.js +286 -0
- package/src/lib/model/task-views.js.map +1 -0
- package/src/lib/model/tasks-csv.d.ts +28 -0
- package/src/lib/model/tasks-csv.js +28 -0
- package/src/lib/model/tasks-csv.js.map +1 -0
- package/src/lib/plugin.d.ts +32 -0
- package/src/lib/plugin.js +208 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/server/companies-import.d.ts +57 -0
- package/src/lib/server/companies-import.js +242 -0
- package/src/lib/server/companies-import.js.map +1 -0
- package/src/lib/server/company-delete.d.ts +59 -0
- package/src/lib/server/company-delete.js +146 -0
- package/src/lib/server/company-delete.js.map +1 -0
- package/src/lib/server/contact-email-history.d.ts +82 -0
- package/src/lib/server/contact-email-history.js +264 -0
- package/src/lib/server/contact-email-history.js.map +1 -0
- package/src/lib/server/contact-profile.d.ts +41 -0
- package/src/lib/server/contact-profile.js +45 -0
- package/src/lib/server/contact-profile.js.map +1 -0
- package/src/lib/server/contact-update.d.ts +92 -0
- package/src/lib/server/contact-update.js +512 -0
- package/src/lib/server/contact-update.js.map +1 -0
- package/src/lib/server/contacts-import.d.ts +73 -0
- package/src/lib/server/contacts-import.js +263 -0
- package/src/lib/server/contacts-import.js.map +1 -0
- package/src/lib/server/contacts-merge.d.ts +86 -0
- package/src/lib/server/contacts-merge.js +206 -0
- package/src/lib/server/contacts-merge.js.map +1 -0
- package/src/lib/server/deals-import.d.ts +76 -0
- package/src/lib/server/deals-import.js +246 -0
- package/src/lib/server/deals-import.js.map +1 -0
- package/src/lib/server/email-send.d.ts +119 -0
- package/src/lib/server/email-send.js +667 -0
- package/src/lib/server/email-send.js.map +1 -0
- package/src/lib/server/email-template-duplicate.d.ts +19 -0
- package/src/lib/server/email-template-duplicate.js +206 -0
- package/src/lib/server/email-template-duplicate.js.map +1 -0
- package/src/lib/server/erase-person.d.ts +108 -0
- package/src/lib/server/erase-person.js +309 -0
- package/src/lib/server/erase-person.js.map +1 -0
- package/src/lib/server/import-context.d.ts +85 -0
- package/src/lib/server/import-context.js +181 -0
- package/src/lib/server/import-context.js.map +1 -0
- package/src/lib/server/inbound-address.d.ts +61 -0
- package/src/lib/server/inbound-address.js +188 -0
- package/src/lib/server/inbound-address.js.map +1 -0
- package/src/lib/server/lead-convert.d.ts +78 -0
- package/src/lib/server/lead-convert.js +250 -0
- package/src/lib/server/lead-convert.js.map +1 -0
- package/src/lib/server/leads-import.d.ts +84 -0
- package/src/lib/server/leads-import.js +261 -0
- package/src/lib/server/leads-import.js.map +1 -0
- package/src/lib/server/next-activity-routes.d.ts +33 -0
- package/src/lib/server/next-activity-routes.js +110 -0
- package/src/lib/server/next-activity-routes.js.map +1 -0
- package/src/lib/server/org-activity.d.ts +61 -0
- package/src/lib/server/org-activity.js +120 -0
- package/src/lib/server/org-activity.js.map +1 -0
- package/src/lib/server/org-caller.d.ts +110 -0
- package/src/lib/server/org-caller.js +154 -0
- package/src/lib/server/org-caller.js.map +1 -0
- package/src/lib/server/recipe-routes.d.ts +75 -0
- package/src/lib/server/recipe-routes.js +442 -0
- package/src/lib/server/recipe-routes.js.map +1 -0
- package/src/lib/server/record-facts.d.ts +65 -0
- package/src/lib/server/record-facts.js +337 -0
- package/src/lib/server/record-facts.js.map +1 -0
- package/src/lib/server/record-timeline.d.ts +51 -0
- package/src/lib/server/record-timeline.js +215 -0
- package/src/lib/server/record-timeline.js.map +1 -0
- package/src/lib/server/suite-gate.d.ts +42 -0
- package/src/lib/server/suite-gate.js +87 -0
- package/src/lib/server/suite-gate.js.map +1 -0
- package/src/lib/server/task-routes.d.ts +132 -0
- package/src/lib/server/task-routes.js +699 -0
- package/src/lib/server/task-routes.js.map +1 -0
- package/src/lib/server/tasks-import.d.ts +54 -0
- package/src/lib/server/tasks-import.js +157 -0
- package/src/lib/server/tasks-import.js.map +1 -0
- package/src/lib/server-deal-stage.d.ts +88 -0
- package/src/lib/server-deal-stage.js +316 -0
- package/src/lib/server-deal-stage.js.map +1 -0
- package/src/lib/server.d.ts +149 -0
- package/src/lib/server.js +615 -0
- package/src/lib/server.js.map +1 -0
|
@@ -0,0 +1,108 @@
|
|
|
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 month grid the Tasks calendar draws, and the arithmetic behind it
|
|
19
|
+
* (AGL-2662).
|
|
20
|
+
*
|
|
21
|
+
* ## Local days, because that is the day a person is asked about
|
|
22
|
+
*
|
|
23
|
+
* Every boundary here is built with the `Date` constructor's LOCAL
|
|
24
|
+
* components rather than by adding 86,400,000 to a timestamp. The two
|
|
25
|
+
* disagree twice a year: a day that a clock change makes 23 or 25 hours long
|
|
26
|
+
* is still one day to the person reading it, and a grid built from fixed-
|
|
27
|
+
* width offsets puts one task on the wrong square every spring. It is the
|
|
28
|
+
* same reasoning `localDayBounds` records for the Tasks tiles, which decide
|
|
29
|
+
* "overdue" and "due today" the same way — so a task the tile calls overdue
|
|
30
|
+
* cannot sit on today's square.
|
|
31
|
+
*
|
|
32
|
+
* ## Six weeks, always
|
|
33
|
+
*
|
|
34
|
+
* The grid is a fixed 6×7 whatever the month, so the surface does not
|
|
35
|
+
* change height as the reader pages through it. A February that starts on a
|
|
36
|
+
* Sunday fills five rows and the sixth is entirely next month's; drawing it
|
|
37
|
+
* anyway is what keeps the columns from jumping.
|
|
38
|
+
*/
|
|
39
|
+
/** How many day columns a week has. Named so the grid and the math agree. */
|
|
40
|
+
export declare const CALENDAR_WEEK_DAYS = 7;
|
|
41
|
+
/** How many week rows the grid always draws — see the note above. */
|
|
42
|
+
export declare const CALENDAR_WEEKS = 6;
|
|
43
|
+
/** Column headings, starting on Sunday. */
|
|
44
|
+
export declare const CALENDAR_DAY_LABELS: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
45
|
+
/** One square of the grid. */
|
|
46
|
+
export interface TaskCalendarDay {
|
|
47
|
+
/** Local midnight at the start of this day — the bucket key. */
|
|
48
|
+
startMs: number;
|
|
49
|
+
/** Local midnight of the NEXT day, so a range test is `[startMs, endMs)`. */
|
|
50
|
+
endMs: number;
|
|
51
|
+
/** The number drawn in the corner. */
|
|
52
|
+
date: number;
|
|
53
|
+
/** This day belongs to the month being shown, rather than its margins. */
|
|
54
|
+
inMonth: boolean;
|
|
55
|
+
/** This is the reader's own today. */
|
|
56
|
+
isToday: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** One month, as the grid needs it. */
|
|
59
|
+
export interface TaskCalendarMonth {
|
|
60
|
+
/** Local midnight on the first of the month. */
|
|
61
|
+
monthStartMs: number;
|
|
62
|
+
/** Local midnight on the first of the NEXT month. */
|
|
63
|
+
monthEndMs: number;
|
|
64
|
+
/** `Date` for the month being shown, so a caller can label it its own way. */
|
|
65
|
+
monthDate: Date;
|
|
66
|
+
/** Six rows of seven days, the first row starting on a Sunday. */
|
|
67
|
+
weeks: TaskCalendarDay[][];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The month `anchorMs` falls in, as six weeks of local days.
|
|
71
|
+
*
|
|
72
|
+
* `nowMs` is passed rather than read from the clock so the grid is a pure
|
|
73
|
+
* function of its inputs: a component that re-rendered at midnight would
|
|
74
|
+
* otherwise move "today" under the reader without a state change, and a
|
|
75
|
+
* test could not pin the square.
|
|
76
|
+
*/
|
|
77
|
+
export declare function taskCalendarMonth(anchorMs: number, nowMs: number): TaskCalendarMonth;
|
|
78
|
+
/** The same month, `delta` months later — negative for earlier. */
|
|
79
|
+
export declare function shiftCalendarMonth(anchorMs: number, delta: number): number;
|
|
80
|
+
/** What a month's grid holds, and what it could not place. */
|
|
81
|
+
export interface TaskCalendarBuckets<T> {
|
|
82
|
+
/** Tasks per day, keyed by the day's `startMs`; ordered as handed in. */
|
|
83
|
+
byDay: Map<number, T[]>;
|
|
84
|
+
/** Tasks with no due date — a calendar cannot place them, and says so. */
|
|
85
|
+
undated: T[];
|
|
86
|
+
/**
|
|
87
|
+
* Tasks due outside the drawn grid.
|
|
88
|
+
*
|
|
89
|
+
* Counted rather than dropped silently: the calendar is drawn over the
|
|
90
|
+
* SAME window the list holds, so a reader paging to a quiet month must
|
|
91
|
+
* not read an empty grid as "nothing is due" when the window's tasks are
|
|
92
|
+
* simply somewhere else.
|
|
93
|
+
*/
|
|
94
|
+
elsewhere: T[];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Place a window of tasks on a month's grid by their due dates.
|
|
98
|
+
*
|
|
99
|
+
* Keyed on the grid's own day bounds rather than by formatting a date into
|
|
100
|
+
* a string: a bucket key that is a rendered date is a bucket key that
|
|
101
|
+
* depends on the locale, and two tasks an hour apart could land in two
|
|
102
|
+
* buckets under one reader and one under another.
|
|
103
|
+
*
|
|
104
|
+
* The margin days a six-week grid always carries — the tail of the previous
|
|
105
|
+
* month and the head of the next — hold tasks like any other square, which
|
|
106
|
+
* is why they are drawn at all.
|
|
107
|
+
*/
|
|
108
|
+
export declare function bucketTasksByCalendarDay<T>(tasks: readonly T[], dueAtMs: (task: T) => number | null | undefined, month: TaskCalendarMonth): TaskCalendarBuckets<T>;
|
|
@@ -0,0 +1,139 @@
|
|
|
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 month grid the Tasks calendar draws, and the arithmetic behind it
|
|
18
|
+
* (AGL-2662).
|
|
19
|
+
*
|
|
20
|
+
* ## Local days, because that is the day a person is asked about
|
|
21
|
+
*
|
|
22
|
+
* Every boundary here is built with the `Date` constructor's LOCAL
|
|
23
|
+
* components rather than by adding 86,400,000 to a timestamp. The two
|
|
24
|
+
* disagree twice a year: a day that a clock change makes 23 or 25 hours long
|
|
25
|
+
* is still one day to the person reading it, and a grid built from fixed-
|
|
26
|
+
* width offsets puts one task on the wrong square every spring. It is the
|
|
27
|
+
* same reasoning `localDayBounds` records for the Tasks tiles, which decide
|
|
28
|
+
* "overdue" and "due today" the same way — so a task the tile calls overdue
|
|
29
|
+
* cannot sit on today's square.
|
|
30
|
+
*
|
|
31
|
+
* ## Six weeks, always
|
|
32
|
+
*
|
|
33
|
+
* The grid is a fixed 6×7 whatever the month, so the surface does not
|
|
34
|
+
* change height as the reader pages through it. A February that starts on a
|
|
35
|
+
* Sunday fills five rows and the sixth is entirely next month's; drawing it
|
|
36
|
+
* anyway is what keeps the columns from jumping.
|
|
37
|
+
*/ /** How many day columns a week has. Named so the grid and the math agree. */ export const CALENDAR_WEEK_DAYS = 7;
|
|
38
|
+
/** How many week rows the grid always draws — see the note above. */ export const CALENDAR_WEEKS = 6;
|
|
39
|
+
/** Column headings, starting on Sunday. */ export const CALENDAR_DAY_LABELS = [
|
|
40
|
+
'Sun',
|
|
41
|
+
'Mon',
|
|
42
|
+
'Tue',
|
|
43
|
+
'Wed',
|
|
44
|
+
'Thu',
|
|
45
|
+
'Fri',
|
|
46
|
+
'Sat'
|
|
47
|
+
];
|
|
48
|
+
/** Local midnight on the day `value` falls in. */ function startOfDay(value) {
|
|
49
|
+
return new Date(value.getFullYear(), value.getMonth(), value.getDate());
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The month `anchorMs` falls in, as six weeks of local days.
|
|
53
|
+
*
|
|
54
|
+
* `nowMs` is passed rather than read from the clock so the grid is a pure
|
|
55
|
+
* function of its inputs: a component that re-rendered at midnight would
|
|
56
|
+
* otherwise move "today" under the reader without a state change, and a
|
|
57
|
+
* test could not pin the square.
|
|
58
|
+
*/ export function taskCalendarMonth(anchorMs, nowMs) {
|
|
59
|
+
const anchor = new Date(anchorMs);
|
|
60
|
+
const monthStart = new Date(anchor.getFullYear(), anchor.getMonth(), 1);
|
|
61
|
+
const monthEnd = new Date(anchor.getFullYear(), anchor.getMonth() + 1, 1);
|
|
62
|
+
const todayMs = startOfDay(new Date(nowMs)).getTime();
|
|
63
|
+
// Back up to the Sunday on or before the first: `getDay()` is 0 on Sunday,
|
|
64
|
+
// so the offset is the day index itself.
|
|
65
|
+
const gridStart = new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate() - monthStart.getDay());
|
|
66
|
+
const weeks = [];
|
|
67
|
+
for(let week = 0; week < CALENDAR_WEEKS; week += 1){
|
|
68
|
+
const row = [];
|
|
69
|
+
for(let day = 0; day < CALENDAR_WEEK_DAYS; day += 1){
|
|
70
|
+
const at = new Date(gridStart.getFullYear(), gridStart.getMonth(), gridStart.getDate() + week * CALENDAR_WEEK_DAYS + day);
|
|
71
|
+
const next = new Date(at.getFullYear(), at.getMonth(), at.getDate() + 1);
|
|
72
|
+
const startMs = at.getTime();
|
|
73
|
+
row.push({
|
|
74
|
+
startMs,
|
|
75
|
+
endMs: next.getTime(),
|
|
76
|
+
date: at.getDate(),
|
|
77
|
+
inMonth: at.getMonth() === monthStart.getMonth(),
|
|
78
|
+
isToday: startMs === todayMs
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
weeks.push(row);
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
monthStartMs: monthStart.getTime(),
|
|
85
|
+
monthEndMs: monthEnd.getTime(),
|
|
86
|
+
monthDate: monthStart,
|
|
87
|
+
weeks
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** The same month, `delta` months later — negative for earlier. */ export function shiftCalendarMonth(anchorMs, delta) {
|
|
91
|
+
const anchor = new Date(anchorMs);
|
|
92
|
+
return new Date(anchor.getFullYear(), anchor.getMonth() + delta, 1).getTime();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Place a window of tasks on a month's grid by their due dates.
|
|
96
|
+
*
|
|
97
|
+
* Keyed on the grid's own day bounds rather than by formatting a date into
|
|
98
|
+
* a string: a bucket key that is a rendered date is a bucket key that
|
|
99
|
+
* depends on the locale, and two tasks an hour apart could land in two
|
|
100
|
+
* buckets under one reader and one under another.
|
|
101
|
+
*
|
|
102
|
+
* The margin days a six-week grid always carries — the tail of the previous
|
|
103
|
+
* month and the head of the next — hold tasks like any other square, which
|
|
104
|
+
* is why they are drawn at all.
|
|
105
|
+
*/ export function bucketTasksByCalendarDay(tasks, dueAtMs, month) {
|
|
106
|
+
var _ref, _ref1;
|
|
107
|
+
var _days_, _days_1;
|
|
108
|
+
const byDay = new Map();
|
|
109
|
+
const days = month.weeks.flat();
|
|
110
|
+
for (const day of days)byDay.set(day.startMs, []);
|
|
111
|
+
const gridStart = (_ref = (_days_ = days[0]) == null ? void 0 : _days_.startMs) != null ? _ref : month.monthStartMs;
|
|
112
|
+
const gridEnd = (_ref1 = (_days_1 = days[days.length - 1]) == null ? void 0 : _days_1.endMs) != null ? _ref1 : month.monthEndMs;
|
|
113
|
+
const undated = [];
|
|
114
|
+
const elsewhere = [];
|
|
115
|
+
for (const task of tasks){
|
|
116
|
+
const due = Number(dueAtMs(task));
|
|
117
|
+
if (!Number.isFinite(due) || !due) {
|
|
118
|
+
undated.push(task);
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (due < gridStart || due >= gridEnd) {
|
|
122
|
+
elsewhere.push(task);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
// Local midnight of the due moment IS the bucket key, because every
|
|
126
|
+
// square was built from local midnight too.
|
|
127
|
+
const key = startOfDay(new Date(due)).getTime();
|
|
128
|
+
const bucket = byDay.get(key);
|
|
129
|
+
if (bucket) bucket.push(task);
|
|
130
|
+
else elsewhere.push(task);
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
byDay,
|
|
134
|
+
undated,
|
|
135
|
+
elsewhere
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=task-calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/task-calendar.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 month grid the Tasks calendar draws, and the arithmetic behind it\n * (AGL-2662).\n *\n * ## Local days, because that is the day a person is asked about\n *\n * Every boundary here is built with the `Date` constructor's LOCAL\n * components rather than by adding 86,400,000 to a timestamp. The two\n * disagree twice a year: a day that a clock change makes 23 or 25 hours long\n * is still one day to the person reading it, and a grid built from fixed-\n * width offsets puts one task on the wrong square every spring. It is the\n * same reasoning `localDayBounds` records for the Tasks tiles, which decide\n * \"overdue\" and \"due today\" the same way — so a task the tile calls overdue\n * cannot sit on today's square.\n *\n * ## Six weeks, always\n *\n * The grid is a fixed 6×7 whatever the month, so the surface does not\n * change height as the reader pages through it. A February that starts on a\n * Sunday fills five rows and the sixth is entirely next month's; drawing it\n * anyway is what keeps the columns from jumping.\n */\n\n/** How many day columns a week has. Named so the grid and the math agree. */\nexport const CALENDAR_WEEK_DAYS = 7\n\n/** How many week rows the grid always draws — see the note above. */\nexport const CALENDAR_WEEKS = 6\n\n/** Column headings, starting on Sunday. */\nexport const CALENDAR_DAY_LABELS = [\n 'Sun',\n 'Mon',\n 'Tue',\n 'Wed',\n 'Thu',\n 'Fri',\n 'Sat',\n] as const\n\n/** One square of the grid. */\nexport interface TaskCalendarDay {\n /** Local midnight at the start of this day — the bucket key. */\n startMs: number\n /** Local midnight of the NEXT day, so a range test is `[startMs, endMs)`. */\n endMs: number\n /** The number drawn in the corner. */\n date: number\n /** This day belongs to the month being shown, rather than its margins. */\n inMonth: boolean\n /** This is the reader's own today. */\n isToday: boolean\n}\n\n/** One month, as the grid needs it. */\nexport interface TaskCalendarMonth {\n /** Local midnight on the first of the month. */\n monthStartMs: number\n /** Local midnight on the first of the NEXT month. */\n monthEndMs: number\n /** `Date` for the month being shown, so a caller can label it its own way. */\n monthDate: Date\n /** Six rows of seven days, the first row starting on a Sunday. */\n weeks: TaskCalendarDay[][]\n}\n\n/** Local midnight on the day `value` falls in. */\nfunction startOfDay(value: Date): Date {\n return new Date(value.getFullYear(), value.getMonth(), value.getDate())\n}\n\n/**\n * The month `anchorMs` falls in, as six weeks of local days.\n *\n * `nowMs` is passed rather than read from the clock so the grid is a pure\n * function of its inputs: a component that re-rendered at midnight would\n * otherwise move \"today\" under the reader without a state change, and a\n * test could not pin the square.\n */\nexport function taskCalendarMonth(\n anchorMs: number,\n nowMs: number,\n): TaskCalendarMonth {\n const anchor = new Date(anchorMs)\n const monthStart = new Date(anchor.getFullYear(), anchor.getMonth(), 1)\n const monthEnd = new Date(anchor.getFullYear(), anchor.getMonth() + 1, 1)\n const todayMs = startOfDay(new Date(nowMs)).getTime()\n // Back up to the Sunday on or before the first: `getDay()` is 0 on Sunday,\n // so the offset is the day index itself.\n const gridStart = new Date(\n monthStart.getFullYear(),\n monthStart.getMonth(),\n monthStart.getDate() - monthStart.getDay(),\n )\n const weeks: TaskCalendarDay[][] = []\n for (let week = 0; week < CALENDAR_WEEKS; week += 1) {\n const row: TaskCalendarDay[] = []\n for (let day = 0; day < CALENDAR_WEEK_DAYS; day += 1) {\n const at = new Date(\n gridStart.getFullYear(),\n gridStart.getMonth(),\n gridStart.getDate() + week * CALENDAR_WEEK_DAYS + day,\n )\n const next = new Date(\n at.getFullYear(),\n at.getMonth(),\n at.getDate() + 1,\n )\n const startMs = at.getTime()\n row.push({\n startMs,\n endMs: next.getTime(),\n date: at.getDate(),\n inMonth: at.getMonth() === monthStart.getMonth(),\n isToday: startMs === todayMs,\n })\n }\n weeks.push(row)\n }\n return {\n monthStartMs: monthStart.getTime(),\n monthEndMs: monthEnd.getTime(),\n monthDate: monthStart,\n weeks,\n }\n}\n\n/** The same month, `delta` months later — negative for earlier. */\nexport function shiftCalendarMonth(anchorMs: number, delta: number): number {\n const anchor = new Date(anchorMs)\n return new Date(anchor.getFullYear(), anchor.getMonth() + delta, 1).getTime()\n}\n\n/** What a month's grid holds, and what it could not place. */\nexport interface TaskCalendarBuckets<T> {\n /** Tasks per day, keyed by the day's `startMs`; ordered as handed in. */\n byDay: Map<number, T[]>\n /** Tasks with no due date — a calendar cannot place them, and says so. */\n undated: T[]\n /**\n * Tasks due outside the drawn grid.\n *\n * Counted rather than dropped silently: the calendar is drawn over the\n * SAME window the list holds, so a reader paging to a quiet month must\n * not read an empty grid as \"nothing is due\" when the window's tasks are\n * simply somewhere else.\n */\n elsewhere: T[]\n}\n\n/**\n * Place a window of tasks on a month's grid by their due dates.\n *\n * Keyed on the grid's own day bounds rather than by formatting a date into\n * a string: a bucket key that is a rendered date is a bucket key that\n * depends on the locale, and two tasks an hour apart could land in two\n * buckets under one reader and one under another.\n *\n * The margin days a six-week grid always carries — the tail of the previous\n * month and the head of the next — hold tasks like any other square, which\n * is why they are drawn at all.\n */\nexport function bucketTasksByCalendarDay<T>(\n tasks: readonly T[],\n dueAtMs: (task: T) => number | null | undefined,\n month: TaskCalendarMonth,\n): TaskCalendarBuckets<T> {\n const byDay = new Map<number, T[]>()\n const days = month.weeks.flat()\n for (const day of days) byDay.set(day.startMs, [])\n const gridStart = days[0]?.startMs ?? month.monthStartMs\n const gridEnd = days[days.length - 1]?.endMs ?? month.monthEndMs\n const undated: T[] = []\n const elsewhere: T[] = []\n for (const task of tasks) {\n const due = Number(dueAtMs(task))\n if (!Number.isFinite(due) || !due) {\n undated.push(task)\n continue\n }\n if (due < gridStart || due >= gridEnd) {\n elsewhere.push(task)\n continue\n }\n // Local midnight of the due moment IS the bucket key, because every\n // square was built from local midnight too.\n const key = startOfDay(new Date(due)).getTime()\n const bucket = byDay.get(key)\n if (bucket) bucket.push(task)\n else elsewhere.push(task)\n }\n return { byDay, undated, elsewhere }\n}\n"],"names":["CALENDAR_WEEK_DAYS","CALENDAR_WEEKS","CALENDAR_DAY_LABELS","startOfDay","value","Date","getFullYear","getMonth","getDate","taskCalendarMonth","anchorMs","nowMs","anchor","monthStart","monthEnd","todayMs","getTime","gridStart","getDay","weeks","week","row","day","at","next","startMs","push","endMs","date","inMonth","isToday","monthStartMs","monthEndMs","monthDate","shiftCalendarMonth","delta","bucketTasksByCalendarDay","tasks","dueAtMs","month","days","byDay","Map","flat","set","gridEnd","length","undated","elsewhere","task","due","Number","isFinite","key","bucket","get"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;CAqBC,GAED,2EAA2E,GAC3E,OAAO,MAAMA,qBAAqB,EAAC;AAEnC,mEAAmE,GACnE,OAAO,MAAMC,iBAAiB,EAAC;AAE/B,yCAAyC,GACzC,OAAO,MAAMC,sBAAsB;IACjC;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAS;AA4BV,gDAAgD,GAChD,SAASC,WAAWC,KAAW;IAC7B,OAAO,IAAIC,KAAKD,MAAME,WAAW,IAAIF,MAAMG,QAAQ,IAAIH,MAAMI,OAAO;AACtE;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC,kBACdC,QAAgB,EAChBC,KAAa;IAEb,MAAMC,SAAS,IAAIP,KAAKK;IACxB,MAAMG,aAAa,IAAIR,KAAKO,OAAON,WAAW,IAAIM,OAAOL,QAAQ,IAAI;IACrE,MAAMO,WAAW,IAAIT,KAAKO,OAAON,WAAW,IAAIM,OAAOL,QAAQ,KAAK,GAAG;IACvE,MAAMQ,UAAUZ,WAAW,IAAIE,KAAKM,QAAQK,OAAO;IACnD,2EAA2E;IAC3E,yCAAyC;IACzC,MAAMC,YAAY,IAAIZ,KACpBQ,WAAWP,WAAW,IACtBO,WAAWN,QAAQ,IACnBM,WAAWL,OAAO,KAAKK,WAAWK,MAAM;IAE1C,MAAMC,QAA6B,EAAE;IACrC,IAAK,IAAIC,OAAO,GAAGA,OAAOnB,gBAAgBmB,QAAQ,EAAG;QACnD,MAAMC,MAAyB,EAAE;QACjC,IAAK,IAAIC,MAAM,GAAGA,MAAMtB,oBAAoBsB,OAAO,EAAG;YACpD,MAAMC,KAAK,IAAIlB,KACbY,UAAUX,WAAW,IACrBW,UAAUV,QAAQ,IAClBU,UAAUT,OAAO,KAAKY,OAAOpB,qBAAqBsB;YAEpD,MAAME,OAAO,IAAInB,KACfkB,GAAGjB,WAAW,IACdiB,GAAGhB,QAAQ,IACXgB,GAAGf,OAAO,KAAK;YAEjB,MAAMiB,UAAUF,GAAGP,OAAO;YAC1BK,IAAIK,IAAI,CAAC;gBACPD;gBACAE,OAAOH,KAAKR,OAAO;gBACnBY,MAAML,GAAGf,OAAO;gBAChBqB,SAASN,GAAGhB,QAAQ,OAAOM,WAAWN,QAAQ;gBAC9CuB,SAASL,YAAYV;YACvB;QACF;QACAI,MAAMO,IAAI,CAACL;IACb;IACA,OAAO;QACLU,cAAclB,WAAWG,OAAO;QAChCgB,YAAYlB,SAASE,OAAO;QAC5BiB,WAAWpB;QACXM;IACF;AACF;AAEA,iEAAiE,GACjE,OAAO,SAASe,mBAAmBxB,QAAgB,EAAEyB,KAAa;IAChE,MAAMvB,SAAS,IAAIP,KAAKK;IACxB,OAAO,IAAIL,KAAKO,OAAON,WAAW,IAAIM,OAAOL,QAAQ,KAAK4B,OAAO,GAAGnB,OAAO;AAC7E;AAmBA;;;;;;;;;;;CAWC,GACD,OAAO,SAASoB,yBACdC,KAAmB,EACnBC,OAA+C,EAC/CC,KAAwB;;QAKNC,QACFA;IAJhB,MAAMC,QAAQ,IAAIC;IAClB,MAAMF,OAAOD,MAAMpB,KAAK,CAACwB,IAAI;IAC7B,KAAK,MAAMrB,OAAOkB,KAAMC,MAAMG,GAAG,CAACtB,IAAIG,OAAO,EAAE,EAAE;IACjD,MAAMR,qBAAYuB,SAAAA,IAAI,CAAC,EAAE,qBAAPA,OAASf,OAAO,mBAAIc,MAAMR,YAAY;IACxD,MAAMc,oBAAUL,UAAAA,IAAI,CAACA,KAAKM,MAAM,GAAG,EAAE,qBAArBN,QAAuBb,KAAK,oBAAIY,MAAMP,UAAU;IAChE,MAAMe,UAAe,EAAE;IACvB,MAAMC,YAAiB,EAAE;IACzB,KAAK,MAAMC,QAAQZ,MAAO;QACxB,MAAMa,MAAMC,OAAOb,QAAQW;QAC3B,IAAI,CAACE,OAAOC,QAAQ,CAACF,QAAQ,CAACA,KAAK;YACjCH,QAAQrB,IAAI,CAACuB;YACb;QACF;QACA,IAAIC,MAAMjC,aAAaiC,OAAOL,SAAS;YACrCG,UAAUtB,IAAI,CAACuB;YACf;QACF;QACA,oEAAoE;QACpE,4CAA4C;QAC5C,MAAMI,MAAMlD,WAAW,IAAIE,KAAK6C,MAAMlC,OAAO;QAC7C,MAAMsC,SAASb,MAAMc,GAAG,CAACF;QACzB,IAAIC,QAAQA,OAAO5B,IAAI,CAACuB;aACnBD,UAAUtB,IAAI,CAACuB;IACtB;IACA,OAAO;QAAER;QAAOM;QAASC;IAAU;AACrC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
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 { CrmTask, CrmTaskKind, CrmTaskPriority } from '@aglyn/aglyn';
|
|
18
|
+
/**
|
|
19
|
+
* The contract between the tasks console and the plugin's two task routes
|
|
20
|
+
* (AGL-2599), in one module both halves import so the field a drawer sends
|
|
21
|
+
* and the field a handler reads cannot drift apart.
|
|
22
|
+
*
|
|
23
|
+
* Route PATHS are relative to the console's plugin API prefix: the handler
|
|
24
|
+
* registers `crm/task-save` and the browser calls `/api/crm/task-save`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CRM_TASK_ROUTES: {
|
|
27
|
+
readonly save: "crm/task-save";
|
|
28
|
+
readonly complete: "crm/task-complete";
|
|
29
|
+
};
|
|
30
|
+
/** The browser-side address of a route: `/api/` + the registered path. */
|
|
31
|
+
export declare const crmTaskRouteUrl: (route: (typeof CRM_TASK_ROUTES)[keyof typeof CRM_TASK_ROUTES]) => string;
|
|
32
|
+
/**
|
|
33
|
+
* What a person may set on a task. Everything else on the document — scope,
|
|
34
|
+
* provenance, status, timestamps — is the server's to stamp.
|
|
35
|
+
*/
|
|
36
|
+
export interface CrmTaskFields {
|
|
37
|
+
title: string;
|
|
38
|
+
kind: CrmTaskKind;
|
|
39
|
+
priority: CrmTaskPriority;
|
|
40
|
+
dueAtMs: number | null;
|
|
41
|
+
assigneeUid: string | null;
|
|
42
|
+
notes: string;
|
|
43
|
+
contactId: string | null;
|
|
44
|
+
companyId: string | null;
|
|
45
|
+
dealId: string | null;
|
|
46
|
+
/**
|
|
47
|
+
* When the assignee is reminded (AGL-2659): a time, `null` for none, or
|
|
48
|
+
* ABSENT for "nothing said" — which the route answers with the rule in
|
|
49
|
+
* `crmTaskReminderAfterEdit`: a new task's reminder is its due time, and
|
|
50
|
+
* an edit that moves the due date moves a reminder that still sat on it.
|
|
51
|
+
* The drawer leaves it absent until the person touches the field.
|
|
52
|
+
*/
|
|
53
|
+
remindAtMs?: number | null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Which level a task route call runs at (AGL-2637), the way
|
|
57
|
+
* `readCrmRouteScope` reads it off the body.
|
|
58
|
+
*
|
|
59
|
+
* `hostId` alone is the SITE variant every route has always had: the org is
|
|
60
|
+
* resolved from the site, the caller's role checked on it, the task stamped
|
|
61
|
+
* with the site's scope. `orgId` is the ORGANIZATION variant, authorized by
|
|
62
|
+
* the org for an org-wide member; a `hostId` beside it names the site a NEW
|
|
63
|
+
* task is filed from, and absent, the task is the organization's own — no
|
|
64
|
+
* site, `hostId: null`, the org scope token alone.
|
|
65
|
+
*/
|
|
66
|
+
export type CrmTaskRouteScope = {
|
|
67
|
+
hostId: string;
|
|
68
|
+
orgId?: undefined;
|
|
69
|
+
} | {
|
|
70
|
+
orgId: string;
|
|
71
|
+
hostId?: string | null;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* The scope a surface calls with, from what it holds: the mounted site, or
|
|
75
|
+
* at the organization level the org the scope hook resolved. `null` until
|
|
76
|
+
* the org is known, which is when a surface has nothing to call with.
|
|
77
|
+
*/
|
|
78
|
+
export declare function crmTaskCallScope(hostId: string | null | undefined, orgId: string | null | undefined): CrmTaskRouteScope | null;
|
|
79
|
+
export type CrmTaskSaveRequest = CrmTaskRouteScope & {
|
|
80
|
+
/** Absent on create. */
|
|
81
|
+
taskId?: string;
|
|
82
|
+
task: CrmTaskFields;
|
|
83
|
+
};
|
|
84
|
+
export interface CrmTaskSaveResponse {
|
|
85
|
+
ok: true;
|
|
86
|
+
taskId: string;
|
|
87
|
+
/** Whether the assignee was told — false when they assigned it to themselves. */
|
|
88
|
+
notified: boolean;
|
|
89
|
+
}
|
|
90
|
+
export type CrmTaskCompleteRequest = CrmTaskRouteScope & {
|
|
91
|
+
taskId: string;
|
|
92
|
+
};
|
|
93
|
+
export interface CrmTaskCompleteResponse {
|
|
94
|
+
ok: true;
|
|
95
|
+
completedAtMs: number;
|
|
96
|
+
/** The task was already done; nothing was written and no event fired. */
|
|
97
|
+
alreadyDone?: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* THE BATCH FORMS, organization level only (AGL-2637).
|
|
101
|
+
*
|
|
102
|
+
* The org hub's bulk bar completes or reassigns a selection in ONE request
|
|
103
|
+
* per action: the same two routes, with `taskIds` (complete) or `tasks`
|
|
104
|
+
* (save) in place of one `taskId`, authorized once by the org. Each task is
|
|
105
|
+
* answered on its own — a refusal names the task and carries the route's
|
|
106
|
+
* sentence — so a selection that reaches a task that has since been deleted
|
|
107
|
+
* still completes the rest. The site hub keeps one request per task, where
|
|
108
|
+
* each is authorized against the site.
|
|
109
|
+
*
|
|
110
|
+
* Capped at the list's own window: a selection cannot be larger than what
|
|
111
|
+
* the list showed.
|
|
112
|
+
*/
|
|
113
|
+
export declare const CRM_TASK_BATCH_MAX = 200;
|
|
114
|
+
export interface CrmTasksCompleteRequest {
|
|
115
|
+
orgId: string;
|
|
116
|
+
taskIds: string[];
|
|
117
|
+
}
|
|
118
|
+
export type CrmTaskCompleteOutcome = {
|
|
119
|
+
taskId: string;
|
|
120
|
+
ok: true;
|
|
121
|
+
completedAtMs: number;
|
|
122
|
+
alreadyDone?: boolean;
|
|
123
|
+
} | {
|
|
124
|
+
taskId: string;
|
|
125
|
+
ok: false;
|
|
126
|
+
error: string;
|
|
127
|
+
};
|
|
128
|
+
export interface CrmTasksCompleteResponse {
|
|
129
|
+
ok: true;
|
|
130
|
+
results: CrmTaskCompleteOutcome[];
|
|
131
|
+
}
|
|
132
|
+
export interface CrmTasksSaveRequest {
|
|
133
|
+
orgId: string;
|
|
134
|
+
/** Updates only — a batch never creates. */
|
|
135
|
+
tasks: Array<{
|
|
136
|
+
taskId: string;
|
|
137
|
+
task: CrmTaskFields;
|
|
138
|
+
}>;
|
|
139
|
+
}
|
|
140
|
+
export type CrmTaskSaveOutcome = {
|
|
141
|
+
taskId: string;
|
|
142
|
+
ok: true;
|
|
143
|
+
notified: boolean;
|
|
144
|
+
} | {
|
|
145
|
+
taskId: string;
|
|
146
|
+
ok: false;
|
|
147
|
+
error: string;
|
|
148
|
+
};
|
|
149
|
+
export interface CrmTasksSaveResponse {
|
|
150
|
+
ok: true;
|
|
151
|
+
results: CrmTaskSaveOutcome[];
|
|
152
|
+
}
|
|
153
|
+
export declare const CRM_TASK_TITLE_MAX = 200;
|
|
154
|
+
export declare const CRM_TASK_NOTES_MAX = 4000;
|
|
155
|
+
/**
|
|
156
|
+
* The request body as a task, or the reason it is not one.
|
|
157
|
+
*
|
|
158
|
+
* Coerces where a person could not have meant anything else (whitespace
|
|
159
|
+
* around a title, a due date sent as a string of digits) and refuses where a
|
|
160
|
+
* guess would store something the list cannot show (an unknown kind, a title
|
|
161
|
+
* that is nothing but spaces). The refusal is a sentence because the drawer
|
|
162
|
+
* puts it in front of the person who typed the value.
|
|
163
|
+
*/
|
|
164
|
+
export declare function readCrmTaskFields(input: unknown): {
|
|
165
|
+
ok: true;
|
|
166
|
+
fields: CrmTaskFields;
|
|
167
|
+
} | {
|
|
168
|
+
ok: false;
|
|
169
|
+
error: string;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* The stored document's editable half, as the drawer's form reads it.
|
|
173
|
+
*
|
|
174
|
+
* The inverse of what the save route writes, so opening a task and saving it
|
|
175
|
+
* untouched is a no-op on every field the form owns.
|
|
176
|
+
*/
|
|
177
|
+
export declare function crmTaskFieldsOf(task: Partial<CrmTask>): CrmTaskFields;
|
|
@@ -0,0 +1,197 @@
|
|
|
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
|
+
*/ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
17
|
+
/**
|
|
18
|
+
* The contract between the tasks console and the plugin's two task routes
|
|
19
|
+
* (AGL-2599), in one module both halves import so the field a drawer sends
|
|
20
|
+
* and the field a handler reads cannot drift apart.
|
|
21
|
+
*
|
|
22
|
+
* Route PATHS are relative to the console's plugin API prefix: the handler
|
|
23
|
+
* registers `crm/task-save` and the browser calls `/api/crm/task-save`.
|
|
24
|
+
*/ export const CRM_TASK_ROUTES = {
|
|
25
|
+
save: 'crm/task-save',
|
|
26
|
+
complete: 'crm/task-complete'
|
|
27
|
+
};
|
|
28
|
+
/** The browser-side address of a route: `/api/` + the registered path. */ export const crmTaskRouteUrl = (route)=>`/api/${route}`;
|
|
29
|
+
/**
|
|
30
|
+
* The scope a surface calls with, from what it holds: the mounted site, or
|
|
31
|
+
* at the organization level the org the scope hook resolved. `null` until
|
|
32
|
+
* the org is known, which is when a surface has nothing to call with.
|
|
33
|
+
*/ export function crmTaskCallScope(hostId, orgId) {
|
|
34
|
+
if (hostId) return {
|
|
35
|
+
hostId
|
|
36
|
+
};
|
|
37
|
+
if (orgId) return {
|
|
38
|
+
orgId
|
|
39
|
+
};
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* THE BATCH FORMS, organization level only (AGL-2637).
|
|
44
|
+
*
|
|
45
|
+
* The org hub's bulk bar completes or reassigns a selection in ONE request
|
|
46
|
+
* per action: the same two routes, with `taskIds` (complete) or `tasks`
|
|
47
|
+
* (save) in place of one `taskId`, authorized once by the org. Each task is
|
|
48
|
+
* answered on its own — a refusal names the task and carries the route's
|
|
49
|
+
* sentence — so a selection that reaches a task that has since been deleted
|
|
50
|
+
* still completes the rest. The site hub keeps one request per task, where
|
|
51
|
+
* each is authorized against the site.
|
|
52
|
+
*
|
|
53
|
+
* Capped at the list's own window: a selection cannot be larger than what
|
|
54
|
+
* the list showed.
|
|
55
|
+
*/ export const CRM_TASK_BATCH_MAX = 200;
|
|
56
|
+
export const CRM_TASK_TITLE_MAX = 200;
|
|
57
|
+
export const CRM_TASK_NOTES_MAX = 4000;
|
|
58
|
+
const RECORD_ID_MAX = 200;
|
|
59
|
+
const KINDS = new Set([
|
|
60
|
+
'call',
|
|
61
|
+
'email',
|
|
62
|
+
'meeting',
|
|
63
|
+
'todo'
|
|
64
|
+
]);
|
|
65
|
+
const PRIORITIES = new Set([
|
|
66
|
+
'low',
|
|
67
|
+
'normal',
|
|
68
|
+
'high'
|
|
69
|
+
]);
|
|
70
|
+
/**
|
|
71
|
+
* A typed record id, or `null` for anything that is not one.
|
|
72
|
+
*
|
|
73
|
+
* A Firestore id is opaque but bounded, and it never contains a slash — a
|
|
74
|
+
* slash would make it a path. Refusing here rather than storing keeps a
|
|
75
|
+
* malformed link from becoming a `where` clause nothing can match.
|
|
76
|
+
*/ function recordId(value) {
|
|
77
|
+
const text = String(value != null ? value : '').trim();
|
|
78
|
+
if (!text || text.length > RECORD_ID_MAX || text.includes('/')) return null;
|
|
79
|
+
return text;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The request body as a task, or the reason it is not one.
|
|
83
|
+
*
|
|
84
|
+
* Coerces where a person could not have meant anything else (whitespace
|
|
85
|
+
* around a title, a due date sent as a string of digits) and refuses where a
|
|
86
|
+
* guess would store something the list cannot show (an unknown kind, a title
|
|
87
|
+
* that is nothing but spaces). The refusal is a sentence because the drawer
|
|
88
|
+
* puts it in front of the person who typed the value.
|
|
89
|
+
*/ export function readCrmTaskFields(input) {
|
|
90
|
+
var _raw_title, _raw_kind, _raw_priority, _raw_assigneeUid, _raw_notes;
|
|
91
|
+
const raw = input != null ? input : {};
|
|
92
|
+
const title = String((_raw_title = raw['title']) != null ? _raw_title : '').trim();
|
|
93
|
+
if (!title) return {
|
|
94
|
+
ok: false,
|
|
95
|
+
error: 'A task needs a title.'
|
|
96
|
+
};
|
|
97
|
+
if (title.length > CRM_TASK_TITLE_MAX) {
|
|
98
|
+
return {
|
|
99
|
+
ok: false,
|
|
100
|
+
error: `A title is at most ${CRM_TASK_TITLE_MAX} characters.`
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const kind = String((_raw_kind = raw['kind']) != null ? _raw_kind : 'todo');
|
|
104
|
+
if (!KINDS.has(kind)) {
|
|
105
|
+
return {
|
|
106
|
+
ok: false,
|
|
107
|
+
error: `"${kind}" is not a kind of task.`
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const priority = String((_raw_priority = raw['priority']) != null ? _raw_priority : 'normal');
|
|
111
|
+
if (!PRIORITIES.has(priority)) {
|
|
112
|
+
return {
|
|
113
|
+
ok: false,
|
|
114
|
+
error: `"${priority}" is not a priority.`
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const dueRaw = raw['dueAtMs'];
|
|
118
|
+
let dueAtMs = null;
|
|
119
|
+
if (dueRaw !== null && dueRaw !== undefined && dueRaw !== '') {
|
|
120
|
+
const ms = Number(dueRaw);
|
|
121
|
+
if (!Number.isFinite(ms) || ms <= 0) {
|
|
122
|
+
return {
|
|
123
|
+
ok: false,
|
|
124
|
+
error: 'The due date could not be read.'
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
dueAtMs = Math.round(ms);
|
|
128
|
+
}
|
|
129
|
+
// Three answers, not two: a reminder the body leaves out is the route's
|
|
130
|
+
// to decide, and only an explicit null or empty string means "none".
|
|
131
|
+
const remindRaw = raw['remindAtMs'];
|
|
132
|
+
let remindAtMs;
|
|
133
|
+
if (remindRaw === null || remindRaw === '') {
|
|
134
|
+
remindAtMs = null;
|
|
135
|
+
} else if (remindRaw !== undefined) {
|
|
136
|
+
const ms = Number(remindRaw);
|
|
137
|
+
if (!Number.isFinite(ms) || ms <= 0) {
|
|
138
|
+
return {
|
|
139
|
+
ok: false,
|
|
140
|
+
error: 'The reminder time could not be read.'
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
remindAtMs = Math.round(ms);
|
|
144
|
+
}
|
|
145
|
+
const assigneeRaw = String((_raw_assigneeUid = raw['assigneeUid']) != null ? _raw_assigneeUid : '').trim();
|
|
146
|
+
const notes = String((_raw_notes = raw['notes']) != null ? _raw_notes : '').slice(0, CRM_TASK_NOTES_MAX);
|
|
147
|
+
const ids = {
|
|
148
|
+
contactId: raw['contactId'] == null || raw['contactId'] === '' ? null : recordId(raw['contactId']),
|
|
149
|
+
companyId: raw['companyId'] == null || raw['companyId'] === '' ? null : recordId(raw['companyId']),
|
|
150
|
+
dealId: raw['dealId'] == null || raw['dealId'] === '' ? null : recordId(raw['dealId'])
|
|
151
|
+
};
|
|
152
|
+
for (const [field, value] of Object.entries(ids)){
|
|
153
|
+
if (value === null && raw[field] != null && raw[field] !== '') {
|
|
154
|
+
return {
|
|
155
|
+
ok: false,
|
|
156
|
+
error: `The linked ${field.replace('Id', '')} could not be read.`
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
ok: true,
|
|
162
|
+
fields: _extends({
|
|
163
|
+
title,
|
|
164
|
+
kind: kind,
|
|
165
|
+
priority: priority,
|
|
166
|
+
dueAtMs,
|
|
167
|
+
assigneeUid: assigneeRaw || null,
|
|
168
|
+
notes
|
|
169
|
+
}, ids, remindAtMs !== undefined ? {
|
|
170
|
+
remindAtMs
|
|
171
|
+
} : {})
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* The stored document's editable half, as the drawer's form reads it.
|
|
176
|
+
*
|
|
177
|
+
* The inverse of what the save route writes, so opening a task and saving it
|
|
178
|
+
* untouched is a no-op on every field the form owns.
|
|
179
|
+
*/ export function crmTaskFieldsOf(task) {
|
|
180
|
+
var _task_title, _task_kind, _task_priority, _task_notes;
|
|
181
|
+
return {
|
|
182
|
+
title: (_task_title = task.title) != null ? _task_title : '',
|
|
183
|
+
kind: (_task_kind = task.kind) != null ? _task_kind : 'todo',
|
|
184
|
+
priority: (_task_priority = task.priority) != null ? _task_priority : 'normal',
|
|
185
|
+
dueAtMs: typeof task.dueAtMs === 'number' ? task.dueAtMs : null,
|
|
186
|
+
assigneeUid: task.assigneeUid || null,
|
|
187
|
+
notes: (_task_notes = task.notes) != null ? _task_notes : '',
|
|
188
|
+
contactId: task.contactId || null,
|
|
189
|
+
companyId: task.companyId || null,
|
|
190
|
+
dealId: task.dealId || null,
|
|
191
|
+
// A stored task from before reminders existed carries no field, and
|
|
192
|
+
// reads as having no reminder — the same answer the route's rule gives.
|
|
193
|
+
remindAtMs: typeof task.remindAtMs === 'number' ? task.remindAtMs : null
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
//# sourceMappingURL=task-routes.js.map
|