@flareapp/js 1.1.0-rc.1 → 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.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  type Config = {
2
- key: string;
2
+ key: string | null;
3
3
  version: string;
4
4
  sourcemapVersion: string;
5
5
  stage: string;
@@ -77,16 +77,16 @@ type Glow = {
77
77
  type MessageLevel = 'info' | 'debug' | 'warning' | 'error' | 'critical';
78
78
 
79
79
  declare class Api {
80
- report(report: Report, url: string, key: string, reportBrowserExtensionErrors: boolean): Promise<void>;
80
+ report(report: Report, url: string, key: string | null, reportBrowserExtensionErrors: boolean): Promise<void>;
81
81
  }
82
82
 
83
83
  declare class Flare {
84
- http: Api;
84
+ api: Api;
85
85
  config: Config;
86
86
  glows: Glow[];
87
87
  context: Context;
88
88
  solutionProviders: SolutionProvider[];
89
- constructor(http?: Api);
89
+ constructor(api?: Api);
90
90
  light(key?: string, debug?: boolean): Flare;
91
91
  configure(config: Partial<Config>): Flare;
92
92
  test(): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  type Config = {
2
- key: string;
2
+ key: string | null;
3
3
  version: string;
4
4
  sourcemapVersion: string;
5
5
  stage: string;
@@ -77,16 +77,16 @@ type Glow = {
77
77
  type MessageLevel = 'info' | 'debug' | 'warning' | 'error' | 'critical';
78
78
 
79
79
  declare class Api {
80
- report(report: Report, url: string, key: string, reportBrowserExtensionErrors: boolean): Promise<void>;
80
+ report(report: Report, url: string, key: string | null, reportBrowserExtensionErrors: boolean): Promise<void>;
81
81
  }
82
82
 
83
83
  declare class Flare {
84
- http: Api;
84
+ api: Api;
85
85
  config: Config;
86
86
  glows: Glow[];
87
87
  context: Context;
88
88
  solutionProviders: SolutionProvider[];
89
- constructor(http?: Api);
89
+ constructor(api?: Api);
90
90
  light(key?: string, debug?: boolean): Flare;
91
91
  configure(config: Partial<Config>): Flare;
92
92
  test(): Promise<void>;
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ __export(src_exports, {
36
36
  module.exports = __toCommonJS(src_exports);
37
37
 
38
38
  // src/env/index.ts
39
- var CLIENT_VERSION = false ? "?" : '"1.1.0-rc.1"';
39
+ var CLIENT_VERSION = false ? "?" : '"1.1.0"';
40
40
  var KEY = typeof FLARE_JS_KEY === "undefined" ? "" : FLARE_JS_KEY;
41
41
  var SOURCEMAP_VERSION = typeof FLARE_SOURCEMAP_VERSION === "undefined" ? "" : FLARE_SOURCEMAP_VERSION;
42
42
 
@@ -105,7 +105,7 @@ var Api = class {
105
105
  method: "POST",
106
106
  headers: {
107
107
  "Content-Type": "application/json",
108
- "X-Api-Token": key,
108
+ "X-Api-Token": key ?? "",
109
109
  "X-Requested-With": "XMLHttpRequest",
110
110
  "X-Report-Browser-Extension-Errors": JSON.stringify(reportBrowserExtensionErrors)
111
111
  },
@@ -318,10 +318,10 @@ function hasStack(err) {
318
318
 
319
319
  // src/Flare.ts
320
320
  var Flare = class {
321
- constructor(http = new Api()) {
322
- this.http = http;
321
+ constructor(api = new Api()) {
322
+ this.api = api;
323
323
  this.config = {
324
- key: KEY,
324
+ key: null,
325
325
  version: CLIENT_VERSION,
326
326
  sourcemapVersion: SOURCEMAP_VERSION,
327
327
  stage: "",
@@ -443,7 +443,7 @@ var Flare = class {
443
443
  if (!reportToSubmit) {
444
444
  return;
445
445
  }
446
- return this.http.report(
446
+ return this.api.report(
447
447
  reportToSubmit,
448
448
  this.config.reportingUrl,
449
449
  this.config.key,
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/env/index.ts
2
- var CLIENT_VERSION = false ? "?" : '"1.1.0-rc.1"';
2
+ var CLIENT_VERSION = false ? "?" : '"1.1.0"';
3
3
  var KEY = typeof FLARE_JS_KEY === "undefined" ? "" : FLARE_JS_KEY;
4
4
  var SOURCEMAP_VERSION = typeof FLARE_SOURCEMAP_VERSION === "undefined" ? "" : FLARE_SOURCEMAP_VERSION;
5
5
 
@@ -68,7 +68,7 @@ var Api = class {
68
68
  method: "POST",
69
69
  headers: {
70
70
  "Content-Type": "application/json",
71
- "X-Api-Token": key,
71
+ "X-Api-Token": key ?? "",
72
72
  "X-Requested-With": "XMLHttpRequest",
73
73
  "X-Report-Browser-Extension-Errors": JSON.stringify(reportBrowserExtensionErrors)
74
74
  },
@@ -281,10 +281,10 @@ function hasStack(err) {
281
281
 
282
282
  // src/Flare.ts
283
283
  var Flare = class {
284
- constructor(http = new Api()) {
285
- this.http = http;
284
+ constructor(api = new Api()) {
285
+ this.api = api;
286
286
  this.config = {
287
- key: KEY,
287
+ key: null,
288
288
  version: CLIENT_VERSION,
289
289
  sourcemapVersion: SOURCEMAP_VERSION,
290
290
  stage: "",
@@ -406,7 +406,7 @@ var Flare = class {
406
406
  if (!reportToSubmit) {
407
407
  return;
408
408
  }
409
- return this.http.report(
409
+ return this.api.report(
410
410
  reportToSubmit,
411
411
  this.config.reportingUrl,
412
412
  this.config.key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flareapp/js",
3
- "version": "1.1.0-rc.1",
3
+ "version": "1.1.0",
4
4
  "description": "JavaScript client for flareapp.io",
5
5
  "homepage": "https://flareapp.io",
6
6
  "bugs": {
package/src/Flare.ts CHANGED
@@ -16,7 +16,7 @@ import { assert, assertKey, assertSolutionProvider, now } from './util';
16
16
 
17
17
  export class Flare {
18
18
  config: Config = {
19
- key: KEY,
19
+ key: null,
20
20
  version: CLIENT_VERSION,
21
21
  sourcemapVersion: SOURCEMAP_VERSION,
22
22
  stage: '',
@@ -32,7 +32,7 @@ export class Flare {
32
32
  context: Context = { context: {} };
33
33
  solutionProviders: SolutionProvider[] = [];
34
34
 
35
- constructor(public http: Api = new Api()) {}
35
+ constructor(public api: Api = new Api()) {}
36
36
 
37
37
  light(key: string = KEY, debug: boolean = false): Flare {
38
38
  this.config.key = key;
@@ -184,7 +184,7 @@ export class Flare {
184
184
  return;
185
185
  }
186
186
 
187
- return this.http.report(
187
+ return this.api.report(
188
188
  reportToSubmit,
189
189
  this.config.reportingUrl,
190
190
  this.config.key,
package/src/api/Api.ts CHANGED
@@ -2,12 +2,12 @@ import { Report } from '../types';
2
2
  import { flatJsonStringify } from '../util';
3
3
 
4
4
  export class Api {
5
- report(report: Report, url: string, key: string, reportBrowserExtensionErrors: boolean): Promise<void> {
5
+ report(report: Report, url: string, key: string | null, reportBrowserExtensionErrors: boolean): Promise<void> {
6
6
  return fetch(url, {
7
7
  method: 'POST',
8
8
  headers: {
9
9
  'Content-Type': 'application/json',
10
- 'X-Api-Token': key,
10
+ 'X-Api-Token': key ?? '',
11
11
  'X-Requested-With': 'XMLHttpRequest',
12
12
  'X-Report-Browser-Extension-Errors': JSON.stringify(reportBrowserExtensionErrors),
13
13
  },
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type Config = {
2
- key: string;
2
+ key: string | null;
3
3
  version: string;
4
4
  sourcemapVersion: string;
5
5
  stage: string;