@alwaysmeticulous/recorder-loader 2.70.0 → 2.72.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.
@@ -1 +1 @@
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;;GAEG;AACH,OAAO,MAAM,mCACF,aAAa,KACrB,QAAQ,IAAI,CAKd,CAAC;AAmFF;;;;GAIG;AACH,OAAO,MAAM,wKA9EV,aAAa,KAAG,QAAQ,IAAI,CA8E+B,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, tryLoadAndStartRecorder } 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;;GAEG;AACH,OAAO,MAAM,mCACF,aAAa,KACrB,QAAQ,IAAI,CAKd,CAAC;AAgFF;;;;GAIG;AACH,OAAO,MAAM,wKA3EV,aAAa,KAAG,QAAQ,IAAI,CA2E+B,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, tryLoadAndStartRecorder } from \"./loader\";\n"],"names":[],"version":3,"file":"index.d.ts.map"}
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ const $c97024bcb09807fa$var$unsafeLoadAndStartRecorder = ({ projectId: projectId
22
22
  const script = document.createElement("script");
23
23
  script.type = "text/javascript";
24
24
  const baseSnippetsUrl = snippetsBaseUrl || "https://snippet.meticulous.ai";
25
- script.src = new URL("v1/stagingMeticulousSnippetManualInit.js", baseSnippetsUrl).href;
25
+ script.src = new URL("v1/meticulous-manual-init.js", baseSnippetsUrl).href;
26
26
  // Setup configuration
27
27
  const typedWindow = window;
28
28
  typedWindow.METICULOUS_RECORDING_TOKEN = projectId;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;ACGA,MAAM,oDAA8B;AAK7B,MAAM,4CAA0B,OACrC,UACkB;IAClB,iEAAiE;IACjE,MAAM,iDAA2B,SAAS,KAAK,CAAC,CAAC,QAAU;QACzD,QAAQ,KAAK,CAAC;IAChB;AACF;AAEA,MAAM,mDAA6B,CAAC,aAClC,UAAS,oBACT,iBAAgB,6BAChB,0BAAyB,cACzB,WAAU,EACV,iBAAiB,iBAAgB,mBACjC,gBAAe,sBACf,mBAAkB,EACJ,GAAoB;IAClC,IAAI,YAAY,KAAK;IAErB,OAAO,IAAI,QAAc,CAAC,SAAS,SAAW;QAC5C,MAAM,kBAAkB,oBAAoB;QAE5C,IAAI,kBAAkB,GACpB,WAAW,IAAM;YACf,YAAY,IAAI;YAChB;QACF,GAAG;QAGL,MAAM,SAAS,SAAS,aAAa,CAAC;QACtC,OAAO,IAAI,GAAG;QACd,MAAM,kBAAkB,mBAAmB;QAC3C,OAAO,GAAG,GAAG,IAAI,IACf,4CACA,iBACA,IAAI;QAEN,sBAAsB;QACtB,MAAM,cAAc;QACpB,YAAY,0BAA0B,GAAG;QAEzC,IAAI,qBAAqB,WACvB,YAAY,6BAA6B,GAAG;QAG9C,IAAI,eAAe,WACjB,YAAY,0BAA0B,GAAG;QAG3C,IAAI,8BAA8B,WAChC,YAAY,sCAAsC,GAChD;QAGJ,IAAI,sBAAsB,IAAI,IAAI,mBAAmB,MAAM,GAAG,GAC5D,YAAY,sCAAsC,GAAG;QAGvD,OAAO,MAAM,GAAG,WAAY;YAC1B,IAAI,WAAW;gBACb,QAAQ,KAAK,CACX;gBAEF,kDAAkD;gBAClD;YACF,CAAC;YAED,MAAM,qBAAqB,OAAO,YAAY,EAAE;YAChD,IAAI,OAAO,uBAAuB,YAAY;gBAC5C,OAAO;gBACP;YACF,CAAC;YAED,IAAI;gBACF;YACF,EAAE,OAAO,OAAO;gBACd,OAAO;YACT;YAEA;QACF;QACA,OAAO,OAAO,GAAG,IAAM;YACrB,OAAO;QACT;QAEA,SAAS,IAAI,CAAC,WAAW,CAAC;IAC5B;AACF;AAOO,MAAM,4CAAuB;;ADvGpC","sources":["packages/recorder-loader/src/index.ts","packages/recorder-loader/src/loader.ts"],"sourcesContent":["export { loadAndStartRecorder, tryLoadAndStartRecorder } from \"./loader\";\n","import { MeticulousWindowConfig } from \"@alwaysmeticulous/sdk-bundles-api\";\nimport { LoaderOptions } from \"./loader.types\";\n\nconst DEFAULT_MAX_MS_TO_BLOCK_FOR = 2_000;\n\n/**\n * Load and start the Meticulous Recorder\n */\nexport const tryLoadAndStartRecorder = async (\n options: LoaderOptions\n): Promise<void> => {\n // Try to load the recorder and silence any initialisation error.\n await unsafeLoadAndStartRecorder(options).catch((error) => {\n console.error(error);\n });\n};\n\nconst unsafeLoadAndStartRecorder = ({\n projectId,\n uploadIntervalMs,\n snapshotLinkedStylesheets,\n commitHash,\n maxMsToBlockFor: maxMsToBlockFor_,\n snippetsBaseUrl,\n responseSanitizers,\n}: LoaderOptions): Promise<void> => {\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\n/**\n * @deprecated Use `tryLoadAndStartRecorder` instead.\n *\n * Load and start the Meticulous Recorder\n */\nexport const loadAndStartRecorder = unsafeLoadAndStartRecorder;\n"],"names":[],"version":3,"file":"index.js.map"}
