videomail-client 10.0.4 → 10.0.6
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.cjs
CHANGED
|
@@ -3848,6 +3848,22 @@ function __webpack_require__(moduleId) {
|
|
|
3848
3848
|
return getBrowser_browser;
|
|
3849
3849
|
}
|
|
3850
3850
|
/* ESM default export */ const getBrowser = getBrowser_getBrowser;
|
|
3851
|
+
function HTTPError_define_property(obj, key, value) {
|
|
3852
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
3853
|
+
value: value,
|
|
3854
|
+
enumerable: true,
|
|
3855
|
+
configurable: true,
|
|
3856
|
+
writable: true
|
|
3857
|
+
});
|
|
3858
|
+
else obj[key] = value;
|
|
3859
|
+
return obj;
|
|
3860
|
+
}
|
|
3861
|
+
class HTTPError_HTTPError extends Error {
|
|
3862
|
+
constructor(...args){
|
|
3863
|
+
super(...args), HTTPError_define_property(this, "code", void 0), HTTPError_define_property(this, "status", void 0);
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3866
|
+
/* ESM default export */ const HTTPError = HTTPError_HTTPError;
|
|
3851
3867
|
function VideomailError_define_property(obj, key, value) {
|
|
3852
3868
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
3853
3869
|
value: value,
|
|
@@ -3858,7 +3874,7 @@ function __webpack_require__(moduleId) {
|
|
|
3858
3874
|
else obj[key] = value;
|
|
3859
3875
|
return obj;
|
|
3860
3876
|
}
|
|
3861
|
-
class VideomailError extends
|
|
3877
|
+
class VideomailError extends HTTPError {
|
|
3862
3878
|
hasClass(name) {
|
|
3863
3879
|
var _this_classList;
|
|
3864
3880
|
return null === (_this_classList = this.classList) || void 0 === _this_classList ? void 0 : _this_classList.includes(name);
|
|
@@ -3907,7 +3923,6 @@ function __webpack_require__(moduleId) {
|
|
|
3907
3923
|
VideomailError_define_property(VideomailError, "BROWSER_PROBLEM", "browser-problem");
|
|
3908
3924
|
VideomailError_define_property(VideomailError, "WEBCAM_PROBLEM", "webcam-problem");
|
|
3909
3925
|
VideomailError_define_property(VideomailError, "OVERCONSTRAINED", "OverconstrainedError");
|
|
3910
|
-
VideomailError_define_property(VideomailError, "NOT_FOUND_ERROR", "NotFoundError");
|
|
3911
3926
|
VideomailError_define_property(VideomailError, "NOT_READABLE_ERROR", "NotReadableError");
|
|
3912
3927
|
VideomailError_define_property(VideomailError, "SECURITY_ERROR", "SecurityError");
|
|
3913
3928
|
VideomailError_define_property(VideomailError, "TRACK_START_ERROR", "TrackStartError");
|
|
@@ -3915,30 +3930,18 @@ function __webpack_require__(moduleId) {
|
|
|
3915
3930
|
/* ESM default export */ const error_VideomailError = VideomailError;
|
|
3916
3931
|
function createError(errorParams) {
|
|
3917
3932
|
const { exc, options } = errorParams;
|
|
3933
|
+
let err = errorParams.err;
|
|
3934
|
+
if (!err && exc instanceof Error) err = exc;
|
|
3935
|
+
if (err instanceof error_VideomailError) return err;
|
|
3918
3936
|
let message = errorParams.message;
|
|
3919
3937
|
let explanation = errorParams.explanation;
|
|
3920
|
-
let err = errorParams.err;
|
|
3921
3938
|
var _errorParams_classList;
|
|
3922
3939
|
const classList = null !== (_errorParams_classList = errorParams.classList) && void 0 !== _errorParams_classList ? _errorParams_classList : [];
|
|
3923
|
-
if (!err && exc instanceof Error) err = exc;
|
|
3924
|
-
if (err instanceof error_VideomailError) return err;
|
|
3925
3940
|
const audioEnabled = isAudioEnabled(options);
|
|
3926
3941
|
const browser = getBrowser(options);
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
if ("object" == typeof err) {
|
|
3931
|
-
if ("code" in err) errorCode = err.code;
|
|
3932
|
-
if (err.name === error_VideomailError.TRACK_START_ERROR) errType = error_VideomailError.TRACK_START_ERROR;
|
|
3933
|
-
else if (err.name === error_VideomailError.SECURITY_ERROR) errType = error_VideomailError.SECURITY_ERROR;
|
|
3934
|
-
else if (8 === errorCode && err.name === error_VideomailError.NOT_FOUND_ERROR) errType = error_VideomailError.NOT_FOUND_ERROR;
|
|
3935
|
-
else if (35 === errorCode || err.name === error_VideomailError.NOT_ALLOWED_ERROR) // https://github.com/binarykitchen/videomail.io/issues/411
|
|
3936
|
-
errType = error_VideomailError.NOT_ALLOWED_ERROR;
|
|
3937
|
-
else if (err.constructor.name === error_VideomailError.DOM_EXCEPTION) errType = err.name === error_VideomailError.NOT_READABLE_ERROR ? error_VideomailError.NOT_READABLE_ERROR : error_VideomailError.DOM_EXCEPTION;
|
|
3938
|
-
else if (err.constructor.name === error_VideomailError.OVERCONSTRAINED) errType = error_VideomailError.OVERCONSTRAINED;
|
|
3939
|
-
else if (err.name) errType = err.name;
|
|
3940
|
-
} else errType = err;
|
|
3941
|
-
switch(errType){
|
|
3942
|
+
var _err_name;
|
|
3943
|
+
const errName = null !== (_err_name = null == err ? void 0 : err.name) && void 0 !== _err_name ? _err_name : null == err ? void 0 : err.constructor.name;
|
|
3944
|
+
switch(errName){
|
|
3942
3945
|
case error_VideomailError.SECURITY_ERROR:
|
|
3943
3946
|
message = "The operation was insecure";
|
|
3944
3947
|
explanation = "Probably you have disallowed Cookies for this page?";
|
|
@@ -3956,7 +3959,6 @@ function __webpack_require__(moduleId) {
|
|
|
3956
3959
|
message = "Source of your webcam cannot be accessed";
|
|
3957
3960
|
explanation = "Probably it is locked from another process or has a hardware error.";
|
|
3958
3961
|
break;
|
|
3959
|
-
case error_VideomailError.NOT_FOUND_ERROR:
|
|
3960
3962
|
case "NO_DEVICES_FOUND":
|
|
3961
3963
|
if (audioEnabled) {
|
|
3962
3964
|
message = "No webcam nor microphone found";
|
|
@@ -4012,31 +4014,8 @@ function __webpack_require__(moduleId) {
|
|
|
4012
4014
|
classList.push(error_VideomailError.WEBCAM_PROBLEM);
|
|
4013
4015
|
break;
|
|
4014
4016
|
case error_VideomailError.DOM_EXCEPTION:
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
message = "Requested webcam not found";
|
|
4018
|
-
explanation = "A webcam is needed but could not be found";
|
|
4019
|
-
classList.push(error_VideomailError.WEBCAM_PROBLEM);
|
|
4020
|
-
break;
|
|
4021
|
-
case 9:
|
|
4022
|
-
{
|
|
4023
|
-
const newUrl = `https:${window.location.href.substring(window.location.protocol.length)}`;
|
|
4024
|
-
message = "Security upgrade needed";
|
|
4025
|
-
explanation = `Click <a href="${newUrl}">here</a> to switch to HTTPs which is more safe and enables encrypted videomail transfers.`;
|
|
4026
|
-
classList.push(error_VideomailError.BROWSER_PROBLEM);
|
|
4027
|
-
break;
|
|
4028
|
-
}
|
|
4029
|
-
case 11:
|
|
4030
|
-
message = "Invalid State";
|
|
4031
|
-
explanation = "The object is in an invalid, unusable state";
|
|
4032
|
-
classList.push(error_VideomailError.BROWSER_PROBLEM);
|
|
4033
|
-
break;
|
|
4034
|
-
default:
|
|
4035
|
-
message = "DOM Exception";
|
|
4036
|
-
explanation = pretty(err);
|
|
4037
|
-
classList.push(error_VideomailError.BROWSER_PROBLEM);
|
|
4038
|
-
break;
|
|
4039
|
-
}
|
|
4017
|
+
message = "DOM Exception";
|
|
4018
|
+
explanation = pretty(err);
|
|
4040
4019
|
break;
|
|
4041
4020
|
/*
|
|
4042
4021
|
* Chrome has a weird problem where if you try to do a getUserMedia request too early, it
|
|
@@ -4056,12 +4035,11 @@ function __webpack_require__(moduleId) {
|
|
|
4056
4035
|
/*
|
|
4057
4036
|
* it can be that explanation itself is an error object
|
|
4058
4037
|
* error objects can be prettified to undefined sometimes
|
|
4059
|
-
*/ if (!explanation && originalExplanation)
|
|
4060
|
-
explanation = `Inspected: ${originalExplanation}`;
|
|
4038
|
+
*/ if (!explanation && originalExplanation) explanation = `Inspected: ${originalExplanation}`;
|
|
4061
4039
|
if (!message && (null == err ? void 0 : err.message)) message = err.message;
|
|
4062
4040
|
// for weird, undefined cases
|
|
4063
4041
|
if (!message) {
|
|
4064
|
-
if (
|
|
4042
|
+
if (errName) message = `${errName} (weird)`;
|
|
4065
4043
|
if (!explanation) explanation = pretty(err);
|
|
4066
4044
|
// avoid dupes
|
|
4067
4045
|
if (pretty(message) === explanation) explanation = void 0;
|
|
@@ -4082,6 +4060,10 @@ function __webpack_require__(moduleId) {
|
|
|
4082
4060
|
err
|
|
4083
4061
|
};
|
|
4084
4062
|
const videomailError = new error_VideomailError(null != message ? message : "(undefined message)", options, classList, errData);
|
|
4063
|
+
if (err) {
|
|
4064
|
+
videomailError.status = err.status;
|
|
4065
|
+
videomailError.code = err.code;
|
|
4066
|
+
}
|
|
4085
4067
|
if (options.reportErrors) {
|
|
4086
4068
|
const resource = new src_resource(options);
|
|
4087
4069
|
resource.reportError(videomailError).catch((reason)=>{
|
|
@@ -4466,14 +4448,14 @@ function __webpack_require__(moduleId) {
|
|
|
4466
4448
|
const body = response.body;
|
|
4467
4449
|
if ("error" in body) {
|
|
4468
4450
|
const message = body.error.message;
|
|
4469
|
-
const name = body.error.name;
|
|
4470
|
-
const stack = body.error.stack;
|
|
4471
4451
|
const cause = body.error.cause;
|
|
4472
|
-
const error = new
|
|
4452
|
+
const error = new HTTPError(message, {
|
|
4473
4453
|
cause
|
|
4474
4454
|
});
|
|
4475
|
-
error.name = name;
|
|
4476
|
-
error.stack = stack;
|
|
4455
|
+
if (body.error.name) error.name = body.error.name;
|
|
4456
|
+
if (body.error.stack) error.stack = body.error.stack;
|
|
4457
|
+
if (body.error.status) error.status = body.error.status;
|
|
4458
|
+
if (body.error.code) error.code = body.error.code;
|
|
4477
4459
|
return error;
|
|
4478
4460
|
}
|
|
4479
4461
|
}
|
|
@@ -5811,7 +5793,7 @@ function __webpack_require__(moduleId) {
|
|
|
5811
5793
|
const external_is_power_of_two_namespaceObject = require("is-power-of-two");
|
|
5812
5794
|
var external_is_power_of_two_default = /*#__PURE__*/ __webpack_require__.n(external_is_power_of_two_namespaceObject);
|
|
5813
5795
|
var package_namespaceObject = {
|
|
5814
|
-
i8: "10.0.
|
|
5796
|
+
i8: "10.0.6"
|
|
5815
5797
|
}; // CONCATENATED MODULE: ./src/types/env.ts
|
|
5816
5798
|
// ... and these actually define the runtime mode of Node.js and are
|
|
5817
5799
|
// set either in package.json, via Jest or in the Dockerfile
|
|
@@ -8854,7 +8836,7 @@ function __webpack_require__(moduleId) {
|
|
|
8854
8836
|
return "test" === isTest_process.env.ENVIRON;
|
|
8855
8837
|
}
|
|
8856
8838
|
/* ESM default export */ const isTest = isTest_isTest;
|
|
8857
|
-
function
|
|
8839
|
+
function mergeWithDefaultOptions_mergeWithDefaultOptions() {
|
|
8858
8840
|
let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
8859
8841
|
const newOptions = external_deepmerge_default()(src_options, options, {
|
|
8860
8842
|
arrayMerge (_destination, source) {
|
|
@@ -8867,7 +8849,7 @@ function __webpack_require__(moduleId) {
|
|
|
8867
8849
|
if (isTest()) newOptions.verbose = false;
|
|
8868
8850
|
return newOptions;
|
|
8869
8851
|
}
|
|
8870
|
-
/* ESM default export */ const
|
|
8852
|
+
/* ESM default export */ const mergeWithDefaultOptions = mergeWithDefaultOptions_mergeWithDefaultOptions;
|
|
8871
8853
|
function client_define_property(obj, key, value) {
|
|
8872
8854
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
8873
8855
|
value: value,
|
|
@@ -8964,7 +8946,7 @@ function __webpack_require__(moduleId) {
|
|
|
8964
8946
|
if (this.options.logger.getLines) return this.options.logger.getLines();
|
|
8965
8947
|
}
|
|
8966
8948
|
constructor(options = {}){
|
|
8967
|
-
super("VideomailClient",
|
|
8949
|
+
super("VideomailClient", mergeWithDefaultOptions(options)), client_define_property(this, "container", void 0);
|
|
8968
8950
|
this.validateOptions();
|
|
8969
8951
|
util_Despot.removeAllListeners();
|
|
8970
8952
|
this.container = new wrappers_container(this.options);
|
package/dist/index.js
CHANGED
|
@@ -3781,7 +3781,12 @@ function getBrowser_getBrowser(localOptions) {
|
|
|
3781
3781
|
return getBrowser_browser;
|
|
3782
3782
|
}
|
|
3783
3783
|
/* ESM default export */ const getBrowser = getBrowser_getBrowser;
|
|
3784
|
-
class
|
|
3784
|
+
class HTTPError extends Error {
|
|
3785
|
+
code;
|
|
3786
|
+
status;
|
|
3787
|
+
}
|
|
3788
|
+
/* ESM default export */ const error_HTTPError = HTTPError;
|
|
3789
|
+
class VideomailError extends error_HTTPError {
|
|
3785
3790
|
title = "videomail-client error";
|
|
3786
3791
|
location = window.location.href;
|
|
3787
3792
|
explanation;
|
|
@@ -3807,7 +3812,6 @@ class VideomailError extends Error {
|
|
|
3807
3812
|
static BROWSER_PROBLEM = "browser-problem";
|
|
3808
3813
|
static WEBCAM_PROBLEM = "webcam-problem";
|
|
3809
3814
|
static OVERCONSTRAINED = "OverconstrainedError";
|
|
3810
|
-
static NOT_FOUND_ERROR = "NotFoundError";
|
|
3811
3815
|
static NOT_READABLE_ERROR = "NotReadableError";
|
|
3812
3816
|
static SECURITY_ERROR = "SecurityError";
|
|
3813
3817
|
static TRACK_START_ERROR = "TrackStartError";
|
|
@@ -3854,29 +3858,16 @@ class VideomailError extends Error {
|
|
|
3854
3858
|
/* ESM default export */ const error_VideomailError = VideomailError;
|
|
3855
3859
|
function createError(errorParams) {
|
|
3856
3860
|
const { exc, options } = errorParams;
|
|
3857
|
-
let message = errorParams.message;
|
|
3858
|
-
let explanation = errorParams.explanation;
|
|
3859
3861
|
let err = errorParams.err;
|
|
3860
|
-
const classList = errorParams.classList ?? [];
|
|
3861
3862
|
if (!err && exc instanceof Error) err = exc;
|
|
3862
3863
|
if (err instanceof error_VideomailError) return err;
|
|
3864
|
+
let message = errorParams.message;
|
|
3865
|
+
let explanation = errorParams.explanation;
|
|
3866
|
+
const classList = errorParams.classList ?? [];
|
|
3863
3867
|
const audioEnabled = isAudioEnabled(options);
|
|
3864
3868
|
const browser = getBrowser(options);
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
// whole code is ugly because all browsers behave so differently :(
|
|
3868
|
-
if ("object" == typeof err) {
|
|
3869
|
-
if ("code" in err) errorCode = err.code;
|
|
3870
|
-
if (err.name === error_VideomailError.TRACK_START_ERROR) errType = error_VideomailError.TRACK_START_ERROR;
|
|
3871
|
-
else if (err.name === error_VideomailError.SECURITY_ERROR) errType = error_VideomailError.SECURITY_ERROR;
|
|
3872
|
-
else if (8 === errorCode && err.name === error_VideomailError.NOT_FOUND_ERROR) errType = error_VideomailError.NOT_FOUND_ERROR;
|
|
3873
|
-
else if (35 === errorCode || err.name === error_VideomailError.NOT_ALLOWED_ERROR) // https://github.com/binarykitchen/videomail.io/issues/411
|
|
3874
|
-
errType = error_VideomailError.NOT_ALLOWED_ERROR;
|
|
3875
|
-
else if (err.constructor.name === error_VideomailError.DOM_EXCEPTION) errType = err.name === error_VideomailError.NOT_READABLE_ERROR ? error_VideomailError.NOT_READABLE_ERROR : error_VideomailError.DOM_EXCEPTION;
|
|
3876
|
-
else if (err.constructor.name === error_VideomailError.OVERCONSTRAINED) errType = error_VideomailError.OVERCONSTRAINED;
|
|
3877
|
-
else if (err.name) errType = err.name;
|
|
3878
|
-
} else errType = err;
|
|
3879
|
-
switch(errType){
|
|
3869
|
+
const errName = err?.name ?? err?.constructor.name;
|
|
3870
|
+
switch(errName){
|
|
3880
3871
|
case error_VideomailError.SECURITY_ERROR:
|
|
3881
3872
|
message = "The operation was insecure";
|
|
3882
3873
|
explanation = "Probably you have disallowed Cookies for this page?";
|
|
@@ -3894,7 +3885,6 @@ function createError(errorParams) {
|
|
|
3894
3885
|
message = "Source of your webcam cannot be accessed";
|
|
3895
3886
|
explanation = "Probably it is locked from another process or has a hardware error.";
|
|
3896
3887
|
break;
|
|
3897
|
-
case error_VideomailError.NOT_FOUND_ERROR:
|
|
3898
3888
|
case "NO_DEVICES_FOUND":
|
|
3899
3889
|
if (audioEnabled) {
|
|
3900
3890
|
message = "No webcam nor microphone found";
|
|
@@ -3950,31 +3940,8 @@ function createError(errorParams) {
|
|
|
3950
3940
|
classList.push(error_VideomailError.WEBCAM_PROBLEM);
|
|
3951
3941
|
break;
|
|
3952
3942
|
case error_VideomailError.DOM_EXCEPTION:
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
message = "Requested webcam not found";
|
|
3956
|
-
explanation = "A webcam is needed but could not be found";
|
|
3957
|
-
classList.push(error_VideomailError.WEBCAM_PROBLEM);
|
|
3958
|
-
break;
|
|
3959
|
-
case 9:
|
|
3960
|
-
{
|
|
3961
|
-
const newUrl = `https:${window.location.href.substring(window.location.protocol.length)}`;
|
|
3962
|
-
message = "Security upgrade needed";
|
|
3963
|
-
explanation = `Click <a href="${newUrl}">here</a> to switch to HTTPs which is more safe and enables encrypted videomail transfers.`;
|
|
3964
|
-
classList.push(error_VideomailError.BROWSER_PROBLEM);
|
|
3965
|
-
break;
|
|
3966
|
-
}
|
|
3967
|
-
case 11:
|
|
3968
|
-
message = "Invalid State";
|
|
3969
|
-
explanation = "The object is in an invalid, unusable state";
|
|
3970
|
-
classList.push(error_VideomailError.BROWSER_PROBLEM);
|
|
3971
|
-
break;
|
|
3972
|
-
default:
|
|
3973
|
-
message = "DOM Exception";
|
|
3974
|
-
explanation = pretty(err);
|
|
3975
|
-
classList.push(error_VideomailError.BROWSER_PROBLEM);
|
|
3976
|
-
break;
|
|
3977
|
-
}
|
|
3943
|
+
message = "DOM Exception";
|
|
3944
|
+
explanation = pretty(err);
|
|
3978
3945
|
break;
|
|
3979
3946
|
/*
|
|
3980
3947
|
* Chrome has a weird problem where if you try to do a getUserMedia request too early, it
|
|
@@ -3994,12 +3961,11 @@ function createError(errorParams) {
|
|
|
3994
3961
|
/*
|
|
3995
3962
|
* it can be that explanation itself is an error object
|
|
3996
3963
|
* error objects can be prettified to undefined sometimes
|
|
3997
|
-
*/ if (!explanation && originalExplanation)
|
|
3998
|
-
explanation = `Inspected: ${originalExplanation}`;
|
|
3964
|
+
*/ if (!explanation && originalExplanation) explanation = `Inspected: ${originalExplanation}`;
|
|
3999
3965
|
if (!message && err?.message) message = err.message;
|
|
4000
3966
|
// for weird, undefined cases
|
|
4001
3967
|
if (!message) {
|
|
4002
|
-
if (
|
|
3968
|
+
if (errName) message = `${errName} (weird)`;
|
|
4003
3969
|
if (!explanation) explanation = pretty(err);
|
|
4004
3970
|
// avoid dupes
|
|
4005
3971
|
if (pretty(message) === explanation) explanation = void 0;
|
|
@@ -4020,6 +3986,10 @@ function createError(errorParams) {
|
|
|
4020
3986
|
err
|
|
4021
3987
|
};
|
|
4022
3988
|
const videomailError = new error_VideomailError(message ?? "(undefined message)", options, classList, errData);
|
|
3989
|
+
if (err) {
|
|
3990
|
+
videomailError.status = err.status;
|
|
3991
|
+
videomailError.code = err.code;
|
|
3992
|
+
}
|
|
4023
3993
|
if (options.reportErrors) {
|
|
4024
3994
|
const resource = new src_resource(options);
|
|
4025
3995
|
resource.reportError(videomailError).catch((reason)=>{
|
|
@@ -4368,14 +4338,14 @@ function findOriginalExc(exc) {
|
|
|
4368
4338
|
const body = response.body;
|
|
4369
4339
|
if ("error" in body) {
|
|
4370
4340
|
const message = body.error.message;
|
|
4371
|
-
const name = body.error.name;
|
|
4372
|
-
const stack = body.error.stack;
|
|
4373
4341
|
const cause = body.error.cause;
|
|
4374
|
-
const error = new
|
|
4342
|
+
const error = new error_HTTPError(message, {
|
|
4375
4343
|
cause
|
|
4376
4344
|
});
|
|
4377
|
-
error.name = name;
|
|
4378
|
-
error.stack = stack;
|
|
4345
|
+
if (body.error.name) error.name = body.error.name;
|
|
4346
|
+
if (body.error.stack) error.stack = body.error.stack;
|
|
4347
|
+
if (body.error.status) error.status = body.error.status;
|
|
4348
|
+
if (body.error.code) error.code = body.error.code;
|
|
4379
4349
|
return error;
|
|
4380
4350
|
}
|
|
4381
4351
|
}
|
|
@@ -5596,7 +5566,7 @@ function isPromise_isPromise(anything) {
|
|
|
5596
5566
|
}
|
|
5597
5567
|
/* ESM default export */ const isPromise = isPromise_isPromise;
|
|
5598
5568
|
var package_namespaceObject = {
|
|
5599
|
-
i8: "10.0.
|
|
5569
|
+
i8: "10.0.6"
|
|
5600
5570
|
}; // CONCATENATED MODULE: ./src/types/env.ts
|
|
5601
5571
|
// ... and these actually define the runtime mode of Node.js and are
|
|
5602
5572
|
// set either in package.json, via Jest or in the Dockerfile
|
|
@@ -8545,7 +8515,7 @@ function isTest_isTest() {
|
|
|
8545
8515
|
return "test" === isTest_process.env.ENVIRON;
|
|
8546
8516
|
}
|
|
8547
8517
|
/* ESM default export */ const isTest = isTest_isTest;
|
|
8548
|
-
function
|
|
8518
|
+
function mergeWithDefaultOptions_mergeWithDefaultOptions(options = {}) {
|
|
8549
8519
|
const newOptions = (0, __WEBPACK_EXTERNAL_MODULE_deepmerge__["default"])(src_options, options, {
|
|
8550
8520
|
arrayMerge (_destination, source) {
|
|
8551
8521
|
return source;
|
|
@@ -8557,13 +8527,13 @@ function mergeWithDefaultOptions(options = {}) {
|
|
|
8557
8527
|
if (isTest()) newOptions.verbose = false;
|
|
8558
8528
|
return newOptions;
|
|
8559
8529
|
}
|
|
8560
|
-
/* ESM default export */ const
|
|
8530
|
+
/* ESM default export */ const mergeWithDefaultOptions = mergeWithDefaultOptions_mergeWithDefaultOptions;
|
|
8561
8531
|
class VideomailClient extends util_Despot {
|
|
8562
8532
|
container;
|
|
8563
8533
|
static ENC_TYPE_APP_JSON = constants.public.ENC_TYPE_APP_JSON;
|
|
8564
8534
|
static ENC_TYPE_FORM = constants.public.ENC_TYPE_FORM;
|
|
8565
8535
|
constructor(options = {}){
|
|
8566
|
-
super("VideomailClient",
|
|
8536
|
+
super("VideomailClient", mergeWithDefaultOptions(options));
|
|
8567
8537
|
this.validateOptions();
|
|
8568
8538
|
util_Despot.removeAllListeners();
|
|
8569
8539
|
this.container = new wrappers_container(this.options);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { IBrowser, ICPU, IDevice, IEngine, IOS } from "ua-parser-js";
|
|
2
2
|
import { VideomailClientOptions } from "../../types/options";
|
|
3
|
+
import HTTPError from "./HTTPError";
|
|
3
4
|
export interface ErrData extends ErrorOptions {
|
|
4
5
|
explanation: string | undefined;
|
|
5
6
|
logLines?: string[] | undefined;
|
|
6
7
|
err?: Error | undefined;
|
|
7
8
|
}
|
|
8
|
-
declare class VideomailError extends
|
|
9
|
+
declare class VideomailError extends HTTPError {
|
|
9
10
|
readonly title = "videomail-client error";
|
|
10
11
|
readonly location: string;
|
|
11
12
|
explanation: string | undefined;
|
|
@@ -31,7 +32,6 @@ declare class VideomailError extends Error {
|
|
|
31
32
|
static readonly BROWSER_PROBLEM = "browser-problem";
|
|
32
33
|
static readonly WEBCAM_PROBLEM = "webcam-problem";
|
|
33
34
|
static readonly OVERCONSTRAINED = "OverconstrainedError";
|
|
34
|
-
static readonly NOT_FOUND_ERROR = "NotFoundError";
|
|
35
35
|
static readonly NOT_READABLE_ERROR = "NotReadableError";
|
|
36
36
|
static readonly SECURITY_ERROR = "SecurityError";
|
|
37
37
|
static readonly TRACK_START_ERROR = "TrackStartError";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import VideomailError from "./VideomailError";
|
|
2
2
|
import { VideomailClientOptions } from "../../types/options";
|
|
3
|
+
import HTTPError from "./HTTPError";
|
|
3
4
|
interface ErrorParams {
|
|
4
|
-
err?:
|
|
5
|
+
err?: HTTPError;
|
|
5
6
|
exc?: unknown;
|
|
6
7
|
message?: string;
|
|
7
8
|
explanation?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "videomail-client",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.6",
|
|
4
4
|
"description": "A wicked npm package to record videos directly in the browser, wohooo!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webcam",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"prettier:fix": "prettier --write ./etc ./src ./.storybook ./*.ts",
|
|
50
50
|
"release": "release-it --only-version --config ./etc/release-it.ts",
|
|
51
51
|
"storybook": "cross-env BROWSER=chromium storybook dev -p 8443 --https --ssl-cert ./etc/ssl-certs/localhost.crt --ssl-key ./etc/ssl-certs/localhost.key",
|
|
52
|
-
"test": "cross-env ENVIRON=test vitest",
|
|
52
|
+
"test": "cross-env ENVIRON=test vitest --watch=false",
|
|
53
53
|
"types:check": "tsc --noEmit",
|
|
54
54
|
"types:config": "tsc --showConfig"
|
|
55
55
|
},
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"eslint-plugin-storybook": "0.11.0",
|
|
106
106
|
"globals": "15.12.0",
|
|
107
107
|
"jsdom": "25.0.1",
|
|
108
|
-
"msw": "2.6.
|
|
108
|
+
"msw": "2.6.5",
|
|
109
109
|
"msw-storybook-addon": "2.0.4",
|
|
110
110
|
"prettier": "3.3.3",
|
|
111
111
|
"prettier-plugin-curly": "0.3.1",
|