@patch-adams/core 1.5.21 → 1.5.22
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/dist/cli.cjs +21 -9
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +21 -9
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +21 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1452,8 +1452,8 @@ function generateLrsBridgeCode(options) {
|
|
|
1452
1452
|
', bravaisUserId=' + employeeData.bravaisUserId + ', tenantUrl=' + employeeData.tenantUrl
|
|
1453
1453
|
: 'NO DATA'));
|
|
1454
1454
|
if (employeeData && employeeData.email) {
|
|
1455
|
-
actor.mbox = 'mailto:' + employeeData.email;
|
|
1456
|
-
log('Enhanced actor with email:', employeeData.email);
|
|
1455
|
+
actor.mbox = 'mailto:' + employeeData.email.toLowerCase();
|
|
1456
|
+
log('Enhanced actor with email:', employeeData.email.toLowerCase());
|
|
1457
1457
|
|
|
1458
1458
|
// Also update name if we got a better one
|
|
1459
1459
|
if (employeeData.name && (!actor.name || actor.name === 'Unknown Learner')) {
|
|
@@ -1618,6 +1618,18 @@ function generateLrsBridgeCode(options) {
|
|
|
1618
1618
|
return n === 'anonymous learner' || n === 'unknown learner' || n === 'anonymous' || n === 'unknown';
|
|
1619
1619
|
}
|
|
1620
1620
|
|
|
1621
|
+
/**
|
|
1622
|
+
* Normalize actor IFI fields for consistent matching in Bravais Analytics.
|
|
1623
|
+
* Lowercases mbox email (RFC 5321: local-part is case-insensitive in practice).
|
|
1624
|
+
*/
|
|
1625
|
+
function normalizeActor(actor) {
|
|
1626
|
+
if (!actor) return actor;
|
|
1627
|
+
if (actor.mbox && actor.mbox.indexOf('mailto:') === 0) {
|
|
1628
|
+
actor.mbox = 'mailto:' + actor.mbox.substring(7).toLowerCase();
|
|
1629
|
+
}
|
|
1630
|
+
return actor;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1621
1633
|
/**
|
|
1622
1634
|
* Persist actor to localStorage for cross-frame sharing.
|
|
1623
1635
|
* Only stores non-anonymous actors.
|
|
@@ -1664,14 +1676,14 @@ function generateLrsBridgeCode(options) {
|
|
|
1664
1676
|
(LRS.actor.account && shared.account && LRS.actor.account.name !== shared.account.name)) {
|
|
1665
1677
|
log('Actor updated from cross-frame storage:', shared.name);
|
|
1666
1678
|
}
|
|
1667
|
-
LRS.actor = shared;
|
|
1668
|
-
return
|
|
1679
|
+
LRS.actor = normalizeActor(shared);
|
|
1680
|
+
return LRS.actor;
|
|
1669
1681
|
}
|
|
1670
1682
|
// Fallback to current actor or re-extract
|
|
1671
1683
|
if (LRS.actor && !isAnonymousActor(LRS.actor)) {
|
|
1672
|
-
return LRS.actor;
|
|
1684
|
+
return normalizeActor(LRS.actor);
|
|
1673
1685
|
}
|
|
1674
|
-
return LRS.actor || extractActor();
|
|
1686
|
+
return normalizeActor(LRS.actor || extractActor());
|
|
1675
1687
|
}
|
|
1676
1688
|
|
|
1677
1689
|
/**
|
|
@@ -1733,9 +1745,9 @@ function generateLrsBridgeCode(options) {
|
|
|
1733
1745
|
function finalizeActor(actor) {
|
|
1734
1746
|
// Try to enhance actor with email if missing
|
|
1735
1747
|
enhanceActorWithEmail(actor, function(enhancedActor) {
|
|
1736
|
-
LRS.actor = enhancedActor;
|
|
1737
|
-
persistActor(
|
|
1738
|
-
callback(
|
|
1748
|
+
LRS.actor = normalizeActor(enhancedActor);
|
|
1749
|
+
persistActor(LRS.actor);
|
|
1750
|
+
callback(LRS.actor);
|
|
1739
1751
|
});
|
|
1740
1752
|
}
|
|
1741
1753
|
|