@honeybadger-io/js 4.0.0 → 4.0.3

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.
@@ -598,7 +598,7 @@ function isBrowserConfig(config) {
598
598
  return config.async !== undefined;
599
599
  }
600
600
 
601
- var GlobalStore$1 = /** @class */ (function () {
601
+ var GlobalStore = /** @class */ (function () {
602
602
  function GlobalStore(store) {
603
603
  this.store = store;
604
604
  }
@@ -619,7 +619,7 @@ var GlobalStore$1 = /** @class */ (function () {
619
619
  var notifier = {
620
620
  name: 'honeybadger-js',
621
621
  url: 'https://github.com/honeybadger-io/honeybadger-js',
622
- version: '4.0.0'
622
+ version: '4.0.3'
623
623
  };
624
624
  // Split at commas and spaces
625
625
  var TAG_SEPARATOR = /,|\s+/;
@@ -635,7 +635,7 @@ var Client = /** @class */ (function () {
635
635
  this.config = __assign({ apiKey: null, endpoint: 'https://api.honeybadger.io', environment: null, hostname: null, projectRoot: null, component: null, action: null, revision: null, reportData: null, breadcrumbsEnabled: true, maxBreadcrumbs: 40, maxObjectDepth: 8, logger: console, developmentEnvironments: ['dev', 'development', 'test'], debug: false, tags: null, enableUncaught: true, enableUnhandledRejection: true, afterUncaught: function () { return true; }, filters: ['creditcard', 'password'], __plugins: [] }, opts);
636
636
  // First, we go with the global (shared) store.
637
637
  // Webserver middleware can then switch to the AsyncStore for async context tracking.
638
- this.__store = new GlobalStore$1({ context: {}, breadcrumbs: [] });
638
+ this.__store = new GlobalStore({ context: {}, breadcrumbs: [] });
639
639
  this.__transport = transport;
640
640
  this.logger = logger(this);
641
641
  }
@@ -1033,9 +1033,7 @@ try {
1033
1033
  Store = new AsyncLocalStorage();
1034
1034
  }
1035
1035
  catch (e) {
1036
- // eslint-disable-next-line @typescript-eslint/no-var-requires
1037
- var GlobalStore = require('../core/store').GlobalStore;
1038
- Store = new GlobalStore();
1036
+ Store = new GlobalStore({ context: {}, breadcrumbs: [] });
1039
1037
  }
1040
1038
  var AsyncStore = Store;
1041
1039
 
@@ -1301,6 +1299,7 @@ var Honeybadger = /** @class */ (function (_super) {
1301
1299
  return _this;
1302
1300
  }
1303
1301
  Honeybadger.prototype.factory = function (opts) {
1302
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1304
1303
  return new Honeybadger(opts);
1305
1304
  };
1306
1305
  Honeybadger.prototype.configure = function (opts) {
@@ -3,9 +3,9 @@ import { BrowserConfig } from './core/types';
3
3
  declare class Honeybadger extends Client {
4
4
  config: BrowserConfig;
5
5
  constructor(opts?: Partial<BrowserConfig>);
6
- configure(opts?: Partial<BrowserConfig>): Client;
6
+ configure(opts?: Partial<BrowserConfig>): this;
7
7
  resetMaxErrors(): number;
8
- factory(opts?: Partial<BrowserConfig>): Honeybadger;
8
+ factory(opts?: Partial<BrowserConfig>): this;
9
9
  checkIn(_id: string): Promise<void>;
10
10
  }
11
11
  declare const _default: Honeybadger;
@@ -12,10 +12,10 @@ export default abstract class Client {
12
12
  config: Config;
13
13
  logger: Logger;
14
14
  protected constructor(opts: Partial<Config>, transport: Transport);
15
- protected abstract factory(opts: Partial<Config>): void;
15
+ protected abstract factory(opts: Partial<Config>): this;
16
16
  protected abstract checkIn(id: string): Promise<void>;
17
17
  getVersion(): string;
18
- configure(opts?: Partial<Config>): Client;
18
+ configure(opts?: Partial<Config>): this;
19
19
  beforeNotify(handler: BeforeNotifyHandler): Client;
20
20
  afterNotify(handler: AfterNotifyHandler): Client;
21
21
  setContext(context: Record<string, unknown>): Client;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import Client from './client';
3
- import { AsyncLocalStorage } from 'async_hooks';
3
+ /** @ts-ignore */
4
+ import type { AsyncLocalStorage } from 'async_hooks';
4
5
  export interface Logger {
5
6
  log(...args: unknown[]): unknown;
6
7
  info(...args: unknown[]): unknown;
@@ -1,4 +1,5 @@
1
- import { Handler, Callback, Context } from 'aws-lambda';
1
+ /** @ts-ignore */
2
+ import type { Handler, Callback, Context } from 'aws-lambda';
2
3
  export declare type SyncHandler<TEvent = any, TResult = any> = (event: TEvent, context: Context, callback: Callback<TResult>) => void;
3
4
  export declare type AsyncHandler<TEvent = any, TResult = any> = (event: TEvent, context: Context) => Promise<TResult>;
4
5
  export declare function lambdaHandler<TEvent = any, TResult = any>(handler: Handler<TEvent, TResult>): Handler<TEvent, TResult>;
@@ -8,8 +8,8 @@ declare class Honeybadger extends Client {
8
8
  lambdaHandler: typeof lambdaHandler;
9
9
  config: Config | ServerlessConfig;
10
10
  constructor(opts?: Partial<Config | ServerlessConfig>);
11
- factory(opts?: Partial<Config | ServerlessConfig>): Honeybadger;
12
- configure(opts?: Partial<Config | ServerlessConfig>): Honeybadger;
11
+ factory(opts?: Partial<Config | ServerlessConfig>): this;
12
+ configure(opts?: Partial<Config | ServerlessConfig>): this;
13
13
  checkIn(id: string): Promise<void>;
14
14
  withRequest<R>(request: Record<symbol, unknown>, handler: (...args: never[]) => R, onError?: (...args: unknown[]) => unknown): R | void;
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honeybadger-io/js",
3
- "version": "4.0.0",
3
+ "version": "4.0.3",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/honeybadger-io/honeybadger-js",
6
6
  "author": {
@@ -63,15 +63,15 @@
63
63
  "eslint-plugin-jest": "^26.0.0",
64
64
  "eslint-plugin-promise": "^6.0.0",
65
65
  "express": "^4.17.1",
66
- "husky": "^7.0.4",
66
+ "husky": "^8.0.1",
67
67
  "jest": "^27.4.4",
68
68
  "nock": "^13.2.1",
69
69
  "rollup": "^2.61.1",
70
70
  "rollup-plugin-uglify": "^6.0.2",
71
71
  "shipjs": "0.24.4",
72
- "sinon": "^13.0.1",
72
+ "sinon": "^14.0.0",
73
73
  "supertest": "^6.1.6",
74
- "ts-jest": "^27.1.1",
74
+ "ts-jest": "^28.0.2",
75
75
  "tsd": "^0.20.0",
76
76
  "tslib": "^2.3.1",
77
77
  "typescript": "^4.5.3"