@aglyn/aglyn 1.0.0-beta.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +11 -0
- package/package.json +66 -0
- package/src/index.d.ts +25 -0
- package/src/index.js +26 -0
- package/src/index.js.map +1 -0
- package/src/lib/aglyn.d.ts +31 -0
- package/src/lib/aglyn.js +114 -0
- package/src/lib/aglyn.js.map +1 -0
- package/src/lib/app-utils/abuse-report.d.ts +193 -0
- package/src/lib/app-utils/abuse-report.js +321 -0
- package/src/lib/app-utils/abuse-report.js.map +1 -0
- package/src/lib/app-utils/accept-negotiation.d.ts +129 -0
- package/src/lib/app-utils/accept-negotiation.js +266 -0
- package/src/lib/app-utils/accept-negotiation.js.map +1 -0
- package/src/lib/app-utils/account-emails.d.ts +263 -0
- package/src/lib/app-utils/account-emails.js +264 -0
- package/src/lib/app-utils/account-emails.js.map +1 -0
- package/src/lib/app-utils/actions.d.ts +717 -0
- package/src/lib/app-utils/actions.js +1031 -0
- package/src/lib/app-utils/actions.js.map +1 -0
- package/src/lib/app-utils/activity-presenter.d.ts +152 -0
- package/src/lib/app-utils/activity-presenter.js +326 -0
- package/src/lib/app-utils/activity-presenter.js.map +1 -0
- package/src/lib/app-utils/advertising-tag-mounts.d.ts +133 -0
- package/src/lib/app-utils/advertising-tag-mounts.js +118 -0
- package/src/lib/app-utils/advertising-tag-mounts.js.map +1 -0
- package/src/lib/app-utils/advertising-tags.d.ts +307 -0
- package/src/lib/app-utils/advertising-tags.js +525 -0
- package/src/lib/app-utils/advertising-tags.js.map +1 -0
- package/src/lib/app-utils/agent-api-catalog.d.ts +94 -0
- package/src/lib/app-utils/agent-api-catalog.js +106 -0
- package/src/lib/app-utils/agent-api-catalog.js.map +1 -0
- package/src/lib/app-utils/agent-openapi.d.ts +103 -0
- package/src/lib/app-utils/agent-openapi.js +1128 -0
- package/src/lib/app-utils/agent-openapi.js.map +1 -0
- package/src/lib/app-utils/analytics-beacon.d.ts +154 -0
- package/src/lib/app-utils/analytics-beacon.js +152 -0
- package/src/lib/app-utils/analytics-beacon.js.map +1 -0
- package/src/lib/app-utils/analytics-environment.d.ts +133 -0
- package/src/lib/app-utils/analytics-environment.js +152 -0
- package/src/lib/app-utils/analytics-environment.js.map +1 -0
- package/src/lib/app-utils/analytics-events.d.ts +744 -0
- package/src/lib/app-utils/analytics-events.js +650 -0
- package/src/lib/app-utils/analytics-events.js.map +1 -0
- package/src/lib/app-utils/analytics-link-clicks.d.ts +102 -0
- package/src/lib/app-utils/analytics-link-clicks.js +267 -0
- package/src/lib/app-utils/analytics-link-clicks.js.map +1 -0
- package/src/lib/app-utils/analytics-path-key.d.ts +46 -0
- package/src/lib/app-utils/analytics-path-key.js +46 -0
- package/src/lib/app-utils/analytics-path-key.js.map +1 -0
- package/src/lib/app-utils/api-adapter.d.ts +47 -0
- package/src/lib/app-utils/api-adapter.js +367 -0
- package/src/lib/app-utils/api-adapter.js.map +1 -0
- package/src/lib/app-utils/api-idempotency.d.ts +169 -0
- package/src/lib/app-utils/api-idempotency.js +213 -0
- package/src/lib/app-utils/api-idempotency.js.map +1 -0
- package/src/lib/app-utils/api-plugins.d.ts +210 -0
- package/src/lib/app-utils/api-plugins.js +221 -0
- package/src/lib/app-utils/api-plugins.js.map +1 -0
- package/src/lib/app-utils/assist-credits.d.ts +482 -0
- package/src/lib/app-utils/assist-credits.js +509 -0
- package/src/lib/app-utils/assist-credits.js.map +1 -0
- package/src/lib/app-utils/attribution-attribute.d.ts +34 -0
- package/src/lib/app-utils/attribution-attribute.js +34 -0
- package/src/lib/app-utils/attribution-attribute.js.map +1 -0
- package/src/lib/app-utils/attribution-guard.d.ts +130 -0
- package/src/lib/app-utils/attribution-guard.js +410 -0
- package/src/lib/app-utils/attribution-guard.js.map +1 -0
- package/src/lib/app-utils/author-css.d.ts +123 -0
- package/src/lib/app-utils/author-css.js +275 -0
- package/src/lib/app-utils/author-css.js.map +1 -0
- package/src/lib/app-utils/author-html-markdown.d.ts +31 -0
- package/src/lib/app-utils/author-html-markdown.js +497 -0
- package/src/lib/app-utils/author-html-markdown.js.map +1 -0
- package/src/lib/app-utils/author-html.d.ts +135 -0
- package/src/lib/app-utils/author-html.js +1037 -0
- package/src/lib/app-utils/author-html.js.map +1 -0
- package/src/lib/app-utils/automation-placeholders.d.ts +72 -0
- package/src/lib/app-utils/automation-placeholders.js +207 -0
- package/src/lib/app-utils/automation-placeholders.js.map +1 -0
- package/src/lib/app-utils/bandwidth-cap.d.ts +183 -0
- package/src/lib/app-utils/bandwidth-cap.js +193 -0
- package/src/lib/app-utils/bandwidth-cap.js.map +1 -0
- package/src/lib/app-utils/binding-token-catalog.d.ts +82 -0
- package/src/lib/app-utils/binding-token-catalog.js +293 -0
- package/src/lib/app-utils/binding-token-catalog.js.map +1 -0
- package/src/lib/app-utils/binding-tokens.d.ts +157 -0
- package/src/lib/app-utils/binding-tokens.js +251 -0
- package/src/lib/app-utils/binding-tokens.js.map +1 -0
- package/src/lib/app-utils/breadcrumb-json-ld.d.ts +57 -0
- package/src/lib/app-utils/breadcrumb-json-ld.js +67 -0
- package/src/lib/app-utils/breadcrumb-json-ld.js.map +1 -0
- package/src/lib/app-utils/campaign-attribution.d.ts +117 -0
- package/src/lib/app-utils/campaign-attribution.js +162 -0
- package/src/lib/app-utils/campaign-attribution.js.map +1 -0
- package/src/lib/app-utils/campaign-forwarding.d.ts +220 -0
- package/src/lib/app-utils/campaign-forwarding.js +332 -0
- package/src/lib/app-utils/campaign-forwarding.js.map +1 -0
- package/src/lib/app-utils/campaign-membership.d.ts +109 -0
- package/src/lib/app-utils/campaign-membership.js +176 -0
- package/src/lib/app-utils/campaign-membership.js.map +1 -0
- package/src/lib/app-utils/campaign-touch.d.ts +206 -0
- package/src/lib/app-utils/campaign-touch.js +326 -0
- package/src/lib/app-utils/campaign-touch.js.map +1 -0
- package/src/lib/app-utils/child-contract-compose.d.ts +28 -0
- package/src/lib/app-utils/child-contract-compose.js +140 -0
- package/src/lib/app-utils/child-contract-compose.js.map +1 -0
- package/src/lib/app-utils/child-contract.d.ts +129 -0
- package/src/lib/app-utils/child-contract.js +153 -0
- package/src/lib/app-utils/child-contract.js.map +1 -0
- package/src/lib/app-utils/collection-delete.d.ts +113 -0
- package/src/lib/app-utils/collection-delete.js +120 -0
- package/src/lib/app-utils/collection-delete.js.map +1 -0
- package/src/lib/app-utils/collection-entries.d.ts +833 -0
- package/src/lib/app-utils/collection-entries.js +1285 -0
- package/src/lib/app-utils/collection-entries.js.map +1 -0
- package/src/lib/app-utils/collection-entry-date.d.ts +129 -0
- package/src/lib/app-utils/collection-entry-date.js +183 -0
- package/src/lib/app-utils/collection-entry-date.js.map +1 -0
- package/src/lib/app-utils/collection-kind.d.ts +55 -0
- package/src/lib/app-utils/collection-kind.js +69 -0
- package/src/lib/app-utils/collection-kind.js.map +1 -0
- package/src/lib/app-utils/collection-slug.d.ts +79 -0
- package/src/lib/app-utils/collection-slug.js +70 -0
- package/src/lib/app-utils/collection-slug.js.map +1 -0
- package/src/lib/app-utils/compose-layout-nodes.d.ts +147 -0
- package/src/lib/app-utils/compose-layout-nodes.js +261 -0
- package/src/lib/app-utils/compose-layout-nodes.js.map +1 -0
- package/src/lib/app-utils/compose-layout-props.d.ts +71 -0
- package/src/lib/app-utils/compose-layout-props.js +61 -0
- package/src/lib/app-utils/compose-layout-props.js.map +1 -0
- package/src/lib/app-utils/compose-reusable-components.d.ts +504 -0
- package/src/lib/app-utils/compose-reusable-components.js +1366 -0
- package/src/lib/app-utils/compose-reusable-components.js.map +1 -0
- package/src/lib/app-utils/compress.d.ts +35 -0
- package/src/lib/app-utils/compress.js +38 -0
- package/src/lib/app-utils/compress.js.map +1 -0
- package/src/lib/app-utils/consent-banner-ui.d.ts +226 -0
- package/src/lib/app-utils/consent-banner-ui.js +583 -0
- package/src/lib/app-utils/consent-banner-ui.js.map +1 -0
- package/src/lib/app-utils/consent-groups.d.ts +189 -0
- package/src/lib/app-utils/consent-groups.js +219 -0
- package/src/lib/app-utils/consent-groups.js.map +1 -0
- package/src/lib/app-utils/consent-preferences-dialog.d.ts +58 -0
- package/src/lib/app-utils/consent-preferences-dialog.js +106 -0
- package/src/lib/app-utils/consent-preferences-dialog.js.map +1 -0
- package/src/lib/app-utils/console-record-links.d.ts +163 -0
- package/src/lib/app-utils/console-record-links.js +178 -0
- package/src/lib/app-utils/console-record-links.js.map +1 -0
- package/src/lib/app-utils/console-routes.d.ts +658 -0
- package/src/lib/app-utils/console-routes.js +489 -0
- package/src/lib/app-utils/console-routes.js.map +1 -0
- package/src/lib/app-utils/console-widget-slot-context.d.ts +46 -0
- package/src/lib/app-utils/console-widget-slot-context.js +23 -0
- package/src/lib/app-utils/console-widget-slot-context.js.map +1 -0
- package/src/lib/app-utils/contact-custom-fields.d.ts +191 -0
- package/src/lib/app-utils/contact-custom-fields.js +349 -0
- package/src/lib/app-utils/contact-custom-fields.js.map +1 -0
- package/src/lib/app-utils/contact-holder.d.ts +52 -0
- package/src/lib/app-utils/contact-holder.js +98 -0
- package/src/lib/app-utils/contact-holder.js.map +1 -0
- package/src/lib/app-utils/contact-merge.d.ts +136 -0
- package/src/lib/app-utils/contact-merge.js +379 -0
- package/src/lib/app-utils/contact-merge.js.map +1 -0
- package/src/lib/app-utils/contacts.d.ts +554 -0
- package/src/lib/app-utils/contacts.js +401 -0
- package/src/lib/app-utils/contacts.js.map +1 -0
- package/src/lib/app-utils/content-author-profile.d.ts +68 -0
- package/src/lib/app-utils/content-author-profile.js +118 -0
- package/src/lib/app-utils/content-author-profile.js.map +1 -0
- package/src/lib/app-utils/content-authors.d.ts +662 -0
- package/src/lib/app-utils/content-authors.js +771 -0
- package/src/lib/app-utils/content-authors.js.map +1 -0
- package/src/lib/app-utils/content-schema-type.d.ts +81 -0
- package/src/lib/app-utils/content-schema-type.js +87 -0
- package/src/lib/app-utils/content-schema-type.js.map +1 -0
- package/src/lib/app-utils/contexts.d.ts +35 -0
- package/src/lib/app-utils/contexts.js +35 -0
- package/src/lib/app-utils/contexts.js.map +1 -0
- package/src/lib/app-utils/create-resource-uid.d.ts +18 -0
- package/src/lib/app-utils/create-resource-uid.js +23 -0
- package/src/lib/app-utils/create-resource-uid.js.map +1 -0
- package/src/lib/app-utils/crm-booking.d.ts +75 -0
- package/src/lib/app-utils/crm-booking.js +133 -0
- package/src/lib/app-utils/crm-booking.js.map +1 -0
- package/src/lib/app-utils/crm-csv.d.ts +232 -0
- package/src/lib/app-utils/crm-csv.js +432 -0
- package/src/lib/app-utils/crm-csv.js.map +1 -0
- package/src/lib/app-utils/crm-digest.d.ts +179 -0
- package/src/lib/app-utils/crm-digest.js +271 -0
- package/src/lib/app-utils/crm-digest.js.map +1 -0
- package/src/lib/app-utils/crm-email-templates.d.ts +172 -0
- package/src/lib/app-utils/crm-email-templates.js +382 -0
- package/src/lib/app-utils/crm-email-templates.js.map +1 -0
- package/src/lib/app-utils/crm-inbound.d.ts +245 -0
- package/src/lib/app-utils/crm-inbound.js +407 -0
- package/src/lib/app-utils/crm-inbound.js.map +1 -0
- package/src/lib/app-utils/crm-kinds.d.ts +73 -0
- package/src/lib/app-utils/crm-kinds.js +92 -0
- package/src/lib/app-utils/crm-kinds.js.map +1 -0
- package/src/lib/app-utils/crm-next-activity.d.ts +107 -0
- package/src/lib/app-utils/crm-next-activity.js +140 -0
- package/src/lib/app-utils/crm-next-activity.js.map +1 -0
- package/src/lib/app-utils/crm-reports.d.ts +479 -0
- package/src/lib/app-utils/crm-reports.js +680 -0
- package/src/lib/app-utils/crm-reports.js.map +1 -0
- package/src/lib/app-utils/crm-task-reminders.d.ts +129 -0
- package/src/lib/app-utils/crm-task-reminders.js +139 -0
- package/src/lib/app-utils/crm-task-reminders.js.map +1 -0
- package/src/lib/app-utils/crm.d.ts +1546 -0
- package/src/lib/app-utils/crm.js +1814 -0
- package/src/lib/app-utils/crm.js.map +1 -0
- package/src/lib/app-utils/csp-report.d.ts +84 -0
- package/src/lib/app-utils/csp-report.js +177 -0
- package/src/lib/app-utils/csp-report.js.map +1 -0
- package/src/lib/app-utils/csv-import.d.ts +192 -0
- package/src/lib/app-utils/csv-import.js +279 -0
- package/src/lib/app-utils/csv-import.js.map +1 -0
- package/src/lib/app-utils/dataset-csv.d.ts +109 -0
- package/src/lib/app-utils/dataset-csv.js +235 -0
- package/src/lib/app-utils/dataset-csv.js.map +1 -0
- package/src/lib/app-utils/dataset-models.d.ts +194 -0
- package/src/lib/app-utils/dataset-models.js +409 -0
- package/src/lib/app-utils/dataset-models.js.map +1 -0
- package/src/lib/app-utils/dataset-query.d.ts +57 -0
- package/src/lib/app-utils/dataset-query.js +126 -0
- package/src/lib/app-utils/dataset-query.js.map +1 -0
- package/src/lib/app-utils/datasets.d.ts +136 -0
- package/src/lib/app-utils/datasets.js +177 -0
- package/src/lib/app-utils/datasets.js.map +1 -0
- package/src/lib/app-utils/decompress.d.ts +36 -0
- package/src/lib/app-utils/decompress.js +32 -0
- package/src/lib/app-utils/decompress.js.map +1 -0
- package/src/lib/app-utils/dedicated-sending-domain.d.ts +47 -0
- package/src/lib/app-utils/dedicated-sending-domain.js +114 -0
- package/src/lib/app-utils/dedicated-sending-domain.js.map +1 -0
- package/src/lib/app-utils/deferred-image.d.ts +86 -0
- package/src/lib/app-utils/deferred-image.js +83 -0
- package/src/lib/app-utils/deferred-image.js.map +1 -0
- package/src/lib/app-utils/definition-canvas-tree.d.ts +61 -0
- package/src/lib/app-utils/definition-canvas-tree.js +126 -0
- package/src/lib/app-utils/definition-canvas-tree.js.map +1 -0
- package/src/lib/app-utils/deployment-shape.d.ts +167 -0
- package/src/lib/app-utils/deployment-shape.js +238 -0
- package/src/lib/app-utils/deployment-shape.js.map +1 -0
- package/src/lib/app-utils/detect-template-placeholders.d.ts +30 -0
- package/src/lib/app-utils/detect-template-placeholders.js +53 -0
- package/src/lib/app-utils/detect-template-placeholders.js.map +1 -0
- package/src/lib/app-utils/dmca-counter-notice.d.ts +185 -0
- package/src/lib/app-utils/dmca-counter-notice.js +277 -0
- package/src/lib/app-utils/dmca-counter-notice.js.map +1 -0
- package/src/lib/app-utils/docs-deflection.d.ts +156 -0
- package/src/lib/app-utils/docs-deflection.js +547 -0
- package/src/lib/app-utils/docs-deflection.js.map +1 -0
- package/src/lib/app-utils/docs-help.d.ts +57 -0
- package/src/lib/app-utils/docs-help.generated.d.ts +303 -0
- package/src/lib/app-utils/docs-help.generated.js +867 -0
- package/src/lib/app-utils/docs-help.generated.js.map +1 -0
- package/src/lib/app-utils/docs-help.js +46 -0
- package/src/lib/app-utils/docs-help.js.map +1 -0
- package/src/lib/app-utils/docs-index.generated.d.ts +29 -0
- package/src/lib/app-utils/docs-index.generated.js +8388 -0
- package/src/lib/app-utils/docs-index.generated.js.map +1 -0
- package/src/lib/app-utils/docs-retrieval.d.ts +67 -0
- package/src/lib/app-utils/docs-retrieval.js +188 -0
- package/src/lib/app-utils/docs-retrieval.js.map +1 -0
- package/src/lib/app-utils/document-landmark.d.ts +50 -0
- package/src/lib/app-utils/document-landmark.js +100 -0
- package/src/lib/app-utils/document-landmark.js.map +1 -0
- package/src/lib/app-utils/duplicate-resource.d.ts +101 -0
- package/src/lib/app-utils/duplicate-resource.js +206 -0
- package/src/lib/app-utils/duplicate-resource.js.map +1 -0
- package/src/lib/app-utils/dynamic-list-rule.d.ts +471 -0
- package/src/lib/app-utils/dynamic-list-rule.js +914 -0
- package/src/lib/app-utils/dynamic-list-rule.js.map +1 -0
- package/src/lib/app-utils/element-animation.d.ts +200 -0
- package/src/lib/app-utils/element-animation.js +233 -0
- package/src/lib/app-utils/element-animation.js.map +1 -0
- package/src/lib/app-utils/element-hidden-style.d.ts +46 -0
- package/src/lib/app-utils/element-hidden-style.js +48 -0
- package/src/lib/app-utils/element-hidden-style.js.map +1 -0
- package/src/lib/app-utils/element-ui.d.ts +243 -0
- package/src/lib/app-utils/element-ui.js +459 -0
- package/src/lib/app-utils/element-ui.js.map +1 -0
- package/src/lib/app-utils/email-starter-policy.d.ts +160 -0
- package/src/lib/app-utils/email-starter-policy.js +327 -0
- package/src/lib/app-utils/email-starter-policy.js.map +1 -0
- package/src/lib/app-utils/email-topics.d.ts +310 -0
- package/src/lib/app-utils/email-topics.js +336 -0
- package/src/lib/app-utils/email-topics.js.map +1 -0
- package/src/lib/app-utils/enabled-plugins-context.d.ts +100 -0
- package/src/lib/app-utils/enabled-plugins-context.js +113 -0
- package/src/lib/app-utils/enabled-plugins-context.js.map +1 -0
- package/src/lib/app-utils/ensure-canvas-root.d.ts +38 -0
- package/src/lib/app-utils/ensure-canvas-root.js +61 -0
- package/src/lib/app-utils/ensure-canvas-root.js.map +1 -0
- package/src/lib/app-utils/entity-picker-context.d.ts +199 -0
- package/src/lib/app-utils/entity-picker-context.js +93 -0
- package/src/lib/app-utils/entity-picker-context.js.map +1 -0
- package/src/lib/app-utils/error-beacon.d.ts +107 -0
- package/src/lib/app-utils/error-beacon.js +296 -0
- package/src/lib/app-utils/error-beacon.js.map +1 -0
- package/src/lib/app-utils/expand-repeatables.d.ts +172 -0
- package/src/lib/app-utils/expand-repeatables.js +299 -0
- package/src/lib/app-utils/expand-repeatables.js.map +1 -0
- package/src/lib/app-utils/foreign-script.d.ts +82 -0
- package/src/lib/app-utils/foreign-script.js +102 -0
- package/src/lib/app-utils/foreign-script.js.map +1 -0
- package/src/lib/app-utils/form-abuse-ceiling.d.ts +146 -0
- package/src/lib/app-utils/form-abuse-ceiling.js +158 -0
- package/src/lib/app-utils/form-abuse-ceiling.js.map +1 -0
- package/src/lib/app-utils/form-contract.d.ts +198 -0
- package/src/lib/app-utils/form-contract.js +282 -0
- package/src/lib/app-utils/form-contract.js.map +1 -0
- package/src/lib/app-utils/form-dataset-binding.d.ts +50 -0
- package/src/lib/app-utils/form-dataset-binding.js +74 -0
- package/src/lib/app-utils/form-dataset-binding.js.map +1 -0
- package/src/lib/app-utils/forms.d.ts +727 -0
- package/src/lib/app-utils/forms.js +777 -0
- package/src/lib/app-utils/forms.js.map +1 -0
- package/src/lib/app-utils/functions.d.ts +188 -0
- package/src/lib/app-utils/functions.js +529 -0
- package/src/lib/app-utils/functions.js.map +1 -0
- package/src/lib/app-utils/guarded-version-save.d.ts +91 -0
- package/src/lib/app-utils/guarded-version-save.js +131 -0
- package/src/lib/app-utils/guarded-version-save.js.map +1 -0
- package/src/lib/app-utils/health-report.d.ts +1766 -0
- package/src/lib/app-utils/health-report.js +2072 -0
- package/src/lib/app-utils/health-report.js.map +1 -0
- package/src/lib/app-utils/host-naming.d.ts +135 -0
- package/src/lib/app-utils/host-naming.js +188 -0
- package/src/lib/app-utils/host-naming.js.map +1 -0
- package/src/lib/app-utils/host-permissions.d.ts +76 -0
- package/src/lib/app-utils/host-permissions.js +119 -0
- package/src/lib/app-utils/host-permissions.js.map +1 -0
- package/src/lib/app-utils/host-tokens.d.ts +228 -0
- package/src/lib/app-utils/host-tokens.js +304 -0
- package/src/lib/app-utils/host-tokens.js.map +1 -0
- package/src/lib/app-utils/idp-profile.d.ts +83 -0
- package/src/lib/app-utils/idp-profile.js +268 -0
- package/src/lib/app-utils/idp-profile.js.map +1 -0
- package/src/lib/app-utils/image-upload-types.d.ts +49 -0
- package/src/lib/app-utils/image-upload-types.js +86 -0
- package/src/lib/app-utils/image-upload-types.js.map +1 -0
- package/src/lib/app-utils/index.d.ts +18 -0
- package/src/lib/app-utils/index.js +23 -0
- package/src/lib/app-utils/index.js.map +1 -0
- package/src/lib/app-utils/internal-traffic.d.ts +197 -0
- package/src/lib/app-utils/internal-traffic.js +288 -0
- package/src/lib/app-utils/internal-traffic.js.map +1 -0
- package/src/lib/app-utils/lineal-order.d.ts +62 -0
- package/src/lib/app-utils/lineal-order.js +65 -0
- package/src/lib/app-utils/lineal-order.js.map +1 -0
- package/src/lib/app-utils/link-references.d.ts +36 -0
- package/src/lib/app-utils/link-references.js +89 -0
- package/src/lib/app-utils/link-references.js.map +1 -0
- package/src/lib/app-utils/link-target-search-context.d.ts +123 -0
- package/src/lib/app-utils/link-target-search-context.js +221 -0
- package/src/lib/app-utils/link-target-search-context.js.map +1 -0
- package/src/lib/app-utils/list-assignment-policy.d.ts +169 -0
- package/src/lib/app-utils/list-assignment-policy.js +170 -0
- package/src/lib/app-utils/list-assignment-policy.js.map +1 -0
- package/src/lib/app-utils/list-import.d.ts +158 -0
- package/src/lib/app-utils/list-import.js +332 -0
- package/src/lib/app-utils/list-import.js.map +1 -0
- package/src/lib/app-utils/llms-txt.d.ts +104 -0
- package/src/lib/app-utils/llms-txt.js +144 -0
- package/src/lib/app-utils/llms-txt.js.map +1 -0
- package/src/lib/app-utils/local-storage-budget.d.ts +75 -0
- package/src/lib/app-utils/local-storage-budget.js +153 -0
- package/src/lib/app-utils/local-storage-budget.js.map +1 -0
- package/src/lib/app-utils/lockdown.d.ts +698 -0
- package/src/lib/app-utils/lockdown.js +929 -0
- package/src/lib/app-utils/lockdown.js.map +1 -0
- package/src/lib/app-utils/margin-utilization.d.ts +267 -0
- package/src/lib/app-utils/margin-utilization.js +351 -0
- package/src/lib/app-utils/margin-utilization.js.map +1 -0
- package/src/lib/app-utils/markdown-lite.d.ts +297 -0
- package/src/lib/app-utils/markdown-lite.js +705 -0
- package/src/lib/app-utils/markdown-lite.js.map +1 -0
- package/src/lib/app-utils/marketing-consent.d.ts +704 -0
- package/src/lib/app-utils/marketing-consent.js +783 -0
- package/src/lib/app-utils/marketing-consent.js.map +1 -0
- package/src/lib/app-utils/marketplace-listing-visibility.d.ts +120 -0
- package/src/lib/app-utils/marketplace-listing-visibility.js +139 -0
- package/src/lib/app-utils/marketplace-listing-visibility.js.map +1 -0
- package/src/lib/app-utils/marketplace-overrides.d.ts +271 -0
- package/src/lib/app-utils/marketplace-overrides.js +462 -0
- package/src/lib/app-utils/marketplace-overrides.js.map +1 -0
- package/src/lib/app-utils/marketplace-provenance.d.ts +150 -0
- package/src/lib/app-utils/marketplace-provenance.js +136 -0
- package/src/lib/app-utils/marketplace-provenance.js.map +1 -0
- package/src/lib/app-utils/marketplace-theme.d.ts +237 -0
- package/src/lib/app-utils/marketplace-theme.js +525 -0
- package/src/lib/app-utils/marketplace-theme.js.map +1 -0
- package/src/lib/app-utils/marketplace-update-state.d.ts +119 -0
- package/src/lib/app-utils/marketplace-update-state.js +132 -0
- package/src/lib/app-utils/marketplace-update-state.js.map +1 -0
- package/src/lib/app-utils/marketplace-verification.d.ts +95 -0
- package/src/lib/app-utils/marketplace-verification.js +81 -0
- package/src/lib/app-utils/marketplace-verification.js.map +1 -0
- package/src/lib/app-utils/measure-node-map.d.ts +76 -0
- package/src/lib/app-utils/measure-node-map.js +111 -0
- package/src/lib/app-utils/measure-node-map.js.map +1 -0
- package/src/lib/app-utils/media-alt.d.ts +55 -0
- package/src/lib/app-utils/media-alt.js +58 -0
- package/src/lib/app-utils/media-alt.js.map +1 -0
- package/src/lib/app-utils/media-asset-facts.d.ts +125 -0
- package/src/lib/app-utils/media-asset-facts.js +467 -0
- package/src/lib/app-utils/media-asset-facts.js.map +1 -0
- package/src/lib/app-utils/media-cdn-scope.d.ts +65 -0
- package/src/lib/app-utils/media-cdn-scope.js +75 -0
- package/src/lib/app-utils/media-cdn-scope.js.map +1 -0
- package/src/lib/app-utils/media-folders.d.ts +161 -0
- package/src/lib/app-utils/media-folders.js +230 -0
- package/src/lib/app-utils/media-folders.js.map +1 -0
- package/src/lib/app-utils/media-metadata.d.ts +277 -0
- package/src/lib/app-utils/media-metadata.js +388 -0
- package/src/lib/app-utils/media-metadata.js.map +1 -0
- package/src/lib/app-utils/media-picker-context.d.ts +93 -0
- package/src/lib/app-utils/media-picker-context.js +26 -0
- package/src/lib/app-utils/media-picker-context.js.map +1 -0
- package/src/lib/app-utils/media-quarantine.d.ts +247 -0
- package/src/lib/app-utils/media-quarantine.js +323 -0
- package/src/lib/app-utils/media-quarantine.js.map +1 -0
- package/src/lib/app-utils/media-ref.d.ts +661 -0
- package/src/lib/app-utils/media-ref.js +1055 -0
- package/src/lib/app-utils/media-ref.js.map +1 -0
- package/src/lib/app-utils/media-takedown-reach.d.ts +126 -0
- package/src/lib/app-utils/media-takedown-reach.js +143 -0
- package/src/lib/app-utils/media-takedown-reach.js.map +1 -0
- package/src/lib/app-utils/member-email-aliases.d.ts +180 -0
- package/src/lib/app-utils/member-email-aliases.js +217 -0
- package/src/lib/app-utils/member-email-aliases.js.map +1 -0
- package/src/lib/app-utils/merge-node-sx.d.ts +47 -0
- package/src/lib/app-utils/merge-node-sx.js +123 -0
- package/src/lib/app-utils/merge-node-sx.js.map +1 -0
- package/src/lib/app-utils/name-match.d.ts +155 -0
- package/src/lib/app-utils/name-match.js +175 -0
- package/src/lib/app-utils/name-match.js.map +1 -0
- package/src/lib/app-utils/name-search.d.ts +117 -0
- package/src/lib/app-utils/name-search.js +145 -0
- package/src/lib/app-utils/name-search.js.map +1 -0
- package/src/lib/app-utils/node-capabilities.d.ts +85 -0
- package/src/lib/app-utils/node-capabilities.js +88 -0
- package/src/lib/app-utils/node-capabilities.js.map +1 -0
- package/src/lib/app-utils/node-definition-sanitizer.d.ts +164 -0
- package/src/lib/app-utils/node-definition-sanitizer.js +402 -0
- package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -0
- package/src/lib/app-utils/node-identity.d.ts +47 -0
- package/src/lib/app-utils/node-identity.js +50 -0
- package/src/lib/app-utils/node-identity.js.map +1 -0
- package/src/lib/app-utils/node-interactions.d.ts +102 -0
- package/src/lib/app-utils/node-interactions.js +192 -0
- package/src/lib/app-utils/node-interactions.js.map +1 -0
- package/src/lib/app-utils/node-url-policy.d.ts +54 -0
- package/src/lib/app-utils/node-url-policy.js +72 -0
- package/src/lib/app-utils/node-url-policy.js.map +1 -0
- package/src/lib/app-utils/notifications.d.ts +71 -0
- package/src/lib/app-utils/notifications.js +101 -0
- package/src/lib/app-utils/notifications.js.map +1 -0
- package/src/lib/app-utils/onboarding-deep-link.d.ts +120 -0
- package/src/lib/app-utils/onboarding-deep-link.js +142 -0
- package/src/lib/app-utils/onboarding-deep-link.js.map +1 -0
- package/src/lib/app-utils/operator-identity.d.ts +207 -0
- package/src/lib/app-utils/operator-identity.js +186 -0
- package/src/lib/app-utils/operator-identity.js.map +1 -0
- package/src/lib/app-utils/org-billing-doc.d.ts +231 -0
- package/src/lib/app-utils/org-billing-doc.js +238 -0
- package/src/lib/app-utils/org-billing-doc.js.map +1 -0
- package/src/lib/app-utils/org-override-reason.d.ts +100 -0
- package/src/lib/app-utils/org-override-reason.js +116 -0
- package/src/lib/app-utils/org-override-reason.js.map +1 -0
- package/src/lib/app-utils/org-permissions.d.ts +194 -0
- package/src/lib/app-utils/org-permissions.js +357 -0
- package/src/lib/app-utils/org-permissions.js.map +1 -0
- package/src/lib/app-utils/org-roles.d.ts +72 -0
- package/src/lib/app-utils/org-roles.js +131 -0
- package/src/lib/app-utils/org-roles.js.map +1 -0
- package/src/lib/app-utils/organizations.d.ts +407 -0
- package/src/lib/app-utils/organizations.js +511 -0
- package/src/lib/app-utils/organizations.js.map +1 -0
- package/src/lib/app-utils/page-header-actions-context.d.ts +83 -0
- package/src/lib/app-utils/page-header-actions-context.js +58 -0
- package/src/lib/app-utils/page-header-actions-context.js.map +1 -0
- package/src/lib/app-utils/page-header-record-context.d.ts +80 -0
- package/src/lib/app-utils/page-header-record-context.js +64 -0
- package/src/lib/app-utils/page-header-record-context.js.map +1 -0
- package/src/lib/app-utils/page-markdown.d.ts +103 -0
- package/src/lib/app-utils/page-markdown.js +385 -0
- package/src/lib/app-utils/page-markdown.js.map +1 -0
- package/src/lib/app-utils/paid-media-source.d.ts +90 -0
- package/src/lib/app-utils/paid-media-source.js +184 -0
- package/src/lib/app-utils/paid-media-source.js.map +1 -0
- package/src/lib/app-utils/palette-sx.d.ts +34 -0
- package/src/lib/app-utils/palette-sx.js +150 -0
- package/src/lib/app-utils/palette-sx.js.map +1 -0
- package/src/lib/app-utils/password-policy.d.ts +47 -0
- package/src/lib/app-utils/password-policy.js +46 -0
- package/src/lib/app-utils/password-policy.js.map +1 -0
- package/src/lib/app-utils/payments-configured.d.ts +84 -0
- package/src/lib/app-utils/payments-configured.js +88 -0
- package/src/lib/app-utils/payments-configured.js.map +1 -0
- package/src/lib/app-utils/person-erasure.d.ts +126 -0
- package/src/lib/app-utils/person-erasure.js +121 -0
- package/src/lib/app-utils/person-erasure.js.map +1 -0
- package/src/lib/app-utils/person-key.d.ts +32 -0
- package/src/lib/app-utils/person-key.js +62 -0
- package/src/lib/app-utils/person-key.js.map +1 -0
- package/src/lib/app-utils/plan-entitlements.d.ts +2756 -0
- package/src/lib/app-utils/plan-entitlements.js +4085 -0
- package/src/lib/app-utils/plan-entitlements.js.map +1 -0
- package/src/lib/app-utils/platform-ad-conversions.d.ts +122 -0
- package/src/lib/app-utils/platform-ad-conversions.js +174 -0
- package/src/lib/app-utils/platform-ad-conversions.js.map +1 -0
- package/src/lib/app-utils/platform-advertising-tags.d.ts +139 -0
- package/src/lib/app-utils/platform-advertising-tags.js +203 -0
- package/src/lib/app-utils/platform-advertising-tags.js.map +1 -0
- package/src/lib/app-utils/platform-brand.d.ts +151 -0
- package/src/lib/app-utils/platform-brand.js +175 -0
- package/src/lib/app-utils/platform-brand.js.map +1 -0
- package/src/lib/app-utils/platform-consent-default.d.ts +142 -0
- package/src/lib/app-utils/platform-consent-default.js +295 -0
- package/src/lib/app-utils/platform-consent-default.js.map +1 -0
- package/src/lib/app-utils/platform-marketing-consent.d.ts +151 -0
- package/src/lib/app-utils/platform-marketing-consent.js +182 -0
- package/src/lib/app-utils/platform-marketing-consent.js.map +1 -0
- package/src/lib/app-utils/platform-marketing-host.d.ts +33 -0
- package/src/lib/app-utils/platform-marketing-host.js +97 -0
- package/src/lib/app-utils/platform-marketing-host.js.map +1 -0
- package/src/lib/app-utils/platform-visitor-consent.d.ts +252 -0
- package/src/lib/app-utils/platform-visitor-consent.js +533 -0
- package/src/lib/app-utils/platform-visitor-consent.js.map +1 -0
- package/src/lib/app-utils/plugin-api-cross-origin.d.ts +61 -0
- package/src/lib/app-utils/plugin-api-cross-origin.js +202 -0
- package/src/lib/app-utils/plugin-api-cross-origin.js.map +1 -0
- package/src/lib/app-utils/plugin-api-rate-limit.d.ts +192 -0
- package/src/lib/app-utils/plugin-api-rate-limit.js +270 -0
- package/src/lib/app-utils/plugin-api-rate-limit.js.map +1 -0
- package/src/lib/app-utils/plugin-artifact-path.d.ts +32 -0
- package/src/lib/app-utils/plugin-artifact-path.js +33 -0
- package/src/lib/app-utils/plugin-artifact-path.js.map +1 -0
- package/src/lib/app-utils/plugin-bundle-checks.d.ts +148 -0
- package/src/lib/app-utils/plugin-bundle-checks.js +989 -0
- package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -0
- package/src/lib/app-utils/plugin-manifest.d.ts +516 -0
- package/src/lib/app-utils/plugin-manifest.js +687 -0
- package/src/lib/app-utils/plugin-manifest.js.map +1 -0
- package/src/lib/app-utils/published-legal-pages.d.ts +71 -0
- package/src/lib/app-utils/published-legal-pages.js +90 -0
- package/src/lib/app-utils/published-legal-pages.js.map +1 -0
- package/src/lib/app-utils/publisher-agreement.d.ts +254 -0
- package/src/lib/app-utils/publisher-agreement.js +274 -0
- package/src/lib/app-utils/publisher-agreement.js.map +1 -0
- package/src/lib/app-utils/publisher-attestation.d.ts +99 -0
- package/src/lib/app-utils/publisher-attestation.js +158 -0
- package/src/lib/app-utils/publisher-attestation.js.map +1 -0
- package/src/lib/app-utils/recipient-email-render.d.ts +216 -0
- package/src/lib/app-utils/recipient-email-render.js +221 -0
- package/src/lib/app-utils/recipient-email-render.js.map +1 -0
- package/src/lib/app-utils/redispatch-caught-error.d.ts +38 -0
- package/src/lib/app-utils/redispatch-caught-error.js +46 -0
- package/src/lib/app-utils/redispatch-caught-error.js.map +1 -0
- package/src/lib/app-utils/registering-plugin.d.ts +19 -0
- package/src/lib/app-utils/registering-plugin.js +38 -0
- package/src/lib/app-utils/registering-plugin.js.map +1 -0
- package/src/lib/app-utils/release-flags.d.ts +283 -0
- package/src/lib/app-utils/release-flags.js +518 -0
- package/src/lib/app-utils/release-flags.js.map +1 -0
- package/src/lib/app-utils/repair-canvas-nodes.d.ts +130 -0
- package/src/lib/app-utils/repair-canvas-nodes.js +298 -0
- package/src/lib/app-utils/repair-canvas-nodes.js.map +1 -0
- package/src/lib/app-utils/repeat-infringer.d.ts +166 -0
- package/src/lib/app-utils/repeat-infringer.js +188 -0
- package/src/lib/app-utils/repeat-infringer.js.map +1 -0
- package/src/lib/app-utils/repeat-sources.d.ts +115 -0
- package/src/lib/app-utils/repeat-sources.js +86 -0
- package/src/lib/app-utils/repeat-sources.js.map +1 -0
- package/src/lib/app-utils/request-geo.d.ts +114 -0
- package/src/lib/app-utils/request-geo.js +247 -0
- package/src/lib/app-utils/request-geo.js.map +1 -0
- package/src/lib/app-utils/request-ip.d.ts +213 -0
- package/src/lib/app-utils/request-ip.js +344 -0
- package/src/lib/app-utils/request-ip.js.map +1 -0
- package/src/lib/app-utils/resolve-named-tokens.d.ts +26 -0
- package/src/lib/app-utils/resolve-named-tokens.js +59 -0
- package/src/lib/app-utils/resolve-named-tokens.js.map +1 -0
- package/src/lib/app-utils/responsive-typography-sx.d.ts +77 -0
- package/src/lib/app-utils/responsive-typography-sx.js +122 -0
- package/src/lib/app-utils/responsive-typography-sx.js.map +1 -0
- package/src/lib/app-utils/reusable-component-keys.d.ts +135 -0
- package/src/lib/app-utils/reusable-component-keys.js +140 -0
- package/src/lib/app-utils/reusable-component-keys.js.map +1 -0
- package/src/lib/app-utils/reusable-prop-values.d.ts +199 -0
- package/src/lib/app-utils/reusable-prop-values.js +494 -0
- package/src/lib/app-utils/reusable-prop-values.js.map +1 -0
- package/src/lib/app-utils/safe-json-ld.d.ts +29 -0
- package/src/lib/app-utils/safe-json-ld.js +37 -0
- package/src/lib/app-utils/safe-json-ld.js.map +1 -0
- package/src/lib/app-utils/sanitize-svg.d.ts +55 -0
- package/src/lib/app-utils/sanitize-svg.js +460 -0
- package/src/lib/app-utils/sanitize-svg.js.map +1 -0
- package/src/lib/app-utils/scheme-sx.d.ts +84 -0
- package/src/lib/app-utils/scheme-sx.js +148 -0
- package/src/lib/app-utils/scheme-sx.js.map +1 -0
- package/src/lib/app-utils/scope-tokens.d.ts +249 -0
- package/src/lib/app-utils/scope-tokens.js +331 -0
- package/src/lib/app-utils/scope-tokens.js.map +1 -0
- package/src/lib/app-utils/screen-link-context-value.d.ts +57 -0
- package/src/lib/app-utils/screen-link-context-value.js +43 -0
- package/src/lib/app-utils/screen-link-context-value.js.map +1 -0
- package/src/lib/app-utils/screen-link-context.d.ts +185 -0
- package/src/lib/app-utils/screen-link-context.js +304 -0
- package/src/lib/app-utils/screen-link-context.js.map +1 -0
- package/src/lib/app-utils/screen-link-value.d.ts +269 -0
- package/src/lib/app-utils/screen-link-value.js +384 -0
- package/src/lib/app-utils/screen-link-value.js.map +1 -0
- package/src/lib/app-utils/screen-route.d.ts +669 -0
- package/src/lib/app-utils/screen-route.js +751 -0
- package/src/lib/app-utils/screen-route.js.map +1 -0
- package/src/lib/app-utils/screen-seo-fields.d.ts +37 -0
- package/src/lib/app-utils/screen-seo-fields.js +42 -0
- package/src/lib/app-utils/screen-seo-fields.js.map +1 -0
- package/src/lib/app-utils/search-indexing.d.ts +162 -0
- package/src/lib/app-utils/search-indexing.js +207 -0
- package/src/lib/app-utils/search-indexing.js.map +1 -0
- package/src/lib/app-utils/seo-listing-fields.d.ts +70 -0
- package/src/lib/app-utils/seo-listing-fields.js +75 -0
- package/src/lib/app-utils/seo-listing-fields.js.map +1 -0
- package/src/lib/app-utils/seo-locale.d.ts +119 -0
- package/src/lib/app-utils/seo-locale.js +133 -0
- package/src/lib/app-utils/seo-locale.js.map +1 -0
- package/src/lib/app-utils/seo-title-variables.d.ts +149 -0
- package/src/lib/app-utils/seo-title-variables.js +190 -0
- package/src/lib/app-utils/seo-title-variables.js.map +1 -0
- package/src/lib/app-utils/seo-title.d.ts +70 -0
- package/src/lib/app-utils/seo-title.js +117 -0
- package/src/lib/app-utils/seo-title.js.map +1 -0
- package/src/lib/app-utils/server.d.ts +174 -0
- package/src/lib/app-utils/server.js +314 -0
- package/src/lib/app-utils/server.js.map +1 -0
- package/src/lib/app-utils/site-context.d.ts +106 -0
- package/src/lib/app-utils/site-context.js +100 -0
- package/src/lib/app-utils/site-context.js.map +1 -0
- package/src/lib/app-utils/sitemap.d.ts +117 -0
- package/src/lib/app-utils/sitemap.js +183 -0
- package/src/lib/app-utils/sitemap.js.map +1 -0
- package/src/lib/app-utils/social-image.d.ts +112 -0
- package/src/lib/app-utils/social-image.js +191 -0
- package/src/lib/app-utils/social-image.js.map +1 -0
- package/src/lib/app-utils/starter-templates.d.ts +99 -0
- package/src/lib/app-utils/starter-templates.js +579 -0
- package/src/lib/app-utils/starter-templates.js.map +1 -0
- package/src/lib/app-utils/stored-nodes.d.ts +120 -0
- package/src/lib/app-utils/stored-nodes.js +174 -0
- package/src/lib/app-utils/stored-nodes.js.map +1 -0
- package/src/lib/app-utils/strip-undefined.d.ts +59 -0
- package/src/lib/app-utils/strip-undefined.js +95 -0
- package/src/lib/app-utils/strip-undefined.js.map +1 -0
- package/src/lib/app-utils/stripe-deployment-mode.d.ts +47 -0
- package/src/lib/app-utils/stripe-deployment-mode.js +70 -0
- package/src/lib/app-utils/stripe-deployment-mode.js.map +1 -0
- package/src/lib/app-utils/support-tiers.d.ts +108 -0
- package/src/lib/app-utils/support-tiers.js +201 -0
- package/src/lib/app-utils/support-tiers.js.map +1 -0
- package/src/lib/app-utils/timezone-geo-hint.d.ts +36 -0
- package/src/lib/app-utils/timezone-geo-hint.js +180 -0
- package/src/lib/app-utils/timezone-geo-hint.js.map +1 -0
- package/src/lib/app-utils/upload-cors.d.ts +155 -0
- package/src/lib/app-utils/upload-cors.js +254 -0
- package/src/lib/app-utils/upload-cors.js.map +1 -0
- package/src/lib/app-utils/upload-inspection.d.ts +159 -0
- package/src/lib/app-utils/upload-inspection.js +539 -0
- package/src/lib/app-utils/upload-inspection.js.map +1 -0
- package/src/lib/app-utils/url-slug.d.ts +40 -0
- package/src/lib/app-utils/url-slug.js +42 -0
- package/src/lib/app-utils/url-slug.js.map +1 -0
- package/src/lib/app-utils/usage-budget.d.ts +429 -0
- package/src/lib/app-utils/usage-budget.js +421 -0
- package/src/lib/app-utils/usage-budget.js.map +1 -0
- package/src/lib/app-utils/variables.d.ts +96 -0
- package/src/lib/app-utils/variables.js +233 -0
- package/src/lib/app-utils/variables.js.map +1 -0
- package/src/lib/app-utils/video-asset-facts.d.ts +61 -0
- package/src/lib/app-utils/video-asset-facts.js +70 -0
- package/src/lib/app-utils/video-asset-facts.js.map +1 -0
- package/src/lib/app-utils/video-object.d.ts +89 -0
- package/src/lib/app-utils/video-object.js +245 -0
- package/src/lib/app-utils/video-object.js.map +1 -0
- package/src/lib/app-utils/visitor-consent.d.ts +757 -0
- package/src/lib/app-utils/visitor-consent.js +981 -0
- package/src/lib/app-utils/visitor-consent.js.map +1 -0
- package/src/lib/app-utils/visitor-record-ceiling.d.ts +223 -0
- package/src/lib/app-utils/visitor-record-ceiling.js +215 -0
- package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -0
- package/src/lib/app-utils/web-vitals-rum.d.ts +53 -0
- package/src/lib/app-utils/web-vitals-rum.js +278 -0
- package/src/lib/app-utils/web-vitals-rum.js.map +1 -0
- package/src/lib/app-utils/webhook-delivery.d.ts +324 -0
- package/src/lib/app-utils/webhook-delivery.js +413 -0
- package/src/lib/app-utils/webhook-delivery.js.map +1 -0
- package/src/lib/app-utils/where-used.d.ts +57 -0
- package/src/lib/app-utils/where-used.js +59 -0
- package/src/lib/app-utils/where-used.js.map +1 -0
- package/src/lib/app-utils/wistia-embed.d.ts +86 -0
- package/src/lib/app-utils/wistia-embed.js +119 -0
- package/src/lib/app-utils/wistia-embed.js.map +1 -0
- package/src/lib/app-utils/workflows.d.ts +136 -0
- package/src/lib/app-utils/workflows.js +346 -0
- package/src/lib/app-utils/workflows.js.map +1 -0
- package/src/lib/canvas-manager/canvas-manager-tree.d.ts +109 -0
- package/src/lib/canvas-manager/canvas-manager-tree.js +139 -0
- package/src/lib/canvas-manager/canvas-manager-tree.js.map +1 -0
- package/src/lib/canvas-manager/canvas-manager.d.ts +549 -0
- package/src/lib/canvas-manager/canvas-manager.js +1311 -0
- package/src/lib/canvas-manager/canvas-manager.js.map +1 -0
- package/src/lib/canvas-manager/index.d.ts +20 -0
- package/src/lib/canvas-manager/index.js +21 -0
- package/src/lib/canvas-manager/index.js.map +1 -0
- package/src/lib/canvas-manager/stores/index.d.ts +17 -0
- package/src/lib/canvas-manager/stores/index.js +18 -0
- package/src/lib/canvas-manager/stores/index.js.map +1 -0
- package/src/lib/canvas-manager/stores/node.store.d.ts +30 -0
- package/src/lib/canvas-manager/stores/node.store.js +45 -0
- package/src/lib/canvas-manager/stores/node.store.js.map +1 -0
- package/src/lib/components-manager/components-manager.d.ts +56 -0
- package/src/lib/components-manager/components-manager.js +191 -0
- package/src/lib/components-manager/components-manager.js.map +1 -0
- package/src/lib/components-manager/index.d.ts +18 -0
- package/src/lib/components-manager/index.js +19 -0
- package/src/lib/components-manager/index.js.map +1 -0
- package/src/lib/emit-manager/emit-manager.d.ts +56 -0
- package/src/lib/emit-manager/emit-manager.js +60 -0
- package/src/lib/emit-manager/emit-manager.js.map +1 -0
- package/src/lib/emit-manager/index.d.ts +18 -0
- package/src/lib/emit-manager/index.js +19 -0
- package/src/lib/emit-manager/index.js.map +1 -0
- package/src/lib/foundation/constants/_internal.d.ts +18 -0
- package/src/lib/foundation/constants/_internal.js +62 -0
- package/src/lib/foundation/constants/_internal.js.map +1 -0
- package/src/lib/foundation/constants/app.d.ts +23 -0
- package/src/lib/foundation/constants/app.js +25 -0
- package/src/lib/foundation/constants/app.js.map +1 -0
- package/src/lib/foundation/constants/canvas.d.ts +18 -0
- package/src/lib/foundation/constants/canvas.js +18 -0
- package/src/lib/foundation/constants/canvas.js.map +1 -0
- package/src/lib/foundation/constants/components.d.ts +54 -0
- package/src/lib/foundation/constants/components.js +61 -0
- package/src/lib/foundation/constants/components.js.map +1 -0
- package/src/lib/foundation/constants/shared.d.ts +50 -0
- package/src/lib/foundation/constants/shared.js +49 -0
- package/src/lib/foundation/constants/shared.js.map +1 -0
- package/src/lib/foundation/constants/symbol.d.ts +63 -0
- package/src/lib/foundation/constants/symbol.js +75 -0
- package/src/lib/foundation/constants/symbol.js.map +1 -0
- package/src/lib/foundation/definitions/components.types.d.ts +372 -0
- package/src/lib/foundation/definitions/components.types.js +180 -0
- package/src/lib/foundation/definitions/components.types.js.map +1 -0
- package/src/lib/foundation/definitions/contact.types.d.ts +73 -0
- package/src/lib/foundation/definitions/contact.types.js +107 -0
- package/src/lib/foundation/definitions/contact.types.js.map +1 -0
- package/src/lib/foundation/definitions/host-content-collections.d.ts +137 -0
- package/src/lib/foundation/definitions/host-content-collections.js +219 -0
- package/src/lib/foundation/definitions/host-content-collections.js.map +1 -0
- package/src/lib/foundation/definitions/org-billing.types.d.ts +1361 -0
- package/src/lib/foundation/definitions/org-billing.types.js +77 -0
- package/src/lib/foundation/definitions/org-billing.types.js.map +1 -0
- package/src/lib/foundation/definitions/organization.types.d.ts +307 -0
- package/src/lib/foundation/definitions/organization.types.js +42 -0
- package/src/lib/foundation/definitions/organization.types.js.map +1 -0
- package/src/lib/foundation/definitions/platform.types.d.ts +1326 -0
- package/src/lib/foundation/definitions/platform.types.js +124 -0
- package/src/lib/foundation/definitions/platform.types.js.map +1 -0
- package/src/lib/foundation/definitions/property-kinds.d.ts +189 -0
- package/src/lib/foundation/definitions/property-kinds.js +565 -0
- package/src/lib/foundation/definitions/property-kinds.js.map +1 -0
- package/src/lib/foundation/definitions/shared.d.ts +23 -0
- package/src/lib/foundation/definitions/shared.js +18 -0
- package/src/lib/foundation/definitions/shared.js.map +1 -0
- package/src/lib/foundation/definitions/write-deny-coverage.util.d.ts +249 -0
- package/src/lib/foundation/definitions/write-deny-coverage.util.js +499 -0
- package/src/lib/foundation/definitions/write-deny-coverage.util.js.map +1 -0
- package/src/lib/foundation/index.d.ts +32 -0
- package/src/lib/foundation/index.js +67 -0
- package/src/lib/foundation/index.js.map +1 -0
- package/src/lib/lifecycle.d.ts +24 -0
- package/src/lib/lifecycle.js +39 -0
- package/src/lib/lifecycle.js.map +1 -0
- package/src/lib/mst/common.d.ts +17 -0
- package/src/lib/mst/common.js +23 -0
- package/src/lib/mst/common.js.map +1 -0
- package/src/lib/mst/index.d.ts +19 -0
- package/src/lib/mst/index.js +20 -0
- package/src/lib/mst/index.js.map +1 -0
- package/src/lib/mst/json.d.ts +22 -0
- package/src/lib/mst/json.js +23 -0
- package/src/lib/mst/json.js.map +1 -0
- package/src/lib/mst/types.d.ts +20 -0
- package/src/lib/mst/types.js +18 -0
- package/src/lib/mst/types.js.map +1 -0
- package/src/lib/plugin-manager/billing-webhook-hooks.d.ts +77 -0
- package/src/lib/plugin-manager/billing-webhook-hooks.js +55 -0
- package/src/lib/plugin-manager/billing-webhook-hooks.js.map +1 -0
- package/src/lib/plugin-manager/commerce-zone-props.d.ts +172 -0
- package/src/lib/plugin-manager/commerce-zone-props.js +31 -0
- package/src/lib/plugin-manager/commerce-zone-props.js.map +1 -0
- package/src/lib/plugin-manager/custom-fields.d.ts +60 -0
- package/src/lib/plugin-manager/custom-fields.js +39 -0
- package/src/lib/plugin-manager/custom-fields.js.map +1 -0
- package/src/lib/plugin-manager/editor-sessions.d.ts +109 -0
- package/src/lib/plugin-manager/editor-sessions.js +137 -0
- package/src/lib/plugin-manager/editor-sessions.js.map +1 -0
- package/src/lib/plugin-manager/enabled-plugins.d.ts +438 -0
- package/src/lib/plugin-manager/enabled-plugins.js +403 -0
- package/src/lib/plugin-manager/enabled-plugins.js.map +1 -0
- package/src/lib/plugin-manager/feature-plugins.d.ts +1314 -0
- package/src/lib/plugin-manager/feature-plugins.js +609 -0
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +11 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js +149 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -0
- package/src/lib/plugin-manager/index.d.ts +42 -0
- package/src/lib/plugin-manager/index.js +46 -0
- package/src/lib/plugin-manager/index.js.map +1 -0
- package/src/lib/plugin-manager/install-presets.d.ts +93 -0
- package/src/lib/plugin-manager/install-presets.js +86 -0
- package/src/lib/plugin-manager/install-presets.js.map +1 -0
- package/src/lib/plugin-manager/media-delivery-provider.d.ts +124 -0
- package/src/lib/plugin-manager/media-delivery-provider.js +53 -0
- package/src/lib/plugin-manager/media-delivery-provider.js.map +1 -0
- package/src/lib/plugin-manager/order-fulfilment.d.ts +142 -0
- package/src/lib/plugin-manager/order-fulfilment.js +104 -0
- package/src/lib/plugin-manager/order-fulfilment.js.map +1 -0
- package/src/lib/plugin-manager/plugin-activity-actions.d.ts +122 -0
- package/src/lib/plugin-manager/plugin-activity-actions.js +140 -0
- package/src/lib/plugin-manager/plugin-activity-actions.js.map +1 -0
- package/src/lib/plugin-manager/plugin-bridge.d.ts +98 -0
- package/src/lib/plugin-manager/plugin-bridge.js +154 -0
- package/src/lib/plugin-manager/plugin-bridge.js.map +1 -0
- package/src/lib/plugin-manager/plugin-config.d.ts +148 -0
- package/src/lib/plugin-manager/plugin-config.js +228 -0
- package/src/lib/plugin-manager/plugin-config.js.map +1 -0
- package/src/lib/plugin-manager/plugin-console-crons.d.ts +139 -0
- package/src/lib/plugin-manager/plugin-console-crons.js +177 -0
- package/src/lib/plugin-manager/plugin-console-crons.js.map +1 -0
- package/src/lib/plugin-manager/plugin-contact-capture.d.ts +220 -0
- package/src/lib/plugin-manager/plugin-contact-capture.js +89 -0
- package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -0
- package/src/lib/plugin-manager/plugin-contributions.d.ts +244 -0
- package/src/lib/plugin-manager/plugin-contributions.js +283 -0
- package/src/lib/plugin-manager/plugin-contributions.js.map +1 -0
- package/src/lib/plugin-manager/plugin-entitlement-keys.d.ts +169 -0
- package/src/lib/plugin-manager/plugin-entitlement-keys.js +84 -0
- package/src/lib/plugin-manager/plugin-entitlement-keys.js.map +1 -0
- package/src/lib/plugin-manager/plugin-entitlements.d.ts +181 -0
- package/src/lib/plugin-manager/plugin-entitlements.js +188 -0
- package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -0
- package/src/lib/plugin-manager/plugin-events.d.ts +145 -0
- package/src/lib/plugin-manager/plugin-events.js +79 -0
- package/src/lib/plugin-manager/plugin-events.js.map +1 -0
- package/src/lib/plugin-manager/plugin-figures.d.ts +251 -0
- package/src/lib/plugin-manager/plugin-figures.js +252 -0
- package/src/lib/plugin-manager/plugin-figures.js.map +1 -0
- package/src/lib/plugin-manager/plugin-host-collections.d.ts +146 -0
- package/src/lib/plugin-manager/plugin-host-collections.js +116 -0
- package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -0
- package/src/lib/plugin-manager/plugin-jobs.d.ts +130 -0
- package/src/lib/plugin-manager/plugin-jobs.js +182 -0
- package/src/lib/plugin-manager/plugin-jobs.js.map +1 -0
- package/src/lib/plugin-manager/plugin-loader.d.ts +86 -0
- package/src/lib/plugin-manager/plugin-loader.js +223 -0
- package/src/lib/plugin-manager/plugin-loader.js.map +1 -0
- package/src/lib/plugin-manager/plugin-manager.d.ts +95 -0
- package/src/lib/plugin-manager/plugin-manager.js +343 -0
- package/src/lib/plugin-manager/plugin-manager.js.map +1 -0
- package/src/lib/plugin-manager/plugin-metered-lines.d.ts +97 -0
- package/src/lib/plugin-manager/plugin-metered-lines.js +123 -0
- package/src/lib/plugin-manager/plugin-metered-lines.js.map +1 -0
- package/src/lib/plugin-manager/plugin-org-erasure.d.ts +52 -0
- package/src/lib/plugin-manager/plugin-org-erasure.js +100 -0
- package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -0
- package/src/lib/plugin-manager/plugin-permissions.d.ts +69 -0
- package/src/lib/plugin-manager/plugin-permissions.js +77 -0
- package/src/lib/plugin-manager/plugin-permissions.js.map +1 -0
- package/src/lib/plugin-manager/plugin-person-erasure.d.ts +58 -0
- package/src/lib/plugin-manager/plugin-person-erasure.js +109 -0
- package/src/lib/plugin-manager/plugin-person-erasure.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-cards.d.ts +99 -0
- package/src/lib/plugin-manager/plugin-record-cards.js +59 -0
- package/src/lib/plugin-manager/plugin-record-cards.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-facts.d.ts +111 -0
- package/src/lib/plugin-manager/plugin-record-facts.js +51 -0
- package/src/lib/plugin-manager/plugin-record-facts.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-routes.d.ts +129 -0
- package/src/lib/plugin-manager/plugin-record-routes.js +93 -0
- package/src/lib/plugin-manager/plugin-record-routes.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-timeline.d.ts +147 -0
- package/src/lib/plugin-manager/plugin-record-timeline.js +39 -0
- package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -0
- package/src/lib/plugin-manager/plugin-resource-drafts.d.ts +137 -0
- package/src/lib/plugin-manager/plugin-resource-drafts.js +51 -0
- package/src/lib/plugin-manager/plugin-resource-drafts.js.map +1 -0
- package/src/lib/plugin-manager/plugin-services.d.ts +94 -0
- package/src/lib/plugin-manager/plugin-services.js +153 -0
- package/src/lib/plugin-manager/plugin-services.js.map +1 -0
- package/src/lib/plugin-manager/plugin-styles-ui.d.ts +71 -0
- package/src/lib/plugin-manager/plugin-styles-ui.js +80 -0
- package/src/lib/plugin-manager/plugin-styles-ui.js.map +1 -0
- package/src/lib/plugin-manager/plugin-styles.d.ts +176 -0
- package/src/lib/plugin-manager/plugin-styles.js +186 -0
- package/src/lib/plugin-manager/plugin-styles.js.map +1 -0
- package/src/lib/plugin-manager/plugin-subprocessors.d.ts +135 -0
- package/src/lib/plugin-manager/plugin-subprocessors.js +129 -0
- package/src/lib/plugin-manager/plugin-subprocessors.js.map +1 -0
- package/src/lib/plugin-manager/plugin-tax-profile.d.ts +84 -0
- package/src/lib/plugin-manager/plugin-tax-profile.js +39 -0
- package/src/lib/plugin-manager/plugin-tax-profile.js.map +1 -0
- package/src/lib/plugin-manager/plugin-user-erasure.d.ts +53 -0
- package/src/lib/plugin-manager/plugin-user-erasure.js +84 -0
- package/src/lib/plugin-manager/plugin-user-erasure.js.map +1 -0
- package/src/lib/plugin-manager/plugin-zones.d.ts +121 -0
- package/src/lib/plugin-manager/plugin-zones.js +74 -0
- package/src/lib/plugin-manager/plugin-zones.js.map +1 -0
- package/src/lib/plugin-manager/realm-plugins.d.ts +112 -0
- package/src/lib/plugin-manager/realm-plugins.js +196 -0
- package/src/lib/plugin-manager/realm-plugins.js.map +1 -0
- package/src/lib/plugin-manager/realm-server.d.ts +54 -0
- package/src/lib/plugin-manager/realm-server.js +88 -0
- package/src/lib/plugin-manager/realm-server.js.map +1 -0
- package/src/lib/plugin-manager/record-zone-props.d.ts +126 -0
- package/src/lib/plugin-manager/record-zone-props.js +31 -0
- package/src/lib/plugin-manager/record-zone-props.js.map +1 -0
- package/src/lib/plugin-manager/site-page-hooks.d.ts +102 -0
- package/src/lib/plugin-manager/site-page-hooks.js +114 -0
- package/src/lib/plugin-manager/site-page-hooks.js.map +1 -0
- package/src/lib/plugin-manager/site-runtime.d.ts +57 -0
- package/src/lib/plugin-manager/site-runtime.js +25 -0
- package/src/lib/plugin-manager/site-runtime.js.map +1 -0
- package/src/lib/plugin-manager/usage-alert-contributors.d.ts +115 -0
- package/src/lib/plugin-manager/usage-alert-contributors.js +106 -0
- package/src/lib/plugin-manager/usage-alert-contributors.js.map +1 -0
- package/src/lib/types/ast.d.ts +199 -0
- package/src/lib/types/ast.js +20 -0
- package/src/lib/types/ast.js.map +1 -0
- package/src/lib/types/index.d.ts +20 -0
- package/src/lib/types/index.js +21 -0
- package/src/lib/types/index.js.map +1 -0
- package/src/lib/types/nodes.d.ts +608 -0
- package/src/lib/types/nodes.js +28 -0
- package/src/lib/types/nodes.js.map +1 -0
- package/src/lib/types/routing.d.ts +17 -0
- package/src/lib/types/routing.js +18 -0
- package/src/lib/types/routing.js.map +1 -0
- package/src/lib/types/screen.d.ts +23 -0
- package/src/lib/types/screen.js +18 -0
- package/src/lib/types/screen.js.map +1 -0
- package/src/lib/utils.d.ts +25 -0
- package/src/lib/utils.js +42 -0
- package/src/lib/utils.js.map +1 -0
- package/src/server.d.ts +37 -0
- package/src/server.js +55 -0
- package/src/server.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/crm-inbound.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { normalizeContactEmail } from './contacts'\nimport {\n CRM_EMAIL_BODY_MAX,\n CRM_EMAIL_SUBJECT_MAX,\n type CrmActivity,\n type CrmActivityLink,\n type CrmEmailDirection,\n} from './crm'\nimport {\n type MemberAddresses,\n memberEmailAddresses,\n verifiedMemberEmailAliases,\n} from './member-email-aliases'\n\n/**\n * EMAIL CAPTURE (AGL-2657): the pure half.\n *\n * A workspace gets one address — `crm+<token>@<capture domain>` — and a\n * reply forwarded to it, or a message a teammate copies to it from their\n * own mailbox, is filed on the record of whoever the message was with.\n * This module is everything about that which needs no Firestore and no\n * provider: the shape of the address, the token in it, which of a\n * message's addresses is the correspondent, what of the body is worth\n * keeping, and the activity row the whole thing becomes. The webhook route\n * and the address route read it; the dialog and the settings card read the\n * address helpers; the specs read all of it.\n *\n * ## The token is the whole secret\n *\n * The address is public the moment a member pastes it into a mailbox rule,\n * and the domain is the platform's, so the token is the only thing that\n * says which workspace a message is for. Thirty-two characters from a\n * lowercase alphabet — mail servers may fold the local part's case, and a\n * token that survived folding is one that never depended on case — drawn\n * from the platform's random source, which is the same entropy an API key\n * carries. Rotation replaces it; the old address then files nothing.\n *\n * ## Who the message was with\n *\n * A message names several addresses and exactly one of them is the person\n * the record is about. The rule: the first address among From, To and Cc\n * that is not the capture address and not a member of the workspace — the\n * workspace's own people are never the correspondent — in that order,\n * because a reply's From is the correspondent and a copied send's To is.\n * A member is every address that is theirs: the one they sign in with and\n * each alias they have confirmed (`member-email-aliases.ts`), so a send\n * from an outbound-domain alias is read as the member's, not as a stranger.\n * A message a teammate forwarded names the correspondent nowhere in its\n * headers, only in the forwarded block of the body, so that block's `From:`\n * is the last candidate. Which candidate matched decides the direction:\n * one the correspondent wrote is `inbound`, one the workspace wrote is\n * `outbound`.\n */\n\n/** Where captured mail arrives when the deployment names no domain. */\nexport const CRM_INBOUND_DEFAULT_DOMAIN = 'in.aglyn.com'\n\n/** The local part every capture address begins with: `crm+<token>@…`. */\nexport const CRM_INBOUND_LOCAL_PART = 'crm'\n\n/** How many characters a minted token has. */\nexport const CRM_INBOUND_TOKEN_LENGTH = 32\n\n/** The most a captured message's excerpt keeps: a letter, not a thread. */\nexport const CRM_INBOUND_EXCERPT_MAX = 4_000\n\n/** What the org's feed says about a message that matched no record. */\nexport const CRM_INBOUND_UNMATCHED_ACTION = 'Inbound email matched no record'\n\n/** What the org's feed says about a message the record's ceiling refused. */\nexport const CRM_INBOUND_CEILING_ACTION = 'Inbound email not filed: activity log full'\n\nconst TOKEN_ALPHABET = 'abcdefghijklmnopqrstuvwxyz0123456789'\nconst TOKEN_PATTERN = /^[a-z0-9]{24,64}$/\nconst DOMAIN_PATTERN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/\n\n/**\n * The domain captured mail is addressed at: `CRM_INBOUND_DOMAIN`, or the\n * platform's default when the deployment names none or names something\n * that is not a hostname. Lowercased, because a domain is.\n */\nexport function crmInboundDomain(\n env: Record<string, string | undefined> = process.env,\n): string {\n const configured = String(env['CRM_INBOUND_DOMAIN'] ?? '')\n .trim()\n .toLowerCase()\n return DOMAIN_PATTERN.test(configured) ? configured : CRM_INBOUND_DEFAULT_DOMAIN\n}\n\n/**\n * A fresh token from the platform's random source. One byte per character\n * folded onto a 36-symbol alphabet: the fold is very slightly uneven and\n * the token is thirty-two symbols long, which is more than an API key\n * carries and far more than an address anyone guesses.\n */\nexport function mintCrmInboundToken(): string {\n const bytes = new Uint8Array(CRM_INBOUND_TOKEN_LENGTH)\n globalThis.crypto.getRandomValues(bytes)\n let token = ''\n for (const byte of bytes) token += TOKEN_ALPHABET[byte % TOKEN_ALPHABET.length]\n return token\n}\n\nexport function isCrmInboundToken(value: unknown): value is string {\n return typeof value === 'string' && TOKEN_PATTERN.test(value)\n}\n\n/** `crm+<token>@<domain>` — the address a member pastes into a mailbox. */\nexport function crmInboundAddress(token: string, domain: string): string {\n return `${CRM_INBOUND_LOCAL_PART}+${token}@${domain}`\n}\n\n/**\n * The bare address in a header value — `Ada <ada@example.com>` and\n * `ada@example.com` both answer `ada@example.com` — normalized as every\n * contact address is, or `null` for anything that is not one.\n */\nexport function emailAddressOf(value: unknown): string | null {\n const raw = String(value ?? '').trim()\n const angled = /<([^<>]+)>\\s*$/.exec(raw)\n return normalizeContactEmail(angled ? angled[1] : raw)\n}\n\n/** The part after the `@`, or `null` — what an unmatched message is logged by. */\nexport function emailDomainOf(value: unknown): string | null {\n const address = emailAddressOf(value)\n if (!address) return null\n const at = address.lastIndexOf('@')\n return at > 0 ? address.slice(at + 1) : null\n}\n\n/**\n * The token a recipient address carries, or `null` when the address is not\n * a capture address on `domain`. The local part is read case-folded — a\n * relay may fold it and the alphabet has no case to lose — and the domain\n * is compared the way domains compare.\n */\nexport function crmInboundTokenOf(recipient: unknown, domain: string): string | null {\n const raw = String(recipient ?? '').trim()\n const angled = /<([^<>]+)>\\s*$/.exec(raw)\n const address = (angled ? angled[1] : raw).trim()\n const at = address.lastIndexOf('@')\n if (at <= 0) return null\n if (address.slice(at + 1).toLowerCase() !== domain.toLowerCase()) return null\n const local = address.slice(0, at).toLowerCase()\n const match = new RegExp(`^${CRM_INBOUND_LOCAL_PART}\\\\+([a-z0-9]{24,64})$`).exec(local)\n return match ? match[1] : null\n}\n\n/** Every distinct token among a message's recipients, in the order met. */\nexport function crmInboundTokensIn(\n recipients: readonly unknown[],\n domain: string,\n): string[] {\n const tokens: string[] = []\n for (const recipient of recipients) {\n const token = crmInboundTokenOf(recipient, domain)\n if (token && !tokens.includes(token)) tokens.push(token)\n }\n return tokens\n}\n\nexport function isCrmInboundAddress(address: unknown, domain: string): boolean {\n return crmInboundTokenOf(address, domain) !== null\n}\n\n/**\n * The subject with its reply and forward prefixes removed, however many\n * were stacked — `Re: Fwd: RE: Renewal` is the `Renewal` thread — and\n * whitespace collapsed, so two rows of one conversation carry one value.\n */\nexport function crmThreadSubject(subject: unknown): string {\n let value = String(subject ?? '')\n .replace(/\\s+/g, ' ')\n .trim()\n const prefix = /^(re|fwd?|aw|wg|tr|sv|vs)\\s*(\\[\\d+\\])?\\s*:\\s*/i\n while (prefix.test(value)) value = value.replace(prefix, '')\n return value.slice(0, CRM_EMAIL_SUBJECT_MAX)\n}\n\nconst ENTITIES: Record<string, string> = {\n amp: '&',\n lt: '<',\n gt: '>',\n quot: '\"',\n apos: \"'\",\n nbsp: ' ',\n}\n\n/**\n * The words in an HTML part, for a message that carried no text part.\n * Block boundaries become line breaks, tags go, the common entities are\n * read back — a best effort over a bounded slice, never a renderer.\n */\nexport function htmlToPlainText(html: unknown): string {\n return String(html ?? '')\n .slice(0, 200_000)\n .replace(/<(script|style)[\\s\\S]*?<\\/\\1>/gi, '')\n .replace(/<br\\s*\\/?>/gi, '\\n')\n .replace(/<\\/(p|div|li|tr|h[1-6]|blockquote|pre)>/gi, '\\n')\n .replace(/<[^>]+>/g, '')\n .replace(/&(#\\d+|#x[0-9a-f]+|[a-z]+);/gi, (whole, code: string) => {\n if (code.startsWith('#x') || code.startsWith('#X')) {\n return String.fromCodePoint(parseInt(code.slice(2), 16))\n }\n if (code.startsWith('#')) return String.fromCodePoint(parseInt(code.slice(1), 10))\n return ENTITIES[code.toLowerCase()] ?? whole\n })\n}\n\n/** What a forwarded message's header block says, and the words after it. */\nexport interface ForwardedSection {\n /** The address on the block's `From:` line, or `null` when it carried none. */\n from: string | null\n /** The forwarded message's own text, header block removed. */\n body: string\n}\n\nconst FORWARD_MARKER = /^\\s*(-{2,}\\s*Forwarded message\\s*-{2,}|Begin forwarded message:)\\s*$/i\nconst HEADER_LINE = /^\\s*\\*?(From|Sent|Date|To|Cc|Subject|Reply-To)\\s*:\\*?\\s*(.*)$/i\n\n/**\n * The forwarded message inside a forward — the block a mail client puts\n * under \"Forwarded message\" or, with no marker, a run of `From:` … `Subject:`\n * header lines — or `null` when the text carries none. The `From:` line is\n * where the correspondent of a forwarded reply is named, since the forward's\n * own headers name only the teammate who forwarded it.\n */\nexport function forwardedSection(text: string): ForwardedSection | null {\n const lines = text.split('\\n')\n let start = -1\n for (let index = 0; index < lines.length; index += 1) {\n if (FORWARD_MARKER.test(lines[index])) {\n start = index + 1\n break\n }\n if (/^\\s*\\*?From\\s*:/i.test(lines[index]) && !lines[index].trimStart().startsWith('>')) {\n const window = lines.slice(index, index + 8)\n if (window.some((line) => /^\\s*\\*?Subject\\s*:/i.test(line))) {\n start = index\n break\n }\n }\n }\n if (start < 0) return null\n let from: string | null = null\n let cursor = start\n // The header block: header lines, blank lines between them allowed, up to\n // the first line that is neither.\n let sawHeader = false\n while (cursor < lines.length) {\n const line = lines[cursor]\n const header = HEADER_LINE.exec(line)\n if (header) {\n sawHeader = true\n if (header[1].toLowerCase() === 'from') from = from ?? emailAddressOf(header[2])\n cursor += 1\n continue\n }\n if (!line.trim() && !sawHeader) {\n cursor += 1\n continue\n }\n if (!line.trim() && sawHeader) {\n // A blank line after a header run may precede more headers (Apple\n // Mail) or the body; look past it.\n const next = lines[cursor + 1] ?? ''\n if (HEADER_LINE.test(next)) {\n cursor += 1\n continue\n }\n cursor += 1\n break\n }\n break\n }\n return { from, body: lines.slice(cursor).join('\\n') }\n}\n\nconst QUOTE_INTRO = /^\\s*On\\b.{0,300}$/\nconst QUOTE_END = /wrote:\\s*$/i\nconst HISTORY_MARKERS = [\n /^\\s*>/,\n /^\\s*-{2,}\\s*Original Message\\s*-{2,}\\s*$/i,\n /^\\s*_{5,}\\s*$/,\n /^\\s*From:\\s.+$/,\n /^\\s*Sent from my\\b/i,\n /^\\s*Le .{0,200} a écrit\\s*:\\s*$/i,\n /^\\s*Am .{0,200} schrieb .{0,100}:\\s*$/i,\n]\n\n/**\n * The words above the quoted history: everything before the first `On …\n * wrote:` line, quote mark, \"Original Message\" rule or reply header block.\n * The intro may wrap onto a second line, so a line that begins `On` is\n * read together with the one after it.\n */\nexport function stripQuotedHistory(text: string): string {\n const lines = text.split('\\n')\n let end = lines.length\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index]\n if (HISTORY_MARKERS.some((marker) => marker.test(line))) {\n end = index\n break\n }\n if (QUOTE_INTRO.test(line)) {\n const joined = `${line} ${lines[index + 1] ?? ''}`\n if (QUOTE_END.test(line) || QUOTE_END.test(joined)) {\n end = index\n break\n }\n }\n }\n return lines.slice(0, end).join('\\n')\n}\n\n/**\n * What the timeline keeps of a captured message: the text part — or the\n * words of the HTML part when there is none — with a forward's header\n * block and the quoted history below the reply removed, whitespace\n * settled, bounded. Never the whole thread: the thread is in the mailbox,\n * and the row is a note that this exchange happened.\n */\nexport function crmInboundExcerpt(text: unknown, html?: unknown): string {\n let body = String(text ?? '')\n if (!body.trim() && html) body = htmlToPlainText(html)\n body = body.replace(/\\r\\n?/g, '\\n').replace(/\\u00a0/g, ' ')\n const forwarded = forwardedSection(body)\n if (forwarded) body = forwarded.body\n body = stripQuotedHistory(body)\n return body\n .split('\\n')\n .map((line) => line.replace(/[ \\t]+$/g, ''))\n .join('\\n')\n .replace(/\\n{3,}/g, '\\n\\n')\n .trim()\n .slice(0, CRM_INBOUND_EXCERPT_MAX)\n}\n\n/** One address the message might be with, in the order the rule tries them. */\nexport interface CrmInboundCandidate {\n email: string\n /** What a row filed on a match with this address says about the message. */\n direction: CrmEmailDirection\n /** Which header the address came from, for the spec and the log. */\n via: 'from' | 'to' | 'cc' | 'forwarded'\n}\n\n/** One member of the workspace, as the capture filer reads them. */\nexport interface CrmInboundMember extends MemberAddresses {\n uid: string\n /** The address they sign in with; `''` for a roster row that carries none. */\n email: string\n name?: string | null\n}\n\n/** A roster row as {@link crmInboundRoster} reads it — `AglynOrgMember`'s fields. */\nexport interface CrmInboundRosterRow {\n $id: string\n email?: string | null\n displayName?: string | null\n orgSuspended?: boolean\n}\n\n/**\n * The roster a captured message is matched against: every roster row that\n * does not carry the org's suspension flag, each with the address the\n * member signs in with and the aliases they have CONFIRMED, read off their\n * stored alias document by uid. The confirmed filter is applied here, from\n * the stored documents, so no caller can hand the rule an address a member\n * only typed. An alias document with no roster row beside it belongs to\n * somebody who is no longer a member, and is never read.\n */\nexport function crmInboundRoster(\n rows: readonly CrmInboundRosterRow[],\n aliasDocuments: ReadonlyMap<string, unknown>,\n): CrmInboundMember[] {\n const roster: CrmInboundMember[] = []\n for (const row of rows) {\n if (row.orgSuspended === true) continue\n const uid = String(row.$id ?? '')\n if (!uid) continue\n const email = normalizeContactEmail(row.email) ?? ''\n const verifiedAliases = verifiedMemberEmailAliases(aliasDocuments.get(uid))\n if (!email && !verifiedAliases.length) continue\n roster.push({\n uid,\n email,\n name: row.displayName ?? null,\n ...(verifiedAliases.length ? { verifiedAliases } : {}),\n })\n }\n return roster\n}\n\nexport interface CrmInboundCandidatesInput {\n from: unknown\n to: readonly unknown[]\n cc?: readonly unknown[]\n /** The forwarded block's `From:`, when the body carried one. */\n forwardedFrom?: unknown\n /** The capture domain, so the capture address itself is never a candidate. */\n domain: string\n /**\n * The workspace's roster. Every address that is a member's — the one\n * they sign in with and each alias they have confirmed — is theirs, and\n * none of them is ever a correspondent.\n */\n members: readonly MemberAddresses[]\n}\n\nexport interface CrmInboundCandidates {\n /** The normalized From, or `null` when the header carried no address. */\n sender: string | null\n /** Whether a member of the workspace wrote the message. */\n senderIsMember: boolean\n candidates: CrmInboundCandidate[]\n}\n\n/**\n * The addresses to try against the workspace's records, in order — see the\n * module comment — each already stamped with the direction a match would\n * mean: a message a member wrote went OUT to whoever it matches, and one\n * anybody else wrote came IN from them.\n */\nexport function crmInboundCandidates(input: CrmInboundCandidatesInput): CrmInboundCandidates {\n const members = new Set<string>()\n for (const member of input.members) {\n for (const address of memberEmailAddresses(member)) members.add(address)\n }\n const sender = emailAddressOf(input.from)\n const senderIsMember = sender !== null && members.has(sender)\n const seen = new Set<string>()\n const candidates: CrmInboundCandidate[] = []\n const consider = (\n value: unknown,\n direction: CrmEmailDirection,\n via: CrmInboundCandidate['via'],\n ) => {\n const email = emailAddressOf(value)\n if (!email || seen.has(email) || members.has(email)) return\n if (isCrmInboundAddress(email, input.domain)) return\n seen.add(email)\n candidates.push({ email, direction, via })\n }\n consider(input.from, 'inbound', 'from')\n const headed = senderIsMember ? 'outbound' : 'inbound'\n for (const value of input.to) consider(value, headed, 'to')\n for (const value of input.cc ?? []) consider(value, headed, 'cc')\n consider(input.forwardedFrom, 'inbound', 'forwarded')\n return { sender, senderIsMember, candidates }\n}\n\n/**\n * The key one message is filed under, so a second delivery of it is a\n * no-op: its `Message-ID`, which every mail client stamps and every relay\n * preserves, else the provider's own id, which a redelivery of one\n * webhook event repeats. `null` when the message has neither — a message\n * that cannot be told from its own redelivery is filed by a fresh id.\n */\nexport function crmCapturedEmailKey(messageId: unknown, providerId: unknown): string | null {\n const id = String(messageId ?? '').trim()\n if (id) return `mid:${id}`\n const provider = String(providerId ?? '').trim()\n return provider ? `provider:${provider}` : null\n}\n\n/** What a captured message is logged from — see {@link buildCrmCapturedEmailActivity}. */\nexport interface CrmCapturedEmailInput {\n direction: CrmEmailDirection\n subject: string\n /** The excerpt, already reduced by {@link crmInboundExcerpt}. */\n excerpt: string\n /** The address on the message's From. */\n from: string\n /** The address the message was addressed to, when one is worth showing. */\n to?: string | null\n messageId: string\n inReplyTo?: string | null\n /** When the message was received. */\n atMs: number\n /** The member who wrote it, or `''` for a message a correspondent wrote. */\n byUid: string\n byName?: string | null\n link: CrmActivityLink\n hostId: string\n visibleTo: readonly string[]\n}\n\n/**\n * The activity row a captured message is filed as (AGL-2657): `kind:\n * 'email'`, with the direction the match decided, the excerpt for a body,\n * and the thread facts a later reader groups by. No delivery state — the\n * platform did not send it and can say nothing about where it got to —\n * which is also how the timeline tells a captured send from a platform\n * send. The same shape `buildCrmEmailActivity` writes, so the timeline\n * draws both with one row.\n */\nexport function buildCrmCapturedEmailActivity(input: CrmCapturedEmailInput): CrmActivity {\n const { link } = input\n const subject = String(input.subject ?? '')\n .replace(/\\s+/g, ' ')\n .trim()\n .slice(0, CRM_EMAIL_SUBJECT_MAX)\n const inReplyTo = String(input.inReplyTo ?? '').trim()\n const to = String(input.to ?? '').trim()\n const byName = String(input.byName ?? '').trim()\n return {\n kind: 'email',\n subject,\n body: String(input.excerpt ?? '').slice(0, CRM_EMAIL_BODY_MAX),\n direction: input.direction,\n from: input.from,\n ...(to ? { to } : {}),\n messageId: String(input.messageId ?? '').trim(),\n ...(inReplyTo ? { inReplyTo } : {}),\n threadSubject: crmThreadSubject(subject),\n atMs: input.atMs,\n byUid: input.byUid,\n ...(byName ? { byName } : {}),\n ...(link.contactId ? { contactId: String(link.contactId) } : {}),\n ...(link.companyId ? { companyId: String(link.companyId) } : {}),\n ...(link.dealId ? { dealId: String(link.dealId) } : {}),\n ...(link.leadId ? { leadId: String(link.leadId) } : {}),\n hostId: input.hostId,\n visibleTo: [...input.visibleTo],\n }\n}\n"],"names":["normalizeContactEmail","CRM_EMAIL_BODY_MAX","CRM_EMAIL_SUBJECT_MAX","memberEmailAddresses","verifiedMemberEmailAliases","CRM_INBOUND_DEFAULT_DOMAIN","CRM_INBOUND_LOCAL_PART","CRM_INBOUND_TOKEN_LENGTH","CRM_INBOUND_EXCERPT_MAX","CRM_INBOUND_UNMATCHED_ACTION","CRM_INBOUND_CEILING_ACTION","TOKEN_ALPHABET","TOKEN_PATTERN","DOMAIN_PATTERN","crmInboundDomain","env","process","configured","String","trim","toLowerCase","test","mintCrmInboundToken","bytes","Uint8Array","globalThis","crypto","getRandomValues","token","byte","length","isCrmInboundToken","value","crmInboundAddress","domain","emailAddressOf","raw","angled","exec","emailDomainOf","address","at","lastIndexOf","slice","crmInboundTokenOf","recipient","local","match","RegExp","crmInboundTokensIn","recipients","tokens","includes","push","isCrmInboundAddress","crmThreadSubject","subject","replace","prefix","ENTITIES","amp","lt","gt","quot","apos","nbsp","htmlToPlainText","html","whole","code","startsWith","fromCodePoint","parseInt","FORWARD_MARKER","HEADER_LINE","forwardedSection","text","lines","split","start","index","trimStart","window","some","line","from","cursor","sawHeader","header","next","body","join","QUOTE_INTRO","QUOTE_END","HISTORY_MARKERS","stripQuotedHistory","end","marker","joined","crmInboundExcerpt","forwarded","map","crmInboundRoster","rows","aliasDocuments","roster","row","orgSuspended","uid","$id","email","verifiedAliases","get","name","displayName","crmInboundCandidates","input","members","Set","member","add","sender","senderIsMember","has","seen","candidates","consider","direction","via","headed","to","cc","forwardedFrom","crmCapturedEmailKey","messageId","providerId","id","provider","buildCrmCapturedEmailActivity","link","inReplyTo","byName","kind","excerpt","threadSubject","atMs","byUid","contactId","companyId","dealId","leadId","hostId","visibleTo"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,qBAAqB,QAAQ,gBAAY;AAClD,SACEC,kBAAkB,EAClBC,qBAAqB,QAIhB,WAAO;AACd,SAEEC,oBAAoB,EACpBC,0BAA0B,QACrB,4BAAwB;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GAED,qEAAqE,GACrE,OAAO,MAAMC,6BAA6B,eAAc;AAExD,uEAAuE,GACvE,OAAO,MAAMC,yBAAyB,MAAK;A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AAb3B,iBAAiB,IAAIzE,KAAK,CAAC,GAAG1C;QAC3C8H,WAAWX,MAAMW,SAAS;QAC1B1C,MAAM+B,MAAM/B,IAAI;OACZ6C,KAAK;QAAEA;IAAG,IAAI,CAAC;QACnBI,WAAWpH,QAAOkG,mBAAAA,MAAMkB,SAAS,YAAflB,mBAAmB,IAAIjG,IAAI;OACzCyH,YAAY;QAAEA;IAAU,IAAI,CAAC;QACjCI,eAAezF,iBAAiBC;QAChCyF,MAAM7B,MAAM6B,IAAI;QAChBC,OAAO9B,MAAM8B,KAAK;OACdL,SAAS;QAAEA;IAAO,IAAI,CAAC,GACvBF,KAAKQ,SAAS,GAAG;QAAEA,WAAWjI,OAAOyH,KAAKQ,SAAS;IAAE,IAAI,CAAC,GAC1DR,KAAKS,SAAS,GAAG;QAAEA,WAAWlI,OAAOyH,KAAKS,SAAS;IAAE,IAAI,CAAC,GAC1DT,KAAKU,MAAM,GAAG;QAAEA,QAAQnI,OAAOyH,KAAKU,MAAM;IAAE,IAAI,CAAC,GACjDV,KAAKW,MAAM,GAAG;QAAEA,QAAQpI,OAAOyH,KAAKW,MAAM;IAAE,IAAI,CAAC;QACrDC,QAAQnC,MAAMmC,MAAM;QACpBC,WAAW;eAAIpC,MAAMoC,SAAS;SAAC;;AAEnC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The CRM's fixed vocabularies — lifecycle stages, task kinds, activity
|
|
19
|
+
* kinds — and the guards that check a value against them.
|
|
20
|
+
*
|
|
21
|
+
* A leaf module with no imports, re-exported by `crm.ts`, so every existing
|
|
22
|
+
* `crm` import keeps working. It is separate because the actions builder
|
|
23
|
+
* validates an automation step against these lists, and the actions builder
|
|
24
|
+
* ships with the element renderer to every published page: importing them
|
|
25
|
+
* from `crm.ts` put the whole CRM record model — companies, deals, tasks,
|
|
26
|
+
* the contact facet helpers it reads — in front of every visitor to check a
|
|
27
|
+
* string against a four-item list.
|
|
28
|
+
*
|
|
29
|
+
* Only the lists, their types, their guards and the task horizon live here.
|
|
30
|
+
* The on-screen labels stay in `crm.ts`, beside the records they describe.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Where a person sits in the relationship, as one of a fixed list.
|
|
34
|
+
*
|
|
35
|
+
* A fixed list rather than free text so that a report can count people per
|
|
36
|
+
* stage and a filter can select one, and in the order a person usually moves
|
|
37
|
+
* through them so a picker reads as a progression. `other` is the escape
|
|
38
|
+
* hatch for a business whose funnel has a step none of these name; it is a
|
|
39
|
+
* deliberate stage, not an absent one.
|
|
40
|
+
*/
|
|
41
|
+
export declare const CONTACT_LIFECYCLE_STAGES: readonly ["subscriber", "lead", "marketing-qualified", "sales-qualified", "opportunity", "customer", "evangelist", "other"];
|
|
42
|
+
export type ContactLifecycleStage = (typeof CONTACT_LIFECYCLE_STAGES)[number];
|
|
43
|
+
export declare function isContactLifecycleStage(value: unknown): value is ContactLifecycleStage;
|
|
44
|
+
/**
|
|
45
|
+
* What a task is, as a fixed list.
|
|
46
|
+
*
|
|
47
|
+
* A const array rather than a bare union because two surfaces have to
|
|
48
|
+
* enumerate it — the task form's picker and the automation step that creates
|
|
49
|
+
* a task without a form — and a union cannot be iterated at run time.
|
|
50
|
+
*/
|
|
51
|
+
export declare const CRM_TASK_KINDS: readonly ["call", "email", "meeting", "todo"];
|
|
52
|
+
export type CrmTaskKind = (typeof CRM_TASK_KINDS)[number];
|
|
53
|
+
export declare function isCrmTaskKind(value: unknown): value is CrmTaskKind;
|
|
54
|
+
/**
|
|
55
|
+
* How far ahead an automation may date a task, in days.
|
|
56
|
+
*
|
|
57
|
+
* A year, because the longest follow-up anybody schedules from a trigger is
|
|
58
|
+
* an annual renewal check, and a task dated further out than that is one
|
|
59
|
+
* nobody will find on the list when it comes due.
|
|
60
|
+
*/
|
|
61
|
+
export declare const CRM_TASK_MAX_DUE_DAYS = 365;
|
|
62
|
+
/**
|
|
63
|
+
* What a person can log, in the order the picker offers them (AGL-2600).
|
|
64
|
+
*
|
|
65
|
+
* A fixed list rather than free text for the reason the lifecycle stages are
|
|
66
|
+
* one: a report counts calls per week and a filter selects meetings, and
|
|
67
|
+
* neither can be done over a string somebody typed. `note` is the plain
|
|
68
|
+
* entry — something worth writing down that was not a conversation — and
|
|
69
|
+
* `other` the escape hatch for the kind none of these name.
|
|
70
|
+
*/
|
|
71
|
+
export declare const CRM_ACTIVITY_KINDS: readonly ["call", "email", "meeting", "note", "other"];
|
|
72
|
+
export type CrmActivityKind = (typeof CRM_ACTIVITY_KINDS)[number];
|
|
73
|
+
export declare function isCrmActivityKind(value: unknown): value is CrmActivityKind;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /**
|
|
17
|
+
* The CRM's fixed vocabularies — lifecycle stages, task kinds, activity
|
|
18
|
+
* kinds — and the guards that check a value against them.
|
|
19
|
+
*
|
|
20
|
+
* A leaf module with no imports, re-exported by `crm.ts`, so every existing
|
|
21
|
+
* `crm` import keeps working. It is separate because the actions builder
|
|
22
|
+
* validates an automation step against these lists, and the actions builder
|
|
23
|
+
* ships with the element renderer to every published page: importing them
|
|
24
|
+
* from `crm.ts` put the whole CRM record model — companies, deals, tasks,
|
|
25
|
+
* the contact facet helpers it reads — in front of every visitor to check a
|
|
26
|
+
* string against a four-item list.
|
|
27
|
+
*
|
|
28
|
+
* Only the lists, their types, their guards and the task horizon live here.
|
|
29
|
+
* The on-screen labels stay in `crm.ts`, beside the records they describe.
|
|
30
|
+
*/ /**
|
|
31
|
+
* Where a person sits in the relationship, as one of a fixed list.
|
|
32
|
+
*
|
|
33
|
+
* A fixed list rather than free text so that a report can count people per
|
|
34
|
+
* stage and a filter can select one, and in the order a person usually moves
|
|
35
|
+
* through them so a picker reads as a progression. `other` is the escape
|
|
36
|
+
* hatch for a business whose funnel has a step none of these name; it is a
|
|
37
|
+
* deliberate stage, not an absent one.
|
|
38
|
+
*/ export const CONTACT_LIFECYCLE_STAGES = [
|
|
39
|
+
'subscriber',
|
|
40
|
+
'lead',
|
|
41
|
+
'marketing-qualified',
|
|
42
|
+
'sales-qualified',
|
|
43
|
+
'opportunity',
|
|
44
|
+
'customer',
|
|
45
|
+
'evangelist',
|
|
46
|
+
'other'
|
|
47
|
+
];
|
|
48
|
+
export function isContactLifecycleStage(value) {
|
|
49
|
+
return typeof value === 'string' && CONTACT_LIFECYCLE_STAGES.includes(value);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* What a task is, as a fixed list.
|
|
53
|
+
*
|
|
54
|
+
* A const array rather than a bare union because two surfaces have to
|
|
55
|
+
* enumerate it — the task form's picker and the automation step that creates
|
|
56
|
+
* a task without a form — and a union cannot be iterated at run time.
|
|
57
|
+
*/ export const CRM_TASK_KINDS = [
|
|
58
|
+
'call',
|
|
59
|
+
'email',
|
|
60
|
+
'meeting',
|
|
61
|
+
'todo'
|
|
62
|
+
];
|
|
63
|
+
export function isCrmTaskKind(value) {
|
|
64
|
+
return typeof value === 'string' && CRM_TASK_KINDS.includes(value);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* How far ahead an automation may date a task, in days.
|
|
68
|
+
*
|
|
69
|
+
* A year, because the longest follow-up anybody schedules from a trigger is
|
|
70
|
+
* an annual renewal check, and a task dated further out than that is one
|
|
71
|
+
* nobody will find on the list when it comes due.
|
|
72
|
+
*/ export const CRM_TASK_MAX_DUE_DAYS = 365;
|
|
73
|
+
/**
|
|
74
|
+
* What a person can log, in the order the picker offers them (AGL-2600).
|
|
75
|
+
*
|
|
76
|
+
* A fixed list rather than free text for the reason the lifecycle stages are
|
|
77
|
+
* one: a report counts calls per week and a filter selects meetings, and
|
|
78
|
+
* neither can be done over a string somebody typed. `note` is the plain
|
|
79
|
+
* entry — something worth writing down that was not a conversation — and
|
|
80
|
+
* `other` the escape hatch for the kind none of these name.
|
|
81
|
+
*/ export const CRM_ACTIVITY_KINDS = [
|
|
82
|
+
'call',
|
|
83
|
+
'email',
|
|
84
|
+
'meeting',
|
|
85
|
+
'note',
|
|
86
|
+
'other'
|
|
87
|
+
];
|
|
88
|
+
export function isCrmActivityKind(value) {
|
|
89
|
+
return typeof value === 'string' && CRM_ACTIVITY_KINDS.includes(value);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=crm-kinds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/crm-kinds.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The CRM's fixed vocabularies — lifecycle stages, task kinds, activity\n * kinds — and the guards that check a value against them.\n *\n * A leaf module with no imports, re-exported by `crm.ts`, so every existing\n * `crm` import keeps working. It is separate because the actions builder\n * validates an automation step against these lists, and the actions builder\n * ships with the element renderer to every published page: importing them\n * from `crm.ts` put the whole CRM record model — companies, deals, tasks,\n * the contact facet helpers it reads — in front of every visitor to check a\n * string against a four-item list.\n *\n * Only the lists, their types, their guards and the task horizon live here.\n * The on-screen labels stay in `crm.ts`, beside the records they describe.\n */\n\n/**\n * Where a person sits in the relationship, as one of a fixed list.\n *\n * A fixed list rather than free text so that a report can count people per\n * stage and a filter can select one, and in the order a person usually moves\n * through them so a picker reads as a progression. `other` is the escape\n * hatch for a business whose funnel has a step none of these name; it is a\n * deliberate stage, not an absent one.\n */\nexport const CONTACT_LIFECYCLE_STAGES = [\n 'subscriber',\n 'lead',\n 'marketing-qualified',\n 'sales-qualified',\n 'opportunity',\n 'customer',\n 'evangelist',\n 'other',\n] as const\n\nexport type ContactLifecycleStage = (typeof CONTACT_LIFECYCLE_STAGES)[number]\n\nexport function isContactLifecycleStage(\n value: unknown,\n): value is ContactLifecycleStage {\n return (\n typeof value === 'string' &&\n (CONTACT_LIFECYCLE_STAGES as readonly string[]).includes(value)\n )\n}\n\n/**\n * What a task is, as a fixed list.\n *\n * A const array rather than a bare union because two surfaces have to\n * enumerate it — the task form's picker and the automation step that creates\n * a task without a form — and a union cannot be iterated at run time.\n */\nexport const CRM_TASK_KINDS = ['call', 'email', 'meeting', 'todo'] as const\nexport type CrmTaskKind = (typeof CRM_TASK_KINDS)[number]\n\nexport function isCrmTaskKind(value: unknown): value is CrmTaskKind {\n return (\n typeof value === 'string' &&\n (CRM_TASK_KINDS as readonly string[]).includes(value)\n )\n}\n\n/**\n * How far ahead an automation may date a task, in days.\n *\n * A year, because the longest follow-up anybody schedules from a trigger is\n * an annual renewal check, and a task dated further out than that is one\n * nobody will find on the list when it comes due.\n */\nexport const CRM_TASK_MAX_DUE_DAYS = 365\n\n/**\n * What a person can log, in the order the picker offers them (AGL-2600).\n *\n * A fixed list rather than free text for the reason the lifecycle stages are\n * one: a report counts calls per week and a filter selects meetings, and\n * neither can be done over a string somebody typed. `note` is the plain\n * entry — something worth writing down that was not a conversation — and\n * `other` the escape hatch for the kind none of these name.\n */\nexport const CRM_ACTIVITY_KINDS = ['call', 'email', 'meeting', 'note', 'other'] as const\n\nexport type CrmActivityKind = (typeof CRM_ACTIVITY_KINDS)[number]\n\nexport function isCrmActivityKind(value: unknown): value is CrmActivityKind {\n return (\n typeof value === 'string' &&\n (CRM_ACTIVITY_KINDS as readonly string[]).includes(value)\n )\n}\n"],"names":["CONTACT_LIFECYCLE_STAGES","isContactLifecycleStage","value","includes","CRM_TASK_KINDS","isCrmTaskKind","CRM_TASK_MAX_DUE_DAYS","CRM_ACTIVITY_KINDS","isCrmActivityKind"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;CAcC,GAED;;;;;;;;CAQC,GACD,OAAO,MAAMA,2BAA2B;IACtC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAS;AAIV,OAAO,SAASC,wBACdC,KAAc;IAEd,OACE,OAAOA,UAAU,YACjB,AAACF,yBAA+CG,QAAQ,CAACD;AAE7D;AAEA;;;;;;CAMC,GACD,OAAO,MAAME,iBAAiB;IAAC;IAAQ;IAAS;IAAW;CAAO,CAAS;AAG3E,OAAO,SAASC,cAAcH,KAAc;IAC1C,OACE,OAAOA,UAAU,YACjB,AAACE,eAAqCD,QAAQ,CAACD;AAEnD;AAEA;;;;;;CAMC,GACD,OAAO,MAAMI,wBAAwB,IAAG;AAExC;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAqB;IAAC;IAAQ;IAAS;IAAW;IAAQ;CAAQ,CAAS;AAIxF,OAAO,SAASC,kBAAkBN,KAAc;IAC9C,OACE,OAAOA,UAAU,YACjB,AAACK,mBAAyCJ,QAAQ,CAACD;AAEvD"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* NEXT ACTIVITY (AGL-2661): when the earliest open task against a record
|
|
19
|
+
* is due, denormalized onto the record as `nextTaskAtMs`.
|
|
20
|
+
*
|
|
21
|
+
* The question a sales manager asks of a LIST — "which deals have nothing
|
|
22
|
+
* scheduled?" — cannot be answered by a task query per row, so every
|
|
23
|
+
* contact, company and deal carries the answer. This module is the pure
|
|
24
|
+
* half: what the value IS given a record's open tasks, how a stored one is
|
|
25
|
+
* read back, the view clause a list filters on, and the report figure. The
|
|
26
|
+
* admin library's `recomputeCrmNextTaskAt` is the writer; the console's
|
|
27
|
+
* route is its door for client-direct task writes.
|
|
28
|
+
*/
|
|
29
|
+
import type { CrmDeal, CrmTask, CrmViewFilterClause } from './crm';
|
|
30
|
+
/** The field on a contact, a company and a deal — the one name every list reads. */
|
|
31
|
+
export declare const CRM_NEXT_ACTIVITY_FIELD = "nextTaskAtMs";
|
|
32
|
+
/**
|
|
33
|
+
* The records one task can be filed against — the ids a recompute reads
|
|
34
|
+
* off a task, and the three collections it writes to.
|
|
35
|
+
*/
|
|
36
|
+
export interface CrmNextActivityLink {
|
|
37
|
+
contactId?: string;
|
|
38
|
+
companyId?: string;
|
|
39
|
+
dealId?: string;
|
|
40
|
+
}
|
|
41
|
+
/** How the collections are keyed on a task, in the order a recompute walks them. */
|
|
42
|
+
export declare const CRM_NEXT_ACTIVITY_LINK_FIELDS: readonly ["contactId", "companyId", "dealId"];
|
|
43
|
+
export type CrmNextActivityLinkField = (typeof CRM_NEXT_ACTIVITY_LINK_FIELDS)[number];
|
|
44
|
+
/**
|
|
45
|
+
* When the earliest OPEN task in the list is due, or `null`.
|
|
46
|
+
*
|
|
47
|
+
* Only an open task with a finite due time counts: a done task is history,
|
|
48
|
+
* and an open one with no date is a to-do with no "next" about it — the
|
|
49
|
+
* record's next activity is unknown rather than immediate, and `null`
|
|
50
|
+
* says so. A pre-change writer never produced a time outside the finite
|
|
51
|
+
* range, but a stored `dueAtMs` is trusted no further than that.
|
|
52
|
+
*/
|
|
53
|
+
export declare function nextTaskAtMsOf(tasks: readonly Pick<CrmTask, 'status' | 'dueAtMs'>[]): number | null;
|
|
54
|
+
/**
|
|
55
|
+
* A stored `nextTaskAtMs`, read back: a finite positive number, else
|
|
56
|
+
* `null`. Absent — a record written before the field existed — reads as
|
|
57
|
+
* `null` too, because to every reader "not yet computed" and "nothing
|
|
58
|
+
* scheduled" draw the same dash; the Fields section's recompute is what
|
|
59
|
+
* closes the gap for a filter that asks the store rather than the row.
|
|
60
|
+
*/
|
|
61
|
+
export declare function readNextTaskAtMs(record: {
|
|
62
|
+
nextTaskAtMs?: unknown;
|
|
63
|
+
} | null | undefined): number | null;
|
|
64
|
+
/** Whether nothing is scheduled against the record — the "stuck" test. */
|
|
65
|
+
export declare function hasNoNextActivity(record: {
|
|
66
|
+
nextTaskAtMs?: unknown;
|
|
67
|
+
} | null | undefined): boolean;
|
|
68
|
+
/** The links one task carries, with the blanks left out. */
|
|
69
|
+
export declare function nextActivityLinksOfTask(task: Partial<Pick<CrmTask, CrmNextActivityLinkField>> | null | undefined): CrmNextActivityLink;
|
|
70
|
+
/**
|
|
71
|
+
* Several links as one per record, so a bulk action over forty tasks on
|
|
72
|
+
* one deal recomputes that deal once. Order is first-seen.
|
|
73
|
+
*/
|
|
74
|
+
export declare function mergeNextActivityLinks(links: readonly (CrmNextActivityLink | null | undefined)[]): Array<{
|
|
75
|
+
field: CrmNextActivityLinkField;
|
|
76
|
+
id: string;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* The saved-view clause "No next activity" is stored as — one clause,
|
|
80
|
+
* spelled once, so the toggle a list draws and the matcher it runs agree
|
|
81
|
+
* on the name. `isEmpty` is honest here: a recompute writes `null` for a
|
|
82
|
+
* record with nothing scheduled, and a record never written reads blank
|
|
83
|
+
* too (see `readNextTaskAtMs`).
|
|
84
|
+
*/
|
|
85
|
+
export declare const CRM_NO_NEXT_ACTIVITY_CLAUSE: Readonly<CrmViewFilterClause>;
|
|
86
|
+
export declare function isNoNextActivityClause(clause: Pick<CrmViewFilterClause, 'field' | 'op'>): boolean;
|
|
87
|
+
/** A view's filters with the clause switched on or off, the rest untouched. */
|
|
88
|
+
export declare function withNoNextActivity(filters: readonly CrmViewFilterClause[], on: boolean): CrmViewFilterClause[];
|
|
89
|
+
/**
|
|
90
|
+
* The rows a "No next activity" clause keeps: every one when the view does
|
|
91
|
+
* not carry it, else those with nothing scheduled. What a list that
|
|
92
|
+
* filters through a query — companies, deals — runs over the page it
|
|
93
|
+
* loaded, the way the contacts list runs its window-only clauses.
|
|
94
|
+
*/
|
|
95
|
+
export declare function filterByNextActivity<T extends {
|
|
96
|
+
nextTaskAtMs?: unknown;
|
|
97
|
+
}>(rows: readonly T[], filters: readonly CrmViewFilterClause[]): T[];
|
|
98
|
+
/**
|
|
99
|
+
* The report figure: how many OPEN deals have nothing scheduled, and which
|
|
100
|
+
* (AGL-2661). A won deal needs no next step and a lost one has none, so
|
|
101
|
+
* only open deals are stuck; the caller hands in the window it already
|
|
102
|
+
* reads for the pipeline card, so this costs no read of its own.
|
|
103
|
+
*/
|
|
104
|
+
export declare function stuckDeals<T extends Pick<CrmDeal, 'status' | 'nextTaskAtMs'>>(deals: readonly T[]): {
|
|
105
|
+
count: number;
|
|
106
|
+
deals: T[];
|
|
107
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /**
|
|
17
|
+
* NEXT ACTIVITY (AGL-2661): when the earliest open task against a record
|
|
18
|
+
* is due, denormalized onto the record as `nextTaskAtMs`.
|
|
19
|
+
*
|
|
20
|
+
* The question a sales manager asks of a LIST — "which deals have nothing
|
|
21
|
+
* scheduled?" — cannot be answered by a task query per row, so every
|
|
22
|
+
* contact, company and deal carries the answer. This module is the pure
|
|
23
|
+
* half: what the value IS given a record's open tasks, how a stored one is
|
|
24
|
+
* read back, the view clause a list filters on, and the report figure. The
|
|
25
|
+
* admin library's `recomputeCrmNextTaskAt` is the writer; the console's
|
|
26
|
+
* route is its door for client-direct task writes.
|
|
27
|
+
*/ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
28
|
+
/** The field on a contact, a company and a deal — the one name every list reads. */ export const CRM_NEXT_ACTIVITY_FIELD = 'nextTaskAtMs';
|
|
29
|
+
/** How the collections are keyed on a task, in the order a recompute walks them. */ export const CRM_NEXT_ACTIVITY_LINK_FIELDS = [
|
|
30
|
+
'contactId',
|
|
31
|
+
'companyId',
|
|
32
|
+
'dealId'
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* When the earliest OPEN task in the list is due, or `null`.
|
|
36
|
+
*
|
|
37
|
+
* Only an open task with a finite due time counts: a done task is history,
|
|
38
|
+
* and an open one with no date is a to-do with no "next" about it — the
|
|
39
|
+
* record's next activity is unknown rather than immediate, and `null`
|
|
40
|
+
* says so. A pre-change writer never produced a time outside the finite
|
|
41
|
+
* range, but a stored `dueAtMs` is trusted no further than that.
|
|
42
|
+
*/ export function nextTaskAtMsOf(tasks) {
|
|
43
|
+
let earliest = null;
|
|
44
|
+
for (const task of tasks){
|
|
45
|
+
if (task.status !== 'open') continue;
|
|
46
|
+
const due = task.dueAtMs;
|
|
47
|
+
if (typeof due !== 'number' || !Number.isFinite(due)) continue;
|
|
48
|
+
if (earliest === null || due < earliest) earliest = due;
|
|
49
|
+
}
|
|
50
|
+
return earliest;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A stored `nextTaskAtMs`, read back: a finite positive number, else
|
|
54
|
+
* `null`. Absent — a record written before the field existed — reads as
|
|
55
|
+
* `null` too, because to every reader "not yet computed" and "nothing
|
|
56
|
+
* scheduled" draw the same dash; the Fields section's recompute is what
|
|
57
|
+
* closes the gap for a filter that asks the store rather than the row.
|
|
58
|
+
*/ export function readNextTaskAtMs(record) {
|
|
59
|
+
const value = record == null ? void 0 : record.nextTaskAtMs;
|
|
60
|
+
return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : null;
|
|
61
|
+
}
|
|
62
|
+
/** Whether nothing is scheduled against the record — the "stuck" test. */ export function hasNoNextActivity(record) {
|
|
63
|
+
return readNextTaskAtMs(record) === null;
|
|
64
|
+
}
|
|
65
|
+
/** The links one task carries, with the blanks left out. */ export function nextActivityLinksOfTask(task) {
|
|
66
|
+
const link = {};
|
|
67
|
+
for (const field of CRM_NEXT_ACTIVITY_LINK_FIELDS){
|
|
68
|
+
var _ref;
|
|
69
|
+
const id = String((_ref = task == null ? void 0 : task[field]) != null ? _ref : '').trim();
|
|
70
|
+
if (id) link[field] = id;
|
|
71
|
+
}
|
|
72
|
+
return link;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Several links as one per record, so a bulk action over forty tasks on
|
|
76
|
+
* one deal recomputes that deal once. Order is first-seen.
|
|
77
|
+
*/ export function mergeNextActivityLinks(links) {
|
|
78
|
+
const seen = new Set();
|
|
79
|
+
const merged = [];
|
|
80
|
+
for (const link of links){
|
|
81
|
+
for (const field of CRM_NEXT_ACTIVITY_LINK_FIELDS){
|
|
82
|
+
var _ref;
|
|
83
|
+
const id = String((_ref = link == null ? void 0 : link[field]) != null ? _ref : '').trim();
|
|
84
|
+
if (!id) continue;
|
|
85
|
+
const key = `${field}:${id}`;
|
|
86
|
+
if (seen.has(key)) continue;
|
|
87
|
+
seen.add(key);
|
|
88
|
+
merged.push({
|
|
89
|
+
field,
|
|
90
|
+
id
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return merged;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The saved-view clause "No next activity" is stored as — one clause,
|
|
98
|
+
* spelled once, so the toggle a list draws and the matcher it runs agree
|
|
99
|
+
* on the name. `isEmpty` is honest here: a recompute writes `null` for a
|
|
100
|
+
* record with nothing scheduled, and a record never written reads blank
|
|
101
|
+
* too (see `readNextTaskAtMs`).
|
|
102
|
+
*/ export const CRM_NO_NEXT_ACTIVITY_CLAUSE = Object.freeze({
|
|
103
|
+
field: CRM_NEXT_ACTIVITY_FIELD,
|
|
104
|
+
op: 'isEmpty',
|
|
105
|
+
value: ''
|
|
106
|
+
});
|
|
107
|
+
export function isNoNextActivityClause(clause) {
|
|
108
|
+
return clause.field === CRM_NEXT_ACTIVITY_FIELD && clause.op === 'isEmpty';
|
|
109
|
+
}
|
|
110
|
+
/** A view's filters with the clause switched on or off, the rest untouched. */ export function withNoNextActivity(filters, on) {
|
|
111
|
+
const rest = filters.filter((clause)=>!isNoNextActivityClause(clause));
|
|
112
|
+
return on ? [
|
|
113
|
+
...rest,
|
|
114
|
+
_extends({}, CRM_NO_NEXT_ACTIVITY_CLAUSE)
|
|
115
|
+
] : rest;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The rows a "No next activity" clause keeps: every one when the view does
|
|
119
|
+
* not carry it, else those with nothing scheduled. What a list that
|
|
120
|
+
* filters through a query — companies, deals — runs over the page it
|
|
121
|
+
* loaded, the way the contacts list runs its window-only clauses.
|
|
122
|
+
*/ export function filterByNextActivity(rows, filters) {
|
|
123
|
+
return filters.some(isNoNextActivityClause) ? rows.filter(hasNoNextActivity) : [
|
|
124
|
+
...rows
|
|
125
|
+
];
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The report figure: how many OPEN deals have nothing scheduled, and which
|
|
129
|
+
* (AGL-2661). A won deal needs no next step and a lost one has none, so
|
|
130
|
+
* only open deals are stuck; the caller hands in the window it already
|
|
131
|
+
* reads for the pipeline card, so this costs no read of its own.
|
|
132
|
+
*/ export function stuckDeals(deals) {
|
|
133
|
+
const stuck = deals.filter((deal)=>deal.status === 'open' && hasNoNextActivity(deal));
|
|
134
|
+
return {
|
|
135
|
+
count: stuck.length,
|
|
136
|
+
deals: stuck
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=crm-next-activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/crm-next-activity.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * NEXT ACTIVITY (AGL-2661): when the earliest open task against a record\n * is due, denormalized onto the record as `nextTaskAtMs`.\n *\n * The question a sales manager asks of a LIST — \"which deals have nothing\n * scheduled?\" — cannot be answered by a task query per row, so every\n * contact, company and deal carries the answer. This module is the pure\n * half: what the value IS given a record's open tasks, how a stored one is\n * read back, the view clause a list filters on, and the report figure. The\n * admin library's `recomputeCrmNextTaskAt` is the writer; the console's\n * route is its door for client-direct task writes.\n */\n\nimport type { CrmDeal, CrmTask, CrmViewFilterClause } from './crm'\n\n/** The field on a contact, a company and a deal — the one name every list reads. */\nexport const CRM_NEXT_ACTIVITY_FIELD = 'nextTaskAtMs'\n\n/**\n * The records one task can be filed against — the ids a recompute reads\n * off a task, and the three collections it writes to.\n */\nexport interface CrmNextActivityLink {\n contactId?: string\n companyId?: string\n dealId?: string\n}\n\n/** How the collections are keyed on a task, in the order a recompute walks them. */\nexport const CRM_NEXT_ACTIVITY_LINK_FIELDS = ['contactId', 'companyId', 'dealId'] as const\n\nexport type CrmNextActivityLinkField = (typeof CRM_NEXT_ACTIVITY_LINK_FIELDS)[number]\n\n/**\n * When the earliest OPEN task in the list is due, or `null`.\n *\n * Only an open task with a finite due time counts: a done task is history,\n * and an open one with no date is a to-do with no \"next\" about it — the\n * record's next activity is unknown rather than immediate, and `null`\n * says so. A pre-change writer never produced a time outside the finite\n * range, but a stored `dueAtMs` is trusted no further than that.\n */\nexport function nextTaskAtMsOf(\n tasks: readonly Pick<CrmTask, 'status' | 'dueAtMs'>[],\n): number | null {\n let earliest: number | null = null\n for (const task of tasks) {\n if (task.status !== 'open') continue\n const due = task.dueAtMs\n if (typeof due !== 'number' || !Number.isFinite(due)) continue\n if (earliest === null || due < earliest) earliest = due\n }\n return earliest\n}\n\n/**\n * A stored `nextTaskAtMs`, read back: a finite positive number, else\n * `null`. Absent — a record written before the field existed — reads as\n * `null` too, because to every reader \"not yet computed\" and \"nothing\n * scheduled\" draw the same dash; the Fields section's recompute is what\n * closes the gap for a filter that asks the store rather than the row.\n */\nexport function readNextTaskAtMs(\n record: { nextTaskAtMs?: unknown } | null | undefined,\n): number | null {\n const value = record?.nextTaskAtMs\n return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : null\n}\n\n/** Whether nothing is scheduled against the record — the \"stuck\" test. */\nexport function hasNoNextActivity(\n record: { nextTaskAtMs?: unknown } | null | undefined,\n): boolean {\n return readNextTaskAtMs(record) === null\n}\n\n/** The links one task carries, with the blanks left out. */\nexport function nextActivityLinksOfTask(\n task: Partial<Pick<CrmTask, CrmNextActivityLinkField>> | null | undefined,\n): CrmNextActivityLink {\n const link: CrmNextActivityLink = {}\n for (const field of CRM_NEXT_ACTIVITY_LINK_FIELDS) {\n const id = String(task?.[field] ?? '').trim()\n if (id) link[field] = id\n }\n return link\n}\n\n/**\n * Several links as one per record, so a bulk action over forty tasks on\n * one deal recomputes that deal once. Order is first-seen.\n */\nexport function mergeNextActivityLinks(\n links: readonly (CrmNextActivityLink | null | undefined)[],\n): Array<{ field: CrmNextActivityLinkField; id: string }> {\n const seen = new Set<string>()\n const merged: Array<{ field: CrmNextActivityLinkField; id: string }> = []\n for (const link of links) {\n for (const field of CRM_NEXT_ACTIVITY_LINK_FIELDS) {\n const id = String(link?.[field] ?? '').trim()\n if (!id) continue\n const key = `${field}:${id}`\n if (seen.has(key)) continue\n seen.add(key)\n merged.push({ field, id })\n }\n }\n return merged\n}\n\n/**\n * The saved-view clause \"No next activity\" is stored as — one clause,\n * spelled once, so the toggle a list draws and the matcher it runs agree\n * on the name. `isEmpty` is honest here: a recompute writes `null` for a\n * record with nothing scheduled, and a record never written reads blank\n * too (see `readNextTaskAtMs`).\n */\nexport const CRM_NO_NEXT_ACTIVITY_CLAUSE: Readonly<CrmViewFilterClause> = Object.freeze({\n field: CRM_NEXT_ACTIVITY_FIELD,\n op: 'isEmpty',\n value: '',\n})\n\nexport function isNoNextActivityClause(clause: Pick<CrmViewFilterClause, 'field' | 'op'>): boolean {\n return clause.field === CRM_NEXT_ACTIVITY_FIELD && clause.op === 'isEmpty'\n}\n\n/** A view's filters with the clause switched on or off, the rest untouched. */\nexport function withNoNextActivity(\n filters: readonly CrmViewFilterClause[],\n on: boolean,\n): CrmViewFilterClause[] {\n const rest = filters.filter((clause) => !isNoNextActivityClause(clause))\n return on ? [...rest, { ...CRM_NO_NEXT_ACTIVITY_CLAUSE }] : rest\n}\n\n/**\n * The rows a \"No next activity\" clause keeps: every one when the view does\n * not carry it, else those with nothing scheduled. What a list that\n * filters through a query — companies, deals — runs over the page it\n * loaded, the way the contacts list runs its window-only clauses.\n */\nexport function filterByNextActivity<T extends { nextTaskAtMs?: unknown }>(\n rows: readonly T[],\n filters: readonly CrmViewFilterClause[],\n): T[] {\n return filters.some(isNoNextActivityClause) ? rows.filter(hasNoNextActivity) : [...rows]\n}\n\n/**\n * The report figure: how many OPEN deals have nothing scheduled, and which\n * (AGL-2661). A won deal needs no next step and a lost one has none, so\n * only open deals are stuck; the caller hands in the window it already\n * reads for the pipeline card, so this costs no read of its own.\n */\nexport function stuckDeals<T extends Pick<CrmDeal, 'status' | 'nextTaskAtMs'>>(\n deals: readonly T[],\n): { count: number; deals: T[] } {\n const stuck = deals.filter((deal) => deal.status === 'open' && hasNoNextActivity(deal))\n return { count: stuck.length, deals: stuck }\n}\n"],"names":["CRM_NEXT_ACTIVITY_FIELD","CRM_NEXT_ACTIVITY_LINK_FIELDS","nextTaskAtMsOf","tasks","earliest","task","status","due","dueAtMs","Number","isFinite","readNextTaskAtMs","record","value","nextTaskAtMs","hasNoNextActivity","nextActivityLinksOfTask","link","field","id","String","trim","mergeNextActivityLinks","links","seen","Set","merged","key","has","add","push","CRM_NO_NEXT_ACTIVITY_CLAUSE","Object","freeze","op","isNoNextActivityClause","clause","withNoNextActivity","filters","on","rest","filter","filterByNextActivity","rows","some","stuckDeals","deals","stuck","deal","count","length"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;CAWC;AAID,kFAAkF,GAClF,OAAO,MAAMA,0BAA0B,eAAc;AAYrD,kFAAkF,GAClF,OAAO,MAAMC,gCAAgC;IAAC;IAAa;IAAa;CAAS,CAAS;AAI1F;;;;;;;;CAQC,GACD,OAAO,SAASC,eACdC,KAAqD;IAErD,IAAIC,WAA0B;IAC9B,KAAK,MAAMC,QAAQF,MAAO;QACxB,IAAIE,KAAKC,MAAM,KAAK,QAAQ;QAC5B,MAAMC,MAAMF,KAAKG,OAAO;QACxB,IAAI,OAAOD,QAAQ,YAAY,CAACE,OAAOC,QAAQ,CAACH,MAAM;QACtD,IAAIH,aAAa,QAAQG,MAAMH,UAAUA,WAAWG;IACtD;IACA,OAAOH;AACT;AAEA;;;;;;CAMC,GACD,OAAO,SAASO,iBACdC,MAAqD;IAErD,MAAMC,QAAQD,0BAAAA,OAAQE,YAAY;IAClC,OAAO,OAAOD,UAAU,YAAYJ,OAAOC,QAAQ,CAACG,UAAUA,QAAQ,IAAIA,QAAQ;AACpF;AAEA,wEAAwE,GACxE,OAAO,SAASE,kBACdH,MAAqD;IAErD,OAAOD,iBAAiBC,YAAY;AACtC;AAEA,0DAA0D,GAC1D,OAAO,SAASI,wBACdX,IAAyE;IAEzE,MAAMY,OAA4B,CAAC;IACnC,KAAK,MAAMC,SAASjB,8BAA+B;;QACjD,MAAMkB,KAAKC,eAAOf,wBAAAA,IAAM,CAACa,MAAM,mBAAI,IAAIG,IAAI;QAC3C,IAAIF,IAAIF,IAAI,CAACC,MAAM,GAAGC;IACxB;IACA,OAAOF;AACT;AA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