@cloudcare/browser-core 3.2.39 → 3.2.41

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 (51) hide show
  1. package/cjs/browser/addEventListener.js +45 -5
  2. package/cjs/browser/addEventListener.js.map +1 -1
  3. package/cjs/browser/xhrObservable.js +13 -0
  4. package/cjs/browser/xhrObservable.js.map +1 -1
  5. package/cjs/configuration/remoteConfiguration.js +7 -2
  6. package/cjs/configuration/remoteConfiguration.js.map +1 -1
  7. package/cjs/dataMap.js +2 -0
  8. package/cjs/dataMap.js.map +1 -1
  9. package/cjs/helper/deviceInfo.js +2 -1
  10. package/cjs/helper/deviceInfo.js.map +1 -1
  11. package/cjs/index.js +7 -0
  12. package/cjs/index.js.map +1 -1
  13. package/cjs/session/sessionConstants.js +2 -1
  14. package/cjs/session/sessionConstants.js.map +1 -1
  15. package/cjs/session/sessionManagement.js +13 -3
  16. package/cjs/session/sessionManagement.js.map +1 -1
  17. package/cjs/session/sessionStore.js +1 -1
  18. package/cjs/session/sessionStore.js.map +1 -1
  19. package/cjs/transport/flushController.js +2 -2
  20. package/cjs/transport/flushController.js.map +1 -1
  21. package/esm/browser/addEventListener.js +45 -5
  22. package/esm/browser/addEventListener.js.map +1 -1
  23. package/esm/browser/xhrObservable.js +13 -0
  24. package/esm/browser/xhrObservable.js.map +1 -1
  25. package/esm/configuration/remoteConfiguration.js +6 -2
  26. package/esm/configuration/remoteConfiguration.js.map +1 -1
  27. package/esm/dataMap.js +2 -0
  28. package/esm/dataMap.js.map +1 -1
  29. package/esm/helper/deviceInfo.js +2 -1
  30. package/esm/helper/deviceInfo.js.map +1 -1
  31. package/esm/index.js +1 -1
  32. package/esm/index.js.map +1 -1
  33. package/esm/session/sessionConstants.js +1 -0
  34. package/esm/session/sessionConstants.js.map +1 -1
  35. package/esm/session/sessionManagement.js +14 -4
  36. package/esm/session/sessionManagement.js.map +1 -1
  37. package/esm/session/sessionStore.js +1 -1
  38. package/esm/session/sessionStore.js.map +1 -1
  39. package/esm/transport/flushController.js +2 -2
  40. package/esm/transport/flushController.js.map +1 -1
  41. package/package.json +3 -3
  42. package/src/browser/addEventListener.js +60 -8
  43. package/src/browser/xhrObservable.js +17 -2
  44. package/src/configuration/remoteConfiguration.js +13 -2
  45. package/src/dataMap.js +2 -0
  46. package/src/helper/deviceInfo.js +2 -1
  47. package/src/index.js +2 -1
  48. package/src/session/sessionConstants.js +1 -0
  49. package/src/session/sessionManagement.js +14 -4
  50. package/src/session/sessionStore.js +1 -1
  51. package/src/transport/flushController.js +6 -4
