@alwaysmeticulous/recorder-loader 2.25.0 → 2.26.0

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.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { NetworkResponseSanitizer } from "@alwaysmeticulous/sdk-bundles-api";
1
2
  interface LoaderOptions {
2
3
  projectId: string;
3
4
  uploadIntervalMs?: number;
@@ -5,6 +6,10 @@ interface LoaderOptions {
5
6
  commitHash?: string;
6
7
  maxMsToBlockFor?: number;
7
8
  snippetsBaseUrl?: string;
9
+ /**
10
+ * Optional. Allows sanitizing network responses before they are sent to Meticulous's servers.
11
+ */
12
+ responseSanitizers?: NetworkResponseSanitizer[];
8
13
  }
9
14
  export const loadAndStartRecorder: (options: LoaderOptions) => Promise<void>;
10
15
 
@@ -1 +1 @@
1
- {"mappings":"AAAA;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;ACJD,OAAO,MAAM,sBAAsB,CACjC,OAAO,EAAE,aAAa,KACnB,OAAO,CAAC,IAAI,CAyEhB,CAAC","sources":["packages/recorder-loader/src/src/loader.types.ts","packages/recorder-loader/src/src/loader.ts","packages/recorder-loader/src/src/index.ts","packages/recorder-loader/src/index.ts"],"sourcesContent":[null,null,null,"export { loadAndStartRecorder } from \"./loader\";\n"],"names":[],"version":3,"file":"index.d.ts.map"}
1
+ {"mappings":";AAEA;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACjD;ACVD,OAAO,MAAM,sBAAsB,CACjC,OAAO,EAAE,aAAa,KACnB,OAAO,CAAC,IAAI,CA+EhB,CAAC","sources":["packages/recorder-loader/src/src/loader.types.ts","packages/recorder-loader/src/src/loader.ts","packages/recorder-loader/src/src/index.ts","packages/recorder-loader/src/index.ts"],"sourcesContent":[null,null,null,"export { loadAndStartRecorder } from \"./loader\";\n"],"names":[],"version":3,"file":"index.d.ts.map"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ function $parcel$export(e, n, v, s) {
4
4
 
5
5
  $parcel$export(module.exports, "loadAndStartRecorder", () => $c97024bcb09807fa$export$9da0cde53b499187);
6
6
  const $c97024bcb09807fa$var$DEFAULT_MAX_MS_TO_BLOCK_FOR = 2000;
7
- const $c97024bcb09807fa$export$9da0cde53b499187 = ({ projectId: projectId , uploadIntervalMs: uploadIntervalMs , snapshotLinkedStylesheets: snapshotLinkedStylesheets , commitHash: commitHash , maxMsToBlockFor: maxMsToBlockFor_ , snippetsBaseUrl: snippetsBaseUrl , })=>{
7
+ const $c97024bcb09807fa$export$9da0cde53b499187 = ({ projectId: projectId , uploadIntervalMs: uploadIntervalMs , snapshotLinkedStylesheets: snapshotLinkedStylesheets , commitHash: commitHash , maxMsToBlockFor: maxMsToBlockFor_ , snippetsBaseUrl: snippetsBaseUrl , responseSanitizers: responseSanitizers , })=>{
8
8
  let abandoned = false;
9
9
  return new Promise((resolve, reject)=>{
10
10
  const maxMsToBlockFor = maxMsToBlockFor_ ?? $c97024bcb09807fa$var$DEFAULT_MAX_MS_TO_BLOCK_FOR;
@@ -17,10 +17,12 @@ const $c97024bcb09807fa$export$9da0cde53b499187 = ({ projectId: projectId , uplo
17
17
  const baseSnippetsUrl = snippetsBaseUrl || "https://snippet.meticulous.ai";
18
18
  script.src = new URL("v1/stagingMeticulousSnippetManualInit.js", baseSnippetsUrl).href;
19
19
  // Setup configuration
20
- window["METICULOUS_RECORDING_TOKEN"] = projectId;
21
- if (uploadIntervalMs !== undefined) window["METICULOUS_UPLOAD_INTERVAL_MS"] = uploadIntervalMs;
22
- if (commitHash !== undefined) window["METICULOUS_APP_COMMIT_HASH"] = commitHash;
23
- if (snapshotLinkedStylesheets !== undefined) window["METICULOUS_SNAPSHOT_LINKED_STYLESHEETS"] = snapshotLinkedStylesheets;
20
+ const typedWindow = window;
21
+ typedWindow.METICULOUS_RECORDING_TOKEN = projectId;
22
+ if (uploadIntervalMs !== undefined) typedWindow.METICULOUS_UPLOAD_INTERVAL_MS = uploadIntervalMs;
23
+ if (commitHash !== undefined) typedWindow.METICULOUS_APP_COMMIT_HASH = commitHash;
24
+ if (snapshotLinkedStylesheets !== undefined) typedWindow.METICULOUS_SNAPSHOT_LINKED_STYLESHEETS = snapshotLinkedStylesheets;
25
+ if (responseSanitizers != null && responseSanitizers.length > 0) typedWindow.METICULOUS_NETWORK_RESPONSE_SANITIZERS = responseSanitizers;
24
26
  script.onload = function() {
25
27
  if (abandoned) {
26
28
  console.debug("Meticulous snippet abandoned due to max blocking time reached.");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;ACEA,MAAM,iDAA2B,GAAG,IAAI,AAAC;AAElC,MAAM,yCAAoB,GAEZ,CAAC,aACpB,SAAS,CAAA,oBACT,gBAAgB,CAAA,6BAChB,yBAAyB,CAAA,cACzB,UAAU,CAAA,EACV,eAAe,EAAE,gBAAgB,CAAA,mBACjC,eAAe,CAAA,IAChB,GAAK;IACJ,IAAI,SAAS,GAAG,KAAK,AAAC;IAEtB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,GAAK;QAC5C,MAAM,eAAe,GAAG,gBAAgB,IAAI,iDAA2B,AAAC;QAExE,IAAI,eAAe,GAAG,CAAC,EACrB,UAAU,CAAC,IAAM;YACf,SAAS,GAAG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AAM,CAAC,CAAC;KACnC,CAAC,CAAC;CACJ,AAAC;;AD/EF","sources":["packages/recorder-loader/src/index.ts","packages/recorder-loader/src/loader.ts"],"sourcesContent":["export { loadAndStartRecorder } from \"./loader\";\n","import { LoaderOptions } from \"./loader.types\";\n\nconst DEFAULT_MAX_MS_TO_BLOCK_FOR = 2000;\n\nexport const loadAndStartRecorder: (\n options: LoaderOptions\n) => Promise<void> = ({\n projectId,\n uploadIntervalMs,\n snapshotLinkedStylesheets,\n commitHash,\n maxMsToBlockFor: maxMsToBlockFor_,\n snippetsBaseUrl,\n}) => {\n let abandoned = false;\n\n return new Promise<void>((resolve, reject) => {\n const maxMsToBlockFor = maxMsToBlockFor_ ?? DEFAULT_MAX_MS_TO_BLOCK_FOR;\n\n if (maxMsToBlockFor > 0) {\n setTimeout(() => {\n abandoned = true;\n resolve();\n }, maxMsToBlockFor);\n }\n\n const script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n const baseSnippetsUrl = snippetsBaseUrl || \"https://snippet.meticulous.ai\";\n script.src = new URL(\n \"v1/stagingMeticulousSnippetManualInit.js\",\n baseSnippetsUrl\n ).href;\n\n // Setup configuration\n window[\"METICULOUS_RECORDING_TOKEN\"] = projectId;\n\n if (uploadIntervalMs !== undefined) {\n window[\"METICULOUS_UPLOAD_INTERVAL_MS\"] = uploadIntervalMs;\n }\n\n if (commitHash !== undefined) {\n window[\"METICULOUS_APP_COMMIT_HASH\"] = commitHash;\n }\n\n if (snapshotLinkedStylesheets !== undefined) {\n window[\"METICULOUS_SNAPSHOT_LINKED_STYLESHEETS\"] =\n snapshotLinkedStylesheets;\n }\n\n script.onload = function () {\n if (abandoned) {\n console.debug(\n \"Meticulous snippet abandoned due to max blocking time reached.\"\n );\n // At this point the promise has already resolved.\n return;\n }\n\n const initialiseRecorder = window.__meticulous?.initialiseRecorder;\n if (typeof initialiseRecorder !== \"function\") {\n reject(\"Meticulous recorder failed to initialise.\");\n return;\n }\n\n try {\n initialiseRecorder();\n } catch (error) {\n reject(error);\n }\n\n resolve();\n };\n script.onerror = () => {\n reject(\"Meticulous recorder failed to initialise.\");\n };\n\n document.head.appendChild(script);\n });\n};\n"],"names":[],"version":3,"file":"index.js.map"}
1
+ {"mappings":";;;;;ACGA,MAAM,iDAA2B,GAAG,IAAI,AAAC;AAElC,MAAM,yCAAoB,GAEZ,CAAC,aACpB,SAAS,CAAA,oBACT,gBAAgB,CAAA,6BAChB,yBAAyB,CAAA,cACzB,UAAU,CAAA,EACV,eAAe,EAAE,gBAAgB,CAAA,mBACjC,eAAe,CAAA,sBACf,kBAAkB,CAAA,IACnB,GAAK;IACJ,IAAI,SAAS,GAAG,KAAK,AAAC;IAEtB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,GAAK;QAC5C,MAAM,eAAe,GAAG,gBAAgB,IAAI,iDAA2B,AAAC;QAExE,IAAI,eAAe,GAAG,CAAC,EACrB,UAAU,CAAC,IAAM;YACf,SAAS,GAAG,IAAI,CAAC;YACjB,OAAO,EAAE,CAAC;SACX,EAAE,eAAe,CAAC,CAAC;QAGtB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,AAAC;QAChD,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAChC,MAAM,eAAe,GAAG,eAAe,IAAI,+BAA+B,AAAC;QAC3E,MAAM,CAAC,GAAG,GAAG,IAAI,GAAG,CAClB,0CAA0C,EAC1C,eAAe,CAChB,CAAC,IAAI,CAAC;QAEP,sBAAsB;QACtB,MAAM,WAAW,GAAG,MAAM,AAA0B,AAAC;QACrD,WAAW,CAAC,0BAA0B,GAAG,SAAS,CAAC;QAEnD,IAAI,gBAAgB,KAAK,SAAS,EAChC,WAAW,CAAC,6BAA6B,GAAG,gBAAgB,CAAC;QAG/D,IAAI,UAAU,KAAK,SAAS,EAC1B,WAAW,CAAC,0BAA0B,GAAG,UAAU,CAAC;QAGtD,IAAI,yBAAyB,KAAK,SAAS,EACzC,WAAW,CAAC,sCAAsC,GAChD,yBAAyB,CAAC;QAG9B,IAAI,kBAAkB,IAAI,IAAI,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAC7D,WAAW,CAAC,sCAAsC,GAAG,kBAAkB,CAAC;QAG1E,MAAM,CAAC,MAAM,GAAG,WAAY;YAC1B,IAAI,SAAS,EAAE;gBACb,OAAO,CAAC,KAAK,CACX,gEAAgE,CACjE,CAAC;gBACF,kDAAkD;gBAClD,OAAO;aACR;YAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,YAAY,EAAE,kBAAkB,AAAC;YACnE,IAAI,OAAO,kBAAkB,KAAK,UAAU,EAAE;gBAC5C,MAAM,CAAC,2CAA2C,CAAC,CAAC;gBACpD,OAAO;aACR;YAED,IAAI;gBACF,kBAAkB,EAAE,CAAC;aACtB,CAAC,OAAO,KAAK,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,CAAC;aACf;YAED,OAAO,EAAE,CAAC;SACX,CAAC;QACF,MAAM,CAAC,OAAO,GAAG,IAAM;YACrB,MAAM,CAAC,2CAA2C,CAAC,CAAC;SACrD,CAAC;QAEF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KACnC,CAAC,CAAC;CACJ,AAAC;;ADtFF","sources":["packages/recorder-loader/src/index.ts","packages/recorder-loader/src/loader.ts"],"sourcesContent":["export { loadAndStartRecorder } from \"./loader\";\n","import { MeticulousWindowConfig } from \"@alwaysmeticulous/sdk-bundles-api\";\nimport { LoaderOptions } from \"./loader.types\";\n\nconst DEFAULT_MAX_MS_TO_BLOCK_FOR = 2000;\n\nexport const loadAndStartRecorder: (\n options: LoaderOptions\n) => Promise<void> = ({\n projectId,\n uploadIntervalMs,\n snapshotLinkedStylesheets,\n commitHash,\n maxMsToBlockFor: maxMsToBlockFor_,\n snippetsBaseUrl,\n responseSanitizers,\n}) => {\n let abandoned = false;\n\n return new Promise<void>((resolve, reject) => {\n const maxMsToBlockFor = maxMsToBlockFor_ ?? DEFAULT_MAX_MS_TO_BLOCK_FOR;\n\n if (maxMsToBlockFor > 0) {\n setTimeout(() => {\n abandoned = true;\n resolve();\n }, maxMsToBlockFor);\n }\n\n const script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n const baseSnippetsUrl = snippetsBaseUrl || \"https://snippet.meticulous.ai\";\n script.src = new URL(\n \"v1/stagingMeticulousSnippetManualInit.js\",\n baseSnippetsUrl\n ).href;\n\n // Setup configuration\n const typedWindow = window as MeticulousWindowConfig;\n typedWindow.METICULOUS_RECORDING_TOKEN = projectId;\n\n if (uploadIntervalMs !== undefined) {\n typedWindow.METICULOUS_UPLOAD_INTERVAL_MS = uploadIntervalMs;\n }\n\n if (commitHash !== undefined) {\n typedWindow.METICULOUS_APP_COMMIT_HASH = commitHash;\n }\n\n if (snapshotLinkedStylesheets !== undefined) {\n typedWindow.METICULOUS_SNAPSHOT_LINKED_STYLESHEETS =\n snapshotLinkedStylesheets;\n }\n\n if (responseSanitizers != null && responseSanitizers.length > 0) {\n typedWindow.METICULOUS_NETWORK_RESPONSE_SANITIZERS = responseSanitizers;\n }\n\n script.onload = function () {\n if (abandoned) {\n console.debug(\n \"Meticulous snippet abandoned due to max blocking time reached.\"\n );\n // At this point the promise has already resolved.\n return;\n }\n\n const initialiseRecorder = window.__meticulous?.initialiseRecorder;\n if (typeof initialiseRecorder !== \"function\") {\n reject(\"Meticulous recorder failed to initialise.\");\n return;\n }\n\n try {\n initialiseRecorder();\n } catch (error) {\n reject(error);\n }\n\n resolve();\n };\n script.onerror = () => {\n reject(\"Meticulous recorder failed to initialise.\");\n };\n\n document.head.appendChild(script);\n });\n};\n"],"names":[],"version":3,"file":"index.js.map"}
package/dist/module.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const $5d774bdb3a883001$var$DEFAULT_MAX_MS_TO_BLOCK_FOR = 2000;
2
- const $5d774bdb3a883001$export$9da0cde53b499187 = ({ projectId: projectId , uploadIntervalMs: uploadIntervalMs , snapshotLinkedStylesheets: snapshotLinkedStylesheets , commitHash: commitHash , maxMsToBlockFor: maxMsToBlockFor_ , snippetsBaseUrl: snippetsBaseUrl , })=>{
2
+ const $5d774bdb3a883001$export$9da0cde53b499187 = ({ projectId: projectId , uploadIntervalMs: uploadIntervalMs , snapshotLinkedStylesheets: snapshotLinkedStylesheets , commitHash: commitHash , maxMsToBlockFor: maxMsToBlockFor_ , snippetsBaseUrl: snippetsBaseUrl , responseSanitizers: responseSanitizers , })=>{
3
3
  let abandoned = false;
4
4
  return new Promise((resolve, reject)=>{
5
5
  const maxMsToBlockFor = maxMsToBlockFor_ ?? $5d774bdb3a883001$var$DEFAULT_MAX_MS_TO_BLOCK_FOR;
@@ -12,10 +12,12 @@ const $5d774bdb3a883001$export$9da0cde53b499187 = ({ projectId: projectId , uplo
12
12
  const baseSnippetsUrl = snippetsBaseUrl || "https://snippet.meticulous.ai";
13
13
  script.src = new URL("v1/stagingMeticulousSnippetManualInit.js", baseSnippetsUrl).href;
14
14
  // Setup configuration
15
- window["METICULOUS_RECORDING_TOKEN"] = projectId;
16
- if (uploadIntervalMs !== undefined) window["METICULOUS_UPLOAD_INTERVAL_MS"] = uploadIntervalMs;
17
- if (commitHash !== undefined) window["METICULOUS_APP_COMMIT_HASH"] = commitHash;
18
- if (snapshotLinkedStylesheets !== undefined) window["METICULOUS_SNAPSHOT_LINKED_STYLESHEETS"] = snapshotLinkedStylesheets;
15
+ const typedWindow = window;
16
+ typedWindow.METICULOUS_RECORDING_TOKEN = projectId;
17
+ if (uploadIntervalMs !== undefined) typedWindow.METICULOUS_UPLOAD_INTERVAL_MS = uploadIntervalMs;
18
+ if (commitHash !== undefined) typedWindow.METICULOUS_APP_COMMIT_HASH = commitHash;
19
+ if (snapshotLinkedStylesheets !== undefined) typedWindow.METICULOUS_SNAPSHOT_LINKED_STYLESHEETS = snapshotLinkedStylesheets;
20
+ if (responseSanitizers != null && responseSanitizers.length > 0) typedWindow.METICULOUS_NETWORK_RESPONSE_SANITIZERS = responseSanitizers;
19
21
  script.onload = function() {
20
22
  if (abandoned) {
21
23
  console.debug("Meticulous snippet abandoned due to max blocking time reached.");
@@ -1 +1 @@
1
- {"mappings":"ACEA,MAAM,iDAA2B,GAAG,IAAI,AAAC;AAElC,MAAM,yCAAoB,GAEZ,CAAC,aACpB,SAAS,CAAA,oBACT,gBAAgB,CAAA,6BAChB,yBAAyB,CAAA,cACzB,UAAU,CAAA,EACV,eAAe,EAAE,gBAAgB,CAAA,mBACjC,eAAe,CAAA,IAChB,GAAK;IACJ,IAAI,SAAS,GAAG,KAAK,AAAC;IAEtB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,GAAK;QAC5C,MAAM,eAAe,GAAG,gBAAgB,IAAI,iDAA2B,AAAC;QAExE,IAAI,eAAe,GAAG,CAAC,EACrB,UAAU,CAAC,IAAM;YACf,SAAS,GAAG,IAAI,CAAC;YACjB,OAAO,EAAE,CAAC;SACX,EAAE,eAAe,CAAC,CAAC;QAGtB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,AAAC;QAChD,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAChC,MAAM,eAAe,GAAG,eAAe,IAAI,+BAA+B,AAAC;QAC3E,MAAM,CAAC,GAAG,GAAG,IAAI,GAAG,CAClB,0CAA0C,EAC1C,eAAe,CAChB,CAAC,IAAI,CAAC;QAEP,sBAAsB;QACtB,MAAM,CAAC,4BAA4B,CAAC,GAAG,SAAS,CAAC;QAEjD,IAAI,gBAAgB,KAAK,SAAS,EAChC,MAAM,CAAC,+BAA+B,CAAC,GAAG,gBAAgB,CAAC;QAG7D,IAAI,UAAU,KAAK,SAAS,EAC1B,MAAM,CAAC,4BAA4B,CAAC,GAAG,UAAU,CAAC;QAGpD,IAAI,yBAAyB,KAAK,SAAS,EACzC,MAAM,CAAC,wCAAwC,CAAC,GAC9C,yBAAyB,CAAC;QAG9B,MAAM,CAAC,MAAM,GAAG,WAAY;YAC1B,IAAI,SAAS,EAAE;gBACb,OAAO,CAAC,KAAK,CACX,gEAAgE,CACjE,CAAC;gBACF,kDAAkD;gBAClD,OAAO;aACR;YAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,YAAY,EAAE,kBAAkB,AAAC;YACnE,IAAI,OAAO,kBAAkB,KAAK,UAAU,EAAE;gBAC5C,MAAM,CAAC,2CAA2C,CAAC,CAAC;gBACpD,OAAO;aACR;YAED,IAAI;gBACF,kBAAkB,EAAE,CAAC;aACtB,CAAC,OAAO,KAAK,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,CAAC;aACf;YAED,OAAO,EAAE,CAAC;SACX,CAAC;QACF,MAAM,CAAC,OAAO,GAAG,IAAM;YACrB,MAAM,CAAC,2CAA2C,CAAC,CAAC;SACrD,CAAC;QAEF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KACnC,CAAC,CAAC;CACJ,AAAC;;AD/EF","sources":["packages/recorder-loader/src/index.ts","packages/recorder-loader/src/loader.ts"],"sourcesContent":["export { loadAndStartRecorder } from \"./loader\";\n","import { LoaderOptions } from \"./loader.types\";\n\nconst DEFAULT_MAX_MS_TO_BLOCK_FOR = 2000;\n\nexport const loadAndStartRecorder: (\n options: LoaderOptions\n) => Promise<void> = ({\n projectId,\n uploadIntervalMs,\n snapshotLinkedStylesheets,\n commitHash,\n maxMsToBlockFor: maxMsToBlockFor_,\n snippetsBaseUrl,\n}) => {\n let abandoned = false;\n\n return new Promise<void>((resolve, reject) => {\n const maxMsToBlockFor = maxMsToBlockFor_ ?? DEFAULT_MAX_MS_TO_BLOCK_FOR;\n\n if (maxMsToBlockFor > 0) {\n setTimeout(() => {\n abandoned = true;\n resolve();\n }, maxMsToBlockFor);\n }\n\n const script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n const baseSnippetsUrl = snippetsBaseUrl || \"https://snippet.meticulous.ai\";\n script.src = new URL(\n \"v1/stagingMeticulousSnippetManualInit.js\",\n baseSnippetsUrl\n ).href;\n\n // Setup configuration\n window[\"METICULOUS_RECORDING_TOKEN\"] = projectId;\n\n if (uploadIntervalMs !== undefined) {\n window[\"METICULOUS_UPLOAD_INTERVAL_MS\"] = uploadIntervalMs;\n }\n\n if (commitHash !== undefined) {\n window[\"METICULOUS_APP_COMMIT_HASH\"] = commitHash;\n }\n\n if (snapshotLinkedStylesheets !== undefined) {\n window[\"METICULOUS_SNAPSHOT_LINKED_STYLESHEETS\"] =\n snapshotLinkedStylesheets;\n }\n\n script.onload = function () {\n if (abandoned) {\n console.debug(\n \"Meticulous snippet abandoned due to max blocking time reached.\"\n );\n // At this point the promise has already resolved.\n return;\n }\n\n const initialiseRecorder = window.__meticulous?.initialiseRecorder;\n if (typeof initialiseRecorder !== \"function\") {\n reject(\"Meticulous recorder failed to initialise.\");\n return;\n }\n\n try {\n initialiseRecorder();\n } catch (error) {\n reject(error);\n }\n\n resolve();\n };\n script.onerror = () => {\n reject(\"Meticulous recorder failed to initialise.\");\n };\n\n document.head.appendChild(script);\n });\n};\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":"ACGA,MAAM,iDAA2B,GAAG,IAAI,AAAC;AAElC,MAAM,yCAAoB,GAEZ,CAAC,aACpB,SAAS,CAAA,oBACT,gBAAgB,CAAA,6BAChB,yBAAyB,CAAA,cACzB,UAAU,CAAA,EACV,eAAe,EAAE,gBAAgB,CAAA,mBACjC,eAAe,CAAA,sBACf,kBAAkB,CAAA,IACnB,GAAK;IACJ,IAAI,SAAS,GAAG,KAAK,AAAC;IAEtB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,GAAK;QAC5C,MAAM,eAAe,GAAG,gBAAgB,IAAI,iDAA2B,AAAC;QAExE,IAAI,eAAe,GAAG,CAAC,EACrB,UAAU,CAAC,IAAM;YACf,SAAS,GAAG,IAAI,CAAC;YACjB,OAAO,EAAE,CAAC;SACX,EAAE,eAAe,CAAC,CAAC;QAGtB,M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,CAAC;SACrD,CAAC;QAEF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KACnC,CAAC,CAAC;CACJ,AAAC;;ADtFF","sources":["packages/recorder-loader/src/index.ts","packages/recorder-loader/src/loader.ts"],"sourcesContent":["export { loadAndStartRecorder } from \"./loader\";\n","import { MeticulousWindowConfig } from \"@alwaysmeticulous/sdk-bundles-api\";\nimport { LoaderOptions } from \"./loader.types\";\n\nconst DEFAULT_MAX_MS_TO_BLOCK_FOR = 2000;\n\nexport const loadAndStartRecorder: (\n options: LoaderOptions\n) => Promise<void> = ({\n projectId,\n uploadIntervalMs,\n snapshotLinkedStylesheets,\n commitHash,\n maxMsToBlockFor: maxMsToBlockFor_,\n snippetsBaseUrl,\n responseSanitizers,\n}) => {\n let abandoned = false;\n\n return new Promise<void>((resolve, reject) => {\n const maxMsToBlockFor = maxMsToBlockFor_ ?? DEFAULT_MAX_MS_TO_BLOCK_FOR;\n\n if (maxMsToBlockFor > 0) {\n setTimeout(() => {\n abandoned = true;\n resolve();\n }, maxMsToBlockFor);\n }\n\n const script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n const baseSnippetsUrl = snippetsBaseUrl || \"https://snippet.meticulous.ai\";\n script.src = new URL(\n \"v1/stagingMeticulousSnippetManualInit.js\",\n baseSnippetsUrl\n ).href;\n\n // Setup configuration\n const typedWindow = window as MeticulousWindowConfig;\n typedWindow.METICULOUS_RECORDING_TOKEN = projectId;\n\n if (uploadIntervalMs !== undefined) {\n typedWindow.METICULOUS_UPLOAD_INTERVAL_MS = uploadIntervalMs;\n }\n\n if (commitHash !== undefined) {\n typedWindow.METICULOUS_APP_COMMIT_HASH = commitHash;\n }\n\n if (snapshotLinkedStylesheets !== undefined) {\n typedWindow.METICULOUS_SNAPSHOT_LINKED_STYLESHEETS =\n snapshotLinkedStylesheets;\n }\n\n if (responseSanitizers != null && responseSanitizers.length > 0) {\n typedWindow.METICULOUS_NETWORK_RESPONSE_SANITIZERS = responseSanitizers;\n }\n\n script.onload = function () {\n if (abandoned) {\n console.debug(\n \"Meticulous snippet abandoned due to max blocking time reached.\"\n );\n // At this point the promise has already resolved.\n return;\n }\n\n const initialiseRecorder = window.__meticulous?.initialiseRecorder;\n if (typeof initialiseRecorder !== \"function\") {\n reject(\"Meticulous recorder failed to initialise.\");\n return;\n }\n\n try {\n initialiseRecorder();\n } catch (error) {\n reject(error);\n }\n\n resolve();\n };\n script.onerror = () => {\n reject(\"Meticulous recorder failed to initialise.\");\n };\n\n document.head.appendChild(script);\n });\n};\n"],"names":[],"version":3,"file":"module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/recorder-loader",
3
- "version": "2.25.0",
3
+ "version": "2.26.0",
4
4
  "license": "ISC",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "lint:fix": "eslint src --ext=ts,tsx,js --cache --fix"
20
20
  },
21
21
  "devDependencies": {
22
- "@alwaysmeticulous/sdk-bundles-api": "^2.25.0"
22
+ "@alwaysmeticulous/sdk-bundles-api": "^2.26.0"
23
23
  },
24
24
  "author": {
25
25
  "name": "The Meticulous Team",
@@ -35,5 +35,5 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
37
37
  },
38
- "gitHead": "26cdd6f9fe277d23b344cc88eb9da6123a88a3d9"
38
+ "gitHead": "e2537377f68c00b3db4afa3708b93f44239980af"
39
39
  }