videomail-client 9.3.2 → 9.3.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.
@@ -3,12 +3,10 @@
3
3
  "files.trimTrailingWhitespace": true,
4
4
  "editor.defaultFormatter": "esbenp.prettier-vscode",
5
5
  "editor.formatOnSave": true,
6
+ "editor.codeActionsOnSave": {
7
+ "source.fixAll.eslint": "always"
8
+ },
6
9
  "prettier.configPath": "./prettier.config.cjs",
7
- "editor.codeActionsOnSave": [
8
- // Sort package.json keys with
9
- // https://marketplace.visualstudio.com/items?itemName=unional.vscode-sort-package-json
10
- "source.sortPackageJson"
11
- ],
12
10
  "cSpell.words": [
13
11
  "animitter",
14
12
  "autobuffer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "9.3.2",
3
+ "version": "9.3.3",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -68,7 +68,7 @@
68
68
  "number-is-integer": "2.0.0",
69
69
  "request-frame": "1.5.3",
70
70
  "safe-json-stringify": "1.2.0",
71
- "superagent": "8.1.2",
71
+ "superagent": "10.1.0",
72
72
  "ua-parser-js": "1.0.39",
73
73
  "websocket-stream": "5.5.2"
74
74
  },
@@ -111,7 +111,7 @@
111
111
  "postcss": "8.4.47",
112
112
  "prettier": "3.3.3",
113
113
  "prettier-plugin-curly": "0.2.2",
114
- "prettier-plugin-organize-imports": "4.0.0",
114
+ "prettier-plugin-organize-imports": "4.1.0",
115
115
  "prettier-plugin-packagejson": "2.5.2",
116
116
  "prettier-plugin-sh": "0.14.0",
117
117
  "router": "1.3.8",
