@aglyn/plugins-crm 1.0.0-beta.221 → 1.0.0-beta.223
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/README.md +2 -1
- package/package.json +13 -13
- package/src/lib/components/activity-list.js +12 -5
- package/src/lib/components/activity-list.js.map +1 -1
- package/src/lib/components/companies-bulk-bar.d.ts +1 -4
- package/src/lib/components/companies-bulk-bar.js +7 -20
- package/src/lib/components/companies-bulk-bar.js.map +1 -1
- package/src/lib/components/companies-section.d.ts +3 -3
- package/src/lib/components/companies-section.js +149 -46
- package/src/lib/components/companies-section.js.map +1 -1
- package/src/lib/components/company-edit-drawer.js +281 -20
- package/src/lib/components/company-edit-drawer.js.map +1 -1
- package/src/lib/components/company-properties-card.js +99 -8
- package/src/lib/components/company-properties-card.js.map +1 -1
- package/src/lib/components/contact-detail-page.js +3 -1
- package/src/lib/components/contact-detail-page.js.map +1 -1
- package/src/lib/components/contact-merge-dialog.js +33 -10
- package/src/lib/components/contact-merge-dialog.js.map +1 -1
- package/src/lib/components/contact-properties-card.d.ts +0 -69
- package/src/lib/components/contact-properties-card.js +350 -60
- package/src/lib/components/contact-properties-card.js.map +1 -1
- package/src/lib/components/contact-reports-to-field.d.ts +46 -0
- package/src/lib/components/contact-reports-to-field.js +67 -0
- package/src/lib/components/contact-reports-to-field.js.map +1 -0
- package/src/lib/components/contacts-bulk-bar.d.ts +1 -8
- package/src/lib/components/contacts-bulk-bar.js +7 -19
- package/src/lib/components/contacts-bulk-bar.js.map +1 -1
- package/src/lib/components/contacts-section.js +46 -33
- package/src/lib/components/contacts-section.js.map +1 -1
- package/src/lib/components/crm-call-actions.d.ts +10 -0
- package/src/lib/components/crm-call-actions.js +26 -9
- package/src/lib/components/crm-call-actions.js.map +1 -1
- package/src/lib/components/crm-next-activity-column.js +1 -1
- package/src/lib/components/crm-next-activity-column.js.map +1 -1
- package/src/lib/components/crm-record-picker.d.ts +15 -0
- package/src/lib/components/crm-record-picker.js +16 -10
- package/src/lib/components/crm-record-picker.js.map +1 -1
- package/src/lib/components/crm-transfer-buttons.d.ts +54 -0
- package/src/lib/components/crm-transfer-buttons.js +167 -0
- package/src/lib/components/crm-transfer-buttons.js.map +1 -0
- package/src/lib/components/deal-contact-roles-card.d.ts +46 -0
- package/src/lib/components/deal-contact-roles-card.js +368 -0
- package/src/lib/components/deal-contact-roles-card.js.map +1 -0
- package/src/lib/components/deal-detail-page.d.ts +3 -2
- package/src/lib/components/deal-detail-page.js +25 -6
- package/src/lib/components/deal-detail-page.js.map +1 -1
- package/src/lib/components/deal-edit-drawer.d.ts +10 -0
- package/src/lib/components/deal-edit-drawer.js +219 -10
- package/src/lib/components/deal-edit-drawer.js.map +1 -1
- package/src/lib/components/deal-properties-card.d.ts +7 -0
- package/src/lib/components/deal-properties-card.js +34 -3
- package/src/lib/components/deal-properties-card.js.map +1 -1
- package/src/lib/components/deal-stage-card.d.ts +4 -0
- package/src/lib/components/deal-stage-card.js +10 -2
- package/src/lib/components/deal-stage-card.js.map +1 -1
- package/src/lib/components/deals-bulk-bar.d.ts +0 -3
- package/src/lib/components/deals-bulk-bar.js +7 -20
- package/src/lib/components/deals-bulk-bar.js.map +1 -1
- package/src/lib/components/deals-section.d.ts +3 -3
- package/src/lib/components/deals-section.js +123 -63
- package/src/lib/components/deals-section.js.map +1 -1
- package/src/lib/components/fields-section.js +31 -17
- package/src/lib/components/fields-section.js.map +1 -1
- package/src/lib/components/lead-convert-dialog.d.ts +4 -0
- package/src/lib/components/lead-convert-dialog.js +23 -1
- package/src/lib/components/lead-convert-dialog.js.map +1 -1
- package/src/lib/components/lead-detail-page.js +8 -2
- package/src/lib/components/lead-detail-page.js.map +1 -1
- package/src/lib/components/lead-profile-fields.d.ts +71 -0
- package/src/lib/components/lead-profile-fields.js +386 -0
- package/src/lib/components/lead-profile-fields.js.map +1 -0
- package/src/lib/components/lead-properties-card.d.ts +2 -1
- package/src/lib/components/lead-properties-card.js +85 -176
- package/src/lib/components/lead-properties-card.js.map +1 -1
- package/src/lib/components/lead-source-select.d.ts +4 -23
- package/src/lib/components/lead-source-select.js +9 -73
- package/src/lib/components/lead-source-select.js.map +1 -1
- package/src/lib/components/lead-status-chip.d.ts +9 -3
- package/src/lib/components/lead-status-chip.js +8 -4
- package/src/lib/components/lead-status-chip.js.map +1 -1
- package/src/lib/components/lead-status-options.d.ts +20 -0
- package/src/lib/components/lead-status-options.js +51 -0
- package/src/lib/components/lead-status-options.js.map +1 -0
- package/src/lib/components/lead-unqualify-dialog.d.ts +5 -0
- package/src/lib/components/lead-unqualify-dialog.js +50 -18
- package/src/lib/components/lead-unqualify-dialog.js.map +1 -1
- package/src/lib/components/leads-bulk-bar.d.ts +0 -3
- package/src/lib/components/leads-bulk-bar.js +29 -29
- package/src/lib/components/leads-bulk-bar.js.map +1 -1
- package/src/lib/components/leads-section.js +120 -68
- package/src/lib/components/leads-section.js.map +1 -1
- package/src/lib/components/linked-deals-card.d.ts +4 -0
- package/src/lib/components/linked-deals-card.js +47 -3
- package/src/lib/components/linked-deals-card.js.map +1 -1
- package/src/lib/components/log-activity-dialog.js +43 -3
- package/src/lib/components/log-activity-dialog.js.map +1 -1
- package/src/lib/components/new-contact-drawer.d.ts +8 -0
- package/src/lib/components/new-contact-drawer.js +108 -6
- package/src/lib/components/new-contact-drawer.js.map +1 -1
- package/src/lib/components/new-lead-drawer.d.ts +9 -2
- package/src/lib/components/new-lead-drawer.js +88 -121
- package/src/lib/components/new-lead-drawer.js.map +1 -1
- package/src/lib/components/picklist-select.d.ts +36 -0
- package/src/lib/components/picklist-select.js +114 -0
- package/src/lib/components/picklist-select.js.map +1 -0
- package/src/lib/components/picklist-values-card.d.ts +34 -0
- package/src/lib/components/{lead-source-values-card.js → picklist-values-card.js} +241 -58
- package/src/lib/components/picklist-values-card.js.map +1 -0
- package/src/lib/components/pipeline-stages-dialog.d.ts +7 -0
- package/src/lib/components/pipeline-stages-dialog.js +26 -4
- package/src/lib/components/pipeline-stages-dialog.js.map +1 -1
- package/src/lib/components/pipelines-dialog.js +15 -6
- package/src/lib/components/pipelines-dialog.js.map +1 -1
- package/src/lib/components/recent-activity-feed.js +20 -5
- package/src/lib/components/recent-activity-feed.js.map +1 -1
- package/src/lib/components/recipes-card.js +4 -2
- package/src/lib/components/recipes-card.js.map +1 -1
- package/src/lib/components/record-tasks-card.js +15 -8
- package/src/lib/components/record-tasks-card.js.map +1 -1
- package/src/lib/components/reports/forecast-card.d.ts +6 -0
- package/src/lib/components/reports/forecast-card.js +101 -3
- package/src/lib/components/reports/forecast-card.js.map +1 -1
- package/src/lib/components/reports/lead-funnel-card.d.ts +12 -0
- package/src/lib/components/reports/lead-funnel-card.js +9 -5
- package/src/lib/components/reports/lead-funnel-card.js.map +1 -1
- package/src/lib/components/reports/lead-source-card.d.ts +23 -0
- package/src/lib/components/reports/lead-source-card.js +318 -0
- package/src/lib/components/reports/lead-source-card.js.map +1 -0
- package/src/lib/components/reports/pipeline-card.js +2 -1
- package/src/lib/components/reports/pipeline-card.js.map +1 -1
- package/src/lib/components/reports/report-export.js +1 -1
- package/src/lib/components/reports/report-export.js.map +1 -1
- package/src/lib/components/reports-section.js +8 -0
- package/src/lib/components/reports-section.js.map +1 -1
- package/src/lib/components/sharing-rule-drawer.d.ts +5 -0
- package/src/lib/components/sharing-rule-drawer.js +108 -19
- package/src/lib/components/sharing-rule-drawer.js.map +1 -1
- package/src/lib/components/sharing-rules-card.js +11 -3
- package/src/lib/components/sharing-rules-card.js.map +1 -1
- package/src/lib/components/task-cells.d.ts +9 -1
- package/src/lib/components/task-cells.js +9 -4
- package/src/lib/components/task-cells.js.map +1 -1
- package/src/lib/components/task-edit-drawer.js +111 -43
- package/src/lib/components/task-edit-drawer.js.map +1 -1
- package/src/lib/components/tasks-bulk-bar.d.ts +0 -3
- package/src/lib/components/tasks-bulk-bar.js +7 -20
- package/src/lib/components/tasks-bulk-bar.js.map +1 -1
- package/src/lib/components/tasks-calendar.d.ts +3 -0
- package/src/lib/components/tasks-calendar.js +8 -1
- package/src/lib/components/tasks-calendar.js.map +1 -1
- package/src/lib/components/tasks-section.d.ts +3 -3
- package/src/lib/components/tasks-section.js +58 -43
- package/src/lib/components/tasks-section.js.map +1 -1
- package/src/lib/constants/api-routes.d.ts +2 -9
- package/src/lib/constants/api-routes.js +1 -7
- package/src/lib/constants/api-routes.js.map +1 -1
- package/src/lib/constants/bundle-common.d.ts +6 -0
- package/src/lib/constants/bundle-common.js +11 -0
- package/src/lib/constants/bundle-common.js.map +1 -1
- package/src/lib/constants/company-filters.d.ts +14 -0
- package/src/lib/constants/company-filters.js +51 -1
- package/src/lib/constants/company-filters.js.map +1 -1
- package/src/lib/constants/contact-filters.d.ts +2 -0
- package/src/lib/constants/contact-filters.js +18 -1
- package/src/lib/constants/contact-filters.js.map +1 -1
- package/src/lib/constants/deal-filters.d.ts +22 -1
- package/src/lib/constants/deal-filters.js +67 -4
- package/src/lib/constants/deal-filters.js.map +1 -1
- package/src/lib/declarations.console-server.d.ts +3 -0
- package/src/lib/declarations.console-server.js +35 -0
- package/src/lib/declarations.console-server.js.map +1 -1
- package/src/lib/declarations.d.ts +26 -0
- package/src/lib/declarations.js +35 -0
- package/src/lib/declarations.js.map +1 -0
- package/src/lib/declarations.server.d.ts +11 -0
- package/src/lib/declarations.server.js +97 -1
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/hooks/use-company-picklists.d.ts +15 -0
- package/src/lib/hooks/use-company-picklists.js +55 -0
- package/src/lib/hooks/use-company-picklists.js.map +1 -0
- package/src/lib/hooks/use-crm-picklist.d.ts +25 -0
- package/src/lib/hooks/use-crm-picklist.js +53 -0
- package/src/lib/hooks/use-crm-picklist.js.map +1 -0
- package/src/lib/hooks/use-crm-record-names.d.ts +16 -0
- package/src/lib/hooks/use-crm-record-names.js +45 -19
- package/src/lib/hooks/use-crm-record-names.js.map +1 -1
- package/src/lib/hooks/use-crm-task-picklists.d.ts +11 -0
- package/src/lib/hooks/use-crm-task-picklists.js +45 -0
- package/src/lib/hooks/use-crm-task-picklists.js.map +1 -0
- package/src/lib/hooks/use-deals.d.ts +14 -0
- package/src/lib/hooks/use-deals.js +29 -0
- package/src/lib/hooks/use-deals.js.map +1 -1
- package/src/lib/hooks/use-lead-picklists.d.ts +14 -0
- package/src/lib/hooks/use-lead-picklists.js +46 -0
- package/src/lib/hooks/use-lead-picklists.js.map +1 -0
- package/src/lib/hooks/use-lead-source-picklist.d.ts +5 -19
- package/src/lib/hooks/use-lead-source-picklist.js +12 -22
- package/src/lib/hooks/use-lead-source-picklist.js.map +1 -1
- package/src/lib/hooks/use-lead-status-picklist.d.ts +9 -0
- package/src/lib/hooks/use-lead-status-picklist.js +40 -0
- package/src/lib/hooks/use-lead-status-picklist.js.map +1 -0
- package/src/lib/model/companies.d.ts +32 -3
- package/src/lib/model/companies.js +133 -16
- package/src/lib/model/companies.js.map +1 -1
- package/src/lib/model/contact-merge.d.ts +27 -3
- package/src/lib/model/contact-merge.js +81 -7
- package/src/lib/model/contact-merge.js.map +1 -1
- package/src/lib/model/contact-record.d.ts +17 -0
- package/src/lib/model/contact-record.js +17 -2
- package/src/lib/model/contact-record.js.map +1 -1
- package/src/lib/model/contact-update.d.ts +31 -2
- package/src/lib/model/contact-update.js +14 -0
- package/src/lib/model/contact-update.js.map +1 -1
- package/src/lib/model/crm-list-query.d.ts +5 -0
- package/src/lib/model/crm-list-query.js +8 -0
- package/src/lib/model/crm-list-query.js.map +1 -1
- package/src/lib/model/crm-next-activity.d.ts +107 -0
- package/src/lib/model/crm-next-activity.js +140 -0
- package/src/lib/model/crm-next-activity.js.map +1 -0
- package/src/lib/model/crm-recipes.d.ts +40 -0
- package/src/lib/model/crm-recipes.js +259 -0
- package/src/lib/model/crm-recipes.js.map +1 -0
- package/src/lib/model/crm-record-counts.d.ts +36 -0
- package/src/lib/model/crm-record-counts.js +54 -0
- package/src/lib/model/crm-record-counts.js.map +1 -0
- package/src/lib/model/crm-record-lists.d.ts +23 -0
- package/src/lib/model/crm-record-lists.js +161 -0
- package/src/lib/model/crm-record-lists.js.map +1 -0
- package/src/lib/model/crm-reports.d.ts +73 -3
- package/src/lib/model/crm-reports.js +120 -1
- package/src/lib/model/crm-reports.js.map +1 -1
- package/src/lib/model/crm-sharing.d.ts +21 -3
- package/src/lib/model/crm-sharing.js +27 -6
- package/src/lib/model/crm-sharing.js.map +1 -1
- package/src/lib/model/crm-task-reminders.d.ts +152 -0
- package/src/lib/model/crm-task-reminders.js +161 -0
- package/src/lib/model/crm-task-reminders.js.map +1 -0
- package/src/lib/model/deal-board-model.d.ts +8 -2
- package/src/lib/model/deal-board-model.js +15 -2
- package/src/lib/model/deal-board-model.js.map +1 -1
- package/src/lib/model/deal-contact-roles.d.ts +45 -0
- package/src/lib/model/deal-contact-roles.js +73 -0
- package/src/lib/model/deal-contact-roles.js.map +1 -0
- package/src/lib/model/deal-form-model.d.ts +56 -0
- package/src/lib/model/deal-form-model.js +79 -7
- package/src/lib/model/deal-form-model.js.map +1 -1
- package/src/lib/model/download-text-file.d.ts +23 -0
- package/src/lib/model/download-text-file.js +34 -0
- package/src/lib/model/download-text-file.js.map +1 -0
- package/src/lib/model/lead-filters.d.ts +36 -2
- package/src/lib/model/lead-filters.js +123 -2
- package/src/lib/model/lead-filters.js.map +1 -1
- package/src/lib/model/lead-source-direction.d.ts +38 -0
- package/src/lib/model/lead-source-direction.js +52 -0
- package/src/lib/model/lead-source-direction.js.map +1 -0
- package/src/lib/model/next-activity.d.ts +1 -1
- package/src/lib/model/next-activity.js.map +1 -1
- package/src/lib/model/picklist-values.d.ts +119 -0
- package/src/lib/model/picklist-values.js +256 -0
- package/src/lib/model/picklist-values.js.map +1 -0
- package/src/lib/model/record-facts-disclosed.d.ts +81 -0
- package/src/lib/model/record-facts-disclosed.js +281 -0
- package/src/lib/model/record-facts-disclosed.js.map +1 -0
- package/src/lib/model/record-facts.d.ts +215 -34
- package/src/lib/model/record-facts.js +307 -128
- package/src/lib/model/record-facts.js.map +1 -1
- package/src/lib/model/task-picklists.d.ts +52 -0
- package/src/lib/model/task-picklists.js +83 -0
- package/src/lib/model/task-picklists.js.map +1 -0
- package/src/lib/model/task-routes.d.ts +13 -0
- package/src/lib/model/task-routes.js +23 -4
- package/src/lib/model/task-routes.js.map +1 -1
- package/src/lib/plan-entitlements.js +6 -4
- package/src/lib/plan-entitlements.js.map +1 -1
- package/src/lib/plugin.js +17 -0
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/server/api-v1/contacts.js +220 -14
- package/src/lib/server/api-v1/contacts.js.map +1 -1
- package/src/lib/server/api-v1/crm-activities.js +14 -1
- package/src/lib/server/api-v1/crm-activities.js.map +1 -1
- package/src/lib/server/api-v1/crm-companies.js +123 -14
- package/src/lib/server/api-v1/crm-companies.js.map +1 -1
- package/src/lib/server/api-v1/crm-deals.js +291 -26
- package/src/lib/server/api-v1/crm-deals.js.map +1 -1
- package/src/lib/server/api-v1/crm-leads.js +144 -38
- package/src/lib/server/api-v1/crm-leads.js.map +1 -1
- package/src/lib/server/api-v1/crm-pipelines.d.ts +6 -0
- package/src/lib/server/api-v1/crm-pipelines.js +8 -2
- package/src/lib/server/api-v1/crm-pipelines.js.map +1 -1
- package/src/lib/server/api-v1/crm-tasks.js +78 -34
- package/src/lib/server/api-v1/crm-tasks.js.map +1 -1
- package/src/lib/server/api-v1/openapi.d.ts +0 -11
- package/src/lib/server/api-v1/openapi.js +171 -16
- package/src/lib/server/api-v1/openapi.js.map +1 -1
- package/src/lib/server/assign-contact-owner.d.ts +188 -0
- package/src/lib/server/assign-contact-owner.js +446 -0
- package/src/lib/server/assign-contact-owner.js.map +1 -0
- package/src/lib/server/associate-company-by-domain.d.ts +70 -0
- package/src/lib/server/associate-company-by-domain.js +153 -0
- package/src/lib/server/associate-company-by-domain.js.map +1 -0
- package/src/lib/server/automation-steps.d.ts +140 -0
- package/src/lib/server/automation-steps.js +669 -0
- package/src/lib/server/automation-steps.js.map +1 -0
- package/src/lib/server/capture-contact.d.ts +17 -0
- package/src/lib/server/capture-contact.js +95 -26
- package/src/lib/server/capture-contact.js.map +1 -1
- package/src/lib/server/capture-host-contact.d.ts +104 -0
- package/src/lib/server/capture-host-contact.js +151 -0
- package/src/lib/server/capture-host-contact.js.map +1 -0
- package/src/lib/server/company-children.d.ts +25 -0
- package/src/lib/server/company-children.js +42 -0
- package/src/lib/server/company-children.js.map +1 -0
- package/src/lib/server/company-delete.d.ts +18 -0
- package/src/lib/server/company-delete.js +44 -21
- package/src/lib/server/company-delete.js.map +1 -1
- package/src/lib/server/contact-email-history.js +21 -19
- package/src/lib/server/contact-email-history.js.map +1 -1
- package/src/lib/server/contact-remove.js +27 -2
- package/src/lib/server/contact-remove.js.map +1 -1
- package/src/lib/server/contact-reports-to.d.ts +61 -0
- package/src/lib/server/contact-reports-to.js +114 -0
- package/src/lib/server/contact-reports-to.js.map +1 -0
- package/src/lib/server/contact-update.d.ts +42 -1
- package/src/lib/server/contact-update.js +204 -23
- package/src/lib/server/contact-update.js.map +1 -1
- package/src/lib/server/convert-host-lead.d.ts +46 -1
- package/src/lib/server/convert-host-lead.js +173 -15
- package/src/lib/server/convert-host-lead.js.map +1 -1
- package/src/lib/server/convert-open-lead.js +12 -5
- package/src/lib/server/convert-open-lead.js.map +1 -1
- package/src/lib/server/crm-email-activity.d.ts +118 -0
- package/src/lib/server/crm-email-activity.js +148 -0
- package/src/lib/server/crm-email-activity.js.map +1 -0
- package/src/lib/server/crm-inbound-email.js +1 -1
- package/src/lib/server/crm-inbound-email.js.map +1 -1
- package/src/lib/server/crm-next-activity.d.ts +74 -0
- package/src/lib/server/crm-next-activity.js +194 -0
- package/src/lib/server/crm-next-activity.js.map +1 -0
- package/src/lib/server/crm-record-indexes.d.ts +45 -0
- package/src/lib/server/crm-record-indexes.js +78 -0
- package/src/lib/server/crm-record-indexes.js.map +1 -0
- package/src/lib/server/crm-sharing.d.ts +9 -1
- package/src/lib/server/crm-sharing.js +23 -3
- package/src/lib/server/crm-sharing.js.map +1 -1
- package/src/lib/server/deal-contact-roles.d.ts +27 -0
- package/src/lib/server/deal-contact-roles.js +89 -0
- package/src/lib/server/deal-contact-roles.js.map +1 -0
- package/src/lib/server/email-send.js +2 -1
- package/src/lib/server/email-send.js.map +1 -1
- package/src/lib/server/lead-convert.d.ts +5 -0
- package/src/lib/server/lead-convert.js +19 -3
- package/src/lib/server/lead-convert.js.map +1 -1
- package/src/lib/server/lead-create.d.ts +17 -2
- package/src/lib/server/lead-create.js +46 -14
- package/src/lib/server/lead-create.js.map +1 -1
- package/src/lib/server/lead-nurturing.d.ts +6 -0
- package/src/lib/server/lead-nurturing.js +57 -20
- package/src/lib/server/lead-nurturing.js.map +1 -1
- package/src/lib/server/lead-picklists.d.ts +35 -0
- package/src/lib/server/lead-picklists.js +52 -0
- package/src/lib/server/lead-picklists.js.map +1 -0
- package/src/lib/server/lead-source-picklist.d.ts +1 -13
- package/src/lib/server/lead-source-picklist.js +6 -33
- package/src/lib/server/lead-source-picklist.js.map +1 -1
- package/src/lib/server/merge-contacts.js +23 -5
- package/src/lib/server/merge-contacts.js.map +1 -1
- package/src/lib/server/next-activity-routes.js +2 -1
- package/src/lib/server/next-activity-routes.js.map +1 -1
- package/src/lib/server/person-eraser.d.ts +53 -0
- package/src/lib/server/person-eraser.js +149 -0
- package/src/lib/server/person-eraser.js.map +1 -0
- package/src/lib/server/person-records.d.ts +69 -0
- package/src/lib/server/person-records.js +317 -0
- package/src/lib/server/person-records.js.map +1 -0
- package/src/lib/server/person-refund.d.ts +97 -0
- package/src/lib/server/person-refund.js +221 -0
- package/src/lib/server/person-refund.js.map +1 -0
- package/src/lib/server/picklist-values.d.ts +21 -0
- package/src/lib/server/picklist-values.js +308 -0
- package/src/lib/server/picklist-values.js.map +1 -0
- package/src/lib/server/read-picklist.d.ts +44 -0
- package/src/lib/server/read-picklist.js +65 -0
- package/src/lib/server/read-picklist.js.map +1 -0
- package/src/lib/server/recipe-routes.js +22 -8
- package/src/lib/server/recipe-routes.js.map +1 -1
- package/src/lib/server/record-email-state.js +7 -1
- package/src/lib/server/record-email-state.js.map +1 -1
- package/src/lib/server/record-facts.d.ts +3 -0
- package/src/lib/server/record-facts.js +233 -31
- package/src/lib/server/record-facts.js.map +1 -1
- package/src/lib/server/record-origin.d.ts +27 -0
- package/src/lib/server/record-origin.js +104 -0
- package/src/lib/server/record-origin.js.map +1 -0
- package/src/lib/server/record-timeline.js +40 -3
- package/src/lib/server/record-timeline.js.map +1 -1
- package/src/lib/server/suite-gate.js +4 -3
- package/src/lib/server/suite-gate.js.map +1 -1
- package/src/lib/server/task-reminders-route.js +2 -1
- package/src/lib/server/task-reminders-route.js.map +1 -1
- package/src/lib/server/task-routes.js +33 -17
- package/src/lib/server/task-routes.js.map +1 -1
- package/src/lib/server-deal-stage.d.ts +5 -1
- package/src/lib/server-deal-stage.js +10 -5
- package/src/lib/server-deal-stage.js.map +1 -1
- package/src/lib/server.d.ts +8 -3
- package/src/lib/server.js +47 -43
- package/src/lib/server.js.map +1 -1
- package/src/lib/testing/memory-firestore.d.ts +55 -0
- package/src/lib/testing/memory-firestore.js +335 -0
- package/src/lib/testing/memory-firestore.js.map +1 -0
- package/src/lib/testing/stand-in-email-send-index.d.ts +25 -0
- package/src/lib/testing/stand-in-email-send-index.js +49 -0
- package/src/lib/testing/stand-in-email-send-index.js.map +1 -0
- package/src/lib/transfer/activities.d.ts +30 -0
- package/src/lib/transfer/activities.js +132 -0
- package/src/lib/transfer/activities.js.map +1 -0
- package/src/lib/transfer/aliases.d.ts +22 -0
- package/src/lib/transfer/aliases.js +1342 -0
- package/src/lib/transfer/aliases.js.map +1 -0
- package/src/lib/transfer/common.d.ts +222 -0
- package/src/lib/transfer/common.js +832 -0
- package/src/lib/transfer/common.js.map +1 -0
- package/src/lib/transfer/companies.d.ts +43 -0
- package/src/lib/transfer/companies.js +549 -0
- package/src/lib/transfer/companies.js.map +1 -0
- package/src/lib/transfer/contacts.d.ts +31 -0
- package/src/lib/transfer/contacts.js +727 -0
- package/src/lib/transfer/contacts.js.map +1 -0
- package/src/lib/transfer/deals.d.ts +66 -0
- package/src/lib/transfer/deals.js +698 -0
- package/src/lib/transfer/deals.js.map +1 -0
- package/src/lib/transfer/email-templates-package.d.ts +40 -0
- package/src/lib/transfer/email-templates-package.js +76 -0
- package/src/lib/transfer/email-templates-package.js.map +1 -0
- package/src/lib/transfer/email-templates-package.server.d.ts +32 -0
- package/src/lib/transfer/email-templates-package.server.js +176 -0
- package/src/lib/transfer/email-templates-package.server.js.map +1 -0
- package/src/lib/transfer/fields.d.ts +102 -0
- package/src/lib/transfer/fields.js +1755 -0
- package/src/lib/transfer/fields.js.map +1 -0
- package/src/lib/transfer/leads.d.ts +30 -0
- package/src/lib/transfer/leads.js +582 -0
- package/src/lib/transfer/leads.js.map +1 -0
- package/src/lib/transfer/pipelines.d.ts +21 -0
- package/src/lib/transfer/pipelines.js +172 -0
- package/src/lib/transfer/pipelines.js.map +1 -0
- package/src/lib/transfer/register.d.ts +47 -0
- package/src/lib/transfer/register.js +277 -0
- package/src/lib/transfer/register.js.map +1 -0
- package/src/lib/transfer/tasks.d.ts +30 -0
- package/src/lib/transfer/tasks.js +418 -0
- package/src/lib/transfer/tasks.js.map +1 -0
- package/src/lib/transfer/ui.d.ts +20 -0
- package/src/lib/transfer/ui.js +42 -0
- package/src/lib/transfer/ui.js.map +1 -0
- package/src/lib/components/company-import-drawer.d.ts +0 -42
- package/src/lib/components/company-import-drawer.js +0 -99
- package/src/lib/components/company-import-drawer.js.map +0 -1
- package/src/lib/components/contact-import-drawer.d.ts +0 -46
- package/src/lib/components/contact-import-drawer.js +0 -149
- package/src/lib/components/contact-import-drawer.js.map +0 -1
- package/src/lib/components/crm-export-all-button.d.ts +0 -39
- package/src/lib/components/crm-export-all-button.js +0 -98
- package/src/lib/components/crm-export-all-button.js.map +0 -1
- package/src/lib/components/csv-import-drawer.d.ts +0 -139
- package/src/lib/components/csv-import-drawer.js +0 -757
- package/src/lib/components/csv-import-drawer.js.map +0 -1
- package/src/lib/components/deal-import-drawer.d.ts +0 -24
- package/src/lib/components/deal-import-drawer.js +0 -83
- package/src/lib/components/deal-import-drawer.js.map +0 -1
- package/src/lib/components/lead-import-drawer.d.ts +0 -27
- package/src/lib/components/lead-import-drawer.js +0 -118
- package/src/lib/components/lead-import-drawer.js.map +0 -1
- package/src/lib/components/lead-source-values-card.d.ts +0 -27
- package/src/lib/components/lead-source-values-card.js.map +0 -1
- package/src/lib/components/task-import-drawer.d.ts +0 -24
- package/src/lib/components/task-import-drawer.js +0 -82
- package/src/lib/components/task-import-drawer.js.map +0 -1
- package/src/lib/model/companies-csv.d.ts +0 -36
- package/src/lib/model/companies-csv.js +0 -38
- package/src/lib/model/companies-csv.js.map +0 -1
- package/src/lib/model/contacts-csv.d.ts +0 -54
- package/src/lib/model/contacts-csv.js +0 -67
- package/src/lib/model/contacts-csv.js.map +0 -1
- package/src/lib/model/crm-company-import.d.ts +0 -154
- package/src/lib/model/crm-company-import.js +0 -331
- package/src/lib/model/crm-company-import.js.map +0 -1
- package/src/lib/model/crm-csv.d.ts +0 -239
- package/src/lib/model/crm-csv.js +0 -467
- package/src/lib/model/crm-csv.js.map +0 -1
- package/src/lib/model/crm-deal-import.d.ts +0 -112
- package/src/lib/model/crm-deal-import.js +0 -263
- package/src/lib/model/crm-deal-import.js.map +0 -1
- package/src/lib/model/crm-import.d.ts +0 -250
- package/src/lib/model/crm-import.js +0 -467
- package/src/lib/model/crm-import.js.map +0 -1
- package/src/lib/model/crm-lead-import.d.ts +0 -138
- package/src/lib/model/crm-lead-import.js +0 -446
- package/src/lib/model/crm-lead-import.js.map +0 -1
- package/src/lib/model/crm-task-import.d.ts +0 -94
- package/src/lib/model/crm-task-import.js +0 -275
- package/src/lib/model/crm-task-import.js.map +0 -1
- package/src/lib/model/deals-csv.d.ts +0 -32
- package/src/lib/model/deals-csv.js +0 -36
- package/src/lib/model/deals-csv.js.map +0 -1
- package/src/lib/model/import-column-shapes.d.ts +0 -36
- package/src/lib/model/import-column-shapes.js +0 -76
- package/src/lib/model/import-column-shapes.js.map +0 -1
- package/src/lib/model/lead-source-values.d.ts +0 -82
- package/src/lib/model/lead-source-values.js +0 -149
- package/src/lib/model/lead-source-values.js.map +0 -1
- package/src/lib/model/leads-csv.d.ts +0 -40
- package/src/lib/model/leads-csv.js +0 -40
- package/src/lib/model/leads-csv.js.map +0 -1
- package/src/lib/model/tasks-csv.d.ts +0 -28
- package/src/lib/model/tasks-csv.js +0 -28
- package/src/lib/model/tasks-csv.js.map +0 -1
- package/src/lib/server/companies-import.d.ts +0 -57
- package/src/lib/server/companies-import.js +0 -242
- package/src/lib/server/companies-import.js.map +0 -1
- package/src/lib/server/contacts-import.d.ts +0 -109
- package/src/lib/server/contacts-import.js +0 -393
- package/src/lib/server/contacts-import.js.map +0 -1
- package/src/lib/server/deals-import.d.ts +0 -76
- package/src/lib/server/deals-import.js +0 -248
- package/src/lib/server/deals-import.js.map +0 -1
- package/src/lib/server/export-route.d.ts +0 -60
- package/src/lib/server/export-route.js +0 -447
- package/src/lib/server/export-route.js.map +0 -1
- package/src/lib/server/import-context.d.ts +0 -87
- package/src/lib/server/import-context.js +0 -182
- package/src/lib/server/import-context.js.map +0 -1
- package/src/lib/server/lead-source-values.d.ts +0 -50
- package/src/lib/server/lead-source-values.js +0 -191
- package/src/lib/server/lead-source-values.js.map +0 -1
- package/src/lib/server/leads-import.d.ts +0 -84
- package/src/lib/server/leads-import.js +0 -367
- package/src/lib/server/leads-import.js.map +0 -1
- package/src/lib/server/tasks-import.d.ts +0 -54
- package/src/lib/server/tasks-import.js +0 -160
- package/src/lib/server/tasks-import.js.map +0 -1
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Aglyn LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { type CrmPicklist } from '@aglyn/aglyn/app-utils/crm';
|
|
18
|
-
/**
|
|
19
|
-
* THE LEAD SOURCE LIST'S EDITS (AGL-3298), as pure moves over a picklist.
|
|
20
|
-
*
|
|
21
|
-
* The Fields page applies the ones that touch only the list — add, reorder,
|
|
22
|
-
* sort, activate, deactivate, default — as one client write of the whole
|
|
23
|
-
* document. The two that change what RECORDS hold — a rename and a delete
|
|
24
|
-
* with its replacement — go to `crm/lead-source-values`, which rewrites the
|
|
25
|
-
* list and every lead and contact holding the old label in one request;
|
|
26
|
-
* this module is where both sides agree what each move does.
|
|
27
|
-
*/
|
|
28
|
-
/** The route the two record-changing moves are posted to. */
|
|
29
|
-
export declare const CRM_LEAD_SOURCE_VALUES_ROUTE: "crm/lead-source-values";
|
|
30
|
-
export declare const crmLeadSourceValuesRouteUrl: () => string;
|
|
31
|
-
/** What the route is asked. `hostId` or `orgId` names the org, as every CRM route's scope does. */
|
|
32
|
-
export type LeadSourceValuesRequest = {
|
|
33
|
-
hostId?: string | null;
|
|
34
|
-
orgId?: string;
|
|
35
|
-
} & ({
|
|
36
|
-
action: 'rename';
|
|
37
|
-
valueId: string;
|
|
38
|
-
label: string;
|
|
39
|
-
} | {
|
|
40
|
-
action: 'delete';
|
|
41
|
-
valueId: string;
|
|
42
|
-
/** An active value's label the records move to, or `null` to clear them. */
|
|
43
|
-
replaceWith: string | null;
|
|
44
|
-
});
|
|
45
|
-
/** What the route answers. */
|
|
46
|
-
export interface LeadSourceValuesResponse {
|
|
47
|
-
ok: true;
|
|
48
|
-
/** How many leads now hold the new label (or none). */
|
|
49
|
-
leads: number;
|
|
50
|
-
/**
|
|
51
|
-
* How many contact FACETS were rewritten — one per holder that held the
|
|
52
|
-
* old label, so a person two sites both filed under it counts twice.
|
|
53
|
-
*/
|
|
54
|
-
contacts: number;
|
|
55
|
-
}
|
|
56
|
-
/** Why a move is refused, in the sentence the page shows. */
|
|
57
|
-
export type PicklistMove = {
|
|
58
|
-
ok: true;
|
|
59
|
-
picklist: CrmPicklist;
|
|
60
|
-
} | {
|
|
61
|
-
ok: false;
|
|
62
|
-
error: string;
|
|
63
|
-
};
|
|
64
|
-
/** Append a value. */
|
|
65
|
-
export declare function addPicklistValue(picklist: CrmPicklist, rawLabel: string): PicklistMove;
|
|
66
|
-
/** Rename a value, keeping its id — the list half of the route's rename. */
|
|
67
|
-
export declare function renamePicklistValue(picklist: CrmPicklist, valueId: string, rawLabel: string): PicklistMove;
|
|
68
|
-
/**
|
|
69
|
-
* Remove a value — the list half of the route's delete. The replacement,
|
|
70
|
-
* when there is one, must be another ACTIVE value: records are not moved
|
|
71
|
-
* onto a value the pickers no longer offer. A default that named the
|
|
72
|
-
* deleted value is cleared.
|
|
73
|
-
*/
|
|
74
|
-
export declare function deletePicklistValue(picklist: CrmPicklist, valueId: string, replaceWith: string | null): PicklistMove;
|
|
75
|
-
/** Turn a value on or off. Deactivating the default clears the default. */
|
|
76
|
-
export declare function setPicklistValueActive(picklist: CrmPicklist, valueId: string, active: boolean): CrmPicklist;
|
|
77
|
-
/** Make a value the default for new records, or clear the default with `null`. */
|
|
78
|
-
export declare function setPicklistDefault(picklist: CrmPicklist, valueId: string | null): CrmPicklist;
|
|
79
|
-
/** Move the value at `from` to `to`, the drag and the arrows alike. */
|
|
80
|
-
export declare function movePicklistValue(picklist: CrmPicklist, from: number, to: number): CrmPicklist;
|
|
81
|
-
/** Every value in A–Z order by label, as Salesforce's "Sort alphabetically" does. */
|
|
82
|
-
export declare function sortPicklistValues(picklist: CrmPicklist): CrmPicklist;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2026 Aglyn LLC
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/ import { crmPicklistValueByLabel, crmPicklistValueId, normalizeCrmPicklistLabel } from "@aglyn/aglyn/app-utils/crm";
|
|
18
|
-
/**
|
|
19
|
-
* THE LEAD SOURCE LIST'S EDITS (AGL-3298), as pure moves over a picklist.
|
|
20
|
-
*
|
|
21
|
-
* The Fields page applies the ones that touch only the list — add, reorder,
|
|
22
|
-
* sort, activate, deactivate, default — as one client write of the whole
|
|
23
|
-
* document. The two that change what RECORDS hold — a rename and a delete
|
|
24
|
-
* with its replacement — go to `crm/lead-source-values`, which rewrites the
|
|
25
|
-
* list and every lead and contact holding the old label in one request;
|
|
26
|
-
* this module is where both sides agree what each move does.
|
|
27
|
-
*/ /** The route the two record-changing moves are posted to. */ export const CRM_LEAD_SOURCE_VALUES_ROUTE = 'crm/lead-source-values';
|
|
28
|
-
export const crmLeadSourceValuesRouteUrl = ()=>`/api/${CRM_LEAD_SOURCE_VALUES_ROUTE}`;
|
|
29
|
-
const DUPLICATE = (label)=>`“${label}” is already in the list.`;
|
|
30
|
-
/** Append a value. */ export function addPicklistValue(picklist, rawLabel) {
|
|
31
|
-
const label = normalizeCrmPicklistLabel(rawLabel);
|
|
32
|
-
if (!label) return {
|
|
33
|
-
ok: false,
|
|
34
|
-
error: 'Enter a name for the value.'
|
|
35
|
-
};
|
|
36
|
-
const existing = crmPicklistValueByLabel(picklist, label);
|
|
37
|
-
if (existing) {
|
|
38
|
-
return {
|
|
39
|
-
ok: false,
|
|
40
|
-
error: existing.active ? DUPLICATE(existing.label) : `“${existing.label}” is in the list, inactive — activate it instead.`
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const value = {
|
|
44
|
-
id: crmPicklistValueId(label, picklist.values.map((entry)=>entry.id)),
|
|
45
|
-
label,
|
|
46
|
-
active: true
|
|
47
|
-
};
|
|
48
|
-
return {
|
|
49
|
-
ok: true,
|
|
50
|
-
picklist: _extends({}, picklist, {
|
|
51
|
-
values: [
|
|
52
|
-
...picklist.values,
|
|
53
|
-
value
|
|
54
|
-
]
|
|
55
|
-
})
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
/** Rename a value, keeping its id — the list half of the route's rename. */ export function renamePicklistValue(picklist, valueId, rawLabel) {
|
|
59
|
-
const label = normalizeCrmPicklistLabel(rawLabel);
|
|
60
|
-
if (!label) return {
|
|
61
|
-
ok: false,
|
|
62
|
-
error: 'Enter a name for the value.'
|
|
63
|
-
};
|
|
64
|
-
if (!picklist.values.some((value)=>value.id === valueId)) {
|
|
65
|
-
return {
|
|
66
|
-
ok: false,
|
|
67
|
-
error: 'That value is no longer in the list.'
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const clash = crmPicklistValueByLabel(picklist, label);
|
|
71
|
-
if (clash && clash.id !== valueId) return {
|
|
72
|
-
ok: false,
|
|
73
|
-
error: DUPLICATE(clash.label)
|
|
74
|
-
};
|
|
75
|
-
return {
|
|
76
|
-
ok: true,
|
|
77
|
-
picklist: _extends({}, picklist, {
|
|
78
|
-
values: picklist.values.map((value)=>value.id === valueId ? _extends({}, value, {
|
|
79
|
-
label
|
|
80
|
-
}) : value)
|
|
81
|
-
})
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Remove a value — the list half of the route's delete. The replacement,
|
|
86
|
-
* when there is one, must be another ACTIVE value: records are not moved
|
|
87
|
-
* onto a value the pickers no longer offer. A default that named the
|
|
88
|
-
* deleted value is cleared.
|
|
89
|
-
*/ export function deletePicklistValue(picklist, valueId, replaceWith) {
|
|
90
|
-
if (!picklist.values.some((value)=>value.id === valueId)) {
|
|
91
|
-
return {
|
|
92
|
-
ok: false,
|
|
93
|
-
error: 'That value is no longer in the list.'
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
if (replaceWith !== null) {
|
|
97
|
-
const target = crmPicklistValueByLabel(picklist, replaceWith);
|
|
98
|
-
if (!target || target.id === valueId || !target.active) {
|
|
99
|
-
return {
|
|
100
|
-
ok: false,
|
|
101
|
-
error: 'Pick an active value to move its records to, or none.'
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
ok: true,
|
|
107
|
-
picklist: {
|
|
108
|
-
values: picklist.values.filter((value)=>value.id !== valueId),
|
|
109
|
-
defaultValueId: picklist.defaultValueId === valueId ? null : picklist.defaultValueId
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
/** Turn a value on or off. Deactivating the default clears the default. */ export function setPicklistValueActive(picklist, valueId, active) {
|
|
114
|
-
return {
|
|
115
|
-
values: picklist.values.map((value)=>value.id === valueId ? _extends({}, value, {
|
|
116
|
-
active
|
|
117
|
-
}) : value),
|
|
118
|
-
defaultValueId: !active && picklist.defaultValueId === valueId ? null : picklist.defaultValueId
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
/** Make a value the default for new records, or clear the default with `null`. */ export function setPicklistDefault(picklist, valueId) {
|
|
122
|
-
const value = picklist.values.find((entry)=>entry.id === valueId);
|
|
123
|
-
return _extends({}, picklist, {
|
|
124
|
-
defaultValueId: (value == null ? void 0 : value.active) ? value.id : null
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/** Move the value at `from` to `to`, the drag and the arrows alike. */ export function movePicklistValue(picklist, from, to) {
|
|
128
|
-
const size = picklist.values.length;
|
|
129
|
-
if (from === to || from < 0 || to < 0 || from >= size || to >= size) return picklist;
|
|
130
|
-
const values = [
|
|
131
|
-
...picklist.values
|
|
132
|
-
];
|
|
133
|
-
const [moved] = values.splice(from, 1);
|
|
134
|
-
values.splice(to, 0, moved);
|
|
135
|
-
return _extends({}, picklist, {
|
|
136
|
-
values
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
/** Every value in A–Z order by label, as Salesforce's "Sort alphabetically" does. */ export function sortPicklistValues(picklist) {
|
|
140
|
-
return _extends({}, picklist, {
|
|
141
|
-
values: [
|
|
142
|
-
...picklist.values
|
|
143
|
-
].sort((a, b)=>a.label.localeCompare(b.label, undefined, {
|
|
144
|
-
sensitivity: 'base'
|
|
145
|
-
}))
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
//# sourceMappingURL=lead-source-values.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/lead-source-values.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 {\n type CrmPicklist,\n type CrmPicklistValue,\n crmPicklistValueByLabel,\n crmPicklistValueId,\n normalizeCrmPicklistLabel,\n} from '@aglyn/aglyn/app-utils/crm'\n\n/**\n * THE LEAD SOURCE LIST'S EDITS (AGL-3298), as pure moves over a picklist.\n *\n * The Fields page applies the ones that touch only the list — add, reorder,\n * sort, activate, deactivate, default — as one client write of the whole\n * document. The two that change what RECORDS hold — a rename and a delete\n * with its replacement — go to `crm/lead-source-values`, which rewrites the\n * list and every lead and contact holding the old label in one request;\n * this module is where both sides agree what each move does.\n */\n\n/** The route the two record-changing moves are posted to. */\nexport const CRM_LEAD_SOURCE_VALUES_ROUTE = 'crm/lead-source-values' as const\n\nexport const crmLeadSourceValuesRouteUrl = (): string => `/api/${CRM_LEAD_SOURCE_VALUES_ROUTE}`\n\n/** What the route is asked. `hostId` or `orgId` names the org, as every CRM route's scope does. */\nexport type LeadSourceValuesRequest = { hostId?: string | null; orgId?: string } & (\n | { action: 'rename'; valueId: string; label: string }\n | {\n action: 'delete'\n valueId: string\n /** An active value's label the records move to, or `null` to clear them. */\n replaceWith: string | null\n }\n)\n\n/** What the route answers. */\nexport interface LeadSourceValuesResponse {\n ok: true\n /** How many leads now hold the new label (or none). */\n leads: number\n /**\n * How many contact FACETS were rewritten — one per holder that held the\n * old label, so a person two sites both filed under it counts twice.\n */\n contacts: number\n}\n\n/** Why a move is refused, in the sentence the page shows. */\nexport type PicklistMove = { ok: true; picklist: CrmPicklist } | { ok: false; error: string }\n\nconst DUPLICATE = (label: string) => `“${label}” is already in the list.`\n\n/** Append a value. */\nexport function addPicklistValue(picklist: CrmPicklist, rawLabel: string): PicklistMove {\n const label = normalizeCrmPicklistLabel(rawLabel)\n if (!label) return { ok: false, error: 'Enter a name for the value.' }\n const existing = crmPicklistValueByLabel(picklist, label)\n if (existing) {\n return {\n ok: false,\n error: existing.active\n ? DUPLICATE(existing.label)\n : `“${existing.label}” is in the list, inactive — activate it instead.`,\n }\n }\n const value: CrmPicklistValue = {\n id: crmPicklistValueId(\n label,\n picklist.values.map((entry) => entry.id),\n ),\n label,\n active: true,\n }\n return { ok: true, picklist: { ...picklist, values: [...picklist.values, value] } }\n}\n\n/** Rename a value, keeping its id — the list half of the route's rename. */\nexport function renamePicklistValue(\n picklist: CrmPicklist,\n valueId: string,\n rawLabel: string,\n): PicklistMove {\n const label = normalizeCrmPicklistLabel(rawLabel)\n if (!label) return { ok: false, error: 'Enter a name for the value.' }\n if (!picklist.values.some((value) => value.id === valueId)) {\n return { ok: false, error: 'That value is no longer in the list.' }\n }\n const clash = crmPicklistValueByLabel(picklist, label)\n if (clash && clash.id !== valueId) return { ok: false, error: DUPLICATE(clash.label) }\n return {\n ok: true,\n picklist: {\n ...picklist,\n values: picklist.values.map((value) => (value.id === valueId ? { ...value, label } : value)),\n },\n }\n}\n\n/**\n * Remove a value — the list half of the route's delete. The replacement,\n * when there is one, must be another ACTIVE value: records are not moved\n * onto a value the pickers no longer offer. A default that named the\n * deleted value is cleared.\n */\nexport function deletePicklistValue(\n picklist: CrmPicklist,\n valueId: string,\n replaceWith: string | null,\n): PicklistMove {\n if (!picklist.values.some((value) => value.id === valueId)) {\n return { ok: false, error: 'That value is no longer in the list.' }\n }\n if (replaceWith !== null) {\n const target = crmPicklistValueByLabel(picklist, replaceWith)\n if (!target || target.id === valueId || !target.active) {\n return { ok: false, error: 'Pick an active value to move its records to, or none.' }\n }\n }\n return {\n ok: true,\n picklist: {\n values: picklist.values.filter((value) => value.id !== valueId),\n defaultValueId: picklist.defaultValueId === valueId ? null : picklist.defaultValueId,\n },\n }\n}\n\n/** Turn a value on or off. Deactivating the default clears the default. */\nexport function setPicklistValueActive(\n picklist: CrmPicklist,\n valueId: string,\n active: boolean,\n): CrmPicklist {\n return {\n values: picklist.values.map((value) => (value.id === valueId ? { ...value, active } : value)),\n defaultValueId:\n !active && picklist.defaultValueId === valueId ? null : picklist.defaultValueId,\n }\n}\n\n/** Make a value the default for new records, or clear the default with `null`. */\nexport function setPicklistDefault(picklist: CrmPicklist, valueId: string | null): CrmPicklist {\n const value = picklist.values.find((entry) => entry.id === valueId)\n return { ...picklist, defaultValueId: value?.active ? value.id : null }\n}\n\n/** Move the value at `from` to `to`, the drag and the arrows alike. */\nexport function movePicklistValue(picklist: CrmPicklist, from: number, to: number): CrmPicklist {\n const size = picklist.values.length\n if (from === to || from < 0 || to < 0 || from >= size || to >= size) return picklist\n const values = [...picklist.values]\n const [moved] = values.splice(from, 1)\n values.splice(to, 0, moved)\n return { ...picklist, values }\n}\n\n/** Every value in A–Z order by label, as Salesforce's \"Sort alphabetically\" does. */\nexport function sortPicklistValues(picklist: CrmPicklist): CrmPicklist {\n return {\n ...picklist,\n values: [...picklist.values].sort((a, b) =>\n a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }),\n ),\n }\n}\n"],"names":["crmPicklistValueByLabel","crmPicklistValueId","normalizeCrmPicklistLabel","CRM_LEAD_SOURCE_VALUES_ROUTE","crmLeadSourceValuesRouteUrl","DUPLICATE","label","addPicklistValue","picklist","rawLabel","ok","error","existing","active","value","id","values","map","entry","renamePicklistValue","valueId","some","clash","deletePicklistValue","replaceWith","target","filter","defaultValueId","setPicklistValueActive","setPicklistDefault","find","movePicklistValue","from","to","size","length","moved","splice","sortPicklistValues","sort","a","b","localeCompare","undefined","sensitivity"],"mappings":"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"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Aglyn LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* The leads CSV — one file from the Leads section's Export button and the
|
|
19
|
-
* bulk bar's (AGL-2662).
|
|
20
|
-
*
|
|
21
|
-
* A lead is a capture the CRM has annotated: what the door wrote (the
|
|
22
|
-
* address, the name, every surface that met the person, when, how often)
|
|
23
|
-
* and what the team wrote on top (a status, an owner, a reason, notes).
|
|
24
|
-
* The file carries both. The status is written by its LABEL and an absent
|
|
25
|
-
* one as `New`, the way the list reads it, and the owner by ADDRESS rather
|
|
26
|
-
* than uid, the way every other CRM file writes one. The sources are joined
|
|
27
|
-
* with `|` as the contacts file joins its multi-valued cells.
|
|
28
|
-
*
|
|
29
|
-
* At the organization level the same file gains a `Site` column, because a
|
|
30
|
-
* row there is some site's lead and the file must say which; under a site
|
|
31
|
-
* every row is the site's own and the column is not written.
|
|
32
|
-
*
|
|
33
|
-
* The header is written to READ well rather than to round-trip, and the
|
|
34
|
-
* import (`lead-import-drawer.tsx`) is built to that header rather than the
|
|
35
|
-
* other way round: it maps the columns a file may set — the address, the
|
|
36
|
-
* name, and the team's status, owner, reason and notes — and leaves the
|
|
37
|
-
* capture door's own record (the sources, the two timestamps, the capture
|
|
38
|
-
* count) and the conversion's stamp on "Do not import".
|
|
39
|
-
*/
|
|
40
|
-
export { LEAD_CSV_COLUMNS, leadCsvHeader, leadsCsv, type LeadCsvOptions, type LeadCsvRow, } from './crm-csv';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Aglyn LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/ /**
|
|
17
|
-
* The leads CSV — one file from the Leads section's Export button and the
|
|
18
|
-
* bulk bar's (AGL-2662).
|
|
19
|
-
*
|
|
20
|
-
* A lead is a capture the CRM has annotated: what the door wrote (the
|
|
21
|
-
* address, the name, every surface that met the person, when, how often)
|
|
22
|
-
* and what the team wrote on top (a status, an owner, a reason, notes).
|
|
23
|
-
* The file carries both. The status is written by its LABEL and an absent
|
|
24
|
-
* one as `New`, the way the list reads it, and the owner by ADDRESS rather
|
|
25
|
-
* than uid, the way every other CRM file writes one. The sources are joined
|
|
26
|
-
* with `|` as the contacts file joins its multi-valued cells.
|
|
27
|
-
*
|
|
28
|
-
* At the organization level the same file gains a `Site` column, because a
|
|
29
|
-
* row there is some site's lead and the file must say which; under a site
|
|
30
|
-
* every row is the site's own and the column is not written.
|
|
31
|
-
*
|
|
32
|
-
* The header is written to READ well rather than to round-trip, and the
|
|
33
|
-
* import (`lead-import-drawer.tsx`) is built to that header rather than the
|
|
34
|
-
* other way round: it maps the columns a file may set — the address, the
|
|
35
|
-
* name, and the team's status, owner, reason and notes — and leaves the
|
|
36
|
-
* capture door's own record (the sources, the two timestamps, the capture
|
|
37
|
-
* count) and the conversion's stamp on "Do not import".
|
|
38
|
-
*/ /* The writer is `crm-csv.ts`, shared with the server's export — see `deals-csv.ts`. */ export { LEAD_CSV_COLUMNS, leadCsvHeader, leadsCsv } from "./crm-csv.js";
|
|
39
|
-
|
|
40
|
-
//# sourceMappingURL=leads-csv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/leads-csv.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The leads CSV — one file from the Leads section's Export button and the\n * bulk bar's (AGL-2662).\n *\n * A lead is a capture the CRM has annotated: what the door wrote (the\n * address, the name, every surface that met the person, when, how often)\n * and what the team wrote on top (a status, an owner, a reason, notes).\n * The file carries both. The status is written by its LABEL and an absent\n * one as `New`, the way the list reads it, and the owner by ADDRESS rather\n * than uid, the way every other CRM file writes one. The sources are joined\n * with `|` as the contacts file joins its multi-valued cells.\n *\n * At the organization level the same file gains a `Site` column, because a\n * row there is some site's lead and the file must say which; under a site\n * every row is the site's own and the column is not written.\n *\n * The header is written to READ well rather than to round-trip, and the\n * import (`lead-import-drawer.tsx`) is built to that header rather than the\n * other way round: it maps the columns a file may set — the address, the\n * name, and the team's status, owner, reason and notes — and leaves the\n * capture door's own record (the sources, the two timestamps, the capture\n * count) and the conversion's stamp on \"Do not import\".\n */\n\n/* The writer is `crm-csv.ts`, shared with the server's export — see `deals-csv.ts`. */\nexport {\n LEAD_CSV_COLUMNS,\n leadCsvHeader,\n leadsCsv,\n type LeadCsvOptions,\n type LeadCsvRow,\n} from './crm-csv'\n"],"names":["LEAD_CSV_COLUMNS","leadCsvHeader","leadsCsv"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;CAsBC,GAED,qFAAqF,GACrF,SACEA,gBAAgB,EAChBC,aAAa,EACbC,QAAQ,QAGH,eAAW"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Aglyn LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* The tasks CSV — one file from the section's Export button and the bulk
|
|
19
|
-
* bar's (AGL-2621).
|
|
20
|
-
*
|
|
21
|
-
* A task hangs off a contact, a company or a deal by id; the file names
|
|
22
|
-
* each by the name the list already resolved for the row, so a spreadsheet
|
|
23
|
-
* reads "Acme" and not a document id. The assignee is written by address
|
|
24
|
-
* for the same reason. A due date is an INSTANT — a task due at nine is due
|
|
25
|
-
* at nine in the assignee's zone — so it is written as an ISO timestamp,
|
|
26
|
-
* and a spreadsheet renders it in whatever zone it is opened in.
|
|
27
|
-
*/
|
|
28
|
-
export { TASK_CSV_COLUMNS, tasksCsv, type TaskCsvOptions, type TaskCsvRow, } from './crm-csv';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Aglyn LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/ /**
|
|
17
|
-
* The tasks CSV — one file from the section's Export button and the bulk
|
|
18
|
-
* bar's (AGL-2621).
|
|
19
|
-
*
|
|
20
|
-
* A task hangs off a contact, a company or a deal by id; the file names
|
|
21
|
-
* each by the name the list already resolved for the row, so a spreadsheet
|
|
22
|
-
* reads "Acme" and not a document id. The assignee is written by address
|
|
23
|
-
* for the same reason. A due date is an INSTANT — a task due at nine is due
|
|
24
|
-
* at nine in the assignee's zone — so it is written as an ISO timestamp,
|
|
25
|
-
* and a spreadsheet renders it in whatever zone it is opened in.
|
|
26
|
-
*/ /* The writer is `crm-csv.ts`, shared with the server's export — see `deals-csv.ts`. */ export { TASK_CSV_COLUMNS, tasksCsv } from "./crm-csv.js";
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=tasks-csv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/model/tasks-csv.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The tasks CSV — one file from the section's Export button and the bulk\n * bar's (AGL-2621).\n *\n * A task hangs off a contact, a company or a deal by id; the file names\n * each by the name the list already resolved for the row, so a spreadsheet\n * reads \"Acme\" and not a document id. The assignee is written by address\n * for the same reason. A due date is an INSTANT — a task due at nine is due\n * at nine in the assignee's zone — so it is written as an ISO timestamp,\n * and a spreadsheet renders it in whatever zone it is opened in.\n */\n\n/* The writer is `crm-csv.ts`, shared with the server's export — see `deals-csv.ts`. */\nexport {\n TASK_CSV_COLUMNS,\n tasksCsv,\n type TaskCsvOptions,\n type TaskCsvRow,\n} from './crm-csv'\n"],"names":["TASK_CSV_COLUMNS","tasksCsv"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;CAUC,GAED,qFAAqF,GACrF,SACEA,gBAAgB,EAChBC,QAAQ,QAGH,eAAW"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Aglyn LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* `POST /api/crm/companies-import` — one chunk of a companies file, written
|
|
19
|
-
* (AGL-2621).
|
|
20
|
-
*
|
|
21
|
-
* The browser has already read the file and applied the operator's column
|
|
22
|
-
* mapping; what arrives here is up to {@link COMPANY_IMPORT_CHUNK_SIZE} raw
|
|
23
|
-
* rows in the vocabulary `crm-company-import.ts` defines. This route judges
|
|
24
|
-
* each one through the same normalizers the company drawer runs, and
|
|
25
|
-
* writes it — the ONLY place either happens, so a stale tab cannot store
|
|
26
|
-
* something the server would have refused.
|
|
27
|
-
*
|
|
28
|
-
* ## Matched by domain, then by name
|
|
29
|
-
*
|
|
30
|
-
* A row is one company the org may already have. The domain is a key and
|
|
31
|
-
* the name a spelling, so a row with a domain is looked up by it first,
|
|
32
|
-
* and by the name's search key when no company carries the domain or the
|
|
33
|
-
* row has none — two files calling one business "Acme" and "Acme Inc" meet
|
|
34
|
-
* at `acme.com`, and a file with no domain column still finds "Acme" by
|
|
35
|
-
* name. Both lookups are narrowed to what the caller's scope can see: two
|
|
36
|
-
* clients of one agency may each have an "Acme" and must each get their
|
|
37
|
-
* own. A match is UPDATED with what the row carries, tags unioned; no
|
|
38
|
-
* match is CREATED with the stamp every CRM creator writes.
|
|
39
|
-
*
|
|
40
|
-
* ## The band is counted once per request
|
|
41
|
-
*
|
|
42
|
-
* A created company is a CRM record and meets the records band (AGL-2611).
|
|
43
|
-
* The aggregate is taken once at the first create and the verdict re-judged
|
|
44
|
-
* locally as the request creates more — `checkCrmRecordsQuota` is pure over
|
|
45
|
-
* a count — so two hundred rows cost three aggregate reads, not six
|
|
46
|
-
* hundred. A metered plan never refuses; a hard band refuses the rows past
|
|
47
|
-
* it as `records-band`, and updates to matched companies go through either
|
|
48
|
-
* way, because an update adds no record.
|
|
49
|
-
*/
|
|
50
|
-
import { type PluginApiHandler } from '@aglyn/aglyn/server';
|
|
51
|
-
/**
|
|
52
|
-
* `POST crm/companies-import` — `{ hostId, rows }` → a {@link CompanyImportChunkResult}.
|
|
53
|
-
*
|
|
54
|
-
* Rows are written one after another rather than in parallel: two rows
|
|
55
|
-
* for one company racing each other would each miss the other's create.
|
|
56
|
-
*/
|
|
57
|
-
export declare const crmCompaniesImportHandler: PluginApiHandler;
|