@patch-adams/core 1.5.13 → 1.5.14

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/index.cjs CHANGED
@@ -50,7 +50,9 @@ var LrsBridgeConfigSchema = zod.z.object({
50
50
  /** Document GUID for xAPI statement aggregation - baked into package at wrap time */
51
51
  documentGuid: zod.z.string().optional(),
52
52
  /** Version GUID for xAPI statement aggregation - unique per export */
53
- versionGuid: zod.z.string().optional()
53
+ versionGuid: zod.z.string().optional(),
54
+ /** Original SCORM package filename - baked in at wrap time for LRS searchability */
55
+ packageName: zod.z.string().optional()
54
56
  });
55
57
  var BlockingAssetConfigSchema = zod.z.object({
56
58
  /** Filename for the asset */
@@ -399,7 +401,8 @@ var DEFAULT_LRS_OPTIONS = {
399
401
  lrsAuth: "",
400
402
  lrsProxyEndpoint: "",
401
403
  documentGuid: "",
402
- versionGuid: ""
404
+ versionGuid: "",
405
+ packageName: ""
403
406
  };
404
407
  function generateLrsBridgeCode(options) {
405
408
  if (!options.enabled) {
@@ -415,6 +418,7 @@ function generateLrsBridgeCode(options) {
415
418
  const lrsProxyEndpoint = options.lrsProxyEndpoint || "";
416
419
  const documentGuid = options.documentGuid || "";
417
420
  const versionGuid = options.versionGuid || "";
421
+ const packageName = options.packageName || "";
418
422
  return `
419
423
  // ==========================================================================
420
424
  // PATCH-ADAMS LRS BRIDGE v2.2.0
@@ -447,6 +451,7 @@ function generateLrsBridgeCode(options) {
447
451
  var LRS_PROXY_ENDPOINT = '${lrsProxyEndpoint}';
448
452
  var DOCUMENT_GUID = '${documentGuid}';
449
453
  var VERSION_GUID = '${versionGuid}';
454
+ var PACKAGE_NAME = '${packageName}';
450
455
 
451
456
  // Bravais LRS endpoint pattern: https://lrs-{tenant}.bravais.com/XAPI/statements
452
457
  // Example: core-acme.bravais.com -> lrs-acme.bravais.com
@@ -2130,7 +2135,9 @@ function generateLrsBridgeCode(options) {
2130
2135
  sharedLinkName: null,
2131
2136
  // Tenant info
2132
2137
  homepage: COURSE_HOMEPAGE || window.location.origin,
2133
- tenantHomepage: null // https://{tenant}.bravais.com format
2138
+ tenantHomepage: null, // https://{tenant}.bravais.com format
2139
+ // Package info
2140
+ packageName: null // Original SCORM zip filename
2134
2141
  };
2135
2142
 
2136
2143
  // 0. Use baked-in GUIDs from PA-Patcher config (highest priority - set at wrap time)
@@ -2143,6 +2150,10 @@ function generateLrsBridgeCode(options) {
2143
2150
  info.versionGuid = VERSION_GUID;
2144
2151
  log('Version GUID from baked-in config:', VERSION_GUID);
2145
2152
  }
2153
+ if (PACKAGE_NAME) {
2154
+ info.packageName = PACKAGE_NAME;
2155
+ log('Package name from baked-in config:', PACKAGE_NAME);
2156
+ }
2146
2157
 
2147
2158
  // 1. Extract shared link token and document ID from URL
2148
2159
  info.sharedLinkToken = extractSharedLinkToken();
@@ -2573,6 +2584,11 @@ function generateLrsBridgeCode(options) {
2573
2584
  // Resource type
2574
2585
  obj.definition.extensions['resourceType'] = LRS.courseInfo.resourceType || 'Course';
2575
2586
 
2587
+ // Package name (original SCORM zip filename)
2588
+ if (LRS.courseInfo.packageName) {
2589
+ obj.definition.extensions['packageName'] = LRS.courseInfo.packageName;
2590
+ }
2591
+
2576
2592
  return obj;
2577
2593
  }
2578
2594
 
@@ -5038,7 +5054,8 @@ function buildJsBeforeOptions(config, metadata) {
5038
5054
  lrsProxyEndpoint: lrsBridgeConfig.lrsProxyEndpoint,
5039
5055
  employeeApiEndpoint: lrsBridgeConfig.employeeApiEndpoint,
5040
5056
  documentGuid: lrsBridgeConfig.documentGuid,
5041
- versionGuid: lrsBridgeConfig.versionGuid
5057
+ versionGuid: lrsBridgeConfig.versionGuid,
5058
+ packageName: lrsBridgeConfig.packageName
5042
5059
  };
5043
5060
  return {
5044
5061
  remoteUrl: `${config.remoteDomain}/${config.localFolders.js}/${config.jsBefore.filename}`,
@@ -6728,6 +6745,11 @@ var Patcher = class {
6728
6745
  if (effectiveSkin) {
6729
6746
  console.log(`[Patcher] Skin: ${effectiveSkin}`);
6730
6747
  }
6748
+ if (options.packageName) {
6749
+ this.config.lrsBridge = this.config.lrsBridge ?? {};
6750
+ this.config.lrsBridge.packageName = options.packageName;
6751
+ console.log(`[Patcher] Package name: ${options.packageName}`);
6752
+ }
6731
6753
  const htmlInjector = this.getHtmlInjector(toolInfo.tool);
6732
6754
  htmlInjector.setMetadata(metadata);
6733
6755
  let fetchedFallbacks = {};