@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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/crm-custom-draft.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 { ContactFieldDefinition, CrmCustomValue } from '@aglyn/aglyn'\n\n/**\n * A custom-field DRAFT: the keys a person touched, over what is stored\n * (AGL-2661).\n *\n * Every surface that edits a `custom` map — the contact's card, the\n * company's and the deal's drawers — holds the same two things: the map\n * as it was read, and the keys the reader has changed since. What Save\n * writes is the difference, key by key, because a `custom` map written\n * whole would take every key the surface did not show out with it, and a\n * write of every key would turn a one-field edit into a write of ten.\n * Pure, so the three surfaces cannot drift on what \"changed\" means.\n */\nexport type CrmCustomDraft = Record<string, CrmCustomValue>\n\n/** A stored `custom` map, as read — absent keys and `null` both read as nothing. */\nexport type CrmCustomStored = Readonly<Record<string, CrmCustomValue | undefined>>\n\n/** The value a key shows: the draft's where touched, else the stored one. */\nexport function crmCustomDraftValue(\n stored: CrmCustomStored,\n draft: CrmCustomDraft,\n key: string,\n): CrmCustomValue | undefined {\n return key in draft ? draft[key] : stored[key]\n}\n\n/**\n * The keys whose draft differs from what is stored, with the value to\n * write — `null` for a cleared one, the explicit \"nothing\" that keeps the\n * key present for a `where` clause to find.\n */\nexport function crmCustomDraftChanges(\n stored: CrmCustomStored,\n draft: CrmCustomDraft,\n): Array<[key: string, value: CrmCustomValue]> {\n return Object.entries(draft)\n .filter(([key, value]) => (value ?? null) !== (stored[key] ?? null))\n .map(([key, value]) => [key, value ?? null])\n}\n\n/**\n * The changes as an `update()` payload: one dotted path per key, so the\n * map is merged rather than replaced. Empty when nothing changed, so a\n * caller can spread it into a larger write unconditionally.\n */\nexport function crmCustomDraftWrites(\n stored: CrmCustomStored,\n draft: CrmCustomDraft,\n): Record<`custom.${string}`, CrmCustomValue> {\n return Object.fromEntries(\n crmCustomDraftChanges(stored, draft).map(([key, value]) => [`custom.${key}`, value]),\n ) as Record<`custom.${string}`, CrmCustomValue>\n}\n\n/**\n * The draft as the `custom` map a CREATE stores: every key with a value,\n * `null` and absent both left out because a fresh document has nothing to\n * clear. `undefined` when nothing would be stored, so a caller spreads\n * `{ custom }` only when there is one.\n */\nexport function crmCustomDraftDocument(\n draft: CrmCustomDraft,\n): Record<string, CrmCustomValue> | undefined {\n const stored = Object.fromEntries(\n Object.entries(draft).filter(([, value]) => value !== null && value !== undefined),\n )\n return Object.keys(stored).length ? stored : undefined\n}\n\n/**\n * The required definitions the draft leaves empty — which Save refuses.\n *\n * On an EDIT only a key the reader cleared counts: a required field a\n * record has always lacked is not this save's to demand, or a rename\n * could be refused for a field added last week. On a CREATE every\n * required field counts, because the record is being made whole.\n */\nexport function crmCustomDraftMissingRequired(\n definitions: readonly Pick<ContactFieldDefinition, 'key' | 'required' | 'label'>[],\n stored: CrmCustomStored,\n draft: CrmCustomDraft,\n mode: 'create' | 'edit',\n): string[] {\n return definitions\n .filter((definition) => {\n if (!definition.required) return false\n const value = crmCustomDraftValue(stored, draft, definition.key)\n const empty = value === null || value === undefined || value === ''\n return mode === 'create' ? empty : definition.key in draft && empty\n })\n .map((definition) => definition.label || definition.key)\n}\n"],"names":["crmCustomDraftValue","stored","draft","key","crmCustomDraftChanges","Object","entries","filter","value","map","crmCustomDraftWrites","fromEntries","crmCustomDraftDocument","undefined","keys","length","crmCustomDraftMissingRequired","definitions","mode","definition","required","empty","label"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAqBD,2EAA2E,GAC3E,OAAO,SAASA,oBACdC,MAAuB,EACvBC,KAAqB,EACrBC,GAAW;IAEX,OAAOA,OAAOD,QAAQA,KAAK,CAACC,IAAI,GAAGF,MAAM,CAACE,IAAI;AAChD;AAEA;;;;CAIC,GACD,OAAO,SAASC,sBACdH,MAAuB,EACvBC,KAAqB;IAErB,OAAOG,OAAOC,OAAO,CAACJ,OACnBK,MAAM,CAAC,CAAC,CAACJ,KAAKK,MAAM;YAA0BP;eAArB,CAACO,gBAAAA,QAAS,YAAWP,cAAAA,MAAM,CAACE,IAAI,YAAXF,cAAe;OAC7DQ,GAAG,CAAC,CAAC,CAACN,KAAKK,MAAM,GAAK;YAACL;YAAKK,gBAAAA,QAAS;SAAK;AAC/C;AAEA;;;;CAIC,GACD,OAAO,SAASE,qBACdT,MAAuB,EACvBC,KAAqB;IAErB,OAAOG,OAAOM,WAAW,CACvBP,sBAAsBH,QAAQC,OAAOO,GAAG,CAAC,CAAC,CAACN,KAAKK,MAAM,GAAK;YAAC,CAAC,OAAO,EAAEL,KAAK;YAAEK;SAAM;AAEvF;AAEA;;;;;CAKC,GACD,OAAO,SAASI,uBACdV,KAAqB;IAErB,MAAMD,SAASI,OAAOM,WAAW,CAC/BN,OAAOC,OAAO,CAACJ,OAAOK,MAAM,CAAC,CAAC,GAAGC,MAAM,GAAKA,UAAU,QAAQA,UAAUK;IAE1E,OAAOR,OAAOS,IAAI,CAACb,QAAQc,MAAM,GAAGd,SAASY;AAC/C;AAEA;;;;;;;CAOC,GACD,OAAO,SAASG,8BACdC,WAAkF,EAClFhB,MAAuB,EACvBC,KAAqB,EACrBgB,IAAuB;IAEvB,OAAOD,YACJV,MAAM,CAAC,CAACY;QACP,IAAI,CAACA,WAAWC,QAAQ,EAAE,OAAO;QACjC,MAAMZ,QAAQR,oBAAoBC,QAAQC,OAAOiB,WAAWhB,GAAG;QAC/D,MAAMkB,QAAQb,UAAU,QAAQA,UAAUK,aAAaL,UAAU;QACjE,OAAOU,SAAS,WAAWG,QAAQF,WAAWhB,GAAG,IAAID,SAASmB;IAChE,GACCZ,GAAG,CAAC,CAACU,aAAeA,WAAWG,KAAK,IAAIH,WAAWhB,GAAG;AAC3D"}
|
|
@@ -0,0 +1,112 @@
|
|
|
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 ImportChunkResult, type ImportDroppedValue } from '@aglyn/aglyn/app-utils/csv-import';
|
|
18
|
+
/** The shared ceilings, under this collection's names. */
|
|
19
|
+
export declare const DEAL_IMPORT_MAX_ROWS = 5000;
|
|
20
|
+
export declare const DEAL_IMPORT_CHUNK_SIZE = 200;
|
|
21
|
+
export declare const DEAL_IMPORT_MAX_BODY_BYTES = 2000000;
|
|
22
|
+
export declare const DEAL_IMPORT_PREVIEW_ROWS = 10;
|
|
23
|
+
/** The same caps the deal drawer holds a typed deal to. */
|
|
24
|
+
export declare const DEAL_IMPORT_TITLE_MAX = 120;
|
|
25
|
+
export declare const DEAL_IMPORT_NOTES_MAX = 4000;
|
|
26
|
+
/** The most cents one row may carry — past this the number is a slip. */
|
|
27
|
+
export declare const DEAL_IMPORT_AMOUNT_CENTS_MAX = 1000000000000;
|
|
28
|
+
/** The fields a column may be mapped to, in the order the mapping menu lists them. */
|
|
29
|
+
export declare const DEAL_IMPORT_FIELDS: readonly ["title", "pipeline", "stage", "amount", "currency", "ownerEmail", "expectedClose", "notes"];
|
|
30
|
+
export type DealImportField = (typeof DEAL_IMPORT_FIELDS)[number];
|
|
31
|
+
/** How each field reads in the mapping menu. Typed so a field cannot ship unlabeled. */
|
|
32
|
+
export declare const DEAL_IMPORT_FIELD_LABELS: Record<DealImportField, string>;
|
|
33
|
+
/** Column index → field. A column absent from the map is not imported. */
|
|
34
|
+
export type DealImportMapping = Record<number, DealImportField>;
|
|
35
|
+
/** A proposed mapping from a file's header row, each field taken at most once. */
|
|
36
|
+
export declare function guessDealImportMapping(columns: readonly string[]): DealImportMapping;
|
|
37
|
+
/**
|
|
38
|
+
* What the browser posts for one line: the cells the mapping selected,
|
|
39
|
+
* under the field they were mapped to, verbatim. `unknown` because the
|
|
40
|
+
* server reads this off an untrusted body.
|
|
41
|
+
*/
|
|
42
|
+
export type DealImportRawRow = Partial<Record<DealImportField, unknown>>;
|
|
43
|
+
/**
|
|
44
|
+
* One parsed line under the mapping. Empty cells are left absent. A deal
|
|
45
|
+
* has no custom fields yet, so a custom target the shared drawer could
|
|
46
|
+
* name is dropped here rather than refused at the type.
|
|
47
|
+
*/
|
|
48
|
+
export declare function mapDealImportRow(cells: readonly string[], mapping: Record<number, DealImportField | `custom:${string}`>): DealImportRawRow;
|
|
49
|
+
export type DealImportSkipReason = 'missing-title' | 'unknown-pipeline' | 'unknown-stage' | 'records-band' | 'write-failed';
|
|
50
|
+
/** How a skip reason reads on screen and in the downloaded file. */
|
|
51
|
+
export declare const DEAL_IMPORT_SKIP_LABELS: Record<DealImportSkipReason, string>;
|
|
52
|
+
/** One row, ready for the server to resolve and write. */
|
|
53
|
+
export interface DealImportRow {
|
|
54
|
+
title: string;
|
|
55
|
+
/** The pipeline's name as typed, trimmed; absent means the default pipeline. */
|
|
56
|
+
pipeline?: string;
|
|
57
|
+
/** The stage's name as typed, trimmed; absent means the pipeline's first open stage. */
|
|
58
|
+
stage?: string;
|
|
59
|
+
amountCents?: number;
|
|
60
|
+
/** Lowercase ISO 4217. */
|
|
61
|
+
currency?: string;
|
|
62
|
+
/** Normalized, for the server to resolve against the org's members. */
|
|
63
|
+
ownerEmail?: string;
|
|
64
|
+
/** Epoch ms at noon UTC of the typed calendar day, or the typed instant. */
|
|
65
|
+
expectedCloseAtMs?: number;
|
|
66
|
+
notes?: string;
|
|
67
|
+
dropped: ImportDroppedValue[];
|
|
68
|
+
}
|
|
69
|
+
export type DealImportRowVerdict = {
|
|
70
|
+
ok: true;
|
|
71
|
+
row: DealImportRow;
|
|
72
|
+
} | {
|
|
73
|
+
ok: false;
|
|
74
|
+
reason: 'missing-title';
|
|
75
|
+
input: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* A money cell as cents — `1,250.00`, `$1250`, `1250` → 125000 — or
|
|
79
|
+
* `null` when it is not a number. Rounded to the cent: a spreadsheet
|
|
80
|
+
* that computed `12.345` meant a price, not a third of a cent.
|
|
81
|
+
*/
|
|
82
|
+
export declare function parseImportAmountCents(value: unknown): number | null;
|
|
83
|
+
/**
|
|
84
|
+
* A date cell as epoch ms: a calendar day (`2026-09-30`) at noon UTC — a
|
|
85
|
+
* day, not an instant, so any zone reads the same date back — or an ISO
|
|
86
|
+
* instant as itself. `null` when it is neither.
|
|
87
|
+
*/
|
|
88
|
+
export declare function parseImportDate(value: unknown): number | null;
|
|
89
|
+
/**
|
|
90
|
+
* One raw row as the values that will be written, or the reason it cannot
|
|
91
|
+
* be. Refused here only for a missing title; the pipeline and the stage
|
|
92
|
+
* are refused by the server, which alone can look them up; every other
|
|
93
|
+
* unreadable cell is dropped and named.
|
|
94
|
+
*/
|
|
95
|
+
export declare function normalizeDealImportRow(raw: DealImportRawRow): DealImportRowVerdict;
|
|
96
|
+
/** A name as the key two spellings of one pipeline or stage meet at. */
|
|
97
|
+
export declare function dealImportNameKey(name: string): string;
|
|
98
|
+
/** One row the server did not store, by its index in the request, named by the deal. */
|
|
99
|
+
export interface DealImportSkippedRow {
|
|
100
|
+
index: number;
|
|
101
|
+
title: string;
|
|
102
|
+
reason: DealImportSkipReason;
|
|
103
|
+
}
|
|
104
|
+
/** What one request did. The drawer sums these across a file. */
|
|
105
|
+
export type DealImportChunkResult = ImportChunkResult<DealImportSkippedRow>;
|
|
106
|
+
export declare function emptyDealImportResult(): DealImportChunkResult;
|
|
107
|
+
export declare function mergeDealImportResults(total: DealImportChunkResult, chunk: DealImportChunkResult, offset?: number): DealImportChunkResult;
|
|
108
|
+
/** The skipped rows as a file the operator can fix and re-import. */
|
|
109
|
+
export declare function dealImportSkippedCsv(columns: readonly string[], entries: readonly {
|
|
110
|
+
cells: readonly string[];
|
|
111
|
+
reason: DealImportSkipReason;
|
|
112
|
+
}[]): string;
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ /**
|
|
18
|
+
* BRINGING A SPREADSHEET OF DEALS INTO THE CRM — the pure half (AGL-2662).
|
|
19
|
+
*
|
|
20
|
+
* The contact import's three stages (`crm-import.ts`) over the deal
|
|
21
|
+
* vocabulary: a header row is matched to a proposed mapping, one line is
|
|
22
|
+
* mapped to a raw row of verbatim strings, and the server normalizes each
|
|
23
|
+
* row here before it resolves the two names a deal cannot be filed without.
|
|
24
|
+
*
|
|
25
|
+
* ## A deal names its pipeline and its stage by NAME
|
|
26
|
+
*
|
|
27
|
+
* A spreadsheet says "Sales" and "Proposal sent", never a document id, so
|
|
28
|
+
* the file carries names and the server resolves them against the org's
|
|
29
|
+
* own pipelines — case-insensitively, trimmed — and REFUSES the row, by
|
|
30
|
+
* name, when it cannot: an unknown pipeline is `unknown-pipeline`, an
|
|
31
|
+
* unknown stage in a known pipeline `unknown-stage`. A row with no
|
|
32
|
+
* pipeline cell lands in the default pipeline, and one with no stage cell
|
|
33
|
+
* in that pipeline's first open stage, the way the deal drawer opens.
|
|
34
|
+
*
|
|
35
|
+
* ## A deal has no key, so nothing is merged
|
|
36
|
+
*
|
|
37
|
+
* A contact is one address and a company one domain, but two deals titled
|
|
38
|
+
* "Renewal" are two deals. Every row CREATES; importing a file twice files
|
|
39
|
+
* it twice. What is refused is refused before any write.
|
|
40
|
+
*
|
|
41
|
+
* ## A bad cell is dropped and named; a bad row is skipped and named
|
|
42
|
+
*
|
|
43
|
+
* The contact import's rule: an amount that is not a number, a currency
|
|
44
|
+
* that is not a code, a close date that is not a date, an owner address
|
|
45
|
+
* that is not an address — each is left off the record and REPORTED under
|
|
46
|
+
* {@link DealImportRow.dropped}, never silently discarded.
|
|
47
|
+
*/ import { normalizeContactEmail } from "@aglyn/aglyn/app-utils/contacts";
|
|
48
|
+
import { CSV_IMPORT_CHUNK_SIZE, CSV_IMPORT_MAX_BODY_BYTES, CSV_IMPORT_MAX_ROWS, CSV_IMPORT_PREVIEW_ROWS, emptyImportResult, guessImportMapping, importAliasKeys, importSkippedCsv, importTextValue, mapImportRow, mergeImportResults } from "@aglyn/aglyn/app-utils/csv-import";
|
|
49
|
+
/** The shared ceilings, under this collection's names. */ export const DEAL_IMPORT_MAX_ROWS = CSV_IMPORT_MAX_ROWS;
|
|
50
|
+
export const DEAL_IMPORT_CHUNK_SIZE = CSV_IMPORT_CHUNK_SIZE;
|
|
51
|
+
export const DEAL_IMPORT_MAX_BODY_BYTES = CSV_IMPORT_MAX_BODY_BYTES;
|
|
52
|
+
export const DEAL_IMPORT_PREVIEW_ROWS = CSV_IMPORT_PREVIEW_ROWS;
|
|
53
|
+
/** The same caps the deal drawer holds a typed deal to. */ export const DEAL_IMPORT_TITLE_MAX = 120;
|
|
54
|
+
export const DEAL_IMPORT_NOTES_MAX = 4000;
|
|
55
|
+
/** The most cents one row may carry — past this the number is a slip. */ export const DEAL_IMPORT_AMOUNT_CENTS_MAX = 1000000000000;
|
|
56
|
+
/** The fields a column may be mapped to, in the order the mapping menu lists them. */ export const DEAL_IMPORT_FIELDS = [
|
|
57
|
+
'title',
|
|
58
|
+
'pipeline',
|
|
59
|
+
'stage',
|
|
60
|
+
'amount',
|
|
61
|
+
'currency',
|
|
62
|
+
'ownerEmail',
|
|
63
|
+
'expectedClose',
|
|
64
|
+
'notes'
|
|
65
|
+
];
|
|
66
|
+
/** How each field reads in the mapping menu. Typed so a field cannot ship unlabeled. */ export const DEAL_IMPORT_FIELD_LABELS = {
|
|
67
|
+
title: 'Title (required)',
|
|
68
|
+
pipeline: 'Pipeline (by name)',
|
|
69
|
+
stage: 'Stage (by name)',
|
|
70
|
+
amount: 'Amount (major units, 1250.00)',
|
|
71
|
+
currency: 'Currency (three-letter code)',
|
|
72
|
+
ownerEmail: 'Owner (team member email)',
|
|
73
|
+
expectedClose: 'Expected close (YYYY-MM-DD)',
|
|
74
|
+
notes: 'Notes'
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Header aliases per field, matched after the shared header normalization.
|
|
78
|
+
*
|
|
79
|
+
* First in each list is the header this CRM's own deals export writes, so
|
|
80
|
+
* an export re-imports without a hand mapping; the export's Status,
|
|
81
|
+
* Contact, Company, Closed and Lost reason columns are deliberately
|
|
82
|
+
* absent, because the stage decides the status and a link is made on the
|
|
83
|
+
* record, not from a file.
|
|
84
|
+
*/ const FIELD_ALIASES = {
|
|
85
|
+
title: [
|
|
86
|
+
'title',
|
|
87
|
+
'deal',
|
|
88
|
+
'deal name',
|
|
89
|
+
'deal title',
|
|
90
|
+
'name',
|
|
91
|
+
'opportunity',
|
|
92
|
+
'opportunity name'
|
|
93
|
+
],
|
|
94
|
+
pipeline: [
|
|
95
|
+
'pipeline',
|
|
96
|
+
'pipeline name',
|
|
97
|
+
'board'
|
|
98
|
+
],
|
|
99
|
+
stage: [
|
|
100
|
+
'stage',
|
|
101
|
+
'stage name',
|
|
102
|
+
'deal stage',
|
|
103
|
+
'step'
|
|
104
|
+
],
|
|
105
|
+
amount: [
|
|
106
|
+
'amount',
|
|
107
|
+
'value',
|
|
108
|
+
'deal value',
|
|
109
|
+
'deal amount',
|
|
110
|
+
'total',
|
|
111
|
+
'price'
|
|
112
|
+
],
|
|
113
|
+
currency: [
|
|
114
|
+
'currency',
|
|
115
|
+
'currency code'
|
|
116
|
+
],
|
|
117
|
+
ownerEmail: [
|
|
118
|
+
'owner',
|
|
119
|
+
'owner email',
|
|
120
|
+
'deal owner',
|
|
121
|
+
'assigned to',
|
|
122
|
+
'rep'
|
|
123
|
+
],
|
|
124
|
+
expectedClose: [
|
|
125
|
+
'expected close',
|
|
126
|
+
'close date',
|
|
127
|
+
'expected close date',
|
|
128
|
+
'closing date',
|
|
129
|
+
'expected closing'
|
|
130
|
+
],
|
|
131
|
+
notes: [
|
|
132
|
+
'notes',
|
|
133
|
+
'note',
|
|
134
|
+
'description',
|
|
135
|
+
'comments'
|
|
136
|
+
]
|
|
137
|
+
};
|
|
138
|
+
const FIELD_ALIAS_KEYS = importAliasKeys(DEAL_IMPORT_FIELDS, FIELD_ALIASES);
|
|
139
|
+
/** A proposed mapping from a file's header row, each field taken at most once. */ export function guessDealImportMapping(columns) {
|
|
140
|
+
return guessImportMapping(columns, DEAL_IMPORT_FIELDS, FIELD_ALIAS_KEYS);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* One parsed line under the mapping. Empty cells are left absent. A deal
|
|
144
|
+
* has no custom fields yet, so a custom target the shared drawer could
|
|
145
|
+
* name is dropped here rather than refused at the type.
|
|
146
|
+
*/ export function mapDealImportRow(cells, mapping) {
|
|
147
|
+
const _mapImportRow = mapImportRow(cells, mapping), { custom: _custom } = _mapImportRow, row = _object_without_properties_loose(_mapImportRow, [
|
|
148
|
+
"custom"
|
|
149
|
+
]);
|
|
150
|
+
return row;
|
|
151
|
+
}
|
|
152
|
+
/** How a skip reason reads on screen and in the downloaded file. */ export const DEAL_IMPORT_SKIP_LABELS = {
|
|
153
|
+
'missing-title': 'No title',
|
|
154
|
+
'unknown-pipeline': 'No pipeline by that name',
|
|
155
|
+
'unknown-stage': 'No stage by that name in that pipeline',
|
|
156
|
+
'records-band': 'CRM records limit reached',
|
|
157
|
+
'write-failed': 'Could not be saved'
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* A money cell as cents — `1,250.00`, `$1250`, `1250` → 125000 — or
|
|
161
|
+
* `null` when it is not a number. Rounded to the cent: a spreadsheet
|
|
162
|
+
* that computed `12.345` meant a price, not a third of a cent.
|
|
163
|
+
*/ export function parseImportAmountCents(value) {
|
|
164
|
+
if (typeof value === 'number') {
|
|
165
|
+
return Number.isFinite(value) && value >= 0 ? Math.round(value * 100) : null;
|
|
166
|
+
}
|
|
167
|
+
const text = String(value != null ? value : '').trim().replace(/[,\s]/g, '').replace(/^[^\d.-]+/, '');
|
|
168
|
+
if (!/^\d+(\.\d+)?$/.test(text)) return null;
|
|
169
|
+
const cents = Math.round(Number(text) * 100);
|
|
170
|
+
return Number.isFinite(cents) && cents <= DEAL_IMPORT_AMOUNT_CENTS_MAX ? cents : null;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* A date cell as epoch ms: a calendar day (`2026-09-30`) at noon UTC — a
|
|
174
|
+
* day, not an instant, so any zone reads the same date back — or an ISO
|
|
175
|
+
* instant as itself. `null` when it is neither.
|
|
176
|
+
*/ export function parseImportDate(value) {
|
|
177
|
+
const text = String(value != null ? value : '').trim();
|
|
178
|
+
const day = /^(\d{4})-(\d{2})-(\d{2})$/.exec(text);
|
|
179
|
+
if (day) {
|
|
180
|
+
const ms = Date.UTC(Number(day[1]), Number(day[2]) - 1, Number(day[3]), 12);
|
|
181
|
+
// `Date.UTC` rolls February 30 into March; a typed day that moved is not a day.
|
|
182
|
+
const back = new Date(ms);
|
|
183
|
+
return back.getUTCMonth() === Number(day[2]) - 1 && back.getUTCDate() === Number(day[3]) ? ms : null;
|
|
184
|
+
}
|
|
185
|
+
if (!/^\d{4}-\d{2}-\d{2}T/.test(text)) return null;
|
|
186
|
+
const ms = Date.parse(text);
|
|
187
|
+
return Number.isFinite(ms) ? ms : null;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* One raw row as the values that will be written, or the reason it cannot
|
|
191
|
+
* be. Refused here only for a missing title; the pipeline and the stage
|
|
192
|
+
* are refused by the server, which alone can look them up; every other
|
|
193
|
+
* unreadable cell is dropped and named.
|
|
194
|
+
*/ export function normalizeDealImportRow(raw) {
|
|
195
|
+
var _importTextValue;
|
|
196
|
+
const title = (_importTextValue = importTextValue(raw.title, DEAL_IMPORT_TITLE_MAX)) == null ? void 0 : _importTextValue.replace(/\s+/g, ' ');
|
|
197
|
+
if (!title) {
|
|
198
|
+
return {
|
|
199
|
+
ok: false,
|
|
200
|
+
reason: 'missing-title',
|
|
201
|
+
input: ''
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
const dropped = [];
|
|
205
|
+
const drop = (field, value)=>{
|
|
206
|
+
dropped.push({
|
|
207
|
+
field,
|
|
208
|
+
value: String(value != null ? value : '').trim()
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
const row = {
|
|
212
|
+
title,
|
|
213
|
+
dropped
|
|
214
|
+
};
|
|
215
|
+
const pipeline = importTextValue(raw.pipeline, 120);
|
|
216
|
+
if (pipeline) row.pipeline = pipeline;
|
|
217
|
+
const stage = importTextValue(raw.stage, 120);
|
|
218
|
+
if (stage) row.stage = stage;
|
|
219
|
+
const amountText = importTextValue(raw.amount, 64);
|
|
220
|
+
if (amountText) {
|
|
221
|
+
const cents = parseImportAmountCents(amountText);
|
|
222
|
+
if (cents !== null) row.amountCents = cents;
|
|
223
|
+
else drop('amount', amountText);
|
|
224
|
+
}
|
|
225
|
+
const currencyText = importTextValue(raw.currency, 16);
|
|
226
|
+
if (currencyText) {
|
|
227
|
+
const code = currencyText.toLowerCase();
|
|
228
|
+
if (/^[a-z]{3}$/.test(code)) row.currency = code;
|
|
229
|
+
else drop('currency', currencyText);
|
|
230
|
+
}
|
|
231
|
+
const ownerText = importTextValue(raw.ownerEmail, 320);
|
|
232
|
+
if (ownerText) {
|
|
233
|
+
const owner = normalizeContactEmail(ownerText);
|
|
234
|
+
if (owner) row.ownerEmail = owner;
|
|
235
|
+
else drop('ownerEmail', ownerText);
|
|
236
|
+
}
|
|
237
|
+
const closeText = importTextValue(raw.expectedClose, 64);
|
|
238
|
+
if (closeText) {
|
|
239
|
+
const ms = parseImportDate(closeText);
|
|
240
|
+
if (ms !== null) row.expectedCloseAtMs = ms;
|
|
241
|
+
else drop('expectedClose', closeText);
|
|
242
|
+
}
|
|
243
|
+
const notes = importTextValue(raw.notes, DEAL_IMPORT_NOTES_MAX);
|
|
244
|
+
if (notes) row.notes = notes;
|
|
245
|
+
return {
|
|
246
|
+
ok: true,
|
|
247
|
+
row
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
/** A name as the key two spellings of one pipeline or stage meet at. */ export function dealImportNameKey(name) {
|
|
251
|
+
return name.trim().replace(/\s+/g, ' ').toLowerCase();
|
|
252
|
+
}
|
|
253
|
+
export function emptyDealImportResult() {
|
|
254
|
+
return emptyImportResult();
|
|
255
|
+
}
|
|
256
|
+
export function mergeDealImportResults(total, chunk, offset = 0) {
|
|
257
|
+
return mergeImportResults(total, chunk, offset);
|
|
258
|
+
}
|
|
259
|
+
/** The skipped rows as a file the operator can fix and re-import. */ export function dealImportSkippedCsv(columns, entries) {
|
|
260
|
+
return importSkippedCsv(columns, entries, DEAL_IMPORT_SKIP_LABELS);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
//# sourceMappingURL=crm-deal-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/crm-deal-import.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 * BRINGING A SPREADSHEET OF DEALS INTO THE CRM — the pure half (AGL-2662).\n *\n * The contact import's three stages (`crm-import.ts`) over the deal\n * vocabulary: a header row is matched to a proposed mapping, one line is\n * mapped to a raw row of verbatim strings, and the server normalizes each\n * row here before it resolves the two names a deal cannot be filed without.\n *\n * ## A deal names its pipeline and its stage by NAME\n *\n * A spreadsheet says \"Sales\" and \"Proposal sent\", never a document id, so\n * the file carries names and the server resolves them against the org's\n * own pipelines — case-insensitively, trimmed — and REFUSES the row, by\n * name, when it cannot: an unknown pipeline is `unknown-pipeline`, an\n * unknown stage in a known pipeline `unknown-stage`. A row with no\n * pipeline cell lands in the default pipeline, and one with no stage cell\n * in that pipeline's first open stage, the way the deal drawer opens.\n *\n * ## A deal has no key, so nothing is merged\n *\n * A contact is one address and a company one domain, but two deals titled\n * \"Renewal\" are two deals. Every row CREATES; importing a file twice files\n * it twice. What is refused is refused before any write.\n *\n * ## A bad cell is dropped and named; a bad row is skipped and named\n *\n * The contact import's rule: an amount that is not a number, a currency\n * that is not a code, a close date that is not a date, an owner address\n * that is not an address — each is left off the record and REPORTED under\n * {@link DealImportRow.dropped}, never silently discarded.\n */\n\nimport { normalizeContactEmail } from '@aglyn/aglyn/app-utils/contacts'\nimport {\n CSV_IMPORT_CHUNK_SIZE,\n CSV_IMPORT_MAX_BODY_BYTES,\n CSV_IMPORT_MAX_ROWS,\n CSV_IMPORT_PREVIEW_ROWS,\n emptyImportResult,\n guessImportMapping,\n importAliasKeys,\n type ImportChunkResult,\n type ImportDroppedValue,\n importSkippedCsv,\n importTextValue,\n mapImportRow,\n mergeImportResults,\n} from '@aglyn/aglyn/app-utils/csv-import'\n\n/** The shared ceilings, under this collection's names. */\nexport const DEAL_IMPORT_MAX_ROWS = CSV_IMPORT_MAX_ROWS\nexport const DEAL_IMPORT_CHUNK_SIZE = CSV_IMPORT_CHUNK_SIZE\nexport const DEAL_IMPORT_MAX_BODY_BYTES = CSV_IMPORT_MAX_BODY_BYTES\nexport const DEAL_IMPORT_PREVIEW_ROWS = CSV_IMPORT_PREVIEW_ROWS\n\n/** The same caps the deal drawer holds a typed deal to. */\nexport const DEAL_IMPORT_TITLE_MAX = 120\nexport const DEAL_IMPORT_NOTES_MAX = 4000\n/** The most cents one row may carry — past this the number is a slip. */\nexport const DEAL_IMPORT_AMOUNT_CENTS_MAX = 1_000_000_000_000\n\n/** The fields a column may be mapped to, in the order the mapping menu lists them. */\nexport const DEAL_IMPORT_FIELDS = [\n 'title',\n 'pipeline',\n 'stage',\n 'amount',\n 'currency',\n 'ownerEmail',\n 'expectedClose',\n 'notes',\n] as const\n\nexport type DealImportField = (typeof DEAL_IMPORT_FIELDS)[number]\n\n/** How each field reads in the mapping menu. Typed so a field cannot ship unlabeled. */\nexport const DEAL_IMPORT_FIELD_LABELS: Record<DealImportField, string> = {\n title: 'Title (required)',\n pipeline: 'Pipeline (by name)',\n stage: 'Stage (by name)',\n amount: 'Amount (major units, 1250.00)',\n currency: 'Currency (three-letter code)',\n ownerEmail: 'Owner (team member email)',\n expectedClose: 'Expected close (YYYY-MM-DD)',\n notes: 'Notes',\n}\n\n/**\n * Header aliases per field, matched after the shared header normalization.\n *\n * First in each list is the header this CRM's own deals export writes, so\n * an export re-imports without a hand mapping; the export's Status,\n * Contact, Company, Closed and Lost reason columns are deliberately\n * absent, because the stage decides the status and a link is made on the\n * record, not from a file.\n */\nconst FIELD_ALIASES: Record<DealImportField, readonly string[]> = {\n title: ['title', 'deal', 'deal name', 'deal title', 'name', 'opportunity', 'opportunity name'],\n pipeline: ['pipeline', 'pipeline name', 'board'],\n stage: ['stage', 'stage name', 'deal stage', 'step'],\n amount: ['amount', 'value', 'deal value', 'deal amount', 'total', 'price'],\n currency: ['currency', 'currency code'],\n ownerEmail: ['owner', 'owner email', 'deal owner', 'assigned to', 'rep'],\n expectedClose: ['expected close', 'close date', 'expected close date', 'closing date', 'expected closing'],\n notes: ['notes', 'note', 'description', 'comments'],\n}\n\nconst FIELD_ALIAS_KEYS = importAliasKeys(DEAL_IMPORT_FIELDS, FIELD_ALIASES)\n\n/** Column index → field. A column absent from the map is not imported. */\nexport type DealImportMapping = Record<number, DealImportField>\n\n/** A proposed mapping from a file's header row, each field taken at most once. */\nexport function guessDealImportMapping(columns: readonly string[]): DealImportMapping {\n return guessImportMapping(columns, DEAL_IMPORT_FIELDS, FIELD_ALIAS_KEYS)\n}\n\n/**\n * What the browser posts for one line: the cells the mapping selected,\n * under the field they were mapped to, verbatim. `unknown` because the\n * server reads this off an untrusted body.\n */\nexport type DealImportRawRow = Partial<Record<DealImportField, unknown>>\n\n/**\n * One parsed line under the mapping. Empty cells are left absent. A deal\n * has no custom fields yet, so a custom target the shared drawer could\n * name is dropped here rather than refused at the type.\n */\nexport function mapDealImportRow(\n cells: readonly string[],\n mapping: Record<number, DealImportField | `custom:${string}`>,\n): DealImportRawRow {\n const { custom: _custom, ...row } = mapImportRow(cells, mapping)\n return row\n}\n\nexport type DealImportSkipReason =\n | 'missing-title'\n | 'unknown-pipeline'\n | 'unknown-stage'\n | 'records-band'\n | 'write-failed'\n\n/** How a skip reason reads on screen and in the downloaded file. */\nexport const DEAL_IMPORT_SKIP_LABELS: Record<DealImportSkipReason, string> = {\n 'missing-title': 'No title',\n 'unknown-pipeline': 'No pipeline by that name',\n 'unknown-stage': 'No stage by that name in that pipeline',\n 'records-band': 'CRM records limit reached',\n 'write-failed': 'Could not be saved',\n}\n\n/** One row, ready for the server to resolve and write. */\nexport interface DealImportRow {\n title: string\n /** The pipeline's name as typed, trimmed; absent means the default pipeline. */\n pipeline?: string\n /** The stage's name as typed, trimmed; absent means the pipeline's first open stage. */\n stage?: string\n amountCents?: number\n /** Lowercase ISO 4217. */\n currency?: string\n /** Normalized, for the server to resolve against the org's members. */\n ownerEmail?: string\n /** Epoch ms at noon UTC of the typed calendar day, or the typed instant. */\n expectedCloseAtMs?: number\n notes?: string\n dropped: ImportDroppedValue[]\n}\n\nexport type DealImportRowVerdict =\n | { ok: true; row: DealImportRow }\n | { ok: false; reason: 'missing-title'; input: string }\n\n/**\n * A money cell as cents — `1,250.00`, `$1250`, `1250` → 125000 — or\n * `null` when it is not a number. Rounded to the cent: a spreadsheet\n * that computed `12.345` meant a price, not a third of a cent.\n */\nexport function parseImportAmountCents(value: unknown): number | null {\n if (typeof value === 'number') {\n return Number.isFinite(value) && value >= 0 ? Math.round(value * 100) : null\n }\n const text = String(value ?? '')\n .trim()\n .replace(/[,\\s]/g, '')\n .replace(/^[^\\d.-]+/, '')\n if (!/^\\d+(\\.\\d+)?$/.test(text)) return null\n const cents = Math.round(Number(text) * 100)\n return Number.isFinite(cents) && cents <= DEAL_IMPORT_AMOUNT_CENTS_MAX ? cents : null\n}\n\n/**\n * A date cell as epoch ms: a calendar day (`2026-09-30`) at noon UTC — a\n * day, not an instant, so any zone reads the same date back — or an ISO\n * instant as itself. `null` when it is neither.\n */\nexport function parseImportDate(value: unknown): number | null {\n const text = String(value ?? '').trim()\n const day = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(text)\n if (day) {\n const ms = Date.UTC(Number(day[1]), Number(day[2]) - 1, Number(day[3]), 12)\n // `Date.UTC` rolls February 30 into March; a typed day that moved is not a day.\n const back = new Date(ms)\n return back.getUTCMonth() === Number(day[2]) - 1 && back.getUTCDate() === Number(day[3])\n ? ms\n : null\n }\n if (!/^\\d{4}-\\d{2}-\\d{2}T/.test(text)) return null\n const ms = Date.parse(text)\n return Number.isFinite(ms) ? ms : null\n}\n\n/**\n * One raw row as the values that will be written, or the reason it cannot\n * be. Refused here only for a missing title; the pipeline and the stage\n * are refused by the server, which alone can look them up; every other\n * unreadable cell is dropped and named.\n */\nexport function normalizeDealImportRow(raw: DealImportRawRow): DealImportRowVerdict {\n const title = importTextValue(raw.title, DEAL_IMPORT_TITLE_MAX)?.replace(/\\s+/g, ' ')\n if (!title) {\n return { ok: false, reason: 'missing-title', input: '' }\n }\n const dropped: ImportDroppedValue[] = []\n const drop = (field: DealImportField, value: unknown) => {\n dropped.push({ field, value: String(value ?? '').trim() })\n }\n const row: DealImportRow = { title, dropped }\n\n const pipeline = importTextValue(raw.pipeline, 120)\n if (pipeline) row.pipeline = pipeline\n const stage = importTextValue(raw.stage, 120)\n if (stage) row.stage = stage\n\n const amountText = importTextValue(raw.amount, 64)\n if (amountText) {\n const cents = parseImportAmountCents(amountText)\n if (cents !== null) row.amountCents = cents\n else drop('amount', amountText)\n }\n\n const currencyText = importTextValue(raw.currency, 16)\n if (currencyText) {\n const code = currencyText.toLowerCase()\n if (/^[a-z]{3}$/.test(code)) row.currency = code\n else drop('currency', currencyText)\n }\n\n const ownerText = importTextValue(raw.ownerEmail, 320)\n if (ownerText) {\n const owner = normalizeContactEmail(ownerText)\n if (owner) row.ownerEmail = owner\n else drop('ownerEmail', ownerText)\n }\n\n const closeText = importTextValue(raw.expectedClose, 64)\n if (closeText) {\n const ms = parseImportDate(closeText)\n if (ms !== null) row.expectedCloseAtMs = ms\n else drop('expectedClose', closeText)\n }\n\n const notes = importTextValue(raw.notes, DEAL_IMPORT_NOTES_MAX)\n if (notes) row.notes = notes\n\n return { ok: true, row }\n}\n\n/** A name as the key two spellings of one pipeline or stage meet at. */\nexport function dealImportNameKey(name: string): string {\n return name.trim().replace(/\\s+/g, ' ').toLowerCase()\n}\n\n/** One row the server did not store, by its index in the request, named by the deal. */\nexport interface DealImportSkippedRow {\n index: number\n title: string\n reason: DealImportSkipReason\n}\n\n/** What one request did. The drawer sums these across a file. */\nexport type DealImportChunkResult = ImportChunkResult<DealImportSkippedRow>\n\nexport function emptyDealImportResult(): DealImportChunkResult {\n return emptyImportResult<DealImportSkippedRow>()\n}\n\nexport function mergeDealImportResults(\n total: DealImportChunkResult,\n chunk: DealImportChunkResult,\n offset = 0,\n): DealImportChunkResult {\n return mergeImportResults(total, chunk, offset)\n}\n\n/** The skipped rows as a file the operator can fix and re-import. */\nexport function dealImportSkippedCsv(\n columns: readonly string[],\n entries: readonly { cells: readonly string[]; reason: DealImportSkipReason }[],\n): string {\n return importSkippedCsv(columns, entries, DEAL_IMPORT_SKIP_LABELS)\n}\n"],"names":["normalizeContactEmail","CSV_IMPORT_CHUNK_SIZE","CSV_IMPORT_MAX_BODY_BYTES","CSV_IMPORT_MAX_ROWS","CSV_IMPORT_PREVIEW_ROWS","emptyImportResult","guessImportMapping","importAliasKeys","importSkippedCsv","importTextValue","mapImportRow","mergeImportResults","DEAL_IMPORT_MAX_ROWS","DEAL_IMPORT_CHUNK_SIZE","DEAL_IMPORT_MAX_BODY_BYTES","DEAL_IMPORT_PREVIEW_ROWS","DEAL_IMPORT_TITLE_MAX","DEAL_IMPORT_NOTES_MAX","DEAL_IMPORT_AMOUNT_CENTS_MAX","DEAL_IMPORT_FIELDS","DEAL_IMPORT_FIELD_LABELS","title","pipeline","stage","amount","currency","ownerEmail","expectedClose","notes","FIELD_ALIASES","FIELD_ALIAS_KEYS","guessDealImportMapping","columns","mapDealImportRow","cells","mapping","custom","_custom","row","DEAL_IMPORT_SKIP_LABELS","parseImportAmountCents","value","Number","isFinite","Math","round","text","String","trim","replace","test","cents","parseImportDate","day","exec","ms","Date","UTC","back","getUTCMonth","getUTCDate","parse","normalizeDealImportRow","raw","ok","reason","input","dropped","drop","field","push","amountText","amountCents","currencyText","code","toLowerCase","ownerText","owner","closeText","expectedCloseAtMs","dealImportNameKey","name","emptyDealImportResult","mergeDealImportResults","total","chunk","offset","dealImportSkippedCsv","entries"],"mappings":"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"}
|