@aglyn/aglyn 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/aglyn",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -37,16 +37,16 @@
37
37
  "./package.json": "./package.json"
38
38
  },
39
39
  "dependencies": {
40
- "@aglyn/shared-data-enums": "1.13.0",
41
- "@aglyn/shared-data-mdi": "1.13.0",
42
- "@aglyn/shared-data-types": "1.13.0",
43
- "@aglyn/shared-util-email": "1.13.0",
44
- "@aglyn/shared-util-first-touch": "1.13.0",
45
- "@aglyn/shared-util-http": "1.13.0",
46
- "@aglyn/shared-util-logger": "1.13.0",
47
- "@aglyn/shared-util-timestamp": "1.13.0",
48
- "@aglyn/shared-util-tools": "1.13.0",
49
- "@aglyn/shared-util-vendor": "1.13.0",
40
+ "@aglyn/shared-data-enums": "1.14.0",
41
+ "@aglyn/shared-data-mdi": "1.14.0",
42
+ "@aglyn/shared-data-types": "1.14.0",
43
+ "@aglyn/shared-util-email": "1.14.0",
44
+ "@aglyn/shared-util-first-touch": "1.14.0",
45
+ "@aglyn/shared-util-http": "1.14.0",
46
+ "@aglyn/shared-util-logger": "1.14.0",
47
+ "@aglyn/shared-util-timestamp": "1.14.0",
48
+ "@aglyn/shared-util-tools": "1.14.0",
49
+ "@aglyn/shared-util-vendor": "1.14.0",
50
50
  "@data-driven-forms/react-form-renderer": "^4.2.0",
51
51
  "@msgpack/msgpack": "^3.1.3",
52
52
  "@types/unist": "^3.0.3",
@@ -45,12 +45,12 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
45
45
  */ import { normalizeAddress, normalizePhone } from "../foundation/definitions/contact.types.js";
46
46
  import { consentGroupScope } from "./consent-groups.js";
47
47
  import { CONTACT_LIFECYCLE_STAGES, CRM_TASK_KINDS, isContactLifecycleStage } from "./crm-kinds.js";
48
- import { CONTACT_ALTERNATE_EMAILS_FIELD, CONTACT_FACETS_FIELD, CONTACT_SOURCE_LABELS, composeContactName, normalizeContactEmail, readContactFacet } from "./contacts.js";
48
+ import { CONTACT_ALTERNATE_EMAILS_FIELD, CONTACT_FACETS_FIELD, composeContactName, normalizeContactEmail, readContactFacet } from "./contacts.js";
49
49
  import { isEmailStateStatus } from "./email-state.js";
50
50
  import { NAME_TOKEN_MAX_PREFIX, nameSearchKey, nameSearchTokens, SCOPED_SEARCH_JOIN, scopedSearchTokens } from "./name-search.js";
51
51
  import { effectivePicklistValueSet, isStandardPicklistValueId, judgePicklistValue, mintPicklistValueId, normalizePicklistLabel, normalizePicklistValueSet, PICKLIST_VALUES_MAX, picklistActiveValues, picklistDefaultLabel, picklistFromLabels, picklistOptions, picklistRank, picklistRefusalSentence, picklistValueByLabel } from "./picklists.js";
52
52
  import { MAX_SCOPE_HOSTS, ORG_SCOPE_TOKEN } from "./scope-tokens.js";
53
- import { isKnownContactSource } from "../plugin-manager/plugin-contact-capture.js";
53
+ import { isKnownContactSource, labelContactSource } from "../plugin-manager/plugin-contact-capture.js";
54
54
  // The fixed vocabularies and their guards live in a leaf module; every name
55
55
  // stays importable from here.
56
56
  export * from "./crm-kinds.js";
@@ -1742,9 +1742,6 @@ const blank = (value)=>value === null || typeof value === 'string' && value.trim
1742
1742
  'defaultOwnerUid'
1743
1743
  ];
1744
1744
  }
1745
- function isContactSourceValue(value) {
1746
- return typeof value === 'string' && value in CONTACT_SOURCE_LABELS;
1747
- }
1748
1745
  function cleanText(value, max) {
1749
1746
  const text = typeof value === 'string' ? value.trim().slice(0, max) : '';
1750
1747
  return text || undefined;
@@ -1758,7 +1755,11 @@ function cleanText(value, max) {
1758
1755
  if (!id) return null;
1759
1756
  const whenRaw = entry['when'] && typeof entry['when'] === 'object' && !Array.isArray(entry['when']) ? entry['when'] : {};
1760
1757
  const when = {};
1761
- if (isContactSourceValue(whenRaw['source'])) when.source = whenRaw['source'];
1758
+ // Any word, not only one this process can name. A capture's source is an open
1759
+ // word a plugin declares, and a rule that lost this clause would claim every
1760
+ // capture: an unknown word matches no door, which is the narrow way to be wrong.
1761
+ const source = cleanText(whenRaw['source'], 64);
1762
+ if (source) when.source = source;
1762
1763
  const formId = cleanText(whenRaw['formId'], 128);
1763
1764
  if (formId) when.formId = formId;
1764
1765
  // A person types a domain the way they see one in an address — `@acme.com`
@@ -1866,7 +1867,7 @@ export function readCrmAssignmentSettings(orgDocument) {
1866
1867
  * the roster's.
1867
1868
  */ export function describeAssignmentRule(rule, memberLabel) {
1868
1869
  const parts = [];
1869
- if (rule.when.source) parts.push(`source is ${CONTACT_SOURCE_LABELS[rule.when.source]}`);
1870
+ if (rule.when.source) parts.push(`source is ${labelContactSource(rule.when.source)}`);
1870
1871
  if (rule.when.formId) parts.push(`form is ${rule.when.formId}`);
1871
1872
  if (rule.when.emailDomain) parts.push(`email domain is ${rule.when.emailDomain}`);
1872
1873
  if (rule.when.tag) parts.push(`tagged ${rule.when.tag}`);