@cloudcare/browser-core 3.1.1 → 3.1.3

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.
Files changed (71) hide show
  1. package/cjs/browser/htmlDomUtils.js +13 -4
  2. package/cjs/browser/htmlDomUtils.js.map +1 -1
  3. package/cjs/configuration/configuration.js +3 -1
  4. package/cjs/configuration/configuration.js.map +1 -1
  5. package/cjs/dataMap.js +7 -3
  6. package/cjs/dataMap.js.map +1 -1
  7. package/cjs/helper/enums.js +2 -1
  8. package/cjs/helper/enums.js.map +1 -1
  9. package/cjs/helper/errorTools.js +2 -1
  10. package/cjs/helper/errorTools.js.map +1 -1
  11. package/cjs/helper/monitor.js +1 -0
  12. package/cjs/helper/monitor.js.map +1 -1
  13. package/cjs/helper/serialisation/contextManager.js +20 -5
  14. package/cjs/helper/serialisation/contextManager.js.map +1 -1
  15. package/cjs/helper/serialisation/rowData.js +7 -5
  16. package/cjs/helper/serialisation/rowData.js.map +1 -1
  17. package/cjs/helper/serialisation/storedContextManager.js +47 -0
  18. package/cjs/helper/serialisation/storedContextManager.js.map +1 -0
  19. package/cjs/helper/tools.js +19 -3
  20. package/cjs/helper/tools.js.map +1 -1
  21. package/cjs/index.js +11 -0
  22. package/cjs/index.js.map +1 -1
  23. package/cjs/transport/batch.js +23 -10
  24. package/cjs/transport/batch.js.map +1 -1
  25. package/cjs/transport/httpRequest.js +31 -12
  26. package/cjs/transport/httpRequest.js.map +1 -1
  27. package/cjs/transport/startBatchWithReplica.js +2 -2
  28. package/cjs/transport/startBatchWithReplica.js.map +1 -1
  29. package/esm/browser/htmlDomUtils.js +11 -3
  30. package/esm/browser/htmlDomUtils.js.map +1 -1
  31. package/esm/configuration/configuration.js +3 -1
  32. package/esm/configuration/configuration.js.map +1 -1
  33. package/esm/dataMap.js +7 -3
  34. package/esm/dataMap.js.map +1 -1
  35. package/esm/helper/enums.js +2 -1
  36. package/esm/helper/enums.js.map +1 -1
  37. package/esm/helper/errorTools.js +1 -0
  38. package/esm/helper/errorTools.js.map +1 -1
  39. package/esm/helper/monitor.js +1 -0
  40. package/esm/helper/monitor.js.map +1 -1
  41. package/esm/helper/serialisation/contextManager.js +21 -6
  42. package/esm/helper/serialisation/contextManager.js.map +1 -1
  43. package/esm/helper/serialisation/rowData.js +8 -6
  44. package/esm/helper/serialisation/rowData.js.map +1 -1
  45. package/esm/helper/serialisation/storedContextManager.js +39 -0
  46. package/esm/helper/serialisation/storedContextManager.js.map +1 -0
  47. package/esm/helper/tools.js +18 -3
  48. package/esm/helper/tools.js.map +1 -1
  49. package/esm/index.js +1 -0
  50. package/esm/index.js.map +1 -1
  51. package/esm/transport/batch.js +24 -11
  52. package/esm/transport/batch.js.map +1 -1
  53. package/esm/transport/httpRequest.js +31 -12
  54. package/esm/transport/httpRequest.js.map +1 -1
  55. package/esm/transport/startBatchWithReplica.js +2 -2
  56. package/esm/transport/startBatchWithReplica.js.map +1 -1
  57. package/package.json +2 -2
  58. package/src/browser/htmlDomUtils.js +11 -4
  59. package/src/configuration/configuration.js +3 -1
  60. package/src/dataMap.js +9 -3
  61. package/src/helper/enums.js +2 -1
  62. package/src/helper/errorTools.js +1 -0
  63. package/src/helper/monitor.js +1 -0
  64. package/src/helper/serialisation/contextManager.js +21 -6
  65. package/src/helper/serialisation/rowData.js +9 -6
  66. package/src/helper/serialisation/storedContextManager.js +56 -0
  67. package/src/helper/tools.js +19 -4
  68. package/src/index.js +1 -0
  69. package/src/transport/batch.js +28 -12
  70. package/src/transport/httpRequest.js +46 -11
  71. package/src/transport/startBatchWithReplica.js +3 -1
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getChildNodes = getChildNodes;
6
+ exports.forEachChildNodes = forEachChildNodes;
7
7
  exports.getParentNode = getParentNode;
8
+ exports.hasChildNodes = hasChildNodes;
8
9
  exports.isCommentNode = isCommentNode;
9
10
  exports.isElementNode = isElementNode;
10
11
  exports.isNodeShadowHost = isNodeShadowHost;
@@ -26,10 +27,18 @@ function isNodeShadowRoot(node) {
26
27
  var shadowRoot = node;
27
28
  return !!shadowRoot.host && shadowRoot.nodeType === Node.DOCUMENT_FRAGMENT_NODE && isElementNode(shadowRoot.host);
28
29
  }
29
- function getChildNodes(node) {
30
- return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes;
30
+ function hasChildNodes(node) {
31
+ return node.childNodes.length > 0 || isNodeShadowHost(node);
32
+ }
33
+ // export function getChildNodes(node) {
34
+ // return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes
35
+ // }
36
+ function forEachChildNodes(node, callback) {
37
+ node.childNodes.forEach(callback);
38
+ if (isNodeShadowHost(node)) {
39
+ callback(node.shadowRoot);
40
+ }
31
41
  }
32
-
33
42
  /**
34
43
  * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`
35
44
  */
@@ -1 +1 @@
1
- {"version":3,"file":"htmlDomUtils.js","names":["isTextNode","node","nodeType","Node","TEXT_NODE","isCommentNode","COMMENT_NODE","isElementNode","ELEMENT_NODE","isNodeShadowHost","Boolean","shadowRoot","isNodeShadowRoot","host","DOCUMENT_FRAGMENT_NODE","getChildNodes","childNodes","getParentNode","parentNode"],"sources":["../../src/browser/htmlDomUtils.js"],"sourcesContent":["export function isTextNode(node) {\n return node.nodeType === Node.TEXT_NODE\n}\n\nexport function isCommentNode(node) {\n return node.nodeType === Node.COMMENT_NODE\n}\n\nexport function isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE\n}\n\nexport function isNodeShadowHost(node) {\n return isElementNode(node) && Boolean(node.shadowRoot)\n}\n\nexport function isNodeShadowRoot(node) {\n var shadowRoot = node\n return (\n !!shadowRoot.host &&\n shadowRoot.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n isElementNode(shadowRoot.host)\n )\n}\n\nexport function getChildNodes(node) {\n return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes\n}\n\n/**\n * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`\n */\nexport function getParentNode(node) {\n return isNodeShadowRoot(node) ? node.host : node.parentNode\n}\n"],"mappings":";;;;;;;;;;;;AAAO,SAASA,UAAUA,CAACC,IAAI,EAAE;EAC/B,OAAOA,IAAI,CAACC,QAAQ,KAAKC,IAAI,CAACC,SAAS;AACzC;AAEO,SAASC,aAAaA,CAACJ,IAAI,EAAE;EAClC,OAAOA,IAAI,CAACC,QAAQ,KAAKC,IAAI,CAACG,YAAY;AAC5C;AAEO,SAASC,aAAaA,CAACN,IAAI,EAAE;EAClC,OAAOA,IAAI,CAACC,QAAQ,KAAKC,IAAI,CAACK,YAAY;AAC5C;AAEO,SAASC,gBAAgBA,CAACR,IAAI,EAAE;EACrC,OAAOM,aAAa,CAACN,IAAI,CAAC,IAAIS,OAAO,CAACT,IAAI,CAACU,UAAU,CAAC;AACxD;AAEO,SAASC,gBAAgBA,CAACX,IAAI,EAAE;EACrC,IAAIU,UAAU,GAAGV,IAAI;EACrB,OACE,CAAC,CAACU,UAAU,CAACE,IAAI,IACjBF,UAAU,CAACT,QAAQ,KAAKC,IAAI,CAACW,sBAAsB,IACnDP,aAAa,CAACI,UAAU,CAACE,IAAI,CAAC;AAElC;AAEO,SAASE,aAAaA,CAACd,IAAI,EAAE;EAClC,OAAOQ,gBAAgB,CAACR,IAAI,CAAC,GAAGA,IAAI,CAACU,UAAU,CAACK,UAAU,GAAGf,IAAI,CAACe,UAAU;AAC9E;;AAEA;AACA;AACA;AACO,SAASC,aAAaA,CAAChB,IAAI,EAAE;EAClC,OAAOW,gBAAgB,CAACX,IAAI,CAAC,GAAGA,IAAI,CAACY,IAAI,GAAGZ,IAAI,CAACiB,UAAU;AAC7D"}
1
+ {"version":3,"file":"htmlDomUtils.js","names":["isTextNode","node","nodeType","Node","TEXT_NODE","isCommentNode","COMMENT_NODE","isElementNode","ELEMENT_NODE","isNodeShadowHost","Boolean","shadowRoot","isNodeShadowRoot","host","DOCUMENT_FRAGMENT_NODE","hasChildNodes","childNodes","length","forEachChildNodes","callback","forEach","getParentNode","parentNode"],"sources":["../../src/browser/htmlDomUtils.js"],"sourcesContent":["export function isTextNode(node) {\n return node.nodeType === Node.TEXT_NODE\n}\n\nexport function isCommentNode(node) {\n return node.nodeType === Node.COMMENT_NODE\n}\n\nexport function isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE\n}\n\nexport function isNodeShadowHost(node) {\n return isElementNode(node) && Boolean(node.shadowRoot)\n}\n\nexport function isNodeShadowRoot(node) {\n var shadowRoot = node\n return (\n !!shadowRoot.host &&\n shadowRoot.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n isElementNode(shadowRoot.host)\n )\n}\nexport function hasChildNodes(node) {\n return node.childNodes.length > 0 || isNodeShadowHost(node)\n}\n// export function getChildNodes(node) {\n// return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes\n// }\nexport function forEachChildNodes(node, callback) {\n node.childNodes.forEach(callback)\n if (isNodeShadowHost(node)) {\n callback(node.shadowRoot)\n }\n}\n/**\n * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`\n */\nexport function getParentNode(node) {\n return isNodeShadowRoot(node) ? node.host : node.parentNode\n}\n"],"mappings":";;;;;;;;;;;;;AAAO,SAASA,UAAUA,CAACC,IAAI,EAAE;EAC/B,OAAOA,IAAI,CAACC,QAAQ,KAAKC,IAAI,CAACC,SAAS;AACzC;AAEO,SAASC,aAAaA,CAACJ,IAAI,EAAE;EAClC,OAAOA,IAAI,CAACC,QAAQ,KAAKC,IAAI,CAACG,YAAY;AAC5C;AAEO,SAASC,aAAaA,CAACN,IAAI,EAAE;EAClC,OAAOA,IAAI,CAACC,QAAQ,KAAKC,IAAI,CAACK,YAAY;AAC5C;AAEO,SAASC,gBAAgBA,CAACR,IAAI,EAAE;EACrC,OAAOM,aAAa,CAACN,IAAI,CAAC,IAAIS,OAAO,CAACT,IAAI,CAACU,UAAU,CAAC;AACxD;AAEO,SAASC,gBAAgBA,CAACX,IAAI,EAAE;EACrC,IAAIU,UAAU,GAAGV,IAAI;EACrB,OACE,CAAC,CAACU,UAAU,CAACE,IAAI,IACjBF,UAAU,CAACT,QAAQ,KAAKC,IAAI,CAACW,sBAAsB,IACnDP,aAAa,CAACI,UAAU,CAACE,IAAI,CAAC;AAElC;AACO,SAASE,aAAaA,CAACd,IAAI,EAAE;EAClC,OAAOA,IAAI,CAACe,UAAU,CAACC,MAAM,GAAG,CAAC,IAAIR,gBAAgB,CAACR,IAAI,CAAC;AAC7D;AACA;AACA;AACA;AACO,SAASiB,iBAAiBA,CAACjB,IAAI,EAAEkB,QAAQ,EAAE;EAChDlB,IAAI,CAACe,UAAU,CAACI,OAAO,CAACD,QAAQ,CAAC;EACjC,IAAIV,gBAAgB,CAACR,IAAI,CAAC,EAAE;IAC1BkB,QAAQ,CAAClB,IAAI,CAACU,UAAU,CAAC;EAC3B;AACF;AACA;AACA;AACA;AACO,SAASU,aAAaA,CAACpB,IAAI,EAAE;EAClC,OAAOW,gBAAgB,CAACX,IAAI,CAAC,GAAGA,IAAI,CAACY,IAAI,GAAGZ,IAAI,CAACqB,UAAU;AAC7D"}
@@ -59,7 +59,9 @@ function validateAndBuildConfiguration(initConfiguration) {
59
59
  */
60
60
  batchMessagesLimit: 50,
61
61
  messageBytesLimit: 256 * _byteUtils.ONE_KIBI_BYTE,
62
- resourceUrlLimit: 5 * _byteUtils.ONE_KIBI_BYTE
62
+ resourceUrlLimit: 5 * _byteUtils.ONE_KIBI_BYTE,
63
+ storeContextsToLocal: !!initConfiguration.storeContextsToLocal,
64
+ sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson
63
65
  }, (0, _transportConfiguration.computeTransportConfiguration)(initConfiguration));