@@ -13762,14 +13762,18 @@ function getStateLength (state) {
13762
13762
  },{}],103:[function(_dereq_,module,exports){
13763
13763
  "use strict";
13764
13764
 
13765
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
13766
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13767
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13768
- function Agent() {
13769
- this._defaults = [];
13770
- }
13771
- for (var _i = 0, _arr = ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts']; _i < _arr.length; _i++) {
13772
- const fn = _arr[_i];
13765
+ const defaults = ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts'];
13766
+ class Agent {
13767
+ constructor() {
13768
+ this._defaults = [];
13769
+ }
13770
+ _setDefaults(request) {
13771
+ for (const def of this._defaults) {
13772
+ request[def.fn](...def.args);
13773
+ }
13774
+ }
13775
+ }
13776
+ for (const fn of defaults) {
13773
13777
  // Default setting for all requests from this agent
13774
13778
  Agent.prototype[fn] = function () {
13775
13779
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -13782,28 +13786,11 @@ for (var _i = 0, _arr = ['use', 'on', 'once', 'set', 'query', 'type', 'accept',
13782
13786
  return this;
13783
13787
  };
13784
13788
  }
13785
- Agent.prototype._setDefaults = function (request) {
13786
- var _iterator = _createForOfIteratorHelper(this._defaults),
13787
- _step;
13788
- try {
13789
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
13790
- const def = _step.value;
13791
- request[def.fn](...def.args);
13792
- }
13793
- } catch (err) {
13794
- _iterator.e(err);
13795
- } finally {
13796
- _iterator.f();
13797
- }
13798
- };
13799
13789
  module.exports = Agent;
13800
13790
 
13801
13791
  },{}],104:[function(_dereq_,module,exports){
13802
13792
  "use strict";
13803
13793
 
13804
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
13805
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13806
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13807
13794
  /**
13808
13795
  * Root reference for iframes.
13809
13796
  */
@@ -13824,10 +13811,11 @@ const Emitter = _dereq_('component-emitter');
13824
13811
  const safeStringify = _dereq_('fast-safe-stringify');
13825
13812
  const qs = _dereq_('qs');
13826
13813
  const RequestBase = _dereq_('./request-base');
13827
- const _require = _dereq_('./utils'),
13828
- isObject = _require.isObject,
13829
- mixin = _require.mixin,
13830
- hasOwn = _require.hasOwn;
13814
+ const {
13815
+ isObject,
13816
+ mixin,
13817
+ hasOwn
13818
+ } = _dereq_('./utils');
13831
13819
  const ResponseBase = _dereq_('./response-base');
13832
13820
  const Agent = _dereq_('./agent-base');
13833
13821
 
@@ -13911,17 +13899,8 @@ function pushEncodedKeyValuePair(pairs, key, value) {
13911
13899
  return;
13912
13900
  }
13913
13901
  if (Array.isArray(value)) {
13914
- var _iterator = _createForOfIteratorHelper(value),
13915
- _step;
13916
- try {
13917
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
13918
- const v = _step.value;
13919
- pushEncodedKeyValuePair(pairs, key, v);
13920
- }
13921
- } catch (err) {
13922
- _iterator.e(err);
13923
- } finally {
13924
- _iterator.f();
13902
+ for (const v of value) {
13903
+ pushEncodedKeyValuePair(pairs, key, v);
13925
13904
  }
13926
13905
  } else if (isObject(value)) {
13927
13906
  for (const subkey in value) {
@@ -13995,7 +13974,12 @@ request.types = {
13995
13974
  */
13996
13975
 
13997
13976
  request.serialize = {
13998
- 'application/x-www-form-urlencoded': qs.stringify,
13977
+ 'application/x-www-form-urlencoded': obj => {
13978
+ return qs.stringify(obj, {
13979
+ indices: false,
13980
+ strictNullHandling: true
13981
+ });
13982
+ },
13999
13983
  'application/json': safeStringify
14000
13984
  };
14001
13985
 
@@ -14109,7 +14093,9 @@ function Response(request_) {
14109
14093
  // responseText is accessible only if responseType is '' or 'text' and on older browsers
14110
14094
  this.text = this.req.method !== 'HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text') || typeof this.xhr.responseType === 'undefined' ? this.xhr.responseText : null;
14111
14095
  this.statusText = this.req.xhr.statusText;
14112
- let status = this.xhr.status;
14096
+ let {
14097
+ status
14098
+ } = this.xhr;
14113
14099
  // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request
14114
14100
  if (status === 1223) {
14115
14101
  status = 204;
@@ -14160,9 +14146,15 @@ Response.prototype._parseBody = function (string_) {
14160
14146
  */
14161
14147
 
14162
14148
  Response.prototype.toError = function () {
14163
- const req = this.req;
14164
- const method = req.method;
14165
- const url = req.url;
14149
+ const {
14150
+ req
14151
+ } = this;
14152
+ const {
14153
+ method
14154
+ } = req;
14155
+ const {
14156
+ url
14157
+ } = req;
14166
14158
  const message = `cannot ${method} ${url} (${this.status})`;
14167
14159
  const error = new Error(message);
14168
14160
  error.status = this.status;
@@ -14482,13 +14474,17 @@ Request.prototype._end = function () {
14482
14474
  if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called'));
14483
14475
  const self = this;
14484
14476
  this.xhr = request.getXHR();
14485
- const xhr = this.xhr;
14477
+ const {
14478
+ xhr
14479
+ } = this;
14486
14480
  let data = this._formData || this._data;
14487
14481
  this._setTimeouts();
14488
14482
 
14489
14483
  // state change
14490
14484
  xhr.addEventListener('readystatechange', () => {
14491
- const readyState = xhr.readyState;
14485
+ const {
14486
+ readyState
14487
+ } = xhr;
14492
14488
  if (readyState >= 2 && self._responseTimeoutTimer) {
14493
14489
  clearTimeout(self._responseTimeoutTimer);
14494
14490
  }
@@ -14581,8 +14577,7 @@ Request.prototype._end = function () {
14581
14577
  xhr.send(typeof data === 'undefined' ? null : data);
14582
14578
  };
14583
14579
  request.agent = () => new Agent();
14584
- for (var _i = 0, _arr = ['GET', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE']; _i < _arr.length; _i++) {
14585
- const method = _arr[_i];
14580
+ for (const method of ['GET', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE']) {
14586
14581
  Agent.prototype[method.toLowerCase()] = function (url, fn) {
14587
14582
  const request_ = new request.Request(method, url);
14588
14583
  this._setDefaults(request_);
@@ -14744,17 +14739,15 @@ request.put = (url, data, fn) => {
14744
14739
  };
14745
14740
 
14746
14741
  },{"./agent-base":103,"./request-base":105,"./response-base":106,"./utils":107,"component-emitter":24,"fast-safe-stringify":45,"qs":81}],105:[function(_dereq_,module,exports){
14747
- (function (process){(function (){
14748
14742
  "use strict";
14749
14743
 
14750
- const semver = _dereq_('semver');
14751
-
14752
14744
  /**
14753
14745
  * Module of mixed-in functions shared between node and client code
14754
14746
  */
14755
- const _require = _dereq_('./utils'),
14756
- isObject = _require.isObject,
14757
- hasOwn = _require.hasOwn;
14747
+ const {
14748
+ isObject,
14749
+ hasOwn
14750
+ } = _dereq_('./utils');
14758
14751
 
14759
14752
  /**
14760
14753
  * Expose `RequestBase`.
@@ -15189,25 +15182,8 @@ RequestBase.prototype.abort = function () {
15189
15182
  this._aborted = true;
15190
15183
  if (this.xhr) this.xhr.abort(); // browser
15191
15184
  if (this.req) {
15192
- // Node v13 has major differences in `abort()`
15193
- // https://github.com/nodejs/node/blob/v12.x/lib/internal/streams/end-of-stream.js
15194
- // https://github.com/nodejs/node/blob/v13.x/lib/internal/streams/end-of-stream.js
15195
- // https://github.com/nodejs/node/blob/v14.x/lib/internal/streams/end-of-stream.js
15196
- // (if you run a diff across these you will see the differences)
15197
- //
15198
- // References:
15199
- // <https://github.com/nodejs/node/issues/31630>
15200
- // <https://github.com/ladjs/superagent/pull/1084/commits/dc18679a7c5ccfc6046d882015e5126888973bc8>
15201
- //
15202
- // Thanks to @shadowgate15 and @niftylettuce
15203
- if (semver.gte(process.version, 'v13.0.0') && semver.lt(process.version, 'v14.0.0')) {
15204
- // Note that the reason this doesn't work is because in v13 as compared to v14
15205
- // there is no `callback = nop` set in end-of-stream.js above
15206
- throw new Error('Superagent does not work in v13 properly with abort() due to Node.js core changes');
15207
- }
15208
15185
  this.req.abort(); // node
15209
15186
  }
15210
-
15211
15187
  this.clearTimeout();
15212
15188
  this.emit('abort');
15213
15189
  return this;
@@ -15483,8 +15459,7 @@ RequestBase.prototype._setTimeouts = function () {
15483
15459
  }
15484
15460
  };
15485
15461
 
15486
- }).call(this)}).call(this,_dereq_('_process'))
15487
- },{"./utils":107,"_process":79,"semver":16}],106:[function(_dereq_,module,exports){
15462
+ },{"./utils":107}],106:[function(_dereq_,module,exports){
15488
15463
  "use strict";
15489
15464
 
15490
15465
  /**
@@ -15608,9 +15583,6 @@ ResponseBase.prototype._setStatusProperties = function (status) {
15608
15583
  },{"./utils":107}],107:[function(_dereq_,module,exports){
15609
15584
  "use strict";
15610
15585
 
15611
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
15612
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15613
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15614
15586
  /**
15615
15587
  * Return the mime type for the given `str`.
15616
15588
  *
@@ -15631,20 +15603,11 @@ exports.type = string_ => string_.split(/ *; */).shift();
15631
15603
 
15632
15604
  exports.params = value => {
15633
15605
  const object = {};
15634
- var _iterator = _createForOfIteratorHelper(value.split(/ *; */)),
15635
- _step;
15636
- try {
15637
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
15638
- const string_ = _step.value;
15639
- const parts = string_.split(/ *= */);
15640
- const key = parts.shift();
15641
- const value = parts.shift();
15642
- if (key && value) object[key] = value;
15643
- }
15644
- } catch (err) {
15645
- _iterator.e(err);
15646
- } finally {
15647
- _iterator.f();
15606
+ for (const string_ of value.split(/ *; */)) {
15607
+ const parts = string_.split(/ *= */);
15608
+ const key = parts.shift();
15609
+ const value = parts.shift();
15610
+ if (key && value) object[key] = value;
15648
15611
  }
15649
15612
  return object;
15650
15613
  };
@@ -15659,20 +15622,11 @@ exports.params = value => {
15659
15622
 
15660
15623
  exports.parseLinks = value => {
15661
15624
  const object = {};
15662
- var _iterator2 = _createForOfIteratorHelper(value.split(/ *, */)),
15663
- _step2;
15664
- try {
15665
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
15666
- const string_ = _step2.value;
15667
- const parts = string_.split(/ *; */);
15668
- const url = parts[0].slice(1, -1);
15669
- const rel = parts[1].split(/ *= */)[1].slice(1, -1);
15670
- object[rel] = url;
15671
- }
15672
- } catch (err) {
15673
- _iterator2.e(err);
15674
- } finally {
15675
- _iterator2.f();
15625
+ for (const string_ of value.split(/ *, */)) {
15626
+ const parts = string_.split(/ *; */);
15627
+ const url = parts[0].slice(1, -1);
15628
+ const rel = parts[1].split(/ *= */)[1].slice(1, -1);
15629
+ object[rel] = url;
15676
15630
  }
15677
15631
  return object;
15678
15632
  };
@@ -15729,6 +15683,26 @@ exports.mixin = (target, source) => {
15729
15683
  }
15730
15684
  };
15731
15685
 
15686
+ /**
15687
+ * Check if the response is compressed using Gzip or Deflate.
15688
+ * @param {Object} res
15689
+ * @return {Boolean}
15690
+ */
15691
+
15692
+ exports.isGzipOrDeflateEncoding = res => {
15693
+ return new RegExp(/^\s*(?:deflate|gzip)\s*$/).test(res.headers['content-encoding']);
15694
+ };
15695
+
15696
+ /**
15697
+ * Check if the response is compressed using Brotli.
15698
+ * @param {Object} res
15699
+ * @return {Boolean}
15700
+ */
15701
+
15702
+ exports.isBrotliEncoding = res => {
15703
+ return new RegExp(/^\s*(?:br)\s*$/).test(res.headers['content-encoding']);
15704
+ };
15705
+
15732
15706
  },{}],108:[function(_dereq_,module,exports){
15733
15707
  (function (setImmediate,clearImmediate){(function (){
15734
15708
  var nextTick = _dereq_('process/browser.js').nextTick;
@@ -17360,7 +17334,7 @@ function wrappy (fn, cb) {
17360
17334
  },{}],116:[function(_dereq_,module,exports){
17361
17335
  module.exports={
17362
17336
  "name": "videomail-client",
17363
- "version": "9.3.2",
17337
+ "version": "9.3.3",
17364
17338
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
17365
17339
  "keywords": [
17366
17340
  "webcam",
@@ -17428,7 +17402,7 @@ module.exports={
17428
17402
  "number-is-integer": "2.0.0",
17429
17403
  "request-frame": "1.5.3",
17430
17404
  "safe-json-stringify": "1.2.0",
17431
- "superagent": "8.1.2",
17405
+ "superagent": "10.1.0",
17432
17406
  "ua-parser-js": "1.0.39",
17433
17407
  "websocket-stream": "5.5.2"
17434
17408
  },
@@ -17471,7 +17445,7 @@ module.exports={
17471
17445
  "postcss": "8.4.47",
17472
17446
  "prettier": "3.3.3",
17473
17447
  "prettier-plugin-curly": "0.2.2",
17474
- "prettier-plugin-organize-imports": "4.0.0",
17448
+ "prettier-plugin-organize-imports": "4.1.0",
17475
17449
  "prettier-plugin-packagejson": "2.5.2",
17476
17450
  "prettier-plugin-sh": "0.14.0",
17477
17451
  "router": "1.3.8",