@@ -1 +1 @@
1
- {"version":3,"file":"flushController.js","names":["_observable","require","_timer","createFlushController","_ref","messagesLimit","bytesLimit","durationLimit","pageExitObservable","sessionExpireObservable","subscribe","event","flush","reason","flushObservable","Observable","pageExitSubscription","unsubscribe","sessionExpireSubscription","currentBytesCount","currentMessagesCount","flushReason","messagesCount","bytesCount","cancelDurationLimitTimeout","notify","durationLimitTimeoutId","scheduleDurationLimitTimeout","undefined","setTimeout","clearTimeout","getMessagesCount","notifyBeforeAddMessage","estimatedMessageBytesCount","notifyAfterAddMessage","messageBytesCountDiff","notifyAfterRemoveMessage","messageBytesCount"],"sources":["../../src/transport/flushController.js"],"sourcesContent":["import { Observable } from '../helper/observable'\nimport { clearTimeout, setTimeout } from '../helper/timer'\n\n// type FlushReason = PageExitReason | 'duration_limit' | 'bytes_limit' | 'messages_limit' | 'session_expire'\n\n/**\n * Returns a \"flush controller\", responsible of notifying when flushing a pool of pending data needs\n * to happen. The implementation is designed to support both synchronous and asynchronous usages,\n * but relies on invariants described in each method documentation to keep a coherent state.\n */\nexport function createFlushController({\n messagesLimit,\n bytesLimit,\n durationLimit,\n pageExitObservable,\n sessionExpireObservable\n}) {\n pageExitObservable.subscribe(function (event) {\n return flush(event.reason)\n })\n sessionExpireObservable.subscribe(function () {\n return flush('session_expire')\n })\n var flushObservable = new Observable(function () {\n return function () {\n pageExitSubscription.unsubscribe()\n sessionExpireSubscription.unsubscribe()\n }\n })\n\n var currentBytesCount = 0\n var currentMessagesCount = 0\n\n function flush(flushReason) {\n if (currentMessagesCount === 0) {\n return\n }\n\n var messagesCount = currentMessagesCount\n var bytesCount = currentBytesCount\n\n currentMessagesCount = 0\n currentBytesCount = 0\n cancelDurationLimitTimeout()\n\n flushObservable.notify({\n reason: flushReason,\n messagesCount: messagesCount,\n bytesCount: bytesCount\n })\n }\n\n var durationLimitTimeoutId\n function scheduleDurationLimitTimeout() {\n if (durationLimitTimeoutId === undefined) {\n durationLimitTimeoutId = setTimeout(function () {\n flush('duration_limit')\n }, durationLimit)\n }\n }\n\n function cancelDurationLimitTimeout() {\n clearTimeout(durationLimitTimeoutId)\n durationLimitTimeoutId = undefined\n }\n\n return {\n flushObservable: flushObservable,\n getMessagesCount: function () {\n return currentMessagesCount\n },\n\n /**\n * Notifies that a message will be added to a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right before adding the message, so no flush\n * event can happen after `notifyBeforeAddMessage` and before adding the message.\n */\n notifyBeforeAddMessage: function (estimatedMessageBytesCount) {\n if (currentBytesCount + estimatedMessageBytesCount >= bytesLimit) {\n flush('bytes_limit')\n }\n // Consider the message to be added now rather than in `notifyAfterAddMessage`, because if no\n // message was added yet and `notifyAfterAddMessage` is called asynchronously, we still want\n // to notify when a flush is needed (for example on page exit).\n currentMessagesCount += 1\n currentBytesCount += estimatedMessageBytesCount\n scheduleDurationLimitTimeout()\n },\n\n /**\n * Notifies that a message *was* added to a pool of pending messages waiting to be flushed.\n *\n * This function can be called asynchronously after the message was added, but in this case it\n * should not be called if a flush event occurred in between.\n */\n notifyAfterAddMessage: function (messageBytesCountDiff) {\n if (messageBytesCountDiff === undefined) {\n messageBytesCountDiff = 0\n }\n currentBytesCount += messageBytesCountDiff\n\n if (currentMessagesCount >= messagesLimit) {\n flush('messages_limit')\n } else if (currentBytesCount >= bytesLimit) {\n flush('bytes_limit')\n }\n },\n\n /**\n * Notifies that a message was removed from a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right after removing the message, so no flush\n * event can happen after removing the message and before `notifyAfterRemoveMessage`.\n *\n * @param messageBytesCount: the message bytes count that was added to the pool. Should\n * correspond to the sum of bytes counts passed to `notifyBeforeAddMessage` and\n * `notifyAfterAddMessage`.\n */\n notifyAfterRemoveMessage: function (messageBytesCount) {\n currentBytesCount -= messageBytesCount\n currentMessagesCount -= 1\n if (currentMessagesCount === 0) {\n cancelDurationLimitTimeout()\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,qBAAqBA,CAAAC,IAAA,EAMlC;EAAA,IALDC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IACbC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,aAAa,GAAAH,IAAA,CAAbG,aAAa;IACbC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,uBAAuB,GAAAL,IAAA,CAAvBK,uBAAuB;EAEvBD,kBAAkB,CAACE,SAAS,CAAC,UAAUC,KAAK,EAAE;IAC5C,OAAOC,KAAK,CAACD,KAAK,CAACE,MAAM,CAAC;EAC5B,CAAC,CAAC;EACFJ,uBAAuB,CAACC,SAAS,CAAC,YAAY;IAC5C,OAAOE,KAAK,CAAC,gBAAgB,CAAC;EAChC,CAAC,CAAC;EACF,IAAIE,eAAe,GAAG,IAAIC,sBAAU,CAAC,YAAY;IAC/C,OAAO,YAAY;MACjBC,oBAAoB,CAACC,WAAW,CAAC,CAAC;MAClCC,yBAAyB,CAACD,WAAW,CAAC,CAAC;IACzC,CAAC;EACH,CAAC,CAAC;EAEF,IAAIE,iBAAiB,GAAG,CAAC;EACzB,IAAIC,oBAAoB,GAAG,CAAC;EAE5B,SAASR,KAAKA,CAACS,WAAW,EAAE;IAC1B,IAAID,oBAAoB,KAAK,CAAC,EAAE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,iBAAiB,IAAIgB,qBAAqB;MAE1C,IAAIf,oBAAoB,IAAIf,aAAa,EAAE;QACzCO,KAAK,CAAC,gBAAgB,CAAC;MACzB,CAAC,MAAM,IAAIO,iBAAiB,IAAIb,UAAU,EAAE;QAC1CM,KAAK,CAAC,aAAa,CAAC;MACtB;IACF,CAAC;IAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIwB,wBAAwB,EAAE,SAA1BA,wBAAwBA,CAAYC,iBAAiB,EAAE;MACrDlB,iBAAiB,IAAIkB,iBAAiB;MACtCjB,oBAAoB,IAAI,CAAC;MACzB,IAAIA,oBAAoB,KAAK,CAAC,EAAE;QAC9BI,0BAA0B,CAAC,CAAC;MAC9B;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"flushController.js","names":["_observable","require","_timer","createFlushController","_ref","messagesLimit","bytesLimit","durationLimit","pageExitObservable","sessionExpireObservable","pageExitSubscription","subscribe","event","flush","reason","sessionExpireSubscription","flushObservable","Observable","unsubscribe","currentBytesCount","currentMessagesCount","flushReason","messagesCount","bytesCount","cancelDurationLimitTimeout","notify","durationLimitTimeoutId","scheduleDurationLimitTimeout","undefined","setTimeout","clearTimeout","getMessagesCount","notifyBeforeAddMessage","estimatedMessageBytesCount","notifyAfterAddMessage","messageBytesCountDiff","notifyAfterRemoveMessage","messageBytesCount"],"sources":["../../src/transport/flushController.js"],"sourcesContent":["import { Observable } from '../helper/observable'\nimport { clearTimeout, setTimeout } from '../helper/timer'\n\n// type FlushReason = PageExitReason | 'duration_limit' | 'bytes_limit' | 'messages_limit' | 'session_expire'\n\n/**\n * Returns a \"flush controller\", responsible of notifying when flushing a pool of pending data needs\n * to happen. The implementation is designed to support both synchronous and asynchronous usages,\n * but relies on invariants described in each method documentation to keep a coherent state.\n */\nexport function createFlushController({\n messagesLimit,\n bytesLimit,\n durationLimit,\n pageExitObservable,\n sessionExpireObservable\n}) {\n var pageExitSubscription = pageExitObservable.subscribe(function (event) {\n return flush(event.reason)\n })\n var sessionExpireSubscription = sessionExpireObservable.subscribe(\n function () {\n return flush('session_expire')\n }\n )\n var flushObservable = new Observable(function () {\n return function () {\n pageExitSubscription.unsubscribe()\n sessionExpireSubscription.unsubscribe()\n }\n })\n\n var currentBytesCount = 0\n var currentMessagesCount = 0\n\n function flush(flushReason) {\n if (currentMessagesCount === 0) {\n return\n }\n\n var messagesCount = currentMessagesCount\n var bytesCount = currentBytesCount\n\n currentMessagesCount = 0\n currentBytesCount = 0\n cancelDurationLimitTimeout()\n\n flushObservable.notify({\n reason: flushReason,\n messagesCount: messagesCount,\n bytesCount: bytesCount\n })\n }\n\n var durationLimitTimeoutId\n function scheduleDurationLimitTimeout() {\n if (durationLimitTimeoutId === undefined) {\n durationLimitTimeoutId = setTimeout(function () {\n flush('duration_limit')\n }, durationLimit)\n }\n }\n\n function cancelDurationLimitTimeout() {\n clearTimeout(durationLimitTimeoutId)\n durationLimitTimeoutId = undefined\n }\n\n return {\n flushObservable: flushObservable,\n getMessagesCount: function () {\n return currentMessagesCount\n },\n\n /**\n * Notifies that a message will be added to a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right before adding the message, so no flush\n * event can happen after `notifyBeforeAddMessage` and before adding the message.\n */\n notifyBeforeAddMessage: function (estimatedMessageBytesCount) {\n if (currentBytesCount + estimatedMessageBytesCount >= bytesLimit) {\n flush('bytes_limit')\n }\n // Consider the message to be added now rather than in `notifyAfterAddMessage`, because if no\n // message was added yet and `notifyAfterAddMessage` is called asynchronously, we still want\n // to notify when a flush is needed (for example on page exit).\n currentMessagesCount += 1\n currentBytesCount += estimatedMessageBytesCount\n scheduleDurationLimitTimeout()\n },\n\n /**\n * Notifies that a message *was* added to a pool of pending messages waiting to be flushed.\n *\n * This function can be called asynchronously after the message was added, but in this case it\n * should not be called if a flush event occurred in between.\n */\n notifyAfterAddMessage: function (messageBytesCountDiff) {\n if (messageBytesCountDiff === undefined) {\n messageBytesCountDiff = 0\n }\n currentBytesCount += messageBytesCountDiff\n\n if (currentMessagesCount >= messagesLimit) {\n flush('messages_limit')\n } else if (currentBytesCount >= bytesLimit) {\n flush('bytes_limit')\n }\n },\n\n /**\n * Notifies that a message was removed from a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right after removing the message, so no flush\n * event can happen after removing the message and before `notifyAfterRemoveMessage`.\n *\n * @param messageBytesCount: the message bytes count that was added to the pool. Should\n * correspond to the sum of bytes counts passed to `notifyBeforeAddMessage` and\n * `notifyAfterAddMessage`.\n */\n notifyAfterRemoveMessage: function (messageBytesCount) {\n currentBytesCount -= messageBytesCount\n currentMessagesCount -= 1\n if (currentMessagesCount === 0) {\n cancelDurationLimitTimeout()\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,qBAAqBA,CAAAC,IAAA,EAMlC;EAAA,IALDC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IACbC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,aAAa,GAAAH,IAAA,CAAbG,aAAa;IACbC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,uBAAuB,GAAAL,IAAA,CAAvBK,uBAAuB;EAEvB,IAAIC,oBAAoB,GAAGF,kBAAkB,CAACG,SAAS,CAAC,UAAUC,KAAK,EAAE;IACvE,OAAOC,KAAK,CAACD,KAAK,CAACE,MAAM,CAAC;EAC5B,CAAC,CAAC;EACF,IAAIC,yBAAyB,GAAGN,uBAAuB,CAACE,SAAS,CAC/D,YAAY;IACV,OAAOE,KAAK,CAAC,gBAAgB,CAAC;EAChC,CACF,CAAC;EACD,IAAIG,eAAe,GAAG,IAAIC,sBAAU,CAAC,YAAY;IAC/C,OAAO,YAAY;MACjBP,oBAAoB,CAACQ,WAAW,CAAC,CAAC;MAClCH,yBAAyB,CAACG,WAAW,CAAC,CA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C;IAED;AACJ;AACA;AACA;AACA;AACA;IACIO,qBAAqB,EAAE,SAAvBA,qBAAqBA,CAAYC,qBAAqB,EAAE;MACtD,IAAIA,qBAAqB,KAAKP,SAAS,EAAE;QACvCO,qBAAqB,GAAG,CAAC;MAC3B;MACAhB,iBAAiB,IAAIgB,qBAAqB;MAE1C,IAAIf,oBAAoB,IAAIf,aAAa,EAAE;QACzCQ,KAAK,CAAC,gBAAgB,CAAC;MACzB,CAAC,MAAM,IAAIM,iBAAiB,IAAIb,UAAU,EAAE;QAC1CO,KAAK,CAAC,aAAa,CAAC;MACtB;IACF,CAAC;IAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIuB,wBAAwB,EAAE,SAA1BA,wBAAwBA,CAAYC,iBAAiB,EAAE;MACrDlB,iBAAiB,IAAIkB,iBAAiB;MACtCjB,oBAAoB,IAAI,CAAC;MACzB,IAAIA,oBAAoB,KAAK,CAAC,EAAE;QAC9BI,0BAA0B,CAAC,CAAC;MAC9B;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -31,19 +31,59 @@ export function addEventListeners(eventTarget, eventNames, listener, options) {
31
31
  passive: options.passive
32
32
  } : options && options.capture;
33
33
  // Use the window.EventTarget.prototype when possible to avoid wrong overrides (e.g: https://github.com/salesforce/lwc/issues/1824)
34
- var listenerTarget = window.EventTarget && eventTarget instanceof EventTarget ? window.EventTarget.prototype : eventTarget;
35
- var add = getZoneJsOriginalValue(listenerTarget, 'addEventListener');
34
+ // const istarget = Object.prototype.toString.call(window)
35
+ // const listenerTarget =
36
+ // window.EventTarget && eventTarget instanceof EventTarget
37
+ // ? window.EventTarget.prototype
38
+ // : eventTarget
39
+ // var add = getZoneJsOriginalValue(listenerTarget, 'addEventListener')
40
+
41
+ // eventNames.forEach((eventName) => {
42
+ // add.call(eventTarget, eventName, wrappedListener, options)
43
+ // })
36
44
  each(eventNames, function (eventName) {
37
- add.call(eventTarget, eventName, wrappedListener, options);
45
+ withOriginalOrZoneJsPatchedMethod(eventTarget, 'addEventListener', function (method) {
46
+ return method.call(eventTarget, eventName, wrappedListener, options);
47
+ });
48
+ // add.call(eventTarget, eventName, wrappedListener, options)
38
49
  });
39
50
  var stop = function stop() {
40
- var remove = getZoneJsOriginalValue(listenerTarget, 'removeEventListener');
51
+ // var remove = getZoneJsOriginalValue(listenerTarget, 'removeEventListener')
41
52
  each(eventNames, function (eventName) {
42
- remove.call(eventTarget, eventName, wrappedListener, options);
53
+ withOriginalOrZoneJsPatchedMethod(eventTarget, 'removeEventListener', function (method) {
54
+ return method.call(eventTarget, eventName, wrappedListener, options);
55
+ });
56
+ // remove.call(eventTarget, eventName, wrappedListener, options)
43
57
  });
44
58
  };
45
59
  return {
46
60
  stop: stop
47
61
  };
48
62
  }
