rollbar 2.26.2 → 2.26.4

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 (117) hide show
  1. package/.github/workflows/ci.yml +32 -10
  2. package/.lgtm.yml +7 -7
  3. package/.prettierignore +18 -0
  4. package/.vscode/settings.json +39 -0
  5. package/CHANGELOG.md +121 -35
  6. package/Gruntfile.js +51 -71
  7. package/README.md +2 -4
  8. package/bower.json +1 -3
  9. package/defaults.js +17 -5
  10. package/dist/plugins/jquery.min.js +1 -1
  11. package/dist/rollbar.js +5699 -5052
  12. package/dist/rollbar.js.map +1 -1
  13. package/dist/rollbar.min.js +1 -1
  14. package/dist/rollbar.min.js.map +1 -1
  15. package/dist/rollbar.named-amd.js +5704 -5062
  16. package/dist/rollbar.named-amd.js.map +1 -1
  17. package/dist/rollbar.named-amd.min.js +1 -1
  18. package/dist/rollbar.named-amd.min.js.map +1 -1
  19. package/dist/rollbar.noconflict.umd.js +5693 -5052
  20. package/dist/rollbar.noconflict.umd.js.map +1 -1
  21. package/dist/rollbar.noconflict.umd.min.js +1 -1
  22. package/dist/rollbar.noconflict.umd.min.js.map +1 -1
  23. package/dist/rollbar.snippet.js +1 -1
  24. package/dist/rollbar.umd.js +5704 -5063
  25. package/dist/rollbar.umd.js.map +1 -1
  26. package/dist/rollbar.umd.min.js +1 -1
  27. package/dist/rollbar.umd.min.js.map +1 -1
  28. package/docs/extension-exceptions.md +35 -30
  29. package/docs/migration_v0_to_v1.md +41 -38
  30. package/index.d.ts +270 -231
  31. package/karma.conf.js +16 -34
  32. package/package.json +21 -17
  33. package/prettier.config.js +7 -0
  34. package/src/api.js +21 -10
  35. package/src/apiUtility.js +12 -8
  36. package/src/browser/core.js +103 -65
  37. package/src/browser/defaults/scrubFields.js +3 -3
  38. package/src/browser/detection.js +7 -8
  39. package/src/browser/domUtility.js +18 -8
  40. package/src/browser/globalSetup.js +12 -6
  41. package/src/browser/logger.js +1 -1
  42. package/src/browser/plugins/jquery.js +35 -35
  43. package/src/browser/predicates.js +1 -1
  44. package/src/browser/rollbar.js +1 -1
  45. package/src/browser/rollbarWrapper.js +8 -5
  46. package/src/browser/shim.js +43 -19
  47. package/src/browser/snippet_callback.js +6 -4
  48. package/src/browser/telemetry.js +573 -354
  49. package/src/browser/transforms.js +46 -27
  50. package/src/browser/transport/fetch.js +16 -14
  51. package/src/browser/transport/xhr.js +29 -13
  52. package/src/browser/transport.js +82 -25
  53. package/src/browser/url.js +16 -8
  54. package/src/browser/wrapGlobals.js +27 -8
  55. package/src/defaults.js +3 -3
  56. package/src/errorParser.js +14 -11
  57. package/src/merge.js +32 -23
  58. package/src/notifier.js +16 -13
  59. package/src/predicates.js +43 -23
  60. package/src/queue.js +71 -39
  61. package/src/rateLimiter.js +59 -18
  62. package/src/react-native/logger.js +1 -1
  63. package/src/react-native/rollbar.js +59 -55
  64. package/src/react-native/transforms.js +13 -9
  65. package/src/react-native/transport.js +44 -34
  66. package/src/rollbar.js +22 -13
  67. package/src/scrub.js +0 -1
  68. package/src/server/locals.js +69 -39
  69. package/src/server/logger.js +4 -4
  70. package/src/server/parser.js +72 -47
  71. package/src/server/rollbar.js +133 -55
  72. package/src/server/sourceMap/stackTrace.js +33 -18
  73. package/src/server/telemetry/urlHelpers.js +9 -11
  74. package/src/server/telemetry.js +68 -45
  75. package/src/server/transforms.js +37 -21
  76. package/src/server/transport.js +62 -32
  77. package/src/telemetry.js +92 -28
  78. package/src/transforms.js +33 -21
  79. package/src/truncation.js +8 -5
  80. package/src/utility/headers.js +43 -43
  81. package/src/utility/replace.js +9 -0
  82. package/src/utility/traverse.js +1 -1
  83. package/src/utility.js +89 -52
  84. package/test/api.test.js +31 -29
  85. package/test/apiUtility.test.js +43 -44
  86. package/test/browser.core.test.js +141 -131
  87. package/test/browser.domUtility.test.js +52 -35
  88. package/test/browser.predicates.test.js +13 -13
  89. package/test/browser.rollbar.test.js +597 -503
  90. package/test/browser.telemetry.test.js +76 -0
  91. package/test/browser.transforms.test.js +146 -128
  92. package/test/browser.transport.test.js +54 -46
  93. package/test/browser.url.test.js +12 -11
  94. package/test/fixtures/locals.fixtures.js +245 -126
  95. package/test/notifier.test.js +90 -78
  96. package/test/predicates.test.js +260 -214
  97. package/test/queue.test.js +230 -214
  98. package/test/rateLimiter.test.js +50 -42
  99. package/test/react-native.rollbar.test.js +149 -115
  100. package/test/react-native.transforms.test.js +21 -23
  101. package/test/react-native.transport.test.js +23 -11
  102. package/test/server.lambda.test.js +70 -53
  103. package/test/server.locals.test.js +437 -210
  104. package/test/server.parser.test.js +32 -26
  105. package/test/server.predicates.test.js +45 -43
  106. package/test/server.rollbar.test.js +311 -259
  107. package/test/server.telemetry.test.js +208 -83
  108. package/test/server.transforms.test.js +455 -361
  109. package/test/server.transport.test.js +144 -76
  110. package/test/telemetry.test.js +46 -37
  111. package/test/transforms.test.js +68 -66
  112. package/test/truncation.test.js +55 -53
  113. package/test/utility.test.js +266 -222
  114. package/webpack.config.js +46 -43
  115. package/.gitmodules +0 -3
  116. package/browserstack.browsers.js +0 -153
  117. package/browserstack.browsers.json +0 -4384
