@appsignal/javascript
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0-beta.6
import { Span } from "./span"; | ||
import { compose } from "./utils/functional"; | ||
import { IHook } from "./interfaces/IHook"; | ||
import { AppsignalOptions } from "./types/options"; | ||
@@ -19,2 +20,4 @@ export default class Appsignal { | ||
wrap(fn: Function): Promise<any>; | ||
addDecorator<T extends IHook>(decorator: T): void; | ||
addOverride<T extends IHook>(override: T): void; | ||
diagnose(): object; | ||
@@ -21,0 +24,0 @@ private _createSpanFromError; |
@@ -17,8 +17,11 @@ "use strict"; | ||
this._hooks = { | ||
decorators: [], | ||
overrides: [] | ||
decorators: Array(), | ||
overrides: Array() | ||
}; | ||
this._env = environment_1.Environment.serialize(); | ||
this._queue = new queue_1.Queue(window.__APPSIGNAL_QUEUE__ || []); | ||
var key = options.key, uri = options.uri; | ||
var key = options.key, uri = options.uri, revision = options.revision; | ||
if (revision && typeof revision !== "string") { | ||
options.revision = String(revision); | ||
} | ||
this._api = new api_1.PushApi({ | ||
@@ -95,2 +98,8 @@ key: key, | ||
}; | ||
Appsignal.prototype.addDecorator = function (decorator) { | ||
this._hooks.decorators.push(decorator); | ||
}; | ||
Appsignal.prototype.addOverride = function (override) { | ||
this._hooks.overrides.push(override); | ||
}; | ||
Appsignal.prototype.diagnose = function () { | ||
@@ -97,0 +106,0 @@ return { |
import { Serializable } from "./serializable"; | ||
import { Span as AppsignalSpan } from "./types/span"; | ||
export declare class Span extends Serializable<AppsignalSpan> { | ||
constructor(span: Partial<AppsignalSpan>); | ||
constructor(span?: Partial<AppsignalSpan>); | ||
setAction(name: string): this; | ||
@@ -6,0 +6,0 @@ setNamespace(name: string): this; |
@@ -24,6 +24,7 @@ "use strict"; | ||
Span.prototype.setError = function (error) { | ||
var name = error.name, message = error.message; | ||
if (!error) | ||
return this; | ||
this._data.error = { | ||
name: name, | ||
message: message, | ||
name: error.name || "Error", | ||
message: error.message || "No message given", | ||
backtrace: stacktrace_1.getStacktrace(error) | ||
@@ -30,0 +31,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.0.0-beta.5"; | ||
export declare const VERSION = "1.0.0-beta.6"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = "1.0.0-beta.5"; | ||
exports.VERSION = "1.0.0-beta.6"; | ||
//# sourceMappingURL=version.js.map |
import { Span } from "./span"; | ||
import { compose } from "./utils/functional"; | ||
import { IHook } from "./interfaces/IHook"; | ||
import { AppsignalOptions } from "./types/options"; | ||
@@ -19,2 +20,4 @@ export default class Appsignal { | ||
wrap(fn: Function): Promise<any>; | ||
addDecorator<T extends IHook>(decorator: T): void; | ||
addOverride<T extends IHook>(override: T): void; | ||
diagnose(): object; | ||
@@ -21,0 +24,0 @@ private _createSpanFromError; |
@@ -13,8 +13,11 @@ import * as tslib_1 from "tslib"; | ||
this._hooks = { | ||
decorators: [], | ||
overrides: [] | ||
decorators: Array(), | ||
overrides: Array() | ||
}; | ||
this._env = Environment.serialize(); | ||
this._queue = new Queue(window.__APPSIGNAL_QUEUE__ || []); | ||
var key = options.key, uri = options.uri; | ||
var key = options.key, uri = options.uri, revision = options.revision; | ||
if (revision && typeof revision !== "string") { | ||
options.revision = String(revision); | ||
} | ||
this._api = new PushApi({ | ||
@@ -91,2 +94,8 @@ key: key, | ||
}; | ||
Appsignal.prototype.addDecorator = function (decorator) { | ||
this._hooks.decorators.push(decorator); | ||
}; | ||
Appsignal.prototype.addOverride = function (override) { | ||
this._hooks.overrides.push(override); | ||
}; | ||
Appsignal.prototype.diagnose = function () { | ||
@@ -93,0 +102,0 @@ return { |
import { Serializable } from "./serializable"; | ||
import { Span as AppsignalSpan } from "./types/span"; | ||
export declare class Span extends Serializable<AppsignalSpan> { | ||
constructor(span: Partial<AppsignalSpan>); | ||
constructor(span?: Partial<AppsignalSpan>); | ||
setAction(name: string): this; | ||
@@ -6,0 +6,0 @@ setNamespace(name: string): this; |
@@ -22,6 +22,7 @@ import * as tslib_1 from "tslib"; | ||
Span.prototype.setError = function (error) { | ||
var name = error.name, message = error.message; | ||
if (!error) | ||
return this; | ||
this._data.error = { | ||
name: name, | ||
message: message, | ||
name: error.name || "Error", | ||
message: error.message || "No message given", | ||
backtrace: getStacktrace(error) | ||
@@ -28,0 +29,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.0.0-beta.5"; | ||
export declare const VERSION = "1.0.0-beta.6"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export var VERSION = "1.0.0-beta.5"; | ||
export var VERSION = "1.0.0-beta.6"; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@appsignal/javascript", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0-beta.6", | ||
"main": "dist/cjs/index.js", | ||
@@ -30,3 +30,3 @@ "module": "dist/esm/index.js", | ||
}, | ||
"gitHead": "6c4311f6aa19c901536196998e8ca4545f2e9e90" | ||
"gitHead": "59dc875708a7e6138cfd60960e5f9036e885e64c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91254
162
1337