@aglyn/aglyn 1.0.0 → 1.2.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 +11 -11
- package/src/lib/app-utils/compose-reusable-components.d.ts +22 -0
- package/src/lib/app-utils/compose-reusable-components.js +94 -32
- package/src/lib/app-utils/compose-reusable-components.js.map +1 -1
- package/src/lib/app-utils/contacts.d.ts +15 -1
- package/src/lib/app-utils/contacts.js +15 -1
- package/src/lib/app-utils/contacts.js.map +1 -1
- package/src/lib/app-utils/crm.d.ts +61 -19
- package/src/lib/app-utils/crm.js +47 -26
- package/src/lib/app-utils/crm.js.map +1 -1
- package/src/lib/app-utils/default-site.d.ts +10 -3
- package/src/lib/app-utils/default-site.js +82 -6
- package/src/lib/app-utils/default-site.js.map +1 -1
- package/src/lib/app-utils/docs-help-sections.generated.js +11 -1
- package/src/lib/app-utils/docs-help-sections.generated.js.map +1 -1
- package/src/lib/app-utils/docs-help.generated.d.ts +5 -5
- package/src/lib/app-utils/docs-help.generated.js +23 -0
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +43 -15
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/host-tokens.d.ts +7 -0
- package/src/lib/app-utils/host-tokens.js +27 -4
- package/src/lib/app-utils/host-tokens.js.map +1 -1
- package/src/lib/app-utils/node-definition-sanitizer.js +5 -1
- package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -1
- package/src/lib/app-utils/server.d.ts +1 -0
- package/src/lib/app-utils/server.js +1 -0
- package/src/lib/app-utils/server.js.map +1 -1
- package/src/lib/app-utils/site-brand-files.d.ts +87 -0
- package/src/lib/app-utils/site-brand-files.js +157 -0
- package/src/lib/app-utils/site-brand-files.js.map +1 -0
- package/src/lib/app-utils/site-starter-nodes.js +1 -0
- package/src/lib/app-utils/site-starter-nodes.js.map +1 -1
- package/src/lib/app-utils/site-starter-pick.d.ts +2 -2
- package/src/lib/app-utils/site-starter-pick.js +2 -2
- package/src/lib/app-utils/site-starter-pick.js.map +1 -1
- package/src/lib/plugin-manager/feature-plugins.d.ts +36 -2
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
package/src/lib/app-utils/crm.js
CHANGED
|
@@ -121,26 +121,26 @@ export * from "./crm-kinds.js";
|
|
|
121
121
|
* The field the per-record activity ceiling is counted on, or `null` for an
|
|
122
122
|
* activity that names no record at all.
|
|
123
123
|
*
|
|
124
|
-
* The contact leads, then the
|
|
125
|
-
*
|
|
126
|
-
* copies the facet's `companyId` onto every record it creates), and a
|
|
124
|
+
* The contact leads, then the deal, then the company: every activity about
|
|
125
|
+
* a contact or a deal carries the company it rolls up to (AGL-4123), and a
|
|
127
126
|
* ceiling counted on the company would let one busy account exhaust every
|
|
128
|
-
* contact filed under it. The record whose PAGE the log is read on
|
|
129
|
-
* one whose log has the limit
|
|
127
|
+
* contact and deal filed under it. The record whose PAGE the log is read on
|
|
128
|
+
* is the one whose log has the limit, so a company's own entries are counted
|
|
129
|
+
* with everything that rolled up to it. Shared by the client dialog and the
|
|
130
130
|
* server writers so they count the same thing.
|
|
131
131
|
*/ export function crmActivityCeilingLink(link) {
|
|
132
132
|
if (link.contactId) return {
|
|
133
133
|
field: 'contactId',
|
|
134
134
|
id: String(link.contactId)
|
|
135
135
|
};
|
|
136
|
-
if (link.companyId) return {
|
|
137
|
-
field: 'companyId',
|
|
138
|
-
id: String(link.companyId)
|
|
139
|
-
};
|
|
140
136
|
if (link.dealId) return {
|
|
141
137
|
field: 'dealId',
|
|
142
138
|
id: String(link.dealId)
|
|
143
139
|
};
|
|
140
|
+
if (link.companyId) return {
|
|
141
|
+
field: 'companyId',
|
|
142
|
+
id: String(link.companyId)
|
|
143
|
+
};
|
|
144
144
|
// Last, because a converted lead's activities carry the contact beside it
|
|
145
145
|
// and the contact is the record whose page they are read on.
|
|
146
146
|
if (link.leadId) return {
|
|
@@ -518,7 +518,7 @@ export const CRM_TASK_KIND_LABELS = {
|
|
|
518
518
|
* How a kind reads after a direction — "Inbound call", "Outbound WhatsApp
|
|
519
519
|
* message". Its own map rather than the label lowercased, because a brand
|
|
520
520
|
* keeps its capitals and a channel's name is not the thing that was sent.
|
|
521
|
-
*/ const CRM_ACTIVITY_KIND_NOUNS = {
|
|
521
|
+
*/ export const CRM_ACTIVITY_KIND_NOUNS = {
|
|
522
522
|
call: 'call',
|
|
523
523
|
email: 'email',
|
|
524
524
|
text: 'text message',
|
|
@@ -1641,13 +1641,25 @@ const blank = (value)=>value === null || typeof value === 'string' && value.trim
|
|
|
1641
1641
|
* `crm.defaultRecordScope` when the org has set it. Before AGL-3662 the CRM
|
|
1642
1642
|
* read the org's dataset default, `defaultResourceScope`, so an org that set
|
|
1643
1643
|
* that to All sites keeps CRM records org-wide until it chooses separately.
|
|
1644
|
-
*
|
|
1644
|
+
*
|
|
1645
|
+
* Neither set reads `'org'`: a record belongs to the whole organization, and
|
|
1646
|
+
* the site it came in on is where it came from, not who may see it. Keeping
|
|
1647
|
+
* each site's records apart is the choice an agency makes, so that one
|
|
1648
|
+
* client's collaborator never sees another client's people — a setting it
|
|
1649
|
+
* turns on, never a default the rest live with.
|
|
1650
|
+
*
|
|
1651
|
+
* `undefined` only when there is no org document to read — a surface whose
|
|
1652
|
+
* org has not loaded yet. Every caller treats that as `'host'`, the site the
|
|
1653
|
+
* record came in on: an org that keeps its sites apart must never have a
|
|
1654
|
+
* record stamped for everyone because its document was a moment late, and
|
|
1655
|
+
* a record kept to its site is still visible where it was made.
|
|
1645
1656
|
*/ export function crmDefaultScopeOf(orgDocument) {
|
|
1646
|
-
|
|
1657
|
+
if (!orgDocument || typeof orgDocument !== 'object') return undefined;
|
|
1658
|
+
const settings = orgDocument[ORG_CRM_SETTINGS_FIELD];
|
|
1647
1659
|
const own = settings && typeof settings === 'object' && !Array.isArray(settings) ? settings['defaultRecordScope'] : undefined;
|
|
1648
1660
|
if (own === 'org' || own === 'host') return own;
|
|
1649
|
-
const legacy =
|
|
1650
|
-
return legacy === 'org' || legacy === 'host' ? legacy :
|
|
1661
|
+
const legacy = orgDocument['defaultResourceScope'];
|
|
1662
|
+
return legacy === 'org' || legacy === 'host' ? legacy : 'org';
|
|
1651
1663
|
}
|
|
1652
1664
|
/**
|
|
1653
1665
|
* Whether a capture from a work email domain no visible company carries
|
|
@@ -1879,16 +1891,19 @@ export function readCrmAssignmentSettings(orgDocument) {
|
|
|
1879
1891
|
* The contact create path's own expression (`upsertHostContact`), lifted
|
|
1880
1892
|
* here so that a company, a deal or a task created from a site's console
|
|
1881
1893
|
* lands in exactly the scope a contact captured on that site would: the
|
|
1882
|
-
* whole org when the org's CRM default (`crmDefaultScopeOf`) is `'org'
|
|
1883
|
-
*
|
|
1884
|
-
*
|
|
1885
|
-
*
|
|
1886
|
-
* eight creators are
|
|
1894
|
+
* whole org when the org's CRM default (`crmDefaultScopeOf`) is `'org'` —
|
|
1895
|
+
* which it is unless the org chose otherwise — and otherwise the sites that
|
|
1896
|
+
* present as one sender, which, undeclared, is this site alone. That second
|
|
1897
|
+
* answer is the agency's isolation, which it turns on in CRM → Settings, and
|
|
1898
|
+
* the reason this is a function rather than a convention eight creators are
|
|
1899
|
+
* asked to remember: a creator that spelled its own could stamp a kept-apart
|
|
1900
|
+
* org's record for everyone.
|
|
1887
1901
|
*
|
|
1888
|
-
*
|
|
1889
|
-
* on the record — never a default. The rules refuse
|
|
1890
|
-
* a record outside their own tokens, so a creator
|
|
1891
|
-
* only make its record invisible to itself, never
|
|
1902
|
+
* Under a kept-apart org, widening past the group is an ACT — an org-wide
|
|
1903
|
+
* member editing the scope on the record — never a default. The rules refuse
|
|
1904
|
+
* a scoped member creating a record outside their own tokens, so a creator
|
|
1905
|
+
* that bypassed this could only make its record invisible to itself, never
|
|
1906
|
+
* wider.
|
|
1892
1907
|
*/ export function crmScopeTokens(org, group) {
|
|
1893
1908
|
return crmDefaultScopeOf(org) === 'org' ? [
|
|
1894
1909
|
ORG_SCOPE_TOKEN
|
|
@@ -2894,9 +2909,9 @@ export function isCrmPicklistObject(value) {
|
|
|
2894
2909
|
};
|
|
2895
2910
|
/**
|
|
2896
2911
|
* Salesforce's Opportunity Contact Role (AGL-3521): the part a contact
|
|
2897
|
-
* plays on a deal. Plain; the label sits in each
|
|
2898
|
-
* `contactRoles`, and `contactRoleKeys` lists their
|
|
2899
|
-
* rename or a delete finds the
|
|
2912
|
+
* plays on a deal, and on a company (AGL-4122). Plain; the label sits in each
|
|
2913
|
+
* entry of the record's `contactRoles`, and `contactRoleKeys` lists their
|
|
2914
|
+
* keys, which is how a rename or a delete finds the records to rewrite.
|
|
2900
2915
|
*/ const OPPORTUNITY_CONTACT_ROLE_DEFINITION = {
|
|
2901
2916
|
id: 'opportunityContactRole',
|
|
2902
2917
|
label: 'Contact role',
|
|
@@ -2947,6 +2962,12 @@ export function isCrmPicklistObject(value) {
|
|
|
2947
2962
|
field: 'contactRoles',
|
|
2948
2963
|
arrayKey: 'role',
|
|
2949
2964
|
keyField: 'contactRoleKeys'
|
|
2965
|
+
},
|
|
2966
|
+
{
|
|
2967
|
+
object: 'company',
|
|
2968
|
+
field: 'contactRoles',
|
|
2969
|
+
arrayKey: 'role',
|
|
2970
|
+
keyField: 'contactRoleKeys'
|
|
2950
2971
|
}
|
|
2951
2972
|
]
|
|
2952
2973
|
};
|