@aglyn/aglyn 1.0.0-beta.221 → 1.0.0-beta.222
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/package.json +15 -11
- package/src/lib/app-utils/agent-openapi.js +1 -1
- package/src/lib/app-utils/agent-openapi.js.map +1 -1
- package/src/lib/app-utils/analytics-events.d.ts +3 -2
- package/src/lib/app-utils/analytics-events.js +3 -2
- package/src/lib/app-utils/analytics-events.js.map +1 -1
- package/src/lib/app-utils/api-plugins.d.ts +30 -0
- package/src/lib/app-utils/api-plugins.js +24 -1
- package/src/lib/app-utils/api-plugins.js.map +1 -1
- package/src/lib/app-utils/author-html.d.ts +1 -1
- package/src/lib/app-utils/author-html.js.map +1 -1
- package/src/lib/app-utils/bandwidth-cap.d.ts +12 -1
- package/src/lib/app-utils/bandwidth-cap.js +17 -1
- package/src/lib/app-utils/bandwidth-cap.js.map +1 -1
- package/src/lib/app-utils/compose-reusable-components.d.ts +19 -0
- package/src/lib/app-utils/compose-reusable-components.js +116 -26
- package/src/lib/app-utils/compose-reusable-components.js.map +1 -1
- package/src/lib/app-utils/console-routes.d.ts +4 -0
- package/src/lib/app-utils/console-routes.js +3 -0
- package/src/lib/app-utils/console-routes.js.map +1 -1
- package/src/lib/app-utils/contacts.d.ts +71 -0
- package/src/lib/app-utils/contacts.js +55 -0
- package/src/lib/app-utils/contacts.js.map +1 -1
- package/src/lib/app-utils/contexts.d.ts +1 -0
- package/src/lib/app-utils/contexts.js +1 -0
- package/src/lib/app-utils/contexts.js.map +1 -1
- package/src/lib/app-utils/crm-email-templates.js +21 -4
- package/src/lib/app-utils/crm-email-templates.js.map +1 -1
- package/src/lib/app-utils/crm-kinds.d.ts +2 -0
- package/src/lib/app-utils/crm-kinds.js +1 -0
- package/src/lib/app-utils/crm-kinds.js.map +1 -1
- package/src/lib/app-utils/crm.d.ts +1199 -67
- package/src/lib/app-utils/crm.js +1951 -310
- package/src/lib/app-utils/crm.js.map +1 -1
- package/src/lib/app-utils/csv-import.d.ts +10 -38
- package/src/lib/app-utils/csv-import.js +17 -42
- package/src/lib/app-utils/csv-import.js.map +1 -1
- package/src/lib/app-utils/csv.d.ts +32 -11
- package/src/lib/app-utils/csv.js +43 -5
- package/src/lib/app-utils/csv.js.map +1 -1
- package/src/lib/app-utils/default-site.d.ts +116 -0
- package/src/lib/app-utils/default-site.js +1024 -0
- package/src/lib/app-utils/default-site.js.map +1 -0
- package/src/lib/app-utils/docs-help.generated.d.ts +22 -22
- package/src/lib/app-utils/docs-help.generated.js +44 -10
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +738 -150
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/draft-placeholders.d.ts +76 -0
- package/src/lib/app-utils/draft-placeholders.js +115 -0
- package/src/lib/app-utils/draft-placeholders.js.map +1 -0
- package/src/lib/app-utils/entity-picker-context.d.ts +19 -15
- package/src/lib/app-utils/entity-picker-context.js +4 -4
- package/src/lib/app-utils/entity-picker-context.js.map +1 -1
- package/src/lib/app-utils/expand-repeatables.d.ts +66 -10
- package/src/lib/app-utils/expand-repeatables.js +88 -14
- package/src/lib/app-utils/expand-repeatables.js.map +1 -1
- package/src/lib/app-utils/forms.d.ts +33 -22
- package/src/lib/app-utils/forms.js +47 -28
- package/src/lib/app-utils/forms.js.map +1 -1
- package/src/lib/app-utils/full-use-cost.d.ts +277 -0
- package/src/lib/app-utils/full-use-cost.js +421 -0
- package/src/lib/app-utils/full-use-cost.js.map +1 -0
- package/src/lib/app-utils/health-report.js +11 -0
- package/src/lib/app-utils/health-report.js.map +1 -1
- package/src/lib/app-utils/llms-txt.d.ts +20 -0
- package/src/lib/app-utils/llms-txt.js +7 -1
- package/src/lib/app-utils/llms-txt.js.map +1 -1
- package/src/lib/app-utils/media-asset-facts.d.ts +16 -1
- package/src/lib/app-utils/media-asset-facts.js +40 -13
- package/src/lib/app-utils/media-asset-facts.js.map +1 -1
- package/src/lib/app-utils/media-bandwidth.d.ts +52 -0
- package/src/lib/app-utils/media-bandwidth.js +94 -0
- package/src/lib/app-utils/media-bandwidth.js.map +1 -0
- package/src/lib/app-utils/media-ref.d.ts +241 -33
- package/src/lib/app-utils/media-ref.js +324 -43
- package/src/lib/app-utils/media-ref.js.map +1 -1
- package/src/lib/app-utils/media-src.d.ts +8 -8
- package/src/lib/app-utils/media-src.js +27 -11
- package/src/lib/app-utils/media-src.js.map +1 -1
- package/src/lib/app-utils/media-takedown-reach.d.ts +4 -1
- package/src/lib/app-utils/media-takedown-reach.js +6 -3
- package/src/lib/app-utils/media-takedown-reach.js.map +1 -1
- package/src/lib/app-utils/notifications.d.ts +1 -1
- package/src/lib/app-utils/notifications.js +2 -0
- package/src/lib/app-utils/notifications.js.map +1 -1
- package/src/lib/app-utils/organizations.d.ts +51 -2
- package/src/lib/app-utils/organizations.js +56 -3
- package/src/lib/app-utils/organizations.js.map +1 -1
- package/src/lib/app-utils/page-record-sources.d.ts +87 -0
- package/src/lib/app-utils/page-record-sources.js +53 -0
- package/src/lib/app-utils/page-record-sources.js.map +1 -0
- package/src/lib/app-utils/paid-media-source.d.ts +3 -7
- package/src/lib/app-utils/paid-media-source.js +5 -19
- package/src/lib/app-utils/paid-media-source.js.map +1 -1
- package/src/lib/app-utils/person-erasure.d.ts +5 -2
- package/src/lib/app-utils/person-erasure.js.map +1 -1
- package/src/lib/app-utils/picklists.d.ts +187 -0
- package/src/lib/app-utils/picklists.js +320 -0
- package/src/lib/app-utils/picklists.js.map +1 -0
- package/src/lib/app-utils/plan-entitlements.d.ts +220 -50
- package/src/lib/app-utils/plan-entitlements.js +309 -115
- package/src/lib/app-utils/plan-entitlements.js.map +1 -1
- package/src/lib/app-utils/realm-host-surface.generated.js +2 -0
- package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -1
- package/src/lib/app-utils/release-flags.d.ts +1 -1
- package/src/lib/app-utils/release-flags.js +11 -0
- package/src/lib/app-utils/release-flags.js.map +1 -1
- package/src/lib/app-utils/rendered-widths.d.ts +121 -0
- package/src/lib/app-utils/rendered-widths.js +211 -0
- package/src/lib/app-utils/rendered-widths.js.map +1 -0
- package/src/lib/app-utils/repeat-sources.d.ts +2 -1
- package/src/lib/app-utils/repeat-sources.js.map +1 -1
- package/src/lib/app-utils/screen-route.d.ts +154 -36
- package/src/lib/app-utils/screen-route.js +185 -40
- package/src/lib/app-utils/screen-route.js.map +1 -1
- package/src/lib/app-utils/seo-audit.d.ts +11 -1
- package/src/lib/app-utils/seo-audit.js +33 -13
- package/src/lib/app-utils/seo-audit.js.map +1 -1
- package/src/lib/app-utils/seo-keywords.d.ts +11 -0
- package/src/lib/app-utils/seo-keywords.js +19 -5
- package/src/lib/app-utils/seo-keywords.js.map +1 -1
- package/src/lib/app-utils/seo-page-facts.d.ts +47 -4
- package/src/lib/app-utils/seo-page-facts.js +136 -31
- package/src/lib/app-utils/seo-page-facts.js.map +1 -1
- package/src/lib/app-utils/seo-site-scan.d.ts +42 -4
- package/src/lib/app-utils/seo-site-scan.js +113 -12
- package/src/lib/app-utils/seo-site-scan.js.map +1 -1
- package/src/lib/app-utils/server.d.ts +5 -4
- package/src/lib/app-utils/server.js +14 -5
- package/src/lib/app-utils/server.js.map +1 -1
- package/src/lib/app-utils/site-icon-set.d.ts +195 -0
- package/src/lib/app-utils/site-icon-set.js +351 -0
- package/src/lib/app-utils/site-icon-set.js.map +1 -0
- package/src/lib/app-utils/site-interactions.d.ts +101 -4
- package/src/lib/app-utils/site-interactions.js +120 -4
- package/src/lib/app-utils/site-interactions.js.map +1 -1
- package/src/lib/app-utils/starter-template-nodes.d.ts +7 -0
- package/src/lib/app-utils/starter-template-nodes.js +3 -0
- package/src/lib/app-utils/starter-template-nodes.js.map +1 -1
- package/src/lib/app-utils/starter-templates.d.ts +5 -19
- package/src/lib/app-utils/starter-templates.js +5 -49
- package/src/lib/app-utils/starter-templates.js.map +1 -1
- package/src/lib/app-utils/transfer-launcher-context.d.ts +136 -0
- package/src/lib/app-utils/transfer-launcher-context.js +23 -0
- package/src/lib/app-utils/transfer-launcher-context.js.map +1 -0
- package/src/lib/app-utils/transfer-resume-import.d.ts +39 -0
- package/src/lib/app-utils/transfer-resume-import.js +128 -0
- package/src/lib/app-utils/transfer-resume-import.js.map +1 -0
- package/src/lib/app-utils/upgrade-proposal.d.ts +66 -0
- package/src/lib/app-utils/upgrade-proposal.js +95 -0
- package/src/lib/app-utils/upgrade-proposal.js.map +1 -0
- package/src/lib/app-utils/utc-month.d.ts +33 -0
- package/src/lib/app-utils/utc-month.js +35 -0
- package/src/lib/app-utils/utc-month.js.map +1 -0
- package/src/lib/app-utils/visitor-record-ceiling.d.ts +4 -4
- package/src/lib/app-utils/visitor-record-ceiling.js +4 -4
- package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -1
- package/src/lib/app-utils/wire-nodes.d.ts +39 -19
- package/src/lib/app-utils/wire-nodes.js +120 -34
- package/src/lib/app-utils/wire-nodes.js.map +1 -1
- package/src/lib/data-transfer/access.d.ts +74 -0
- package/src/lib/data-transfer/access.js +93 -0
- package/src/lib/data-transfer/access.js.map +1 -0
- package/src/lib/data-transfer/derive.d.ts +246 -0
- package/src/lib/data-transfer/derive.js +1007 -0
- package/src/lib/data-transfer/derive.js.map +1 -0
- package/src/lib/data-transfer/export-file.d.ts +46 -0
- package/src/lib/data-transfer/export-file.js +146 -0
- package/src/lib/data-transfer/export-file.js.map +1 -0
- package/src/lib/data-transfer/field-catalog.d.ts +134 -0
- package/src/lib/data-transfer/field-catalog.js +278 -0
- package/src/lib/data-transfer/field-catalog.js.map +1 -0
- package/src/lib/data-transfer/header-match.d.ts +129 -0
- package/src/lib/data-transfer/header-match.js +367 -0
- package/src/lib/data-transfer/header-match.js.map +1 -0
- package/src/lib/data-transfer/index.d.ts +34 -0
- package/src/lib/data-transfer/index.js +40 -0
- package/src/lib/data-transfer/index.js.map +1 -0
- package/src/lib/data-transfer/job.d.ts +190 -0
- package/src/lib/data-transfer/job.js +229 -0
- package/src/lib/data-transfer/job.js.map +1 -0
- package/src/lib/data-transfer/lookup.d.ts +45 -0
- package/src/lib/data-transfer/lookup.js +71 -0
- package/src/lib/data-transfer/lookup.js.map +1 -0
- package/src/lib/data-transfer/match.d.ts +99 -0
- package/src/lib/data-transfer/match.js +244 -0
- package/src/lib/data-transfer/match.js.map +1 -0
- package/src/lib/data-transfer/package-plan.d.ts +205 -0
- package/src/lib/data-transfer/package-plan.js +475 -0
- package/src/lib/data-transfer/package-plan.js.map +1 -0
- package/src/lib/data-transfer/package.d.ts +181 -0
- package/src/lib/data-transfer/package.js +426 -0
- package/src/lib/data-transfer/package.js.map +1 -0
- package/src/lib/data-transfer/picklist-map.d.ts +139 -0
- package/src/lib/data-transfer/picklist-map.js +271 -0
- package/src/lib/data-transfer/picklist-map.js.map +1 -0
- package/src/lib/data-transfer/plan.d.ts +176 -0
- package/src/lib/data-transfer/plan.js +451 -0
- package/src/lib/data-transfer/plan.js.map +1 -0
- package/src/lib/data-transfer/policy.d.ts +170 -0
- package/src/lib/data-transfer/policy.js +378 -0
- package/src/lib/data-transfer/policy.js.map +1 -0
- package/src/lib/data-transfer/resource.d.ts +211 -0
- package/src/lib/data-transfer/resource.js +241 -0
- package/src/lib/data-transfer/resource.js.map +1 -0
- package/src/lib/data-transfer/review.d.ts +70 -0
- package/src/lib/data-transfer/review.js +233 -0
- package/src/lib/data-transfer/review.js.map +1 -0
- package/src/lib/data-transfer/similarity.d.ts +40 -0
- package/src/lib/data-transfer/similarity.js +106 -0
- package/src/lib/data-transfer/similarity.js.map +1 -0
- package/src/lib/data-transfer/site-package.d.ts +365 -0
- package/src/lib/data-transfer/site-package.js +1077 -0
- package/src/lib/data-transfer/site-package.js.map +1 -0
- package/src/lib/data-transfer/source.d.ts +74 -0
- package/src/lib/data-transfer/source.js +293 -0
- package/src/lib/data-transfer/source.js.map +1 -0
- package/src/lib/data-transfer/transfer-api.d.ts +898 -0
- package/src/lib/data-transfer/transfer-api.js +107 -0
- package/src/lib/data-transfer/transfer-api.js.map +1 -0
- package/src/lib/foundation/definitions/org-billing.types.d.ts +31 -0
- package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
- package/src/lib/foundation/definitions/organization.types.d.ts +42 -1
- package/src/lib/foundation/definitions/organization.types.js.map +1 -1
- package/src/lib/foundation/definitions/platform.types.d.ts +6 -4
- package/src/lib/foundation/definitions/platform.types.js.map +1 -1
- package/src/lib/foundation/index.d.ts +1 -1
- package/src/lib/foundation/index.js.map +1 -1
- package/src/lib/plugin-manager/feature-plugins.d.ts +91 -2
- package/src/lib/plugin-manager/feature-plugins.js +48 -3
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +50 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js +1129 -28
- package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
- package/src/lib/plugin-manager/index.d.ts +0 -1
- package/src/lib/plugin-manager/index.js +0 -1
- package/src/lib/plugin-manager/index.js.map +1 -1
- package/src/lib/plugin-manager/interaction-recipes.d.ts +142 -0
- package/src/lib/plugin-manager/interaction-recipes.js +104 -0
- package/src/lib/plugin-manager/interaction-recipes.js.map +1 -0
- package/src/lib/plugin-manager/interaction-step-checks.d.ts +66 -0
- package/src/lib/plugin-manager/interaction-step-checks.js +86 -0
- package/src/lib/plugin-manager/interaction-step-checks.js.map +1 -0
- package/src/lib/plugin-manager/plugin-artifact-types.d.ts +235 -0
- package/src/lib/plugin-manager/plugin-artifact-types.js +99 -0
- package/src/lib/plugin-manager/plugin-artifact-types.js.map +1 -0
- package/src/lib/plugin-manager/plugin-contact-capture.d.ts +8 -0
- package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
- package/src/lib/plugin-manager/plugin-conversion-credit.d.ts +216 -0
- package/src/lib/plugin-manager/plugin-conversion-credit.js +91 -0
- package/src/lib/plugin-manager/plugin-conversion-credit.js.map +1 -0
- package/src/lib/plugin-manager/plugin-entity-pickers.d.ts +83 -0
- package/src/lib/plugin-manager/plugin-entity-pickers.js +87 -0
- package/src/lib/plugin-manager/plugin-entity-pickers.js.map +1 -0
- package/src/lib/plugin-manager/plugin-host-resources.d.ts +6 -0
- package/src/lib/plugin-manager/plugin-host-resources.js +6 -1
- package/src/lib/plugin-manager/plugin-host-resources.js.map +1 -1
- package/src/lib/plugin-manager/plugin-intake-gates.d.ts +75 -0
- package/src/lib/plugin-manager/plugin-intake-gates.js +49 -0
- package/src/lib/plugin-manager/plugin-intake-gates.js.map +1 -0
- package/src/lib/plugin-manager/plugin-jobs.d.ts +5 -5
- package/src/lib/plugin-manager/plugin-jobs.js +7 -7
- package/src/lib/plugin-manager/plugin-jobs.js.map +1 -1
- package/src/lib/plugin-manager/plugin-live-paths.d.ts +70 -0
- package/src/lib/plugin-manager/plugin-live-paths.js +66 -0
- package/src/lib/plugin-manager/plugin-live-paths.js.map +1 -0
- package/src/lib/plugin-manager/plugin-org-erasure.d.ts +3 -2
- package/src/lib/plugin-manager/plugin-org-erasure.js +30 -5
- package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -1
- package/src/lib/plugin-manager/plugin-person-erasure.d.ts +68 -9
- package/src/lib/plugin-manager/plugin-person-erasure.js +196 -51
- package/src/lib/plugin-manager/plugin-person-erasure.js.map +1 -1
- package/src/lib/plugin-manager/plugin-person-records.d.ts +275 -0
- package/src/lib/plugin-manager/plugin-person-records.js +107 -0
- package/src/lib/plugin-manager/plugin-person-records.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-counts.d.ts +76 -0
- package/src/lib/plugin-manager/plugin-record-counts.js +49 -0
- package/src/lib/plugin-manager/plugin-record-counts.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-email-state.d.ts +26 -0
- package/src/lib/plugin-manager/plugin-record-email-state.js +16 -0
- package/src/lib/plugin-manager/plugin-record-email-state.js.map +1 -1
- package/src/lib/plugin-manager/plugin-record-index.d.ts +10 -0
- package/src/lib/plugin-manager/plugin-record-index.js.map +1 -1
- package/src/lib/plugin-manager/plugin-record-lists.d.ts +86 -6
- package/src/lib/plugin-manager/plugin-record-lists.js +42 -5
- package/src/lib/plugin-manager/plugin-record-lists.js.map +1 -1
- package/src/lib/plugin-manager/plugin-record-origin.d.ts +79 -0
- package/src/lib/plugin-manager/plugin-record-origin.js +46 -0
- package/src/lib/plugin-manager/plugin-record-origin.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-pages.d.ts +37 -0
- package/src/lib/plugin-manager/plugin-record-pages.js +52 -0
- package/src/lib/plugin-manager/plugin-record-pages.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-timeline.d.ts +60 -0
- package/src/lib/plugin-manager/plugin-record-timeline.js +16 -0
- package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -1
- package/src/lib/plugin-manager/plugin-resource-drafts.d.ts +5 -5
- package/src/lib/plugin-manager/plugin-resource-drafts.js.map +1 -1
- package/src/lib/plugin-manager/plugin-revocations.d.ts +64 -0
- package/src/lib/plugin-manager/plugin-revocations.js +47 -0
- package/src/lib/plugin-manager/plugin-revocations.js.map +1 -0
- package/src/lib/plugin-manager/plugin-send-tallies.d.ts +69 -0
- package/src/lib/plugin-manager/plugin-send-tallies.js +45 -0
- package/src/lib/plugin-manager/plugin-send-tallies.js.map +1 -0
- package/src/lib/plugin-manager/plugin-site-bundle.d.ts +40 -0
- package/src/lib/plugin-manager/plugin-site-bundle.js +4 -0
- package/src/lib/plugin-manager/plugin-site-bundle.js.map +1 -1
- package/src/lib/plugin-manager/plugin-site-export.d.ts +57 -1
- package/src/lib/plugin-manager/plugin-site-export.js +23 -10
- package/src/lib/plugin-manager/plugin-site-export.js.map +1 -1
- package/src/lib/plugin-manager/plugin-sitemap-readers.d.ts +146 -0
- package/src/lib/plugin-manager/plugin-sitemap-readers.js +110 -0
- package/src/lib/plugin-manager/plugin-sitemap-readers.js.map +1 -0
- package/src/lib/plugin-manager/plugin-transfer-resources.d.ts +714 -0
- package/src/lib/plugin-manager/plugin-transfer-resources.js +443 -0
- package/src/lib/plugin-manager/plugin-transfer-resources.js.map +1 -0
- package/src/lib/plugin-manager/plugin-usage-axes.d.ts +54 -5
- package/src/lib/plugin-manager/plugin-usage-axes.js +11 -3
- package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -1
- package/src/lib/plugin-manager/plugin-user-erasure.js +9 -1
- package/src/lib/plugin-manager/plugin-user-erasure.js.map +1 -1
- package/src/lib/plugin-manager/plugin-visitor-doors.d.ts +104 -0
- package/src/lib/plugin-manager/plugin-visitor-doors.js +108 -0
- package/src/lib/plugin-manager/plugin-visitor-doors.js.map +1 -0
- package/src/lib/plugin-manager/realm-host-aglyn.generated.js +2 -0
- package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -1
- package/src/lib/plugin-manager/repeat-rows.d.ts +5 -6
- package/src/lib/plugin-manager/repeat-rows.js.map +1 -1
- package/src/lib/app-utils/actions.d.ts +0 -310
- package/src/lib/app-utils/actions.js +0 -506
- package/src/lib/app-utils/actions.js.map +0 -1
- package/src/lib/app-utils/automation-placeholders.d.ts +0 -72
- package/src/lib/app-utils/automation-placeholders.js +0 -207
- package/src/lib/app-utils/automation-placeholders.js.map +0 -1
- package/src/lib/app-utils/dataset-models.d.ts +0 -339
- package/src/lib/app-utils/dataset-models.js +0 -722
- package/src/lib/app-utils/dataset-models.js.map +0 -1
- package/src/lib/app-utils/datasets.d.ts +0 -171
- package/src/lib/app-utils/datasets.js +0 -227
- package/src/lib/app-utils/datasets.js.map +0 -1
- package/src/lib/app-utils/form-abuse-ceiling.d.ts +0 -146
- package/src/lib/app-utils/form-abuse-ceiling.js +0 -158
- package/src/lib/app-utils/form-abuse-ceiling.js.map +0 -1
- package/src/lib/plugin-manager/order-fulfilment.d.ts +0 -142
- package/src/lib/plugin-manager/order-fulfilment.js +0 -104
- package/src/lib/plugin-manager/order-fulfilment.js.map +0 -1
|
@@ -48,6 +48,7 @@ import { type ConsentGroup } from './consent-groups';
|
|
|
48
48
|
import { type ContactLifecycleStage, type CrmActivityKind, type CrmTaskKind } from './crm-kinds';
|
|
49
49
|
import { type ContactInteraction, type ContactSegment, type ContactSource } from './contacts';
|
|
50
50
|
import { type EmailState } from './email-state';
|
|
51
|
+
import { mintPicklistValueId, normalizePicklistLabel, picklistActiveValues, picklistDefaultLabel, picklistFromLabels, type PicklistJudgement, picklistOptions, type PicklistOption, picklistRank, type PicklistSpec, type PicklistValue, picklistValueByLabel, type PicklistValueSet } from './picklists';
|
|
51
52
|
import { type ScopeToken } from './scope-tokens';
|
|
52
53
|
export * from './crm-kinds';
|
|
53
54
|
/**
|
|
@@ -227,10 +228,38 @@ export interface CrmCompany extends CrmScoped {
|
|
|
227
228
|
website?: string;
|
|
228
229
|
/** E.164 — `normalizePhone` before writing. */
|
|
229
230
|
phone?: string;
|
|
231
|
+
/** The billing address — Salesforce's Billing Address, under its original name. */
|
|
230
232
|
address?: AglynPostalAddress | null;
|
|
233
|
+
/**
|
|
234
|
+
* Salesforce's Industry: a label of the `industry` picklist (AGL-3514).
|
|
235
|
+
* A record written while it was free text keeps its text.
|
|
236
|
+
*/
|
|
231
237
|
industry?: string;
|
|
232
238
|
ownerUid?: string;
|
|
233
239
|
notes?: string;
|
|
240
|
+
/** Account Type: a label of the `accountType` picklist. */
|
|
241
|
+
type?: string | null;
|
|
242
|
+
/** Rating: a label of the `rating` picklist. */
|
|
243
|
+
rating?: string | null;
|
|
244
|
+
/** Ownership: a label of the `ownership` picklist. */
|
|
245
|
+
ownership?: string | null;
|
|
246
|
+
/** Account Source: a label of the `leadSource` picklist. */
|
|
247
|
+
accountSource?: string | null;
|
|
248
|
+
/** Annual revenue in the minor unit of {@link CrmCompany.currency}. */
|
|
249
|
+
annualRevenueCents?: number | null;
|
|
250
|
+
/** Lowercase ISO 4217, the deals' convention; `'usd'` when absent. */
|
|
251
|
+
currency?: string;
|
|
252
|
+
numberOfEmployees?: number | null;
|
|
253
|
+
/** E.164 — `normalizePhone`, like `phone`. */
|
|
254
|
+
fax?: string | null;
|
|
255
|
+
accountNumber?: string | null;
|
|
256
|
+
/** Salesforce's Account Site: which of the company's locations this record is. */
|
|
257
|
+
site?: string | null;
|
|
258
|
+
tickerSymbol?: string | null;
|
|
259
|
+
sicCode?: string | null;
|
|
260
|
+
shippingAddress?: AglynPostalAddress | null;
|
|
261
|
+
/** Another company of the same scope this one sits under; never itself or a descendant. */
|
|
262
|
+
parentCompanyId?: string | null;
|
|
234
263
|
/**
|
|
235
264
|
* Lowercased, deduplicated, capped at twenty — the same shape a contact's
|
|
236
265
|
* tags take, so a bulk "Add tag" over companies and one over contacts
|
|
@@ -271,7 +300,55 @@ export interface CrmDealStage {
|
|
|
271
300
|
* between.
|
|
272
301
|
*/
|
|
273
302
|
kind: 'open' | 'won' | 'lost';
|
|
303
|
+
/**
|
|
304
|
+
* The forecast category a deal takes on landing here (AGL-3516) — see
|
|
305
|
+
* {@link CrmForecastCategory}. Absent on a stage written before the field
|
|
306
|
+
* existed, which reads as its kind's: Closed for won, Omitted for lost,
|
|
307
|
+
* Pipeline for open ({@link dealStageForecastCategory}).
|
|
308
|
+
*/
|
|
309
|
+
forecastCategory?: CrmForecastCategory;
|
|
274
310
|
}
|
|
311
|
+
export declare const CRM_FORECAST_CATEGORIES: readonly ["omitted", "pipeline", "bestCase", "commit", "closed"];
|
|
312
|
+
export type CrmForecastCategory = (typeof CRM_FORECAST_CATEGORIES)[number];
|
|
313
|
+
export declare const CRM_FORECAST_CATEGORY_LABELS: Record<CrmForecastCategory, string>;
|
|
314
|
+
export declare function isCrmForecastCategory(value: unknown): value is CrmForecastCategory;
|
|
315
|
+
/**
|
|
316
|
+
* A category as typed — the stored key or its label in any case and
|
|
317
|
+
* spacing ("Best Case", "best case", `bestCase`) — or `null`.
|
|
318
|
+
*/
|
|
319
|
+
export declare function readCrmForecastCategory(value: unknown): CrmForecastCategory | null;
|
|
320
|
+
/** The category a stage stamps: its own, else its kind's. */
|
|
321
|
+
export declare function dealStageForecastCategory(stage: Pick<CrmDealStage, 'kind' | 'forecastCategory'>): CrmForecastCategory;
|
|
322
|
+
/**
|
|
323
|
+
* A deal's forecast category as every reader takes it: the deal's own,
|
|
324
|
+
* else its stage's, else its status's — a deal written before the field
|
|
325
|
+
* existed forecasts where its stage puts it.
|
|
326
|
+
*/
|
|
327
|
+
export declare function dealForecastCategory(deal: Partial<Pick<CrmDeal, 'forecastCategory' | 'status'>>, stage: Pick<CrmDealStage, 'kind' | 'forecastCategory'> | null | undefined): CrmForecastCategory;
|
|
328
|
+
/** The longest Next step a deal keeps — Salesforce's own 255. */
|
|
329
|
+
export declare const DEAL_NEXT_STEP_MAX = 255;
|
|
330
|
+
/**
|
|
331
|
+
* A probability override as stored: a whole number 0–100, or `null` for
|
|
332
|
+
* none (the stage's applies). Anything that is not a number in range is
|
|
333
|
+
* `undefined` — unreadable, for the writer to refuse.
|
|
334
|
+
*/
|
|
335
|
+
export declare function readDealProbability(value: unknown): number | null | undefined;
|
|
336
|
+
/**
|
|
337
|
+
* A deal's probability: its own override when it holds one, else its
|
|
338
|
+
* stage's, else `null` for a stage the pipeline no longer has.
|
|
339
|
+
*/
|
|
340
|
+
export declare function dealProbability(deal: Partial<Pick<CrmDeal, 'probability'>>, stage: Pick<CrmDealStage, 'probability'> | null | undefined): number | null;
|
|
341
|
+
/**
|
|
342
|
+
* What a stage move writes besides the stage, the status and the clocks:
|
|
343
|
+
* the new stage's forecast category, and the probability override CLEARED
|
|
344
|
+
* — Salesforce re-defaults a probability when the stage changes, so an
|
|
345
|
+
* override typed for the last stage does not follow the deal into the next.
|
|
346
|
+
* A write that sets either field itself, in the same request, wins.
|
|
347
|
+
*/
|
|
348
|
+
export declare function dealStageMoveFields(stage: Pick<CrmDealStage, 'kind' | 'forecastCategory'>): {
|
|
349
|
+
forecastCategory: CrmForecastCategory;
|
|
350
|
+
probability: null;
|
|
351
|
+
};
|
|
275
352
|
/** `orgs/{orgId}/pipelines/{pipelineId}`. */
|
|
276
353
|
export interface CrmPipeline extends CrmScoped {
|
|
277
354
|
name: string;
|
|
@@ -289,7 +366,14 @@ export interface CrmPipeline extends CrmScoped {
|
|
|
289
366
|
/** Whether a pipeline has been retired — see {@link CrmPipeline.archivedAt}. */
|
|
290
367
|
export declare function isPipelineArchived(pipeline: Pick<CrmPipeline, 'archivedAt'> | null | undefined): boolean;
|
|
291
368
|
/**
|
|
292
|
-
* The stages a fresh pipeline starts with
|
|
369
|
+
* The stages a fresh pipeline starts with: Salesforce's standard
|
|
370
|
+
* Opportunity stages, with its probabilities and forecast categories
|
|
371
|
+
* (AGL-3516). A pipeline seeded before them keeps the stages it was seeded
|
|
372
|
+
* with — nothing migrates a stored pipeline.
|
|
373
|
+
*
|
|
374
|
+
* The closing stages keep the ids `won` and `lost` every pipeline has had,
|
|
375
|
+
* so an automation filter naming them reads the same on old pipelines and
|
|
376
|
+
* new ones.
|
|
293
377
|
*
|
|
294
378
|
* Readonly on purpose: a pipeline document stores its own COPY (`[...]`), so
|
|
295
379
|
* a merchant editing their stages must not be editing the module's default,
|
|
@@ -370,6 +454,42 @@ export interface CrmDeal extends CrmScoped {
|
|
|
370
454
|
lostReason?: string;
|
|
371
455
|
notes?: string;
|
|
372
456
|
createdByUid?: string;
|
|
457
|
+
/**
|
|
458
|
+
* Salesforce's Type — the LABEL of one of the org's `opportunityType`
|
|
459
|
+
* values (New Business, Existing Business, …); `typeKey` beside it is
|
|
460
|
+
* what the Deals list filters by.
|
|
461
|
+
*/
|
|
462
|
+
type?: string;
|
|
463
|
+
/**
|
|
464
|
+
* Salesforce's Lead Source — the LABEL of one of the org's `leadSource`
|
|
465
|
+
* values, the picklist a lead's own lead source is; stamped from the
|
|
466
|
+
* lead a conversion opens the deal for. `leadSourceKey` beside it.
|
|
467
|
+
*/
|
|
468
|
+
leadSource?: string;
|
|
469
|
+
/** What happens next, at most {@link DEAL_NEXT_STEP_MAX} characters. */
|
|
470
|
+
nextStep?: string;
|
|
471
|
+
/**
|
|
472
|
+
* This deal's own chance of closing, a whole number 0–100, overriding
|
|
473
|
+
* its stage's; `null` or absent means the stage's applies. Cleared by
|
|
474
|
+
* every stage move ({@link dealStageMoveFields}).
|
|
475
|
+
*/
|
|
476
|
+
probability?: number | null;
|
|
477
|
+
/**
|
|
478
|
+
* Where the deal is forecast — stamped from the stage at every stage move
|
|
479
|
+
* and changeable for this deal afterwards. See {@link dealForecastCategory}.
|
|
480
|
+
*/
|
|
481
|
+
forecastCategory?: CrmForecastCategory;
|
|
482
|
+
/**
|
|
483
|
+
* Salesforce's Primary Campaign Source: ONE of the org's campaigns (the
|
|
484
|
+
* Marketing plugin's containers, which a lead's `campaignIds` name).
|
|
485
|
+
*/
|
|
486
|
+
campaignId?: string;
|
|
487
|
+
/**
|
|
488
|
+
* Salesforce's Opportunity Contact Roles (AGL-3521): the people on the
|
|
489
|
+
* deal and the part each plays, at most one of them Primary — the one
|
|
490
|
+
* `contactId` names. See {@link dealContactRolesOf}.
|
|
491
|
+
*/
|
|
492
|
+
contactRoles?: CrmDealContactRole[];
|
|
373
493
|
/**
|
|
374
494
|
* Custom field values, keyed by the key of a definition whose `object`
|
|
375
495
|
* is `deal` — see {@link fieldDefinitionObject} (AGL-2661).
|
|
@@ -392,6 +512,53 @@ export interface CrmDeal extends CrmScoped {
|
|
|
392
512
|
/** Org-library files attached to the deal (AGL-2662) — see {@link CRM_MEDIA_IDS_MAX}. */
|
|
393
513
|
mediaIds?: string[];
|
|
394
514
|
}
|
|
515
|
+
/** The most contacts one deal names — a buying committee, not a mailing list. */
|
|
516
|
+
export declare const DEAL_CONTACT_ROLES_MAX = 50;
|
|
517
|
+
/** One contact on a deal. */
|
|
518
|
+
export interface CrmDealContactRole {
|
|
519
|
+
contactId: string;
|
|
520
|
+
/** The `opportunityContactRole` label, absent for a contact with no role yet. */
|
|
521
|
+
role?: string;
|
|
522
|
+
primary: boolean;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Stored or sent roles, read defensively: a row without a usable contact
|
|
526
|
+
* id is dropped, a contact named twice keeps its first row, only the first
|
|
527
|
+
* Primary stays Primary, and the list stops at {@link DEAL_CONTACT_ROLES_MAX}.
|
|
528
|
+
*/
|
|
529
|
+
export declare function readDealContactRoles(raw: unknown): CrmDealContactRole[];
|
|
530
|
+
/**
|
|
531
|
+
* `roles` with `contactId` as the one Primary — added first, with no role,
|
|
532
|
+
* when the list does not name them — or, for `null`, with no Primary.
|
|
533
|
+
*/
|
|
534
|
+
export declare function dealContactRolesWithPrimary(roles: readonly CrmDealContactRole[], contactId: string | null | undefined): CrmDealContactRole[];
|
|
535
|
+
/**
|
|
536
|
+
* The roles a deal holds, in step with its `contactId`: the stored list
|
|
537
|
+
* with the contact `contactId` names as its Primary — so a deal written
|
|
538
|
+
* before roles reads as its one contact, Primary, with no role.
|
|
539
|
+
*/
|
|
540
|
+
export declare function dealContactRolesOf(deal: {
|
|
541
|
+
contactId?: unknown;
|
|
542
|
+
contactRoles?: unknown;
|
|
543
|
+
}): CrmDealContactRole[];
|
|
544
|
+
/** The Primary's contact id, or `null` for a deal with none. */
|
|
545
|
+
export declare function dealPrimaryContactId(roles: readonly CrmDealContactRole[]): string | null;
|
|
546
|
+
/** `roles` without one contact — a delete or an erasure of that person. */
|
|
547
|
+
export declare function dealContactRolesWithout(roles: readonly CrmDealContactRole[], contactId: string): CrmDealContactRole[];
|
|
548
|
+
/**
|
|
549
|
+
* `roles` with every row naming `from` moved to `to` — a contact merge.
|
|
550
|
+
* When both are on the deal the survivor keeps its own row, taking the
|
|
551
|
+
* merged row's role where it has none and its Primary where it was.
|
|
552
|
+
*/
|
|
553
|
+
export declare function dealContactRolesRepointed(roles: readonly CrmDealContactRole[], from: string, to: string): CrmDealContactRole[];
|
|
554
|
+
/**
|
|
555
|
+
* What a deal stores for a list of roles: the list, and the `contactId`
|
|
556
|
+
* its Primary names — `null` for none, which a writer turns into a delete.
|
|
557
|
+
*/
|
|
558
|
+
export declare function dealContactRoleFields(roles: readonly CrmDealContactRole[]): {
|
|
559
|
+
contactRoles: CrmDealContactRole[];
|
|
560
|
+
contactId: string | null;
|
|
561
|
+
};
|
|
395
562
|
export declare const CRM_TASK_KIND_LABELS: Record<CrmTaskKind, string>;
|
|
396
563
|
export type CrmTaskPriority = 'low' | 'normal' | 'high';
|
|
397
564
|
export type CrmTaskStatus = 'open' | 'done';
|
|
@@ -413,6 +580,15 @@ export interface CrmTask extends Omit<CrmScoped, 'hostId'> {
|
|
|
413
580
|
kind: CrmTaskKind;
|
|
414
581
|
priority: CrmTaskPriority;
|
|
415
582
|
status: CrmTaskStatus;
|
|
583
|
+
/**
|
|
584
|
+
* The org's labels for `status`, `priority` and `kind` (AGL-3517) — a
|
|
585
|
+
* value of the `taskStatus`, `taskPriority` and `taskType` picklists,
|
|
586
|
+
* whose meaning is the field beside it. Absent or `null` shows the first
|
|
587
|
+
* active value of that meaning; see `crmTaskPicklistLabels`.
|
|
588
|
+
*/
|
|
589
|
+
statusLabel?: string | null;
|
|
590
|
+
priorityLabel?: string | null;
|
|
591
|
+
typeLabel?: string | null;
|
|
416
592
|
dueAtMs?: number | null;
|
|
417
593
|
completedAtMs?: number | null;
|
|
418
594
|
/**
|
|
@@ -549,6 +725,21 @@ export declare function crmEmailDeliveryTags(input: {
|
|
|
549
725
|
* which only the capture route files (AGL-2657).
|
|
550
726
|
*/
|
|
551
727
|
export type CrmEmailDirection = 'outbound' | 'inbound';
|
|
728
|
+
/**
|
|
729
|
+
* Which way a call went (AGL-3517) — Salesforce's Call Type: `inbound` for
|
|
730
|
+
* one the contact placed, `outbound` for one the team placed, `internal`
|
|
731
|
+
* for one between teammates about the record.
|
|
732
|
+
*/
|
|
733
|
+
export type CrmCallDirection = CrmEmailDirection | 'internal';
|
|
734
|
+
/** An activity's direction: a call's three, of which an email takes the first two. */
|
|
735
|
+
export type CrmActivityDirection = CrmCallDirection;
|
|
736
|
+
/** The directions each kind takes, in the order a select lists them; none for the rest. */
|
|
737
|
+
export declare const CRM_ACTIVITY_DIRECTIONS: Readonly<Partial<Record<CrmActivityKind, readonly CrmActivityDirection[]>>>;
|
|
738
|
+
export declare const CRM_ACTIVITY_DIRECTION_LABELS: Record<CrmActivityDirection, string>;
|
|
739
|
+
/** `value` when `kind` takes it as a direction, else `null`. */
|
|
740
|
+
export declare function crmActivityDirection(kind: unknown, value: unknown): CrmActivityDirection | null;
|
|
741
|
+
/** "Inbound call", "Outbound email", "Internal call" — or the kind alone with no direction. */
|
|
742
|
+
export declare function crmActivityKindTitle(kind: CrmActivityKind, direction?: unknown): string;
|
|
552
743
|
/**
|
|
553
744
|
* `orgs/{orgId}/crmActivities/{activityId}` — one thing that happened.
|
|
554
745
|
*
|
|
@@ -608,10 +799,12 @@ export interface CrmActivity extends CrmScoped {
|
|
|
608
799
|
/** The address the message left for. */
|
|
609
800
|
to?: string;
|
|
610
801
|
/**
|
|
611
|
-
* `outbound` for a message the platform sent or a teammate
|
|
612
|
-
* capture address; `inbound` for one a correspondent wrote
|
|
802
|
+
* On an email: `outbound` for a message the platform sent or a teammate
|
|
803
|
+
* copied to the capture address; `inbound` for one a correspondent wrote
|
|
804
|
+
* (AGL-2657). On a call: inbound, outbound or internal (AGL-3517). See
|
|
805
|
+
* {@link CRM_ACTIVITY_DIRECTIONS}.
|
|
613
806
|
*/
|
|
614
|
-
direction?:
|
|
807
|
+
direction?: CrmActivityDirection;
|
|
615
808
|
/** See {@link CrmEmailDeliveryState}; advanced by the delivery webhook. */
|
|
616
809
|
deliveryState?: CrmEmailDeliveryState;
|
|
617
810
|
/** When the delivery state last moved, epoch ms. */
|
|
@@ -919,8 +1112,11 @@ export declare function dealStageById(pipeline: Pick<CrmPipeline, 'stages'> | nu
|
|
|
919
1112
|
* of itself. An open deal with no resolvable stage is worth nothing rather
|
|
920
1113
|
* than everything: the pipeline lost the stage, and a forecast that filled
|
|
921
1114
|
* the gap with 100% would be the most optimistic number available.
|
|
1115
|
+
*
|
|
1116
|
+
* An open deal's own probability override (AGL-3516) replaces its stage's
|
|
1117
|
+
* — see {@link dealProbability}.
|
|
922
1118
|
*/
|
|
923
|
-
export declare function weightedDealAmountCents(deal: Pick<CrmDeal, 'amountCents' | 'status'
|
|
1119
|
+
export declare function weightedDealAmountCents(deal: Pick<CrmDeal, 'amountCents' | 'status'> & Partial<Pick<CrmDeal, 'probability'>>, stage: Pick<CrmDealStage, 'probability'> | null | undefined): number;
|
|
924
1120
|
/** Whether a deal's amount is derived — it has at least one line item. */
|
|
925
1121
|
export declare function dealHasLineItems(deal: Pick<CrmDeal, 'lineItems'> | null | undefined): boolean;
|
|
926
1122
|
/**
|
|
@@ -984,6 +1180,89 @@ export declare function normalizeCompanyDomain(input: unknown): string | null;
|
|
|
984
1180
|
* website imported are stored the same way.
|
|
985
1181
|
*/
|
|
986
1182
|
export declare function normalizeCompanyWebsite(input: unknown): string | null;
|
|
1183
|
+
/** Each company picklist field: the list it holds a value of, and the key the list filters by. */
|
|
1184
|
+
export declare const CRM_COMPANY_PICKLIST_FIELDS: readonly [{
|
|
1185
|
+
readonly field: "type";
|
|
1186
|
+
readonly picklistId: "accountType";
|
|
1187
|
+
readonly keyField: "typeKey";
|
|
1188
|
+
}, {
|
|
1189
|
+
readonly field: "industry";
|
|
1190
|
+
readonly picklistId: "industry";
|
|
1191
|
+
readonly keyField: "industryKey";
|
|
1192
|
+
}, {
|
|
1193
|
+
readonly field: "rating";
|
|
1194
|
+
readonly picklistId: "rating";
|
|
1195
|
+
readonly keyField: "ratingKey";
|
|
1196
|
+
}, {
|
|
1197
|
+
readonly field: "ownership";
|
|
1198
|
+
readonly picklistId: "ownership";
|
|
1199
|
+
}, {
|
|
1200
|
+
readonly field: "accountSource";
|
|
1201
|
+
readonly picklistId: "leadSource";
|
|
1202
|
+
readonly keyField: "accountSourceKey";
|
|
1203
|
+
}];
|
|
1204
|
+
export type CrmCompanyPicklistField = (typeof CRM_COMPANY_PICKLIST_FIELDS)[number]['field'];
|
|
1205
|
+
/** The short text fields, each capped at Salesforce's own length. */
|
|
1206
|
+
export declare const CRM_COMPANY_TEXT_MAX: {
|
|
1207
|
+
readonly accountNumber: 40;
|
|
1208
|
+
readonly site: 80;
|
|
1209
|
+
readonly tickerSymbol: 20;
|
|
1210
|
+
readonly sicCode: 20;
|
|
1211
|
+
};
|
|
1212
|
+
export type CrmCompanyTextField = keyof typeof CRM_COMPANY_TEXT_MAX;
|
|
1213
|
+
/** The most employees a company records — Salesforce's eight digits. */
|
|
1214
|
+
export declare const CRM_COMPANY_EMPLOYEES_MAX = 99999999;
|
|
1215
|
+
/** The account fields that are not picklists, as every door names them. */
|
|
1216
|
+
export declare const CRM_COMPANY_ACCOUNT_FIELDS: readonly ["annualRevenueCents", "currency", "numberOfEmployees", "fax", "accountNumber", "site", "tickerSymbol", "sicCode", "shippingAddress"];
|
|
1217
|
+
export type CrmCompanyAccountField = (typeof CRM_COMPANY_ACCOUNT_FIELDS)[number];
|
|
1218
|
+
/** A short text field as stored: trimmed, single-spaced. */
|
|
1219
|
+
export declare function normalizeCompanyText(value: unknown): string;
|
|
1220
|
+
/**
|
|
1221
|
+
* The account fields a request names, normalized, or the refusal of each
|
|
1222
|
+
* one that cannot be stored — see the block above. A value the door has
|
|
1223
|
+
* already parsed from text (the drawer's revenue, a file's head count)
|
|
1224
|
+
* arrives here as the number it parsed.
|
|
1225
|
+
*/
|
|
1226
|
+
export declare function readCrmCompanyAccountFields(input: Readonly<Record<string, unknown>>): {
|
|
1227
|
+
values: Partial<Pick<CrmCompany, CrmCompanyAccountField>>;
|
|
1228
|
+
errors: Record<string, string>;
|
|
1229
|
+
};
|
|
1230
|
+
/**
|
|
1231
|
+
* The picklist fields a request names, judged against the org's lists —
|
|
1232
|
+
* `lists` holds each list the caller read, and a list it did not read is
|
|
1233
|
+
* judged as the standard values alone. `current` is the record as stored:
|
|
1234
|
+
* its value is kept even when the list no longer offers it, which is how
|
|
1235
|
+
* a company whose industry was typed before Industry became a picklist
|
|
1236
|
+
* keeps it. On a create (`created`), a field not named starts from its
|
|
1237
|
+
* list's default when the org set one.
|
|
1238
|
+
*/
|
|
1239
|
+
export declare function judgeCrmCompanyPicklists(lists: Readonly<Partial<Record<CrmPicklistId, CrmPicklist>>>, requested: Readonly<Partial<Record<string, unknown>>>, options?: {
|
|
1240
|
+
current?: Readonly<Partial<Record<string, unknown>>>;
|
|
1241
|
+
created?: boolean;
|
|
1242
|
+
}): {
|
|
1243
|
+
values: Partial<Record<CrmCompanyPicklistField, string | null>>;
|
|
1244
|
+
errors: Record<string, string>;
|
|
1245
|
+
};
|
|
1246
|
+
/** How deep a chain of parent companies may run. */
|
|
1247
|
+
export declare const CRM_COMPANY_PARENT_DEPTH_MAX = 25;
|
|
1248
|
+
/**
|
|
1249
|
+
* What a parent lookup answers for one company id: its own parent, or
|
|
1250
|
+
* `null` when there is no such company the writer may see.
|
|
1251
|
+
*/
|
|
1252
|
+
export type CrmCompanyParentReader = (companyId: string) => Promise<{
|
|
1253
|
+
parentCompanyId: string | null;
|
|
1254
|
+
} | null>;
|
|
1255
|
+
/**
|
|
1256
|
+
* Why `parentId` cannot be the parent of `companyId` (`null` for a company
|
|
1257
|
+
* not yet created), or `null` when it can: a company is never its own
|
|
1258
|
+
* parent, the parent must be a company the writer can see, and a company
|
|
1259
|
+
* already UNDER this one cannot be put above it — the cycle Salesforce
|
|
1260
|
+
* refuses too. Walks up from the parent through `read`, at most
|
|
1261
|
+
* {@link CRM_COMPANY_PARENT_DEPTH_MAX} steps.
|
|
1262
|
+
*/
|
|
1263
|
+
export declare function crmCompanyParentRefusal(companyId: string | null, parentId: string, read: CrmCompanyParentReader): Promise<string | null>;
|
|
1264
|
+
/** A stored parent id as a reader takes it, `null` for none. */
|
|
1265
|
+
export declare function crmCompanyParentId(value: unknown): string | null;
|
|
987
1266
|
/**
|
|
988
1267
|
* Mailbox domains that belong to people rather than to a business: the
|
|
989
1268
|
* providers anybody can sign up with, and the ones an internet provider
|
|
@@ -1401,6 +1680,12 @@ export declare function isCrmLeadStatus(value: unknown): value is CrmLeadStatus;
|
|
|
1401
1680
|
*/
|
|
1402
1681
|
export interface CrmLeadFields extends CrmLeadProfile {
|
|
1403
1682
|
status?: CrmLeadStatus;
|
|
1683
|
+
/**
|
|
1684
|
+
* Which of the org's Lead status values of `status`'s meaning the lead
|
|
1685
|
+
* holds (AGL-3512); absent, the lead shows its meaning's default label —
|
|
1686
|
+
* see `crmLeadStatusLabel`.
|
|
1687
|
+
*/
|
|
1688
|
+
statusLabel?: string;
|
|
1404
1689
|
/** The team member working the lead. */
|
|
1405
1690
|
ownerUid?: string;
|
|
1406
1691
|
notes?: string;
|
|
@@ -1463,9 +1748,39 @@ export interface CrmLeadProfile {
|
|
|
1463
1748
|
* of the org's lead source values (see {@link CrmPicklist}).
|
|
1464
1749
|
*/
|
|
1465
1750
|
leadSource?: string;
|
|
1751
|
+
/** One of the org's salutation values, by label (`Mr.`, `Dr.` …) — the contact's list. */
|
|
1752
|
+
salutation?: string;
|
|
1753
|
+
/**
|
|
1754
|
+
* The person's given and family names. While either is set, the lead's
|
|
1755
|
+
* `name` is their composition ({@link crmLeadComposedName}), so the name
|
|
1756
|
+
* the list shows and searches is the person the structured fields name. A
|
|
1757
|
+
* lead holding only `name` keeps it as captured: nothing splits a stored
|
|
1758
|
+
* name into parts after the fact.
|
|
1759
|
+
*/
|
|
1760
|
+
firstName?: string;
|
|
1761
|
+
lastName?: string;
|
|
1762
|
+
/** E.164, like {@link phone}. */
|
|
1763
|
+
mobilePhone?: string;
|
|
1764
|
+
/** E.164. */
|
|
1765
|
+
fax?: string;
|
|
1766
|
+
/** A label of the `industry` picklist — the list companies keep (AGL-3514). */
|
|
1767
|
+
industry?: string;
|
|
1768
|
+
/** A label of the `rating` picklist — the list companies keep. */
|
|
1769
|
+
rating?: string;
|
|
1770
|
+
/** Annual revenue in the minor unit of {@link currency}, the company's convention. */
|
|
1771
|
+
annualRevenueCents?: number;
|
|
1772
|
+
/** Lowercase ISO 4217 of the revenue; `'usd'` when absent. */
|
|
1773
|
+
currency?: string;
|
|
1774
|
+
numberOfEmployees?: number;
|
|
1775
|
+
/**
|
|
1776
|
+
* The person asked not to be phoned. Stored only as `true`; absent is
|
|
1777
|
+
* "may be called". A hint beside every number and on the Call button,
|
|
1778
|
+
* never a block — the contact's rule.
|
|
1779
|
+
*/
|
|
1780
|
+
doNotCall?: boolean;
|
|
1466
1781
|
}
|
|
1467
1782
|
/** The profile's keys, in the order a card lists them. */
|
|
1468
|
-
export declare const CRM_LEAD_PROFILE_KEYS: readonly ["company", "jobTitle", "phone", "website", "address", "tags", "leadSource"];
|
|
1783
|
+
export declare const CRM_LEAD_PROFILE_KEYS: readonly ["salutation", "firstName", "lastName", "company", "jobTitle", "phone", "mobilePhone", "fax", "doNotCall", "website", "address", "tags", "leadSource", "industry", "rating", "annualRevenueCents", "currency", "numberOfEmployees"];
|
|
1469
1784
|
export type CrmLeadProfileKey = (typeof CRM_LEAD_PROFILE_KEYS)[number];
|
|
1470
1785
|
/**
|
|
1471
1786
|
* A profile as a writer receives it: a key present is a value to store, a
|
|
@@ -1502,103 +1817,884 @@ export declare function normalizeCrmLeadProfile(input: Record<string, unknown> |
|
|
|
1502
1817
|
patch: CrmLeadProfilePatch;
|
|
1503
1818
|
errors: CrmLeadProfileErrors;
|
|
1504
1819
|
};
|
|
1505
|
-
/**
|
|
1506
|
-
|
|
1507
|
-
|
|
1820
|
+
/**
|
|
1821
|
+
* The `name` a write must store beside a lead's first and last names
|
|
1822
|
+
* (AGL-3513), the contact's rule: while either part is set the name is
|
|
1823
|
+
* their composition, written whenever either moves. `undefined` when the
|
|
1824
|
+
* write names neither part, or when it leaves both blank — a name-only
|
|
1825
|
+
* lead keeps its name, and clearing both parts leaves the name as it
|
|
1826
|
+
* stands.
|
|
1827
|
+
*/
|
|
1828
|
+
export declare function crmLeadComposedName(stored: Readonly<Record<string, unknown>> | null | undefined, patch: Readonly<Pick<CrmLeadProfilePatch, 'firstName' | 'lastName'>>): string | undefined;
|
|
1829
|
+
/**
|
|
1830
|
+
* Each lead picklist field beside the lead source (AGL-3513): the list it
|
|
1831
|
+
* holds a value of, and the key the Leads list filters by. The lists are
|
|
1832
|
+
* the contact's and the company's own — one Salutation, one Industry, one
|
|
1833
|
+
* Rating per org — so a lead converts into the same values.
|
|
1834
|
+
*/
|
|
1835
|
+
export declare const CRM_LEAD_PICKLIST_FIELDS: readonly [{
|
|
1836
|
+
readonly field: "salutation";
|
|
1837
|
+
readonly picklistId: "salutation";
|
|
1838
|
+
}, {
|
|
1839
|
+
readonly field: "industry";
|
|
1840
|
+
readonly picklistId: "industry";
|
|
1841
|
+
readonly keyField: "industryKey";
|
|
1842
|
+
}, {
|
|
1843
|
+
readonly field: "rating";
|
|
1844
|
+
readonly picklistId: "rating";
|
|
1845
|
+
readonly keyField: "ratingKey";
|
|
1846
|
+
}];
|
|
1847
|
+
export type CrmLeadPicklistField = (typeof CRM_LEAD_PICKLIST_FIELDS)[number]['field'];
|
|
1848
|
+
/**
|
|
1849
|
+
* The lead picklist fields a write names, judged against the org's lists
|
|
1850
|
+
* — the company's {@link judgeCrmCompanyPicklists} over the lead's fields:
|
|
1851
|
+
* `lists` holds each list the caller read (a list it did not read is
|
|
1852
|
+
* judged as the standard values alone), the lead's `current` value is kept
|
|
1853
|
+
* even when the list no longer offers it, and on a create a field not
|
|
1854
|
+
* named starts from its list's default.
|
|
1855
|
+
*/
|
|
1856
|
+
export declare function judgeCrmLeadPicklists(lists: Readonly<Partial<Record<CrmPicklistId, CrmPicklist>>>, requested: Readonly<Partial<Record<string, unknown>>>, options?: {
|
|
1857
|
+
current?: Readonly<Partial<Record<string, unknown>>> | null;
|
|
1858
|
+
created?: boolean;
|
|
1859
|
+
}): {
|
|
1860
|
+
values: Partial<Record<CrmLeadPicklistField, string | null>>;
|
|
1861
|
+
errors: Partial<Record<CrmLeadPicklistField, string>>;
|
|
1862
|
+
};
|
|
1863
|
+
/** The CRM objects a picklist's values are kept on. */
|
|
1864
|
+
export type CrmPicklistObject = CrmFieldObject | 'task';
|
|
1865
|
+
/**
|
|
1866
|
+
* The Fields tabs, in order: every object with custom fields, then Tasks,
|
|
1867
|
+
* which has standard picklists and no custom fields (AGL-3517).
|
|
1868
|
+
*/
|
|
1869
|
+
export declare const CRM_PICKLIST_OBJECTS: readonly CrmPicklistObject[];
|
|
1870
|
+
/** How each object reads on the Fields tabs and in a refusal. */
|
|
1871
|
+
export declare const CRM_PICKLIST_OBJECT_LABELS: Record<CrmPicklistObject, string>;
|
|
1872
|
+
export declare function isCrmPicklistObject(value: unknown): value is CrmPicklistObject;
|
|
1873
|
+
/**
|
|
1874
|
+
* One place records hold a picklist's label. `field` is the record's own
|
|
1875
|
+
* field; `keyField`, when set, is the query key written beside it
|
|
1876
|
+
* ({@link crmPicklistKey}); `facet` means the label lives in each holder's
|
|
1877
|
+
* facet on a contact rather than on the record itself.
|
|
1878
|
+
*
|
|
1879
|
+
* `arrayKey` (AGL-3521) means `field` is a LIST of objects and the label is
|
|
1880
|
+
* each entry's `arrayKey` — a deal's contact roles, `{ contactId, role }`.
|
|
1881
|
+
* Such a target always names a `keyField`, which is then the list of the
|
|
1882
|
+
* keys its entries hold: the one array a query can find the records by.
|
|
1883
|
+
*/
|
|
1884
|
+
export interface CrmPicklistTarget {
|
|
1885
|
+
object: CrmPicklistObject;
|
|
1886
|
+
field: string;
|
|
1887
|
+
keyField?: string;
|
|
1888
|
+
facet?: true;
|
|
1889
|
+
arrayKey?: string;
|
|
1890
|
+
}
|
|
1891
|
+
/** A standard picklist field of the CRM. */
|
|
1892
|
+
export interface CrmPicklistDefinition extends PicklistSpec {
|
|
1893
|
+
/** The document id under `crmPicklists`, and the field's name in code. */
|
|
1894
|
+
id: string;
|
|
1895
|
+
/** The field's name in a sentence's subject: "Lead source must be one of: …". */
|
|
1896
|
+
label: string;
|
|
1897
|
+
/** The values in a sentence: "no active lead sources". */
|
|
1898
|
+
plural: string;
|
|
1899
|
+
/** The Fields tab its values are managed on. */
|
|
1900
|
+
object: CrmPicklistObject;
|
|
1901
|
+
/** Every place records hold its label — what a rename and a delete rewrite. */
|
|
1902
|
+
targets: readonly CrmPicklistTarget[];
|
|
1903
|
+
/** How each of `meanings` reads on screen — the Fields page's Means column (AGL-3512). */
|
|
1904
|
+
meaningLabels?: Readonly<Record<string, string>>;
|
|
1905
|
+
/**
|
|
1906
|
+
* Meanings only the platform sets, which an org-added value may not take
|
|
1907
|
+
* (AGL-3512): a lead is Qualified by its conversion alone.
|
|
1908
|
+
*/
|
|
1909
|
+
reservedMeanings?: readonly string[];
|
|
1910
|
+
}
|
|
1911
|
+
/** Every standard picklist field the CRM keeps, one document each. */
|
|
1912
|
+
export declare const CRM_PICKLIST_DEFINITIONS: readonly [{
|
|
1913
|
+
readonly id: "leadSource";
|
|
1914
|
+
readonly label: "Lead source";
|
|
1915
|
+
readonly plural: "lead sources";
|
|
1916
|
+
readonly object: "lead";
|
|
1917
|
+
readonly restricted: true;
|
|
1918
|
+
readonly groups: readonly [{
|
|
1919
|
+
readonly id: "inbound";
|
|
1920
|
+
readonly label: "Inbound";
|
|
1921
|
+
}, {
|
|
1922
|
+
readonly id: "outbound";
|
|
1923
|
+
readonly label: "Outbound";
|
|
1924
|
+
}];
|
|
1925
|
+
readonly standardValues: readonly [{
|
|
1926
|
+
readonly id: "web";
|
|
1927
|
+
readonly label: "Web";
|
|
1928
|
+
readonly group: "inbound";
|
|
1929
|
+
}, {
|
|
1930
|
+
readonly id: "phone-inquiry";
|
|
1931
|
+
readonly label: "Phone inquiry";
|
|
1932
|
+
readonly group: "inbound";
|
|
1933
|
+
}, {
|
|
1934
|
+
readonly id: "email-inquiry";
|
|
1935
|
+
readonly label: "Email inquiry";
|
|
1936
|
+
readonly group: "inbound";
|
|
1937
|
+
}, {
|
|
1938
|
+
readonly id: "partner-referral";
|
|
1939
|
+
readonly label: "Partner referral";
|
|
1940
|
+
readonly group: "inbound";
|
|
1941
|
+
}, {
|
|
1942
|
+
readonly id: "employee-referral";
|
|
1943
|
+
readonly label: "Employee referral";
|
|
1944
|
+
readonly group: "inbound";
|
|
1945
|
+
}, {
|
|
1946
|
+
readonly id: "external-referral";
|
|
1947
|
+
readonly label: "External referral";
|
|
1948
|
+
readonly group: "inbound";
|
|
1949
|
+
}, {
|
|
1950
|
+
readonly id: "advertisement";
|
|
1951
|
+
readonly label: "Advertisement";
|
|
1952
|
+
readonly group: "inbound";
|
|
1953
|
+
}, {
|
|
1954
|
+
readonly id: "trade-show";
|
|
1955
|
+
readonly label: "Trade show";
|
|
1956
|
+
readonly group: "inbound";
|
|
1957
|
+
}, {
|
|
1958
|
+
readonly id: "webinar";
|
|
1959
|
+
readonly label: "Webinar";
|
|
1960
|
+
readonly group: "inbound";
|
|
1961
|
+
}, {
|
|
1962
|
+
readonly id: "word-of-mouth";
|
|
1963
|
+
readonly label: "Word of mouth";
|
|
1964
|
+
readonly group: "inbound";
|
|
1965
|
+
}, {
|
|
1966
|
+
readonly id: "website-form";
|
|
1967
|
+
readonly label: "Website form";
|
|
1968
|
+
readonly group: "inbound";
|
|
1969
|
+
}, {
|
|
1970
|
+
readonly id: "booking";
|
|
1971
|
+
readonly label: "Booking";
|
|
1972
|
+
readonly group: "inbound";
|
|
1973
|
+
}, {
|
|
1974
|
+
readonly id: "newsletter-sign-up";
|
|
1975
|
+
readonly label: "Newsletter sign-up";
|
|
1976
|
+
readonly group: "inbound";
|
|
1977
|
+
}, {
|
|
1978
|
+
readonly id: "site-member-sign-up";
|
|
1979
|
+
readonly label: "Site member sign-up";
|
|
1980
|
+
readonly group: "inbound";
|
|
1981
|
+
}, {
|
|
1982
|
+
readonly id: "online-purchase";
|
|
1983
|
+
readonly label: "Online purchase";
|
|
1984
|
+
readonly group: "inbound";
|
|
1985
|
+
}, {
|
|
1986
|
+
readonly id: "account-sign-up";
|
|
1987
|
+
readonly label: "Account sign-up";
|
|
1988
|
+
readonly group: "inbound";
|
|
1989
|
+
}, {
|
|
1990
|
+
readonly id: "purchased-list";
|
|
1991
|
+
readonly label: "Purchased list";
|
|
1992
|
+
readonly group: "outbound";
|
|
1993
|
+
}, {
|
|
1994
|
+
readonly id: "sequence";
|
|
1995
|
+
readonly label: "Sequence";
|
|
1996
|
+
readonly group: "outbound";
|
|
1997
|
+
}, {
|
|
1998
|
+
readonly id: "email-campaign";
|
|
1999
|
+
readonly label: "Email campaign";
|
|
2000
|
+
readonly group: "outbound";
|
|
2001
|
+
}, {
|
|
2002
|
+
readonly id: "other";
|
|
2003
|
+
readonly label: "Other";
|
|
2004
|
+
}];
|
|
2005
|
+
readonly targets: readonly [{
|
|
2006
|
+
readonly object: "lead";
|
|
2007
|
+
readonly field: "leadSource";
|
|
2008
|
+
readonly keyField: "leadSourceKey";
|
|
2009
|
+
}, {
|
|
2010
|
+
readonly object: "contact";
|
|
2011
|
+
readonly field: "leadSource";
|
|
2012
|
+
readonly facet: true;
|
|
2013
|
+
}, {
|
|
2014
|
+
readonly object: "company";
|
|
2015
|
+
readonly field: "accountSource";
|
|
2016
|
+
readonly keyField: "accountSourceKey";
|
|
2017
|
+
}, {
|
|
2018
|
+
readonly object: "deal";
|
|
2019
|
+
readonly field: "leadSource";
|
|
2020
|
+
readonly keyField: "leadSourceKey";
|
|
2021
|
+
}];
|
|
2022
|
+
}, {
|
|
2023
|
+
readonly id: "leadStatus";
|
|
2024
|
+
readonly label: "Lead status";
|
|
2025
|
+
readonly plural: "lead statuses";
|
|
2026
|
+
readonly object: "lead";
|
|
2027
|
+
readonly restricted: true;
|
|
2028
|
+
readonly meanings: readonly ["new", "nurturing", "working", "qualified", "unqualified"];
|
|
2029
|
+
readonly meaningLabels: Record<"new" | "nurturing" | "working" | "qualified" | "unqualified", string>;
|
|
2030
|
+
readonly reservedMeanings: readonly ["qualified"];
|
|
2031
|
+
readonly standardValues: readonly [{
|
|
2032
|
+
readonly id: "new";
|
|
2033
|
+
readonly label: string;
|
|
2034
|
+
readonly meaning: "new";
|
|
2035
|
+
}, {
|
|
2036
|
+
readonly id: "nurturing";
|
|
2037
|
+
readonly label: string;
|
|
2038
|
+
readonly meaning: "nurturing";
|
|
2039
|
+
}, {
|
|
2040
|
+
readonly id: "working";
|
|
2041
|
+
readonly label: string;
|
|
2042
|
+
readonly meaning: "working";
|
|
2043
|
+
}, {
|
|
2044
|
+
readonly id: "qualified";
|
|
2045
|
+
readonly label: string;
|
|
2046
|
+
readonly meaning: "qualified";
|
|
2047
|
+
}, {
|
|
2048
|
+
readonly id: "unqualified";
|
|
2049
|
+
readonly label: string;
|
|
2050
|
+
readonly meaning: "unqualified";
|
|
2051
|
+
}];
|
|
2052
|
+
readonly targets: readonly [{
|
|
2053
|
+
readonly object: "lead";
|
|
2054
|
+
readonly field: "statusLabel";
|
|
2055
|
+
}];
|
|
2056
|
+
}, {
|
|
2057
|
+
readonly id: "accountType";
|
|
2058
|
+
readonly label: "Type";
|
|
2059
|
+
readonly plural: "account types";
|
|
2060
|
+
readonly object: "company";
|
|
2061
|
+
readonly restricted: true;
|
|
2062
|
+
readonly standardValues: readonly [{
|
|
2063
|
+
readonly id: "analyst";
|
|
2064
|
+
readonly label: "Analyst";
|
|
2065
|
+
}, {
|
|
2066
|
+
readonly id: "press";
|
|
2067
|
+
readonly label: "Press";
|
|
2068
|
+
}, {
|
|
2069
|
+
readonly id: "competitor";
|
|
2070
|
+
readonly label: "Competitor";
|
|
2071
|
+
}, {
|
|
2072
|
+
readonly id: "prospect";
|
|
2073
|
+
readonly label: "Prospect";
|
|
2074
|
+
}, {
|
|
2075
|
+
readonly id: "customer";
|
|
2076
|
+
readonly label: "Customer";
|
|
2077
|
+
}, {
|
|
2078
|
+
readonly id: "reseller";
|
|
2079
|
+
readonly label: "Reseller";
|
|
2080
|
+
}, {
|
|
2081
|
+
readonly id: "integrator";
|
|
2082
|
+
readonly label: "Integrator";
|
|
2083
|
+
}, {
|
|
2084
|
+
readonly id: "investor";
|
|
2085
|
+
readonly label: "Investor";
|
|
2086
|
+
}, {
|
|
2087
|
+
readonly id: "partner";
|
|
2088
|
+
readonly label: "Partner";
|
|
2089
|
+
}, {
|
|
2090
|
+
readonly id: "consulting";
|
|
2091
|
+
readonly label: "Consulting";
|
|
2092
|
+
}, {
|
|
2093
|
+
readonly id: "other";
|
|
2094
|
+
readonly label: "Other";
|
|
2095
|
+
}];
|
|
2096
|
+
readonly targets: readonly [{
|
|
2097
|
+
readonly object: "company";
|
|
2098
|
+
readonly field: "type";
|
|
2099
|
+
readonly keyField: "typeKey";
|
|
2100
|
+
}];
|
|
2101
|
+
}, {
|
|
2102
|
+
readonly id: "industry";
|
|
2103
|
+
readonly label: "Industry";
|
|
2104
|
+
readonly plural: "industries";
|
|
2105
|
+
readonly object: "company";
|
|
2106
|
+
readonly restricted: true;
|
|
2107
|
+
readonly standardValues: readonly [{
|
|
2108
|
+
readonly id: "agriculture";
|
|
2109
|
+
readonly label: "Agriculture";
|
|
2110
|
+
}, {
|
|
2111
|
+
readonly id: "apparel";
|
|
2112
|
+
readonly label: "Apparel";
|
|
2113
|
+
}, {
|
|
2114
|
+
readonly id: "banking";
|
|
2115
|
+
readonly label: "Banking";
|
|
2116
|
+
}, {
|
|
2117
|
+
readonly id: "biotechnology";
|
|
2118
|
+
readonly label: "Biotechnology";
|
|
2119
|
+
}, {
|
|
2120
|
+
readonly id: "chemicals";
|
|
2121
|
+
readonly label: "Chemicals";
|
|
2122
|
+
}, {
|
|
2123
|
+
readonly id: "communications";
|
|
2124
|
+
readonly label: "Communications";
|
|
2125
|
+
}, {
|
|
2126
|
+
readonly id: "construction";
|
|
2127
|
+
readonly label: "Construction";
|
|
2128
|
+
}, {
|
|
2129
|
+
readonly id: "consulting";
|
|
2130
|
+
readonly label: "Consulting";
|
|
2131
|
+
}, {
|
|
2132
|
+
readonly id: "education";
|
|
2133
|
+
readonly label: "Education";
|
|
2134
|
+
}, {
|
|
2135
|
+
readonly id: "electronics";
|
|
2136
|
+
readonly label: "Electronics";
|
|
2137
|
+
}, {
|
|
2138
|
+
readonly id: "energy";
|
|
2139
|
+
readonly label: "Energy";
|
|
2140
|
+
}, {
|
|
2141
|
+
readonly id: "engineering";
|
|
2142
|
+
readonly label: "Engineering";
|
|
2143
|
+
}, {
|
|
2144
|
+
readonly id: "entertainment";
|
|
2145
|
+
readonly label: "Entertainment";
|
|
2146
|
+
}, {
|
|
2147
|
+
readonly id: "environmental";
|
|
2148
|
+
readonly label: "Environmental";
|
|
2149
|
+
}, {
|
|
2150
|
+
readonly id: "finance";
|
|
2151
|
+
readonly label: "Finance";
|
|
2152
|
+
}, {
|
|
2153
|
+
readonly id: "food-and-beverage";
|
|
2154
|
+
readonly label: "Food & Beverage";
|
|
2155
|
+
}, {
|
|
2156
|
+
readonly id: "government";
|
|
2157
|
+
readonly label: "Government";
|
|
2158
|
+
}, {
|
|
2159
|
+
readonly id: "healthcare";
|
|
2160
|
+
readonly label: "Healthcare";
|
|
2161
|
+
}, {
|
|
2162
|
+
readonly id: "hospitality";
|
|
2163
|
+
readonly label: "Hospitality";
|
|
2164
|
+
}, {
|
|
2165
|
+
readonly id: "insurance";
|
|
2166
|
+
readonly label: "Insurance";
|
|
2167
|
+
}, {
|
|
2168
|
+
readonly id: "machinery";
|
|
2169
|
+
readonly label: "Machinery";
|
|
2170
|
+
}, {
|
|
2171
|
+
readonly id: "manufacturing";
|
|
2172
|
+
readonly label: "Manufacturing";
|
|
2173
|
+
}, {
|
|
2174
|
+
readonly id: "media";
|
|
2175
|
+
readonly label: "Media";
|
|
2176
|
+
}, {
|
|
2177
|
+
readonly id: "not-for-profit";
|
|
2178
|
+
readonly label: "Not For Profit";
|
|
2179
|
+
}, {
|
|
2180
|
+
readonly id: "recreation";
|
|
2181
|
+
readonly label: "Recreation";
|
|
2182
|
+
}, {
|
|
2183
|
+
readonly id: "retail";
|
|
2184
|
+
readonly label: "Retail";
|
|
2185
|
+
}, {
|
|
2186
|
+
readonly id: "shipping";
|
|
2187
|
+
readonly label: "Shipping";
|
|
2188
|
+
}, {
|
|
2189
|
+
readonly id: "technology";
|
|
2190
|
+
readonly label: "Technology";
|
|
2191
|
+
}, {
|
|
2192
|
+
readonly id: "telecommunications";
|
|
2193
|
+
readonly label: "Telecommunications";
|
|
2194
|
+
}, {
|
|
2195
|
+
readonly id: "transportation";
|
|
2196
|
+
readonly label: "Transportation";
|
|
2197
|
+
}, {
|
|
2198
|
+
readonly id: "utilities";
|
|
2199
|
+
readonly label: "Utilities";
|
|
2200
|
+
}, {
|
|
2201
|
+
readonly id: "other";
|
|
2202
|
+
readonly label: "Other";
|
|
2203
|
+
}];
|
|
2204
|
+
readonly targets: readonly [{
|
|
2205
|
+
readonly object: "company";
|
|
2206
|
+
readonly field: "industry";
|
|
2207
|
+
readonly keyField: "industryKey";
|
|
2208
|
+
}, {
|
|
2209
|
+
readonly object: "lead";
|
|
2210
|
+
readonly field: "industry";
|
|
2211
|
+
readonly keyField: "industryKey";
|
|
2212
|
+
}];
|
|
2213
|
+
}, {
|
|
2214
|
+
readonly id: "rating";
|
|
2215
|
+
readonly label: "Rating";
|
|
2216
|
+
readonly plural: "ratings";
|
|
2217
|
+
readonly object: "company";
|
|
2218
|
+
readonly restricted: true;
|
|
2219
|
+
readonly standardValues: readonly [{
|
|
2220
|
+
readonly id: "hot";
|
|
2221
|
+
readonly label: "Hot";
|
|
2222
|
+
}, {
|
|
2223
|
+
readonly id: "warm";
|
|
2224
|
+
readonly label: "Warm";
|
|
2225
|
+
}, {
|
|
2226
|
+
readonly id: "cold";
|
|
2227
|
+
readonly label: "Cold";
|
|
2228
|
+
}];
|
|
2229
|
+
readonly targets: readonly [{
|
|
2230
|
+
readonly object: "company";
|
|
2231
|
+
readonly field: "rating";
|
|
2232
|
+
readonly keyField: "ratingKey";
|
|
2233
|
+
}, {
|
|
2234
|
+
readonly object: "lead";
|
|
2235
|
+
readonly field: "rating";
|
|
2236
|
+
readonly keyField: "ratingKey";
|
|
2237
|
+
}];
|
|
2238
|
+
}, {
|
|
2239
|
+
readonly id: "ownership";
|
|
2240
|
+
readonly label: "Ownership";
|
|
2241
|
+
readonly plural: "ownership values";
|
|
2242
|
+
readonly object: "company";
|
|
2243
|
+
readonly restricted: true;
|
|
2244
|
+
readonly standardValues: readonly [{
|
|
2245
|
+
readonly id: "public";
|
|
2246
|
+
readonly label: "Public";
|
|
2247
|
+
}, {
|
|
2248
|
+
readonly id: "private";
|
|
2249
|
+
readonly label: "Private";
|
|
2250
|
+
}, {
|
|
2251
|
+
readonly id: "subsidiary";
|
|
2252
|
+
readonly label: "Subsidiary";
|
|
2253
|
+
}, {
|
|
2254
|
+
readonly id: "other";
|
|
2255
|
+
readonly label: "Other";
|
|
2256
|
+
}];
|
|
2257
|
+
readonly targets: readonly [{
|
|
2258
|
+
readonly object: "company";
|
|
2259
|
+
readonly field: "ownership";
|
|
2260
|
+
}];
|
|
2261
|
+
}, {
|
|
2262
|
+
readonly id: "salutation";
|
|
2263
|
+
readonly label: "Salutation";
|
|
2264
|
+
readonly plural: "salutations";
|
|
2265
|
+
readonly object: "contact";
|
|
2266
|
+
readonly restricted: true;
|
|
2267
|
+
readonly standardValues: readonly [{
|
|
2268
|
+
readonly id: "mr";
|
|
2269
|
+
readonly label: "Mr.";
|
|
2270
|
+
}, {
|
|
2271
|
+
readonly id: "ms";
|
|
2272
|
+
readonly label: "Ms.";
|
|
2273
|
+
}, {
|
|
2274
|
+
readonly id: "mrs";
|
|
2275
|
+
readonly label: "Mrs.";
|
|
2276
|
+
}, {
|
|
2277
|
+
readonly id: "dr";
|
|
2278
|
+
readonly label: "Dr.";
|
|
2279
|
+
}, {
|
|
2280
|
+
readonly id: "prof";
|
|
2281
|
+
readonly label: "Prof.";
|
|
2282
|
+
}];
|
|
2283
|
+
readonly targets: readonly [{
|
|
2284
|
+
readonly object: "contact";
|
|
2285
|
+
readonly field: "salutation";
|
|
2286
|
+
readonly facet: true;
|
|
2287
|
+
}, {
|
|
2288
|
+
readonly object: "lead";
|
|
2289
|
+
readonly field: "salutation";
|
|
2290
|
+
}];
|
|
2291
|
+
}, {
|
|
2292
|
+
readonly id: "opportunityType";
|
|
2293
|
+
readonly label: "Type";
|
|
2294
|
+
readonly plural: "deal types";
|
|
2295
|
+
readonly object: "deal";
|
|
2296
|
+
readonly restricted: true;
|
|
2297
|
+
readonly standardValues: readonly [{
|
|
2298
|
+
readonly id: "existing-business";
|
|
2299
|
+
readonly label: "Existing Business";
|
|
2300
|
+
}, {
|
|
2301
|
+
readonly id: "new-business";
|
|
2302
|
+
readonly label: "New Business";
|
|
2303
|
+
}];
|
|
2304
|
+
readonly targets: readonly [{
|
|
2305
|
+
readonly object: "deal";
|
|
2306
|
+
readonly field: "type";
|
|
2307
|
+
readonly keyField: "typeKey";
|
|
2308
|
+
}];
|
|
2309
|
+
}, {
|
|
2310
|
+
readonly id: "opportunityContactRole";
|
|
2311
|
+
readonly label: "Contact role";
|
|
2312
|
+
readonly plural: "contact roles";
|
|
2313
|
+
readonly object: "deal";
|
|
2314
|
+
readonly restricted: true;
|
|
2315
|
+
readonly standardValues: readonly [{
|
|
2316
|
+
readonly id: "business-user";
|
|
2317
|
+
readonly label: "Business User";
|
|
2318
|
+
}, {
|
|
2319
|
+
readonly id: "decision-maker";
|
|
2320
|
+
readonly label: "Decision Maker";
|
|
2321
|
+
}, {
|
|
2322
|
+
readonly id: "economic-buyer";
|
|
2323
|
+
readonly label: "Economic Buyer";
|
|
2324
|
+
}, {
|
|
2325
|
+
readonly id: "economic-decision-maker";
|
|
2326
|
+
readonly label: "Economic Decision Maker";
|
|
2327
|
+
}, {
|
|
2328
|
+
readonly id: "evaluator";
|
|
2329
|
+
readonly label: "Evaluator";
|
|
2330
|
+
}, {
|
|
2331
|
+
readonly id: "executive-sponsor";
|
|
2332
|
+
readonly label: "Executive Sponsor";
|
|
2333
|
+
}, {
|
|
2334
|
+
readonly id: "influencer";
|
|
2335
|
+
readonly label: "Influencer";
|
|
2336
|
+
}, {
|
|
2337
|
+
readonly id: "technical-buyer";
|
|
2338
|
+
readonly label: "Technical Buyer";
|
|
2339
|
+
}, {
|
|
2340
|
+
readonly id: "other";
|
|
2341
|
+
readonly label: "Other";
|
|
2342
|
+
}];
|
|
2343
|
+
readonly targets: readonly [{
|
|
2344
|
+
readonly object: "deal";
|
|
2345
|
+
readonly field: "contactRoles";
|
|
2346
|
+
readonly arrayKey: "role";
|
|
2347
|
+
readonly keyField: "contactRoleKeys";
|
|
2348
|
+
}];
|
|
2349
|
+
}, {
|
|
2350
|
+
readonly id: "taskStatus";
|
|
2351
|
+
readonly label: "Status";
|
|
2352
|
+
readonly plural: "task statuses";
|
|
2353
|
+
readonly object: "task";
|
|
2354
|
+
readonly restricted: true;
|
|
2355
|
+
readonly meanings: readonly ["open", "done"];
|
|
2356
|
+
readonly standardValues: readonly [{
|
|
2357
|
+
readonly id: "not-started";
|
|
2358
|
+
readonly label: "Not Started";
|
|
2359
|
+
readonly meaning: "open";
|
|
2360
|
+
}, {
|
|
2361
|
+
readonly id: "in-progress";
|
|
2362
|
+
readonly label: "In Progress";
|
|
2363
|
+
readonly meaning: "open";
|
|
2364
|
+
}, {
|
|
2365
|
+
readonly id: "waiting";
|
|
2366
|
+
readonly label: "Waiting on someone else";
|
|
2367
|
+
readonly meaning: "open";
|
|
2368
|
+
}, {
|
|
2369
|
+
readonly id: "deferred";
|
|
2370
|
+
readonly label: "Deferred";
|
|
2371
|
+
readonly meaning: "open";
|
|
2372
|
+
}, {
|
|
2373
|
+
readonly id: "completed";
|
|
2374
|
+
readonly label: "Completed";
|
|
2375
|
+
readonly meaning: "done";
|
|
2376
|
+
}];
|
|
2377
|
+
readonly defaultValueId: "not-started";
|
|
2378
|
+
readonly targets: readonly [{
|
|
2379
|
+
readonly object: "task";
|
|
2380
|
+
readonly field: "statusLabel";
|
|
2381
|
+
}];
|
|
2382
|
+
}, {
|
|
2383
|
+
readonly id: "taskPriority";
|
|
2384
|
+
readonly label: "Priority";
|
|
2385
|
+
readonly plural: "task priorities";
|
|
2386
|
+
readonly object: "task";
|
|
2387
|
+
readonly restricted: true;
|
|
2388
|
+
readonly meanings: readonly ["low", "normal", "high"];
|
|
2389
|
+
readonly standardValues: readonly [{
|
|
2390
|
+
readonly id: "high";
|
|
2391
|
+
readonly label: "High";
|
|
2392
|
+
readonly meaning: "high";
|
|
2393
|
+
}, {
|
|
2394
|
+
readonly id: "normal";
|
|
2395
|
+
readonly label: "Normal";
|
|
2396
|
+
readonly meaning: "normal";
|
|
2397
|
+
}, {
|
|
2398
|
+
readonly id: "low";
|
|
2399
|
+
readonly label: "Low";
|
|
2400
|
+
readonly meaning: "low";
|
|
2401
|
+
}];
|
|
2402
|
+
readonly defaultValueId: "normal";
|
|
2403
|
+
readonly targets: readonly [{
|
|
2404
|
+
readonly object: "task";
|
|
2405
|
+
readonly field: "priorityLabel";
|
|
2406
|
+
}];
|
|
2407
|
+
}, {
|
|
2408
|
+
readonly id: "taskType";
|
|
2409
|
+
readonly label: "Type";
|
|
2410
|
+
readonly plural: "task types";
|
|
2411
|
+
readonly object: "task";
|
|
2412
|
+
readonly restricted: true;
|
|
2413
|
+
readonly meanings: readonly ["call", "email", "meeting", "todo"];
|
|
2414
|
+
readonly standardValues: readonly [{
|
|
2415
|
+
readonly id: "call";
|
|
2416
|
+
readonly label: "Call";
|
|
2417
|
+
readonly meaning: "call";
|
|
2418
|
+
}, {
|
|
2419
|
+
readonly id: "email";
|
|
2420
|
+
readonly label: "Email";
|
|
2421
|
+
readonly meaning: "email";
|
|
2422
|
+
}, {
|
|
2423
|
+
readonly id: "meeting";
|
|
2424
|
+
readonly label: "Meeting";
|
|
2425
|
+
readonly meaning: "meeting";
|
|
2426
|
+
}, {
|
|
2427
|
+
readonly id: "todo";
|
|
2428
|
+
readonly label: "To-do";
|
|
2429
|
+
readonly meaning: "todo";
|
|
2430
|
+
}];
|
|
2431
|
+
readonly defaultValueId: "todo";
|
|
2432
|
+
readonly targets: readonly [{
|
|
2433
|
+
readonly object: "task";
|
|
2434
|
+
readonly field: "typeLabel";
|
|
2435
|
+
}];
|
|
2436
|
+
}, {
|
|
2437
|
+
readonly id: "taskSubject";
|
|
2438
|
+
readonly label: "Subject";
|
|
2439
|
+
readonly plural: "task subjects";
|
|
2440
|
+
readonly object: "task";
|
|
2441
|
+
readonly restricted: false;
|
|
2442
|
+
readonly standardValues: readonly [{
|
|
2443
|
+
readonly id: "call";
|
|
2444
|
+
readonly label: "Call";
|
|
2445
|
+
}, {
|
|
2446
|
+
readonly id: "send-letter";
|
|
2447
|
+
readonly label: "Send Letter";
|
|
2448
|
+
}, {
|
|
2449
|
+
readonly id: "send-quote";
|
|
2450
|
+
readonly label: "Send Quote";
|
|
2451
|
+
}, {
|
|
2452
|
+
readonly id: "other";
|
|
2453
|
+
readonly label: "Other";
|
|
2454
|
+
}];
|
|
2455
|
+
readonly targets: readonly [];
|
|
2456
|
+
}];
|
|
2457
|
+
export type CrmPicklistId = (typeof CRM_PICKLIST_DEFINITIONS)[number]['id'];
|
|
2458
|
+
/** The picklists an org keeps, by document id. */
|
|
2459
|
+
export declare const CRM_PICKLIST_IDS: readonly CrmPicklistId[];
|
|
1508
2460
|
/** The lead source value set's document id. */
|
|
1509
2461
|
export declare const CRM_LEAD_SOURCE_PICKLIST: CrmPicklistId;
|
|
2462
|
+
/** The salutation value set's document id (AGL-3515). */
|
|
2463
|
+
export declare const CRM_SALUTATION_PICKLIST: CrmPicklistId;
|
|
2464
|
+
/** A deal's Type value set's document id (AGL-3516). */
|
|
2465
|
+
export declare const CRM_OPPORTUNITY_TYPE_PICKLIST: CrmPicklistId;
|
|
2466
|
+
/** A deal contact's role value set's document id (AGL-3521). */
|
|
2467
|
+
export declare const CRM_OPPORTUNITY_CONTACT_ROLE_PICKLIST: CrmPicklistId;
|
|
2468
|
+
/**
|
|
2469
|
+
* The built-in Lead source value each first-party door stamps (AGL-3519), by
|
|
2470
|
+
* the door's word for how it met a person — a capture's source, or the
|
|
2471
|
+
* outreach that reached them. `api`, `import` and `manual` are ways a record
|
|
2472
|
+
* was ADDED, not where a person came from, and stamp nothing.
|
|
2473
|
+
*/
|
|
2474
|
+
export declare const CRM_LEAD_SOURCE_ORIGINS: Readonly<Record<string, string>>;
|
|
2475
|
+
export declare function isCrmPicklistId(value: unknown): value is CrmPicklistId;
|
|
2476
|
+
/** The definition an id names, or `null` for one the registry does not hold. */
|
|
2477
|
+
export declare function crmPicklistDefinition(id: unknown): CrmPicklistDefinition | null;
|
|
2478
|
+
/** The definitions whose values are managed on one Fields tab, in registry order. */
|
|
2479
|
+
export declare function crmPicklistDefinitionsFor(object: CrmPicklistObject): CrmPicklistDefinition[];
|
|
1510
2480
|
/** The most values one picklist holds — a menu, not a table. */
|
|
1511
2481
|
export declare const CRM_PICKLIST_VALUES_MAX = 200;
|
|
1512
2482
|
/** One value of a picklist. `id` never changes; `label` is what records store. */
|
|
1513
|
-
export
|
|
1514
|
-
id: string;
|
|
1515
|
-
label: string;
|
|
1516
|
-
active: boolean;
|
|
1517
|
-
}
|
|
2483
|
+
export type CrmPicklistValue = PicklistValue;
|
|
1518
2484
|
/** A picklist as stored and as every reader takes it. */
|
|
1519
|
-
export
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
/** The value a new record starts with, by id — `null` for none. */
|
|
1523
|
-
defaultValueId: string | null;
|
|
1524
|
-
}
|
|
2485
|
+
export type CrmPicklist = PicklistValueSet;
|
|
2486
|
+
/** One option of a picklist select. */
|
|
2487
|
+
export type CrmPicklistOption = PicklistOption;
|
|
1525
2488
|
/**
|
|
1526
|
-
* The values an org
|
|
1527
|
-
*
|
|
1528
|
-
*
|
|
2489
|
+
* The values an org without a lead source document offered before the
|
|
2490
|
+
* standard set was built in. "Referral" and "Partner" are not standard: a
|
|
2491
|
+
* record holding one, in an org that never stored its list, reads as not in
|
|
2492
|
+
* the list until the value is written down as the org's own.
|
|
1529
2493
|
*/
|
|
1530
2494
|
export declare const CRM_LEAD_SOURCE_STARTER_LABELS: readonly string[];
|
|
1531
2495
|
/** A label as a picklist stores it: trimmed, single-spaced, capped. */
|
|
1532
|
-
export declare
|
|
1533
|
-
/**
|
|
1534
|
-
|
|
1535
|
-
* `taken`. Derived rather than random so a seeded list reads the same in
|
|
1536
|
-
* every org, and never reused, because a default names a value by it.
|
|
1537
|
-
*/
|
|
1538
|
-
export declare function crmPicklistValueId(label: string, taken: Iterable<string>): string;
|
|
2496
|
+
export declare const normalizeCrmPicklistLabel: typeof normalizePicklistLabel;
|
|
2497
|
+
/** A new value's id — see `mintPicklistValueId`. */
|
|
2498
|
+
export declare const crmPicklistValueId: typeof mintPicklistValueId;
|
|
1539
2499
|
/** A picklist of active values from labels, in order, with no default. */
|
|
1540
|
-
export declare
|
|
2500
|
+
export declare const crmPicklistFromLabels: typeof picklistFromLabels;
|
|
1541
2501
|
/**
|
|
1542
|
-
* A stored document as a picklist, or `null` for one that holds none
|
|
1543
|
-
*
|
|
1544
|
-
*
|
|
1545
|
-
*
|
|
1546
|
-
* id is dropped, `active` is true unless it is `false`, and a default that
|
|
1547
|
-
* names no value is no default.
|
|
2502
|
+
* A stored document as a picklist, or `null` for one that holds none —
|
|
2503
|
+
* tolerant, as `normalizePicklistValueSet` reads it, and without the
|
|
2504
|
+
* standard values merged in. {@link effectiveCrmPicklist} is what a reader
|
|
2505
|
+
* judges against.
|
|
1548
2506
|
*/
|
|
1549
2507
|
export declare function normalizeCrmPicklist(raw: unknown): CrmPicklist | null;
|
|
1550
|
-
/**
|
|
2508
|
+
/** An org's list for one picklist as every reader should take it — see the block header. */
|
|
2509
|
+
export declare function effectiveCrmPicklist(id: CrmPicklistId, raw: unknown): CrmPicklist;
|
|
2510
|
+
/** The org's lead source list as every reader should take it. */
|
|
1551
2511
|
export declare function effectiveCrmLeadSourcePicklist(raw: unknown): CrmPicklist;
|
|
2512
|
+
/**
|
|
2513
|
+
* The label a door stamps for `origin` (AGL-3519): its built-in value as the
|
|
2514
|
+
* org spells it, while that value is ACTIVE — an org that deactivated it has
|
|
2515
|
+
* said not to file people under it — else `null`, as for a word with none.
|
|
2516
|
+
*/
|
|
2517
|
+
export declare function crmLeadSourceForOrigin(picklist: CrmPicklist, origin: unknown): string | null;
|
|
2518
|
+
/** Whether a value is one of a picklist's standard values — computed from its id, never stored. */
|
|
2519
|
+
export declare function isStandardCrmPicklistValue(id: CrmPicklistId, valueId: string): boolean;
|
|
1552
2520
|
/** The value a label names, in any case or spacing — `null` for none. */
|
|
1553
|
-
export declare
|
|
2521
|
+
export declare const crmPicklistValueByLabel: typeof picklistValueByLabel;
|
|
1554
2522
|
/** The values a picker offers. */
|
|
1555
|
-
export declare
|
|
2523
|
+
export declare const crmPicklistActiveValues: typeof picklistActiveValues;
|
|
1556
2524
|
/** The label a new record starts with — only while the default value is active. */
|
|
1557
|
-
export declare
|
|
2525
|
+
export declare const crmPicklistDefaultLabel: typeof picklistDefaultLabel;
|
|
1558
2526
|
/**
|
|
1559
|
-
* The sentence a
|
|
1560
|
-
* the list allows
|
|
1561
|
-
* one a person can read.
|
|
2527
|
+
* The sentence a value outside a restricted picklist is refused with,
|
|
2528
|
+
* naming what the list allows, and where to add one when it allows none.
|
|
1562
2529
|
*/
|
|
2530
|
+
export declare function crmPicklistRefusal(id: CrmPicklistId, picklist: CrmPicklist): string;
|
|
2531
|
+
/** The sentence a lead source outside the list is refused with. */
|
|
1563
2532
|
export declare function crmLeadSourceRefusal(picklist: CrmPicklist): string;
|
|
1564
2533
|
/**
|
|
1565
|
-
* Whether a write may store `value` as a record's
|
|
1566
|
-
* label it stores
|
|
1567
|
-
*
|
|
1568
|
-
*
|
|
1569
|
-
*
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
*
|
|
2534
|
+
* Whether a write may store `value` as a record's value of picklist `id`,
|
|
2535
|
+
* and the label it stores — `judgePicklistValue` under the definition's
|
|
2536
|
+
* restriction: blank clears, an active value stores the list's spelling,
|
|
2537
|
+
* the record's `current` value is always kept, and on a restricted
|
|
2538
|
+
* picklist anything else is refused with {@link crmPicklistRefusal}.
|
|
2539
|
+
*/
|
|
2540
|
+
export declare function judgeCrmPicklistValue(id: CrmPicklistId, picklist: CrmPicklist, value: unknown, current?: unknown): PicklistJudgement;
|
|
2541
|
+
/**
|
|
2542
|
+
* A deal's contact roles with each role judged against the org's
|
|
2543
|
+
* `opportunityContactRole` list (AGL-3521): an active value stored as the
|
|
2544
|
+
* list spells it, a blank cleared, and the role a contact already holds on
|
|
2545
|
+
* the deal (`current`) kept — or the first refusal, naming what the list
|
|
2546
|
+
* allows.
|
|
1574
2547
|
*/
|
|
1575
|
-
export declare function
|
|
2548
|
+
export declare function judgeDealContactRoles(picklist: CrmPicklist, roles: readonly CrmDealContactRole[], current?: readonly CrmDealContactRole[]): {
|
|
1576
2549
|
ok: true;
|
|
1577
|
-
|
|
2550
|
+
roles: CrmDealContactRole[];
|
|
1578
2551
|
} | {
|
|
1579
2552
|
ok: false;
|
|
1580
2553
|
error: string;
|
|
1581
2554
|
};
|
|
1582
|
-
/**
|
|
1583
|
-
export
|
|
1584
|
-
label: string;
|
|
1585
|
-
/** Listed but deactivated — shown with an "(inactive)" hint. */
|
|
1586
|
-
inactive: boolean;
|
|
1587
|
-
/** Not in the list at all — a value written before the list existed. */
|
|
1588
|
-
unlisted: boolean;
|
|
1589
|
-
}
|
|
2555
|
+
/** {@link judgeCrmPicklistValue} for the lead source. */
|
|
2556
|
+
export declare function judgeCrmLeadSource(picklist: CrmPicklist, value: unknown, current?: unknown): PicklistJudgement;
|
|
1590
2557
|
/**
|
|
1591
2558
|
* What a select offers for a record holding `current`: every active value
|
|
1592
2559
|
* in order, then the record's own value when the list would not otherwise
|
|
1593
2560
|
* show it, so the select keeps what the record holds until it is changed.
|
|
1594
2561
|
*/
|
|
1595
|
-
export declare
|
|
2562
|
+
export declare const crmPicklistOptions: typeof picklistOptions;
|
|
1596
2563
|
/**
|
|
1597
2564
|
* Where a label sorts: its value's position in the list, unlisted values
|
|
1598
2565
|
* after every listed one, and a record with none last. The order the admin
|
|
1599
2566
|
* chose is the order a sort by the field reads in, as Salesforce's does.
|
|
1600
2567
|
*/
|
|
1601
|
-
export declare
|
|
2568
|
+
export declare const crmPicklistRank: typeof picklistRank;
|
|
2569
|
+
/** The lead status value set's document id. */
|
|
2570
|
+
export declare const CRM_LEAD_STATUS_PICKLIST: CrmPicklistId;
|
|
2571
|
+
/** The field a lead's status label is stored in, beside `status`. */
|
|
2572
|
+
export declare const CRM_LEAD_STATUS_LABEL_FIELD = "statusLabel";
|
|
2573
|
+
/** The org's lead status list as every reader should take it. */
|
|
2574
|
+
export declare function effectiveCrmLeadStatusPicklist(raw: unknown): CrmPicklist;
|
|
2575
|
+
/** The standard lead statuses alone — what a reader answers before the org's list is read. */
|
|
2576
|
+
export declare const STANDARD_CRM_LEAD_STATUS_PICKLIST: CrmPicklist;
|
|
2577
|
+
/**
|
|
2578
|
+
* The value a lead with `status` shows when it names none of its own: the
|
|
2579
|
+
* default when active and of that meaning, else the first active value of
|
|
2580
|
+
* that meaning, else the first of that meaning at all.
|
|
2581
|
+
*/
|
|
2582
|
+
export declare function crmLeadStatusValueFor(picklist: CrmPicklist, status: CrmLeadStatus): CrmPicklistValue | null;
|
|
2583
|
+
/** The label a writer stamps beside `status` when it sets a meaning and names no value. */
|
|
2584
|
+
export declare function crmLeadStatusLabelFor(picklist: CrmPicklist, status: CrmLeadStatus): string;
|
|
2585
|
+
/**
|
|
2586
|
+
* How a lead's status reads: its own `statusLabel` while that is a value of
|
|
2587
|
+
* its `status`'s meaning (as the list spells it), else the meaning's label
|
|
2588
|
+
* by {@link crmLeadStatusLabelFor}. A label the list no longer holds is shown
|
|
2589
|
+
* as stored while nothing contradicts it — a value deleted without moving
|
|
2590
|
+
* every lead off it reads as what the lead was given.
|
|
2591
|
+
*/
|
|
2592
|
+
export declare function crmLeadStatusLabel(lead: Pick<CrmLeadFields, 'status' | 'statusLabel'> | null | undefined, picklist?: CrmPicklist): string;
|
|
2593
|
+
/** A status write, as both fields a lead stores — or why it is refused. */
|
|
2594
|
+
export type CrmLeadStatusWrite = {
|
|
2595
|
+
ok: true;
|
|
2596
|
+
status: CrmLeadStatus;
|
|
2597
|
+
statusLabel: string;
|
|
2598
|
+
} | {
|
|
2599
|
+
ok: false;
|
|
2600
|
+
error: string;
|
|
2601
|
+
};
|
|
2602
|
+
/**
|
|
2603
|
+
* What a write naming a lead status stores (AGL-3512): an ACTIVE value's
|
|
2604
|
+
* label, in any case or spacing, stores its meaning and its label; one of
|
|
2605
|
+
* the meanings themselves (`working`) stores that meaning and the label
|
|
2606
|
+
* {@link crmLeadStatusLabelFor} gives it; the lead's `current` label is
|
|
2607
|
+
* kept even when inactive. `allowed` narrows the meanings this door may
|
|
2608
|
+
* set — every door but a conversion leaves Qualified out — and anything
|
|
2609
|
+
* else is refused naming what the door accepts.
|
|
2610
|
+
*/
|
|
2611
|
+
export declare function resolveCrmLeadStatusWrite(picklist: CrmPicklist, requested: unknown, options?: {
|
|
2612
|
+
allowed?: readonly CrmLeadStatus[];
|
|
2613
|
+
current?: Pick<CrmLeadFields, 'status' | 'statusLabel'> | null;
|
|
2614
|
+
}): CrmLeadStatusWrite;
|
|
2615
|
+
/**
|
|
2616
|
+
* The values a lead status select offers for a lead holding `current`:
|
|
2617
|
+
* every active value whose meaning `allowed` admits, in the list's order,
|
|
2618
|
+
* then the lead's own value when the list would not otherwise show it.
|
|
2619
|
+
*/
|
|
2620
|
+
export declare function crmLeadStatusOptions(picklist: CrmPicklist, allowed?: readonly CrmLeadStatus[], current?: Pick<CrmLeadFields, 'status' | 'statusLabel'> | null): Array<{
|
|
2621
|
+
label: string;
|
|
2622
|
+
status: CrmLeadStatus;
|
|
2623
|
+
inactive: boolean;
|
|
2624
|
+
}>;
|
|
2625
|
+
/** The label a value of `meaning` reads as: the first active one, else the first at all. */
|
|
2626
|
+
export declare function crmPicklistMeaningLabel(picklist: CrmPicklist, meaning: unknown): string | null;
|
|
2627
|
+
/**
|
|
2628
|
+
* What a record shows for a semantic field: its own label when it holds
|
|
2629
|
+
* one, else the first active value of its meaning, else the meaning itself.
|
|
2630
|
+
*/
|
|
2631
|
+
export declare function crmPicklistShownLabel(picklist: CrmPicklist, meaning: unknown, label: unknown): string;
|
|
2632
|
+
/**
|
|
2633
|
+
* The label a NEW record of `meaning` starts with: the list's default when
|
|
2634
|
+
* it means that, else the first active value that does.
|
|
2635
|
+
*/
|
|
2636
|
+
export declare function crmPicklistLabelForNew(picklist: CrmPicklist, meaning: unknown): string | null;
|
|
2637
|
+
/** What a semantic write stores: the meaning and the label beside it. */
|
|
2638
|
+
export type CrmSemanticPicklistWrite = {
|
|
2639
|
+
ok: true;
|
|
2640
|
+
meaning: string;
|
|
2641
|
+
label: string | null;
|
|
2642
|
+
} | {
|
|
2643
|
+
ok: false;
|
|
2644
|
+
error: string;
|
|
2645
|
+
};
|
|
2646
|
+
/**
|
|
2647
|
+
* A label OR a meaning, as a write names it, resolved against picklist `id`:
|
|
2648
|
+
*
|
|
2649
|
+
* - an active value's label (any case or spacing) stores that value's
|
|
2650
|
+
* label and its meaning;
|
|
2651
|
+
* - the record's `current` label is kept, with its value's meaning, even
|
|
2652
|
+
* when the value has since been deactivated;
|
|
2653
|
+
* - one of the definition's meanings (`high`, `done`, `call`) stores that
|
|
2654
|
+
* meaning with the first active value's label — or the record's current
|
|
2655
|
+
* label when that already means it;
|
|
2656
|
+
* - anything else is refused naming the values the list allows.
|
|
2657
|
+
*
|
|
2658
|
+
* `null` answers a blank input: the caller keeps its own default.
|
|
2659
|
+
*/
|
|
2660
|
+
export declare function resolveCrmSemanticPicklistWrite(id: CrmPicklistId, picklist: CrmPicklist, input: unknown, current?: unknown): CrmSemanticPicklistWrite | null;
|
|
2661
|
+
/** A task's three semantic picklists, as every task surface reads them. */
|
|
2662
|
+
export interface CrmTaskPicklists {
|
|
2663
|
+
status: CrmPicklist;
|
|
2664
|
+
priority: CrmPicklist;
|
|
2665
|
+
type: CrmPicklist;
|
|
2666
|
+
}
|
|
2667
|
+
/** The picklist id behind each of a task's semantic fields. */
|
|
2668
|
+
export declare const CRM_TASK_PICKLIST_IDS: {
|
|
2669
|
+
readonly status: "taskStatus";
|
|
2670
|
+
readonly priority: "taskPriority";
|
|
2671
|
+
readonly type: "taskType";
|
|
2672
|
+
};
|
|
2673
|
+
/** The org's three task lists from their stored documents — standard values alone for none. */
|
|
2674
|
+
export declare function effectiveCrmTaskPicklists(raw?: Partial<Record<keyof CrmTaskPicklists, unknown>>): CrmTaskPicklists;
|
|
2675
|
+
/** What a task shows for its status, priority and type — see `crmPicklistShownLabel`. */
|
|
2676
|
+
export declare function crmTaskPicklistLabels(task: Partial<Pick<CrmTask, 'status' | 'statusLabel' | 'priority' | 'priorityLabel' | 'kind' | 'typeLabel'>>, picklists: CrmTaskPicklists): {
|
|
2677
|
+
status: string;
|
|
2678
|
+
priority: string;
|
|
2679
|
+
type: string;
|
|
2680
|
+
};
|
|
2681
|
+
/**
|
|
2682
|
+
* The status a tick or an untick writes: done with the first active done
|
|
2683
|
+
* value's label ("Completed"), or open with the label a new task starts
|
|
2684
|
+
* with ("Not Started").
|
|
2685
|
+
*/
|
|
2686
|
+
export declare function crmTaskStatusWrite(picklist: CrmPicklist, done: boolean): {
|
|
2687
|
+
status: CrmTaskStatus;
|
|
2688
|
+
statusLabel: string | null;
|
|
2689
|
+
};
|
|
2690
|
+
/** The labels a new task of these meanings starts with. */
|
|
2691
|
+
export declare function crmTaskLabelsForNew(picklists: CrmTaskPicklists, meanings: Pick<CrmTask, 'kind' | 'priority'> & {
|
|
2692
|
+
status?: CrmTaskStatus;
|
|
2693
|
+
}): {
|
|
2694
|
+
statusLabel: string | null;
|
|
2695
|
+
priorityLabel: string | null;
|
|
2696
|
+
typeLabel: string | null;
|
|
2697
|
+
};
|
|
1602
2698
|
/** The name a lead is listed under: the name it carries, else its address. */
|
|
1603
2699
|
export declare function crmLeadDisplayName(lead: Record<string, unknown> | null | undefined): string;
|
|
1604
2700
|
/**
|
|
@@ -1846,6 +2942,11 @@ export declare function crmSearchFields(visibleTo: unknown, values: readonly unk
|
|
|
1846
2942
|
export declare const CRM_EMAIL_STATUS_FIELD = "emailStatus";
|
|
1847
2943
|
export declare const CRM_EMAIL_STATUS_NONE = "none";
|
|
1848
2944
|
export declare function crmEmailStatusKey(record: Record<string, unknown> | null | undefined): string;
|
|
2945
|
+
/**
|
|
2946
|
+
* A picklist label as a list query compares it — the key a target's
|
|
2947
|
+
* `keyField` holds beside the label — `null` for none.
|
|
2948
|
+
*/
|
|
2949
|
+
export declare function crmPicklistKey(value: unknown): string | null;
|
|
1849
2950
|
/** A lead's lead source as the list compares it: the picklist's key, `null` for none. */
|
|
1850
2951
|
export declare const CRM_LEAD_SOURCE_KEY_FIELD = "leadSourceKey";
|
|
1851
2952
|
export declare function crmLeadSourceKey(value: unknown): string | null;
|
|
@@ -1872,22 +2973,53 @@ export declare function crmLeadListFields(record: object): {
|
|
|
1872
2973
|
status: CrmLeadStatus;
|
|
1873
2974
|
leadSourceKey: string | null;
|
|
1874
2975
|
emailStatus: string;
|
|
2976
|
+
industryKey: string | null;
|
|
2977
|
+
ratingKey: string | null;
|
|
1875
2978
|
};
|
|
1876
2979
|
/** What a company's search box reads: its name and its domain. */
|
|
1877
2980
|
export declare const CRM_COMPANY_SEARCH_SOURCES: readonly ["name", "domain"];
|
|
2981
|
+
/**
|
|
2982
|
+
* Every field the Companies list queries by: the search tokens, and the
|
|
2983
|
+
* key of each picklist field that names one (AGL-3514) — `null` for none,
|
|
2984
|
+
* so "no value" is a value a query can ask for.
|
|
2985
|
+
*/
|
|
1878
2986
|
export declare function crmCompanyListFields(record: object): {
|
|
1879
2987
|
searchTokens: string[];
|
|
1880
2988
|
scopedSearchTokens: string[];
|
|
2989
|
+
typeKey: string | null;
|
|
2990
|
+
industryKey: string | null;
|
|
2991
|
+
ratingKey: string | null;
|
|
2992
|
+
accountSourceKey: string | null;
|
|
1881
2993
|
};
|
|
1882
2994
|
/**
|
|
1883
2995
|
* What a deal's search box reads: its title (AGL-3315) — as word prefixes,
|
|
1884
2996
|
* and as `titleLower`, the whole title's key, which a reader whose access
|
|
1885
|
-
* is some sites searches by its start.
|
|
2997
|
+
* is some sites searches by its start. And the keys the Deals list filters
|
|
2998
|
+
* its Type and Lead source by (AGL-3516): each label as the picklist
|
|
2999
|
+
* compares it, `null` for none.
|
|
1886
3000
|
*/
|
|
1887
3001
|
export declare function crmDealListFields(record: object): {
|
|
1888
3002
|
searchTokens: string[];
|
|
1889
3003
|
scopedSearchTokens: string[];
|
|
1890
3004
|
titleLower: string;
|
|
3005
|
+
typeKey: string | null;
|
|
3006
|
+
leadSourceKey: string | null;
|
|
3007
|
+
contactRoleContactIds: string[];
|
|
3008
|
+
scopedContactRoleContactIds: string[];
|
|
3009
|
+
contactRoleKeys: string[];
|
|
3010
|
+
};
|
|
3011
|
+
/**
|
|
3012
|
+
* The arrays a deal's contact roles are found by (AGL-3521): every contact
|
|
3013
|
+
* on it — `contactRoleContactIds`, which a contact's page asks
|
|
3014
|
+
* `array-contains` at the organization level, and the same ids behind each
|
|
3015
|
+
* scope token (`scopedContactRoleContactIds`, `host:x~contactId`), which it
|
|
3016
|
+
* asks under a site in the one array clause a query has — and the keys of
|
|
3017
|
+
* the roles they hold, which a rename of a role finds the deals by.
|
|
3018
|
+
*/
|
|
3019
|
+
export declare function crmDealContactRoleListFields(deal: Record<string, unknown>): {
|
|
3020
|
+
contactRoleContactIds: string[];
|
|
3021
|
+
scopedContactRoleContactIds: string[];
|
|
3022
|
+
contactRoleKeys: string[];
|
|
1891
3023
|
};
|
|
1892
3024
|
/** What a task's search box reads: its title. */
|
|
1893
3025
|
export declare function crmTaskListFields(record: object): {
|
|
@@ -1900,7 +3032,7 @@ export declare const CRM_FACET_KEY_ANY_GROUP = "*";
|
|
|
1900
3032
|
/** The most facet keys one contact keeps. */
|
|
1901
3033
|
export declare const CRM_FACET_KEYS_MAX = 600;
|
|
1902
3034
|
/** The facet fields a contact list filters by, as their keys name them. */
|
|
1903
|
-
export type CrmFacetKeyField = 'owner' | 'stage' | 'source' | 'company' | 'tag' | 'orders' | 'ltv' | `custom.${string}
|
|
3035
|
+
export type CrmFacetKeyField = 'owner' | 'stage' | 'source' | 'company' | 'tag' | 'orders' | 'ltv' | `custom.${string}` | 'leadSource';
|
|
1904
3036
|
/** A facet value as its key spells it, or `null` for a value a key cannot hold. */
|
|
1905
3037
|
export declare function crmFacetKeyValue(value: unknown): string | null;
|
|
1906
3038
|
/** One facet key: `{group}:{field}` for presence, `{group}:{field}={value}` for a value. */
|