63
+ function isIllegalInvocationError(error, methodName) {
64
+ if (!(error instanceof Error)) {
65
+ return false;
66
+ }
67
+ return error.message.includes('Illegal invocation') ||
68
+ // chrome
69
+ error.message.includes("'".concat(methodName, "' called on an object that does not implement interface EventTarget.")) ||
70
+ // firefox
71
+ error.message.includes("Can only call EventTarget.".concat(methodName, " on instances of EventTarget")) // safari
72
+ ;
73
+ }
74
+ function withOriginalOrZoneJsPatchedMethod(eventTarget, methodName, cb) {
75
+ // Use the window.EventTarget.prototype when possible to avoid wrong overrides (e.g: https://github.com/salesforce/lwc/issues/1824)
76
+ var listenerTarget = window.EventTarget && eventTarget instanceof EventTarget ? window.EventTarget.prototype : eventTarget;
77
+ var originalMethod = getZoneJsOriginalValue(listenerTarget, methodName);
78
+ try {
79
+ // In some cases this call fails with an Illegal invocation error, we then catch the error and use the zone.js
80
+ // patched method
81
+ cb(originalMethod);
82
+ } catch (error) {
83
+ if (isIllegalInvocationError(error, methodName)) {
84
+ return cb(eventTarget[methodName]);
85
+ }
86
+ throw error;
87
+ }
88
+ }
49
89
  //# sourceMappingURL=addEventListener.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addEventListener.js","names":["each","getZoneJsOriginalValue","monitor","addEventListener","eventTarget","event","listener","options","addEventListeners","eventNames","wrappedListener","once","stop","passive","capture","listenerTarget","window","EventTarget","prototype","add","eventName","call","remove"],"sources":["../../src/browser/addEventListener.js"],"sourcesContent":["import { each } from '../helper/tools'\nimport { getZoneJsOriginalValue } from '../helper/getZoneJsOriginalValue'\nimport { monitor } from '../helper/monitor'\nexport function addEventListener(eventTarget, event, listener, options) {\n return addEventListeners(eventTarget, [event], listener, options)\n}\n\n/**\n * Add event listeners to an event emitter object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by:\n * * using an option object only if needed\n * * emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n *\n * * with `once: true`, the listener will be called at most once, even if different events are\n * listened\n */\n\nexport function addEventListeners(eventTarget, eventNames, listener, options) {\n var wrappedListener = monitor(\n options && options.once\n ? function (event) {\n stop()\n listener(event)\n }\n : listener\n )\n options =\n options && options.passive\n ? { capture: options.capture, passive: options.passive }\n : options && options.capture\n // Use the window.EventTarget.prototype when possible to avoid wrong overrides (e.g: https://github.com/salesforce/lwc/issues/1824)\n const listenerTarget =\n window.EventTarget && eventTarget instanceof EventTarget\n ? window.EventTarget.prototype\n : eventTarget\n var add = getZoneJsOriginalValue(listenerTarget, 'addEventListener')\n\n each(eventNames, function (eventName) {\n add.call(eventTarget, eventName, wrappedListener, options)\n })\n var stop = function () {\n var remove = getZoneJsOriginalValue(listenerTarget, 'removeEventListener')\n each(eventNames, function (eventName) {\n remove.call(eventTarget, eventName, wrappedListener, options)\n })\n }\n return {\n stop: stop\n }\n}\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,iBAAiB;AACtC,SAASC,sBAAsB,QAAQ,kCAAkC;AACzE,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,OAAO,SAASC,gBAAgBA,CAACC,WAAW,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAE;EACtE,OAAOC,iBAAiB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EACJ,CAAC;EACD,OAAO;IACLK,IAAI,EAAEA;EACR,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"addEventListener.js","names":["each","getZoneJsOriginalValue","monitor","addEventListener","eventTarget","event","listener","options","addEventListeners","eventNames","wrappedListener","once","stop","passive","capture","eventName","withOriginalOrZoneJsPatchedMethod","method","call","isIllegalInvocationError","error","methodName","Error","message","includes","concat","cb","listenerTarget","window","EventTarget","prototype","originalMethod"],"sources":["../../src/browser/addEventListener.js"],"sourcesContent":["import { each } from '../helper/tools'\nimport { getZoneJsOriginalValue } from '../helper/getZoneJsOriginalValue'\nimport { monitor } from '../helper/monitor'\nexport function addEventListener(eventTarget, event, listener, options) {\n return addEventListeners(eventTarget, [event], listener, options)\n}\n\n/**\n * Add event listeners to an event emitter object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by:\n * * using an option object only if needed\n * * emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n *\n * * with `once: true`, the listener will be called at most once, even if different events are\n * listened\n */\n\nexport function addEventListeners(eventTarget, eventNames, listener, options) {\n var wrappedListener = monitor(\n options && options.once\n ? function (event) {\n stop()\n listener(event)\n }\n : listener\n )\n options =\n options && options.passive\n ? { capture: options.capture, passive: options.passive }\n : options && options.capture\n // Use the window.EventTarget.prototype when possible to avoid wrong overrides (e.g: https://github.com/salesforce/lwc/issues/1824)\n // const istarget = Object.prototype.toString.call(window)\n // const listenerTarget =\n // window.EventTarget && eventTarget instanceof EventTarget\n // ? window.EventTarget.prototype\n // : eventTarget\n // var add = getZoneJsOriginalValue(listenerTarget, 'addEventListener')\n\n // eventNames.forEach((eventName) => {\n // add.call(eventTarget, eventName, wrappedListener, options)\n // })\n each(eventNames, function (eventName) {\n withOriginalOrZoneJsPatchedMethod(\n eventTarget,\n 'addEventListener',\n (method) => method.call(eventTarget, eventName, wrappedListener, options)\n )\n // add.call(eventTarget, eventName, wrappedListener, options)\n })\n var stop = function () {\n // var remove = getZoneJsOriginalValue(listenerTarget, 'removeEventListener')\n each(eventNames, function (eventName) {\n withOriginalOrZoneJsPatchedMethod(\n eventTarget,\n 'removeEventListener',\n (method) =>\n method.call(eventTarget, eventName, wrappedListener, options)\n )\n // remove.call(eventTarget, eventName, wrappedListener, options)\n })\n }\n return {\n stop: stop\n }\n}\nfunction isIllegalInvocationError(error, methodName) {\n if (!(error instanceof Error)) {\n return false\n }\n\n return (\n error.message.includes('Illegal invocation') || // chrome\n error.message.includes(\n `'${methodName}' called on an object that does not implement interface EventTarget.`\n ) || // firefox\n error.message.includes(\n `Can only call EventTarget.${methodName} on instances of EventTarget`\n ) // safari\n )\n}\n\nfunction withOriginalOrZoneJsPatchedMethod(eventTarget, methodName, cb) {\n // Use the window.EventTarget.prototype when possible to avoid wrong overrides (e.g: https://github.com/salesforce/lwc/issues/1824)\n const listenerTarget =\n window.EventTarget && eventTarget instanceof EventTarget\n ? window.EventTarget.prototype\n : eventTarget\n\n const originalMethod = getZoneJsOriginalValue(listenerTarget, methodName)\n\n try {\n // In some cases this call fails with an Illegal invocation error, we then catch the error and use the zone.js\n // patched method\n cb(originalMethod)\n } catch (error) {\n if (isIllegalInvocationError(error, methodName)) {\n return cb(eventTarget[methodName])\n }\n\n throw error\n }\n}\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,iBAAiB;AACtC,SAASC,sBAAsB,QAAQ,kCAAkC;AACzE,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,OAAO,SAASC,gBAAgBA,CAACC,WAAW,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAE;EACtE,OAAOC,iBAAiB,CAACJ,WAAW,EAAE,CAACC,KAAK,CAAC,EAAEC,QAAQ,EAAEC,OAAO,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,iBAAiBA,CAACJ,WAAW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BAAoB,CAAC;EAAI;EAChDJ,KAAK,CAACG,OAAO,CAACC,QAAQ,KAAAC,MAAA,CAChBJ,UAAU,yEAChB,CAAC;EAAI;EACLD,KAAK,CAACG,OAAO,CAACC,QAAQ,8BAAAC,MAAA,CACSJ,UAAU,iCACzC,CAAC,CAAC;EAAA;AAEN;AAEA,SAASL,iCAAiCA,CAACZ,WAAW,EAAEiB,UAAU,EAAEK,EAAE,EAAE;EACtE;EACA,IAAMC,cAAc,GAClBC,MAAM,CAACC,WAAW,IAAIzB,WAAW,YAAYyB,WAAW,GACpDD,MAAM,CAACC,WAAW,CAACC,SAAS,GAC5B1B,WAAW;EAEjB,IAAM2B,cAAc,GAAG9B,sBAAsB,CAAC0B,cAAc,EAAEN,UAAU,CAAC;EAEzE,IAAI;IACF;IACA;IACAK,EAAE,CAACK,cAAc,CAAC;EACpB,CAAC,CAAC,OAAOX,KAAK,EAAE;IACd,IAAID,wBAAwB,CAACC,KAAK,EAAEC,UAAU,CAAC,EAAE;MAC/C,OAAOK,EAAE,CAACtB,WAAW,CAACiB,UAAU,CAAC,CAAC;IACpC;IAEA,MAAMD,KAAK;EACb;AACF","ignoreList":[]}
