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
package/index.d.ts CHANGED
@@ -4,255 +4,294 @@
4
4
  export = Rollbar;
5
5
 
6
6
  declare class Rollbar {
7
- constructor(options?: Rollbar.Configuration);
8
- static init(options: Rollbar.Configuration): Rollbar;
9
- static setComponents(components: Rollbar.Components): void;
7
+ constructor(options?: Rollbar.Configuration);
8
+ static init(options: Rollbar.Configuration): Rollbar;
9
+ static setComponents(components: Rollbar.Components): void;
10
10
 
11
- public global(options: Rollbar.Configuration): Rollbar;
12
- public configure(options: Rollbar.Configuration): Rollbar;
13
- public lastError(): Rollbar.MaybeError;
11
+ public global(options: Rollbar.Configuration): Rollbar;
12
+ public configure(options: Rollbar.Configuration): Rollbar;
13
+ public lastError(): Rollbar.MaybeError;
14
14
 
15
- public log(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
16
- public debug(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
17
- public info(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
18
- public warn(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
19
- public warning(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
20
- public error(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
21
- public critical(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
22
- public wait(callback: () => void): void;
15
+ public log(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
16
+ public debug(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
17
+ public info(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
18
+ public warn(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
19
+ public warning(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
20
+ public error(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
21
+ public critical(...args: Rollbar.LogArgument[]): Rollbar.LogResult;
22
+ public wait(callback: () => void): void;
23
23
 
24
- public captureEvent(metadata: object, level: Rollbar.Level): Rollbar.TelemetryEvent;
24
+ public captureEvent(
25
+ metadata: object,
26
+ level: Rollbar.Level,
27
+ ): Rollbar.TelemetryEvent;
25
28
 
26
- public lambdaHandler<T = object>(handler: Rollbar.LambdaHandler<T>): Rollbar.LambdaHandler<T>;
29
+ public lambdaHandler<T = object>(
30
+ handler: Rollbar.LambdaHandler<T>,
31
+ ): Rollbar.LambdaHandler<T>;
27
32
 
28
- public errorHandler(): Rollbar.ExpressErrorHandler;
33
+ public errorHandler(): Rollbar.ExpressErrorHandler;
29
34
 
30
- // Used with rollbar-react for rollbar-react-native compatibility.
31
- public rollbar: Rollbar;
35
+ // Used with rollbar-react for rollbar-react-native compatibility.
36
+ public rollbar: Rollbar;
32
37
 
33
- // Exposed only for testing, should be changed via the configure method
34
- // DO NOT MODIFY DIRECTLY
35
- public options: Rollbar.Configuration;
38
+ // Exposed only for testing, should be changed via the configure method
39
+ // DO NOT MODIFY DIRECTLY
40
+ public options: Rollbar.Configuration;
36
41
  }
37
42
 
38
43
  declare namespace Rollbar {
39
- export type LambdaHandler<TEvent = any, TResult = any, TContext = any> = (
40
- event: TEvent,
41
- context: TContext,
42
- callback: Callback<TResult>,
43
- ) => void | Promise<TResult>;
44
- export type MaybeError = Error | undefined | null;
45
- export type Level = "debug" | "info" | "warning" | "error" | "critical";
46
- export type Dictionary = { [key: string]: unknown};
44
+ export type LambdaHandler<TEvent = any, TResult = any, TContext = any> = (
45
+ event: TEvent,
46
+ context: TContext,
47
+ callback: Callback<TResult>,
48
+ ) => void | Promise<TResult>;
49
+ export type MaybeError = Error | undefined | null;
50
+ export type Level = 'debug' | 'info' | 'warning' | 'error' | 'critical';
51
+ export type Dictionary = { [key: string]: unknown };
52
+ /**
53
+ * {@link https://docs.rollbar.com/docs/rollbarjs-configuration-reference#reference}
54
+ */
55
+ export interface Configuration {
56
+ accessToken?: string;
57
+ addErrorContext?: boolean;
58
+ addRequestData?: (data: Dictionary, req: Dictionary) => void;
59
+ autoInstrument?: AutoInstrumentOptions;
60
+ captureDeviceInfo?: boolean;
61
+ captureEmail?: boolean;
62
+ captureIp?: boolean | 'anonymize';
63
+ captureLambdaTimeouts?: boolean;
64
+ captureUncaught?: boolean;
65
+ captureUnhandledRejections?: boolean;
66
+ captureUsername?: boolean;
67
+ checkIgnore?: (
68
+ isUncaught: boolean,
69
+ args: LogArgument[],
70
+ item: Dictionary,
71
+ ) => boolean;
47
72
  /**
48
- * {@link https://docs.rollbar.com/docs/rollbarjs-configuration-reference#reference}
73
+ * `codeVersion` takes precedence over `code_version`, if provided.
74
+ * `client.javascript.code_version` takes precedence over both top level properties.
49
75
  */
50
- export interface Configuration {
51
- accessToken?: string;
52
- addErrorContext?: boolean;
53
- addRequestData?: (data: Dictionary, req: Dictionary) => void;
54
- autoInstrument?: AutoInstrumentOptions;
55
- captureDeviceInfo?: boolean;
56
- captureEmail?: boolean;
57
- captureIp?: boolean | "anonymize";
58
- captureLambdaTimeouts?: boolean;
59
- captureUncaught?: boolean;
60
- captureUnhandledRejections?: boolean;
61
- captureUsername?: boolean;
62
- checkIgnore?: (isUncaught: boolean, args: LogArgument[], item: Dictionary) => boolean;
63
- /**
64
- * `codeVersion` takes precedence over `code_version`, if provided.
65
- * `client.javascript.code_version` takes precedence over both top level properties.
66
- */
67
- codeVersion?: string;
68
- /**
69
- * `codeVersion` takes precedence over `code_version`, if provided.
70
- * `client.javascript.code_version` takes precedence over both top level properties.
71
- */
72
- code_version?: string;
73
- enabled?: boolean;
74
- endpoint?: string;
75
- exitOnUncaughtException?: boolean;
76
- environment?: string;
77
- filterTelemetry?: (e: TelemetryEvent) => boolean;
78
- host?: string; // used in node only
79
- hostBlackList?: string[]; // deprecated
80
- hostBlockList?: string[];
81
- hostWhiteList?: string[]; // deprecated
82
- hostSafeList?: string[];
83
- ignoredMessages?: (string | RegExp)[];
84
- ignoreDuplicateErrors?: boolean;
85
- includeItemsInTelemetry?: boolean;
86
- inspectAnonymousErrors?: boolean;
87
- itemsPerMinute?: number;
88
- locals?: LocalsOptions;
89
- logLevel?: Level;
90
- maxItems?: number;
91
- maxRetries?: number;
92
- maxTelemetryEvents?: number;
93
- nodeSourceMaps?: boolean;
94
- onSendCallback?: (isUncaught: boolean, args: LogArgument[], item: Dictionary) => void;
95
- overwriteScrubFields?: boolean;
96
- payload?: Payload;
97
- reportLevel?: Level;
98
- retryInterval?: number | null;
99
- rewriteFilenamePatterns?: string[];
100
- scrubFields?: string[];
101
- scrubHeaders?: string[];
102
- scrubPaths?: string[];
103
- scrubRequestBody?: boolean;
104
- scrubTelemetryInputs?: boolean;
105
- sendConfig?: boolean;
106
- stackTraceLimit?: number;
107
- telemetryScrubber?: TelemetryScrubber;
108
- timeout?: number;
109
- transform?: (data: Dictionary, item: Dictionary) => void | Promise<void>;
110
- transmit?: boolean;
111
- uncaughtErrorLevel?: Level;
112
- verbose?: boolean;
113
- version?: string;
114
- wrapGlobalEventHandlers?: boolean;
115
- }
116
- export type Callback<TResponse = any> = (err: MaybeError, response: TResponse) => void;
117
- export type LogArgument = string | Error | object | Dictionary | Callback | Date | any[] | undefined;
118
- export interface LogResult {
119
- uuid: string;
120
- }
121
- export interface TelemetryEvent {
122
- level: Level;
123
- type: string;
124
- timestamp_ms: number;
125
- body: Dictionary;
126
- source: string;
127
- uuid?: string;
128
- }
129
- export type AutoInstrumentOptions = boolean | AutoInstrumentSettings;
130
- export interface AutoInstrumentSettings {
131
- network?: boolean;
132
- networkResponseHeaders?: boolean | string[];
133
- networkResponseBody?: boolean;
134
- networkRequestBody?: boolean;
135
- log?: boolean;
136
- dom?: boolean;
137
- navigation?: boolean;
138
- connectivity?: boolean;
139
- contentSecurityPolicy?: boolean;
140
- errorOnContentSecurityPolicy?: boolean;
141
- }
142
- export type TelemetryScrubber = (description: TelemetryScrubberInput) => boolean;
143
- export type TelemetryScrubberInput = DomDescription | null;
144
- export interface DomDescription {
145
- tagName: string;
146
- id: string | undefined;
147
- classes: string[] | undefined;
148
- attributes: DomAttribute[];
149
- }
150
- export type DomAttributeKey = "type" | "name" | "title" | "alt";
151
- export interface DomAttribute {
152
- key: DomAttributeKey;
153
- value: string;
154
- }
155
- export type ExpressErrorHandler = (err: any, request: any, response: any, next: ExpressNextFunction) => any;
156
- export interface ExpressNextFunction {
157
- (err?: any): void;
158
- }
159
- class Locals {}
160
- export type LocalsType = typeof Locals;
161
- export type LocalsOptions = LocalsType | LocalsSettings;
162
- export interface LocalsSettings {
163
- module: LocalsType,
164
- enabled?: boolean;
165
- uncaughtOnly?: boolean;
166
- depth?: number;
167
- maxProperties?: number;
168
- maxArray?: number;
169
- }
76
+ codeVersion?: string;
77
+ /**
78
+ * `codeVersion` takes precedence over `code_version`, if provided.
79
+ * `client.javascript.code_version` takes precedence over both top level properties.
80
+ */
81
+ code_version?: string;
82
+ enabled?: boolean;
83
+ endpoint?: string;
84
+ exitOnUncaughtException?: boolean;
85
+ environment?: string;
86
+ filterTelemetry?: (e: TelemetryEvent) => boolean;
87
+ host?: string; // used in node only
88
+ hostBlackList?: string[]; // deprecated
89
+ hostBlockList?: string[];
90
+ hostWhiteList?: string[]; // deprecated
91
+ hostSafeList?: string[];
92
+ ignoredMessages?: (string | RegExp)[];
93
+ ignoreDuplicateErrors?: boolean;
94
+ includeItemsInTelemetry?: boolean;
95
+ inspectAnonymousErrors?: boolean;
96
+ itemsPerMinute?: number;
97
+ locals?: LocalsOptions;
98
+ logLevel?: Level;
99
+ maxItems?: number;
100
+ maxRetries?: number;
101
+ maxTelemetryEvents?: number;
102
+ nodeSourceMaps?: boolean;
103
+ onSendCallback?: (
104
+ isUncaught: boolean,
105
+ args: LogArgument[],
106
+ item: Dictionary,
107
+ ) => void;
108
+ overwriteScrubFields?: boolean;
109
+ payload?: Payload;
110
+ reportLevel?: Level;
111
+ retryInterval?: number | null;
112
+ rewriteFilenamePatterns?: string[];
113
+ scrubFields?: string[];
114
+ scrubHeaders?: string[];
115
+ scrubPaths?: string[];
116
+ scrubRequestBody?: boolean;
117
+ scrubTelemetryInputs?: boolean;
118
+ sendConfig?: boolean;
119
+ stackTraceLimit?: number;
120
+ telemetryScrubber?: TelemetryScrubber;
121
+ timeout?: number;
122
+ transform?: (data: Dictionary, item: Dictionary) => void | Promise<void>;
123
+ transmit?: boolean;
124
+ uncaughtErrorLevel?: Level;
125
+ verbose?: boolean;
126
+ version?: string;
127
+ wrapGlobalEventHandlers?: boolean;
128
+ }
129
+ export type Callback<TResponse = any> = (
130
+ err: MaybeError,
131
+ response: TResponse,
132
+ ) => void;
133
+ export type LogArgument =
134
+ | string
135
+ | Error
136
+ | object
137
+ | Dictionary
138
+ | Callback
139
+ | Date
140
+ | any[]
141
+ | undefined;
142
+ export interface LogResult {
143
+ uuid: string;
144
+ }
145
+ export interface TelemetryEvent {
146
+ level: Level;
147
+ type: string;
148
+ timestamp_ms: number;
149
+ body: Dictionary;
150
+ source: string;
151
+ uuid?: string;
152
+ }
153
+ export type AutoInstrumentOptions = boolean | AutoInstrumentSettings;
154
+ export interface AutoInstrumentSettings {
155
+ network?: boolean;
156
+ networkResponseHeaders?: boolean | string[];
157
+ networkResponseBody?: boolean;
158
+ networkRequestBody?: boolean;
159
+ log?: boolean;
160
+ dom?: boolean;
161
+ navigation?: boolean;
162
+ connectivity?: boolean;
163
+ contentSecurityPolicy?: boolean;
164
+ errorOnContentSecurityPolicy?: boolean;
165
+ }
166
+ export type TelemetryScrubber = (
167
+ description: TelemetryScrubberInput,
168
+ ) => boolean;
169
+ export type TelemetryScrubberInput = DomDescription | null;
170
+ export interface DomDescription {
171
+ tagName: string;
172
+ id: string | undefined;
173
+ classes: string[] | undefined;
174
+ attributes: DomAttribute[];
175
+ }
176
+ export type DomAttributeKey = 'type' | 'name' | 'title' | 'alt';
177
+ export interface DomAttribute {
178
+ key: DomAttributeKey;
179
+ value: string;
180
+ }
181
+ export type ExpressErrorHandler = (
182
+ err: any,
183
+ request: any,
184
+ response: any,
185
+ next: ExpressNextFunction,
186
+ ) => any;
187
+ export interface ExpressNextFunction {
188
+ (err?: any): void;
189
+ }
190
+ class Locals {}
191
+ export type LocalsType = typeof Locals;
192
+ export type LocalsOptions = LocalsType | LocalsSettings;
193
+ export interface LocalsSettings {
194
+ module: LocalsType;
195
+ enabled?: boolean;
196
+ uncaughtOnly?: boolean;
197
+ depth?: number;
198
+ maxProperties?: number;
199
+ maxArray?: number;
200
+ }
170
201
 
171
- class Telemeter {}
172
- class Instrumenter {}
202
+ class Telemeter {}
203
+ class Instrumenter {}
173
204
 
174
- export type TelemeterType = typeof Telemeter;
175
- export type InstrumenterType = typeof Instrumenter;
176
- export type TruncationType = object;
177
- export type ScrubType = (data: object, scrubFields?: string[], scrubPaths?: string[]) => object;
178
- export type WrapGlobalsType = (window?: any, handler?: any, shim?: any) => void;
179
- export type PolyfillJSONType = (JSON: any) => any;
205
+ export type TelemeterType = typeof Telemeter;
206
+ export type InstrumenterType = typeof Instrumenter;
207
+ export type TruncationType = object;
208
+ export type ScrubType = (
209
+ data: object,
210
+ scrubFields?: string[],
211
+ scrubPaths?: string[],
212
+ ) => object;
213
+ export type WrapGlobalsType = (
214
+ window?: any,
215
+ handler?: any,
216
+ shim?: any,
217
+ ) => void;
218
+ export type PolyfillJSONType = (JSON: any) => any;
180
219
 
181
- export interface Components {
182
- telemeter?: TelemeterType,
183
- instrumenter?: InstrumenterType,
184
- polyfillJSON?: PolyfillJSONType,
185
- wrapGlobals?: WrapGlobalsType,
186
- scrub?: ScrubType,
187
- truncation?: TruncationType
188
- }
220
+ export interface Components {
221
+ telemeter?: TelemeterType;
222
+ instrumenter?: InstrumenterType;
223
+ polyfillJSON?: PolyfillJSONType;
224
+ wrapGlobals?: WrapGlobalsType;
225
+ scrub?: ScrubType;
226
+ truncation?: TruncationType;
227
+ }
189
228
 
190
- /**
191
- * @deprecated number is deprecated for this field
192
- */
193
- export type DeprecatedNumber = number;
229
+ /**
230
+ * @deprecated number is deprecated for this field
231
+ */
232
+ export type DeprecatedNumber = number;
194
233
 
195
- /**
196
- * {@link https://docs.rollbar.com/docs/rollbarjs-configuration-reference#payload-1}
197
- */
198
- export interface Payload {
199
- person?: {
200
- id: string | DeprecatedNumber | null;
201
- username?: string;
202
- email?: string;
203
- [property: string]: any;
204
- },
205
- context?: any;
206
- client?: {
207
- javascript?: {
208
- /**
209
- * Version control number (i.e. git SHA) of the current revision. Used for linking filenames in stacktraces to GitHub.
210
- * Note: for the purposes of nesting under the payload key, only code_version will correctly set the value in the final item.
211
- * However, if you wish to set this code version at the top level of the configuration object rather than nested under
212
- * the payload key, we will accept both codeVersion and code_version with codeVersion given preference if both happened
213
- * to be defined. Furthermore, if code_version is nested under the payload key this will have the final preference over
214
- * any value set at the top level.
215
- */
216
- code_version?: string | DeprecatedNumber;
217
- /**
218
- * When true, the Rollbar service will attempt to find and apply source maps to all frames in the stack trace.
219
- * @default false
220
- */
221
- source_map_enabled?: boolean;
222
- /**
223
- * When true, the Rollbar service will attempt to apply source maps to frames even if they are missing column numbers.
224
- * Works best when the minified javascript file is generated using newlines instead of semicolons.
225
- * @default false
226
- */
227
- guess_uncaught_frames?: boolean;
228
- [property: string]: any;
229
- }
230
- [property: string]: any;
231
- },
234
+ /**
235
+ * {@link https://docs.rollbar.com/docs/rollbarjs-configuration-reference#payload-1}
236
+ */
237
+ export interface Payload {
238
+ person?: {
239
+ id: string | DeprecatedNumber | null;
240
+ username?: string;
241
+ email?: string;
242
+ [property: string]: any;
243
+ };
244
+ context?: any;
245
+ client?: {
246
+ javascript?: {
247
+ /**
248
+ * Version control number (i.e. git SHA) of the current revision. Used for linking filenames in stacktraces to GitHub.
249
+ * Note: for the purposes of nesting under the payload key, only code_version will correctly set the value in the final item.
250
+ * However, if you wish to set this code version at the top level of the configuration object rather than nested under
251
+ * the payload key, we will accept both codeVersion and code_version with codeVersion given preference if both happened
252
+ * to be defined. Furthermore, if code_version is nested under the payload key this will have the final preference over
253
+ * any value set at the top level.
254
+ */
255
+ code_version?: string | DeprecatedNumber;
232
256
  /**
233
- * The environment that your code is running in.
234
- * @default undefined
257
+ * When true, the Rollbar service will attempt to find and apply source maps to all frames in the stack trace.
258
+ * @default false
235
259
  */
236
- environment?: string;
237
- server?: {
238
- /**
239
- * @default master
240
- */
241
- branch?: string;
242
- /**
243
- * The hostname of the machine that rendered the page.
244
- */
245
- host?: string;
246
- /**
247
- * It is used in two different ways: `source maps`, and `source control`.
248
- *
249
- * If you are looking for more information on it please go to:
250
- * {@link https://docs.rollbar.com/docs/source-maps}
251
- * {@link https://docs.rollbar.com/docs/source-control}
252
- */
253
- root?: string;
254
- [property: string]: any;
255
- },
260
+ source_map_enabled?: boolean;
261
+ /**
262
+ * When true, the Rollbar service will attempt to apply source maps to frames even if they are missing column numbers.
263
+ * Works best when the minified javascript file is generated using newlines instead of semicolons.
264
+ * @default false
265
+ */
266
+ guess_uncaught_frames?: boolean;
256
267
  [property: string]: any;
257
- }
268
+ };
269
+ [property: string]: any;
270
+ };
271
+ /**
272
+ * The environment that your code is running in.
273
+ * @default undefined
274
+ */
275
+ environment?: string;
276
+ server?: {
277
+ /**
278
+ * @default master
279
+ */
280
+ branch?: string;
281
+ /**
282
+ * The hostname of the machine that rendered the page.
283
+ */
284
+ host?: string;
285
+ /**
286
+ * It is used in two different ways: `source maps`, and `source control`.
287
+ *
288
+ * If you are looking for more information on it please go to:
289
+ * {@link https://docs.rollbar.com/docs/source-maps}
290
+ * {@link https://docs.rollbar.com/docs/source-control}
291
+ */
292
+ root?: string;
293
+ [property: string]: any;
294
+ };
295
+ [property: string]: any;
296
+ }
258
297
  }
package/karma.conf.js CHANGED
@@ -1,43 +1,25 @@
1
1
  var path = require('path');
2
2
  var webpack = require('webpack');
3
3
  var defaults = require('./defaults');
4
- var browserStackBrowsers = require('./browserstack.browsers');
5
4
 
6
5
  var defaultsPlugin = new webpack.DefinePlugin(defaults);
7
6
 
8
- var allBrowsers = browserStackBrowsers.filter('bs_all');
9
- var allBrowsersByBrowser = {
10
- // Travis needs the --no-sandbox option,
11
- // so add as a custom launcher to be used as the default browser.
12
- ChromeNoSandbox: {
13
- base: 'ChromeHeadless',
14
- flags: ['--no-sandbox']
15
- }
16
- };
17
- allBrowsers.forEach(function(browser) {
18
- allBrowsersByBrowser[browser._alias] = browser;
19
- });
20
-
21
-
22
7
  module.exports = function (config) {
23
8
  config.set({
24
- browsers: ['ChromeNoSandbox'],
9
+ browsers: ['ChromeHeadless'],
25
10
 
26
11
  // The Travis environment has these specified.
27
12
  // To run BrowserStack tests locally, specify the environment variables:
28
13
  // BROWSER_STACK_USERNAME, BROWSER_STACK_ACCESS_KEY
29
14
  browserStack: {
30
15
  username: null,
31
- accessKey: null
16
+ accessKey: null,
32
17
  },
33
18
 
34
19
  client: {
35
- captureConsole: true
20
+ captureConsole: true,
36
21
  },
37
22
 
38
- // Used for testing on BrowserStack
39
- customLaunchers: allBrowsersByBrowser,
40
-
41
23
  // Files are specified in the grunt-karma configuration in Gruntfile.js
42
24
  //files: []
43
25
 
@@ -51,12 +33,12 @@ module.exports = function (config) {
51
33
  // run the bundle through the webpack and sourcemap plugins
52
34
  preprocessors: {
53
35
  'test/**/!(requirejs).test.js': ['webpack', 'sourcemap'],
54
- '**/*.html': ['html2js']
36
+ '**/*.html': ['html2js'],
55
37
  },
56
38
 
57
39
  proxies: {
58
40
  '/dist/': '/base/dist/',
59
- '/examples/': '/base/examples/'
41
+ '/examples/': '/base/examples/',
60
42
  },
61
43
 
62
44
  customHeaders: [
@@ -65,8 +47,8 @@ module.exports = function (config) {
65
47
  {
66
48
  match: '\\.html',
67
49
  name: 'Content-Security-Policy',
68
- value: "default-src 'self' 'unsafe-inline' 'unsafe-eval';"
69
- }
50
+ value: "default-src 'self' 'unsafe-inline' 'unsafe-eval';",
51
+ },
70
52
  ],
71
53
 
72
54
  reporters: ['progress'],
@@ -89,30 +71,30 @@ module.exports = function (config) {
89
71
  loader: 'eslint-loader',
90
72
  exclude: [/node_modules/, /vendor/, /lib/, /dist/],
91
73
  options: {
92
- configFile: path.resolve(__dirname, '.eslintrc')
93
- }
74
+ configFile: path.resolve(__dirname, '.eslintrc'),
75
+ },
94
76
  },
95
77
  {
96
78
  test: /\.js$/,
97
79
  loader: 'strict-loader',
98
- exclude: [/node_modules/, /vendor/, /lib/, /dist/, /test/]
80
+ exclude: [/node_modules/, /vendor/, /lib/, /dist/, /test/],
99
81
  },
100
82
  {
101
83
  test: /(mootootls|requirejs)\.js$/,
102
- loader: 'script'
84
+ loader: 'script',
103
85
  },
104
86
  {
105
87
  enforce: 'post',
106
88
  test: /\.js$/,
107
89
  exclude: [/node_modules/, /vendor/, /lib/, /dist/, /test/],
108
- loader: 'istanbul-instrumenter-loader'
109
- }
90
+ loader: 'coverage-istanbul-loader',
91
+ },
110
92
  ],
111
- }
93
+ },
112
94
  },
113
95
 
114
96
  webpackMiddleware: {
115
- noInfo: true
116
- }
97
+ noInfo: true,
98
+ },
117
99
  });
118
100
  };