@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.d.cts CHANGED
@@ -38,6 +38,8 @@ declare const LrsBridgeConfigSchema: z.ZodObject<{
38
38
  documentGuid: z.ZodOptional<z.ZodString>;
39
39
  /** Version GUID for xAPI statement aggregation - unique per export */
40
40
  versionGuid: z.ZodOptional<z.ZodString>;
41
+ /** Original SCORM package filename - baked in at wrap time for LRS searchability */
42
+ packageName: z.ZodOptional<z.ZodString>;
41
43
  }, "strip", z.ZodTypeAny, {
42
44
  enabled: boolean;
43
45
  trackMedia: boolean;
@@ -55,6 +57,7 @@ declare const LrsBridgeConfigSchema: z.ZodObject<{
55
57
  employeeApiEndpoint?: string | undefined;
56
58
  documentGuid?: string | undefined;
57
59
  versionGuid?: string | undefined;
60
+ packageName?: string | undefined;
58
61
  }, {
59
62
  enabled?: boolean | undefined;
60
63
  trackMedia?: boolean | undefined;
@@ -72,6 +75,7 @@ declare const LrsBridgeConfigSchema: z.ZodObject<{
72
75
  employeeApiEndpoint?: string | undefined;
73
76
  documentGuid?: string | undefined;
74
77
  versionGuid?: string | undefined;
78
+ packageName?: string | undefined;
75
79
  }>;
76
80
  /**
77
81
  * Configuration for a blocking asset (CSS before, JS before)
@@ -245,6 +249,8 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
245
249
  documentGuid: z.ZodOptional<z.ZodString>;
246
250
  /** Version GUID for xAPI statement aggregation - unique per export */
247
251
  versionGuid: z.ZodOptional<z.ZodString>;
252
+ /** Original SCORM package filename - baked in at wrap time for LRS searchability */
253
+ packageName: z.ZodOptional<z.ZodString>;
248
254
  }, "strip", z.ZodTypeAny, {
249
255
  enabled: boolean;
250
256
  trackMedia: boolean;
@@ -262,6 +268,7 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
262
268
  employeeApiEndpoint?: string | undefined;
263
269
  documentGuid?: string | undefined;
264
270
  versionGuid?: string | undefined;
271
+ packageName?: string | undefined;
265
272
  }, {
266
273
  enabled?: boolean | undefined;
267
274
  trackMedia?: boolean | undefined;
@@ -279,6 +286,7 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
279
286
  employeeApiEndpoint?: string | undefined;
280
287
  documentGuid?: string | undefined;
281
288
  versionGuid?: string | undefined;
289
+ packageName?: string | undefined;
282
290
  }>>;
283
291
  /** Plugin configurations - each plugin is keyed by its name */
284
292
  plugins: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -338,6 +346,7 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
338
346
  employeeApiEndpoint?: string | undefined;
339
347
  documentGuid?: string | undefined;
340
348
  versionGuid?: string | undefined;
349
+ packageName?: string | undefined;
341
350
  };
342
351
  plugins: Record<string, z.objectOutputType<{
343
352
  /** Whether this plugin is enabled */
@@ -389,6 +398,7 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
389
398
  employeeApiEndpoint?: string | undefined;
390
399
  documentGuid?: string | undefined;
391
400
  versionGuid?: string | undefined;
401
+ packageName?: string | undefined;
392
402
  } | undefined;
393
403
  plugins?: Record<string, z.objectInputType<{
394
404
  /** Whether this plugin is enabled */
@@ -864,6 +874,8 @@ interface PatchOptions {
864
874
  skipFetch?: boolean;
865
875
  /** Optional skin name — per-call override for config.skin */
866
876
  skin?: string;
877
+ /** Original package filename — baked into LRS bridge for statement searchability */
878
+ packageName?: string;
867
879
  }
868
880
  /**
869
881
  * Main Patcher class for patching e-learning course packages
@@ -1037,6 +1049,8 @@ interface LrsBridgeOptions {
1037
1049
  documentGuid?: string;
1038
1050
  /** Version GUID for xAPI statement aggregation - unique per export */
1039
1051
  versionGuid?: string;
1052
+ /** Original SCORM package filename - baked in at wrap time for LRS searchability */
1053
+ packageName?: string;
1040
1054
  }
1041
1055
  declare const DEFAULT_LRS_OPTIONS: LrsBridgeOptions;
1042
1056
  /**
package/dist/index.d.ts CHANGED
@@ -38,6 +38,8 @@ declare const LrsBridgeConfigSchema: z.ZodObject<{
38
38
  documentGuid: z.ZodOptional<z.ZodString>;
39
39
  /** Version GUID for xAPI statement aggregation - unique per export */
40
40
  versionGuid: z.ZodOptional<z.ZodString>;