1
+ {"mappings":";;;;;;ACGA,MAAM,oDAA8B;AAK7B,MAAM,4CAA0B,OACrC,UACkB;IAClB,iEAAiE;IACjE,MAAM,iDAA2B,SAAS,KAAK,CAAC,CAAC,QAAU;QACzD,QAAQ,KAAK,CAAC;IAChB;AACF;AAEA,MAAM,mDAA6B,CAAC,aAClC,UAAS,oBACT,iBAAgB,6BAChB,0BAAyB,cACzB,WAAU,EACV,iBAAiB,iBAAgB,mBACjC,gBAAe,sBACf,mBAAkB,EACJ,GAAoB;IAClC,IAAI,YAAY,KAAK;IAErB,OAAO,IAAI,QAAc,CAAC,SAAS,SAAW;QAC5C,MAAM,kBAAkB,oBAAoB;QAE5C,IAAI,kBAAkB,GACpB,WAAW,IAAM;YACf,YAAY,IAAI;YAChB;QACF,GAAG;QAGL,MAAM,SAAS,SAAS,aAAa,CAAC;QACtC,OAAO,IAAI,GAAG;QACd,MAAM,kBAAkB,mBAAmB;QAC3C,OAAO,GAAG,GAAG,IAAI,IAAI,gCAAgC,iBAAiB,IAAI;QAE1E,sBAAsB;QACtB,MAAM,cAAc;QACpB,YAAY,0BAA0B,GAAG;QAEzC,IAAI,qBAAqB,WACvB,YAAY,6BAA6B,GAAG;QAG9C,IAAI,eAAe,WACjB,YAAY,0BAA0B,GAAG;QAG3C,IAAI,8BAA8B,WAChC,YAAY,sCAAsC,GAChD;QAGJ,IAAI,sBAAsB,IAAI,IAAI,mBAAmB,MAAM,GAAG,GAC5D,YAAY,sCAAsC,GAAG;QAGvD,OAAO,MAAM,GAAG,WAAY;YAC1B,IAAI,WAAW;gBACb,QAAQ,KAAK,CACX;gBAEF,kDAAkD;gBAClD;YACF,CAAC;YAED,MAAM,qBAAqB,OAAO,YAAY,EAAE;YAChD,IAAI,OAAO,uBAAuB,YAAY;gBAC5C,OAAO;gBACP;YACF,CAAC;YAED,IAAI;gBACF;YACF,EAAE,OAAO,OAAO;gBACd,OAAO;YACT;YAEA;QACF;QACA,OAAO,OAAO,GAAG,IAAM;YACrB,OAAO;QACT;QAEA,SAAS,IAAI,CAAC,WAAW,CAAC;IAC5B;AACF;AAOO,MAAM,4CAAuB;;ADpGpC","sources":["packages/recorder-loader/src/index.ts","packages/recorder-loader/src/loader.ts"],"sourcesContent":["export { loadAndStartRecorder, tryLoadAndStartRecorder } from \"./loader\";\n","import { MeticulousWindowConfig } from \"@alwaysmeticulous/sdk-bundles-api\";\nimport { LoaderOptions } from \"./loader.types\";\n\nconst DEFAULT_MAX_MS_TO_BLOCK_FOR = 2_000;\n\n/**\n * Load and start the Meticulous Recorder\n */\nexport const tryLoadAndStartRecorder = async (\n options: LoaderOptions\n): Promise<void> => {\n // Try to load the recorder and silence any initialisation error.\n await unsafeLoadAndStartRecorder(options).catch((error) => {\n console.error(error);\n });\n};\n\nconst unsafeLoadAndStartRecorder = ({\n projectId,\n uploadIntervalMs,\n snapshotLinkedStylesheets,\n commitHash,\n maxMsToBlockFor: maxMsToBlockFor_,\n snippetsBaseUrl,\n responseSanitizers,\n}: LoaderOptions): Promise<void> => {\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(\"v1/meticulous-manual-init.js\", baseSnippetsUrl).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\n/**\n * @deprecated Use `tryLoadAndStartRecorder` instead.\n *\n * Load and start the Meticulous Recorder\n */\nexport const loadAndStartRecorder = unsafeLoadAndStartRecorder;\n"],"names":[],"version":3,"file":"index.js.map"}
package/dist/module.js CHANGED
@@ -16,7 +16,7 @@ const $5d774bdb3a883001$var$unsafeLoadAndStartRecorder = ({ projectId: projectId
16
16
  const script = document.createElement("script");
17
17
  script.type = "text/javascript";
18
18
  const baseSnippetsUrl = snippetsBaseUrl || "https://snippet.meticulous.ai";
19
- script.src = new URL("v1/stagingMeticulousSnippetManualInit.js", baseSnippetsUrl).href;
19
+ script.src = new URL("v1/meticulous-manual-init.js", baseSnippetsUrl).href;
20
20
  // Setup configuration
21
21
  const typedWindow = window;
22
22
  typedWindow.METICULOUS_RECORDING_TOKEN = projectId;
@@ -1 +1 @@
1
- {"mappings":"ACGA,MAAM,oDAA8B;AAK7B,MAAM,4CAA0B,OACrC,UACkB;IAClB,iEAAiE;IACjE,MAAM,iDAA2B,SAAS,KAAK,CAAC,CAAC,QAAU;QACzD,QAAQ,KAAK,CAAC;IAChB;AACF;AAEA,MAAM,mDAA6B,CAAC,aAClC,UAAS,oBACT,iBAAgB,6BAChB,0BAAyB,cACzB,WAAU,EACV,iBAAiB,iBAAgB,mBACjC,gBAAe,sBACf,mBAAkB,EACJ,GAAoB;IAClC,IAAI,YAAY,KAAK;IAErB,OAAO,IAAI,QAAc,CAAC,SAAS,SAAW;QAC5C,MAAM,kBAAkB,oBAAoB;QAE5C,IAAI,kBAAkB,GACpB,WAAW,IAAM;YACf,YAAY,IAAI;YAChB;QACF,GAAG;QAGL,MAAM,SAAS,SAAS,aAAa,CAAC;QACtC,OAAO,IAAI,GAAG;QACd,MAAM,kBAAkB,mBAAmB;QAC3C,OAAO,GAAG,GAAG,IAAI,IACf,4CACA,iBACA,IAAI;QAEN,sBAAsB;QACtB,MAAM,cAAc;QACpB,YAAY,0BAA0B,GAAG;QAEzC,IAAI,qBAAqB,WACvB,YAAY,6BAA6B,GAAG;QAG9C,IAAI,eAAe,WACjB,YAAY,0BAA0B,GAAG;QAG3C,IAAI,8BAA8B,WAChC,YAAY,sCAAsC,GAChD;QAGJ,IAAI,sBAAsB,IAAI,IAAI,mBAAmB,MAAM,GAAG,GAC5D,YAAY,sCAAsC,GAAG;QAGvD,OAAO,MAAM,GAAG,WAAY;YAC1B,IAAI,WAAW;gBACb,QAAQ,KAAK,CACX;gBAEF,kDAAkD;gBAClD;YACF,CAAC;YAED,MAAM,qBAAqB,OAAO,YAAY,EAAE;YAChD,IAAI,OAAO,uBAAuB,YAAY;gBAC5C,OAAO;gBACP;YACF,CAAC;YAED,IAAI;gBACF;YACF,EAAE,OAAO,OAAO;gBACd,OAAO;YACT;YAEA;QACF;QACA,OAAO,OAAO,GAAG,IAAM;YACrB,OAAO;QACT;QAEA,SAAS,IAAI,CAAC,WAAW,CAAC;IAC5B;AACF;AAOO,MAAM,4CAAuB;;ADvGpC","sources":["packages/recorder-loader/src/index.ts","packages/recorder-loader/src/loader.ts"],"sourcesContent":["export { loadAndStartRecorder, tryLoadAndStartRecorder } from \"./loader\";\n","import { MeticulousWindowConfig } from \"@alwaysmeticulous/sdk-bundles-api\";\nimport { LoaderOptions } from \"./loader.types\";\n\nconst DEFAULT_MAX_MS_TO_BLOCK_FOR = 2_000;\n\n/**\n * Load and start the Meticulous Recorder\n */\nexport const tryLoadAndStartRecorder = async (\n options: LoaderOptions\n): Promise<void> => {\n // Try to load the recorder and silence any initialisation error.\n await unsafeLoadAndStartRecorder(options).catch((error) => {\n console.error(error);\n });\n};\n\nconst unsafeLoadAndStartRecorder = ({\n projectId,\n uploadIntervalMs,\n snapshotLinkedStylesheets,\n commitHash,\n maxMsToBlockFor: maxMsToBlockFor_,\n snippetsBaseUrl,\n responseSanitizers,\n}: LoaderOptions): Promise<void> => {\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\n/**\n * @deprecated Use `tryLoadAndStartRecorder` instead.\n *\n * Load and start the Meticulous Recorder\n */\nexport const loadAndStartRecorder = unsafeLoadAndStartRecorder;\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":"ACGA,MAAM,oDAA8B;AAK7B,MAAM,4CAA0B,OACrC,UACkB;IAClB,iEAAiE;IACjE,MAAM,iDAA2B,SAAS,KAAK,CAAC,CAAC,QAAU;QACzD,QAAQ,KAAK,CAAC;IAChB;AACF;AAEA,MAAM,mDAA6B,CAAC,aAClC,UAAS,oBACT,iBAAgB,6BAChB,0BAAyB,cACzB,WAAU,EACV,iBAAiB,iBAAgB,mBACjC,gBAAe,sBACf,mBAAkB,EACJ,GAAoB;IAClC,IAAI,YAAY,KAAK;IAErB,OAAO,IAAI,QAAc,CAAC,SAAS,SAAW;QAC5C,MAAM,kBAAkB,oBAAoB;QAE5C,IAAI,kBAAkB,GACpB,WAAW,IAAM;YACf,YAAY,IAAI;YAChB;QACF,GAAG;QAGL,MAAM,SAAS,SAAS,aAAa,CAAC;QACtC,OAAO,IAAI,GAAG;QACd,MAAM,kBAAkB,mBAAmB;QAC3C,OAAO,GAAG,GAAG,IAAI,IAAI,gCAAgC,iBAAiB,IAAI;QAE1E,sBAAsB;QACtB,MAAM,cAAc;QACpB,YAAY,0BAA0B,GAAG;QAEzC,IAAI,qBAAqB,WACvB,YAAY,6BAA6B,GAAG;QAG9C,IAAI,eAAe,WACjB,YAAY,0BAA0B,GAAG;QAG3C,IAAI,8BAA8B,WAChC,YAAY,sCAAsC,GAChD;QAGJ,IAAI,sBAAsB,IAAI,IAAI,mBAAmB,MAAM,GAAG,GAC5D,YAAY,sCAAsC,GAAG;QAGvD,OAAO,MAAM,GAAG,WAAY;YAC1B,IAAI,WAAW;gBACb,QAAQ,KAAK,CACX;gBAEF,kDAAkD;gBAClD;YACF,CAAC;YAED,MAAM,qBAAqB,OAAO,YAAY,EAAE;YAChD,IAAI,OAAO,uBAAuB,YAAY;gBAC5C,OAAO;gBACP;YACF,CAAC;YAED,IAAI;gBACF;YACF,EAAE,OAAO,OAAO;gBACd,OAAO;YACT;YAEA;QACF;QACA,OAAO,OAAO,GAAG,IAAM;YACrB,OAAO;QACT;QAEA,SAAS,IAAI,CAAC,WAAW,CAAC;IAC5B;AACF;AAOO,MAAM,4CAAuB;;ADpGpC","sources":["packages/recorder-loader/src/index.ts","packages/recorder-loader/src/loader.ts"],"sourcesContent":["export { loadAndStartRecorder, tryLoadAndStartRecorder } from \"./loader\";\n","import { MeticulousWindowConfig } from \"@alwaysmeticulous/sdk-bundles-api\";\nimport { LoaderOptions } from \"./loader.types\";\n\nconst DEFAULT_MAX_MS_TO_BLOCK_FOR = 2_000;\n\n/**\n * Load and start the Meticulous Recorder\n */\nexport const tryLoadAndStartRecorder = async (\n options: LoaderOptions\n): Promise<void> => {\n // Try to load the recorder and silence any initialisation error.\n await unsafeLoadAndStartRecorder(options).catch((error) => {\n console.error(error);\n });\n};\n\nconst unsafeLoadAndStartRecorder = ({\n projectId,\n uploadIntervalMs,\n snapshotLinkedStylesheets,\n commitHash,\n maxMsToBlockFor: maxMsToBlockFor_,\n snippetsBaseUrl,\n responseSanitizers,\n}: LoaderOptions): Promise<void> => {\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(\"v1/meticulous-manual-init.js\", baseSnippetsUrl).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\n/**\n * @deprecated Use `tryLoadAndStartRecorder` instead.\n *\n * Load and start the Meticulous Recorder\n */\nexport const loadAndStartRecorder = unsafeLoadAndStartRecorder;\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.70.0",
3
+ "version": "2.72.0",
4
4
  "license": "ISC",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -20,7 +20,7 @@
20
20
  "depcheck": "depcheck --ignore-patterns=dist"
21
21
  },
22
22
  "devDependencies": {
23
- "@alwaysmeticulous/sdk-bundles-api": "^2.70.0"
23
+ "@alwaysmeticulous/sdk-bundles-api": "^2.72.0"
24
24
  },
25
25
  "author": {
26
26
  "name": "The Meticulous Team",
@@ -36,5 +36,5 @@
36
36
  "bugs": {
37
37
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
38
38
  },
39
- "gitHead": "f6b1b6f2e2f513d53c3cb427644bbb2afa928741"
39
+ "gitHead": "f39fc34ba27a6f530d670b5282a9bc3afca63e9f"
40
40
  }