@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/cli.js
CHANGED
|
@@ -2278,12 +2278,12 @@ function generateLrsBridgeCode(options) {
|
|
|
2278
2278
|
// Without this override, our statements have a different object.id than cloudplayer
|
|
2279
2279
|
// statements, so Analytics treats them as unrelated to the document.
|
|
2280
2280
|
if (docData.guid) {
|
|
2281
|
-
|
|
2282
|
-
log('Overriding baked-in GUID with Bravais GUID:', LRS.courseInfo.guid, '->', docData.guid);
|
|
2283
|
-
}
|
|
2281
|
+
var oldGuid = LRS.courseInfo.guid;
|
|
2284
2282
|
LRS.courseInfo.guid = docData.guid;
|
|
2285
2283
|
LRS.courseInfo.id = 'http://xyleme.com/bravais/document/' + docData.guid;
|
|
2286
|
-
log(
|
|
2284
|
+
// Always-visible log (not behind DEBUG) so we can confirm override in production
|
|
2285
|
+
console.info('[PA-LRS] Document GUID set from API:', docData.guid,
|
|
2286
|
+
oldGuid && oldGuid !== docData.guid ? '(was: ' + oldGuid + ')' : '');
|
|
2287
2287
|
}
|
|
2288
2288
|
|
|
2289
2289
|
// Version GUID \u2014 same principle: Bravais version GUID must override baked-in
|
|
@@ -2592,21 +2592,20 @@ function generateLrsBridgeCode(options) {
|
|
|
2592
2592
|
info.sharedLinkName = launchInfo.sharedLinkName || info.sharedLinkName;
|
|
2593
2593
|
}
|
|
2594
2594
|
|
|
2595
|
-
// 3b.
|
|
2596
|
-
//
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
}
|
|
2595
|
+
// 3b. Always try to extract GUIDs from Xyleme Cloud Player's internal data.
|
|
2596
|
+
// Cloud Player data is authoritative \u2014 it has the canonical Bravais GUID.
|
|
2597
|
+
// This overrides any baked-in GUID which is just a random UUID from wrap time.
|
|
2598
|
+
var cloudPlayerData = extractFromXylemeCloudPlayer();
|
|
2599
|
+
if (cloudPlayerData) {
|
|
2600
|
+
if (cloudPlayerData.guid) info.guid = cloudPlayerData.guid;
|
|
2601
|
+
if (cloudPlayerData.versionGuid) info.versionGuid = cloudPlayerData.versionGuid;
|
|
2602
|
+
info.documentId = cloudPlayerData.documentId || info.documentId;
|
|
2603
|
+
info.title = cloudPlayerData.title || info.title;
|
|
2604
|
+
log('Updated course info from Cloud Player:', {
|
|
2605
|
+
guid: info.guid,
|
|
2606
|
+
versionGuid: info.versionGuid,
|
|
2607
|
+
documentId: info.documentId
|
|
2608
|
+
});
|
|
2610
2609
|
}
|
|
2611
2610
|
|
|
2612
2611
|
// 4. Try getCourseTitle() from preloadIntegrity.js
|
|
@@ -5228,12 +5227,18 @@ function generateLrsBridgeCode(options) {
|
|
|
5228
5227
|
|
|
5229
5228
|
// Always-visible bridge summary (not gated by DEBUG)
|
|
5230
5229
|
// This ensures diagnostics are available even in production builds
|
|
5230
|
+
// Shows current GUID (may be from Cloud Player, baked-in, or pending API override)
|
|
5231
|
+
var currentGuid = LRS.courseInfo ? LRS.courseInfo.guid : DOCUMENT_GUID;
|
|
5232
|
+
var currentVerGuid = LRS.courseInfo ? LRS.courseInfo.versionGuid : VERSION_GUID;
|
|
5233
|
+
var sharedToken = LRS.courseInfo ? LRS.courseInfo.sharedLinkToken : null;
|
|
5231
5234
|
if (window.console && window.console.info) {
|
|
5232
5235
|
console.info('[PA-LRS] Bridge v' + LRS.version + ': mode=' + LRS.mode +
|
|
5233
5236
|
', endpoint=' + (LRS_ENDPOINT ? LRS_ENDPOINT.substring(0, 30) + '...' : 'NONE') +
|
|
5234
5237
|
', proxy=' + (LRS_PROXY_ENDPOINT ? 'yes' : 'no') +
|
|
5235
|
-
', docGuid=' + (
|
|
5236
|
-
'
|
|
5238
|
+
', docGuid=' + (currentGuid || 'NONE') +
|
|
5239
|
+
(currentGuid !== DOCUMENT_GUID ? ' (overridden from baked: ' + DOCUMENT_GUID + ')' : '') +
|
|
5240
|
+
', verGuid=' + (currentVerGuid || 'NONE') +
|
|
5241
|
+
', sharedToken=' + (sharedToken || 'NONE') +
|
|
5237
5242
|
', actor=' + (LRS.actor ? (LRS.actor.name || 'anonymous') : 'none') +
|
|
5238
5243
|
', hasRefreshActor=' + (typeof LRS.refreshActor === 'function'));
|
|
5239
5244
|
}
|
|
@@ -5304,35 +5309,30 @@ function generateLrsBridgeCode(options) {
|
|
|
5304
5309
|
});
|
|
5305
5310
|
}
|
|
5306
5311
|
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
}
|
|
5320
|
-
} else {
|
|
5321
|
-
warn('Could not fetch document data from shared API - statements may fail aggregation');
|
|
5312
|
+
// ALWAYS fetch document metadata from the Bravais API.
|
|
5313
|
+
// Even if we have a baked-in GUID, we must override it with the canonical
|
|
5314
|
+
// Bravais GUID so our statements link to the same document as cloudplayer.
|
|
5315
|
+
// The baked-in GUID is a random UUID from wrap time; the Bravais GUID is
|
|
5316
|
+
// assigned at upload and is what Analytics uses for aggregation.
|
|
5317
|
+
if (sharedLinkToken) {
|
|
5318
|
+
log('Have shared link token, fetching document data via shared API...');
|
|
5319
|
+
fetchDocumentMetadata(null, function(docData) {
|
|
5320
|
+
if (docData) {
|
|
5321
|
+
updateCourseInfoFromApi(docData);
|
|
5322
|
+
if (docData.name) {
|
|
5323
|
+
LRS.courseInfo.sharedLinkName = docData.name;
|
|
5322
5324
|
}
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
// No shared link token, try with extracted document ID (requires auth)
|
|
5327
|
-
log('No shared link token, fetching document data with ID:', documentId);
|
|
5328
|
-
fetchDocDataAndReady(documentId);
|
|
5329
|
-
} else {
|
|
5330
|
-
// No identifiers available
|
|
5331
|
-
warn('No shared link token or document ID - statements may fail aggregation');
|
|
5325
|
+
} else {
|
|
5326
|
+
warn('Could not fetch document data from shared API - statements may use baked-in GUID');
|
|
5327
|
+
}
|
|
5332
5328
|
maybeEnrichAndReady();
|
|
5333
|
-
}
|
|
5329
|
+
});
|
|
5330
|
+
} else if (documentId) {
|
|
5331
|
+
log('Fetching document data with ID:', documentId);
|
|
5332
|
+
fetchDocDataAndReady(documentId);
|
|
5334
5333
|
} else {
|
|
5335
|
-
//
|
|
5334
|
+
// No identifiers available
|
|
5335
|
+
warn('No shared link token or document ID - statements will use baked-in GUID');
|
|
5336
5336
|
maybeEnrichAndReady();
|
|
5337
5337
|
}
|
|
5338
5338
|
|