@cloudcare/browser-core 3.1.18 → 3.1.20

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 (61) hide show
  1. package/cjs/browser/fetchObservable.js +62 -32
  2. package/cjs/browser/fetchObservable.js.map +1 -1
  3. package/cjs/browser/xhrObservable.js +31 -39
  4. package/cjs/browser/xhrObservable.js.map +1 -1
  5. package/cjs/dataMap.js +1 -0
  6. package/cjs/dataMap.js.map +1 -1
  7. package/cjs/helper/deviceInfo.js +1 -2
  8. package/cjs/helper/deviceInfo.js.map +1 -1
  9. package/cjs/helper/enums.js +6 -1
  10. package/cjs/helper/enums.js.map +1 -1
  11. package/cjs/helper/instrumentMethod.js +47 -44
  12. package/cjs/helper/instrumentMethod.js.map +1 -1
  13. package/cjs/helper/tools.js +15 -0
  14. package/cjs/helper/tools.js.map +1 -1
  15. package/cjs/helper/valueHistory.js +123 -0
  16. package/cjs/helper/valueHistory.js.map +1 -0
  17. package/cjs/index.js +4 -4
  18. package/cjs/index.js.map +1 -1
  19. package/cjs/session/sessionManagement.js +4 -2
  20. package/cjs/session/sessionManagement.js.map +1 -1
  21. package/cjs/tracekit/tracekit.js +29 -25
  22. package/cjs/tracekit/tracekit.js.map +1 -1
  23. package/esm/browser/fetchObservable.js +63 -34
  24. package/esm/browser/fetchObservable.js.map +1 -1
  25. package/esm/browser/xhrObservable.js +33 -41
  26. package/esm/browser/xhrObservable.js.map +1 -1
  27. package/esm/dataMap.js +1 -0
  28. package/esm/dataMap.js.map +1 -1
  29. package/esm/helper/deviceInfo.js +1 -2
  30. package/esm/helper/deviceInfo.js.map +1 -1
  31. package/esm/helper/enums.js +4 -0
  32. package/esm/helper/enums.js.map +1 -1
  33. package/esm/helper/instrumentMethod.js +48 -44
  34. package/esm/helper/instrumentMethod.js.map +1 -1
  35. package/esm/helper/tools.js +13 -0
  36. package/esm/helper/tools.js.map +1 -1
  37. package/esm/helper/valueHistory.js +115 -0
  38. package/esm/helper/valueHistory.js.map +1 -0
  39. package/esm/index.js +1 -1
  40. package/esm/index.js.map +1 -1
  41. package/esm/session/sessionManagement.js +4 -2
  42. package/esm/session/sessionManagement.js.map +1 -1
  43. package/esm/tracekit/tracekit.js +30 -26
  44. package/esm/tracekit/tracekit.js.map +1 -1
  45. package/package.json +2 -2
  46. package/src/browser/fetchObservable.js +71 -50
  47. package/src/browser/xhrObservable.js +39 -54
  48. package/src/dataMap.js +1 -0
  49. package/src/helper/deviceInfo.js +1 -2
  50. package/src/helper/enums.js +4 -1
  51. package/src/helper/instrumentMethod.js +61 -44
  52. package/src/helper/tools.js +13 -0
  53. package/src/helper/valueHistory.js +116 -0
  54. package/src/index.js +1 -1
  55. package/src/session/sessionManagement.js +4 -2
  56. package/src/tracekit/tracekit.js +29 -25
  57. package/cjs/helper/contextHistory.js +0 -117
  58. package/cjs/helper/contextHistory.js.map +0 -1
  59. package/esm/helper/contextHistory.js +0 -109
  60. package/esm/helper/contextHistory.js.map +0 -1
  61. package/src/helper/contextHistory.js +0 -101
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.initFetchObservable = initFetchObservable;
7
+ exports.resetFetchObservable = resetFetchObservable;
7
8
  var _instrumentMethod = require("../helper/instrumentMethod");
8
9
  var _observable = require("../helper/observable");
9
10
  var _tools = require("../helper/tools");
@@ -16,28 +17,28 @@ function initFetchObservable() {
16
17
  }
17
18
  return fetchObservable;
18
19
  }
