@patch-adams/core 1.5.18 → 1.5.19
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 +47 -47
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +47 -47
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +47 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +47 -47
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1947,12 +1947,12 @@ function generateLrsBridgeCode(options) {
|
|
|
1947
1947
|
// Without this override, our statements have a different object.id than cloudplayer
|
|
1948
1948
|
// statements, so Analytics treats them as unrelated to the document.
|
|
1949
1949
|
if (docData.guid) {
|
|
1950
|
-
|
|
1951
|
-
log('Overriding baked-in GUID with Bravais GUID:', LRS.courseInfo.guid, '->', docData.guid);
|
|
1952
|
-
}
|
|
1950
|
+
var oldGuid = LRS.courseInfo.guid;
|
|
1953
1951
|
LRS.courseInfo.guid = docData.guid;
|
|
1954
1952
|
LRS.courseInfo.id = 'http://xyleme.com/bravais/document/' + docData.guid;
|
|
1955
|
-
log(
|
|
1953
|
+
// Always-visible log (not behind DEBUG) so we can confirm override in production
|
|
1954
|
+
console.info('[PA-LRS] Document GUID set from API:', docData.guid,
|
|
1955
|
+
oldGuid && oldGuid !== docData.guid ? '(was: ' + oldGuid + ')' : '');
|
|
1956
1956
|
}
|
|
1957
1957
|
|
|
1958
1958
|
// Version GUID \u2014 same principle: Bravais version GUID must override baked-in
|
|
@@ -2261,21 +2261,20 @@ function generateLrsBridgeCode(options) {
|
|
|
2261
2261
|
info.sharedLinkName = launchInfo.sharedLinkName || info.sharedLinkName;
|
|
2262
2262
|
}
|
|
2263
2263
|
|
|
2264
|
-
// 3b.
|
|
2265
|
-
//
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
}
|
|
2264
|
+
// 3b. Always try to extract GUIDs from Xyleme Cloud Player's internal data.
|
|
2265
|
+
// Cloud Player data is authoritative \u2014 it has the canonical Bravais GUID.
|
|
2266
|
+
// This overrides any baked-in GUID which is just a random UUID from wrap time.
|
|
2267
|
+
var cloudPlayerData = extractFromXylemeCloudPlayer();
|
|
2268
|
+
if (cloudPlayerData) {
|
|
2269
|
+
if (cloudPlayerData.guid) info.guid = cloudPlayerData.guid;
|
|
2270
|
+
if (cloudPlayerData.versionGuid) info.versionGuid = cloudPlayerData.versionGuid;
|
|
2271
|
+
info.documentId = cloudPlayerData.documentId || info.documentId;
|
|
2272
|
+
info.title = cloudPlayerData.title || info.title;
|
|
2273
|
+
log('Updated course info from Cloud Player:', {
|
|
2274
|
+
guid: info.guid,
|
|
2275
|
+
versionGuid: info.versionGuid,
|
|
2276
|
+
documentId: info.documentId
|
|
2277
|
+
});
|
|
2279
2278
|
}
|
|
2280
2279
|
|
|
2281
2280
|
// 4. Try getCourseTitle() from preloadIntegrity.js
|
|
@@ -4897,12 +4896,18 @@ function generateLrsBridgeCode(options) {
|
|
|
4897
4896
|
|
|
4898
4897
|
// Always-visible bridge summary (not gated by DEBUG)
|
|
4899
4898
|
// This ensures diagnostics are available even in production builds
|
|
4899
|
+
// Shows current GUID (may be from Cloud Player, baked-in, or pending API override)
|
|
4900
|
+
var currentGuid = LRS.courseInfo ? LRS.courseInfo.guid : DOCUMENT_GUID;
|
|
4901
|
+
var currentVerGuid = LRS.courseInfo ? LRS.courseInfo.versionGuid : VERSION_GUID;
|
|
4902
|
+
var sharedToken = LRS.courseInfo ? LRS.courseInfo.sharedLinkToken : null;
|
|
4900
4903
|
if (window.console && window.console.info) {
|
|
4901
4904
|
console.info('[PA-LRS] Bridge v' + LRS.version + ': mode=' + LRS.mode +
|
|
4902
4905
|
', endpoint=' + (LRS_ENDPOINT ? LRS_ENDPOINT.substring(0, 30) + '...' : 'NONE') +
|
|
4903
4906
|
', proxy=' + (LRS_PROXY_ENDPOINT ? 'yes' : 'no') +
|
|
4904
|
-
', docGuid=' + (
|
|
4905
|
-
'
|
|
4907
|
+
', docGuid=' + (currentGuid || 'NONE') +
|
|
4908
|
+
(currentGuid !== DOCUMENT_GUID ? ' (overridden from baked: ' + DOCUMENT_GUID + ')' : '') +
|
|
4909
|
+
', verGuid=' + (currentVerGuid || 'NONE') +
|
|
4910
|
+
', sharedToken=' + (sharedToken || 'NONE') +
|
|
4906
4911
|
', actor=' + (LRS.actor ? (LRS.actor.name || 'anonymous') : 'none') +
|
|
4907
4912
|
', hasRefreshActor=' + (typeof LRS.refreshActor === 'function'));
|
|
4908
4913
|
}
|
|
@@ -4973,35 +4978,30 @@ function generateLrsBridgeCode(options) {
|
|
|
4973
4978
|
});
|
|
4974
4979
|
}
|
|
4975
4980
|
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
}
|
|
4989
|
-
} else {
|
|
4990
|
-
warn('Could not fetch document data from shared API - statements may fail aggregation');
|
|
4981
|
+
// ALWAYS fetch document metadata from the Bravais API.
|
|
4982
|
+
// Even if we have a baked-in GUID, we must override it with the canonical
|
|
4983
|
+
// Bravais GUID so our statements link to the same document as cloudplayer.
|
|
4984
|
+
// The baked-in GUID is a random UUID from wrap time; the Bravais GUID is
|
|
4985
|
+
// assigned at upload and is what Analytics uses for aggregation.
|
|
4986
|
+
if (sharedLinkToken) {
|
|
4987
|
+
log('Have shared link token, fetching document data via shared API...');
|
|
4988
|
+
fetchDocumentMetadata(null, function(docData) {
|
|
4989
|
+
if (docData) {
|
|
4990
|
+
updateCourseInfoFromApi(docData);
|
|
4991
|
+
if (docData.name) {
|
|
4992
|
+
LRS.courseInfo.sharedLinkName = docData.name;
|
|
4991
4993
|
}
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
// No shared link token, try with extracted document ID (requires auth)
|
|
4996
|
-
log('No shared link token, fetching document data with ID:', documentId);
|
|
4997
|
-
fetchDocDataAndReady(documentId);
|
|
4998
|
-
} else {
|
|
4999
|
-
// No identifiers available
|
|
5000
|
-
warn('No shared link token or document ID - statements may fail aggregation');
|
|
4994
|
+
} else {
|
|
4995
|
+
warn('Could not fetch document data from shared API - statements may use baked-in GUID');
|
|
4996
|
+
}
|
|
5001
4997
|
maybeEnrichAndReady();
|
|
5002
|
-
}
|
|
4998
|
+
});
|
|
4999
|
+
} else if (documentId) {
|
|
5000
|
+
log('Fetching document data with ID:', documentId);
|
|
5001
|
+
fetchDocDataAndReady(documentId);
|
|
5003
5002
|
} else {
|
|
5004
|
-
//
|
|
5003
|
+
// No identifiers available
|
|
5004
|
+
warn('No shared link token or document ID - statements will use baked-in GUID');
|
|
5005
5005
|
maybeEnrichAndReady();
|
|
5006
5006
|
}
|
|
5007
5007
|
|