64
66
  }
65
67
  function buildCookieOptions(initConfiguration) {
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","names":["_cookie","require","_catchUserErrors","_display","_tools","_byteUtils","_transportConfiguration","DefaultPrivacyLevel","ALLOW","MASK","MASK_USER_INPUT","exports","validateAndBuildConfiguration","initConfiguration","sampleRate","undefined","isPercentage","display","error","sessionSampleRate","telemetrySampleRate","assign","beforeSend","catchUserErrors","cookieOptions","buildCookieOptions","isNullUndefinedDefaultValue","service","version","env","telemetryEnabled","silentMultipleInit","batchBytesLimit","ONE_KIBI_BYTE","eventRateLimiterThreshold","maxTelemetryEventsPerPage","flushTimeout","ONE_SECOND","batchMessagesLimit","messageBytesLimit","resourceUrlLimit","computeTransportConfiguration","secure","mustUseSecureCookie","crossSite","useCrossSiteSessionCookie","trackSessionAcrossSubdomains","domain","getCurrentSite","useSecureSessionCookie"],"sources":["../../src/configuration/configuration.js"],"sourcesContent":["import { getCurrentSite } from '../browser/cookie'\nimport { catchUserErrors } from '../helper/catchUserErrors'\nimport { display } from '../helper/display'\nimport {\n assign,\n isPercentage,\n ONE_SECOND,\n isNullUndefinedDefaultValue\n} from '../helper/tools'\nimport { ONE_KIBI_BYTE } from '../helper/byteUtils'\nimport { computeTransportConfiguration } from './transportConfiguration'\n\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input'\n}\nexport function validateAndBuildConfiguration(initConfiguration) {\n if (\n initConfiguration.sampleRate !== undefined &&\n !isPercentage(initConfiguration.sampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.sessionSampleRate !== undefined &&\n !isPercentage(initConfiguration.sessionSampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.telemetrySampleRate !== undefined &&\n !isPercentage(initConfiguration.telemetrySampleRate)\n ) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100')\n return\n }\n var sessionSampleRate =\n initConfiguration.sessionSampleRate || initConfiguration.sampleRate\n return assign(\n {\n beforeSend:\n initConfiguration.beforeSend &&\n catchUserErrors(\n initConfiguration.beforeSend,\n 'beforeSend threw an error:'\n ),\n cookieOptions: buildCookieOptions(initConfiguration),\n sessionSampleRate: isNullUndefinedDefaultValue(sessionSampleRate, 100),\n service: initConfiguration.service,\n version: initConfiguration.version,\n env: initConfiguration.env,\n telemetrySampleRate: isNullUndefinedDefaultValue(\n initConfiguration.telemetrySampleRate,\n 100\n ),\n telemetryEnabled: isNullUndefinedDefaultValue(\n initConfiguration.telemetryEnabled,\n false\n ),\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: 30 * ONE_SECOND,\n\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n resourceUrlLimit: 5 * ONE_KIBI_BYTE\n },\n computeTransportConfiguration(initConfiguration)\n )\n}\n\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {}\n\n cookieOptions.secure = mustUseSecureCookie(initConfiguration)\n cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie\n\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite()\n }\n\n return cookieOptions\n}\n\nfunction mustUseSecureCookie(initConfiguration) {\n return (\n !!initConfiguration.useSecureSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n )\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAMA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AAEO,IAAIM,mBAAmB,GAAG;EAC/BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;E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AACiB,gBAAgB,EAClC,KACF,CAAC;IACDC,kBAAkB,EAAE,CAAC,CAAClB,iBAAiB,CAACkB,kBAAkB;IAE1D;AACN;AACA;AACA;IACMC,eAAe,EAAE,EAAE,GAAGC,wBAAa;IAEnCC,yBAAyB,EAAE,IAAI;IAC/BC,yBAAyB,EAAE,EAAE;IAE7B;AACN;AACA;AACA;IACMC,YAAY,EAAE,EAAE,GAAGC,iBAAU;IAE7B;AACN;AACA;IACMC,kBAAkB,EAAE,EAAE;IACtBC,iBAAiB,EAAE,GAAG,GAAGN,wBAAa;IACtCO,gBAAgB,EAAE,CAAC,GAAGP;EACxB,CAAC,EACD,IAAAQ,qDAA6B,EAAC5B,iBAAiB,CACjD,CAAC;AACH;AAEO,SAASY,kBAAkBA,CAACZ,iBAAiB,EAAE;EACpD,IAAIW,aAAa,GAAG,CAAC,CAAC;EAEtBA,aAAa,CAACkB,MAAM,GAAGC,mBAAmB,CAAC9B,iBAAiB,CAAC;EAC7DW,aAAa,CAACoB,SAAS,GAAG,CAAC,CAAC/B,iBAAiB,CAACgC,yBAAyB;EAEvE,IAAIhC,iBAAiB,CAACiC,4BAA4B,EAAE;IAClDtB,aAAa,CAACuB,MAAM,GAAG,IAAAC,sBAAc,EAAC,CAAC;EACzC;EAEA,OAAOxB,aAAa;AACtB;AAEA,SAASmB,mBAAmBA,CAAC9B,iBAAiB,EAAE;EAC9C,OACE,CAAC,CAACA,iBAAiB,CAACoC,sBAAsB,IAC1C,CAAC,CAACpC,iBAAiB,CAACgC,yBAAyB;AAEjD"}
1
+ {"version":3,"file":"configuration.js","names":["_cookie","require","_catchUserErrors","_display","_tools","_byteUtils","_transportConfiguration","DefaultPrivacyLevel","ALLOW","MASK","MASK_USER_INPUT","exports","validateAndBuildConfiguration","initConfiguration","sampleRate","undefined","isPercentage","display","error","sessionSampleRate","telemetrySampleRate","assign","beforeSend","catchUserErrors","cookieOptions","buildCookieOptions","isNullUndefinedDefaultValue","service","version","env","telemetryEnabled","silentMultipleInit","batchBytesLimit","ONE_KIBI_BYTE","eventRateLimiterThreshold","maxTelemetryEventsPerPage","flushTimeout","ONE_SECOND","batchMessagesLimit","messageBytesLimit","resourceUrlLimit","storeContextsToLocal","sendContentTypeByJson","computeTransportConfiguration","secure","mustUseSecureCookie","crossSite","useCrossSiteSessionCookie","trackSessionAcrossSubdomains","domain","getCurrentSite","useSecureSessionCookie"],"sources":["../../src/configuration/configuration.js"],"sourcesContent":["import { getCurrentSite } from '../browser/cookie'\nimport { catchUserErrors } from '../helper/catchUserErrors'\nimport { display } from '../helper/display'\nimport {\n assign,\n isPercentage,\n ONE_SECOND,\n isNullUndefinedDefaultValue\n} from '../helper/tools'\nimport { ONE_KIBI_BYTE } from '../helper/byteUtils'\nimport { computeTransportConfiguration } from './transportConfiguration'\n\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input'\n}\nexport function validateAndBuildConfiguration(initConfiguration) {\n if (\n initConfiguration.sampleRate !== undefined &&\n !isPercentage(initConfiguration.sampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.sessionSampleRate !== undefined &&\n !isPercentage(initConfiguration.sessionSampleRate)\n ) {\n display.error('Sample Rate should be a number between 0 and 100')\n return\n }\n if (\n initConfiguration.telemetrySampleRate !== undefined &&\n !isPercentage(initConfiguration.telemetrySampleRate)\n ) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100')\n return\n }\n var sessionSampleRate =\n initConfiguration.sessionSampleRate || initConfiguration.sampleRate\n return assign(\n {\n beforeSend:\n initConfiguration.beforeSend &&\n catchUserErrors(\n initConfiguration.beforeSend,\n 'beforeSend threw an error:'\n ),\n cookieOptions: buildCookieOptions(initConfiguration),\n sessionSampleRate: isNullUndefinedDefaultValue(sessionSampleRate, 100),\n service: initConfiguration.service,\n version: initConfiguration.version,\n env: initConfiguration.env,\n telemetrySampleRate: isNullUndefinedDefaultValue(\n initConfiguration.telemetrySampleRate,\n 100\n ),\n telemetryEnabled: isNullUndefinedDefaultValue(\n initConfiguration.telemetryEnabled,\n false\n ),\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: 30 * ONE_SECOND,\n\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n resourceUrlLimit: 5 * ONE_KIBI_BYTE,\n storeContextsToLocal: !!initConfiguration.storeContextsToLocal,\n sendContentTypeByJson: !!initConfiguration.sendContentTypeByJson\n },\n computeTransportConfiguration(initConfiguration)\n )\n}\n\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {}\n\n cookieOptions.secure = mustUseSecureCookie(initConfiguration)\n cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie\n\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite()\n }\n\n return cookieOptions\n}\n\nfunction mustUseSecureCookie(initConfiguration) {\n return (\n !!initConfiguration.useSecureSessionCookie ||\n !!initConfiguration.useCrossSiteSessionCookie\n )\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAMA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AAEO,IAAIM,mBAAmB,GAAG;EAC/BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,eAAe,EAAE;AACnB,CAAC;AAAAC,OAAA,CAAAJ,mBAAA,GAA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ClB,iBAAiB,CAACkB,kBAAkB;IAE1D;AACN;AACA;AACA;IACMC,eAAe,EAAE,EAAE,GAAGC,wBAAa;IAEnCC,yBAAyB,EAAE,IAAI;IAC/BC,yBAAyB,EAAE,EAAE;IAE7B;AACN;AACA;AACA;IACMC,YAAY,EAAE,EAAE,GAAGC,iBAAU;IAE7B;AACN;AACA;IACMC,kBAAkB,EAAE,EAAE;IACtBC,iBAAiB,EAAE,GAAG,GAAGN,wBAAa;IACtCO,gBAAgB,EAAE,CAAC,GAAGP,wBAAa;IACnCQ,oBAAoB,EAAE,CAAC,CAAC5B,iBAAiB,CAAC4B,oBAAoB;IAC9DC,qBAAqB,EAAE,CAAC,CAAC7B,iBAAiB,CAAC6B;EAC7C,CAAC,EACD,IAAAC,qDAA6B,EAAC9B,iBAAiB,CACjD,CAAC;AACH;AAEO,SAASY,kBAAkBA,CAACZ,iBAAiB,EAAE;EACpD,IAAIW,aAAa,GAAG,CAAC,CAAC;EAEtBA,aAAa,CAACoB,MAAM,GAAGC,mBAAmB,CAAChC,iBAAiB,CAAC;EAC7DW,aAAa,CAACsB,SAAS,GAAG,CAAC,CAACjC,iBAAiB,CAACkC,yBAAyB;EAEvE,IAAIlC,iBAAiB,CAACmC,4BAA4B,EAAE;IAClDxB,aAAa,CAACyB,MAAM,GAAG,IAAAC,sBAAc,EAAC,CAAC;EACzC;EAEA,OAAO1B,aAAa;AACtB;AAEA,SAASqB,mBAAmBA,CAAChC,iBAAiB,EAAE;EAC9C,OACE,CAAC,CAACA,iBAAiB,CAACsC,sBAAsB,IAC1C,CAAC,CAACtC,iBAAiB,CAACkC,yBAAyB;AAEjD"}
package/cjs/dataMap.js CHANGED
@@ -18,7 +18,6 @@ var commonTags = {
18
18
  session_id: 'session.id',
19
19
  session_type: 'session.type',
20
20
  session_sampling: 'session.is_sampling',
21
- session_has_replay: 'session.has_replay',
22
21
  is_signin: 'user.is_signin',
23
22
  os: 'device.os',
24
23
  os_version: 'device.os_version',
@@ -44,7 +43,10 @@ var commonFields = {
44
43
  action_id: 'action.id',
45
44
  action_ids: 'action.ids',
46
45
  view_in_foreground: 'view.in_foreground',
47
- display: 'display'
46
+ display: 'display',
47
+ session_has_replay: 'session.has_replay',
48
+ is_login: 'user.is_login',
49
+ page_states: '_gc.page_states'
48
50
  };
49
51
  // 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]
50
52
  exports.commonFields = commonFields;
@@ -68,6 +70,7 @@ var dataMap = {
68
70
  largest_contentful_paint: 'view.largest_contentful_paint',
69
71
  largest_contentful_paint_element_selector: 'view.largest_contentful_paint_element_selector',
70
72
  cumulative_layout_shift: 'view.cumulative_layout_shift',
73
+ cumulative_layout_shift_target_selector: 'view.cumulative_layout_shift_target_selector',
71
74
  first_input_delay: 'view.first_input_delay',
72
75
  loading_time: 'view.loading_time',
73
76
  dom_interactive: 'view.dom_interactive',
@@ -75,15 +78,16 @@ var dataMap = {
75
78
  dom_complete: 'view.dom_complete',
76
79
  load_event: 'view.load_event',
77
80
  first_input_time: 'view.first_input_time',
81
+ first_input_target_selector: 'view.first_input_target_selector',
78
82
  first_paint_time: 'view.fpt',
79
83
  interaction_to_next_paint: 'view.interaction_to_next_paint',
84
+ interaction_to_next_paint_target_selector: 'view.interaction_to_next_paint_target_selector',
80
85
  resource_load_time: 'view.resource_load_time',
81
86
  time_to_interactive: 'view.tti',
82
87
  dom: 'view.dom',
83
88
  dom_ready: 'view.dom_ready',
84
89
  time_spent: 'view.time_spent',
85
90
  first_byte: 'view.first_byte',
86
- page_states: '_gc.page_states',
87
91
  frustration_count: 'view.frustration.count',
88
92
  custom_timings: 'view.custom_timings'
89
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dataMap.js","names":["_enums","require","commonTags","sdk_name","sdk_version","app_id","env","service","version","userid","user_email","user_name","session_id","session_type","session_sampling","session_has_replay","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","view_url_query","exports","commonFields","action_id","action_ids","view_in_foreground","display","dataMap","view","type","RumEventType","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_paint_time","interaction_to_next_paint","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","page_states","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_type","resource_status","resource_status_group","resource_method","duration","resource_size","resource_encode_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","long_task","LONG_TASK","long_task_id","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n session_has_replay: 'session.has_replay',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.path', // 冗余一个字段\n view_path_group: 'view.path_group',\n view_url_query: 'view.url_query'\n}\nexport var commonFields = {\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n page_states: '_gc.page_states',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_type: 'resource.type',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_encode_size: 'resource.encode_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration'\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message']\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,UAAU,EAAE,YAAY;EACxBC,YAAY,EAAE,cAAc;EAC5BC,gBAAgB,EAAE,qBAAqB;EACvCC,kBAAkB,EAAE,oBAAoB;EACxCC,SAAS,EAAE,gBAAgB;EAC3BC,EAAE,EAAE,WAAW;EACfC,UAAU,EAAE,mBAAmB;EAC/BC,gBAAgB,EAAE,yBAAyB;EAC3CC,OAAO,EAAE,gBAAgB;EACzBC,eAAe,EAAE,wBAAwB;EACzCC,qBAAqB,EAAE,8BAA8B;EACrDC,WAAW,EAAE,oBAAoB;EACjCC,YAAY,EAAE,qBAAqB;EACnCC,MAAM,EAAE,eAAe;EACvBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,eAAe;EAC9BC,QAAQ,EAAE,UAAU;EACpBC,SA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CAAC6F,MAAM;IACzB3F,IAAI,EAAE;MACJmE,YAAY,EAAE,cAAc;MAC5BC,UAAU,EAAE,YAAY;MACxBwB,kBAAkB,EAAE,UAAU;MAC9BC,uBAAuB,EAAE,eAAe;MACxCC,uBAAuB,EAAE,eAAe;MACxCC,6BAA6B,EAAE,qBAAqB;MACpDC,qBAAqB,EAAE,kBAAkB;MACzCC,2BAA2B,EAAE,mBAAmB;MAChDC,qBAAqB,EAAE,aAAa;MACpC3G,SAAS,EAAE,gBAAgB;MAC3B7B,OAAO,EAAE,SAAS;MAClB6H,MAAM,EAAE;IACV,CAAC;IACDnF,MAAM,EAAE;MACNoF,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS;IAC/B;EACF;AACF,CAAC;AAAAnG,OAAA,CAAAM,OAAA,GAAAA,OAAA"}
1
+ {"version":3,"file":"dataMap.js","names":["_enums","require","commonTags","sdk_name","sdk_version","app_id","env","service","version","userid","user_email","user_name","session_id","session_type","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","view_url_query","exports","commonFields","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","dataMap","view","type","RumEventType","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","is_active","session_replay_stats","session_is_active","view_error_count","view_resource_count","view_long_task_count","view_action_count","first_contentful_paint","largest_contentful_paint","largest_contentful_paint_element_selector","cumulative_layout_shift","cumulative_layout_shift_target_selector","first_input_delay","loading_time","dom_interactive","dom_content_loaded","dom_complete","load_event","first_input_time","first_input_target_selector","first_paint_time","interaction_to_next_paint","interaction_to_next_paint_target_selector","resource_load_time","time_to_interactive","dom","dom_ready","time_spent","first_byte","frustration_count","custom_timings","resource","RESOURCE","trace_id","span_id","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_type","resource_status","resource_status_group","resource_method","duration","resource_size","resource_encode_size","resource_render_blocking_status","resource_dns","resource_tcp","resource_ssl","resource_ttfb","resource_trans","resource_redirect","resource_first_byte","resource_dns_time","resource_download_time","resource_first_byte_time","resource_connect_time","resource_ssl_time","resource_redirect_time","error","ERROR","error_id","error_source","error_type","error_handling","error_message","error_stack","error_causes","long_task","LONG_TASK","long_task_id","action","ACTION","action_type","action_name","action_error_count","action_resource_count","action_frustration_types","action_long_task_count","action_target","action_position","telemetry","status","message","error_kind","browser_log","LOGGER","error_resource_url","error_resource_url_host","error_resource_url_path","error_resource_url_path_group","error_resource_status","error_resource_status_group","error_resource_method"],"sources":["../src/dataMap.js"],"sourcesContent":["import { RumEventType } from './helper/enums'\nexport var commonTags = {\n sdk_name: '_gc.sdk_name',\n sdk_version: '_gc.sdk_version',\n app_id: 'application.id',\n env: 'env',\n service: 'service',\n version: 'version',\n userid: 'user.id',\n user_email: 'user.email',\n user_name: 'user.name',\n session_id: 'session.id',\n session_type: 'session.type',\n session_sampling: 'session.is_sampling',\n is_signin: 'user.is_signin',\n os: 'device.os',\n os_version: 'device.os_version',\n os_version_major: 'device.os_version_major',\n browser: 'device.browser',\n browser_version: 'device.browser_version',\n browser_version_major: 'device.browser_version_major',\n screen_size: 'device.screen_size',\n network_type: 'device.network_type',\n device: 'device.device',\n view_id: 'view.id',\n view_referrer: 'view.referrer',\n view_url: 'view.url',\n view_host: 'view.host',\n view_path: 'view.path',\n view_name: 'view.path', // 冗余一个字段\n view_path_group: 'view.path_group',\n view_url_query: 'view.url_query'\n}\nexport var commonFields = {\n action_id: 'action.id',\n action_ids: 'action.ids',\n view_in_foreground: 'view.in_foreground',\n display: 'display',\n session_has_replay: 'session.has_replay',\n is_login: 'user.is_login',\n page_states: '_gc.page_states'\n}\n// 需要用双引号将字符串类型的field value括起来, 这里有数组标示[string, path]\nexport var dataMap = {\n view: {\n type: RumEventType.VIEW,\n tags: {\n view_loading_type: 'view.loading_type',\n view_apdex_level: 'view.apdex_level',\n view_privacy_replay_level: 'privacy.replay_level'\n },\n fields: {\n is_active: 'view.is_active',\n session_replay_stats: '_gc.replay_stats',\n session_is_active: 'session.is_active',\n view_error_count: 'view.error.count',\n view_resource_count: 'view.resource.count',\n view_long_task_count: 'view.long_task.count',\n view_action_count: 'view.action.count',\n first_contentful_paint: 'view.first_contentful_paint',\n largest_contentful_paint: 'view.largest_contentful_paint',\n largest_contentful_paint_element_selector:\n 'view.largest_contentful_paint_element_selector',\n cumulative_layout_shift: 'view.cumulative_layout_shift',\n cumulative_layout_shift_target_selector:\n 'view.cumulative_layout_shift_target_selector',\n first_input_delay: 'view.first_input_delay',\n loading_time: 'view.loading_time',\n dom_interactive: 'view.dom_interactive',\n dom_content_loaded: 'view.dom_content_loaded',\n dom_complete: 'view.dom_complete',\n load_event: 'view.load_event',\n first_input_time: 'view.first_input_time',\n first_input_target_selector: 'view.first_input_target_selector',\n first_paint_time: 'view.fpt',\n interaction_to_next_paint: 'view.interaction_to_next_paint',\n interaction_to_next_paint_target_selector:\n 'view.interaction_to_next_paint_target_selector',\n resource_load_time: 'view.resource_load_time',\n time_to_interactive: 'view.tti',\n dom: 'view.dom',\n dom_ready: 'view.dom_ready',\n time_spent: 'view.time_spent',\n first_byte: 'view.first_byte',\n frustration_count: 'view.frustration.count',\n custom_timings: 'view.custom_timings'\n }\n },\n resource: {\n type: RumEventType.RESOURCE,\n tags: {\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n resource_url: 'resource.url',\n resource_url_host: 'resource.url_host',\n resource_url_path: 'resource.url_path',\n resource_url_path_group: 'resource.url_path_group',\n resource_url_query: 'resource.url_query',\n resource_type: 'resource.type',\n resource_status: 'resource.status',\n resource_status_group: 'resource.status_group',\n resource_method: 'resource.method'\n },\n fields: {\n duration: 'resource.duration',\n resource_size: 'resource.size',\n resource_encode_size: 'resource.encode_size',\n resource_render_blocking_status: 'resource.render_blocking_status',\n resource_dns: 'resource.dns',\n resource_tcp: 'resource.tcp',\n resource_ssl: 'resource.ssl',\n resource_ttfb: 'resource.ttfb',\n resource_trans: 'resource.trans',\n resource_redirect: 'resource.redirect',\n resource_first_byte: 'resource.firstbyte',\n resource_dns_time: 'resource.dns_time',\n resource_download_time: 'resource.download_time',\n resource_first_byte_time: 'resource.first_byte_time',\n resource_connect_time: 'resource.connect_time',\n resource_ssl_time: 'resource.ssl_time',\n resource_redirect_time: 'resource.redirect_time'\n }\n },\n error: {\n type: RumEventType.ERROR,\n tags: {\n error_id: 'error.id',\n trace_id: '_gc.trace_id',\n span_id: '_gc.span_id',\n error_source: 'error.source',\n error_type: 'error.type',\n error_handling: 'error.handling'\n // resource_url: 'error.resource.url',\n // resource_url_host: 'error.resource.url_host',\n // resource_url_path: 'error.resource.url_path',\n // resource_url_path_group: 'error.resource.url_path_group',\n // resource_status: 'error.resource.status',\n // resource_status_group: 'error.resource.status_group',\n // resource_method: 'error.resource.method'\n },\n fields: {\n error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack'],\n error_causes: ['string', 'error.causes']\n }\n },\n long_task: {\n type: RumEventType.LONG_TASK,\n tags: {\n long_task_id: 'long_task.id'\n },\n fields: {\n duration: 'long_task.duration'\n }\n },\n action: {\n type: RumEventType.ACTION,\n tags: {\n action_type: 'action.type'\n },\n fields: {\n action_name: 'action.target.name',\n duration: 'action.loading_time',\n action_error_count: 'action.error.count',\n action_resource_count: 'action.resource.count',\n action_frustration_types: 'action.frustration.type',\n action_long_task_count: 'action.long_task.count',\n action_target: '_gc.action.target',\n action_position: '_gc.action.position'\n }\n },\n telemetry: {\n type: 'telemetry',\n fields: {\n status: 'telemetry.status',\n message: ['string', 'telemetry.message'],\n type: 'telemetry.type',\n error_stack: ['string', 'telemetry.error.stack'],\n error_kind: ['string', 'telemetry.error.kind']\n }\n },\n browser_log: {\n type: RumEventType.LOGGER,\n tags: {\n error_source: 'error.source',\n error_type: 'error.type',\n error_resource_url: 'http.url',\n error_resource_url_host: 'http.url_host',\n error_resource_url_path: 'http.url_path',\n error_resource_url_path_group: 'http.url_path_group',\n error_resource_status: 'http.status_code',\n error_resource_status_group: 'http.status_group',\n error_resource_method: 'http.method',\n action_id: 'user_action.id',\n service: 'service',\n status: 'status'\n },\n fields: {\n message: ['string', 'message']\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,UAAU,EAAE,YAAY;EACxBC,YAAY,EAAE,cAAc;EAC5BC,gBAAgB,EAAE,qBAAqB;EACvCC,SAAS,EAAE,gBAAgB;EAC3BC,EAAE,EAAE,WAAW;EACfC,UAAU,EAAE,mBAAmB;EAC/BC,gBAAgB,EAAE,yBAAyB;EAC3CC,OAAO,EAAE,gBAAgB;EACzBC,eAAe,EAAE,wBAAwB;EACzCC,qBAAqB,EAAE,8BAA8B;EACrDC,WAAW,EAAE,oBAAoB;EACjCC,YAAY,EAAE,qBAAqB;EACnCC,MAAM,EAAE,eAAe;EACvBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,eAAe;EAC9BC,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,WAAW;EAAE;EACxBC,eAAe,EAAE,iBAAiB;EAClCC,cAAc,EAAE;AAClB,CAAC;AAAAC,OAAA,CAAA/B,UAAA,GAAAA,UAAA;AACM,IAAIgC,YAAY,GAAG;EACxBC,SAAS,EAAE,WAAW;EACtBC,UAAU,EAAE,YAAY;EACxBC,kBAAkB,EAAE,oBAAoB;EACxCC,OAAO,EAAE,SAAS;EAClBC,kBAAkB,EAAE,oBAAoB;EACxCC,QAAQ,EAAE,eAAe;E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EAAE,kBAAkB;MACzCC,2BAA2B,EAAE,mBAAmB;MAChDC,qBAAqB,EAAE,aAAa;MACpChH,SAAS,EAAE,gBAAgB;MAC3B5B,OAAO,EAAE,SAAS;MAClBiI,MAAM,EAAE;IACV,CAAC;IACDrF,MAAM,EAAE;MACNsF,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS;IAC/B;EACF;AACF,CAAC;AAAAxG,OAAA,CAAAS,OAAA,GAAAA,OAAA"}
@@ -37,7 +37,8 @@ var DOM_EVENT = {
37
37
  PLAY: 'play',
38
38
  PAUSE: 'pause',
39
39
  SECURITY_POLICY_VIOLATION: 'securitypolicyviolation',
40
- SELECTION_CHANGE: 'selectionchange'
40
+ SELECTION_CHANGE: 'selectionchange',
41
+ STORAGE: 'storage'
41
42
  };
42
43
  exports.DOM_EVENT = DOM_EVENT;
43
44
  var ResourceType = {
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":["DOM_EVENT","BEFORE_UNLOAD","CLICK","DBL_CLICK","KEY_DOWN","LOAD","POP_STATE","SCROLL","TOUCH_START","TOUCH_END","TOUCH_MOVE","VISIBILITY_CHANGE","PAGE_SHOW","FREEZE","RESUME","DOM_CONTENT_LOADED","POINTER_DOWN","POINTER_UP","POINTER_CANCEL","HASH_CHANGE","PAGE_HIDE","MOUSE_DOWN","MOUSE_UP","MOUSE_MOVE","FOCUS","BLUR","CONTEXT_MENU","RESIZE","CHANGE","INPUT","PLAY","PAUSE","SECURITY_POLICY_VIOLATION","SELECTION_CHANGE","exports","ResourceType","DOCUMENT","XHR","BEACON","FETCH","CSS","JS","IMAGE","FONT","MEDIA","OTHER","ActionType","CUSTOM","FrustrationType","RAGE_CLICK","ERROR_CLICK","DEAD_CLICK","RumEventType","ACTION","ERROR","LONG_TASK","VIEW","RESOURCE","LOGGER","ViewLoadingType","INITIAL_LOAD","ROUTE_CHANGE","RequestType","TraceType","DDTRACE","ZIPKIN_MULTI_HEADER","ZIPKIN_SINGLE_HEADER","W3C_TRACEPARENT","W3C_TRACEPARENT_64","SKYWALKING_V3","JAEGER","ErrorHandling","HANDLED","UNHANDLED","NonErrorPrefix","UNCAUGHT","PROVIDED"],"sources":["../../src/helper/enums.js"],"sourcesContent":["export var DOM_EVENT = {\n BEFORE_UNLOAD: 'beforeunload',\n CLICK: 'click',\n DBL_CLICK: 'dblclick',\n KEY_DOWN: 'keydown',\n LOAD: 'load',\n POP_STATE: 'popstate',\n SCROLL: 'scroll',\n TOUCH_START: 'touchstart',\n TOUCH_END: 'touchend',\n TOUCH_MOVE: 'touchmove',\n VISIBILITY_CHANGE: 'visibilitychange',\n PAGE_SHOW: 'pageshow',\n FREEZE: 'freeze',\n RESUME: 'resume',\n DOM_CONTENT_LOADED: 'DOMContentLoaded',\n POINTER_DOWN: 'pointerdown',\n POINTER_UP: 'pointerup',\n POINTER_CANCEL: 'pointercancel',\n HASH_CHANGE: 'hashchange',\n PAGE_HIDE: 'pagehide',\n MOUSE_DOWN: 'mousedown',\n MOUSE_UP: 'mouseup',\n MOUSE_MOVE: 'mousemove',\n FOCUS: 'focus',\n BLUR: 'blur',\n CONTEXT_MENU: 'contextmenu',\n RESIZE: 'resize',\n CHANGE: 'change',\n INPUT: 'input',\n PLAY: 'play',\n PAUSE: 'pause',\n SECURITY_POLICY_VIOLATION: 'securitypolicyviolation',\n SELECTION_CHANGE: 'selectionchange'\n}\nexport var ResourceType = {\n DOCUMENT: 'document',\n XHR: 'xhr',\n BEACON: 'beacon',\n FETCH: 'fetch',\n CSS: 'css',\n JS: 'js',\n IMAGE: 'image',\n FONT: 'font',\n MEDIA: 'media',\n OTHER: 'other'\n}\n\nexport var ActionType = {\n CLICK: 'click',\n CUSTOM: 'custom'\n}\nexport var FrustrationType = {\n RAGE_CLICK: 'rage_click',\n ERROR_CLICK: 'error_click',\n DEAD_CLICK: 'dead_click'\n}\nexport var RumEventType = {\n ACTION: 'action',\n ERROR: 'error',\n LONG_TASK: 'long_task',\n VIEW: 'view',\n RESOURCE: 'resource',\n LOGGER: 'logger'\n}\n\nexport var ViewLoadingType = {\n INITIAL_LOAD: 'initial_load',\n ROUTE_CHANGE: 'route_change'\n}\nexport var RequestType = {\n FETCH: ResourceType.FETCH,\n XHR: ResourceType.XHR\n}\n\nexport var TraceType = {\n DDTRACE: 'ddtrace',\n ZIPKIN_MULTI_HEADER: 'zipkin',\n ZIPKIN_SINGLE_HEADER: 'zipkin_single_header',\n W3C_TRACEPARENT: 'w3c_traceparent',\n W3C_TRACEPARENT_64: 'w3c_traceparent_64bit',\n SKYWALKING_V3: 'skywalking_v3',\n JAEGER: 'jaeger'\n}\nexport var ErrorHandling = {\n HANDLED: 'handled',\n UNHANDLED: 'unhandled'\n}\nexport var NonErrorPrefix = {\n UNCAUGHT: 'Uncaught',\n PROVIDED: 'Provided'\n}\n"],"mappings":";;;;;;AAAO,IAAIA,SAAS,GAAG;EACrBC,aAAa,EAAE,cAAc;EAC7BC,KAAK,EAAE,OAAO;EACdC,SAAS,EAAE,UAAU;EACrBC,QAAQ,EAAE,SAAS;EACnBC,IAAI,EAAE,MAAM;EACZC,SAAS,EAAE,UAAU;EACrBC,MAAM,EAAE,QAAQ;EAChBC,WAAW,EAAE,YAAY;EACzBC,SAAS,EAAE,UAAU;EACrBC,UAAU,EAAE,WAAW;EACvBC,iBAAiB,EAAE,kBAAkB;EACrCC,SAAS,EAAE,UAAU;EACrBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,kBAAkB,EAAE,kBAAkB;EACtCC,YAAY,EAAE,aAAa;EAC3BC,UAAU,EAAE,WAAW;EACvBC,cAAc,EAAE,eAAe;EAC/BC,WAAW,EAAE,YAAY;EACzBC,SAAS,EAAE,UAAU;EACrBC,UAAU,EAAE,WAAW;EACvBC,QAAQ,EAAE,SAAS;EACnBC,UAAU,EAAE,WAAW;EACvBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,YAAY,EAAE,aAAa;EAC3BC,MAAM,EAAE,QA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CAACE;AACpB,CAAC;AAAAH,OAAA,CAAA4B,WAAA,GAAAA,WAAA;AAEM,IAAIC,SAAS,GAAG;EACrBC,OAAO,EAAE,SAAS;EAClBC,mBAAmB,EAAE,QAAQ;EAC7BC,oBAAoB,EAAE,sBAAsB;EAC5CC,eAAe,EAAE,iBAAiB;EAClCC,kBAAkB,EAAE,uBAAuB;EAC3CC,aAAa,EAAE,eAAe;EAC9BC,MAAM,EAAE;AACV,CAAC;AAAApC,OAAA,CAAA6B,SAAA,GAAAA,SAAA;AACM,IAAIQ,aAAa,GAAG;EACzBC,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE;AACb,CAAC;AAAAvC,OAAA,CAAAqC,aAAA,GAAAA,aAAA;AACM,IAAIG,cAAc,GAAG;EAC1BC,QAAQ,EAAE,UAAU;EACpBC,QAAQ,EAAE;AACZ,CAAC;AAAA1C,OAAA,CAAAwC,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"file":"enums.js","names":["DOM_EVENT","BEFORE_UNLOAD","CLICK","DBL_CLICK","KEY_DOWN","LOAD","POP_STATE","SCROLL","TOUCH_START","TOUCH_END","TOUCH_MOVE","VISIBILITY_CHANGE","PAGE_SHOW","FREEZE","RESUME","DOM_CONTENT_LOADED","POINTER_DOWN","POINTER_UP","POINTER_CANCEL","HASH_CHANGE","PAGE_HIDE","MOUSE_DOWN","MOUSE_UP","MOUSE_MOVE","FOCUS","BLUR","CONTEXT_MENU","RESIZE","CHANGE","INPUT","PLAY","PAUSE","SECURITY_POLICY_VIOLATION","SELECTION_CHANGE","STORAGE","exports","ResourceType","DOCUMENT","XHR","BEACON","FETCH","CSS","JS","IMAGE","FONT","MEDIA","OTHER","ActionType","CUSTOM","FrustrationType","RAGE_CLICK","ERROR_CLICK","DEAD_CLICK","RumEventType","ACTION","ERROR","LONG_TASK","VIEW","RESOURCE","LOGGER","ViewLoadingType","INITIAL_LOAD","ROUTE_CHANGE","RequestType","TraceType","DDTRACE","ZIPKIN_MULTI_HEADER","ZIPKIN_SINGLE_HEADER","W3C_TRACEPARENT","W3C_TRACEPARENT_64","SKYWALKING_V3","JAEGER","ErrorHandling","HANDLED","UNHANDLED","NonErrorPrefix","UNCAUGHT","PROVIDED"],"sources":["../../src/helper/enums.js"],"sourcesContent":["export var DOM_EVENT = {\n BEFORE_UNLOAD: 'beforeunload',\n CLICK: 'click',\n DBL_CLICK: 'dblclick',\n KEY_DOWN: 'keydown',\n LOAD: 'load',\n POP_STATE: 'popstate',\n SCROLL: 'scroll',\n TOUCH_START: 'touchstart',\n TOUCH_END: 'touchend',\n TOUCH_MOVE: 'touchmove',\n VISIBILITY_CHANGE: 'visibilitychange',\n PAGE_SHOW: 'pageshow',\n FREEZE: 'freeze',\n RESUME: 'resume',\n DOM_CONTENT_LOADED: 'DOMContentLoaded',\n POINTER_DOWN: 'pointerdown',\n POINTER_UP: 'pointerup',\n POINTER_CANCEL: 'pointercancel',\n HASH_CHANGE: 'hashchange',\n PAGE_HIDE: 'pagehide',\n MOUSE_DOWN: 'mousedown',\n MOUSE_UP: 'mouseup',\n MOUSE_MOVE: 'mousemove',\n FOCUS: 'focus',\n BLUR: 'blur',\n CONTEXT_MENU: 'contextmenu',\n RESIZE: 'resize',\n CHANGE: 'change',\n INPUT: 'input',\n PLAY: 'play',\n PAUSE: 'pause',\n SECURITY_POLICY_VIOLATION: 'securitypolicyviolation',\n SELECTION_CHANGE: 'selectionchange',\n STORAGE: 'storage'\n}\nexport var ResourceType = {\n DOCUMENT: 'document',\n XHR: 'xhr',\n BEACON: 'beacon',\n FETCH: 'fetch',\n CSS: 'css',\n JS: 'js',\n IMAGE: 'image',\n FONT: 'font',\n MEDIA: 'media',\n OTHER: 'other'\n}\n\nexport var ActionType = {\n CLICK: 'click',\n CUSTOM: 'custom'\n}\nexport var FrustrationType = {\n RAGE_CLICK: 'rage_click',\n ERROR_CLICK: 'error_click',\n DEAD_CLICK: 'dead_click'\n}\nexport var RumEventType = {\n ACTION: 'action',\n ERROR: 'error',\n LONG_TASK: 'long_task',\n VIEW: 'view',\n RESOURCE: 'resource',\n LOGGER: 'logger'\n}\n\nexport var ViewLoadingType = {\n INITIAL_LOAD: 'initial_load',\n ROUTE_CHANGE: 'route_change'\n}\nexport var RequestType = {\n FETCH: ResourceType.FETCH,\n XHR: ResourceType.XHR\n}\n\nexport var TraceType = {\n DDTRACE: 'ddtrace',\n ZIPKIN_MULTI_HEADER: 'zipkin',\n ZIPKIN_SINGLE_HEADER: 'zipkin_single_header',\n W3C_TRACEPARENT: 'w3c_traceparent',\n W3C_TRACEPARENT_64: 'w3c_traceparent_64bit',\n SKYWALKING_V3: 'skywalking_v3',\n JAEGER: 'jaeger'\n}\nexport var ErrorHandling = {\n HANDLED: 'handled',\n UNHANDLED: 'unhandled'\n}\nexport var NonErrorPrefix = {\n UNCAUGHT: 'Uncaught',\n PROVIDED: 'Provided'\n}\n"],"mappings":";;;;;;AAAO,IAAIA,SAAS,GAAG;EACrBC,aAAa,EAAE,cAAc;EAC7BC,KAAK,EAAE,OAAO;EACdC,SAAS,EAAE,UAAU;EACrBC,QAAQ,EAAE,SAAS;EACnBC,IAAI,EAAE,MAAM;EACZC,SAAS,EAAE,UAAU;EACrBC,MAAM,EAAE,QAAQ;EAChBC,WAAW,EAAE,YAAY;EACzBC,SAAS,EAAE,UAAU;EACrBC,UAAU,EAAE,WAAW;EACvBC,iBAAiB,EAAE,kBAAkB;EACrCC,SAAS,EAAE,UAAU;EACrBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,kBAAkB,EAAE,kBAAkB;EACtCC,YAAY,EAAE,aAAa;EAC3BC,UAAU,EAAE,WAAW;EACvBC,cAAc,EAAE,eAAe;EAC/BC,WAAW,EAAE,YAAY;EACzBC,SAAS,EAAE,UAAU;EACrBC,UAAU,EAAE,WAAW;EACvBC,QAAQ,EAAE,SAAS;EACnBC,UAAU,EAAE,WAAW;EACvBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM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W,GAAG;EACvBvB,KAAK,EAAEJ,YAAY,CAACI,KAAK;EACzBF,GAAG,EAAEF,YAAY,CAACE;AACpB,CAAC;AAAAH,OAAA,CAAA4B,WAAA,GAAAA,WAAA;AAEM,IAAIC,SAAS,GAAG;EACrBC,OAAO,EAAE,SAAS;EAClBC,mBAAmB,EAAE,QAAQ;EAC7BC,oBAAoB,EAAE,sBAAsB;EAC5CC,eAAe,EAAE,iBAAiB;EAClCC,kBAAkB,EAAE,uBAAuB;EAC3CC,aAAa,EAAE,eAAe;EAC9BC,MAAM,EAAE;AACV,CAAC;AAAApC,OAAA,CAAA6B,SAAA,GAAAA,SAAA;AACM,IAAIQ,aAAa,GAAG;EACzBC,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE;AACb,CAAC;AAAAvC,OAAA,CAAAqC,aAAA,GAAAA,aAAA;AACM,IAAIG,cAAc,GAAG;EAC1BC,QAAQ,EAAE,UAAU;EACpBC,QAAQ,EAAE;AACZ,CAAC;AAAA1C,OAAA,CAAAwC,cAAA,GAAAA,cAAA"}
@@ -15,6 +15,7 @@ var _tools = require("./tools");
15
15
  var _jsonStringify = require("../helper/serialisation/jsonStringify");
16
16
  var _tracekit = require("../tracekit");
17
17
  var _monitor = require("../helper/monitor");
18
+ var _sanitize = require("../helper/sanitize");
18
19
  var NO_ERROR_STACK_PRESENT_MESSAGE = 'No stack, consider using an instance of Error';
19
20
  exports.NO_ERROR_STACK_PRESENT_MESSAGE = NO_ERROR_STACK_PRESENT_MESSAGE;
20
21
  var ErrorSource = {
@@ -54,7 +55,7 @@ function computeRawError(data) {
54
55
  function computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError) {
55
56
  // Favor stackTrace message only if tracekit has really been able to extract something meaningful (message + name)
56
57
  // TODO rework tracekit integration to avoid scattering error building logic
57
- return stackTrace && stackTrace.message && stackTrace && stackTrace.name ? stackTrace.message : !isErrorInstance ? nonErrorPrefix + ' ' + (0, _jsonStringify.jsonStringify)(sanitize(originalError)) : 'Empty message';
58
+ return stackTrace && stackTrace.message && stackTrace && stackTrace.name ? stackTrace.message : !isErrorInstance ? nonErrorPrefix + ' ' + (0, _jsonStringify.jsonStringify)((0, _sanitize.sanitize)(originalError)) : 'Empty message';
58
59
  }
59
60
  function hasUsableStack(isErrorInstance, stackTrace) {
60
61
  if (stackTrace === undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"errorTools.js","names":["_tools","require","_jsonStringify","_tracekit","_monitor","NO_ERROR_STACK_PRESENT_MESSAGE","exports","ErrorSource","AGENT","CONSOLE","NETWORK","SOURCE","LOGGER","CUSTOM","computeRawError","data","stackTrace","originalError","handlingStack","startClocks","nonErrorPrefix","source","handling","isErrorInstance","Error","message","computeMessage","stack","hasUsableStack","toStackTraceString","causes","flattenErrorCauses","undefined","type","name","jsonStringify","sanitize","length","url","formatUnknownError","errorObject","createHandlingStack","internalFramesToSkip","error","formattedStack","e","noop","callMonitored","computeStackTrace","slice","result","formatErrorMessage","each","frame","func","args","join","line","column","getFileFromStackTraceString","execResult","exec","parentSource","currentError","cause","push"],"sources":["../../src/helper/errorTools.js"],"sourcesContent":["import { each, noop } from './tools'\nimport { jsonStringify } from '../helper/serialisation/jsonStringify'\nimport { computeStackTrace } from '../tracekit'\nimport { callMonitored } from '../helper/monitor'\nexport var NO_ERROR_STACK_PRESENT_MESSAGE =\n 'No stack, consider using an instance of Error'\nexport var ErrorSource = {\n AGENT: 'agent',\n CONSOLE: 'console',\n NETWORK: 'network',\n SOURCE: 'source',\n LOGGER: 'logger',\n CUSTOM: 'custom'\n}\n\nexport function computeRawError(data) {\n var stackTrace = data.stackTrace\n var originalError = data.originalError\n var handlingStack = data.handlingStack\n var startClocks = data.startClocks\n var nonErrorPrefix = data.nonErrorPrefix\n var source = data.source\n var handling = data.handling\n var isErrorInstance = originalError instanceof Error\n var message = computeMessage(\n stackTrace,\n isErrorInstance,\n nonErrorPrefix,\n originalError\n )\n var stack = hasUsableStack(isErrorInstance, stackTrace)\n ? toStackTraceString(stackTrace)\n : NO_ERROR_STACK_PRESENT_MESSAGE\n var causes = isErrorInstance\n ? flattenErrorCauses(originalError, source)\n : undefined\n var type = stackTrace && stackTrace.name\n\n return {\n startClocks: startClocks,\n source: source,\n handling: handling,\n originalError: originalError,\n message: message,\n stack: stack,\n handlingStack: handlingStack,\n type: type,\n causes: causes\n }\n}\nfunction computeMessage(\n stackTrace,\n isErrorInstance,\n nonErrorPrefix,\n originalError\n) {\n // Favor stackTrace message only if tracekit has really been able to extract something meaningful (message + name)\n // TODO rework tracekit integration to avoid scattering error building logic\n return stackTrace && stackTrace.message && stackTrace && stackTrace.name\n ? stackTrace.message\n : !isErrorInstance\n ? nonErrorPrefix + ' ' + jsonStringify(sanitize(originalError))\n : 'Empty message'\n}\nfunction hasUsableStack(isErrorInstance, stackTrace) {\n if (stackTrace === undefined) {\n return false\n }\n if (isErrorInstance) {\n return true\n }\n // handle cases where tracekit return stack = [] or stack = [{url: undefined, line: undefined, column: undefined}]\n // TODO rework tracekit integration to avoid generating those unusable stack\n return (\n stackTrace.stack.length > 0 &&\n (stackTrace.stack.length > 1 || stackTrace.stack[0].url !== undefined)\n )\n}\n\nexport function formatUnknownError(\n stackTrace,\n errorObject,\n nonErrorPrefix,\n handlingStack\n) {\n if (\n !stackTrace ||\n (stackTrace.message === undefined && !(errorObject instanceof Error))\n ) {\n return {\n message: nonErrorPrefix + '' + jsonStringify(errorObject),\n stack: 'No stack, consider using an instance of Error',\n handlingStack: handlingStack,\n type: stackTrace && stackTrace.name\n }\n }\n return {\n message: stackTrace.message || 'Empty message',\n stack: toStackTraceString(stackTrace),\n handlingStack: handlingStack,\n type: stackTrace.name\n }\n}\n/**\n Creates a stacktrace without SDK internal frames.\n \n Constraints:\n - Has to be called at the utmost position of the call stack.\n - No internal monitoring should encapsulate the function, that is why we need to use callMonitored inside of it.\n */\nexport function createHandlingStack() {\n /**\n * Skip the two internal frames:\n * - SDK API (console.error, ...)\n * - this function\n * in order to keep only the user calls\n */\n var internalFramesToSkip = 2\n var error = new Error()\n var formattedStack\n\n // IE needs to throw the error to fill in the stack trace\n if (!error.stack) {\n try {\n throw error\n } catch (e) {\n noop()\n }\n }\n callMonitored(function () {\n var stackTrace = computeStackTrace(error)\n stackTrace.stack = stackTrace.stack.slice(internalFramesToSkip)\n formattedStack = toStackTraceString(stackTrace)\n })\n\n return formattedStack\n}\nexport function toStackTraceString(stack) {\n var result = formatErrorMessage(stack)\n each(stack.stack, function (frame) {\n var func = frame.func === '?' ? '<anonymous>' : frame.func\n var args =\n frame.args && frame.args.length > 0\n ? '(' + frame.args.join(', ') + ')'\n : ''\n var line = frame.line ? ':' + frame.line : ''\n var column = frame.line && frame.column ? ':' + frame.column : ''\n result += '\\n at ' + func + args + ' @ ' + frame.url + line + column\n })\n return result\n}\nexport function formatErrorMessage(stack) {\n return (stack.name || 'Error') + ': ' + stack.message\n}\nexport function getFileFromStackTraceString(stack) {\n var execResult = /@ (.+)/.exec(stack)\n return execResult && execResult[1]\n}\nexport function flattenErrorCauses(error, parentSource) {\n var currentError = error\n var causes = []\n while (\n currentError &&\n currentError.cause instanceof Error &&\n causes.length < 10\n ) {\n var stackTrace = computeStackTrace(currentError.cause)\n causes.push({\n message: currentError.cause.message,\n source: parentSource,\n type: stackTrace && stackTrace.name,\n stack: stackTrace && toStackTraceString(stackTrace)\n })\n currentError = currentError.cause\n }\n return causes.length ? causes : undefined\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACO,IAAII,8BAA8B,GACvC,+CAA+C;AAAAC,OAAA,CAAAD,8BAAA,GAAAA,8BAAA;AAC1C,IAAIE,WAAW,GAAG;EACvBC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EA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IAAI,GAAG,KAAK,GAAGF,KAAK,CAACf,GAAG,GAAGmB,IAAI,GAAGC,MAAM;EACvE,CAAC,CAAC;EACF,OAAOR,MAAM;AACf;AACO,SAASC,kBAAkBA,CAACxB,KAAK,EAAE;EACxC,OAAO,CAACA,KAAK,CAACO,IAAI,IAAI,OAAO,IAAI,IAAI,GAAGP,KAAK,CAACF,OAAO;AACvD;AACO,SAASkC,2BAA2BA,CAAChC,KAAK,EAAE;EACjD,IAAIiC,UAAU,GAAG,QAAQ,CAACC,IAAI,CAAClC,KAAK,CAAC;EACrC,OAAOiC,UAAU,IAAIA,UAAU,CAAC,CAAC,CAAC;AACpC;AACO,SAAS7B,kBAAkBA,CAACY,KAAK,EAAEmB,YAAY,EAAE;EACtD,IAAIC,YAAY,GAAGpB,KAAK;EACxB,IAAIb,MAAM,GAAG,EAAE;EACf,OACEiC,YAAY,IACZA,YAAY,CAACC,KAAK,YAAYxC,KAAK,IACnCM,MAAM,CAACO,MAAM,GAAG,EAAE,EAClB;IACA,IAAIrB,UAAU,GAAG,IAAAgC,2BAAiB,EAACe,YAAY,CAACC,KAAK,CAAC;IACtDlC,MAAM,CAACmC,IAAI,CAAC;MACVxC,OAAO,EAAEsC,YAAY,CAACC,KAAK,CAACvC,OAAO;MACnCJ,MAAM,EAAEyC,YAAY;MACpB7B,IAAI,EAAEjB,UAAU,IAAIA,UAAU,CAACkB,IAAI;MACnCP,KAAK,EAAEX,UAAU,IAAIa,kBAAkB,CAACb,UAAU;IACpD,CAAC,CAAC;IACF+C,YAAY,GAAGA,YAAY,CAACC,KAAK;EACnC;EACA,OAAOlC,MAAM,CAACO,MAAM,GAAGP,MAAM,GAAGE,SAAS;AAC3C"}
1
+ {"version":3,"file":"errorTools.js","names":["_tools","require","_jsonStringify","_tracekit","_monitor","_sanitize","NO_ERROR_STACK_PRESENT_MESSAGE","exports","ErrorSource","AGENT","CONSOLE","NETWORK","SOURCE","LOGGER","CUSTOM","computeRawError","data","stackTrace","originalError","handlingStack","startClocks","nonErrorPrefix","source","handling","isErrorInstance","Error","message","computeMessage","stack","hasUsableStack","toStackTraceString","causes","flattenErrorCauses","undefined","type","name","jsonStringify","sanitize","length","url","formatUnknownError","errorObject","createHandlingStack","internalFramesToSkip","error","formattedStack","e","noop","callMonitored","computeStackTrace","slice","result","formatErrorMessage","each","frame","func","args","join","line","column","getFileFromStackTraceString","execResult","exec","parentSource","currentError","cause","push"],"sources":["../../src/helper/errorTools.js"],"sourcesContent":["import { each, noop } from './tools'\nimport { jsonStringify } from '../helper/serialisation/jsonStringify'\nimport { computeStackTrace } from '../tracekit'\nimport { callMonitored } from '../helper/monitor'\nimport { sanitize } from '../helper/sanitize'\nexport var NO_ERROR_STACK_PRESENT_MESSAGE =\n 'No stack, consider using an instance of Error'\nexport var ErrorSource = {\n AGENT: 'agent',\n CONSOLE: 'console',\n NETWORK: 'network',\n SOURCE: 'source',\n LOGGER: 'logger',\n CUSTOM: 'custom'\n}\n\nexport function computeRawError(data) {\n var stackTrace = data.stackTrace\n var originalError = data.originalError\n var handlingStack = data.handlingStack\n var startClocks = data.startClocks\n var nonErrorPrefix = data.nonErrorPrefix\n var source = data.source\n var handling = data.handling\n var isErrorInstance = originalError instanceof Error\n var message = computeMessage(\n stackTrace,\n isErrorInstance,\n nonErrorPrefix,\n originalError\n )\n var stack = hasUsableStack(isErrorInstance, stackTrace)\n ? toStackTraceString(stackTrace)\n : NO_ERROR_STACK_PRESENT_MESSAGE\n var causes = isErrorInstance\n ? flattenErrorCauses(originalError, source)\n : undefined\n var type = stackTrace && stackTrace.name\n\n return {\n startClocks: startClocks,\n source: source,\n handling: handling,\n originalError: originalError,\n message: message,\n stack: stack,\n handlingStack: handlingStack,\n type: type,\n causes: causes\n }\n}\nfunction computeMessage(\n stackTrace,\n isErrorInstance,\n nonErrorPrefix,\n originalError\n) {\n // Favor stackTrace message only if tracekit has really been able to extract something meaningful (message + name)\n // TODO rework tracekit integration to avoid scattering error building logic\n return stackTrace && stackTrace.message && stackTrace && stackTrace.name\n ? stackTrace.message\n : !isErrorInstance\n ? nonErrorPrefix + ' ' + jsonStringify(sanitize(originalError))\n : 'Empty message'\n}\nfunction hasUsableStack(isErrorInstance, stackTrace) {\n if (stackTrace === undefined) {\n return false\n }\n if (isErrorInstance) {\n return true\n }\n // handle cases where tracekit return stack = [] or stack = [{url: undefined, line: undefined, column: undefined}]\n // TODO rework tracekit integration to avoid generating those unusable stack\n return (\n stackTrace.stack.length > 0 &&\n (stackTrace.stack.length > 1 || stackTrace.stack[0].url !== undefined)\n )\n}\n\nexport function formatUnknownError(\n stackTrace,\n errorObject,\n nonErrorPrefix,\n handlingStack\n) {\n if (\n !stackTrace ||\n (stackTrace.message === undefined && !(errorObject instanceof Error))\n ) {\n return {\n message: nonErrorPrefix + '' + jsonStringify(errorObject),\n stack: 'No stack, consider using an instance of Error',\n handlingStack: handlingStack,\n type: stackTrace && stackTrace.name\n }\n }\n return {\n message: stackTrace.message || 'Empty message',\n stack: toStackTraceString(stackTrace),\n handlingStack: handlingStack,\n type: stackTrace.name\n }\n}\n/**\n Creates a stacktrace without SDK internal frames.\n \n Constraints:\n - Has to be called at the utmost position of the call stack.\n - No internal monitoring should encapsulate the function, that is why we need to use callMonitored inside of it.\n */\nexport function createHandlingStack() {\n /**\n * Skip the two internal frames:\n * - SDK API (console.error, ...)\n * - this function\n * in order to keep only the user calls\n */\n var internalFramesToSkip = 2\n var error = new Error()\n var formattedStack\n\n // IE needs to throw the error to fill in the stack trace\n if (!error.stack) {\n try {\n throw error\n } catch (e) {\n noop()\n }\n }\n callMonitored(function () {\n var stackTrace = computeStackTrace(error)\n stackTrace.stack = stackTrace.stack.slice(internalFramesToSkip)\n formattedStack = toStackTraceString(stackTrace)\n })\n\n return formattedStack\n}\nexport function toStackTraceString(stack) {\n var result = formatErrorMessage(stack)\n each(stack.stack, function (frame) {\n var func = frame.func === '?' ? '<anonymous>' : frame.func\n var args =\n frame.args && frame.args.length > 0\n ? '(' + frame.args.join(', ') + ')'\n : ''\n var line = frame.line ? ':' + frame.line : ''\n var column = frame.line && frame.column ? ':' + frame.column : ''\n result += '\\n at ' + func + args + ' @ ' + frame.url + line + column\n })\n return result\n}\nexport function formatErrorMessage(stack) {\n return (stack.name || 'Error') + ': ' + stack.message\n}\nexport function getFileFromStackTraceString(stack) {\n var execResult = /@ (.+)/.exec(stack)\n return execResult && execResult[1]\n}\nexport function flattenErrorCauses(error, parentSource) {\n var currentError = error\n var causes = []\n while (\n currentError &&\n currentError.cause instanceof Error &&\n causes.length < 10\n ) {\n var stackTrace = computeStackTrace(currentError.cause)\n causes.push({\n message: currentError.cause.message,\n source: parentSource,\n type: stackTrace && stackTrace.name,\n stack: stackTrace && toStackTraceString(stackTrace)\n })\n currentError = currentError.cause\n }\n return causes.length ? causes : undefined\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACO,IAAIK,8BAA8B,GACvC,+CAA+C;AAAAC,OAAA,CAAAD,8BAAA,GAAAA,8BAAA;AAC1C,IAAIE,WAAW,GAAG;EACvBC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE;AACV,CAAC;AAAAP,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAEM,SAASO,eAAeA,CAACC,IAAI,EAAE;EACpC,IAAIC,UAAU,GAAGD,IAAI,CAACC,UAAU;EAChC,IAAIC,aAAa,GAAGF,IAAI,CAACE,aAAa;EACtC,IAAIC,aAAa,GAAGH,IAAI,CAACG,aAAa;EACtC,IAAIC,WAAW,GAAGJ,IAAI,CAACI,WAAW;EAClC,IAAIC,cAAc,GAAGL,IAAI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ClC,KAAK,CAAC;EACrC,OAAOiC,UAAU,IAAIA,UAAU,CAAC,CAAC,CAAC;AACpC;AACO,SAAS7B,kBAAkBA,CAACY,KAAK,EAAEmB,YAAY,EAAE;EACtD,IAAIC,YAAY,GAAGpB,KAAK;EACxB,IAAIb,MAAM,GAAG,EAAE;EACf,OACEiC,YAAY,IACZA,YAAY,CAACC,KAAK,YAAYxC,KAAK,IACnCM,MAAM,CAACO,MAAM,GAAG,EAAE,EAClB;IACA,IAAIrB,UAAU,GAAG,IAAAgC,2BAAiB,EAACe,YAAY,CAACC,KAAK,CAAC;IACtDlC,MAAM,CAACmC,IAAI,CAAC;MACVxC,OAAO,EAAEsC,YAAY,CAACC,KAAK,CAACvC,OAAO;MACnCJ,MAAM,EAAEyC,YAAY;MACpB7B,IAAI,EAAEjB,UAAU,IAAIA,UAAU,CAACkB,IAAI;MACnCP,KAAK,EAAEX,UAAU,IAAIa,kBAAkB,CAACb,UAAU;IACpD,CAAC,CAAC;IACF+C,YAAY,GAAGA,YAAY,CAACC,KAAK;EACnC;EACA,OAAOlC,MAAM,CAACO,MAAM,GAAGP,MAAM,GAAGE,SAAS;AAC3C"}
@@ -43,6 +43,7 @@ function callMonitored(fn, context, args) {
43
43
  }
44
44
  function displayIfDebugEnabled(api) {
45
45
  var args = [].slice.call(arguments, 1);
46
+ // display.apply(null, [api, '[MONITOR]'].concat(args))
46
47
  if (debugMode) {
47
48
  _display.display.apply(null, [api, '[MONITOR]'].concat(args));
48
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"monitor.js","names":["_display","require","onMonitorErrorCollected","debugMode","startMonitorErrorCollection","newOnMonitorErrorCollected","setDebugMode","newDebugMode","resetMonitor","undefined","monitor","fn","callMonitored","arguments","context","args","apply","e","displayIfDebugEnabled","ConsoleApiName","error","api","slice","call","display","concat"],"sources":["../../src/helper/monitor.js"],"sourcesContent":["import { ConsoleApiName, display } from './display'\nvar onMonitorErrorCollected\nvar debugMode = false\n\nexport function startMonitorErrorCollection(newOnMonitorErrorCollected) {\n onMonitorErrorCollected = newOnMonitorErrorCollected\n}\n\nexport function setDebugMode(newDebugMode) {\n debugMode = newDebugMode\n}\n\nexport function resetMonitor() {\n onMonitorErrorCollected = undefined\n debugMode = false\n}\n\nexport function monitor(fn) {\n return function () {\n return callMonitored(fn, this, arguments)\n }\n}\n\nexport function callMonitored(fn, context, args) {\n try {\n return fn.apply(context, args)\n } catch (e) {\n displayIfDebugEnabled(ConsoleApiName.error, e)\n if (onMonitorErrorCollected) {\n try {\n onMonitorErrorCollected(e)\n } catch (e) {\n displayIfDebugEnabled(ConsoleApiName.error, e)\n }\n }\n }\n}\n\nexport function displayIfDebugEnabled(api) {\n var args = [].slice.call(arguments, 1)\n if (debugMode) {\n display.apply(null, [api, '[MONITOR]'].concat(args))\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAIC,uBAAuB;AAC3B,IAAIC,SAAS,GAAG,KAAK;AAEd,SAASC,2BAA2BA,CAACC,0BAA0B,EAAE;EACtEH,uBAAuB,GAAGG,0BAA0B;AACtD;AAEO,SAASC,YAAYA,CAACC,YAAY,EAAE;EACzCJ,SAAS,GAAGI,YAAY;AAC1B;AAEO,SAASC,YAAYA,CAAA,EAAG;EAC7BN,uBAAuB,GAAGO,SAAS;EACnCN,SAAS,GAAG,KAAK;AACnB;AAEO,SAASO,OAAOA,CAACC,EAAE,EAAE;EAC1B,OAAO,YAAY;IACjB,OAAOC,aAAa,CAACD,EAAE,EAAE,IAAI,EAAEE,SAAS,CAAC;EAC3C,CAAC;AACH;AAEO,SAASD,aAAaA,CAACD,EAAE,EAAEG,OAAO,EAAEC,IAAI,EAAE;EAC/C,IAAI;IACF,OAAOJ,EAAE,CAACK,KAAK,CAACF,OAAO,EAAEC,IAAI,CAAC;EAChC,CAAC,CAAC,OAAOE,CAAC,EAAE;IACVC,qBAAqB,CAACC,uBAAc,CAACC,KAAK,EAAEH,CAAC,CAAC;IAC9C,IAAIf,uBAAuB,EAAE;MAC3B,IAAI;QACFA,uBAAuB,CAACe,CAAC,CAAC;MAC5B,CAAC,CAAC,OAAOA,CAAC,EAAE;QACVC,qBAAqB,CAACC,uBAAc,CAACC,KAAK,EAAEH,CAAC,CAAC;MAChD;IACF;EACF;AACF;AAEO,SAASC,qBAAqBA,CAACG,GAAG,EAAE;EACzC,IAAIN,IAAI,GAAG,EAAE,CAACO,KAAK,CAACC,IAAI,CAACV,SAAS,EAAE,CAAC,CAAC;EACtC,IAAIV,SAAS,EAAE;IACbqB,gBAAO,CAACR,KAAK,CAAC,IAAI,EAAE,CAACK,GAAG,EAAE,WAAW,CAAC,CAACI,MAAM,CAACV,IAAI,CAAC,CAAC;EACtD;AACF"}
1
+ {"version":3,"file":"monitor.js","names":["_display","require","onMonitorErrorCollected","debugMode","startMonitorErrorCollection","newOnMonitorErrorCollected","setDebugMode","newDebugMode","resetMonitor","undefined","monitor","fn","callMonitored","arguments","context","args","apply","e","displayIfDebugEnabled","ConsoleApiName","error","api","slice","call","display","concat"],"sources":["../../src/helper/monitor.js"],"sourcesContent":["import { ConsoleApiName, display } from './display'\nvar onMonitorErrorCollected\nvar debugMode = false\n\nexport function startMonitorErrorCollection(newOnMonitorErrorCollected) {\n onMonitorErrorCollected = newOnMonitorErrorCollected\n}\n\nexport function setDebugMode(newDebugMode) {\n debugMode = newDebugMode\n}\n\nexport function resetMonitor() {\n onMonitorErrorCollected = undefined\n debugMode = false\n}\n\nexport function monitor(fn) {\n return function () {\n return callMonitored(fn, this, arguments)\n }\n}\n\nexport function callMonitored(fn, context, args) {\n try {\n return fn.apply(context, args)\n } catch (e) {\n displayIfDebugEnabled(ConsoleApiName.error, e)\n if (onMonitorErrorCollected) {\n try {\n onMonitorErrorCollected(e)\n } catch (e) {\n displayIfDebugEnabled(ConsoleApiName.error, e)\n }\n }\n }\n}\n\nexport function displayIfDebugEnabled(api) {\n var args = [].slice.call(arguments, 1)\n // display.apply(null, [api, '[MONITOR]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,CAAC,CAAC;EACtD;AACF"}
@@ -7,7 +7,9 @@ exports.BYTES_COMPUTATION_THROTTLING_DELAY = void 0;
7
7
  exports.createContextManager = createContextManager;
8
8
  var _byteUtils = require("../byteUtils");
9
9
  var _tools = require("../tools");
10
+ var _sanitize = require("../sanitize");
10
11
  var _jsonStringify = require("./jsonStringify");
12
+ var _observable = require("../observable");
11
13
  var _heavyCustomerDataWarning = require("./heavyCustomerDataWarning");
12
14
  var BYTES_COMPUTATION_THROTTLING_DELAY = 200;
13
15
  exports.BYTES_COMPUTATION_THROTTLING_DELAY = BYTES_COMPUTATION_THROTTLING_DELAY;
@@ -18,7 +20,7 @@ function createContextManager(customerDataType, computeBytesCountImpl) {
18
20
  var context = {};
19
21
  var bytesCountCache;
20
22
  var alreadyWarned = false;
21
-
23
+ var changeObservable = new _observable.Observable();
22
24
  // Throttle the bytes computation to minimize the impact on performance.
23
25
  // Especially useful if the user call context APIs synchronously multiple times in a row
24
26
  var computeBytesCountThrottled = (0, _tools.throttle)(function (context) {
@@ -27,7 +29,7 @@ function createContextManager(customerDataType, computeBytesCountImpl) {
27
29
  alreadyWarned = (0, _heavyCustomerDataWarning.warnIfCustomerDataLimitReached)(bytesCountCache, customerDataType);
28
30
  }
29
31
  }, BYTES_COMPUTATION_THROTTLING_DELAY).throttled;
30
- return {
32
+ var contextManager = {
31
33
  getBytesCount: function getBytesCount() {
32
34
  return bytesCountCache;
33
35
  },
@@ -39,36 +41,49 @@ function createContextManager(customerDataType, computeBytesCountImpl) {
39
41
  add: function add(key, value) {
40
42
  context[key] = value;
41
43
  computeBytesCountThrottled(context);
44
+ changeObservable.notify();
42
45
  },
43
46
  /** @deprecated renamed to removeContextProperty */
44
47
  remove: function remove(key) {
45
48
  delete context[key];
46
49
  computeBytesCountThrottled(context);
50
+ changeObservable.notify();
47
51
  },
48
52
  /** @deprecated use setContext instead */
49
53
  set: function set(newContext) {
50
54
  context = newContext;
51
55
  computeBytesCountThrottled(context);
56
+ changeObservable.notify();
52
57
  },
53
58
  getContext: function getContext() {
54
59
  return (0, _tools.deepClone)(context);
55
60
  },
56
61
  setContext: function setContext(newContext) {
57
- context = (0, _tools.deepClone)(newContext);
58
- computeBytesCountThrottled(context);
62
+ if ((0, _tools.getType)(newContext) === 'object') {
63
+ context = (0, _sanitize.sanitize)(newContext);
64
+ computeBytesCountThrottled(context);
65
+ } else {
66
+ contextManager.clearContext();
67
+ }
68
+ changeObservable.notify();
59
69
  },
60
70
  setContextProperty: function setContextProperty(key, property) {
61
71
  context[key] = (0, _tools.deepClone)(property);
62
72
  computeBytesCountThrottled(context);
73
+ changeObservable.notify();
63
74
  },
64
75
  removeContextProperty: function removeContextProperty(key) {
65
76
  delete context[key];
66
77
  computeBytesCountThrottled(context);
78
+ changeObservable.notify();
67
79
  },
68
80
  clearContext: function clearContext() {
69
81
  context = {};
70
82
  bytesCountCache = 0;
71
- }
83
+ changeObservable.notify();
84
+ },
85
+ changeObservable: changeObservable
72
86
  };
87
+ return contextManager;
73
88
  }
74
89
  //# sourceMappingURL=contextManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contextManager.js","names":["_byteUtils","require","_tools","_jsonStringify","_heavyCustomerDataWarning","BYTES_COMPUTATION_THROTTLING_DELAY","exports","createContextManager","customerDataType","computeBytesCountImpl","computeBytesCount","context","bytesCountCache","alreadyWarned","computeBytesCountThrottled","throttle","jsonStringify","warnIfCustomerDataLimitReached","throttled","getBytesCount","get","add","key","value","remove","set","newContext","getContext","deepClone","setContext","setContextProperty","property","removeContextProperty","clearContext"],"sources":["../../../src/helper/serialisation/contextManager.js"],"sourcesContent":["import { computeBytesCount } from '../byteUtils'\nimport { deepClone, throttle } from '../tools'\nimport { jsonStringify } from './jsonStringify'\nimport { warnIfCustomerDataLimitReached } from './heavyCustomerDataWarning'\n\nexport var BYTES_COMPUTATION_THROTTLING_DELAY = 200\n\nexport function createContextManager(customerDataType, computeBytesCountImpl) {\n if (typeof computeBytesCountImpl === 'undefined') {\n computeBytesCountImpl = computeBytesCount\n }\n var context = {}\n var bytesCountCache\n var alreadyWarned = false\n\n // Throttle the bytes computation to minimize the impact on performance.\n // Especially useful if the user call context APIs synchronously multiple times in a row\n var computeBytesCountThrottled = throttle(function (context) {\n bytesCountCache = computeBytesCountImpl(jsonStringify(context))\n if (!alreadyWarned) {\n alreadyWarned = warnIfCustomerDataLimitReached(\n bytesCountCache,\n customerDataType\n )\n }\n }, BYTES_COMPUTATION_THROTTLING_DELAY).throttled\n\n return {\n getBytesCount: function () {\n return bytesCountCache\n },\n /** @deprecated use getContext instead */\n get: function () {\n return context\n },\n\n /** @deprecated use setContextProperty instead */\n add: function (key, value) {\n context[key] = value\n computeBytesCountThrottled(context)\n },\n\n /** @deprecated renamed to removeContextProperty */\n remove: function (key) {\n delete context[key]\n computeBytesCountThrottled(context)\n },\n\n /** @deprecated use setContext instead */\n set: function (newContext) {\n context = newContext\n computeBytesCountThrottled(context)\n },\n\n getContext: function () {\n return deepClone(context)\n },\n\n setContext: function (newContext) {\n context = deepClone(newContext)\n computeBytesCountThrottled(context)\n },\n\n setContextProperty: function (key, property) {\n context[key] = deepClone(property)\n computeBytesCountThrottled(context)\n },\n\n removeContextProperty: function (key) {\n delete context[key]\n computeBytesCountThrottled(context)\n },\n\n clearContext: function () {\n context = {}\n bytesCountCache = 0\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AAEO,IAAII,kCAAkC,GAAG,GAAG;AAAAC,OAAA,CAAAD,kCAAA,GAAAA,kCAAA;AAE5C,SAASE,oBAAoBA,CAACC,gBAAgB,EAAEC,qBAAqB,EAAE;EAC5E,IAAI,OAAOA,qBAAqB,KAAK,WAAW,EAAE;IAChDA,qBAAqB,GAAGC,4BAAiB;EAC3C;EACA,IAAIC,OAAO,GAAG,CAAC,CAAC;EA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CpB,OAAO,CAACW,GAAG,CAAC,GAAG,IAAAM,gBAAS,EAACG,QAAQ,CAAC;MAClCjB,0BAA0B,CAACH,OAAO,CAAC;IACrC,CAAC;IAEDqB,qBAAqB,EAAE,SAAAA,sBAAUV,GAAG,EAAE;MACpC,OAAOX,OAAO,CAACW,GAAG,CAAC;MACnBR,0BAA0B,CAACH,OAAO,CAAC;IACrC,CAAC;IAEDsB,YAAY,EAAE,SAAAA,aAAA,EAAY;MACxBtB,OAAO,GAAG,CAAC,CAAC;MACZC,eAAe,GAAG,CAAC;IACrB;EACF,CAAC;AACH"}
1
+ {"version":3,"file":"contextManager.js","names":["_byteUtils","require","_tools","_sanitize","_jsonStringify","_observable","_heavyCustomerDataWarning","BYTES_COMPUTATION_THROTTLING_DELAY","exports","createContextManager","customerDataType","computeBytesCountImpl","computeBytesCount","context","bytesCountCache","alreadyWarned","changeObservable","Observable","computeBytesCountThrottled","throttle","jsonStringify","warnIfCustomerDataLimitReached","throttled","contextManager","getBytesCount","get","add","key","value","notify","remove","set","newContext","getContext","deepClone","setContext","getType","sanitize","clearContext","setContextProperty","property","removeContextProperty"],"sources":["../../../src/helper/serialisation/contextManager.js"],"sourcesContent":["import { computeBytesCount } from '../byteUtils'\nimport { deepClone, throttle, getType } from '../tools'\nimport { sanitize } from '../sanitize'\nimport { jsonStringify } from './jsonStringify'\nimport { Observable } from '../observable'\nimport { warnIfCustomerDataLimitReached } from './heavyCustomerDataWarning'\n\nexport var BYTES_COMPUTATION_THROTTLING_DELAY = 200\n\nexport function createContextManager(customerDataType, computeBytesCountImpl) {\n if (typeof computeBytesCountImpl === 'undefined') {\n computeBytesCountImpl = computeBytesCount\n }\n var context = {}\n var bytesCountCache\n var alreadyWarned = false\n var changeObservable = new Observable()\n // Throttle the bytes computation to minimize the impact on performance.\n // Especially useful if the user call context APIs synchronously multiple times in a row\n var computeBytesCountThrottled = throttle(function (context) {\n bytesCountCache = computeBytesCountImpl(jsonStringify(context))\n if (!alreadyWarned) {\n alreadyWarned = warnIfCustomerDataLimitReached(\n bytesCountCache,\n customerDataType\n )\n }\n }, BYTES_COMPUTATION_THROTTLING_DELAY).throttled\n\n var contextManager = {\n getBytesCount: function () {\n return bytesCountCache\n },\n /** @deprecated use getContext instead */\n get: function () {\n return context\n },\n\n /** @deprecated use setContextProperty instead */\n add: function (key, value) {\n context[key] = value\n computeBytesCountThrottled(context)\n changeObservable.notify()\n },\n\n /** @deprecated renamed to removeContextProperty */\n remove: function (key) {\n delete context[key]\n computeBytesCountThrottled(context)\n changeObservable.notify()\n },\n\n /** @deprecated use setContext instead */\n set: function (newContext) {\n context = newContext\n computeBytesCountThrottled(context)\n changeObservable.notify()\n },\n\n getContext: function () {\n return deepClone(context)\n },\n\n setContext: function (newContext) {\n if (getType(newContext) === 'object') {\n context = sanitize(newContext)\n computeBytesCountThrottled(context)\n } else {\n contextManager.clearContext()\n }\n changeObservable.notify()\n },\n\n setContextProperty: function (key, property) {\n context[key] = deepClone(property)\n computeBytesCountThrottled(context)\n changeObservable.notify()\n },\n\n removeContextProperty: function (key) {\n delete context[key]\n computeBytesCountThrottled(context)\n changeObservable.notify()\n },\n\n clearContext: function () {\n context = {}\n bytesCountCache = 0\n changeObservable.notify()\n },\n changeObservable: changeObservable\n }\n return contextManager\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAL,OAAA;AAEO,IAAIM,kCAAkC,GAAG,GAAG;AAAAC,OAAA,CAAAD,kCAAA,GAAAA,kCAAA;AAE5C,SAASE,oBAAoBA,CAACC,gBAAgB,EAAEC,qBAAqB,EAAE;EAC5E,IAAI,OAAOA,qBAAqB,KAAK,WAAW,EAAE;IAChDA,qBAAqB,GAAGC,4BAAiB;EAC3C;EACA,IA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;IAEDsB,UAAU,EAAE,SAAAA,WAAUH,UAAU,EAAE;MAChC,IAAI,IAAAI,cAAO,EAACJ,UAAU,CAAC,KAAK,QAAQ,EAAE;QACpCnB,OAAO,GAAG,IAAAwB,kBAAQ,EAACL,UAAU,CAAC;QAC9Bd,0BAA0B,CAACL,OAAO,CAAC;MACrC,CAAC,MAAM;QACLU,cAAc,CAACe,YAAY,CAAC,CAAC;MAC/B;MACAtB,gBAAgB,CAACa,MAAM,CAAC,CAAC;IAC3B,CAAC;IAEDU,kBAAkB,EAAE,SAAAA,mBAAUZ,GAAG,EAAEa,QAAQ,EAAE;MAC3C3B,OAAO,CAACc,GAAG,CAAC,GAAG,IAAAO,gBAAS,EAACM,QAAQ,CAAC;MAClCtB,0BAA0B,CAACL,OAAO,CAAC;MACnCG,gBAAgB,CAACa,MAAM,CAAC,CAAC;IAC3B,CAAC;IAEDY,qBAAqB,EAAE,SAAAA,sBAAUd,GAAG,EAAE;MACpC,OAAOd,OAAO,CAACc,GAAG,CAAC;MACnBT,0BAA0B,CAACL,OAAO,CAAC;MACnCG,gBAAgB,CAACa,MAAM,CAAC,CAAC;IAC3B,CAAC;IAEDS,YAAY,EAAE,SAAAA,aAAA,EAAY;MACxBzB,OAAO,GAAG,CAAC,CAAC;MACZC,eAAe,GAAG,CAAC;MACnBE,gBAAgB,CAACa,MAAM,CAAC,CAAC;IAC3B,CAAC;IACDb,gBAAgB,EAAEA;EACpB,CAAC;EACD,OAAOO,cAAc;AACvB"}
@@ -21,12 +21,14 @@ function escapeRowData(str) {
21
21
  return '\\' + word;
22
22
  });
23
23
  }
24
- function escapeJsonValue(value) {
25
- if ((0, _tools.isString)(value)) {
26
- return value;
27
- } else {
28
- return (0, _jsonStringify.jsonStringify)(value);
24
+ function escapeJsonValue(value, isTag) {
25
+ if (_typeof(value) === 'object' && value) {
26
+ value = (0, _jsonStringify.jsonStringify)(value);
27
+ } else if (isTag) {
28
+ // tag json 只能是字符串
29
+ value = '' + value;
29
30
  }
31
+ return value;
30
32
  }
31
33
  function escapeFieldValueStr(str) {
32
34
  return '"' + str.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"';
@@ -1 +1 @@
1
- {"version":3,"file":"rowData.js","names":["_jsonStringify","require","_tools","_typeof","obj","Symbol","iterator","constructor","prototype","escapeRowData","str","jsonStringify","isString","reg","String","replace","word","escapeJsonValue","value","escapeFieldValueStr","escapeRowField"],"sources":["../../../src/helper/serialisation/rowData.js"],"sourcesContent":["import { jsonStringify } from './jsonStringify'\nimport { isString } from '../tools'\nexport function escapeRowData(str) {\n if (typeof str === 'object' && str) {\n str = jsonStringify(str)\n } else if (!isString(str)) {\n return str\n }\n var reg = /[\\s=,\"]/g\n return String(str).replace(reg, function (word) {\n return '\\\\' + word\n })\n}\n\nexport function escapeJsonValue(value) {\n if (isString(value)) {\n return value\n } else {\n return jsonStringify(value)\n }\n}\n\nexport function escapeFieldValueStr(str) {\n return '\"' + str.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"') + '\"'\n}\nexport function escapeRowField(value) {\n if (typeof value === 'object' && value) {\n return escapeFieldValueStr(jsonStringify(value))\n } else if (isString(value)) {\n return escapeFieldValueStr(value)\n } else {\n return value\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAmC,SAAAE,QAAAC,GAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,GAAA,kBAAAA,GAAA,gBAAAA,GAAA,WAAAA,GAAA,yBAAAC,MAAA,IAAAD,GAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,GAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,GAAA,KAAAD,OAAA,CAAAC,GAAA;AAC5B,SAASK,aAAaA,CAACC,GAAG,EAAE;EACjC,IAAIP,OAAA,CAAOO,GAAG,MAAK,QAAQ,IAAIA,GAAG,EAAE;IAClCA,GAAG,GAAG,IAAAC,4BAAa,EAACD,GAAG,CAAC;EAC1B,CAAC,MAAM,IAAI,CAAC,IAAAE,eAAQ,EAACF,GAAG,CAAC,EAAE;IACzB,OAAOA,GAAG;EACZ;EACA,IAAIG,GAAG,GAAG,UAAU;EACpB,OAAOC,MAAM,CAACJ,GAAG,CAAC,CAACK,OAAO,CAACF,GAAG,EAAE,UAAUG,IAAI,EAAE;IAC9C,OAAO,IAAI,GAAGA,IAAI;EACpB,CAAC,CAAC;AACJ;AAEO,SAASC,eAAeA,CAACC,KAAK,EAAE;EACrC,IAAI,IAAAN,eAAQ,EAACM,KAAK,CAAC,EAAE;IACnB,OAAOA,KAAK;EACd,CAAC,MAAM;IACL,OAAO,IAAAP,4BAAa,EAACO,KAAK,CAAC;EAC7B;AACF;AAEO,SAASC,mBAAmBA,CAACT,GAAG,EAAE;EACvC,OAAO,GAAG,GAAGA,GAAG,CAACK,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAACA,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,GAAG;AACpE;AACO,SAASK,cAAcA,CAACF,KAAK,EAAE;EACpC,IAAIf,OAAA,CAAOe,KAAK,MAAK,QAAQ,IAAIA,KAAK,EAAE;IACtC,OAAOC,mBAAmB,CAAC,IAAAR,4BAAa,EAACO,KAAK,CAAC,CAAC;EAClD,CAAC,MAAM,IAAI,IAAAN,eAAQ,EAACM,KAAK,CAAC,EAAE;IAC1B,OAAOC,mBAAmB,CAACD,KAAK,CAAC;EACnC,CAAC,MAAM;IACL,OAAOA,KAAK;EACd;AACF"}
1
+ {"version":3,"file":"rowData.js","names":["_jsonStringify","require","_tools","_typeof","obj","Symbol","iterator","constructor","prototype","escapeRowData","str","jsonStringify","isString","reg","String","replace","word","escapeJsonValue","value","isTag","escapeFieldValueStr","escapeRowField"],"sources":["../../../src/helper/serialisation/rowData.js"],"sourcesContent":["import { jsonStringify } from './jsonStringify'\nimport { isString, isNumber } from '../tools'\nexport function escapeRowData(str) {\n if (typeof str === 'object' && str) {\n str = jsonStringify(str)\n } else if (!isString(str)) {\n return str\n }\n var reg = /[\\s=,\"]/g\n return String(str).replace(reg, function (word) {\n return '\\\\' + word\n })\n}\n\nexport function escapeJsonValue(value, isTag) {\n if (typeof value === 'object' && value) {\n value = jsonStringify(value)\n } else if (isTag) {\n // tag json 只能是字符串\n value = '' + value\n }\n\n return value\n}\n\nexport function escapeFieldValueStr(str) {\n return '\"' + str.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"') + '\"'\n}\nexport function escapeRowField(value) {\n if (typeof value === 'object' && value) {\n return escapeFieldValueStr(jsonStringify(value))\n } else if (isString(value)) {\n return escapeFieldValueStr(value)\n } else {\n return value\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAA6C,SAAAE,QAAAC,GAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,GAAA,kBAAAA,GAAA,gBAAAA,GAAA,WAAAA,GAAA,yBAAAC,MAAA,IAAAD,GAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,GAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,GAAA,KAAAD,OAAA,CAAAC,GAAA;AACtC,SAASK,aAAaA,CAACC,GAAG,EAAE;EACjC,IAAIP,OAAA,CAAOO,GAAG,MAAK,QAAQ,IAAIA,GAAG,EAAE;IAClCA,GAAG,GAAG,IAAAC,4BAAa,EAACD,GAAG,CAAC;EAC1B,CAAC,MAAM,IAAI,CAAC,IAAAE,eAAQ,EAACF,GAAG,CAAC,EAAE;IACzB,OAAOA,GAAG;EACZ;EACA,IAAIG,GAAG,GAAG,UAAU;EACpB,OAAOC,MAAM,CAACJ,GAAG,CAAC,CAACK,OAAO,CAACF,GAAG,EAAE,UAAUG,IAAI,EAAE;IAC9C,OAAO,IAAI,GAAGA,IAAI;EACpB,CAAC,CAAC;AACJ;AAEO,SAASC,eAAeA,CAACC,KAAK,EAAEC,KAAK,EAAE;EAC5C,IAAIhB,OAAA,CAAOe,KAAK,MAAK,QAAQ,IAAIA,KAAK,EAAE;IACtCA,KAAK,GAAG,IAAAP,4BAAa,EAACO,KAAK,CAAC;EAC9B,CAAC,MAAM,IAAIC,KAAK,EAAE;IAChB;IACAD,KAAK,GAAG,EAAE,GAAGA,KAAK;EACpB;EAEA,OAAOA,KAAK;AACd;AAEO,SAASE,mBAAmBA,CAACV,GAAG,EAAE;EACvC,OAAO,GAAG,GAAGA,GAAG,CAACK,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAACA,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,GAAG;AACpE;AACO,SAASM,cAAcA,CAACH,KAAK,EAAE;EACpC,IAAIf,OAAA,CAAOe,KAAK,MAAK,QAAQ,IAAIA,KAAK,EAAE;IACtC,OAAOE,mBAAmB,CAAC,IAAAT,4BAAa,EAACO,KAAK,CAAC,CAAC;EAClD,CAAC,MAAM,IAAI,IAAAN,eAAQ,EAACM,KAAK,CAAC,EAAE;IAC1B,OAAOE,mBAAmB,CAACF,KAAK,CAAC;EACnC,CAAC,MAAM;IACL,OAAOA,KAAK;EACd;AACF"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.buildStorageKey = buildStorageKey;
7
+ exports.createStoredContextManager = createStoredContextManager;
8
+ exports.removeStorageListeners = removeStorageListeners;
9
+ var _byteUtils = require("../byteUtils");
10
+ var _enums = require("../enums");
11
+ var _tools = require("../tools");
12
+ var _addEventListener = require("../../browser/addEventListener");
13
+ var _contextManager = require("./contextManager");
14
+ var CONTEXT_STORE_KEY_PREFIX = '_gc_s';
15
+ var storageListeners = [];
16
+ function createStoredContextManager(productKey, customerDataType, computeBytesCountImpl) {
17
+ if (computeBytesCountImpl === undefined) {
18
+ computeBytesCountImpl = _byteUtils.computeBytesCount;
19
+ }
20
+ var storageKey = buildStorageKey(productKey, customerDataType);
21
+ var contextManager = (0, _contextManager.createContextManager)(customerDataType, computeBytesCountImpl);
22
+ synchronizeWithStorage();
23
+ storageListeners.push((0, _addEventListener.addEventListener)(window, _enums.DOM_EVENT.STORAGE, function (params) {
24
+ if (storageKey === params.key) {
25
+ synchronizeWithStorage();
26
+ }
27
+ }));
28
+ contextManager.changeObservable.subscribe(dumpToStorage);
29
+ function synchronizeWithStorage() {
30
+ var rawContext = localStorage.getItem(storageKey);
31
+ var context = rawContext !== null ? JSON.parse(rawContext) : {};
32
+ contextManager.setContext(context);
33
+ }
34
+ function dumpToStorage() {
35
+ localStorage.setItem(storageKey, JSON.stringify(contextManager.getContext()));
36
+ }
37
+ return contextManager;
38
+ }
39
+ function buildStorageKey(productKey, customerDataType) {
40
+ return CONTEXT_STORE_KEY_PREFIX + '_' + productKey + '_' + customerDataType;
41
+ }
42
+ function removeStorageListeners() {
43
+ (0, _tools.map)(storageListeners, function (listener) {
44
+ listener.stop();
45
+ });
46
+ }
47
+ //# sourceMappingURL=storedContextManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storedContextManager.js","names":["_byteUtils","require","_enums","_tools","_addEventListener","_contextManager","CONTEXT_STORE_KEY_PREFIX","storageListeners","createStoredContextManager","productKey","customerDataType","computeBytesCountImpl","undefined","computeBytesCount","storageKey","buildStorageKey","contextManager","createContextManager","synchronizeWithStorage","push","addEventListener","window","DOM_EVENT","STORAGE","params","key","changeObservable","subscribe","dumpToStorage","rawContext","localStorage","getItem","context","JSON","parse","setContext","setItem","stringify","getContext","removeStorageListeners","map","listener","stop"],"sources":["../../../src/helper/serialisation/storedContextManager.js"],"sourcesContent":["import { computeBytesCount } from '../byteUtils'\nimport { DOM_EVENT } from '../enums'\nimport { map } from '../tools'\nimport { addEventListener } from '../../browser/addEventListener'\nimport { createContextManager } from './contextManager'\nvar CONTEXT_STORE_KEY_PREFIX = '_gc_s'\n\nvar storageListeners = []\n\nexport function createStoredContextManager(\n productKey,\n customerDataType,\n computeBytesCountImpl\n) {\n if (computeBytesCountImpl === undefined) {\n computeBytesCountImpl = computeBytesCount\n }\n var storageKey = buildStorageKey(productKey, customerDataType)\n var contextManager = createContextManager(\n customerDataType,\n computeBytesCountImpl\n )\n\n synchronizeWithStorage()\n storageListeners.push(\n addEventListener(window, DOM_EVENT.STORAGE, function (params) {\n if (storageKey === params.key) {\n synchronizeWithStorage()\n }\n })\n )\n contextManager.changeObservable.subscribe(dumpToStorage)\n function synchronizeWithStorage() {\n var rawContext = localStorage.getItem(storageKey)\n var context = rawContext !== null ? JSON.parse(rawContext) : {}\n contextManager.setContext(context)\n }\n\n function dumpToStorage() {\n localStorage.setItem(\n storageKey,\n JSON.stringify(contextManager.getContext())\n )\n }\n return contextManager\n}\n\nexport function buildStorageKey(productKey, customerDataType) {\n return CONTEXT_STORE_KEY_PREFIX + '_' + productKey + '_' + customerDataType\n}\n\nexport function removeStorageListeners() {\n map(storageListeners, function (listener) {\n listener.stop()\n })\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAIK,wBAAwB,GAAG,OAAO;AAEtC,IAAIC,gBAAgB,GAAG,EAAE;AAElB,SAASC,0BAA0BA,CACxCC,UAAU,EACVC,gBAAgB,EAChBC,qBAAqB,EACrB;EACA,IAAIA,qBAAqB,KAAKC,SAAS,EAAE;IACvCD,qBAAqB,GAAGE,4BAAiB;EAC3C;EACA,IAAIC,UAAU,GAAGC,eAAe,CAACN,UAAU,EAAEC,gBAAgB,CAAC;EAC9D,IAAIM,cAAc,GAAG,IAAAC,oCAAoB,EACvCP,gBAAgB,EAChBC,qBACF,CAAC;EAEDO,sBAAsB,CAAC,CAAC;EACxBX,gBA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