@honeybadger-io/js 6.16.3 → 6.16.5
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/browser/honeybadger.ext.min.js +1 -1
- package/dist/browser/honeybadger.ext.min.js.map +1 -1
- package/dist/browser/honeybadger.js +114 -12
- package/dist/browser/honeybadger.js.map +1 -1
- package/dist/browser/honeybadger.min.js +1 -1
- package/dist/browser/honeybadger.min.js.map +1 -1
- package/dist/server/fastify.js +1 -1
- package/dist/server/honeybadger.js +110 -6
- package/dist/server/honeybadger.js.map +1 -1
- package/package.json +2 -2
package/dist/server/fastify.js
CHANGED
|
@@ -1455,7 +1455,7 @@ var Client = /** @class */ (function () {
|
|
|
1455
1455
|
this.__notifier = {
|
|
1456
1456
|
name: '@honeybadger-io/core',
|
|
1457
1457
|
url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/core',
|
|
1458
|
-
version: '6.16.
|
|
1458
|
+
version: '6.16.5'
|
|
1459
1459
|
};
|
|
1460
1460
|
this.config = __assign(__assign({}, defaults_1.CONFIG), opts);
|
|
1461
1461
|
this.__initStore();
|
|
@@ -1473,7 +1473,7 @@ var Client = /** @class */ (function () {
|
|
|
1473
1473
|
this.__notifier = {
|
|
1474
1474
|
name: '@honeybadger-io/core',
|
|
1475
1475
|
url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/core',
|
|
1476
|
-
version: '6.16.
|
|
1476
|
+
version: '6.16.5'
|
|
1477
1477
|
};
|
|
1478
1478
|
this.config = __assign$1(__assign$1({}, defaults_1.CONFIG), opts);
|
|
1479
1479
|
this.__initStore();
|
|
@@ -2883,12 +2883,14 @@ function fullUrl(req) {
|
|
|
2883
2883
|
var address = connection && connection.address();
|
|
2884
2884
|
// @ts-ignore The old @types/node incorrectly defines `address` as string|Address
|
|
2885
2885
|
var port = address ? address.port : undefined;
|
|
2886
|
-
// @ts-ignore
|
|
2887
2886
|
return url_1$1.default.format({
|
|
2888
2887
|
protocol: req.protocol,
|
|
2889
2888
|
hostname: req.hostname,
|
|
2890
2889
|
port: port,
|
|
2891
2890
|
pathname: req.path,
|
|
2891
|
+
// Express types `query` as `ParsedQs`, which permits arbitrarily nested objects, while
|
|
2892
|
+
// `url.format` accepts `ParsedUrlQueryInput`. The two agree for the flat values a real
|
|
2893
|
+
// query string produces, and `format` stringifies anything deeper either way.
|
|
2892
2894
|
query: req.query
|
|
2893
2895
|
});
|
|
2894
2896
|
}
|
|
@@ -3745,6 +3747,104 @@ client.CheckInsClient = CheckInsClient;
|
|
|
3745
3747
|
|
|
3746
3748
|
} (checkInsManager));
|
|
3747
3749
|
|
|
3750
|
+
var globalSingleton = {};
|
|
3751
|
+
|
|
3752
|
+
(function (exports) {
|
|
3753
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3754
|
+
exports.getOrCreateSingleton = exports.singletonKey = exports.DISABLE_GLOBAL_SINGLETON_KEY = void 0;
|
|
3755
|
+
var core_1 = src;
|
|
3756
|
+
/**
|
|
3757
|
+
* Set this on the global object before the package is loaded to opt out of sharing.
|
|
3758
|
+
* Two independently bundled copies on one page then keep their own clients, the way
|
|
3759
|
+
* they did before the singleton was shared.
|
|
3760
|
+
*/
|
|
3761
|
+
exports.DISABLE_GLOBAL_SINGLETON_KEY = '__HONEYBADGER_DISABLE_GLOBAL_SINGLETON__';
|
|
3762
|
+
/**
|
|
3763
|
+
* Stamped on the client when it is stored, and required when it is read back, so the slot
|
|
3764
|
+
* is only ever trusted when this package wrote it. Duck typing would not do: a value that
|
|
3765
|
+
* happens to carry a `notify` method would be handed out as the client.
|
|
3766
|
+
*/
|
|
3767
|
+
var CLIENT_MARKER = '__honeybadger_client__';
|
|
3768
|
+
function singletonKey(target, version) {
|
|
3769
|
+
return "__honeybadger_singleton_".concat(target, "_").concat(version, "__");
|
|
3770
|
+
}
|
|
3771
|
+
exports.singletonKey = singletonKey;
|
|
3772
|
+
function isSingleton(value) {
|
|
3773
|
+
return !!value && value[CLIENT_MARKER] === true;
|
|
3774
|
+
}
|
|
3775
|
+
function markAsSingleton(client) {
|
|
3776
|
+
Object.defineProperty(client, CLIENT_MARKER, {
|
|
3777
|
+
value: true,
|
|
3778
|
+
writable: false,
|
|
3779
|
+
configurable: true,
|
|
3780
|
+
enumerable: false,
|
|
3781
|
+
});
|
|
3782
|
+
}
|
|
3783
|
+
/**
|
|
3784
|
+
* Returns the client stored on the global object, creating and storing it the first time.
|
|
3785
|
+
*
|
|
3786
|
+
* Bundlers can emit more than one copy of this module — Next.js compiles the
|
|
3787
|
+
* instrumentation, page-rendering and edge contexts into separate module graphs — and
|
|
3788
|
+
* each copy would otherwise build its own client. Only the copy the configuration code
|
|
3789
|
+
* ran in would be configured, so a `Honeybadger.notify()` made through any other copy
|
|
3790
|
+
* would silently do nothing. Keeping the instance on the realm's global object lets every
|
|
3791
|
+
* copy find the same configured client.
|
|
3792
|
+
*
|
|
3793
|
+
* The slot is keyed by build target and by exact version: an older copy must never be
|
|
3794
|
+
* handed to a newer caller that would then call a method it does not have. Two different
|
|
3795
|
+
* versions in one realm fall back to one client each, which is the behaviour that shipped
|
|
3796
|
+
* before the singleton was shared.
|
|
3797
|
+
*/
|
|
3798
|
+
function getOrCreateSingleton(target, version, create, _global) {
|
|
3799
|
+
if (_global === void 0) { _global = core_1.Util.globalThisOrWindow(); }
|
|
3800
|
+
if (!_global) {
|
|
3801
|
+
return create();
|
|
3802
|
+
}
|
|
3803
|
+
var key = singletonKey(target, version);
|
|
3804
|
+
var shared;
|
|
3805
|
+
var canShare = false;
|
|
3806
|
+
// Reading the global object can throw as easily as writing to it can: the opt-out
|
|
3807
|
+
// flag, the slot and the marker are all ordinary properties, and a host or another
|
|
3808
|
+
// script may have installed a getter on any of them. `create()` stays outside, so a
|
|
3809
|
+
// genuine failure to build the client still propagates.
|
|
3810
|
+
try {
|
|
3811
|
+
if (_global[exports.DISABLE_GLOBAL_SINGLETON_KEY] !== true) {
|
|
3812
|
+
canShare = true;
|
|
3813
|
+
var existing = _global[key];
|
|
3814
|
+
if (isSingleton(existing)) {
|
|
3815
|
+
shared = existing;
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3818
|
+
}
|
|
3819
|
+
catch (_e) {
|
|
3820
|
+
canShare = false;
|
|
3821
|
+
}
|
|
3822
|
+
if (shared) {
|
|
3823
|
+
return shared;
|
|
3824
|
+
}
|
|
3825
|
+
var created = create();
|
|
3826
|
+
if (!canShare) {
|
|
3827
|
+
return created;
|
|
3828
|
+
}
|
|
3829
|
+
try {
|
|
3830
|
+
markAsSingleton(created);
|
|
3831
|
+
Object.defineProperty(_global, key, {
|
|
3832
|
+
value: created,
|
|
3833
|
+
writable: true,
|
|
3834
|
+
configurable: true,
|
|
3835
|
+
enumerable: false,
|
|
3836
|
+
});
|
|
3837
|
+
}
|
|
3838
|
+
catch (_e) {
|
|
3839
|
+
// A frozen global object (node --frozen-intrinsics, SES lockdown). Importing this
|
|
3840
|
+
// package must never throw, so this copy keeps the client to itself.
|
|
3841
|
+
}
|
|
3842
|
+
return created;
|
|
3843
|
+
}
|
|
3844
|
+
exports.getOrCreateSingleton = getOrCreateSingleton;
|
|
3845
|
+
|
|
3846
|
+
} (globalSingleton));
|
|
3847
|
+
|
|
3748
3848
|
(function (exports) {
|
|
3749
3849
|
var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
|
|
3750
3850
|
var extendStatics = function (d, b) {
|
|
@@ -3811,7 +3911,6 @@ client.CheckInsClient = CheckInsClient;
|
|
|
3811
3911
|
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
3812
3912
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3813
3913
|
};
|
|
3814
|
-
var _a;
|
|
3815
3914
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3816
3915
|
exports.CheckIn = exports.Types = void 0;
|
|
3817
3916
|
var os_1 = __importDefault(require$$0__default["default"]);
|
|
@@ -3826,6 +3925,7 @@ client.CheckInsClient = CheckInsClient;
|
|
|
3826
3925
|
var transport_1 = transport;
|
|
3827
3926
|
var stacked_store_1 = stacked_store;
|
|
3828
3927
|
var check_ins_manager_1 = checkInsManager;
|
|
3928
|
+
var global_singleton_1 = globalSingleton;
|
|
3829
3929
|
var endpoint = core_1.Util.endpoint;
|
|
3830
3930
|
var DEFAULT_PLUGINS = [
|
|
3831
3931
|
(0, uncaught_exception_plugin_1.default)(),
|
|
@@ -3989,13 +4089,17 @@ client.CheckInsClient = CheckInsClient;
|
|
|
3989
4089
|
var NOTIFIER = {
|
|
3990
4090
|
name: '@honeybadger-io/js',
|
|
3991
4091
|
url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/js',
|
|
3992
|
-
version: '6.16.
|
|
4092
|
+
version: '6.16.5'
|
|
3993
4093
|
};
|
|
3994
4094
|
var userAgent = function () {
|
|
3995
4095
|
return "Honeybadger JS Server Client ".concat(NOTIFIER.version, ", ").concat(os_1.default.version(), "; ").concat(os_1.default.platform());
|
|
3996
4096
|
};
|
|
3997
|
-
var singleton =
|
|
3998
|
-
|
|
4097
|
+
var singleton = (0, global_singleton_1.getOrCreateSingleton)('server', NOTIFIER.version, function () {
|
|
4098
|
+
var _a;
|
|
4099
|
+
var client = new Honeybadger(__assign({ __plugins: DEFAULT_PLUGINS }, ((_a = (0, util_1.readConfigFromFileSystem)()) !== null && _a !== void 0 ? _a : {})));
|
|
4100
|
+
client.setNotifier(NOTIFIER);
|
|
4101
|
+
return client;
|
|
4102
|
+
});
|
|
3999
4103
|
var core_2 = src;
|
|
4000
4104
|
Object.defineProperty(exports, "Types", { enumerable: true, get: function () { return core_2.Types; } });
|
|
4001
4105
|
var check_in_1 = requireCheckIn();
|