20
+ function resetFetchObservable() {
21
+ fetchObservable = undefined;
22
+ }
19
23
  function createFetchObservable() {
20
24
  return new _observable.Observable(function (observable) {
21
25
  if (!window.fetch) {
22
26
  return;
23
27
  }
24
- var fetchMethod = (0, _instrumentMethod.instrumentMethod)(window, 'fetch', function (originalFetch) {
25
- return function (input, init) {
26
- var responsePromise;
27
- var context = (0, _monitor.callMonitored)(beforeSend, null, [observable, input, init]);
28
- if (context) {
29
- responsePromise = originalFetch.call(this, context.input, context.init);
30
- (0, _monitor.callMonitored)(afterSend, null, [observable, responsePromise, context]);
31
- } else {
32
- responsePromise = originalFetch.call(this, input, init);
33
- }
34
- return responsePromise;
35
- };
28
+ var fetchMethod = (0, _instrumentMethod.instrumentMethod)(window, 'fetch', function (call) {
29
+ return beforeSend(call, observable);
30
+ }, {
31
+ computeHandlingStack: true
36
32
  });
37
33
  return fetchMethod.stop;
38
34
  });
39
35
  }
40
- function beforeSend(observable, input, init) {
36
+ function beforeSend(params, observable) {
37
+ var parameters = params.parameters;
38
+ var onPostCall = params.onPostCall;
39
+ var handlingStack = params.handlingStack;
40
+ var input = parameters[0];
41
+ var init = parameters[1];
41
42
  // var method =
42
43
  // (init && init.method) || (input instanceof Request && input.method) || 'GET'
43
44
  // const methodFromParams =
@@ -56,32 +57,61 @@ function beforeSend(observable, input, init) {
56
57
  input: input,
57
58
  method: method,
58
59
  startClocks: startClocks,
59
- url: url
60
+ url: url,
61
+ handlingStack: handlingStack
60
62
  };
61
63
  observable.notify(context);
62
- return context;
64
+ parameters[0] = context.input;
65
+ parameters[1] = context.init;
66
+ onPostCall(function (responsePromise) {
67
+ return afterSend(observable, responsePromise, context);
68
+ });
63
69
  }
64
70
  function afterSend(observable, responsePromise, startContext) {
65
- var reportFetch = function reportFetch(response) {
66
- var context = startContext;
71
+ var context = startContext;
72
+ var reportFetch = function reportFetch(partialContext) {
67
73
  context.state = 'resolve';
74
+ (0, _tools.assign)(context, partialContext);
68
75
  // context.duration = elapsed(context.startClocks.timeStamp, timeStampNow())
69
- if ('stack' in response || response instanceof Error) {
70
- context.status = 0;
71
- context.isAborted = response instanceof DOMException && response.code === DOMException.ABORT_ERR;
72
- context.error = response;
73
- } else if ('status' in response) {
74
- context.response = response;
75
- try {
76
- context.responseType = response.constructor === Response && response.type || ''; // issue The Response type getter can only be used on instances of Response
77
- } catch (err) {
78
- context.responseType = '';
79
- }
80
- context.status = response.status;
81
- context.isAborted = false;
82
- }
76
+ // if ('stack' in response || response instanceof Error) {
77
+ // context.status = 0
78
+ // context.isAborted =
79
+ // response instanceof DOMException &&
80
+ // response.code === DOMException.ABORT_ERR
81
+ // context.error = response
82
+ // } else if ('status' in response) {
83
+ // context.response = response
84
+ // try {
85
+ // context.responseType =
86
+ // (response.constructor === Response && response.type) || '' // issue The Response type getter can only be used on instances of Response
87
+ // } catch (err) {
88
+ // context.responseType = ''
89
+ // }
90
+
91
+ // context.status = response.status
92
+ // context.isAborted = false
93
+ // }
83
94
  observable.notify(context);
84
95
  };
85
- responsePromise.then((0, _monitor.monitor)(reportFetch), (0, _monitor.monitor)(reportFetch));
96
+ responsePromise.then((0, _monitor.monitor)(function (response) {
97
+ var responseType = '';
98
+ try {
99
+ responseType = response.constructor === Response && response.type || ''; // issue The Response type getter can only be used on instances of Response
100
+ } catch (err) {
101
+ responseType = '';
102
+ }
103
+ reportFetch({
104
+ response: response,
105
+ responseType: responseType,
106
+ status: response.status,
107
+ isAborted: false
108
+ });
109
+ }), (0, _monitor.monitor)(function (error) {
110
+ reportFetch({
111
+ status: 0,
112
+ isAborted: context.init && context.init.signal && context.init.signal.aborted || error instanceof DOMException && error.code === DOMException.ABORT_ERR,
113
+ error: error
114
+ });
115
+ }));
86
116
  }
87
117
  //# sourceMappingURL=fetchObservable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchObservable.js","names":["_instrumentMethod","require","_observable","_tools","_monitor","_urlPolyfill","fetchObservable","initFetchObservable","createFetchObservable","Observable","observable","window","fetch","fetchMethod","instrumentMethod","originalFetch","input","init","responsePromise","context","callMonitored","beforeSend","call","afterSend","stop","methodFromParams","method","undefined","Request","String","toUpperCase","url","normalizeUrl","startClocks","clocksNow","state","notify","startContext","reportFetch","response","Error","status","isAborted","DOMException","code","ABORT_ERR","error","responseType","constructor","Response","type","err","then","monitor"],"sources":["../../src/browser/fetchObservable.js"],"sourcesContent":["import { instrumentMethod } from '../helper/instrumentMethod'\nimport { Observable } from '../helper/observable'\nimport { clocksNow } from '../helper/tools'\nimport { monitor, callMonitored } from '../helper/monitor'\nimport { normalizeUrl } from '../helper/urlPolyfill'\n\nvar fetchObservable\n\nexport function initFetchObservable() {\n if (!fetchObservable) {\n fetchObservable = createFetchObservable()\n }\n return fetchObservable\n}\n\nfunction createFetchObservable() {\n return new Observable(function (observable) {\n if (!window.fetch) {\n return\n }\n\n var fetchMethod = instrumentMethod(\n window,\n 'fetch',\n function (originalFetch) {\n return function (input, init) {\n var responsePromise\n var context = callMonitored(beforeSend, null, [\n observable,\n input,\n init\n ])\n if (context) {\n responsePromise = originalFetch.call(\n this,\n context.input,\n context.init\n )\n callMonitored(afterSend, null, [\n observable,\n responsePromise,\n context\n ])\n } else {\n responsePromise = originalFetch.call(this, input, init)\n }\n return responsePromise\n }\n }\n )\n return fetchMethod.stop\n })\n}\n\nfunction beforeSend(observable, input, init) {\n // var method =\n // (init && init.method) || (input instanceof Request && input.method) || 'GET'\n // const methodFromParams =\n // (init && init.method) || (input instanceof Request && input.method)\n // const method = methodFromParams ? methodFromParams.toUpperCase() : 'GET'\n var methodFromParams = init && init.method\n\n if (methodFromParams === undefined && input instanceof Request) {\n methodFromParams = input.method\n }\n\n var method =\n methodFromParams !== undefined\n ? String(methodFromParams).toUpperCase()\n : 'GET'\n var url = input instanceof Request ? input.url : normalizeUrl(String(input))\n\n var startClocks = clocksNow()\n\n var context = {\n state: 'start',\n init: init,\n input: input,\n method: method,\n startClocks: startClocks,\n url: url\n }\n\n observable.notify(context)\n\n return context\n}\n\nfunction afterSend(observable, responsePromise, startContext) {\n var reportFetch = function (response) {\n var context = startContext\n context.state = 'resolve'\n // context.duration = elapsed(context.startClocks.timeStamp, timeStampNow())\n if ('stack' in response || response instanceof Error) {\n context.status = 0\n context.isAborted =\n response instanceof DOMException &&\n response.code === DOMException.ABORT_ERR\n context.error = response\n } else if ('status' in response) {\n context.response = response\n try {\n context.responseType =\n (response.constructor === Response && response.type) || '' // issue The Response type getter can only be used on instances of Response\n } catch (err) {\n context.responseType = ''\n }\n\n context.status = response.status\n context.isAborted = false\n }\n observable.notify(context)\n }\n responsePromise.then(monitor(reportFetch), monitor(reportFetch))\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAIK,eAAe;AAEZ,SAASC,mBAAmBA,CAAA,EAAG;EACpC,IAAI,CAACD,eAAe,EAAE;IACpBA,eAAe,GAAGE,qBAAqB,CAAC,CAAC;EAC3C;EACA,OAAOF,eAAe;AACxB;AAEA,SAASE,qBAAqBA,CAAA,EAAG;EAC/B,OAAO,IAAIC,sBAAU,CAAC,UAAUC,UAAU,EAAE;IAC1C,IAAI,CAACC,MAAM,CAACC,KAAK,EAAE;MACjB;IACF;IAEA,IAAIC,WAAW,GAAG,IAAAC,kCAAgB,EAChCH,MAAM,EACN,OAAO,EACP,UAAUI,aAAa,EAAE;MACvB,OAAO,UAAUC,KAAK,EAAEC,IAAI,EAAE;QAC5B,IAAIC,eAAe;QACnB,IAAIC,OAAO,GAAG,IAAAC,sBAAa,EAACC,UAAU,EAAE,IAAI,EAAE,CAC5CX,UAAU,EACVM,KAAK,EACLC,IAAI,CACL,CAAC;QACF,IAAIE,OAAO,EAAE;UACXD,eAAe,GAAGH,aAAa,CAACO,IAAI,CAClC,IAAI,EACJH,OAAO,CAACH,KAAK,EACbG,OAAO,CAACF,IACV,CAAC;UACD,IAAAG,sBAAa,EAACG,SAAS,EAAE,IAAI,EAAE,CAC7Bb,UAAU,EACVQ,eAAe,EACfC,OAAO,CACR,CAAC;QACJ,CAAC,MAAM;UACLD,eAAe,GAAGH,aAAa,CAACO,IAAI,CAAC,IAAI,EAAEN,KAAK,EAAEC,IAAI,CAAC;QACzD;QACA,OAAOC,eAAe;MACxB,CAAC;IACH,CACF,CAAC;IACD,OAAOL,WAAW,CAACW,IAA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,CAACK,IAAI,KAAKD,YAAY,CAACE,SAAS;MAC1C1B,OAAO,CAAC2B,KAAK,GAAGP,QAAQ;IAC1B,CAAC,MAAM,IAAI,QAAQ,IAAIA,QAAQ,EAAE;MAC/BpB,OAAO,CAACoB,QAAQ,GAAGA,QAAQ;MAC3B,IAAI;QACFpB,OAAO,CAAC4B,YAAY,GACjBR,QAAQ,CAACS,WAAW,KAAKC,QAAQ,IAAIV,QAAQ,CAACW,IAAI,IAAK,EAAE,EAAC;MAC/D,CAAC,CAAC,OAAOC,GAAG,EAAE;QACZhC,OAAO,CAAC4B,YAAY,GAAG,EAAE;MAC3B;MAEA5B,OAAO,CAACsB,MAAM,GAAGF,QAAQ,CAACE,MAAM;MAChCtB,OAAO,CAACuB,SAAS,GAAG,KAAK;IAC3B;IACAhC,UAAU,CAAC0B,MAAM,CAACjB,OAAO,CAAC;EAC5B,CAAC;EACDD,eAAe,CAACkC,IAAI,CAAC,IAAAC,gBAAO,EAACf,WAAW,CAAC,EAAE,IAAAe,gBAAO,EAACf,WAAW,CAAC,CAAC;AAClE","ignoreList":[]}
1
+ {"version":3,"file":"fetchObservable.js","names":["_instrumentMethod","require","_observable","_tools","_monitor","_urlPolyfill","fetchObservable","initFetchObservable","createFetchObservable","resetFetchObservable","undefined","Observable","observable","window","fetch","fetchMethod","instrumentMethod","call","beforeSend","computeHandlingStack","stop","params","parameters","onPostCall","handlingStack","input","init","methodFromParams","method","Request","String","toUpperCase","url","normalizeUrl","startClocks","clocksNow","context","state","notify","responsePromise","afterSend","startContext","reportFetch","partialContext","assign","then","monitor","response","responseType","constructor","Response","type","err","status","isAborted","error","signal","aborted","DOMException","code","ABORT_ERR"],"sources":["../../src/browser/fetchObservable.js"],"sourcesContent":["import { instrumentMethod } from '../helper/instrumentMethod'\nimport { Observable } from '../helper/observable'\nimport { clocksNow, assign } from '../helper/tools'\nimport { monitor } from '../helper/monitor'\nimport { normalizeUrl } from '../helper/urlPolyfill'\n\nvar fetchObservable\n\nexport function initFetchObservable() {\n if (!fetchObservable) {\n fetchObservable = createFetchObservable()\n }\n return fetchObservable\n}\nexport function resetFetchObservable() {\n fetchObservable = undefined\n}\nfunction createFetchObservable() {\n return new Observable(function (observable) {\n if (!window.fetch) {\n return\n }\n\n var fetchMethod = instrumentMethod(\n window,\n 'fetch',\n function (call) {\n return beforeSend(call, observable)\n },\n {\n computeHandlingStack: true\n }\n )\n return fetchMethod.stop\n })\n}\n\nfunction beforeSend(params, observable) {\n var parameters = params.parameters\n var onPostCall = params.onPostCall\n var handlingStack = params.handlingStack\n var input = parameters[0]\n var init = parameters[1]\n // var method =\n // (init && init.method) || (input instanceof Request && input.method) || 'GET'\n // const methodFromParams =\n // (init && init.method) || (input instanceof Request && input.method)\n // const method = methodFromParams ? methodFromParams.toUpperCase() : 'GET'\n var methodFromParams = init && init.method\n\n if (methodFromParams === undefined && input instanceof Request) {\n methodFromParams = input.method\n }\n\n var method =\n methodFromParams !== undefined\n ? String(methodFromParams).toUpperCase()\n : 'GET'\n var url = input instanceof Request ? input.url : normalizeUrl(String(input))\n\n var startClocks = clocksNow()\n\n var context = {\n state: 'start',\n init: init,\n input: input,\n method: method,\n startClocks: startClocks,\n url: url,\n handlingStack: handlingStack\n }\n\n observable.notify(context)\n parameters[0] = context.input\n parameters[1] = context.init\n onPostCall(function (responsePromise) {\n return afterSend(observable, responsePromise, context)\n })\n}\n\nfunction afterSend(observable, responsePromise, startContext) {\n var context = startContext\n var reportFetch = function (partialContext) {\n context.state = 'resolve'\n assign(context, partialContext)\n // context.duration = elapsed(context.startClocks.timeStamp, timeStampNow())\n // if ('stack' in response || response instanceof Error) {\n // context.status = 0\n // context.isAborted =\n // response instanceof DOMException &&\n // response.code === DOMException.ABORT_ERR\n // context.error = response\n // } else if ('status' in response) {\n // context.response = response\n // try {\n // context.responseType =\n // (response.constructor === Response && response.type) || '' // issue The Response type getter can only be used on instances of Response\n // } catch (err) {\n // context.responseType = ''\n // }\n\n // context.status = response.status\n // context.isAborted = false\n // }\n observable.notify(context)\n }\n responsePromise.then(\n monitor(function (response) {\n var responseType = ''\n try {\n responseType =\n (response.constructor === Response && response.type) || '' // issue The Response type getter can only be used on instances of Response\n } catch (err) {\n responseType = ''\n }\n reportFetch({\n response: response,\n responseType: responseType,\n status: response.status,\n isAborted: false\n })\n }),\n monitor(function (error) {\n reportFetch({\n status: 0,\n isAborted:\n (context.init &&\n context.init.signal &&\n context.init.signal.aborted) ||\n (error instanceof DOMException &&\n error.code === DOMException.ABORT_ERR),\n error: error\n })\n })\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAIK,eAAe;AAEZ,SAASC,mBAAmBA,CAAA,EAAG;EACpC,IAAI,CAACD,eAAe,EAAE;IACpBA,eAAe,GAAGE,qBAAqB,CAAC,CAAC;EAC3C;EACA,OAAOF,eAAe;AACxB;AACO,SAASG,oBAAoBA,CAAA,EAAG;EACrCH,eAAe,GAAGI,SAAS;AAC7B;AACA,SAASF,qBAAqBA,CAAA,EAAG;EAC/B,OAAO,IAAIG,sBAAU,CAAC,UAAUC,UAAU,EAAE;IAC1C,IAAI,CAACC,MAAM,CAACC,KAAK,EAAE;MACjB;IACF;IAEA,IAAIC,WAAW,GAAG,IAAAC,kCAAgB,EAChCH,MAAM,EACN,OAAO,EACP,UAAUI,IAAI,EAAE;MACd,OAAOC,UAAU,CAACD,IAAI,EAAEL,UAAU,CAAC;IACrC,CAAC,EACD;MACEO,oBAAoB,EAAE;IACxB,CACF,CAAC;IACD,OAAOJ,WAAW,CAACK,IAAI;EACzB,CAAC,CAAC;AACJ;AAEA,SAASF,UAAUA,CAACG,MAAM,EAAET,UAAU,EAAE;EACtC,IAAIU,UAAU,GAAGD,MAAM,CAACC,UAAU;EAClC,IAAI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var _tools = require("../helper/tools");
11
11
  var _addEventListener = require("../browser/addEventListener");
12
12
  var xhrObservable;
13
- var xhrContexts = {};
14
- var DATA_FLUX_REQUEST_ID_KEY = '_DATAFLUX_REQUEST_UUID';
13
+ var xhrContexts = new WeakMap();
15
14
  function initXhrObservable() {
16
15
  if (!xhrObservable) {
17
16
  xhrObservable = createXhrObservable();
@@ -20,17 +19,13 @@ function initXhrObservable() {
20
19
  }
21
20
  function createXhrObservable() {
22
21
  return new _observable.Observable(function (observable) {
23
- var openInstrumentMethod = (0, _instrumentMethod.instrumentMethodAndCallOriginal)(XMLHttpRequest.prototype, 'open', {
24
- before: openXhr
25
- });
26
- var sendInstrumentMethod = (0, _instrumentMethod.instrumentMethodAndCallOriginal)(XMLHttpRequest.prototype, 'send', {
27
- before: function before() {
28
- sendXhr.call(this, observable);
29
- }
30
- });
31
- var abortInstrumentMethod = (0, _instrumentMethod.instrumentMethodAndCallOriginal)(XMLHttpRequest.prototype, 'abort', {
32
- before: abortXhr
22
+ var openInstrumentMethod = (0, _instrumentMethod.instrumentMethod)(XMLHttpRequest.prototype, 'open', openXhr);
23
+ var sendInstrumentMethod = (0, _instrumentMethod.instrumentMethod)(XMLHttpRequest.prototype, 'send', function (call) {
24
+ sendXhr(call, observable);
25
+ }, {
26
+ computeHandlingStack: true
33
27
  });
28
+ var abortInstrumentMethod = (0, _instrumentMethod.instrumentMethod)(XMLHttpRequest.prototype, 'abort', abortXhr);
34
29
  return function () {
35
30
  openInstrumentMethod.stop();
36
31
  sendInstrumentMethod.stop();
@@ -38,36 +33,37 @@ function createXhrObservable() {
38
33
  };
39
34
  });
40
35
  }
41
- function openXhr(method, url) {
42
- var requestUUID = this[DATA_FLUX_REQUEST_ID_KEY] || (0, _tools.UUID)();
43
- this[DATA_FLUX_REQUEST_ID_KEY] = requestUUID;
44
- xhrContexts[requestUUID] = {
36
+ function openXhr(params) {
37
+ var xhr = params.target;
38
+ var method = params.parameters[0];
39
+ var url = params.parameters[1];
40
+ xhrContexts.set(xhr, {
45
41
  state: 'open',
46
42
  method: String(method).toUpperCase(),
47
43
  url: (0, _urlPolyfill.normalizeUrl)(String(url))
48
- };
44
+ });
49
45
  }
50
- function sendXhr(observable) {
51
- var context = xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]];
46
+ function sendXhr(params, observable) {
47
+ var xhr = params.target;
48
+ var handlingStack = params.handlingStack;
49
+ var context = xhrContexts.get(xhr);
52
50
  if (!context) {
53
51
  return;
54
52
  }
55
53
  var startContext = context;
56
54
  startContext.state = 'start';
57
- startContext.startTime = (0, _tools.relativeNow)();
58
55
  startContext.startClocks = (0, _tools.clocksNow)();
59
56
  startContext.isAborted = false;
60
- startContext.xhr = this;
57
+ startContext.xhr = xhr;
58
+ startContext.handlingStack = handlingStack;
61
59
  var hasBeenReported = false;
62
- var stopInstrumentingOnReadyStateChange = (0, _instrumentMethod.instrumentMethodAndCallOriginal)(this, 'onreadystatechange', {
63
- before: function before() {
64
- if (this.readyState === XMLHttpRequest.DONE) {
65
- // Try to report the XHR as soon as possible, because the XHR may be mutated by the
66
- // application during a future event. For example, Angular is calling .abort() on
67
- // completed requests during a onreadystatechange event, so the status becomes '0'
68
- // before the request is collected.
69
- onEnd.call(this);
70
- }
60
+ var stopInstrumentingOnReadyStateChange = (0, _instrumentMethod.instrumentMethod)(xhr, 'onreadystatechange', function () {
61
+ if (xhr.readyState === XMLHttpRequest.DONE) {
62
+ // Try to report the XHR as soon as possible, because the XHR may be mutated by the
63
+ // application during a future event. For example, Angular is calling .abort() on
64
+ // completed requests during a onreadystatechange event, so the status becomes '0'
65
+ // before the request is collected.
66
+ onEnd();
71
67
  }
72
68
  }).stop;
73
69
  var onEnd = function onEnd() {
@@ -80,19 +76,15 @@ function sendXhr(observable) {
80
76
  var completeContext = context;
81
77
  completeContext.state = 'complete';
82
78
  completeContext.duration = (0, _tools.elapsed)(startContext.startClocks.timeStamp, (0, _tools.timeStampNow)());
83
- completeContext.status = this.status;
79
+ completeContext.status = xhr.status;
84
80
  observable.notify((0, _tools.shallowClone)(completeContext));
85
- clearRequestId.call(this);
86
81
  };
87
- var unsubscribeLoadEndListener = (0, _addEventListener.addEventListener)(this, 'loadend', onEnd).stop;
82
+ var unsubscribeLoadEndListener = (0, _addEventListener.addEventListener)(xhr, 'loadend', onEnd).stop;
88
83
  observable.notify(startContext);
89
84
  }
90
- function clearRequestId() {
91
- delete xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]];
92
- delete this[DATA_FLUX_REQUEST_ID_KEY];
93
- }
94
- function abortXhr() {
95
- var context = xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]];
85
+ function abortXhr(params) {
86
+ var xhr = params.target;
87
+ var context = xhrContexts.get(xhr);
96
88
  if (context) {
97
89
  context.isAborted = true;
98
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"xhrObservable.js","names":["_instrumentMethod","require","_observable","_urlPolyfill","_tools","_addEventListener","xhrObservable","xhrContexts","DATA_FLUX_REQUEST_ID_KEY","initXhrObservable","createXhrObservable","Observable","observable","openInstrumentMethod","instrumentMethodAndCallOriginal","XMLHttpRequest","prototype","before","openXhr","sendInstrumentMethod","sendXhr","call","abortInstrumentMethod","abortXhr","stop","method","url","requestUUID","UUID","state","String","toUpperCase","normalizeUrl","context","startContext","startTime","relativeNow","startClocks","clocksNow","isAborted","xhr","hasBeenReported","stopInstrumentingOnReadyStateChange","readyState","DONE","onEnd","unsubscribeLoadEndListener","completeContext","duration","elapsed","timeStamp","timeStampNow","status","notify","shallowClone","clearRequestId","addEventListener"],"sources":["../../src/browser/xhrObservable.js"],"sourcesContent":["import { instrumentMethodAndCallOriginal } from '../helper/instrumentMethod'\nimport { Observable } from '../helper/observable'\nimport { normalizeUrl } from '../helper/urlPolyfill'\nimport {\n shallowClone,\n elapsed,\n relativeNow,\n clocksNow,\n timeStampNow,\n UUID\n} from '../helper/tools'\nimport { addEventListener } from '../browser/addEventListener'\nvar xhrObservable\nvar xhrContexts = {}\nvar DATA_FLUX_REQUEST_ID_KEY = '_DATAFLUX_REQUEST_UUID'\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 = instrumentMethodAndCallOriginal(\n XMLHttpRequest.prototype,\n 'open',\n {\n before: openXhr\n }\n )\n\n var sendInstrumentMethod = instrumentMethodAndCallOriginal(\n XMLHttpRequest.prototype,\n 'send',\n {\n before: function () {\n sendXhr.call(this, observable)\n }\n }\n )\n\n var abortInstrumentMethod = instrumentMethodAndCallOriginal(\n XMLHttpRequest.prototype,\n 'abort',\n {\n before: abortXhr\n }\n )\n\n return function () {\n openInstrumentMethod.stop()\n sendInstrumentMethod.stop()\n abortInstrumentMethod.stop()\n }\n })\n}\n\nfunction openXhr(method, url) {\n var requestUUID = this[DATA_FLUX_REQUEST_ID_KEY] || UUID()\n this[DATA_FLUX_REQUEST_ID_KEY] = requestUUID\n xhrContexts[requestUUID] = {\n state: 'open',\n method: String(method).toUpperCase(),\n url: normalizeUrl(String(url))\n }\n}\n\nfunction sendXhr(observable) {\n var context = xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]]\n if (!context) {\n return\n }\n var startContext = context\n startContext.state = 'start'\n startContext.startTime = relativeNow()\n startContext.startClocks = clocksNow()\n startContext.isAborted = false\n startContext.xhr = this\n var hasBeenReported = false\n var stopInstrumentingOnReadyStateChange = instrumentMethodAndCallOriginal(\n this,\n 'onreadystatechange',\n {\n before: function () {\n if (this.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.call(this)\n }\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 = this.status\n observable.notify(shallowClone(completeContext))\n clearRequestId.call(this)\n }\n var unsubscribeLoadEndListener = addEventListener(this, 'loadend', onEnd).stop\n observable.notify(startContext)\n}\nfunction clearRequestId() {\n delete xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]]\n delete this[DATA_FLUX_REQUEST_ID_KEY]\n}\nfunction abortXhr() {\n var context = xhrContexts[this[DATA_FLUX_REQUEST_ID_KEY]]\n if (context) {\n context.isAborted = true\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAQA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAIK,aAAa;AACjB,IAAIC,WAAW,GAAG,CAAC,CAAC;AACpB,IAAIC,wBAAwB,GAAG,wBAAwB;AAChD,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,IAAIC,sBAAU,CAAC,UAAUC,UAAU,EAAE;IAC1C,IAAIC,oBAAoB,GAAG,IAAAC,iDAA+B,EACxDC,cAAc,CAACC,SAAS,EACxB,MAAM,EACN;MACEC,MAAM,EAAEC;IACV,CACF,CAAC;IAED,IAAIC,oBAAoB,GAAG,IAAAL,iDAA+B,EACxDC,cAAc,CAACC,SAAS,EACxB,MAAM,EACN;MACEC,MAAM,EAAE,SAAAA,OAAA,EAAY;QAClBG,OAAO,CAACC,IAAI,CAAC,IAAI,EAAET,UAAU,CAAC;MAChC;IACF,CACF,CAAC;IAED,IAAIU,qBAAqB,GAAG,IAAAR,iDAA+B,EACzDC,cA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C0B,UAAU,KAAK5B,cAAc,CAAC6B,IAAI,EAAE;QAC3C;QACA;QACA;QACA;QACAC,KAAK,CAACxB,IAAI,CAAC,IAAI,CAAC;MAClB;IACF;EACF,CACF,CAAC,CAACG,IAAI;EAEN,IAAIqB,KAAK,GAAG,SAARA,KAAKA,CAAA,EAAe;IACtBC,0BAA0B,CAAC,CAAC;IAC5BJ,mCAAmC,CAAC,CAAC;IACrC,IAAID,eAAe,EAAE;MACnB;IACF;IACAA,eAAe,GAAG,IAAI;IACtB,IAAIM,eAAe,GAAGd,OAAO;IAC7Bc,eAAe,CAAClB,KAAK,GAAG,UAAU;IAClCkB,eAAe,CAACC,QAAQ,GAAG,IAAAC,cAAO,EAChCf,YAAY,CAACG,WAAW,CAACa,SAAS,EAClC,IAAAC,mBAAY,EAAC,CACf,CAAC;IACDJ,eAAe,CAACK,MAAM,GAAG,IAAI,CAACA,MAAM;IACpCxC,UAAU,CAACyC,MAAM,CAAC,IAAAC,mBAAY,EAACP,eAAe,CAAC,CAAC;IAChDQ,cAAc,CAAClC,IAAI,CAAC,IAAI,CAAC;EAC3B,CAAC;EACD,IAAIyB,0BAA0B,GAAG,IAAAU,kCAAgB,EAAC,IAAI,EAAE,SAAS,EAAEX,KAAK,CAAC,CAACrB,IAAI;EAC9EZ,UAAU,CAACyC,MAAM,CAACnB,YAAY,CAAC;AACjC;AACA,SAASqB,cAAcA,CAAA,EAAG;EACxB,OAAOhD,WAAW,CAAC,IAAI,CAACC,wBAAwB,CAAC,CAAC;EAClD,OAAO,IAAI,CAACA,wBAAwB,CAAC;AACvC;AACA,SAASe,QAAQA,CAAA,EAAG;EAClB,IAAIU,OAAO,GAAG1B,WAAW,CAAC,IAAI,CAACC,wBAAwB,CAAC,CAAC;EACzD,IAAIyB,OAAO,EAAE;IACXA,OAAO,CAACM,SAAS,GAAG,IAAI;EAC1B;AACF","ignoreList":[]}
1
+ {"version":3,"file":"xhrObservable.js","names":["_instrumentMethod","require","_observable","_urlPolyfill","_tools","_addEventListener","xhrObservable","xhrContexts","WeakMap","initXhrObservable","createXhrObservable","Observable","observable","openInstrumentMethod","instrumentMethod","XMLHttpRequest","prototype","openXhr","sendInstrumentMethod","call","sendXhr","computeHandlingStack","abortInstrumentMethod","abortXhr","stop","params","xhr","target","method","parameters","url","set","state","String","toUpperCase","normalizeUrl","handlingStack","context","get","startContext","startClocks","clocksNow","isAborted","hasBeenReported","stopInstrumentingOnReadyStateChange","readyState","DONE","onEnd","unsubscribeLoadEndListener","completeContext","duration","elapsed","timeStamp","timeStampNow","status","notify","shallowClone","addEventListener"],"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,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAIK,aAAa;AACjB,IAAIC,WAAW,GAAG,IAAIC,OAAO,CAAC,CAAC;AACxB,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,IAAIC,sBAAU,CAAC,UAAUC,UAAU,EAAE;IAC1C,IAAIC,oBAAoB,GAAG,IAAAC,kCAAgB,EACzCC,cA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,IAAIU,OAAO,GAAG9B,WAAW,CAAC+B,GAAG,CAACZ,GAAG,CAAC;EAClC,IAAIW,OAAO,EAAE;IACXA,OAAO,CAACK,SAAS,GAAG,IAAI;EAC1B;AACF","ignoreList":[]}
package/cjs/dataMap.js CHANGED
@@ -75,6 +75,7 @@ var dataMap = {
75
75
  largest_contentful_paint: 'view.largest_contentful_paint',
76
76
  largest_contentful_paint_element_selector: 'view.largest_contentful_paint_element_selector',
77
77
  cumulative_layout_shift: 'view.cumulative_layout_shift',
78
+ cumulative_layout_shift_time: 'view.cumulative_layout_shift_time',
78
79
  cumulative_layout_shift_target_selector: 'view.cumulative_layout_shift_target_selector',
79
80
  first_input_delay: 'view.first_input_delay',
80
81
  loading_time: 'view.loading_time',
@@ -1 +1 @@
1
- {"version":3,"file":"dataMap.js","names":["_enums","require","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","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","exports","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","drift","dataMap","view","type","RumEventType","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","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_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","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 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 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}\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 drift: '_gc.drift'\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 sampled_for_replay: 'session.sampled_for_replay',\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.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 }\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,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,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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AW;IACjBO,MAAM,EAAE;MACNyF,MAAM,EAAE,kBAAkB;MAC1BC,OAAO,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC;MACxCjG,IAAI,EAAE,gBAAgB;MACtB+E,WAAW,EAAE,CAAC,QAAQ,EAAE,uBAAuB,CAAC;MAChDmB,UAAU,EAAE,CAAC,QAAQ,EAAE,sBAAsB;IAC/C;EACF,CAAC;EACDC,WAAW,EAAE;IACXnG,IAAI,EAAEC,mBAAY,CAACmG,MAAM;IACzBjG,IAAI,EAAE;MACJwE,YAAY,EAAE,cAAc;MAC5BC,UAAU,EAAE,YAAY;MACxByB,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;MACpCvH,SAAS,EAAE,gBAAgB;MAC3B7B,OAAO,EAAE,SAAS;MAClByI,MAAM,EAAE;IACV,CAAC;IACDzF,MAAM,EAAE;MACN0F,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS;IAC/B;EACF;AACF,CAAC;AAAAhH,OAAA,CAAAa,OAAA,GAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"dataMap.js","names":["_enums","require","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","device","view_id","view_referrer","view_url","view_host","view_path","view_name","view_path_group","exports","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","drift","dataMap","view","type","RumEventType","VIEW","tags","view_loading_type","view_apdex_level","view_privacy_replay_level","fields","sampled_for_replay","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_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_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","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 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 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}\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 drift: '_gc.drift'\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 sampled_for_replay: 'session.sampled_for_replay',\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_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.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 }\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,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;EACf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 -524,7 +524,6 @@ var _deviceInfo = {};
524
524
  if (typeof window !== 'undefined') {
525
525
  _deviceInfo = {
526
526
  os: MethodLibrary.getOS(),
527
- MethodLibrary: MethodLibrary,
528
527
  osVersion: MethodLibrary.getOSVersion().version,
529
528
  osVersionMajor: MethodLibrary.getOSVersion().osMajor,
530
529
  browser: MethodLibrary.getBrowserInfo().browser,
@@ -532,7 +531,7 @@ if (typeof window !== 'undefined') {
532
531
  browserVersionMajor: MethodLibrary.getBrowserInfo().browserMajor,
533
532
  screenSize: window.screen.width + '*' + window.screen.height,
534
533
  networkType: MethodLibrary.getNetwork(),
535
- divice: MethodLibrary.getDeviceType()
534
+ device: MethodLibrary.getDeviceType()
536
535
  };
537
536
  }
538
537
  var deviceInfo = _deviceInfo;