@@ -1,72 +1,78 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  var assert = require('assert');
4
4
  var vows = require('vows');
5
5
  var p = require('../src/server/parser');
6
6
 
7
- vows.describe('parser')
7
+ vows
8
+ .describe('parser')
8
9
  .addBatch({
9
- 'parseStack': {
10
+ parseStack: {
10
11
  'a valid stack trace': {
11
- topic: function() {
12
- var item = { diagnostic: {} }
13
- var stack = 'ReferenceError: foo is not defined\n' +
14
- ' at MethodClass.method.<anonymous> (app/server.js:2:4)\n' +
15
- ' at /app/node_modules/client.js:321:23\n' +
16
- ' at (/app/node_modules/client.js:321:23)\n' +
17
- ' at MethodClass.method.(anonymous) (app/server.js:62:14)\n' +
18
- ' at MethodClass.method (app/server.ts:52:4)\n' +
19
- ' at MethodClass.method (app/server.js:62:14)\n';
12
+ topic: function () {
13
+ var item = { diagnostic: {} };
14
+ var stack =
15
+ 'ReferenceError: foo is not defined\n' +
16
+ ' at MethodClass.method.<anonymous> (app/server.js:2:4)\n' +
17
+ ' at /app/node_modules/client.js:321:23\n' +
18
+ ' at (/app/node_modules/client.js:321:23)\n' +
19
+ ' at MethodClass.method.(anonymous) (app/server.js:62:14)\n' +
20
+ ' at MethodClass.method (app/server.ts:52:4)\n' +
21
+ ' at MethodClass.method (app/server.js:62:14)\n';
20
22
  p.parseStack(stack, {}, item, this.callback);
21
23
  },
22
- 'should parse valid js frame': function(err, frames) {
24
+ 'should parse valid js frame': function (err, frames) {
23
25
  var frame = frames[0];
24
26
  assert.ifError(err);
25
27
  assert.equal(frame.method, 'MethodClass.method');
26
28
  assert.equal(frame.filename, 'app/server.js');
27
29
  assert.equal(frame.lineno, 62);
28
- assert.equal(frame.colno, 14-1);
30
+ assert.equal(frame.colno, 14 - 1);
29
31
  },
30
- 'should parse valid ts frame': function(err, frames) {
32
+ 'should parse valid ts frame': function (err, frames) {
31
33
  var frame = frames[1];
32
34
  assert.ifError(err);
33
35
  assert.equal(frame.method, 'MethodClass.method');
34
36
  assert.equal(frame.filename, 'app/server.ts');
35
37
  assert.equal(frame.lineno, 52);
36
- assert.equal(frame.colno, 4-1);
38
+ assert.equal(frame.colno, 4 - 1);
37
39
  },
38
- 'should parse method with parens': function(err, frames) {
40
+ 'should parse method with parens': function (err, frames) {
39
41
  var frame = frames[2];
40
42
  assert.ifError(err);
41
43
  assert.equal(frame.method, 'MethodClass.method.(anonymous)');
42
44
  assert.equal(frame.filename, 'app/server.js');
43
45
  assert.equal(frame.lineno, 62);
44
- assert.equal(frame.colno, 14-1);
46
+ assert.equal(frame.colno, 14 - 1);
45
47
  },
46
- 'should parse without method and with leading slash': function(err, frames) {
48
+ 'should parse without method and with leading slash': function (
49
+ err,
50
+ frames,
51
+ ) {
47
52
  var frame = frames[3];
48
53
  assert.ifError(err);
49
54
  assert.equal(frame.method, '<unknown>');
50
55
  assert.equal(frame.filename, '/app/node_modules/client.js');
51
56
  assert.equal(frame.lineno, 321);
52
- assert.equal(frame.colno, 23-1);
57
+ assert.equal(frame.colno, 23 - 1);
53
58
  },
54
- 'should parse without method or parens': function(err, frames) {
59
+ 'should parse without method or parens': function (err, frames) {
55
60
  var frame = frames[4];
56
61
  assert.ifError(err);
57
62
  assert.equal(frame.method, '<unknown>');
58
63
  assert.equal(frame.filename, '/app/node_modules/client.js');
59
64
  assert.equal(frame.lineno, 321);
60
- assert.equal(frame.colno, 23-1);
65
+ assert.equal(frame.colno, 23 - 1);
61
66
  },
62
- 'should parse method with angle brackets': function(err, frames) {
67
+ 'should parse method with angle brackets': function (err, frames) {
63
68
  var frame = frames[5];
64
69
  assert.ifError(err);
65
70
  assert.equal(frame.method, 'MethodClass.method.<anonymous>');
66
71
  assert.equal(frame.filename, 'app/server.js');
67
72
  assert.equal(frame.lineno, 2);
68
- assert.equal(frame.colno, 4-1);
73
+ assert.equal(frame.colno, 4 - 1);
69
74
  },
70
75
  },
71
- }
72
- }).export(module, {error: false});;
76
+ },
77
+ })
78
+ .export(module, { error: false });
@@ -1,89 +1,91 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  var assert = require('assert');
4
4
  var vows = require('vows');
5
5
  var p = require('../src/predicates');
6
6
 
7
- vows.describe('predicates')
7
+ vows
8
+ .describe('predicates')
8
9
  .addBatch({
9
- 'checkLevel': {
10
+ checkLevel: {
10
11
  'an item without a level': {
11
- topic: function() {
12
- return {body: 'nothing'};
12
+ topic: function () {
13
+ return { body: 'nothing' };
13
14
  },
14
15
  'settings with a critical reportLevel': {
15
- topic: function(item) {
16
- var settings = {reportLevel: 'critical'};
16
+ topic: function (item) {
17
+ var settings = { reportLevel: 'critical' };
17
18
  return p.checkLevel(item, settings);
18
19
  },
19
- 'should not send': function(topic) {
20
+ 'should not send': function (topic) {
20
21
  assert.isFalse(topic);
21
- }
22
- }
22
+ },
23
+ },
23
24
  },
24
25
  'an item with an unknown level': {
25
- topic: function() {
26
- return {level: 'wooo'};
26
+ topic: function () {
27
+ return { level: 'wooo' };
27
28
  },
28
29
  'settings with an error reportLevel': {
29
- topic: function(item) {
30
- var settings = {reportLevel: 'error'};
30
+ topic: function (item) {
31
+ var settings = { reportLevel: 'error' };
31
32
  return p.checkLevel(item, settings);
32
33
  },
33
- 'should not send': function(topic) {
34
+ 'should not send': function (topic) {
34
35
  assert.isFalse(topic);
35
- }
36
+ },
36
37
  },
37
38
  'settings with an unknown reportLevel': {
38
- topic: function(item) {
39
- var settings = {reportLevel: 'yesss'};
39
+ topic: function (item) {
40
+ var settings = { reportLevel: 'yesss' };
40
41
  return p.checkLevel(item, settings);
41
42
  },
42
- 'should send': function(topic) {
43
+ 'should send': function (topic) {
43
44
  assert.isTrue(topic);
44
- }
45
+ },
45
46
  },
46
47
  'settings without a reportLevel': {
47
- topic: function(item) {
48
- var settings = {nothing: 'to see here'};
48
+ topic: function (item) {
49
+ var settings = { nothing: 'to see here' };
49
50
  return p.checkLevel(item, settings);
50
51
  },
51
- 'should send': function(topic) {
52
+ 'should send': function (topic) {
52
53
  assert.isTrue(topic);
53
- }
54
- }
54
+ },
55
+ },
55
56
  },
56
57
  'an item with a warning level': {
57
- topic: function() {
58
- return {level: 'warning'};
58
+ topic: function () {
59
+ return { level: 'warning' };
59
60
  },
60
61
  'settings with an error reportLevel': {
61
- topic: function(item) {
62
- var settings = {reportLevel: 'error'};
62
+ topic: function (item) {
63
+ var settings = { reportLevel: 'error' };
63
64
  return p.checkLevel(item, settings);
64
65
  },
65
- 'should not send': function(topic) {
66
+ 'should not send': function (topic) {
66
67
  assert.isFalse(topic);
67
- }
68
+ },
68
69
  },
69
70
  'settings with an info reportLevel': {
70
- topic: function(item) {
71
- var settings = {reportLevel: 'info'};
71
+ topic: function (item) {
72
+ var settings = { reportLevel: 'info' };
72
73
  return p.checkLevel(item, settings);
73
74
  },
74
- 'should send': function(topic) {
75
+ 'should send': function (topic) {
75
76
  assert.isTrue(topic);
76
- }
77
+ },
77
78
  },
78
79
  'settings with a warning reportLevel': {
79
- topic: function(item) {
80
- var settings = {reportLevel: 'warning'};
80
+ topic: function (item) {
81
+ var settings = { reportLevel: 'warning' };
81
82
  return p.checkLevel(item, settings);
82
83
  },
83
- 'should send': function(topic) {
84
+ 'should send': function (topic) {
84
85
  assert.isTrue(topic);
85
- }
86
- }
87
- }
88
- }
89
- }).export(module, {error: false});
86
+ },
87
+ },
88
+ },
89
+ },
90
+ })
91
+ .export(module, { error: false });