@@ -19,11 +19,13 @@ function createXhrObservable() {
19
19
  }, {
20
20
  computeHandlingStack: true
21
21
  });
22
+ var setRequestHeaderInstrumentMethod = instrumentMethod(XMLHttpRequest.prototype, 'setRequestHeader', setRequestHeaderXhr);
22
23
  var abortInstrumentMethod = instrumentMethod(XMLHttpRequest.prototype, 'abort', abortXhr);
23
24
  return function () {
24
25
  openInstrumentMethod.stop();
25
26
  sendInstrumentMethod.stop();
26
27
  abortInstrumentMethod.stop();
28
+ setRequestHeaderInstrumentMethod.stop();
27
29
  };
28
30
  });
29
31
  }
@@ -37,6 +39,17 @@ function openXhr(params) {
37
39
  url: normalizeUrl(String(url))
38
40
  });
39
41
  }
42
+ function setRequestHeaderXhr(params) {
43
+ var xhr = params.target;
44
+ var headerKey = params.parameters[0];
45
+ var headerValue = params.parameters[1];
46
+ var context = xhrContexts.get(xhr);
47
+ if (context && headerKey) {
48
+ var requestHeaderContexts = context.requestHeaderContexts || {};
49
+ requestHeaderContexts[headerKey] = headerValue;
50
+ context.requestHeaderContexts = requestHeaderContexts;
51
+ }
52
+ }
40
53
  function sendXhr(params, observable) {
41
54
  var xhr = params.target;
42
55
  var handlingStack = params.handlingStack;
@@ -1 +1 @@
1
- {"version":3,"file":"xhrObservable.js","names":["instrumentMethod","Observable","normalizeUrl","shallowClone","elapsed","clocksNow","timeStampNow","addEventListener","xhrObservable","xhrContexts","WeakMap","initXhrObservable","createXhrObservable","observable","openInstrumentMethod","XMLHttpRequest","prototype","openXhr","sendInstrumentMethod","call","sendXhr","computeHandlingStack","abortInstrumentMethod","abortXhr","stop","params","xhr","target","method","parameters","url","set","state","String","toUpperCase","handlingStack","context","get","startContext","startClocks","isAborted","hasBeenReported","stopInstrumentingOnReadyStateChange","readyState","DONE","onEnd","unsubscribeLoadEndListener","completeContext","duration","timeStamp","status","notify"],"sources":["../../src/browser/xhrObservable.js"],"sourcesContent":["import { instrumentMethod } from '../helper/instrumentMethod'\nimport { Observable } from '../helper/observable'\nimport { normalizeUrl } from '../helper/urlPolyfill'\nimport { shallowClone, elapsed, clocksNow, timeStampNow } from '../helper/tools'\nimport { addEventListener } from '../browser/addEventListener'\nvar xhrObservable\nvar xhrContexts = new WeakMap()\nexport function initXhrObservable() {\n if (!xhrObservable) {\n xhrObservable = createXhrObservable()\n }\n return xhrObservable\n}\n\nfunction createXhrObservable() {\n return new Observable(function (observable) {\n var openInstrumentMethod = instrumentMethod(\n XMLHttpRequest.prototype,\n 'open',\n openXhr\n )\n\n var sendInstrumentMethod = instrumentMethod(\n XMLHttpRequest.prototype,\n 'send',\n function (call) {\n sendXhr(call, observable)\n },\n { computeHandlingStack: true }\n )\n\n var abortInstrumentMethod = instrumentMethod(\n XMLHttpRequest.prototype,\n 'abort',\n abortXhr\n )\n\n return function () {\n openInstrumentMethod.stop()\n sendInstrumentMethod.stop()\n abortInstrumentMethod.stop()\n }\n })\n}\n\nfunction openXhr(params) {\n var xhr = params.target\n var method = params.parameters[0]\n var url = params.parameters[1]\n xhrContexts.set(xhr, {\n state: 'open',\n method: String(method).toUpperCase(),\n url: normalizeUrl(String(url))\n })\n}\n\nfunction sendXhr(params, observable) {\n var xhr = params.target\n var handlingStack = params.handlingStack\n var context = xhrContexts.get(xhr)\n if (!context) {\n return\n }\n var startContext = context\n startContext.state = 'start'\n startContext.startClocks = clocksNow()\n startContext.isAborted = false\n startContext.xhr = xhr\n startContext.handlingStack = handlingStack\n var hasBeenReported = false\n var stopInstrumentingOnReadyStateChange = instrumentMethod(\n xhr,\n 'onreadystatechange',\n function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n // Try to report the XHR as soon as possible, because the XHR may be mutated by the\n // application during a future event. For example, Angular is calling .abort() on\n // completed requests during a onreadystatechange event, so the status becomes '0'\n // before the request is collected.\n onEnd()\n }\n }\n ).stop\n\n var onEnd = function () {\n unsubscribeLoadEndListener()\n stopInstrumentingOnReadyStateChange()\n if (hasBeenReported) {\n return\n }\n hasBeenReported = true\n var completeContext = context\n completeContext.state = 'complete'\n completeContext.duration = elapsed(\n startContext.startClocks.timeStamp,\n timeStampNow()\n )\n completeContext.status = xhr.status\n observable.notify(shallowClone(completeContext))\n }\n var unsubscribeLoadEndListener = addEventListener(xhr, 'loadend', onEnd).stop\n observable.notify(startContext)\n}\n\nfunction abortXhr(params) {\n var xhr = params.target\n var context = xhrContexts.get(xhr)\n if (context) {\n context.isAborted = true\n }\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,YAAY,EAAEC,OAAO,EAAEC,SAAS,EAAEC,YAAY,QAAQ,iBAAiB;AAChF,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,IAAIC,aAAa;AACjB,IAAIC,WA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Ae,CAAC,CAAC;EAClD,CAAC;EACD,IAAID,0BAA0B,GAAGvC,gBAAgB,CAACmB,GAAG,EAAE,SAAS,EAAEmB,KAAK,CAAC,CAACrB,IAAI;EAC7EX,UAAU,CAACsC,MAAM,CAACb,YAAY,CAAC;AACjC;AAEA,SAASf,QAAQA,CAACE,MAAM,EAAE;EACxB,IAAIC,GAAG,GAAGD,MAAM,CAACE,MAAM;EACvB,IAAIS,OAAO,GAAG3B,WAAW,CAAC4B,GAAG,CAACX,GAAG,CAAC;EAClC,IAAIU,OAAO,EAAE;IACXA,OAAO,CAACI,SAAS,GAAG,IAAI;EAC1B;AACF","ignoreList":[]}
1
+ {"version":3,"file":"xhrObservable.js","names":["instrumentMethod","Observable","normalizeUrl","shallowClone","elapsed","clocksNow","timeStampNow","addEventListener","xhrObservable","xhrContexts","WeakMap","initXhrObservable","createXhrObservable","observable","openInstrumentMethod","XMLHttpRequest","prototype","openXhr","sendInstrumentMethod","call","sendXhr","computeHandlingStack","setRequestHeaderInstrumentMethod","setRequestHeaderXhr","abortInstrumentMethod","abortXhr","stop","params","xhr","target","method","parameters","url","set","state","String","toUpperCase","headerKey","headerValue","context","get","requestHeaderContexts","handlingStack","startContext","startClocks","isAborted","hasBeenReported","stopInstrumentingOnReadyStateChange","readyState","DONE","onEnd","unsubscribeLoadEndListener","completeContext","duration","timeStamp","status","notify"],"sources":["../../src/browser/xhrObservable.js"],"sourcesContent":["import { instrumentMethod } from '../helper/instrumentMethod'\nimport { Observable } from '../helper/observable'\nimport { normalizeUrl } from '../helper/urlPolyfill'\nimport { shallowClone, elapsed, clocksNow, timeStampNow } from '../helper/tools'\nimport { addEventListener } from '../browser/addEventListener'\nvar xhrObservable\nvar xhrContexts = new WeakMap()\nexport function initXhrObservable() {\n if (!xhrObservable) {\n xhrObservable = createXhrObservable()\n }\n return xhrObservable\n}\n\nfunction createXhrObservable() {\n return new Observable(function (observable) {\n var openInstrumentMethod = instrumentMethod(\n XMLHttpRequest.prototype,\n 'open',\n openXhr\n )\n\n var sendInstrumentMethod = instrumentMethod(\n XMLHttpRequest.prototype,\n 'send',\n function (call) {\n sendXhr(call, observable)\n },\n { computeHandlingStack: true }\n )\n var setRequestHeaderInstrumentMethod = instrumentMethod(\n XMLHttpRequest.prototype,\n 'setRequestHeader',\n setRequestHeaderXhr\n )\n var abortInstrumentMethod = instrumentMethod(\n XMLHttpRequest.prototype,\n 'abort',\n abortXhr\n )\n\n return function () {\n openInstrumentMethod.stop()\n sendInstrumentMethod.stop()\n abortInstrumentMethod.stop()\n setRequestHeaderInstrumentMethod.stop()\n }\n })\n}\n\nfunction openXhr(params) {\n var xhr = params.target\n var method = params.parameters[0]\n var url = params.parameters[1]\n xhrContexts.set(xhr, {\n state: 'open',\n method: String(method).toUpperCase(),\n url: normalizeUrl(String(url))\n })\n}\nfunction setRequestHeaderXhr(params) {\n var xhr = params.target\n var headerKey = params.parameters[0]\n var headerValue = params.parameters[1]\n var context = xhrContexts.get(xhr)\n if (context && headerKey) {\n var requestHeaderContexts = context.requestHeaderContexts || {}\n requestHeaderContexts[headerKey] = headerValue\n context.requestHeaderContexts = requestHeaderContexts\n }\n}\nfunction sendXhr(params, observable) {\n var xhr = params.target\n var handlingStack = params.handlingStack\n var context = xhrContexts.get(xhr)\n if (!context) {\n return\n }\n var startContext = context\n startContext.state = 'start'\n startContext.startClocks = clocksNow()\n startContext.isAborted = false\n startContext.xhr = xhr\n startContext.handlingStack = handlingStack\n var hasBeenReported = false\n var stopInstrumentingOnReadyStateChange = instrumentMethod(\n xhr,\n 'onreadystatechange',\n function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n // Try to report the XHR as soon as possible, because the XHR may be mutated by the\n // application during a future event. For example, Angular is calling .abort() on\n // completed requests during a onreadystatechange event, so the status becomes '0'\n // before the request is collected.\n onEnd()\n }\n }\n ).stop\n\n var onEnd = function () {\n unsubscribeLoadEndListener()\n stopInstrumentingOnReadyStateChange()\n if (hasBeenReported) {\n return\n }\n hasBeenReported = true\n var completeContext = context\n completeContext.state = 'complete'\n completeContext.duration = elapsed(\n startContext.startClocks.timeStamp,\n timeStampNow()\n )\n completeContext.status = xhr.status\n observable.notify(shallowClone(completeContext))\n }\n var unsubscribeLoadEndListener = addEventListener(xhr, 'loadend', onEnd).stop\n observable.notify(startContext)\n}\n\nfunction abortXhr(params) {\n var xhr = params.target\n var context = xhrContexts.get(xhr)\n if (context) {\n context.isAborted = true\n }\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,YAAY,EAAEC,OAAO,EAAEC,SAAS,EAAEC,YAAY,QAAQ,iBAAiB;AAChF,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,IAAIC,aAAa;AACjB,IAAIC,WAAW,GAAG,IAAIC,OAAO,CAAC,CAAC;AAC/B,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EAClC,IAAI,CAACH,aAAa,EAAE;IAClBA,aAAa,GAAGI,mBAAmB,CAAC,CAAC;EACvC;EACA,OAAOJ,aAAa;AACtB;AAEA,SAASI,mBAAmBA,CAAA,EAAG;EAC7B,OAAO,IAAIX,UAAU,CAAC,UAAUY,UAAU,EAAE;IAC1C,IAAIC,oBAAoB,GAAGd,gBAAgB,CACzCe,cAAc,CAACC,SAAS,EACxB,MAAM,EACNC,OACF,CAAC;IAED,IAAIC,oBAAoB,GAAGlB,gBAAgB,CACzCe,cAAc,CAACC,SAAS,EACxB,MAAM,EACN,UAAUG,IAAI,EAAE;MACdC,OAAO,CAACD,IAAI,EAAEN,UAAU,CAAC;IAC3B,CAAC,EACD;MAAEQ,oBAAoB,EAAE;IAAK,CAC/B,CAAC;IACD,IAAIC,gCAAgC,GAAGtB,gBAAgB,CACrDe,cAAc,CAACC,SAAS,EACxB,kBAAkB,EAClBO,mBACF,CAAC;IACD,IAAIC,qBAAqB,GAAGxB,gBAAgB,CAC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AG,EAAE,SAAS,EAAEsB,KAAK,CAAC,CAACxB,IAAI;EAC7Eb,UAAU,CAAC2C,MAAM,CAACb,YAAY,CAAC;AACjC;AAEA,SAASlB,QAAQA,CAACE,MAAM,EAAE;EACxB,IAAIC,GAAG,GAAGD,MAAM,CAACE,MAAM;EACvB,IAAIU,OAAO,GAAG9B,WAAW,CAAC+B,GAAG,CAACZ,GAAG,CAAC;EAClC,IAAIW,OAAO,EAAE;IACXA,OAAO,CAACM,SAAS,GAAG,IAAI;EAC1B;AACF","ignoreList":[]}
@@ -16,7 +16,7 @@ import { trim } from './transportConfiguration';
16
16
  import { objectEntries, getType } from '../helper/tools';
17
17
  export function fetchAndApplyRemoteConfiguration(initConfiguration, callback) {
18
18
  fetchRemoteConfiguration(initConfiguration, function (remoteInitConfiguration) {
19
- callback(applyRemoteConfiguration(initConfiguration, remoteInitConfiguration));
19
+ callback(applyRemoteConfiguration(initConfiguration, remoteInitConfiguration), getSimpleRemoteConfiguration(initConfiguration, remoteInitConfiguration));
20
20
  });
21
21
  }
22
22
  var modifiableFieldPaths = {
@@ -60,7 +60,7 @@ function modificationByFieldsPath(remoteConfiguration, modifiableFieldPaths) {
60
60
  });
61
61
  return result;
62
62
  }
63
- export function applyRemoteConfiguration(initConfiguration, remoteInitConfiguration) {
63
+ export function getSimpleRemoteConfiguration(initConfiguration, remoteInitConfiguration) {
64
64
  var simpleRemoteInitConfiguration = {};
65
65
  for (var key in remoteInitConfiguration) {
66
66
  if (remoteInitConfiguration[key] !== undefined) {
@@ -76,6 +76,10 @@ export function applyRemoteConfiguration(initConfiguration, remoteInitConfigurat
76
76
  simpleRemoteInitConfiguration[simpleKey] = remoteInitConfiguration[key];
77
77
  }
78
78
  }
79
+ return simpleRemoteInitConfiguration;
80
+ }
81
+ export function applyRemoteConfiguration(initConfiguration, remoteInitConfiguration) {
82
+ var simpleRemoteInitConfiguration = getSimpleRemoteConfiguration(initConfiguration, remoteInitConfiguration);
79
83
  return _objectSpread(_objectSpread({}, initConfiguration), modificationByFieldsPath(simpleRemoteInitConfiguration, modifiableFieldPaths));
80
84
  }
81
85
  export function fetchRemoteConfiguration(configuration, callback) {
@@ -1 +1 @@
1
- {"version":3,"file":"remoteConfiguration.js","names":["addEventListener","display","trim","objectEntries","getType","fetchAndApplyRemoteConfiguration","initConfiguration","callback","fetchRemoteConfiguration","remoteInitConfiguration","applyRemoteConfiguration","modifiableFieldPaths","sessionSampleRate","telemetrySampleRate","silentMultipleInit","service","env","version","tracingSampleRate","useCrossSiteSessionCookie","usePartitionedCrossSiteSessionCookie","useSecureSessionCookie","trackSessionAcrossSubdomains","storeContextsToLocal","storeContextsKey","sendContentTypeByJson","allowFallbackToLocalStorage","sessionOnErrorSampleRate","sessionReplaySampleRate","sessionReplayOnErrorSampleRate","trackUserInteractions","trackInteractions","actionNameAttribute","trackViewsManually","workerUrl","compressIntakeRequests","traceType","modificationByFieldsPath","remoteConfiguration","result","forEach","_ref","_ref2","_slicedToArray","fieldPath","fieldType","remoteValue","simpleRemoteInitConfiguration","key","undefined","simpleKey","replace","applicationId","_objectSpread","configuration","xhr","XMLHttpRequest","status","JSON","parse","responseText","content","displayRemoteConfigurationFetchingError","open","buildEndpoint","send","url","datakitOrigin","datakitUrl","site","indexOf","location","origin","endpoint","lastIndexOf","length","clientToken","error"],"sources":["../../src/configuration/remoteConfiguration.js"],"sourcesContent":["import { addEventListener } from '../browser/addEventListener'\nimport { display } from '../helper/display'\nimport { trim } from './transportConfiguration'\nimport { objectEntries, getType } from '../helper/tools'\nexport function fetchAndApplyRemoteConfiguration(initConfiguration, callback) {\n fetchRemoteConfiguration(initConfiguration, (remoteInitConfiguration) => {\n callback(\n applyRemoteConfiguration(initConfiguration, remoteInitConfiguration)\n )\n })\n}\n\nconst modifiableFieldPaths = {\n sessionSampleRate: 'number',\n telemetrySampleRate: 'number',\n silentMultipleInit: 'boolean',\n service: 'string',\n env: 'string',\n version: 'string',\n tracingSampleRate: 'number',\n useCrossSiteSessionCookie: 'boolean',\n usePartitionedCrossSiteSessionCookie: 'boolean',\n useSecureSessionCookie: 'boolean',\n trackSessionAcrossSubdomains: 'boolean',\n storeContextsToLocal: 'boolean',\n storeContextsKey: 'string',\n sendContentTypeByJson: 'boolean',\n allowFallbackToLocalStorage: 'boolean',\n sessionOnErrorSampleRate: 'number',\n sessionReplaySampleRate: 'number',\n sessionReplayOnErrorSampleRate: 'number',\n trackUserInteractions: 'boolean',\n trackInteractions: 'boolean',\n actionNameAttribute: 'string',\n trackViewsManually: 'boolean',\n workerUrl: 'string',\n compressIntakeRequests: 'boolean',\n traceType: 'string'\n}\nfunction modificationByFieldsPath(remoteConfiguration, modifiableFieldPaths) {\n const result = {}\n objectEntries(modifiableFieldPaths).forEach(([fieldPath, fieldType]) => {\n // const sourceValue = sourceConfiguration[fieldPath]\n const remoteValue = remoteConfiguration[fieldPath]\n if (getType(remoteValue) === fieldType) {\n result[fieldPath] = remoteValue\n }\n })\n return result\n}\nexport function applyRemoteConfiguration(\n initConfiguration,\n remoteInitConfiguration\n) {\n const simpleRemoteInitConfiguration = {}\n for (const key in remoteInitConfiguration) {\n if (remoteInitConfiguration[key] !== undefined) {\n // ex\n // {\n // \"R.d1b454d0_22eb_11ef_9b66_95ca11aa2c6c.sessionSampleRate\": 80\n // }\n // transform to\n // {\n // \"sessionSampleRate\": 80\n // }\n const simpleKey = key.replace(\n 'R.' + initConfiguration.applicationId + '.',\n ''\n )\n simpleRemoteInitConfiguration[simpleKey] = remoteInitConfiguration[key]\n }\n }\n return {\n ...initConfiguration,\n ...modificationByFieldsPath(\n simpleRemoteInitConfiguration,\n modifiableFieldPaths\n )\n }\n}\n\nexport function fetchRemoteConfiguration(configuration, callback) {\n const xhr = new XMLHttpRequest()\n\n addEventListener(xhr, 'load', function () {\n if (xhr.status === 200) {\n const remoteConfiguration = JSON.parse(xhr.responseText)\n callback(remoteConfiguration.content)\n } else {\n callback({})\n displayRemoteConfigurationFetchingError()\n }\n })\n\n addEventListener(xhr, 'error', function () {\n callback({})\n displayRemoteConfigurationFetchingError()\n })\n\n xhr.open('GET', buildEndpoint(configuration))\n xhr.send()\n}\n\nexport function buildEndpoint(configuration) {\n var url =\n configuration.datakitOrigin ||\n configuration.datakitUrl ||\n configuration.site\n if (url.indexOf('/') === 0) {\n url = location.origin + trim(url)\n }\n var endpoint = url\n if (url.lastIndexOf('/') === url.length - 1) {\n endpoint = trim(url) + 'v1/env_variable'\n } else {\n endpoint = trim(url) + '/v1/env_variable'\n }\n endpoint += '?app_id=' + configuration.applicationId\n //testing-openway.dataflux.cn/v1/env_variable?token=a47fb0cdddaa4561a90d941317cdbc0b&app_id=d1b454d0_22eb_11ef_9b66_95ca11aa2c6c&to_headless=true\n if (configuration.site && configuration.clientToken) {\n endpoint =\n endpoint + '&token=' + configuration.clientToken + '&to_headless=true'\n }\n return endpoint\n}\n\nfunction displayRemoteConfigurationFetchingError() {\n display.error('Error fetching the remote configuration.')\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,SAASC,IAAI,QAAQ,0BAA0B;AAC/C,SAASC,aAAa,EAAEC,OAAO,QAAQ,iBAAiB;AACxD,OAAO,SAASC,gCAAgCA,CAACC,iBAAiB,EAAEC,QAAQ,EAAE;EAC5EC,wBAAwB,CAACF,iBAAiB,EAAE,UAACG,uBAAuB,EAAK;IACvEF,QAAQ,CACNG,wBAAwB,CAACJ,iBAAiB,EAAEG,uBAAuB,CACrE,CAAC;EACH,CAAC,CAAC;AACJ;AAEA,IAAME,oBAAoB,GAAG;EAC3BC,iBAAiB,EAAE,QAAQ;EAC3BC,mBAAmB,EAAE,QAAQ;EAC7BC,kBAAkB,EAAE,SAAS;EAC7BC,OAAO,EAAE,QAAQ;EACjBC,GAAG,EAAE,QAAQ;EACbC,OAAO,EAAE,QAAQ;EACjBC,iBAAiB,EAAE,QAAQ;EAC3BC,yBAAyB,EAAE,SAAS;EAC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,GAAG,GAAGK,QAAQ,CAACC,MAAM,GAAGtE,IAAI,CAACgE,GAAG,CAAC;EACnC;EACA,IAAIO,QAAQ,GAAGP,GAAG;EAClB,IAAIA,GAAG,CAACQ,WAAW,CAAC,GAAG,CAAC,KAAKR,GAAG,CAACS,MAAM,GAAG,CAAC,EAAE;IAC3CF,QAAQ,GAAGvE,IAAI,CAACgE,GAAG,CAAC,GAAG,iBAAiB;EAC1C,CAAC,MAAM;IACLO,QAAQ,GAAGvE,IAAI,CAACgE,GAAG,CAAC,GAAG,kBAAkB;EAC3C;EACAO,QAAQ,IAAI,UAAU,GAAGnB,aAAa,CAACF,aAAa;EACpD;EACA,IAAIE,aAAa,CAACe,IAAI,IAAIf,aAAa,CAACsB,WAAW,EAAE;IACnDH,QAAQ,GACNA,QAAQ,GAAG,SAAS,GAAGnB,aAAa,CAACsB,WAAW,GAAG,mBAAmB;EAC1E;EACA,OAAOH,QAAQ;AACjB;AAEA,SAASX,uCAAuCA,CAAA,EAAG;EACjD7D,OAAO,CAAC4E,KAAK,CAAC,0CAA0C,CAAC;AAC3D","ignoreList":[]}
1
+ {"version":3,"file":"remoteConfiguration.js","names":["addEventListener","display","trim","objectEntries","getType","fetchAndApplyRemoteConfiguration","initConfiguration","callback","fetchRemoteConfiguration","remoteInitConfiguration","applyRemoteConfiguration","getSimpleRemoteConfiguration","modifiableFieldPaths","sessionSampleRate","telemetrySampleRate","silentMultipleInit","service","env","version","tracingSampleRate","useCrossSiteSessionCookie","usePartitionedCrossSiteSessionCookie","useSecureSessionCookie","trackSessionAcrossSubdomains","storeContextsToLocal","storeContextsKey","sendContentTypeByJson","allowFallbackToLocalStorage","sessionOnErrorSampleRate","sessionReplaySampleRate","sessionReplayOnErrorSampleRate","trackUserInteractions","trackInteractions","actionNameAttribute","trackViewsManually","workerUrl","compressIntakeRequests","traceType","modificationByFieldsPath","remoteConfiguration","result","forEach","_ref","_ref2","_slicedToArray","fieldPath","fieldType","remoteValue","simpleRemoteInitConfiguration","key","undefined","simpleKey","replace","applicationId","_objectSpread","configuration","xhr","XMLHttpRequest","status","JSON","parse","responseText","content","displayRemoteConfigurationFetchingError","open","buildEndpoint","send","url","datakitOrigin","datakitUrl","site","indexOf","location","origin","endpoint","lastIndexOf","length","clientToken","error"],"sources":["../../src/configuration/remoteConfiguration.js"],"sourcesContent":["import { addEventListener } from '../browser/addEventListener'\nimport { display } from '../helper/display'\nimport { trim } from './transportConfiguration'\nimport { objectEntries, getType } from '../helper/tools'\nexport function fetchAndApplyRemoteConfiguration(initConfiguration, callback) {\n fetchRemoteConfiguration(initConfiguration, (remoteInitConfiguration) => {\n callback(\n applyRemoteConfiguration(initConfiguration, remoteInitConfiguration),\n getSimpleRemoteConfiguration(initConfiguration, remoteInitConfiguration)\n )\n })\n}\n\nconst modifiableFieldPaths = {\n sessionSampleRate: 'number',\n telemetrySampleRate: 'number',\n silentMultipleInit: 'boolean',\n service: 'string',\n env: 'string',\n version: 'string',\n tracingSampleRate: 'number',\n useCrossSiteSessionCookie: 'boolean',\n usePartitionedCrossSiteSessionCookie: 'boolean',\n useSecureSessionCookie: 'boolean',\n trackSessionAcrossSubdomains: 'boolean',\n storeContextsToLocal: 'boolean',\n storeContextsKey: 'string',\n sendContentTypeByJson: 'boolean',\n allowFallbackToLocalStorage: 'boolean',\n sessionOnErrorSampleRate: 'number',\n sessionReplaySampleRate: 'number',\n sessionReplayOnErrorSampleRate: 'number',\n trackUserInteractions: 'boolean',\n trackInteractions: 'boolean',\n actionNameAttribute: 'string',\n trackViewsManually: 'boolean',\n workerUrl: 'string',\n compressIntakeRequests: 'boolean',\n traceType: 'string'\n}\nfunction modificationByFieldsPath(remoteConfiguration, modifiableFieldPaths) {\n const result = {}\n objectEntries(modifiableFieldPaths).forEach(([fieldPath, fieldType]) => {\n // const sourceValue = sourceConfiguration[fieldPath]\n const remoteValue = remoteConfiguration[fieldPath]\n if (getType(remoteValue) === fieldType) {\n result[fieldPath] = remoteValue\n }\n })\n return result\n}\nexport function getSimpleRemoteConfiguration(\n initConfiguration,\n remoteInitConfiguration\n) {\n const simpleRemoteInitConfiguration = {}\n for (const key in remoteInitConfiguration) {\n if (remoteInitConfiguration[key] !== undefined) {\n // ex\n // {\n // \"R.d1b454d0_22eb_11ef_9b66_95ca11aa2c6c.sessionSampleRate\": 80\n // }\n // transform to\n // {\n // \"sessionSampleRate\": 80\n // }\n const simpleKey = key.replace(\n 'R.' + initConfiguration.applicationId + '.',\n ''\n )\n simpleRemoteInitConfiguration[simpleKey] = remoteInitConfiguration[key]\n }\n }\n return simpleRemoteInitConfiguration\n}\nexport function applyRemoteConfiguration(\n initConfiguration,\n remoteInitConfiguration\n) {\n const simpleRemoteInitConfiguration = getSimpleRemoteConfiguration(\n initConfiguration,\n remoteInitConfiguration\n )\n return {\n ...initConfiguration,\n ...modificationByFieldsPath(\n simpleRemoteInitConfiguration,\n modifiableFieldPaths\n )\n }\n}\n\nexport function fetchRemoteConfiguration(configuration, callback) {\n const xhr = new XMLHttpRequest()\n\n addEventListener(xhr, 'load', function () {\n if (xhr.status === 200) {\n const remoteConfiguration = JSON.parse(xhr.responseText)\n callback(remoteConfiguration.content)\n } else {\n callback({})\n displayRemoteConfigurationFetchingError()\n }\n })\n\n addEventListener(xhr, 'error', function () {\n callback({})\n displayRemoteConfigurationFetchingError()\n })\n\n xhr.open('GET', buildEndpoint(configuration))\n xhr.send()\n}\n\nexport function buildEndpoint(configuration) {\n var url =\n configuration.datakitOrigin ||\n configuration.datakitUrl ||\n configuration.site\n if (url.indexOf('/') === 0) {\n url = location.origin + trim(url)\n }\n var endpoint = url\n if (url.lastIndexOf('/') === url.length - 1) {\n endpoint = trim(url) + 'v1/env_variable'\n } else {\n endpoint = trim(url) + '/v1/env_variable'\n }\n endpoint += '?app_id=' + configuration.applicationId\n //testing-openway.dataflux.cn/v1/env_variable?token=a47fb0cdddaa4561a90d941317cdbc0b&app_id=d1b454d0_22eb_11ef_9b66_95ca11aa2c6c&to_headless=true\n if (configuration.site && configuration.clientToken) {\n endpoint =\n endpoint + '&token=' + configuration.clientToken + '&to_headless=true'\n }\n return endpoint\n}\n\nfunction displayRemoteConfigurationFetchingError() {\n display.error('Error fetching the remote configuration.')\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,SAASC,IAAI,QAAQ,0BAA0B;AAC/C,SAASC,aAAa,EAAEC,OAAO,QAAQ,iBAAiB;AACxD,OAAO,SAASC,gCAAgCA,CAACC,iBAAiB,EAAEC,QAAQ,EAAE;EAC5EC,wBAAwB,CAACF,iBAAiB,EAAE,UAACG,uBAAuB,EAAK;IACvEF,QAAQ,CACNG,wBAAwB,CAACJ,iBAAiB,EAAEG,uBAAuB,CAAC,EACpEE,4BAA4B,CAACL,iBAAiB,EAAEG,uBAAuB,CACzE,CAAC;EACH,CAAC,CAAC;AACJ;AAEA,IAAMG,oBAAoB,GAAG;EAC3BC,iBAAiB,EAAE,QAAQ;EAC3BC,mBAAmB,EAAE,QAAQ;EAC7BC,kBAAkB,EAAE,SAAS;EAC7BC,OAAO,EAAE,QAAQ;EACjBC,GAAG,EAAE,QAAQ;EACbC,OAAO,EAAE,QAAQ;EACjBC,iBAAiB,EAAE,QAAQ;EAC3BC,yBAAyB,EAAE,SAAS;EACpCC,oCAAoC,EAAE,SAAS;EAC/CC,sBAAsB,EAAE,SAAS;EACjCC,4BAA4B,EAAE,SAAS;EACvCC,oBAAoB,EAAE,SAAS;EAC/BC,gBAAgB,EAAE,QAAQ;EAC1BC,qBAAqB,EAAE,SAAS;EAChCC,2BAA2B,EAAE,SAAS;EACtCC,wBAAwB,EAAE,QAAQ;EAClCC,uBAAuB,EAAE,QAAQ;EACjCC,8BAA8B,EAAE,QAAQ;EACxCC,qBAAqB,EAAE,SAAS;EAChCC,iBAAiB,EAAE,SAAS;EAC5BC,mBAAmB,EAAE,QAAQ;EAC7BC,kBAAkB,EAAE,SAAS;EA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ACiE,GAAG,CAAC,GAAG,iBAAiB;EAC1C,CAAC,MAAM;IACLO,QAAQ,GAAGxE,IAAI,CAACiE,GAAG,CAAC,GAAG,kBAAkB;EAC3C;EACAO,QAAQ,IAAI,UAAU,GAAGnB,aAAa,CAACF,aAAa;EACpD;EACA,IAAIE,aAAa,CAACe,IAAI,IAAIf,aAAa,CAACsB,WAAW,EAAE;IACnDH,QAAQ,GACNA,QAAQ,GAAG,SAAS,GAAGnB,aAAa,CAACsB,WAAW,GAAG,mBAAmB;EAC1E;EACA,OAAOH,QAAQ;AACjB;AAEA,SAASX,uCAAuCA,CAAA,EAAG;EACjD9D,OAAO,CAAC6E,KAAK,CAAC,0CAA0C,CAAC;AAC3D","ignoreList":[]}
package/esm/dataMap.js CHANGED
@@ -12,6 +12,7 @@ export var commonTags = {
12
12
  user_name: 'user.name',
13
13
  session_id: 'session.id',
14
14
  session_type: 'session.type',
15
+ session_is_forced: 'session.is_forced_session',
15
16
  session_sampling: 'session.is_sampling',
16
17
  is_signin: 'user.is_signin',
17
18
  os: 'device.os',
@@ -24,6 +25,7 @@ export var commonTags = {
24
25
  network_type: 'device.network_type',
25
26
  time_zone: 'device.time_zone',
26
27
  device: 'device.device',
28
+ user_agent: 'device.user_agent',
27
29
  view_id: 'view.id',
28
30
  view_referrer: 'view.referrer',
29
31
  view_url: 'view.url',
@@ -1 +1 @@
1
- {"version":3,"file":"dataMap.js","names":["RumEventType","commonTags","sdk_name","sdk_version","app_id","env","service","version","source","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","time_zone","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","view_path_name","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","session_on_error_sample_rate","session_replay_on_error_sample_rate","drift","dataMap","view","type","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","view_update_time","sampled_for_replay","sampled_for_error_replay","sampled_for_error_session","session_error_timestamp","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_time","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_id","resource_status","resource_status_group","resource_method","duration","resource_size","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_delivery_type","resource_type","resource_protocol","resource_encode_size","resource_decode_size","resource_transfer_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","error_handling_stack","long_task","LONG_TASK","long_task_id","blocking_duration","first_ui_event_timestamp","render_start","style_and_layout_start","long_task_start_time","scripts","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","connectivity","runtime_env","usage","configuration","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 source: 'source',\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 time_zone: 'device.time_zone',\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.name',\n view_path_group: 'view.path_group',\n view_path_name: 'view.pathname'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\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 session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate',\n session_on_error_sample_rate:\n '_gc.configuration.session_on_error_sample_rate',\n session_replay_on_error_sample_rate:\n '_gc.configuration.session_replay_on_error_sample_rate',\n drift: '_gc.drift'\n}\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 view_update_time: '_gc.view_update_time',\n sampled_for_replay: 'session.sampled_for_replay',\n sampled_for_error_replay: 'session.sampled_for_error_replay',\n sampled_for_error_session: 'session.sampled_for_error_session',\n session_error_timestamp: 'session.error_timestamp_for_session',\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_time: 'view.cumulative_layout_shift_time',\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_id: 'resource.id',\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_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_delivery_type: 'resource.delivery_type',\n resource_type: 'resource.type',\n resource_protocol: 'resource.protocol',\n resource_encode_size: 'resource.encoded_body_size',\n resource_decode_size: 'resource.decoded_body_size',\n resource_transfer_size: 'resource.transfer_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 error_handling_stack: ['string', 'error.handling_stack']\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 blocking_duration: 'long_task.blocking_duration',\n first_ui_event_timestamp: 'long_task.first_ui_event_timestamp',\n render_start: 'long_task.render_start',\n style_and_layout_start: 'long_task.style_and_layout_start',\n long_task_start_time: 'long_task.start_time',\n scripts: ['string', 'long_task.scripts']\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 connectivity: ['string', 'telemetry.connectivity'],\n runtime_env: ['string', 'telemetry.runtime_env'],\n usage: ['string', 'telemetry.usage'],\n configuration: ['string', 'telemetry.configuration']\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 error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack']\n }\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,OAAO,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,QAAQ;EAChBC,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,SAAS,EAAE,kBAAkB;EAC7BC,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;EACtBC,eAAe,EAAE,iBAAiB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E,aAAa;MACpC1I,SAAS,EAAE,gBAAgB;MAC3B9B,OAAO,EAAE,SAAS;MAClByJ,MAAM,EAAE;IACV,CAAC;IACDvG,MAAM,EAAE;MACNwG,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;MAC9BzB,aAAa,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC;MAC1CC,WAAW,EAAE,CAAC,QAAQ,EAAE,aAAa;IACvC;EACF;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"dataMap.js","names":["RumEventType","commonTags","sdk_name","sdk_version","app_id","env","service","version","source","userid","user_email","user_name","session_id","session_type","session_is_forced","session_sampling","is_signin","os","os_version","os_version_major","browser","browser_version","browser_version_major","screen_size","network_type","time_zone","device","user_agent","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","view_path_name","commonFields","view_url_query","action_id","action_ids","view_in_foreground","display","session_has_replay","is_login","page_states","session_sample_rate","session_replay_sample_rate","session_on_error_sample_rate","session_replay_on_error_sample_rate","drift","dataMap","view","type","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","view_update_time","sampled_for_replay","sampled_for_error_replay","sampled_for_error_session","session_error_timestamp","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_time","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_id","resource_status","resource_status_group","resource_method","duration","resource_size","resource_url","resource_url_host","resource_url_path","resource_url_path_group","resource_url_query","resource_delivery_type","resource_type","resource_protocol","resource_encode_size","resource_decode_size","resource_transfer_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","error_handling_stack","long_task","LONG_TASK","long_task_id","blocking_duration","first_ui_event_timestamp","render_start","style_and_layout_start","long_task_start_time","scripts","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","connectivity","runtime_env","usage","configuration","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 source: 'source',\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_is_forced: 'session.is_forced_session',\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 time_zone: 'device.time_zone',\n device: 'device.device',\n user_agent: 'device.user_agent',\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.name',\n view_path_group: 'view.path_group',\n view_path_name: 'view.pathname'\n}\nexport var commonFields = {\n view_url_query: 'view.url_query',\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 session_sample_rate: '_gc.configuration.session_sample_rate',\n session_replay_sample_rate: '_gc.configuration.session_replay_sample_rate',\n session_on_error_sample_rate:\n '_gc.configuration.session_on_error_sample_rate',\n session_replay_on_error_sample_rate:\n '_gc.configuration.session_replay_on_error_sample_rate',\n drift: '_gc.drift'\n}\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 view_update_time: '_gc.view_update_time',\n sampled_for_replay: 'session.sampled_for_replay',\n sampled_for_error_replay: 'session.sampled_for_error_replay',\n sampled_for_error_session: 'session.sampled_for_error_session',\n session_error_timestamp: 'session.error_timestamp_for_session',\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_time: 'view.cumulative_layout_shift_time',\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_id: 'resource.id',\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_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_delivery_type: 'resource.delivery_type',\n resource_type: 'resource.type',\n resource_protocol: 'resource.protocol',\n resource_encode_size: 'resource.encoded_body_size',\n resource_decode_size: 'resource.decoded_body_size',\n resource_transfer_size: 'resource.transfer_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 error_handling_stack: ['string', 'error.handling_stack']\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 blocking_duration: 'long_task.blocking_duration',\n first_ui_event_timestamp: 'long_task.first_ui_event_timestamp',\n render_start: 'long_task.render_start',\n style_and_layout_start: 'long_task.style_and_layout_start',\n long_task_start_time: 'long_task.start_time',\n scripts: ['string', 'long_task.scripts']\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 connectivity: ['string', 'telemetry.connectivity'],\n runtime_env: ['string', 'telemetry.runtime_env'],\n usage: ['string', 'telemetry.usage'],\n configuration: ['string', 'telemetry.configuration']\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 error_message: ['string', 'error.message'],\n error_stack: ['string', 'error.stack']\n }\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,OAAO,IAAIC,UAAU,GAAG;EACtBC,QAAQ,EAAE,cAAc;EACxBC,WAAW,EAAE,iBAAiB;EAC9BC,MAAM,EAAE,gBAAgB;EACxBC,GA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AI,EAAE,WAAW;IACjBM,MAAM,EAAE;MACNuG,MAAM,EAAE,kBAAkB;MAC1BC,OAAO,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC;MACxC9G,IAAI,EAAE,gBAAgB;MACtBsF,WAAW,EAAE,CAAC,QAAQ,EAAE,uBAAuB,CAAC;MAChDyB,UAAU,EAAE,CAAC,QAAQ,EAAE,sBAAsB,CAAC;MAC9CC,YAAY,EAAE,CAAC,QAAQ,EAAE,wBAAwB,CAAC;MAClDC,WAAW,EAAE,CAAC,QAAQ,EAAE,uBAAuB,CAAC;MAChDC,KAAK,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;MACpCC,aAAa,EAAE,CAAC,QAAQ,EAAE,yBAAyB;IACrD;EACF,CAAC;EACDC,WAAW,EAAE;IACXpH,IAAI,EAAEpD,YAAY,CAACyK,MAAM;IACzBnH,IAAI,EAAE;MACJgF,YAAY,EAAE,cAAc;MAC5BC,UAAU,EAAE,YAAY;MACxBmC,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;MACpC1I,SAAS,EAAE,gBAAgB;MAC3BhC,OAAO,EAAE,SAAS;MAClB2J,MAAM,EAAE;IACV,CAAC;IACDvG,MAAM,EAAE;MACNwG,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;MAC9BzB,aAAa,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC;MAC1CC,WAAW,EAAE,CAAC,QAAQ,EAAE,aAAa;IACvC;EACF;AACF,CAAC","ignoreList":[]}
@@ -495,7 +495,8 @@ if (typeof window !== 'undefined') {
495
495
  screenSize: window.screen.width + '*' + window.screen.height,
496
496
  networkType: MethodLibrary.getNetwork(),
497
497
  device: MethodLibrary.getDeviceType(),
498
- timeZone: MethodLibrary.getTimeZone()
498
+ timeZone: MethodLibrary.getTimeZone(),
499
+ userAgent: VariableLibrary.navigator.userAgent || ''
499
500
  };
500
501
  }
501
502
  export var deviceInfo = _deviceInfo;