@posthog/core 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/error-tracking/chunk-ids.d.ts +5 -0
  2. package/dist/error-tracking/chunk-ids.d.ts.map +1 -0
  3. package/dist/error-tracking/chunk-ids.js +68 -0
  4. package/dist/error-tracking/chunk-ids.mjs +34 -0
  5. package/dist/error-tracking/coercers/dom-exception-coercer.d.ts +10 -0
  6. package/dist/error-tracking/coercers/dom-exception-coercer.d.ts.map +1 -0
  7. package/dist/error-tracking/coercers/dom-exception-coercer.js +65 -0
  8. package/dist/error-tracking/coercers/dom-exception-coercer.mjs +31 -0
  9. package/dist/error-tracking/coercers/error-coercer.d.ts +9 -0
  10. package/dist/error-tracking/coercers/error-coercer.d.ts.map +1 -0
  11. package/dist/error-tracking/coercers/error-coercer.js +61 -0
  12. package/dist/error-tracking/coercers/error-coercer.mjs +27 -0
  13. package/dist/error-tracking/coercers/error-event-coercer.d.ts +7 -0
  14. package/dist/error-tracking/coercers/error-event-coercer.d.ts.map +1 -0
  15. package/dist/error-tracking/coercers/error-event-coercer.js +53 -0
  16. package/dist/error-tracking/coercers/error-event-coercer.mjs +19 -0
  17. package/dist/error-tracking/coercers/event-coercer.d.ts +6 -0
  18. package/dist/error-tracking/coercers/event-coercer.d.ts.map +1 -0
  19. package/dist/error-tracking/coercers/event-coercer.js +52 -0
  20. package/dist/error-tracking/coercers/event-coercer.mjs +18 -0
  21. package/dist/error-tracking/coercers/index.d.ts +9 -0
  22. package/dist/error-tracking/coercers/index.d.ts.map +1 -0
  23. package/dist/error-tracking/coercers/index.js +123 -0
  24. package/dist/error-tracking/coercers/index.mjs +8 -0
  25. package/dist/error-tracking/coercers/object-coercer.d.ts +14 -0
  26. package/dist/error-tracking/coercers/object-coercer.d.ts.map +1 -0
  27. package/dist/error-tracking/coercers/object-coercer.js +86 -0
  28. package/dist/error-tracking/coercers/object-coercer.mjs +52 -0
  29. package/dist/error-tracking/coercers/primitive-coercer.d.ts +7 -0
  30. package/dist/error-tracking/coercers/primitive-coercer.d.ts.map +1 -0
  31. package/dist/error-tracking/coercers/primitive-coercer.js +50 -0
  32. package/dist/error-tracking/coercers/primitive-coercer.mjs +16 -0
  33. package/dist/error-tracking/coercers/promise-rejection-event.d.ts +7 -0
  34. package/dist/error-tracking/coercers/promise-rejection-event.d.ts.map +1 -0
  35. package/dist/error-tracking/coercers/promise-rejection-event.js +60 -0
  36. package/dist/error-tracking/coercers/promise-rejection-event.mjs +26 -0
  37. package/dist/error-tracking/coercers/string-coercer.d.ts +7 -0
  38. package/dist/error-tracking/coercers/string-coercer.d.ts.map +1 -0
  39. package/dist/error-tracking/coercers/string-coercer.js +64 -0
  40. package/dist/error-tracking/coercers/string-coercer.mjs +30 -0
  41. package/dist/error-tracking/coercers/utils.d.ts +8 -0
  42. package/dist/error-tracking/coercers/utils.d.ts.map +1 -0
  43. package/dist/error-tracking/coercers/utils.js +57 -0
  44. package/dist/error-tracking/coercers/utils.mjs +20 -0
  45. package/dist/error-tracking/error-properties-builder.d.ts +18 -0
  46. package/dist/error-tracking/error-properties-builder.d.ts.map +1 -0
  47. package/dist/error-tracking/error-properties-builder.js +156 -0
  48. package/dist/error-tracking/error-properties-builder.mjs +122 -0
  49. package/dist/error-tracking/index.d.ts +6 -0
  50. package/dist/error-tracking/index.d.ts.map +1 -0
  51. package/dist/error-tracking/index.js +87 -0
  52. package/dist/error-tracking/index.mjs +4 -0
  53. package/dist/error-tracking/parsers/base.d.ts +9 -0
  54. package/dist/error-tracking/parsers/base.d.ts.map +1 -0
  55. package/dist/error-tracking/parsers/base.js +71 -0
  56. package/dist/error-tracking/parsers/base.mjs +19 -0
  57. package/dist/error-tracking/parsers/chrome.d.ts +3 -0
  58. package/dist/error-tracking/parsers/chrome.d.ts.map +1 -0
  59. package/dist/error-tracking/parsers/chrome.js +61 -0
  60. package/dist/error-tracking/parsers/chrome.mjs +27 -0
  61. package/dist/error-tracking/parsers/gecko.d.ts +3 -0
  62. package/dist/error-tracking/parsers/gecko.d.ts.map +1 -0
  63. package/dist/error-tracking/parsers/gecko.js +58 -0
  64. package/dist/error-tracking/parsers/gecko.mjs +24 -0
  65. package/dist/error-tracking/parsers/index.d.ts +9 -0
  66. package/dist/error-tracking/parsers/index.d.ts.map +1 -0
  67. package/dist/error-tracking/parsers/index.js +101 -0
  68. package/dist/error-tracking/parsers/index.mjs +46 -0
  69. package/dist/error-tracking/parsers/node.d.ts +3 -0
  70. package/dist/error-tracking/parsers/node.d.ts.map +1 -0
  71. package/dist/error-tracking/parsers/node.js +101 -0
  72. package/dist/error-tracking/parsers/node.mjs +67 -0
  73. package/dist/error-tracking/parsers/opera.d.ts +4 -0
  74. package/dist/error-tracking/parsers/opera.d.ts.map +1 -0
  75. package/dist/error-tracking/parsers/opera.js +49 -0
  76. package/dist/error-tracking/parsers/opera.mjs +12 -0
  77. package/dist/error-tracking/parsers/react-native.d.ts +1 -0
  78. package/dist/error-tracking/parsers/react-native.d.ts.map +1 -0
  79. package/dist/error-tracking/parsers/react-native.js +5 -0
  80. package/dist/error-tracking/parsers/react-native.mjs +0 -0
  81. package/dist/error-tracking/parsers/safari.d.ts +22 -0
  82. package/dist/error-tracking/parsers/safari.d.ts.map +1 -0
  83. package/dist/error-tracking/parsers/safari.js +47 -0
  84. package/dist/error-tracking/parsers/safari.mjs +13 -0
  85. package/dist/error-tracking/parsers/winjs.d.ts +3 -0
  86. package/dist/error-tracking/parsers/winjs.d.ts.map +1 -0
  87. package/dist/error-tracking/parsers/winjs.js +41 -0
  88. package/dist/error-tracking/parsers/winjs.mjs +7 -0
  89. package/dist/error-tracking/types.d.ts +87 -0
  90. package/dist/error-tracking/types.d.ts.map +1 -0
  91. package/dist/error-tracking/types.js +43 -0
  92. package/dist/error-tracking/types.mjs +9 -0
  93. package/dist/error-tracking/utils.d.ts +13 -0
  94. package/dist/error-tracking/utils.d.ts.map +1 -0
  95. package/dist/error-tracking/utils.js +57 -0
  96. package/dist/error-tracking/utils.mjs +23 -0
  97. package/dist/index.d.ts +121 -9
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/index.js +13 -4
  100. package/dist/index.mjs +5 -4
  101. package/dist/testing/test-utils.d.ts +2 -0
  102. package/dist/testing/test-utils.d.ts.map +1 -1
  103. package/dist/testing/test-utils.js +12 -0
  104. package/dist/testing/test-utils.mjs +10 -1
  105. package/dist/utils/bucketed-rate-limiter.d.ts.map +1 -1
  106. package/dist/utils/number-utils.d.ts.map +1 -1
  107. package/dist/utils/type-utils.d.ts +8 -1
  108. package/dist/utils/type-utils.d.ts.map +1 -1
  109. package/dist/utils/type-utils.js +61 -6
  110. package/dist/utils/type-utils.mjs +36 -2
  111. package/package.json +8 -3
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ ErrorPropertiesBuilder: ()=>ErrorPropertiesBuilder
28
+ });
29
+ const external_chunk_ids_js_namespaceObject = require("./chunk-ids.js");
30
+ const index_js_namespaceObject = require("./parsers/index.js");
31
+ const MAX_CAUSE_RECURSION = 4;
32
+ class ErrorPropertiesBuilder {
33
+ buildFromUnknown(input) {
34
+ let hint = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
35
+ const providedMechanism = hint && hint.mechanism;
36
+ const mechanism = providedMechanism || {
37
+ handled: true,
38
+ type: 'generic'
39
+ };
40
+ const coercingContext = this.buildCoercingContext(mechanism, hint, 0);
41
+ const exceptionWithCause = coercingContext.apply(input);
42
+ const parsingContext = this.buildParsingContext();
43
+ const exceptionWithStack = this.parseStacktrace(exceptionWithCause, parsingContext);
44
+ const exceptionList = this.convertToExceptionList(exceptionWithStack, mechanism);
45
+ return {
46
+ $exception_list: exceptionList,
47
+ $exception_level: 'error'
48
+ };
49
+ }
50
+ coerceFallback(ctx) {
51
+ var _ctx_syntheticException;
52
+ return {
53
+ type: 'Error',
54
+ value: 'Unknown error',
55
+ stack: null == (_ctx_syntheticException = ctx.syntheticException) ? void 0 : _ctx_syntheticException.stack,
56
+ synthetic: true
57
+ };
58
+ }
59
+ parseStacktrace(err, ctx) {
60
+ let cause;
61
+ if (null != err.cause) cause = this.parseStacktrace(err.cause, ctx);
62
+ let stack;
63
+ if ('' != err.stack && null != err.stack) stack = this.applyChunkIds(this.stackParser(err.stack, err.synthetic ? 1 : 0), ctx.chunkIdMap);
64
+ return {
65
+ ...err,
66
+ cause,
67
+ stack
68
+ };
69
+ }
70
+ applyChunkIds(frames, chunkIdMap) {
71
+ return frames.map((frame)=>{
72
+ if (frame.filename && chunkIdMap) frame.chunk_id = chunkIdMap[frame.filename];
73
+ return frame;
74
+ });
75
+ }
76
+ applyCoercers(input, ctx) {
77
+ for (const adapter of this.coercers)if (adapter.match(input)) return adapter.coerce(input, ctx);
78
+ return this.coerceFallback(ctx);
79
+ }
80
+ async applyModifiers(frames) {
81
+ let newFrames = frames;
82
+ for (const modifier of this.modifiers)newFrames = await modifier(newFrames);
83
+ return newFrames;
84
+ }
85
+ async modifyFrames(exceptionWithStack) {
86
+ let cause;
87
+ if (null != exceptionWithStack.cause) cause = await this.modifyFrames(exceptionWithStack.cause);
88
+ let stack = [];
89
+ if (null != exceptionWithStack.stack) stack = await this.applyModifiers(exceptionWithStack.stack);
90
+ return {
91
+ ...exceptionWithStack,
92
+ cause,
93
+ stack
94
+ };
95
+ }
96
+ convertToExceptionList(exceptionWithStack, mechanism) {
97
+ var _mechanism_type, _mechanism_handled, _exceptionWithStack_synthetic;
98
+ const currentException = {
99
+ type: exceptionWithStack.type,
100
+ value: exceptionWithStack.value,
101
+ mechanism: {
102
+ type: null != (_mechanism_type = mechanism.type) ? _mechanism_type : 'generic',
103
+ handled: null != (_mechanism_handled = mechanism.handled) ? _mechanism_handled : true,
104
+ synthetic: null != (_exceptionWithStack_synthetic = exceptionWithStack.synthetic) ? _exceptionWithStack_synthetic : false
105
+ }
106
+ };
107
+ if (exceptionWithStack.stack) currentException.stacktrace = {
108
+ type: 'raw',
109
+ frames: exceptionWithStack.stack
110
+ };
111
+ const exceptionList = [
112
+ currentException
113
+ ];
114
+ if (null != exceptionWithStack.cause) exceptionList.push(...this.convertToExceptionList(exceptionWithStack.cause, {
115
+ ...mechanism,
116
+ handled: true
117
+ }));
118
+ return exceptionList;
119
+ }
120
+ buildParsingContext() {
121
+ const context = {
122
+ chunkIdMap: (0, external_chunk_ids_js_namespaceObject.getFilenameToChunkIdMap)(this.stackParser)
123
+ };
124
+ return context;
125
+ }
126
+ buildCoercingContext(mechanism, hint) {
127
+ let depth = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
128
+ const coerce = (input, depth)=>{
129
+ if (!(depth <= MAX_CAUSE_RECURSION)) return;
130
+ {
131
+ const ctx = this.buildCoercingContext(mechanism, hint, depth);
132
+ return this.applyCoercers(input, ctx);
133
+ }
134
+ };
135
+ const context = {
136
+ ...hint,
137
+ syntheticException: 0 == depth ? hint.syntheticException : void 0,
138
+ mechanism,
139
+ apply: (input)=>coerce(input, depth),
140
+ next: (input)=>coerce(input, depth + 1)
141
+ };
142
+ return context;
143
+ }
144
+ constructor(coercers = [], parsers = [], modifiers = []){
145
+ this.coercers = coercers;
146
+ this.modifiers = modifiers;
147
+ this.stackParser = (0, index_js_namespaceObject.createStackParser)(...parsers);
148
+ }
149
+ }
150
+ exports.ErrorPropertiesBuilder = __webpack_exports__.ErrorPropertiesBuilder;
151
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
152
+ "ErrorPropertiesBuilder"
153
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
154
+ Object.defineProperty(exports, '__esModule', {
155
+ value: true
156
+ });
@@ -0,0 +1,122 @@
1
+ import { getFilenameToChunkIdMap } from "./chunk-ids.mjs";
2
+ import { createStackParser } from "./parsers/index.mjs";
3
+ const MAX_CAUSE_RECURSION = 4;
4
+ class ErrorPropertiesBuilder {
5
+ buildFromUnknown(input) {
6
+ let hint = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
7
+ const providedMechanism = hint && hint.mechanism;
8
+ const mechanism = providedMechanism || {
9
+ handled: true,
10
+ type: 'generic'
11
+ };
12
+ const coercingContext = this.buildCoercingContext(mechanism, hint, 0);
13
+ const exceptionWithCause = coercingContext.apply(input);
14
+ const parsingContext = this.buildParsingContext();
15
+ const exceptionWithStack = this.parseStacktrace(exceptionWithCause, parsingContext);
16
+ const exceptionList = this.convertToExceptionList(exceptionWithStack, mechanism);
17
+ return {
18
+ $exception_list: exceptionList,
19
+ $exception_level: 'error'
20
+ };
21
+ }
22
+ coerceFallback(ctx) {
23
+ var _ctx_syntheticException;
24
+ return {
25
+ type: 'Error',
26
+ value: 'Unknown error',
27
+ stack: null == (_ctx_syntheticException = ctx.syntheticException) ? void 0 : _ctx_syntheticException.stack,
28
+ synthetic: true
29
+ };
30
+ }
31
+ parseStacktrace(err, ctx) {
32
+ let cause;
33
+ if (null != err.cause) cause = this.parseStacktrace(err.cause, ctx);
34
+ let stack;
35
+ if ('' != err.stack && null != err.stack) stack = this.applyChunkIds(this.stackParser(err.stack, err.synthetic ? 1 : 0), ctx.chunkIdMap);
36
+ return {
37
+ ...err,
38
+ cause,
39
+ stack
40
+ };
41
+ }
42
+ applyChunkIds(frames, chunkIdMap) {
43
+ return frames.map((frame)=>{
44
+ if (frame.filename && chunkIdMap) frame.chunk_id = chunkIdMap[frame.filename];
45
+ return frame;
46
+ });
47
+ }
48
+ applyCoercers(input, ctx) {
49
+ for (const adapter of this.coercers)if (adapter.match(input)) return adapter.coerce(input, ctx);
50
+ return this.coerceFallback(ctx);
51
+ }
52
+ async applyModifiers(frames) {
53
+ let newFrames = frames;
54
+ for (const modifier of this.modifiers)newFrames = await modifier(newFrames);
55
+ return newFrames;
56
+ }
57
+ async modifyFrames(exceptionWithStack) {
58
+ let cause;
59
+ if (null != exceptionWithStack.cause) cause = await this.modifyFrames(exceptionWithStack.cause);
60
+ let stack = [];
61
+ if (null != exceptionWithStack.stack) stack = await this.applyModifiers(exceptionWithStack.stack);
62
+ return {
63
+ ...exceptionWithStack,
64
+ cause,
65
+ stack
66
+ };
67
+ }
68
+ convertToExceptionList(exceptionWithStack, mechanism) {
69
+ var _mechanism_type, _mechanism_handled, _exceptionWithStack_synthetic;
70
+ const currentException = {
71
+ type: exceptionWithStack.type,
72
+ value: exceptionWithStack.value,
73
+ mechanism: {
74
+ type: null != (_mechanism_type = mechanism.type) ? _mechanism_type : 'generic',
75
+ handled: null != (_mechanism_handled = mechanism.handled) ? _mechanism_handled : true,
76
+ synthetic: null != (_exceptionWithStack_synthetic = exceptionWithStack.synthetic) ? _exceptionWithStack_synthetic : false
77
+ }
78
+ };
79
+ if (exceptionWithStack.stack) currentException.stacktrace = {
80
+ type: 'raw',
81
+ frames: exceptionWithStack.stack
82
+ };
83
+ const exceptionList = [
84
+ currentException
85
+ ];
86
+ if (null != exceptionWithStack.cause) exceptionList.push(...this.convertToExceptionList(exceptionWithStack.cause, {
87
+ ...mechanism,
88
+ handled: true
89
+ }));
90
+ return exceptionList;
91
+ }
92
+ buildParsingContext() {
93
+ const context = {
94
+ chunkIdMap: getFilenameToChunkIdMap(this.stackParser)
95
+ };
96
+ return context;
97
+ }
98
+ buildCoercingContext(mechanism, hint) {
99
+ let depth = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
100
+ const coerce = (input, depth)=>{
101
+ if (!(depth <= MAX_CAUSE_RECURSION)) return;
102
+ {
103
+ const ctx = this.buildCoercingContext(mechanism, hint, depth);
104
+ return this.applyCoercers(input, ctx);
105
+ }
106
+ };
107
+ const context = {
108
+ ...hint,
109
+ syntheticException: 0 == depth ? hint.syntheticException : void 0,
110
+ mechanism,
111
+ apply: (input)=>coerce(input, depth),
112
+ next: (input)=>coerce(input, depth + 1)
113
+ };
114
+ return context;
115
+ }
116
+ constructor(coercers = [], parsers = [], modifiers = []){
117
+ this.coercers = coercers;
118
+ this.modifiers = modifiers;
119
+ this.stackParser = createStackParser(...parsers);
120
+ }
121
+ }
122
+ export { ErrorPropertiesBuilder };
@@ -0,0 +1,6 @@
1
+ export * from './error-properties-builder';
2
+ export type * from './types';
3
+ export * from './parsers';
4
+ export * from './coercers';
5
+ export * from './utils';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error-tracking/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,mBAAmB,SAAS,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __webpack_modules__ = {
3
+ "./coercers": function(module) {
4
+ module.exports = require("./coercers/index.js");
5
+ },
6
+ "./error-properties-builder": function(module) {
7
+ module.exports = require("./error-properties-builder.js");
8
+ },
9
+ "./parsers": function(module) {
10
+ module.exports = require("./parsers/index.js");
11
+ },
12
+ "./utils?198b": function(module) {
13
+ module.exports = require("./utils.js");
14
+ }
15
+ };
16
+ var __webpack_module_cache__ = {};
17
+ function __webpack_require__(moduleId) {
18
+ var cachedModule = __webpack_module_cache__[moduleId];
19
+ if (void 0 !== cachedModule) return cachedModule.exports;
20
+ var module = __webpack_module_cache__[moduleId] = {
21
+ exports: {}
22
+ };
23
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
24
+ return module.exports;
25
+ }
26
+ (()=>{
27
+ __webpack_require__.n = (module)=>{
28
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
29
+ __webpack_require__.d(getter, {
30
+ a: getter
31
+ });
32
+ return getter;
33
+ };
34
+ })();
35
+ (()=>{
36
+ __webpack_require__.d = (exports1, definition)=>{
37
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
38
+ enumerable: true,
39
+ get: definition[key]
40
+ });
41
+ };
42
+ })();
43
+ (()=>{
44
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
45
+ })();
46
+ (()=>{
47
+ __webpack_require__.r = (exports1)=>{
48
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
49
+ value: 'Module'
50
+ });
51
+ Object.defineProperty(exports1, '__esModule', {
52
+ value: true
53
+ });
54
+ };
55
+ })();
56
+ var __webpack_exports__ = {};
57
+ (()=>{
58
+ __webpack_require__.r(__webpack_exports__);
59
+ var _error_properties_builder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./error-properties-builder");
60
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
61
+ for(var __WEBPACK_IMPORT_KEY__ in _error_properties_builder__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
62
+ return _error_properties_builder__WEBPACK_IMPORTED_MODULE_0__[key];
63
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
64
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
65
+ var _parsers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./parsers");
66
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
67
+ for(var __WEBPACK_IMPORT_KEY__ in _parsers__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
68
+ return _parsers__WEBPACK_IMPORTED_MODULE_1__[key];
69
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
70
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
71
+ var _coercers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./coercers");
72
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
73
+ for(var __WEBPACK_IMPORT_KEY__ in _coercers__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
74
+ return _coercers__WEBPACK_IMPORTED_MODULE_2__[key];
75
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
76
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
77
+ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./utils?198b");
78
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
79
+ for(var __WEBPACK_IMPORT_KEY__ in _utils__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
80
+ return _utils__WEBPACK_IMPORTED_MODULE_3__[key];
81
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
82
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
83
+ })();
84
+ for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
85
+ Object.defineProperty(exports, '__esModule', {
86
+ value: true
87
+ });
@@ -0,0 +1,4 @@
1
+ export * from "./error-properties-builder.mjs";
2
+ export * from "./parsers/index.mjs";
3
+ export * from "./coercers/index.mjs";
4
+ export * from "./utils.mjs";
@@ -0,0 +1,9 @@
1
+ import { StackFrame } from '../types';
2
+ export declare const UNKNOWN_FUNCTION = "?";
3
+ export declare const OPERA10_PRIORITY = 10;
4
+ export declare const OPERA11_PRIORITY = 20;
5
+ export declare const CHROME_PRIORITY = 30;
6
+ export declare const WINJS_PRIORITY = 40;
7
+ export declare const GECKO_PRIORITY = 50;
8
+ export declare function createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame;
9
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,eAAO,MAAM,gBAAgB,MAAM,CAAA;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAClC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAClC,eAAO,MAAM,eAAe,KAAK,CAAA;AACjC,eAAO,MAAM,cAAc,KAAK,CAAA;AAChC,eAAO,MAAM,cAAc,KAAK,CAAA;AAEhC,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAkBvG"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ OPERA10_PRIORITY: ()=>OPERA10_PRIORITY,
28
+ CHROME_PRIORITY: ()=>CHROME_PRIORITY,
29
+ UNKNOWN_FUNCTION: ()=>UNKNOWN_FUNCTION,
30
+ WINJS_PRIORITY: ()=>WINJS_PRIORITY,
31
+ createFrame: ()=>createFrame,
32
+ OPERA11_PRIORITY: ()=>OPERA11_PRIORITY,
33
+ GECKO_PRIORITY: ()=>GECKO_PRIORITY
34
+ });
35
+ const index_js_namespaceObject = require("../../utils/index.js");
36
+ const UNKNOWN_FUNCTION = '?';
37
+ const OPERA10_PRIORITY = 10;
38
+ const OPERA11_PRIORITY = 20;
39
+ const CHROME_PRIORITY = 30;
40
+ const WINJS_PRIORITY = 40;
41
+ const GECKO_PRIORITY = 50;
42
+ function createFrame(filename, func, lineno, colno) {
43
+ const frame = {
44
+ platform: "web:javascript",
45
+ filename,
46
+ function: '<anonymous>' === func ? UNKNOWN_FUNCTION : func,
47
+ in_app: true
48
+ };
49
+ if (!(0, index_js_namespaceObject.isUndefined)(lineno)) frame.lineno = lineno;
50
+ if (!(0, index_js_namespaceObject.isUndefined)(colno)) frame.colno = colno;
51
+ return frame;
52
+ }
53
+ exports.CHROME_PRIORITY = __webpack_exports__.CHROME_PRIORITY;
54
+ exports.GECKO_PRIORITY = __webpack_exports__.GECKO_PRIORITY;
55
+ exports.OPERA10_PRIORITY = __webpack_exports__.OPERA10_PRIORITY;
56
+ exports.OPERA11_PRIORITY = __webpack_exports__.OPERA11_PRIORITY;
57
+ exports.UNKNOWN_FUNCTION = __webpack_exports__.UNKNOWN_FUNCTION;
58
+ exports.WINJS_PRIORITY = __webpack_exports__.WINJS_PRIORITY;
59
+ exports.createFrame = __webpack_exports__.createFrame;
60
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
61
+ "CHROME_PRIORITY",
62
+ "GECKO_PRIORITY",
63
+ "OPERA10_PRIORITY",
64
+ "OPERA11_PRIORITY",
65
+ "UNKNOWN_FUNCTION",
66
+ "WINJS_PRIORITY",
67
+ "createFrame"
68
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
69
+ Object.defineProperty(exports, '__esModule', {
70
+ value: true
71
+ });
@@ -0,0 +1,19 @@
1
+ import { isUndefined } from "../../utils/index.mjs";
2
+ const UNKNOWN_FUNCTION = '?';
3
+ const OPERA10_PRIORITY = 10;
4
+ const OPERA11_PRIORITY = 20;
5
+ const CHROME_PRIORITY = 30;
6
+ const WINJS_PRIORITY = 40;
7
+ const GECKO_PRIORITY = 50;
8
+ function createFrame(filename, func, lineno, colno) {
9
+ const frame = {
10
+ platform: "web:javascript",
11
+ filename,
12
+ function: '<anonymous>' === func ? UNKNOWN_FUNCTION : func,
13
+ in_app: true
14
+ };
15
+ if (!isUndefined(lineno)) frame.lineno = lineno;
16
+ if (!isUndefined(colno)) frame.colno = colno;
17
+ return frame;
18
+ }
19
+ export { CHROME_PRIORITY, GECKO_PRIORITY, OPERA10_PRIORITY, OPERA11_PRIORITY, UNKNOWN_FUNCTION, WINJS_PRIORITY, createFrame };
@@ -0,0 +1,3 @@
1
+ import { StackLineParser } from '../types';
2
+ export declare const chromeStackLineParser: StackLineParser;
3
+ //# sourceMappingURL=chrome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/chrome.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAgB1C,eAAO,MAAM,qBAAqB,EAAE,eAiCnC,CAAA"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ chromeStackLineParser: ()=>chromeStackLineParser
28
+ });
29
+ const external_base_js_namespaceObject = require("./base.js");
30
+ const external_safari_js_namespaceObject = require("./safari.js");
31
+ const chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
32
+ const chromeRegex = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
33
+ const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;
34
+ const chromeStackLineParser = (line)=>{
35
+ const noFnParts = chromeRegexNoFnName.exec(line);
36
+ if (noFnParts) {
37
+ const [, filename, line, col] = noFnParts;
38
+ return (0, external_base_js_namespaceObject.createFrame)(filename, external_base_js_namespaceObject.UNKNOWN_FUNCTION, +line, +col);
39
+ }
40
+ const parts = chromeRegex.exec(line);
41
+ if (parts) {
42
+ const isEval = parts[2] && 0 === parts[2].indexOf('eval');
43
+ if (isEval) {
44
+ const subMatch = chromeEvalRegex.exec(parts[2]);
45
+ if (subMatch) {
46
+ parts[2] = subMatch[1];
47
+ parts[3] = subMatch[2];
48
+ parts[4] = subMatch[3];
49
+ }
50
+ }
51
+ const [func, filename] = (0, external_safari_js_namespaceObject.extractSafariExtensionDetails)(parts[1] || external_base_js_namespaceObject.UNKNOWN_FUNCTION, parts[2]);
52
+ return (0, external_base_js_namespaceObject.createFrame)(filename, func, parts[3] ? +parts[3] : void 0, parts[4] ? +parts[4] : void 0);
53
+ }
54
+ };
55
+ exports.chromeStackLineParser = __webpack_exports__.chromeStackLineParser;
56
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
57
+ "chromeStackLineParser"
58
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
59
+ Object.defineProperty(exports, '__esModule', {
60
+ value: true
61
+ });
@@ -0,0 +1,27 @@
1
+ import { UNKNOWN_FUNCTION, createFrame } from "./base.mjs";
2
+ import { extractSafariExtensionDetails } from "./safari.mjs";
3
+ const chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
4
+ const chromeRegex = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
5
+ const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;
6
+ const chromeStackLineParser = (line)=>{
7
+ const noFnParts = chromeRegexNoFnName.exec(line);
8
+ if (noFnParts) {
9
+ const [, filename, line, col] = noFnParts;
10
+ return createFrame(filename, UNKNOWN_FUNCTION, +line, +col);
11
+ }
12
+ const parts = chromeRegex.exec(line);
13
+ if (parts) {
14
+ const isEval = parts[2] && 0 === parts[2].indexOf('eval');
15
+ if (isEval) {
16
+ const subMatch = chromeEvalRegex.exec(parts[2]);
17
+ if (subMatch) {
18
+ parts[2] = subMatch[1];
19
+ parts[3] = subMatch[2];
20
+ parts[4] = subMatch[3];
21
+ }
22
+ }
23
+ const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);
24
+ return createFrame(filename, func, parts[3] ? +parts[3] : void 0, parts[4] ? +parts[4] : void 0);
25
+ }
26
+ };
27
+ export { chromeStackLineParser };
@@ -0,0 +1,3 @@
1
+ import { StackLineParser } from '../types';
2
+ export declare const geckoStackLineParser: StackLineParser;
3
+ //# sourceMappingURL=gecko.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gecko.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/gecko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAS1C,eAAO,MAAM,oBAAoB,EAAE,eAyBlC,CAAA"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ geckoStackLineParser: ()=>geckoStackLineParser
28
+ });
29
+ const external_base_js_namespaceObject = require("./base.js");
30
+ const external_safari_js_namespaceObject = require("./safari.js");
31
+ const geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
32
+ const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
33
+ const geckoStackLineParser = (line)=>{
34
+ const parts = geckoREgex.exec(line);
35
+ if (parts) {
36
+ const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
37
+ if (isEval) {
38
+ const subMatch = geckoEvalRegex.exec(parts[3]);
39
+ if (subMatch) {
40
+ parts[1] = parts[1] || 'eval';
41
+ parts[3] = subMatch[1];
42
+ parts[4] = subMatch[2];
43
+ parts[5] = '';
44
+ }
45
+ }
46
+ let filename = parts[3];
47
+ let func = parts[1] || external_base_js_namespaceObject.UNKNOWN_FUNCTION;
48
+ [func, filename] = (0, external_safari_js_namespaceObject.extractSafariExtensionDetails)(func, filename);
49
+ return (0, external_base_js_namespaceObject.createFrame)(filename, func, parts[4] ? +parts[4] : void 0, parts[5] ? +parts[5] : void 0);
50
+ }
51
+ };
52
+ exports.geckoStackLineParser = __webpack_exports__.geckoStackLineParser;
53
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
54
+ "geckoStackLineParser"
55
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
56
+ Object.defineProperty(exports, '__esModule', {
57
+ value: true
58
+ });