41
+ /** Original SCORM package filename - baked in at wrap time for LRS searchability */
42
+ packageName: z.ZodOptional<z.ZodString>;
41
43
  }, "strip", z.ZodTypeAny, {
42
44
  enabled: boolean;
43
45
  trackMedia: boolean;
@@ -55,6 +57,7 @@ declare const LrsBridgeConfigSchema: z.ZodObject<{
55
57
  employeeApiEndpoint?: string | undefined;
56
58
  documentGuid?: string | undefined;
57
59
  versionGuid?: string | undefined;
60
+ packageName?: string | undefined;
58
61
  }, {
59
62
  enabled?: boolean | undefined;
60
63
  trackMedia?: boolean | undefined;
@@ -72,6 +75,7 @@ declare const LrsBridgeConfigSchema: z.ZodObject<{
72
75
  employeeApiEndpoint?: string | undefined;
73
76
  documentGuid?: string | undefined;
74
77
  versionGuid?: string | undefined;
78
+ packageName?: string | undefined;
75
79
  }>;
76
80
  /**
77
81
  * Configuration for a blocking asset (CSS before, JS before)
@@ -245,6 +249,8 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
245
249
  documentGuid: z.ZodOptional<z.ZodString>;
246
250
  /** Version GUID for xAPI statement aggregation - unique per export */
247
251
  versionGuid: z.ZodOptional<z.ZodString>;
252
+ /** Original SCORM package filename - baked in at wrap time for LRS searchability */
253
+ packageName: z.ZodOptional<z.ZodString>;
248
254
  }, "strip", z.ZodTypeAny, {
249
255
  enabled: boolean;
250
256
  trackMedia: boolean;
@@ -262,6 +268,7 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
262
268
  employeeApiEndpoint?: string | undefined;
263
269
  documentGuid?: string | undefined;
264
270
  versionGuid?: string | undefined;
271
+ packageName?: string | undefined;
265
272
  }, {
266
273
  enabled?: boolean | undefined;
267
274
  trackMedia?: boolean | undefined;
@@ -279,6 +286,7 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
279
286
  employeeApiEndpoint?: string | undefined;
280
287
  documentGuid?: string | undefined;
281
288
  versionGuid?: string | undefined;
289
+ packageName?: string | undefined;
282
290
  }>>;
283
291
  /** Plugin configurations - each plugin is keyed by its name */
284
292
  plugins: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -338,6 +346,7 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
338
346
  employeeApiEndpoint?: string | undefined;
339
347
  documentGuid?: string | undefined;
340
348
  versionGuid?: string | undefined;
349
+ packageName?: string | undefined;
341
350
  };
342
351
  plugins: Record<string, z.objectOutputType<{
343
352
  /** Whether this plugin is enabled */
@@ -389,6 +398,7 @@ declare const PatchAdamsConfigSchema: z.ZodObject<{
389
398
  employeeApiEndpoint?: string | undefined;
390
399
  documentGuid?: string | undefined;
391
400
  versionGuid?: string | undefined;
401
+ packageName?: string | undefined;
392
402
  } | undefined;
393
403
  plugins?: Record<string, z.objectInputType<{
394
404
  /** Whether this plugin is enabled */
@@ -864,6 +874,8 @@ interface PatchOptions {
864
874
  skipFetch?: boolean;
865
875
  /** Optional skin name — per-call override for config.skin */
866
876
  skin?: string;
877
+ /** Original package filename — baked into LRS bridge for statement searchability */
878
+ packageName?: string;
867
879
  }
868
880
  /**
869
881
  * Main Patcher class for patching e-learning course packages
@@ -1037,6 +1049,8 @@ interface LrsBridgeOptions {
1037
1049
  documentGuid?: string;
1038
1050
  /** Version GUID for xAPI statement aggregation - unique per export */
1039
1051
  versionGuid?: string;
1052
+ /** Original SCORM package filename - baked in at wrap time for LRS searchability */
1053
+ packageName?: string;
1040
1054
  }
1041
1055
  declare const DEFAULT_LRS_OPTIONS: LrsBridgeOptions;
1042
1056
  /**
package/dist/index.js CHANGED
@@ -41,7 +41,9 @@ var LrsBridgeConfigSchema = z.object({
41
41
  /** Document GUID for xAPI statement aggregation - baked into package at wrap time */
42
42
  documentGuid: z.string().optional(),
43
43
  /** Version GUID for xAPI statement aggregation - unique per export */
44
- versionGuid: z.string().optional()
44
+ versionGuid: z.string().optional(),
45
+ /** Original SCORM package filename - baked in at wrap time for LRS searchability */
46
+ packageName: z.string().optional()
45
47
  });
46
48
  var BlockingAssetConfigSchema = z.object({
47
49
  /** Filename for the asset */
@@ -390,7 +392,8 @@ var DEFAULT_LRS_OPTIONS = {
390
392
  lrsAuth: "",
391
393
  lrsProxyEndpoint: "",
392
394
  documentGuid: "",
393
- versionGuid: ""
395
+ versionGuid: "",
396
+ packageName: ""
394
397
  };
395
398
  function generateLrsBridgeCode(options) {
396
399
  if (!options.enabled) {
@@ -406,6 +409,7 @@ function generateLrsBridgeCode(options) {
406
409
  const lrsProxyEndpoint = options.lrsProxyEndpoint || "";
407
410
  const documentGuid = options.documentGuid || "";
408
411
  const versionGuid = options.versionGuid || "";
412
+ const packageName = options.packageName || "";
409
413
  return `
410
414
  // ==========================================================================
411
415
  // PATCH-ADAMS LRS BRIDGE v2.2.0
@@ -438,6 +442,7 @@ function generateLrsBridgeCode(options) {
438
442
  var LRS_PROXY_ENDPOINT = '${lrsProxyEndpoint}';
439
443
  var DOCUMENT_GUID = '${documentGuid}';
440
444
  var VERSION_GUID = '${versionGuid}';
445
+ var PACKAGE_NAME = '${packageName}';
441
446
 
442
447
  // Bravais LRS endpoint pattern: https://lrs-{tenant}.bravais.com/XAPI/statements
443
448
  // Example: core-acme.bravais.com -> lrs-acme.bravais.com
@@ -2121,7 +2126,9 @@ function generateLrsBridgeCode(options) {
2121
2126
  sharedLinkName: null,
2122
2127
  // Tenant info
2123
2128
  homepage: COURSE_HOMEPAGE || window.location.origin,
2124
- tenantHomepage: null // https://{tenant}.bravais.com format
2129
+ tenantHomepage: null, // https://{tenant}.bravais.com format
2130
+ // Package info
2131
+ packageName: null // Original SCORM zip filename
2125
2132
  };
2126
2133
 
2127
2134
  // 0. Use baked-in GUIDs from PA-Patcher config (highest priority - set at wrap time)
@@ -2134,6 +2141,10 @@ function generateLrsBridgeCode(options) {
2134
2141
  info.versionGuid = VERSION_GUID;
2135
2142
  log('Version GUID from baked-in config:', VERSION_GUID);
2136
2143
  }
2144
+ if (PACKAGE_NAME) {
2145
+ info.packageName = PACKAGE_NAME;
2146
+ log('Package name from baked-in config:', PACKAGE_NAME);
2147
+ }
2137
2148
 
2138
2149
  // 1. Extract shared link token and document ID from URL
2139
2150
  info.sharedLinkToken = extractSharedLinkToken();
@@ -2564,6 +2575,11 @@ function generateLrsBridgeCode(options) {
2564
2575
  // Resource type
2565
2576
  obj.definition.extensions['resourceType'] = LRS.courseInfo.resourceType || 'Course';
2566
2577
 
2578
+ // Package name (original SCORM zip filename)
2579
+ if (LRS.courseInfo.packageName) {
2580
+ obj.definition.extensions['packageName'] = LRS.courseInfo.packageName;
2581
+ }
2582
+
2567
2583
  return obj;
2568
2584
  }
2569
2585
 
@@ -5029,7 +5045,8 @@ function buildJsBeforeOptions(config, metadata) {
5029
5045
  lrsProxyEndpoint: lrsBridgeConfig.lrsProxyEndpoint,
5030
5046
  employeeApiEndpoint: lrsBridgeConfig.employeeApiEndpoint,
5031
5047
  documentGuid: lrsBridgeConfig.documentGuid,
5032
- versionGuid: lrsBridgeConfig.versionGuid
5048
+ versionGuid: lrsBridgeConfig.versionGuid,
5049
+ packageName: lrsBridgeConfig.packageName
5033
5050
  };
5034
5051
  return {
5035
5052
  remoteUrl: `${config.remoteDomain}/${config.localFolders.js}/${config.jsBefore.filename}`,
@@ -6719,6 +6736,11 @@ var Patcher = class {
6719
6736
  if (effectiveSkin) {
6720
6737
  console.log(`[Patcher] Skin: ${effectiveSkin}`);
6721
6738
  }
6739
+ if (options.packageName) {
6740
+ this.config.lrsBridge = this.config.lrsBridge ?? {};
6741
+ this.config.lrsBridge.packageName = options.packageName;
6742
+ console.log(`[Patcher] Package name: ${options.packageName}`);
6743
+ }
6722
6744
  const htmlInjector = this.getHtmlInjector(toolInfo.tool);
6723
6745
  htmlInjector.setMetadata(metadata);
6724
6746
  let fetchedFallbacks = {};