@feathersjs/client 4.5.15 → 4.5.17

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/feathers.js CHANGED
@@ -22,12 +22,12 @@ return /******/ (function() { // webpackBootstrap
22
22
  /**
23
23
  * This is the web browser implementation of `debug()`.
24
24
  */
25
+
25
26
  exports.formatArgs = formatArgs;
26
27
  exports.save = save;
27
28
  exports.load = load;
28
29
  exports.useColors = useColors;
29
30
  exports.storage = localstorage();
30
-
31
31
  exports.destroy = function () {
32
32
  var warned = false;
33
33
  return function () {
@@ -37,12 +37,13 @@ exports.destroy = function () {
37
37
  }
38
38
  };
39
39
  }();
40
+
40
41
  /**
41
42
  * Colors.
42
43
  */
43
44
 
44
-
45
45
  exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
46
+
46
47
  /**
47
48
  * Currently only WebKit-based Web Inspectors, Firefox >= v31,
48
49
  * and the Firebug extension (any Firefox version) are known
@@ -50,57 +51,57 @@ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066F
50
51
  *
51
52
  * TODO: add a `localStorage` variable to explicitly enable/disable colors
52
53
  */
53
- // eslint-disable-next-line complexity
54
54
 
55
+ // eslint-disable-next-line complexity
55
56
  function useColors() {
56
57
  // NB: In an Electron preload script, document will be defined but not fully
57
58
  // initialized. Since we know we're in Chrome, we'll just detect this case
58
59
  // explicitly
59
60
  if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
60
61
  return true;
61
- } // Internet Explorer and Edge do not support colors.
62
-
62
+ }
63
63
 
64
+ // Internet Explorer and Edge do not support colors.
64
65
  if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
65
66
  return false;
66
- } // Is webkit? http://stackoverflow.com/a/16459606/376773
67
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
68
-
67
+ }
69
68
 
70
- return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
71
- typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
69
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
70
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
71
+ return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
72
+ // Is firebug? http://stackoverflow.com/a/398120/376773
73
+ typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
74
+ // Is firefox >= v31?
72
75
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
73
- typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
76
+ typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
77
+ // Double check webkit in userAgent just in case we are in a worker
74
78
  typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
75
79
  }
80
+
76
81
  /**
77
82
  * Colorize log arguments if enabled.
78
83
  *
79
84
  * @api public
80
85
  */
81
86
 
82
-
83
87
  function formatArgs(args) {
84
88
  args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
85
-
86
89
  if (!this.useColors) {
87
90
  return;
88
91
  }
89
-
90
92
  var c = 'color: ' + this.color;
91
- args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
93
+ args.splice(1, 0, c, 'color: inherit');
94
+
95
+ // The final "%c" is somewhat tricky, because there could be other
92
96
  // arguments passed either before or after the %c, so we need to
93
97
  // figure out the correct index to insert the CSS into
94
-
95
98
  var index = 0;
96
99
  var lastC = 0;
97
100
  args[0].replace(/%[a-zA-Z%]/g, function (match) {
98
101
  if (match === '%%') {
99
102
  return;
100
103
  }
101
-
102
104
  index++;
103
-
104
105
  if (match === '%c') {
105
106
  // We only are interested in the *last* %c
106
107
  // (the user may have provided their own)
@@ -109,6 +110,7 @@ function formatArgs(args) {
109
110
  });
110
111
  args.splice(lastC, 0, c);
111
112
  }
113
+
112
114
  /**
113
115
  * Invokes `console.debug()` when available.
114
116
  * No-op when `console.debug` is not a "function".
@@ -117,17 +119,14 @@ function formatArgs(args) {
117
119
  *
118
120
  * @api public
119
121
  */
120
-
121
-
122
122
  exports.log = console.debug || console.log || function () {};
123
+
123
124
  /**
124
125
  * Save `namespaces`.
125
126
  *
126
127
  * @param {String} namespaces
127
128
  * @api private
128
129
  */
129
-
130
-
131
130
  function save(namespaces) {
132
131
  try {
133
132
  if (namespaces) {
@@ -135,34 +134,34 @@ function save(namespaces) {
135
134
  } else {
136
135
  exports.storage.removeItem('debug');
137
136
  }
138
- } catch (error) {// Swallow
137
+ } catch (error) {
138
+ // Swallow
139
139
  // XXX (@Qix-) should we be logging these?
140
140
  }
141
141
  }
142
+
142
143
  /**
143
144
  * Load `namespaces`.
144
145
  *
145
146
  * @return {String} returns the previously persisted debug modes
146
147
  * @api private
147
148
  */
148
-
149
-
150
149
  function load() {
151
150
  var r;
152
-
153
151
  try {
154
152
  r = exports.storage.getItem('debug');
155
- } catch (error) {// Swallow
153
+ } catch (error) {
154
+ // Swallow
156
155
  // XXX (@Qix-) should we be logging these?
157
- } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
158
-
156
+ }
159
157
 
158
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
160
159
  if (!r && typeof process !== 'undefined' && 'env' in process) {
161
160
  r = process.env.DEBUG;
162
161
  }
163
-
164
162
  return r;
165
163
  }
164
+
166
165
  /**
167
166
  * Localstorage attempts to return the localstorage.
168
167
  *
@@ -174,19 +173,19 @@ function load() {
174
173
  * @api private
175
174
  */
176
175
 
177
-
178
176
  function localstorage() {
179
177
  try {
180
178
  // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
181
179
  // The Browser also has localStorage in the global context.
182
180
  return localStorage;
183
- } catch (error) {// Swallow
181
+ } catch (error) {
182
+ // Swallow
184
183
  // XXX (@Qix-) should we be logging these?
185
184
  }
186
185
  }
187
-
188
186
  module.exports = __webpack_require__(/*! ./common */ "../../node_modules/debug/src/common.js")(exports);
189
187
  var formatters = module.exports.formatters;
188
+
190
189
  /**
191
190
  * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
192
191
  */
@@ -208,21 +207,16 @@ formatters.j = function (v) {
208
207
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
209
208
 
210
209
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
211
-
212
210
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
213
-
214
211
  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); }
215
-
216
212
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
217
-
218
213
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
219
-
220
- 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; }
221
-
214
+ 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; }
222
215
  /**
223
216
  * This is the common logic for both the Node.js and web browser
224
217
  * implementations of `debug()`.
225
218
  */
219
+
226
220
  function setup(env) {
227
221
  createDebug.debug = createDebug;
228
222
  createDebug.default = createDebug;
@@ -235,29 +229,29 @@ function setup(env) {
235
229
  Object.keys(env).forEach(function (key) {
236
230
  createDebug[key] = env[key];
237
231
  });
232
+
238
233
  /**
239
234
  * The currently active debug mode names, and names to skip.
240
235
  */
241
236
 
242
237
  createDebug.names = [];
243
238
  createDebug.skips = [];
239
+
244
240
  /**
245
241
  * Map of special "%n" handling functions, for the debug "format" argument.
246
242
  *
247
243
  * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
248
244
  */
249
-
250
245
  createDebug.formatters = {};
246
+
251
247
  /**
252
248
  * Selects a color for a debug namespace
253
249
  * @param {String} namespace The namespace string for the debug instance to be colored
254
250
  * @return {Number|String} An ANSI color code for the given namespace
255
251
  * @api private
256
252
  */
257
-
258
253
  function selectColor(namespace) {
259
254
  var hash = 0;
260
-
261
255
  for (var i = 0; i < namespace.length; i++) {
262
256
  hash = (hash << 5) - hash + namespace.charCodeAt(i);
263
257
  hash |= 0; // Convert to 32bit integer
@@ -265,8 +259,8 @@ function setup(env) {
265
259
 
266
260
  return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
267
261
  }
268
-
269
262
  createDebug.selectColor = selectColor;
263
+
270
264
  /**
271
265
  * Create a debugger with the given `namespace`.
272
266
  *
@@ -274,25 +268,22 @@ function setup(env) {
274
268
  * @return {Function}
275
269
  * @api public
276
270
  */
277
-
278
271
  function createDebug(namespace) {
279
272
  var prevTime;
280
273
  var enableOverride = null;
281
274
  var namespacesCache;
282
275
  var enabledCache;
283
-
284
276
  function debug() {
285
277
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
286
278
  args[_key] = arguments[_key];
287
279
  }
288
-
289
280
  // Disabled?
290
281
  if (!debug.enabled) {
291
282
  return;
292
283
  }
284
+ var self = debug;
293
285
 
294
- var self = debug; // Set `diff` timestamp
295
-
286
+ // Set `diff` timestamp
296
287
  var curr = Number(new Date());
297
288
  var ms = curr - (prevTime || curr);
298
289
  self.diff = ms;
@@ -300,39 +291,36 @@ function setup(env) {
300
291
  self.curr = curr;
301
292
  prevTime = curr;
302
293
  args[0] = createDebug.coerce(args[0]);
303
-
304
294
  if (typeof args[0] !== 'string') {
305
295
  // Anything else let's inspect with %O
306
296
  args.unshift('%O');
307
- } // Apply any `formatters` transformations
308
-
297
+ }
309
298
 
299
+ // Apply any `formatters` transformations
310
300
  var index = 0;
311
301
  args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
312
302
  // If we encounter an escaped % then don't increase the array index
313
303
  if (match === '%%') {
314
304
  return '%';
315
305
  }
316
-
317
306
  index++;
318
307
  var formatter = createDebug.formatters[format];
319
-
320
308
  if (typeof formatter === 'function') {
321
309
  var val = args[index];
322
- match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
310
+ match = formatter.call(self, val);
323
311
 
312
+ // Now we need to remove `args[index]` since it's inlined in the `format`
324
313
  args.splice(index, 1);
325
314
  index--;
326
315
  }
327
-
328
316
  return match;
329
- }); // Apply env-specific formatting (colors, etc.)
317
+ });
330
318
 
319
+ // Apply env-specific formatting (colors, etc.)
331
320
  createDebug.formatArgs.call(self, args);
332
321
  var logFn = self.log || createDebug.log;
333
322
  logFn.apply(self, args);
334
323
  }
335
-
336
324
  debug.namespace = namespace;
337
325
  debug.useColors = createDebug.useColors();
338
326
  debug.color = createDebug.selectColor(namespace);
@@ -346,31 +334,29 @@ function setup(env) {
346
334
  if (enableOverride !== null) {
347
335
  return enableOverride;
348
336
  }
349
-
350
337
  if (namespacesCache !== createDebug.namespaces) {
351
338
  namespacesCache = createDebug.namespaces;
352
339
  enabledCache = createDebug.enabled(namespace);
353
340
  }
354
-
355
341
  return enabledCache;
356
342
  },
357
343
  set: function set(v) {
358
344
  enableOverride = v;
359
345
  }
360
- }); // Env-specific initialization logic for debug instances
346
+ });
361
347
 
348
+ // Env-specific initialization logic for debug instances
362
349
  if (typeof createDebug.init === 'function') {
363
350
  createDebug.init(debug);
364
351
  }
365
-
366
352
  return debug;
367
353
  }
368
-
369
354
  function extend(namespace, delimiter) {
370
355
  var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
371
356
  newDebug.log = this.log;
372
357
  return newDebug;
373
358
  }
359
+
374
360
  /**
375
361
  * Enables a debug mode by namespaces. This can include modes
376
362
  * separated by a colon and wildcards.
@@ -378,8 +364,6 @@ function setup(env) {
378
364
  * @param {String} namespaces
379
365
  * @api public
380
366
  */
381
-
382
-
383
367
  function enable(namespaces) {
384
368
  createDebug.save(namespaces);
385
369
  createDebug.namespaces = namespaces;
@@ -388,15 +372,12 @@ function setup(env) {
388
372
  var i;
389
373
  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
390
374
  var len = split.length;
391
-
392
375
  for (i = 0; i < len; i++) {
393
376
  if (!split[i]) {
394
377
  // ignore empty strings
395
378
  continue;
396
379
  }
397
-
398
380
  namespaces = split[i].replace(/\*/g, '.*?');
399
-
400
381
  if (namespaces[0] === '-') {
401
382
  createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
402
383
  } else {
@@ -404,14 +385,13 @@ function setup(env) {
404
385
  }
405
386
  }
406
387
  }
388
+
407
389
  /**
408
390
  * Disable debug output.
409
391
  *
410
392
  * @return {String} namespaces
411
393
  * @api public
412
394
  */
413
-
414
-
415
395
  function disable() {
416
396
  var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) {
417
397
  return '-' + namespace;
@@ -419,6 +399,7 @@ function setup(env) {
419
399
  createDebug.enable('');
420
400
  return namespaces;
421
401
  }
402
+
422
403
  /**
423
404
  * Returns true if the given mode name is enabled, false otherwise.
424
405
  *
@@ -426,30 +407,25 @@ function setup(env) {
426
407
  * @return {Boolean}
427
408
  * @api public
428
409
  */
429
-
430
-
431
410
  function enabled(name) {
432
411
  if (name[name.length - 1] === '*') {
433
412
  return true;
434
413
  }
435
-
436
414
  var i;
437
415
  var len;
438
-
439
416
  for (i = 0, len = createDebug.skips.length; i < len; i++) {
440
417
  if (createDebug.skips[i].test(name)) {
441
418
  return false;
442
419
  }
443
420
  }
444
-
445
421
  for (i = 0, len = createDebug.names.length; i < len; i++) {
446
422
  if (createDebug.names[i].test(name)) {
447
423
  return true;
448
424
  }
449
425
  }
450
-
451
426
  return false;
452
427
  }
428
+
453
429
  /**
454
430
  * Convert regexp to namespace
455
431
  *
@@ -457,11 +433,10 @@ function setup(env) {
457
433
  * @return {String} namespace
458
434
  * @api private
459
435
  */
460
-
461
-
462
436
  function toNamespace(regexp) {
463
437
  return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
464
438
  }
439
+
465
440
  /**
466
441
  * Coerce `val`.
467
442
  *
@@ -469,29 +444,23 @@ function setup(env) {
469
444
  * @return {Mixed}
470
445
  * @api private
471
446
  */
472
-
473
-
474
447
  function coerce(val) {
475
448
  if (val instanceof Error) {
476
449
  return val.stack || val.message;
477
450
  }
478
-
479
451
  return val;
480
452
  }
453
+
481
454
  /**
482
455
  * XXX DO NOT USE. This is a temporary stub function.
483
456
  * XXX It WILL be removed in the next major release.
484
457
  */
485
-
486
-
487
458
  function destroy() {
488
459
  console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
489
460
  }
490
-
491
461
  createDebug.enable(createDebug.load());
492
462
  return createDebug;
493
463
  }
494
-
495
464
  module.exports = setup;
496
465
 
497
466
  /***/ }),
@@ -505,63 +474,47 @@ module.exports = setup;
505
474
  "use strict";
506
475
 
507
476
 
477
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
508
478
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
509
-
510
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
511
-
479
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
512
480
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
513
-
481
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
482
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
514
483
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
515
-
516
484
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
517
-
518
485
  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); }
519
-
520
- 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; }
521
-
522
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
523
-
486
+ 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; }
487
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
524
488
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
525
-
526
489
  Object.defineProperty(exports, "__esModule", ({
527
490
  value: true
528
491
  }));
529
492
  exports.AuthenticationClient = void 0;
530
-
531
493
  var errors_1 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
532
-
533
494
  var storage_1 = __webpack_require__(/*! ./storage */ "../authentication-client/lib/storage.js");
534
-
535
495
  var getMatch = function getMatch(location, key) {
536
496
  var regex = new RegExp("(?:&?)".concat(key, "=([^&]*)"));
537
497
  var match = location.hash ? location.hash.match(regex) : null;
538
-
539
498
  if (match !== null) {
540
499
  var _match = _slicedToArray(match, 2),
541
- value = _match[1];
542
-
500
+ value = _match[1];
543
501
  return [value, regex];
544
502
  }
545
-
546
503
  return [null, regex];
547
504
  };
548
-
549
505
  var AuthenticationClient = /*#__PURE__*/function () {
550
506
  function AuthenticationClient(app, options) {
551
507
  _classCallCheck(this, AuthenticationClient);
552
-
553
508
  var socket = app.io || app.primus;
554
509
  var storage = new storage_1.StorageWrapper(app.get('storage') || options.storage);
555
510
  this.app = app;
556
511
  this.options = options;
557
512
  this.authenticated = false;
558
513
  this.app.set('storage', storage);
559
-
560
514
  if (socket) {
561
515
  this.handleSocket(socket);
562
516
  }
563
517
  }
564
-
565
518
  _createClass(AuthenticationClient, [{
566
519
  key: "service",
567
520
  get: function get() {
@@ -576,7 +529,6 @@ var AuthenticationClient = /*#__PURE__*/function () {
576
529
  key: "handleSocket",
577
530
  value: function handleSocket(socket) {
578
531
  var _this = this;
579
-
580
532
  // Connection events happen on every reconnect
581
533
  var connected = this.app.io ? 'connect' : 'open';
582
534
  var disconnected = this.app.io ? 'disconnect' : 'disconnection';
@@ -585,13 +537,13 @@ var AuthenticationClient = /*#__PURE__*/function () {
585
537
  return socket.once(connected, function (data) {
586
538
  return resolve(data);
587
539
  });
588
- }) // Only reconnect when `reAuthenticate()` or `authenticate()`
540
+ })
541
+ // Only reconnect when `reAuthenticate()` or `authenticate()`
589
542
  // has been called explicitly first
590
543
  // Force reauthentication with the server
591
544
  .then(function () {
592
545
  return _this.authenticated ? _this.reAuthenticate(true) : null;
593
546
  });
594
-
595
547
  _this.app.set('authentication', authPromise);
596
548
  });
597
549
  }
@@ -599,25 +551,21 @@ var AuthenticationClient = /*#__PURE__*/function () {
599
551
  key: "getFromLocation",
600
552
  value: function getFromLocation(location) {
601
553
  var _getMatch = getMatch(location, this.options.locationKey),
602
- _getMatch2 = _slicedToArray(_getMatch, 2),
603
- accessToken = _getMatch2[0],
604
- tokenRegex = _getMatch2[1];
605
-
554
+ _getMatch2 = _slicedToArray(_getMatch, 2),
555
+ accessToken = _getMatch2[0],
556
+ tokenRegex = _getMatch2[1];
606
557
  if (accessToken !== null) {
607
558
  location.hash = location.hash.replace(tokenRegex, '');
608
559
  return Promise.resolve(accessToken);
609
560
  }
610
-
611
561
  var _getMatch3 = getMatch(location, this.options.locationErrorKey),
612
- _getMatch4 = _slicedToArray(_getMatch3, 2),
613
- message = _getMatch4[0],
614
- errorRegex = _getMatch4[1];
615
-
562
+ _getMatch4 = _slicedToArray(_getMatch3, 2),
563
+ message = _getMatch4[0],
564
+ errorRegex = _getMatch4[1];
616
565
  if (message !== null) {
617
566
  location.hash = location.hash.replace(errorRegex, '');
618
567
  return Promise.reject(new errors_1.NotAuthenticated(decodeURIComponent(message)));
619
568
  }
620
-
621
569
  return Promise.resolve(null);
622
570
  }
623
571
  }, {
@@ -629,12 +577,10 @@ var AuthenticationClient = /*#__PURE__*/function () {
629
577
  key: "getAccessToken",
630
578
  value: function getAccessToken() {
631
579
  var _this2 = this;
632
-
633
580
  return this.storage.getItem(this.options.storageKey).then(function (accessToken) {
634
581
  if (!accessToken && typeof window !== 'undefined' && window.location) {
635
582
  return _this2.getFromLocation(window.location);
636
583
  }
637
-
638
584
  return accessToken || null;
639
585
  });
640
586
  }
@@ -654,7 +600,6 @@ var AuthenticationClient = /*#__PURE__*/function () {
654
600
  key: "handleError",
655
601
  value: function handleError(error, type) {
656
602
  var _this3 = this;
657
-
658
603
  if (error.code === 401 || error.code === 403) {
659
604
  var promise = this.removeAccessToken().then(function () {
660
605
  return _this3.reset();
@@ -663,52 +608,42 @@ var AuthenticationClient = /*#__PURE__*/function () {
663
608
  return Promise.reject(error);
664
609
  });
665
610
  }
666
-
667
611
  return Promise.reject(error);
668
612
  }
669
613
  }, {
670
614
  key: "reAuthenticate",
671
615
  value: function reAuthenticate() {
672
616
  var _this4 = this;
673
-
674
617
  var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
675
618
  var strategy = arguments.length > 1 ? arguments[1] : undefined;
676
619
  // Either returns the authentication state or
677
620
  // tries to re-authenticate with the stored JWT and strategy
678
621
  var authPromise = this.app.get('authentication');
679
-
680
622
  if (!authPromise || force === true) {
681
623
  return this.getAccessToken().then(function (accessToken) {
682
624
  if (!accessToken) {
683
625
  throw new errors_1.NotAuthenticated('No accessToken found in storage');
684
626
  }
685
-
686
627
  return _this4.authenticate({
687
628
  strategy: strategy || _this4.options.jwtStrategy,
688
629
  accessToken: accessToken
689
630
  });
690
631
  });
691
632
  }
692
-
693
633
  return authPromise;
694
634
  }
695
635
  }, {
696
636
  key: "authenticate",
697
637
  value: function authenticate(authentication, params) {
698
638
  var _this5 = this;
699
-
700
639
  if (!authentication) {
701
640
  return this.reAuthenticate();
702
641
  }
703
-
704
642
  var promise = this.service.create(authentication, params).then(function (authResult) {
705
643
  var accessToken = authResult.accessToken;
706
644
  _this5.authenticated = true;
707
-
708
645
  _this5.app.emit('login', authResult);
709
-
710
646
  _this5.app.emit('authenticated', authResult);
711
-
712
647
  return _this5.setAccessToken(accessToken).then(function () {
713
648
  return authResult;
714
649
  });
@@ -722,14 +657,12 @@ var AuthenticationClient = /*#__PURE__*/function () {
722
657
  key: "logout",
723
658
  value: function logout() {
724
659
  var _this6 = this;
725
-
726
660
  return Promise.resolve(this.app.get('authentication')).then(function () {
727
661
  return _this6.service.remove(null).then(function (authResult) {
728
662
  return _this6.removeAccessToken().then(function () {
729
663
  return _this6.reset();
730
664
  }).then(function () {
731
665
  _this6.app.emit('logout', authResult);
732
-
733
666
  return authResult;
734
667
  });
735
668
  });
@@ -738,10 +671,8 @@ var AuthenticationClient = /*#__PURE__*/function () {
738
671
  });
739
672
  }
740
673
  }]);
741
-
742
674
  return AuthenticationClient;
743
675
  }();
744
-
745
676
  exports.AuthenticationClient = AuthenticationClient;
746
677
 
747
678
  /***/ }),
@@ -759,31 +690,25 @@ Object.defineProperty(exports, "__esModule", ({
759
690
  value: true
760
691
  }));
761
692
  exports.authentication = void 0;
762
-
763
693
  var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
764
-
765
694
  var authentication = function authentication() {
766
695
  return function (context) {
767
696
  var app = context.app,
768
- params = context.params,
769
- path = context.path,
770
- method = context.method,
771
- service = context.app.authentication;
772
-
697
+ params = context.params,
698
+ path = context.path,
699
+ method = context.method,
700
+ service = context.app.authentication;
773
701
  if ((0, commons_1.stripSlashes)(service.options.path) === path && method === 'create') {
774
702
  return context;
775
703
  }
776
-
777
704
  return Promise.resolve(app.get('authentication')).then(function (authResult) {
778
705
  if (authResult) {
779
706
  context.params = Object.assign({}, authResult, params);
780
707
  }
781
-
782
708
  return context;
783
709
  });
784
710
  };
785
711
  };
786
-
787
712
  exports.authentication = authentication;
788
713
 
789
714
  /***/ }),
@@ -801,18 +726,14 @@ Object.defineProperty(exports, "__esModule", ({
801
726
  value: true
802
727
  }));
803
728
  exports.populateHeader = exports.authentication = void 0;
804
-
805
729
  var authentication_1 = __webpack_require__(/*! ./authentication */ "../authentication-client/lib/hooks/authentication.js");
806
-
807
730
  Object.defineProperty(exports, "authentication", ({
808
731
  enumerable: true,
809
732
  get: function get() {
810
733
  return authentication_1.authentication;
811
734
  }
812
735
  }));
813
-
814
736
  var populate_header_1 = __webpack_require__(/*! ./populate-header */ "../authentication-client/lib/hooks/populate-header.js");
815
-
816
737
  Object.defineProperty(exports, "populateHeader", ({
817
738
  enumerable: true,
818
739
  get: function get() {
@@ -831,31 +752,30 @@ Object.defineProperty(exports, "populateHeader", ({
831
752
  "use strict";
832
753
 
833
754
 
834
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
835
-
755
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
756
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
757
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
758
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
836
759
  Object.defineProperty(exports, "__esModule", ({
837
760
  value: true
838
761
  }));
839
762
  exports.populateHeader = void 0;
840
-
841
763
  var populateHeader = function populateHeader() {
842
764
  return function (context) {
843
765
  var app = context.app,
844
- accessToken = context.params.accessToken;
845
- var authentication = app.authentication; // Set REST header if necessary
846
-
766
+ accessToken = context.params.accessToken;
767
+ var authentication = app.authentication;
768
+ // Set REST header if necessary
847
769
  if (app.rest && accessToken) {
848
770
  var _authentication$optio = authentication.options,
849
- scheme = _authentication$optio.scheme,
850
- header = _authentication$optio.header;
771
+ scheme = _authentication$optio.scheme,
772
+ header = _authentication$optio.header;
851
773
  var authHeader = "".concat(scheme, " ").concat(accessToken);
852
774
  context.params.headers = Object.assign({}, _defineProperty({}, header, authHeader), context.params.headers);
853
775
  }
854
-
855
776
  return context;
856
777
  };
857
778
  };
858
-
859
779
  exports.populateHeader = populateHeader;
860
780
 
861
781
  /***/ }),
@@ -872,7 +792,6 @@ exports.populateHeader = populateHeader;
872
792
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
873
793
  if (k2 === undefined) k2 = k;
874
794
  var desc = Object.getOwnPropertyDescriptor(m, k);
875
-
876
795
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
877
796
  desc = {
878
797
  enumerable: true,
@@ -881,13 +800,11 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
881
800
  }
882
801
  };
883
802
  }
884
-
885
803
  Object.defineProperty(o, k2, desc);
886
804
  } : function (o, m, k, k2) {
887
805
  if (k2 === undefined) k2 = k;
888
806
  o[k2] = m[k];
889
807
  });
890
-
891
808
  var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
892
809
  Object.defineProperty(o, "default", {
893
810
  enumerable: true,
@@ -896,54 +813,39 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun
896
813
  } : function (o, v) {
897
814
  o["default"] = v;
898
815
  });
899
-
900
816
  var __importStar = this && this.__importStar || function (mod) {
901
817
  if (mod && mod.__esModule) return mod;
902
818
  var result = {};
903
- if (mod != null) for (var k in mod) {
904
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
905
- }
906
-
819
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
907
820
  __setModuleDefault(result, mod);
908
-
909
821
  return result;
910
822
  };
911
-
912
823
  Object.defineProperty(exports, "__esModule", ({
913
824
  value: true
914
825
  }));
915
826
  exports.defaults = exports.defaultStorage = exports.hooks = exports.MemoryStorage = exports.AuthenticationClient = exports.getDefaultStorage = void 0;
916
-
917
827
  var core_1 = __webpack_require__(/*! ./core */ "../authentication-client/lib/core.js");
918
-
919
828
  Object.defineProperty(exports, "AuthenticationClient", ({
920
829
  enumerable: true,
921
830
  get: function get() {
922
831
  return core_1.AuthenticationClient;
923
832
  }
924
833
  }));
925
-
926
834
  var hooks = __importStar(__webpack_require__(/*! ./hooks */ "../authentication-client/lib/hooks/index.js"));
927
-
928
835
  exports.hooks = hooks;
929
-
930
836
  var storage_1 = __webpack_require__(/*! ./storage */ "../authentication-client/lib/storage.js");
931
-
932
837
  Object.defineProperty(exports, "MemoryStorage", ({
933
838
  enumerable: true,
934
839
  get: function get() {
935
840
  return storage_1.MemoryStorage;
936
841
  }
937
842
  }));
938
-
939
843
  var getDefaultStorage = function getDefaultStorage() {
940
844
  try {
941
845
  return new storage_1.StorageWrapper(window.localStorage);
942
846
  } catch (error) {}
943
-
944
847
  return new storage_1.MemoryStorage();
945
848
  };
946
-
947
849
  exports.getDefaultStorage = getDefaultStorage;
948
850
  exports.defaultStorage = (0, exports.getDefaultStorage)();
949
851
  exports.defaults = {
@@ -957,10 +859,8 @@ exports.defaults = {
957
859
  Authentication: core_1.AuthenticationClient,
958
860
  storage: exports.defaultStorage
959
861
  };
960
-
961
862
  var init = function init() {
962
863
  var _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
963
-
964
864
  var options = Object.assign({}, exports.defaults, _options);
965
865
  var Authentication = options.Authentication;
966
866
  return function (app) {
@@ -976,9 +876,7 @@ var init = function init() {
976
876
  });
977
877
  };
978
878
  };
979
-
980
879
  exports["default"] = init;
981
-
982
880
  if (true) {
983
881
  module.exports = Object.assign(init, module.exports);
984
882
  }
@@ -994,24 +892,21 @@ if (true) {
994
892
  "use strict";
995
893
 
996
894
 
895
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
997
896
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
998
-
999
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1000
-
897
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
1001
898
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1002
-
899
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
900
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1003
901
  Object.defineProperty(exports, "__esModule", ({
1004
902
  value: true
1005
903
  }));
1006
904
  exports.StorageWrapper = exports.MemoryStorage = void 0;
1007
-
1008
905
  var MemoryStorage = /*#__PURE__*/function () {
1009
906
  function MemoryStorage() {
1010
907
  _classCallCheck(this, MemoryStorage);
1011
-
1012
908
  this.store = {};
1013
909
  }
1014
-
1015
910
  _createClass(MemoryStorage, [{
1016
911
  key: "getItem",
1017
912
  value: function getItem(key) {
@@ -1030,19 +925,14 @@ var MemoryStorage = /*#__PURE__*/function () {
1030
925
  return Promise.resolve(value);
1031
926
  }
1032
927
  }]);
1033
-
1034
928
  return MemoryStorage;
1035
929
  }();
1036
-
1037
930
  exports.MemoryStorage = MemoryStorage;
1038
-
1039
931
  var StorageWrapper = /*#__PURE__*/function () {
1040
932
  function StorageWrapper(storage) {
1041
933
  _classCallCheck(this, StorageWrapper);
1042
-
1043
934
  this.storage = storage;
1044
935
  }
1045
-
1046
936
  _createClass(StorageWrapper, [{
1047
937
  key: "getItem",
1048
938
  value: function getItem(key) {
@@ -1059,10 +949,8 @@ var StorageWrapper = /*#__PURE__*/function () {
1059
949
  return Promise.resolve(this.storage.removeItem(key));
1060
950
  }
1061
951
  }]);
1062
-
1063
952
  return StorageWrapper;
1064
953
  }();
1065
-
1066
954
  exports.StorageWrapper = StorageWrapper;
1067
955
 
1068
956
  /***/ }),
@@ -1074,17 +962,11 @@ exports.StorageWrapper = StorageWrapper;
1074
962
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1075
963
 
1076
964
  var feathers = __webpack_require__(/*! @feathersjs/feathers */ "../feathers/lib/index.js");
1077
-
1078
965
  var errors = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
1079
-
1080
966
  var authentication = __webpack_require__(/*! @feathersjs/authentication-client */ "../authentication-client/lib/index.js");
1081
-
1082
967
  var rest = __webpack_require__(/*! @feathersjs/rest-client */ "../rest-client/lib/index.js");
1083
-
1084
968
  var socketio = __webpack_require__(/*! @feathersjs/socketio-client */ "../socketio-client/lib/index.js");
1085
-
1086
969
  var primus = __webpack_require__(/*! @feathersjs/primus-client */ "../primus-client/lib/index.js");
1087
-
1088
970
  Object.assign(feathers, {
1089
971
  errors: errors,
1090
972
  socketio: socketio,
@@ -1106,19 +988,15 @@ module.exports = feathers;
1106
988
 
1107
989
 
1108
990
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1109
-
1110
991
  Object.defineProperty(exports, "__esModule", ({
1111
992
  value: true
1112
993
  }));
1113
994
  exports.enableHooks = exports.processHooks = exports.getHooks = exports.isHookObject = exports.convertHookData = exports.makeArguments = exports.defaultMakeArguments = exports.createHookObject = exports.ACTIVATE_HOOKS = void 0;
1114
-
1115
995
  var utils_1 = __webpack_require__(/*! ./utils */ "../commons/lib/utils.js");
1116
-
1117
996
  var _utils_1$_ = utils_1._,
1118
- each = _utils_1$_.each,
1119
- pick = _utils_1$_.pick;
997
+ each = _utils_1$_.each,
998
+ pick = _utils_1$_.pick;
1120
999
  exports.ACTIVATE_HOOKS = (0, utils_1.createSymbol)('__feathersActivateHooks');
1121
-
1122
1000
  function createHookObject(method) {
1123
1001
  var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1124
1002
  var hook = {};
@@ -1129,70 +1007,55 @@ function createHookObject(method) {
1129
1007
  });
1130
1008
  return Object.assign(hook, data, {
1131
1009
  method: method,
1132
-
1133
1010
  // A dynamic getter that returns the path of the service
1134
1011
  get path() {
1135
1012
  var app = data.app,
1136
- service = data.service;
1137
-
1013
+ service = data.service;
1138
1014
  if (!service || !app || !app.services) {
1139
1015
  return null;
1140
1016
  }
1141
-
1142
1017
  return Object.keys(app.services).find(function (path) {
1143
1018
  return app.services[path] === service;
1144
1019
  });
1145
1020
  }
1146
-
1147
1021
  });
1148
1022
  }
1149
-
1150
- exports.createHookObject = createHookObject; // Fallback used by `makeArguments` which usually won't be used
1151
-
1023
+ exports.createHookObject = createHookObject;
1024
+ // Fallback used by `makeArguments` which usually won't be used
1152
1025
  function defaultMakeArguments(hook) {
1153
1026
  var result = [];
1154
-
1155
1027
  if (typeof hook.id !== 'undefined') {
1156
1028
  result.push(hook.id);
1157
1029
  }
1158
-
1159
1030
  if (hook.data) {
1160
1031
  result.push(hook.data);
1161
1032
  }
1162
-
1163
1033
  result.push(hook.params || {});
1164
1034
  return result;
1165
1035
  }
1166
-
1167
- exports.defaultMakeArguments = defaultMakeArguments; // Turns a hook object back into a list of arguments
1036
+ exports.defaultMakeArguments = defaultMakeArguments;
1037
+ // Turns a hook object back into a list of arguments
1168
1038
  // to call a service method with
1169
-
1170
1039
  function makeArguments(hook) {
1171
1040
  switch (hook.method) {
1172
1041
  case 'find':
1173
1042
  return [hook.params];
1174
-
1175
1043
  case 'get':
1176
1044
  case 'remove':
1177
1045
  return [hook.id, hook.params];
1178
-
1179
1046
  case 'update':
1180
1047
  case 'patch':
1181
1048
  return [hook.id, hook.data, hook.params];
1182
-
1183
1049
  case 'create':
1184
1050
  return [hook.data, hook.params];
1185
1051
  }
1186
-
1187
1052
  return defaultMakeArguments(hook);
1188
1053
  }
1189
-
1190
- exports.makeArguments = makeArguments; // Converts different hook registration formats into the
1054
+ exports.makeArguments = makeArguments;
1055
+ // Converts different hook registration formats into the
1191
1056
  // same internal format
1192
-
1193
1057
  function convertHookData(obj) {
1194
1058
  var hook = {};
1195
-
1196
1059
  if (Array.isArray(obj)) {
1197
1060
  hook = {
1198
1061
  all: obj
@@ -1206,41 +1069,32 @@ function convertHookData(obj) {
1206
1069
  hook[key] = !Array.isArray(value) ? [value] : value;
1207
1070
  });
1208
1071
  }
1209
-
1210
1072
  return hook;
1211
1073
  }
1212
-
1213
- exports.convertHookData = convertHookData; // Duck-checks a given object to be a hook object
1074
+ exports.convertHookData = convertHookData;
1075
+ // Duck-checks a given object to be a hook object
1214
1076
  // A valid hook object has `type` and `method`
1215
-
1216
1077
  function isHookObject(hookObject) {
1217
1078
  return _typeof(hookObject) === 'object' && typeof hookObject.method === 'string' && typeof hookObject.type === 'string';
1218
1079
  }
1219
-
1220
- exports.isHookObject = isHookObject; // Returns all service and application hooks combined
1080
+ exports.isHookObject = isHookObject;
1081
+ // Returns all service and application hooks combined
1221
1082
  // for a given method and type `appLast` sets if the hooks
1222
1083
  // from `app` should be added last (or first by default)
1223
-
1224
1084
  function getHooks(app, service, type, method) {
1225
1085
  var appLast = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
1226
1086
  var appHooks = app.__hooks[type][method] || [];
1227
1087
  var serviceHooks = service.__hooks[type][method] || [];
1228
-
1229
1088
  if (appLast) {
1230
1089
  // Run hooks in the order of service -> app -> finally
1231
1090
  return serviceHooks.concat(appHooks);
1232
1091
  }
1233
-
1234
1092
  return appHooks.concat(serviceHooks);
1235
1093
  }
1236
-
1237
1094
  exports.getHooks = getHooks;
1238
-
1239
1095
  function processHooks(hooks, initialHookObject) {
1240
1096
  var _this = this;
1241
-
1242
1097
  var hookObject = initialHookObject;
1243
-
1244
1098
  var updateCurrentHook = function updateCurrentHook(current) {
1245
1099
  // Either use the returned hook object or the current
1246
1100
  // hook object from the chain if the hook returned undefined
@@ -1248,18 +1102,15 @@ function processHooks(hooks, initialHookObject) {
1248
1102
  if (!isHookObject(current)) {
1249
1103
  throw new Error("".concat(hookObject.type, " hook for '").concat(hookObject.method, "' method returned invalid hook object"));
1250
1104
  }
1251
-
1252
1105
  hookObject = current;
1253
1106
  }
1254
-
1255
1107
  return hookObject;
1256
- }; // Go through all hooks and chain them into our promise
1257
-
1258
-
1108
+ };
1109
+ // Go through all hooks and chain them into our promise
1259
1110
  var promise = hooks.reduce(function (current, fn) {
1260
1111
  // @ts-ignore
1261
- var hook = fn.bind(_this); // Use the returned hook object or the old one
1262
-
1112
+ var hook = fn.bind(_this);
1113
+ // Use the returned hook object or the old one
1263
1114
  return current.then(function (currentHook) {
1264
1115
  return hook(currentHook);
1265
1116
  }).then(updateCurrentHook);
@@ -1272,20 +1123,18 @@ function processHooks(hooks, initialHookObject) {
1272
1123
  throw error;
1273
1124
  });
1274
1125
  }
1275
-
1276
- exports.processHooks = processHooks; // Add `.hooks` functionality to an object
1277
-
1126
+ exports.processHooks = processHooks;
1127
+ // Add `.hooks` functionality to an object
1278
1128
  function enableHooks(obj, methods, types) {
1279
1129
  if (typeof obj.hooks === 'function') {
1280
1130
  return obj;
1281
1131
  }
1282
-
1283
1132
  var hookData = {};
1284
1133
  types.forEach(function (type) {
1285
1134
  // Initialize properties where hook functions are stored
1286
1135
  hookData[type] = {};
1287
- }); // Add non-enumerable `__hooks` property to the object
1288
-
1136
+ });
1137
+ // Add non-enumerable `__hooks` property to the object
1289
1138
  Object.defineProperty(obj, '__hooks', {
1290
1139
  configurable: true,
1291
1140
  value: hookData,
@@ -1294,13 +1143,11 @@ function enableHooks(obj, methods, types) {
1294
1143
  return Object.assign(obj, {
1295
1144
  hooks: function hooks(allHooks) {
1296
1145
  var _this2 = this;
1297
-
1298
1146
  each(allHooks, function (current, type) {
1299
1147
  // @ts-ignore
1300
1148
  if (!_this2.__hooks[type]) {
1301
1149
  throw new Error("'".concat(type, "' is not a valid hook type"));
1302
1150
  }
1303
-
1304
1151
  var hooks = convertHookData(current);
1305
1152
  each(hooks, function (_value, method) {
1306
1153
  if (method !== 'all' && methods.indexOf(method) === -1) {
@@ -1310,11 +1157,9 @@ function enableHooks(obj, methods, types) {
1310
1157
  methods.forEach(function (method) {
1311
1158
  // @ts-ignore
1312
1159
  var myHooks = _this2.__hooks[type][method] || (_this2.__hooks[type][method] = []);
1313
-
1314
1160
  if (hooks.all) {
1315
1161
  myHooks.push.apply(myHooks, hooks.all);
1316
1162
  }
1317
-
1318
1163
  if (hooks[method]) {
1319
1164
  myHooks.push.apply(myHooks, hooks[method]);
1320
1165
  }
@@ -1324,7 +1169,6 @@ function enableHooks(obj, methods, types) {
1324
1169
  }
1325
1170
  });
1326
1171
  }
1327
-
1328
1172
  exports.enableHooks = enableHooks;
1329
1173
 
1330
1174
  /***/ }),
@@ -1341,7 +1185,6 @@ exports.enableHooks = enableHooks;
1341
1185
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1342
1186
  if (k2 === undefined) k2 = k;
1343
1187
  var desc = Object.getOwnPropertyDescriptor(m, k);
1344
-
1345
1188
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1346
1189
  desc = {
1347
1190
  enumerable: true,
@@ -1350,13 +1193,11 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
1350
1193
  }
1351
1194
  };
1352
1195
  }
1353
-
1354
1196
  Object.defineProperty(o, k2, desc);
1355
1197
  } : function (o, m, k, k2) {
1356
1198
  if (k2 === undefined) k2 = k;
1357
1199
  o[k2] = m[k];
1358
1200
  });
1359
-
1360
1201
  var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
1361
1202
  Object.defineProperty(o, "default", {
1362
1203
  enumerable: true,
@@ -1365,34 +1206,22 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun
1365
1206
  } : function (o, v) {
1366
1207
  o["default"] = v;
1367
1208
  });
1368
-
1369
1209
  var __importStar = this && this.__importStar || function (mod) {
1370
1210
  if (mod && mod.__esModule) return mod;
1371
1211
  var result = {};
1372
- if (mod != null) for (var k in mod) {
1373
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1374
- }
1375
-
1212
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1376
1213
  __setModuleDefault(result, mod);
1377
-
1378
1214
  return result;
1379
1215
  };
1380
-
1381
1216
  var __exportStar = this && this.__exportStar || function (m, exports) {
1382
- for (var p in m) {
1383
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1384
- }
1217
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1385
1218
  };
1386
-
1387
1219
  Object.defineProperty(exports, "__esModule", ({
1388
1220
  value: true
1389
1221
  }));
1390
1222
  exports.hooks = void 0;
1391
-
1392
1223
  var hookUtils = __importStar(__webpack_require__(/*! ./hooks */ "../commons/lib/hooks.js"));
1393
-
1394
1224
  __exportStar(__webpack_require__(/*! ./utils */ "../commons/lib/utils.js"), exports);
1395
-
1396
1225
  exports.hooks = hookUtils;
1397
1226
 
1398
1227
  /***/ }),
@@ -1406,33 +1235,26 @@ exports.hooks = hookUtils;
1406
1235
  "use strict";
1407
1236
 
1408
1237
 
1409
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1410
-
1238
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1239
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
1240
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1411
1241
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1412
-
1413
1242
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1414
-
1415
1243
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1416
-
1417
1244
  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); }
1418
-
1419
- 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; }
1420
-
1421
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1422
-
1245
+ 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; }
1246
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
1423
1247
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1424
-
1425
1248
  Object.defineProperty(exports, "__esModule", ({
1426
1249
  value: true
1427
1250
  }));
1428
- exports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0; // Removes all leading and trailing slashes from a path
1429
-
1251
+ exports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0;
1252
+ // Removes all leading and trailing slashes from a path
1430
1253
  function stripSlashes(name) {
1431
1254
  return name.replace(/^(\/+)|(\/+)$/g, '');
1432
1255
  }
1433
-
1434
- exports.stripSlashes = stripSlashes; // A set of lodash-y utility functions that use ES6
1435
-
1256
+ exports.stripSlashes = stripSlashes;
1257
+ // A set of lodash-y utility functions that use ES6
1436
1258
  exports._ = {
1437
1259
  each: function each(obj, callback) {
1438
1260
  if (obj && typeof obj.forEach === 'function') {
@@ -1448,9 +1270,8 @@ exports._ = {
1448
1270
  return [value[key], key];
1449
1271
  }).some(function (_ref) {
1450
1272
  var _ref2 = _slicedToArray(_ref, 2),
1451
- val = _ref2[0],
1452
- key = _ref2[1];
1453
-
1273
+ val = _ref2[0],
1274
+ key = _ref2[1];
1454
1275
  return callback(val, key);
1455
1276
  });
1456
1277
  },
@@ -1459,9 +1280,8 @@ exports._ = {
1459
1280
  return [value[key], key];
1460
1281
  }).every(function (_ref3) {
1461
1282
  var _ref4 = _slicedToArray(_ref3, 2),
1462
- val = _ref4[0],
1463
- key = _ref4[1];
1464
-
1283
+ val = _ref4[0],
1284
+ key = _ref4[1];
1465
1285
  return callback(val, key);
1466
1286
  });
1467
1287
  },
@@ -1491,16 +1311,13 @@ exports._ = {
1491
1311
  for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1492
1312
  rest[_key - 1] = arguments[_key];
1493
1313
  }
1494
-
1495
1314
  return Object.assign.apply(Object, [first].concat(rest));
1496
1315
  },
1497
1316
  omit: function omit(obj) {
1498
1317
  var result = exports._.extend({}, obj);
1499
-
1500
1318
  for (var _len2 = arguments.length, keys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1501
1319
  keys[_key2 - 1] = arguments[_key2];
1502
1320
  }
1503
-
1504
1321
  keys.forEach(function (key) {
1505
1322
  return delete result[key];
1506
1323
  });
@@ -1510,12 +1327,10 @@ exports._ = {
1510
1327
  for (var _len3 = arguments.length, keys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
1511
1328
  keys[_key3 - 1] = arguments[_key3];
1512
1329
  }
1513
-
1514
1330
  return keys.reduce(function (result, key) {
1515
1331
  if (source[key] !== undefined) {
1516
1332
  result[key] = source[key];
1517
1333
  }
1518
-
1519
1334
  return result;
1520
1335
  }, {});
1521
1336
  },
@@ -1527,24 +1342,20 @@ exports._ = {
1527
1342
  if (!target[key]) {
1528
1343
  Object.assign(target, _defineProperty({}, key, {}));
1529
1344
  }
1530
-
1531
1345
  exports._.merge(target[key], source[key]);
1532
1346
  } else {
1533
1347
  Object.assign(target, _defineProperty({}, key, source[key]));
1534
1348
  }
1535
1349
  });
1536
1350
  }
1537
-
1538
1351
  return target;
1539
1352
  }
1540
- }; // Duck-checks if an object looks like a promise
1541
-
1353
+ };
1354
+ // Duck-checks if an object looks like a promise
1542
1355
  function isPromise(result) {
1543
1356
  return exports._.isObject(result) && typeof result.then === 'function';
1544
1357
  }
1545
-
1546
1358
  exports.isPromise = isPromise;
1547
-
1548
1359
  function makeUrl(path) {
1549
1360
  var app = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1550
1361
  var get = typeof app.get === 'function' ? app.get.bind(app) : function () {};
@@ -1556,13 +1367,10 @@ function makeUrl(path) {
1556
1367
  path = path || '';
1557
1368
  return "".concat(protocol, "://").concat(host).concat(port, "/").concat(exports.stripSlashes(path));
1558
1369
  }
1559
-
1560
1370
  exports.makeUrl = makeUrl;
1561
-
1562
1371
  function createSymbol(name) {
1563
1372
  return typeof Symbol !== 'undefined' ? Symbol(name) : name;
1564
1373
  }
1565
-
1566
1374
  exports.createSymbol = createSymbol;
1567
1375
 
1568
1376
  /***/ }),
@@ -1574,18 +1382,16 @@ exports.createSymbol = createSymbol;
1574
1382
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1575
1383
 
1576
1384
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1577
-
1578
1385
  var debug = __webpack_require__(/*! debug */ "../../node_modules/debug/src/browser.js")('@feathersjs/errors');
1579
-
1580
1386
  function FeathersError(msg, name, code, className, data) {
1581
1387
  msg = msg || 'Error';
1582
1388
  var errors;
1583
1389
  var message;
1584
1390
  var newData;
1585
-
1586
1391
  if (msg instanceof Error) {
1587
- message = msg.message || 'Error'; // NOTE (EK): This is typically to handle validation errors
1392
+ message = msg.message || 'Error';
1588
1393
 
1394
+ // NOTE (EK): This is typically to handle validation errors
1589
1395
  if (msg.errors) {
1590
1396
  errors = msg.errors;
1591
1397
  }
@@ -1597,13 +1403,11 @@ function FeathersError(msg, name, code, className, data) {
1597
1403
  // message is just a string
1598
1404
  message = msg;
1599
1405
  }
1600
-
1601
1406
  if (data) {
1602
1407
  // NOTE(EK): To make sure that we are not messing
1603
1408
  // with immutable data, just make a copy.
1604
1409
  // https://github.com/feathersjs/errors/issues/19
1605
1410
  newData = JSON.parse(JSON.stringify(data));
1606
-
1607
1411
  if (newData.errors) {
1608
1412
  errors = newData.errors;
1609
1413
  delete newData.errors;
@@ -1613,11 +1417,11 @@ function FeathersError(msg, name, code, className, data) {
1613
1417
  // For example: when cloning arrays this property
1614
1418
  errors = JSON.parse(JSON.stringify(data.errors));
1615
1419
  }
1616
- } // NOTE (EK): Babel doesn't support this so
1420
+ }
1421
+
1422
+ // NOTE (EK): Babel doesn't support this so
1617
1423
  // we have to pass in the class name manually.
1618
1424
  // this.name = this.constructor.name;
1619
-
1620
-
1621
1425
  this.type = 'FeathersError';
1622
1426
  this.name = name;
1623
1427
  this.message = message;
@@ -1627,22 +1431,20 @@ function FeathersError(msg, name, code, className, data) {
1627
1431
  this.errors = errors || {};
1628
1432
  debug("".concat(this.name, "(").concat(this.code, "): ").concat(this.message));
1629
1433
  debug(this.errors);
1630
-
1631
1434
  if (Error.captureStackTrace) {
1632
1435
  Error.captureStackTrace(this, FeathersError);
1633
1436
  } else {
1634
1437
  this.stack = new Error().stack;
1635
1438
  }
1636
1439
  }
1637
-
1638
1440
  function inheritsFrom(Child, Parent) {
1639
1441
  Child.prototype = Object.create(Parent.prototype);
1640
1442
  Child.prototype.constructor = Child;
1641
1443
  }
1444
+ inheritsFrom(FeathersError, Error);
1642
1445
 
1643
- inheritsFrom(FeathersError, Error); // NOTE (EK): A little hack to get around `message` not
1446
+ // NOTE (EK): A little hack to get around `message` not
1644
1447
  // being included in the default toJSON call.
1645
-
1646
1448
  Object.defineProperty(FeathersError.prototype, 'toJSON', {
1647
1449
  value: function value() {
1648
1450
  return {
@@ -1654,108 +1456,108 @@ Object.defineProperty(FeathersError.prototype, 'toJSON', {
1654
1456
  errors: this.errors
1655
1457
  };
1656
1458
  }
1657
- }); // 400 - Bad Request
1459
+ });
1658
1460
 
1461
+ // 400 - Bad Request
1659
1462
  function BadRequest(message, data) {
1660
1463
  FeathersError.call(this, message, 'BadRequest', 400, 'bad-request', data);
1661
1464
  }
1465
+ inheritsFrom(BadRequest, FeathersError);
1662
1466
 
1663
- inheritsFrom(BadRequest, FeathersError); // 401 - Not Authenticated
1664
-
1467
+ // 401 - Not Authenticated
1665
1468
  function NotAuthenticated(message, data) {
1666
1469
  FeathersError.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);
1667
1470
  }
1471
+ inheritsFrom(NotAuthenticated, FeathersError);
1668
1472
 
1669
- inheritsFrom(NotAuthenticated, FeathersError); // 402 - Payment Error
1670
-
1473
+ // 402 - Payment Error
1671
1474
  function PaymentError(message, data) {
1672
1475
  FeathersError.call(this, message, 'PaymentError', 402, 'payment-error', data);
1673
1476
  }
1477
+ inheritsFrom(PaymentError, FeathersError);
1674
1478
 
1675
- inheritsFrom(PaymentError, FeathersError); // 403 - Forbidden
1676
-
1479
+ // 403 - Forbidden
1677
1480
  function Forbidden(message, data) {
1678
1481
  FeathersError.call(this, message, 'Forbidden', 403, 'forbidden', data);
1679
1482
  }
1483
+ inheritsFrom(Forbidden, FeathersError);
1680
1484
 
1681
- inheritsFrom(Forbidden, FeathersError); // 404 - Not Found
1682
-
1485
+ // 404 - Not Found
1683
1486
  function NotFound(message, data) {
1684
1487
  FeathersError.call(this, message, 'NotFound', 404, 'not-found', data);
1685
1488
  }
1489
+ inheritsFrom(NotFound, FeathersError);
1686
1490
 
1687
- inheritsFrom(NotFound, FeathersError); // 405 - Method Not Allowed
1688
-
1491
+ // 405 - Method Not Allowed
1689
1492
  function MethodNotAllowed(message, data) {
1690
1493
  FeathersError.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);
1691
1494
  }
1495
+ inheritsFrom(MethodNotAllowed, FeathersError);
1692
1496
 
1693
- inheritsFrom(MethodNotAllowed, FeathersError); // 406 - Not Acceptable
1694
-
1497
+ // 406 - Not Acceptable
1695
1498
  function NotAcceptable(message, data) {
1696
1499
  FeathersError.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);
1697
1500
  }
1501
+ inheritsFrom(NotAcceptable, FeathersError);
1698
1502
 
1699
- inheritsFrom(NotAcceptable, FeathersError); // 408 - Timeout
1700
-
1503
+ // 408 - Timeout
1701
1504
  function Timeout(message, data) {
1702
1505
  FeathersError.call(this, message, 'Timeout', 408, 'timeout', data);
1703
1506
  }
1507
+ inheritsFrom(Timeout, FeathersError);
1704
1508
 
1705
- inheritsFrom(Timeout, FeathersError); // 409 - Conflict
1706
-
1509
+ // 409 - Conflict
1707
1510
  function Conflict(message, data) {
1708
1511
  FeathersError.call(this, message, 'Conflict', 409, 'conflict', data);
1709
1512
  }
1513
+ inheritsFrom(Conflict, FeathersError);
1710
1514
 
1711
- inheritsFrom(Conflict, FeathersError); // 410 - Gone
1712
-
1515
+ // 410 - Gone
1713
1516
  function Gone(message, data) {
1714
1517
  FeathersError(this, message, 'Gone', 410, 'gone', data);
1715
1518
  }
1519
+ inheritsFrom(Gone, FeathersError);
1716
1520
 
1717
- inheritsFrom(Gone, FeathersError); // 411 - Length Required
1718
-
1521
+ // 411 - Length Required
1719
1522
  function LengthRequired(message, data) {
1720
1523
  FeathersError.call(this, message, 'LengthRequired', 411, 'length-required', data);
1721
1524
  }
1525
+ inheritsFrom(LengthRequired, FeathersError);
1722
1526
 
1723
- inheritsFrom(LengthRequired, FeathersError); // 422 Unprocessable
1724
-
1527
+ // 422 Unprocessable
1725
1528
  function Unprocessable(message, data) {
1726
1529
  FeathersError.call(this, message, 'Unprocessable', 422, 'unprocessable', data);
1727
1530
  }
1531
+ inheritsFrom(Unprocessable, FeathersError);
1728
1532
 
1729
- inheritsFrom(Unprocessable, FeathersError); // 429 Too Many Requests
1730
-
1533
+ // 429 Too Many Requests
1731
1534
  function TooManyRequests(message, data) {
1732
1535
  FeathersError.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);
1733
1536
  }
1537
+ inheritsFrom(TooManyRequests, FeathersError);
1734
1538
 
1735
- inheritsFrom(TooManyRequests, FeathersError); // 500 - General Error
1736
-
1539
+ // 500 - General Error
1737
1540
  function GeneralError(message, data) {
1738
1541
  FeathersError.call(this, message, 'GeneralError', 500, 'general-error', data);
1739
1542
  }
1543
+ inheritsFrom(GeneralError, FeathersError);
1740
1544
 
1741
- inheritsFrom(GeneralError, FeathersError); // 501 - Not Implemented
1742
-
1545
+ // 501 - Not Implemented
1743
1546
  function NotImplemented(message, data) {
1744
1547
  FeathersError.call(this, message, 'NotImplemented', 501, 'not-implemented', data);
1745
1548
  }
1549
+ inheritsFrom(NotImplemented, FeathersError);
1746
1550
 
1747
- inheritsFrom(NotImplemented, FeathersError); // 502 - Bad Gateway
1748
-
1551
+ // 502 - Bad Gateway
1749
1552
  function BadGateway(message, data) {
1750
1553
  FeathersError.call(this, message, 'BadGateway', 502, 'bad-gateway', data);
1751
1554
  }
1555
+ inheritsFrom(BadGateway, FeathersError);
1752
1556
 
1753
- inheritsFrom(BadGateway, FeathersError); // 503 - Unavailable
1754
-
1557
+ // 503 - Unavailable
1755
1558
  function Unavailable(message, data) {
1756
1559
  FeathersError.call(this, message, 'Unavailable', 503, 'unavailable', data);
1757
1560
  }
1758
-
1759
1561
  inheritsFrom(Unavailable, FeathersError);
1760
1562
  var errors = {
1761
1563
  FeathersError: FeathersError,
@@ -1794,22 +1596,17 @@ var errors = {
1794
1596
  502: BadGateway,
1795
1597
  503: Unavailable
1796
1598
  };
1797
-
1798
1599
  function convert(error) {
1799
1600
  if (!error) {
1800
1601
  return error;
1801
1602
  }
1802
-
1803
1603
  var FeathersError = errors[error.name];
1804
1604
  var result = FeathersError ? new FeathersError(error.message, error.data) : new Error(error.message || error);
1805
-
1806
1605
  if (_typeof(error) === 'object') {
1807
1606
  Object.assign(result, error);
1808
1607
  }
1809
-
1810
1608
  return result;
1811
1609
  }
1812
-
1813
1610
  module.exports = Object.assign({
1814
1611
  convert: convert
1815
1612
  }, errors);
@@ -1823,18 +1620,12 @@ module.exports = Object.assign({
1823
1620
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1824
1621
 
1825
1622
  var debug = __webpack_require__(/*! debug */ "../../node_modules/debug/src/browser.js")('feathers:application');
1826
-
1827
1623
  var _require = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"),
1828
- stripSlashes = _require.stripSlashes;
1829
-
1624
+ stripSlashes = _require.stripSlashes;
1830
1625
  var Uberproto = __webpack_require__(/*! uberproto */ "../../node_modules/uberproto/lib/proto.js");
1831
-
1832
1626
  var events = __webpack_require__(/*! ./events */ "../feathers/lib/events.js");
1833
-
1834
1627
  var hooks = __webpack_require__(/*! ./hooks */ "../feathers/lib/hooks/index.js");
1835
-
1836
1628
  var version = __webpack_require__(/*! ./version */ "../feathers/lib/version.js");
1837
-
1838
1629
  var Proto = Uberproto.extend({
1839
1630
  create: null
1840
1631
  });
@@ -1881,31 +1672,24 @@ var application = {
1881
1672
  if (typeof _service !== 'undefined') {
1882
1673
  throw new Error('Registering a new service with `app.service(path, service)` is no longer supported. Use `app.use(path, service)` instead.');
1883
1674
  }
1884
-
1885
1675
  var location = stripSlashes(path) || '/';
1886
- var current = this.services[location];
1887
-
1676
+ var current = this.services.hasOwnProperty(location) ? this.services[location] : undefined;
1888
1677
  if (typeof current === 'undefined' && typeof this.defaultService === 'function') {
1889
1678
  return this.use(location, this.defaultService(location)).service(location);
1890
1679
  }
1891
-
1892
1680
  return current;
1893
1681
  },
1894
1682
  use: function use(path, service) {
1895
1683
  var _this = this;
1896
-
1897
1684
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1898
-
1899
1685
  if (typeof path !== 'string') {
1900
1686
  throw new Error("'".concat(path, "' is not a valid service path."));
1901
1687
  }
1902
-
1903
1688
  var location = stripSlashes(path) || '/';
1904
1689
  var isSubApp = typeof service.service === 'function' && service.services;
1905
1690
  var isService = this.methods.concat('setup').some(function (name) {
1906
1691
  return typeof service[name] === 'function';
1907
1692
  });
1908
-
1909
1693
  if (isSubApp) {
1910
1694
  var subApp = service;
1911
1695
  Object.keys(subApp.services).forEach(function (subPath) {
@@ -1913,44 +1697,41 @@ var application = {
1913
1697
  });
1914
1698
  return this;
1915
1699
  }
1916
-
1917
1700
  if (!isService) {
1918
1701
  throw new Error("Invalid service object passed for path `".concat(location, "`"));
1919
- } // If the service is already Uberproto'd use it directly
1920
-
1702
+ }
1921
1703
 
1704
+ // If the service is already Uberproto'd use it directly
1922
1705
  var protoService = Proto.isPrototypeOf(service) ? service : Proto.extend(service);
1923
- debug("Registering new service at `".concat(location, "`")); // Add all the mixins
1706
+ debug("Registering new service at `".concat(location, "`"));
1924
1707
 
1708
+ // Add all the mixins
1925
1709
  this.mixins.forEach(function (fn) {
1926
1710
  return fn.call(_this, protoService, location, options);
1927
1711
  });
1928
-
1929
1712
  if (typeof protoService._setup === 'function') {
1930
1713
  protoService._setup(this, location);
1931
- } // Run the provider functions to register the service
1932
-
1714
+ }
1933
1715
 
1716
+ // Run the provider functions to register the service
1934
1717
  this.providers.forEach(function (provider) {
1935
1718
  return provider.call(_this, protoService, location, options);
1936
- }); // If we ran setup already, set this service up explicitly
1719
+ });
1937
1720
 
1721
+ // If we ran setup already, set this service up explicitly
1938
1722
  if (this._isSetup && typeof protoService.setup === 'function') {
1939
1723
  debug("Setting up service for `".concat(location, "`"));
1940
1724
  protoService.setup(this, location);
1941
1725
  }
1942
-
1943
1726
  this.services[location] = protoService;
1944
1727
  return this;
1945
1728
  },
1946
1729
  setup: function setup() {
1947
1730
  var _this2 = this;
1948
-
1949
1731
  // Setup each service (pass the app so that they can look up other services etc.)
1950
1732
  Object.keys(this.services).forEach(function (path) {
1951
1733
  var service = _this2.services[path];
1952
1734
  debug("Setting up service for `".concat(path, "`"));
1953
-
1954
1735
  if (typeof service.setup === 'function') {
1955
1736
  service.setup(_this2, path);
1956
1737
  }
@@ -1970,19 +1751,19 @@ module.exports = application;
1970
1751
  /***/ (function(module, exports, __webpack_require__) {
1971
1752
 
1972
1753
  var _require = __webpack_require__(/*! events */ "../../node_modules/events/events.js"),
1973
- EventEmitter = _require.EventEmitter;
1754
+ EventEmitter = _require.EventEmitter;
1755
+ var Proto = __webpack_require__(/*! uberproto */ "../../node_modules/uberproto/lib/proto.js");
1974
1756
 
1975
- var Proto = __webpack_require__(/*! uberproto */ "../../node_modules/uberproto/lib/proto.js"); // Returns a hook that emits service events. Should always be
1757
+ // Returns a hook that emits service events. Should always be
1976
1758
  // used as the very last hook in the chain
1977
-
1978
-
1979
1759
  var eventHook = exports.eventHook = function eventHook() {
1980
1760
  return function (hook) {
1981
1761
  var app = hook.app,
1982
- service = hook.service;
1762
+ service = hook.service;
1983
1763
  var eventName = hook.event === null ? hook.event : app.eventMappings[hook.method];
1984
- var isHookEvent = service._hookEvents && service._hookEvents.indexOf(eventName) !== -1; // If this event is not being sent yet and we are not in an error hook
1764
+ var isHookEvent = service._hookEvents && service._hookEvents.indexOf(eventName) !== -1;
1985
1765
 
1766
+ // If this event is not being sent yet and we are not in an error hook
1986
1767
  if (eventName && isHookEvent && hook.type !== 'error') {
1987
1768
  var results = Array.isArray(hook.result) ? hook.result : [hook.result];
1988
1769
  results.forEach(function (element) {
@@ -1990,23 +1771,23 @@ var eventHook = exports.eventHook = function eventHook() {
1990
1771
  });
1991
1772
  }
1992
1773
  };
1993
- }; // Mixin that turns a service into a Node event emitter
1994
-
1774
+ };
1995
1775
 
1776
+ // Mixin that turns a service into a Node event emitter
1996
1777
  var eventMixin = exports.eventMixin = function eventMixin(service) {
1997
1778
  if (service._serviceEvents) {
1998
1779
  return;
1999
1780
  }
1781
+ var app = this;
1782
+ // Indicates if the service is already an event emitter
1783
+ var isEmitter = typeof service.on === 'function' && typeof service.emit === 'function';
2000
1784
 
2001
- var app = this; // Indicates if the service is already an event emitter
2002
-
2003
- var isEmitter = typeof service.on === 'function' && typeof service.emit === 'function'; // If not, mix it in (the service is always an Uberproto object that has a .mixin)
2004
-
1785
+ // If not, mix it in (the service is always an Uberproto object that has a .mixin)
2005
1786
  if (typeof service.mixin === 'function' && !isEmitter) {
2006
1787
  service.mixin(EventEmitter.prototype);
2007
- } // Define non-enumerable properties of
2008
-
1788
+ }
2009
1789
 
1790
+ // Define non-enumerable properties of
2010
1791
  Object.defineProperties(service, {
2011
1792
  // A list of all events that this service sends
2012
1793
  _serviceEvents: {
@@ -2016,21 +1797,21 @@ var eventMixin = exports.eventMixin = function eventMixin(service) {
2016
1797
  _hookEvents: {
2017
1798
  value: []
2018
1799
  }
2019
- }); // `app.eventMappings` has the mapping from method name to event name
1800
+ });
2020
1801
 
1802
+ // `app.eventMappings` has the mapping from method name to event name
2021
1803
  Object.keys(app.eventMappings).forEach(function (method) {
2022
1804
  var event = app.eventMappings[method];
2023
- var alreadyEmits = service._serviceEvents.indexOf(event) !== -1; // Add events for known methods to _serviceEvents and _hookEvents
2024
- // if the service indicated it does not send it itself yet
1805
+ var alreadyEmits = service._serviceEvents.indexOf(event) !== -1;
2025
1806
 
1807
+ // Add events for known methods to _serviceEvents and _hookEvents
1808
+ // if the service indicated it does not send it itself yet
2026
1809
  if (typeof service[method] === 'function' && !alreadyEmits) {
2027
1810
  service._serviceEvents.push(event);
2028
-
2029
1811
  service._hookEvents.push(event);
2030
1812
  }
2031
1813
  });
2032
1814
  };
2033
-
2034
1815
  module.exports = function () {
2035
1816
  return function (app) {
2036
1817
  // Mappings from service method to event name
@@ -2041,13 +1822,15 @@ module.exports = function () {
2041
1822
  remove: 'removed',
2042
1823
  patch: 'patched'
2043
1824
  }
2044
- }); // Register the event hook
2045
- // `finally` hooks always run last after `error` and `after` hooks
1825
+ });
2046
1826
 
1827
+ // Register the event hook
1828
+ // `finally` hooks always run last after `error` and `after` hooks
2047
1829
  app.hooks({
2048
1830
  finally: eventHook()
2049
- }); // Make the app an event emitter
1831
+ });
2050
1832
 
1833
+ // Make the app an event emitter
2051
1834
  Proto.mixin(EventEmitter.prototype, app);
2052
1835
  app.mixins.push(eventMixin);
2053
1836
  };
@@ -2062,40 +1845,32 @@ module.exports = function () {
2062
1845
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2063
1846
 
2064
1847
  var _require = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"),
2065
- _ = _require._;
2066
-
1848
+ _ = _require._;
2067
1849
  var assignArguments = function assignArguments(context) {
2068
1850
  var service = context.service,
2069
- method = context.method;
1851
+ method = context.method;
2070
1852
  var parameters = service.methods[method];
2071
1853
  context.arguments.forEach(function (value, index) {
2072
1854
  context[parameters[index]] = value;
2073
1855
  });
2074
-
2075
1856
  if (!context.params) {
2076
1857
  context.params = {};
2077
1858
  }
2078
-
2079
1859
  return context;
2080
1860
  };
2081
-
2082
1861
  var validate = function validate(context) {
2083
1862
  var service = context.service,
2084
- method = context.method,
2085
- path = context.path;
1863
+ method = context.method,
1864
+ path = context.path;
2086
1865
  var parameters = service.methods[method];
2087
-
2088
1866
  if (parameters.includes('id') && context.id === undefined) {
2089
1867
  throw new Error("An id must be provided to the '".concat(path, ".").concat(method, "' method"));
2090
1868
  }
2091
-
2092
1869
  if (parameters.includes('data') && !_.isObjectOrArray(context.data)) {
2093
1870
  throw new Error("A data object must be provided to the '".concat(path, ".").concat(method, "' method"));
2094
1871
  }
2095
-
2096
1872
  return context;
2097
1873
  };
2098
-
2099
1874
  module.exports = [assignArguments, validate];
2100
1875
 
2101
1876
  /***/ }),
@@ -2106,38 +1881,22 @@ module.exports = [assignArguments, validate];
2106
1881
  \**************************************/
2107
1882
  /***/ (function(module, exports, __webpack_require__) {
2108
1883
 
2109
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2110
-
2111
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2112
-
2113
- 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); }
2114
-
2115
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
2116
-
2117
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
2118
-
2119
- 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; }
2120
-
2121
1884
  var _require = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"),
2122
- hooks = _require.hooks,
2123
- isPromise = _require.isPromise;
2124
-
1885
+ hooks = _require.hooks,
1886
+ isPromise = _require.isPromise;
2125
1887
  var baseHooks = __webpack_require__(/*! ./base */ "../feathers/lib/hooks/base.js");
2126
-
2127
1888
  var createHookObject = hooks.createHookObject,
2128
- getHooks = hooks.getHooks,
2129
- processHooks = hooks.processHooks,
2130
- enableHooks = hooks.enableHooks,
2131
- ACTIVATE_HOOKS = hooks.ACTIVATE_HOOKS;
2132
-
1889
+ getHooks = hooks.getHooks,
1890
+ processHooks = hooks.processHooks,
1891
+ enableHooks = hooks.enableHooks,
1892
+ ACTIVATE_HOOKS = hooks.ACTIVATE_HOOKS;
2133
1893
  var withHooks = function withHooks(_ref) {
2134
1894
  var app = _ref.app,
2135
- service = _ref.service,
2136
- method = _ref.method,
2137
- original = _ref.original;
1895
+ service = _ref.service,
1896
+ method = _ref.method,
1897
+ original = _ref.original;
2138
1898
  return function () {
2139
1899
  var _hooks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2140
-
2141
1900
  var hooks = app.hookTypes.reduce(function (result, type) {
2142
1901
  var value = _hooks[type] || [];
2143
1902
  result[type] = Array.isArray(value) ? value : [value];
@@ -2147,9 +1906,9 @@ var withHooks = function withHooks(_ref) {
2147
1906
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2148
1907
  args[_key] = arguments[_key];
2149
1908
  }
1909
+ var returnHook = args[args.length - 1] === true ? args.pop() : false;
2150
1910
 
2151
- var returnHook = args[args.length - 1] === true ? args.pop() : false; // Create the hook object that gets passed through
2152
-
1911
+ // Create the hook object that gets passed through
2153
1912
  var hookObject = createHookObject(method, {
2154
1913
  type: 'before',
2155
1914
  // initial hook object type
@@ -2157,28 +1916,30 @@ var withHooks = function withHooks(_ref) {
2157
1916
  service: service,
2158
1917
  app: app
2159
1918
  });
2160
- return Promise.resolve(hookObject) // Run `before` hooks
1919
+ return Promise.resolve(hookObject)
1920
+
1921
+ // Run `before` hooks
2161
1922
  .then(function (hookObject) {
2162
1923
  return processHooks.call(service, baseHooks.concat(hooks.before), hookObject);
2163
- }) // Run the original method
1924
+ })
1925
+
1926
+ // Run the original method
2164
1927
  .then(function (hookObject) {
2165
1928
  // If `hookObject.result` is set, skip the original method
2166
1929
  if (typeof hookObject.result !== 'undefined') {
2167
1930
  return hookObject;
2168
- } // Otherwise, call it with arguments created from the hook object
2169
-
1931
+ }
2170
1932
 
1933
+ // Otherwise, call it with arguments created from the hook object
2171
1934
  var promise = new Promise(function (resolve) {
2172
1935
  var func = original || service[method];
2173
1936
  var args = service.methods[method].map(function (value) {
2174
1937
  return hookObject[value];
2175
1938
  });
2176
1939
  var result = func.apply(service, args);
2177
-
2178
1940
  if (!isPromise(result)) {
2179
1941
  throw new Error("Service method '".concat(hookObject.method, "' for '").concat(hookObject.path, "' service must return a promise"));
2180
1942
  }
2181
-
2182
1943
  resolve(result);
2183
1944
  });
2184
1945
  return promise.then(function (result) {
@@ -2188,13 +1949,17 @@ var withHooks = function withHooks(_ref) {
2188
1949
  error.hook = hookObject;
2189
1950
  throw error;
2190
1951
  });
2191
- }) // Run `after` hooks
1952
+ })
1953
+
1954
+ // Run `after` hooks
2192
1955
  .then(function (hookObject) {
2193
1956
  var afterHookObject = Object.assign({}, hookObject, {
2194
1957
  type: 'after'
2195
1958
  });
2196
1959
  return processHooks.call(service, hooks.after, afterHookObject);
2197
- }) // Run `errors` hooks
1960
+ })
1961
+
1962
+ // Run `errors` hooks
2198
1963
  .catch(function (error) {
2199
1964
  var errorHookObject = Object.assign({}, error.hook, {
2200
1965
  type: 'error',
@@ -2209,7 +1974,9 @@ var withHooks = function withHooks(_ref) {
2209
1974
  });
2210
1975
  return errorHookObject;
2211
1976
  });
2212
- }) // Run `finally` hooks
1977
+ })
1978
+
1979
+ // Run `finally` hooks
2213
1980
  .then(function (hookObject) {
2214
1981
  return processHooks.call(service, hooks.finally, hookObject).catch(function (error) {
2215
1982
  var errorHookObject = Object.assign({}, error.hook, {
@@ -2218,7 +1985,9 @@ var withHooks = function withHooks(_ref) {
2218
1985
  });
2219
1986
  return errorHookObject;
2220
1987
  });
2221
- }) // Resolve with a result or reject with an error
1988
+ })
1989
+
1990
+ // Resolve with a result or reject with an error
2222
1991
  .then(function (hookObject) {
2223
1992
  if (typeof hookObject.error !== 'undefined' && typeof hookObject.result === 'undefined') {
2224
1993
  return Promise.reject(returnHook ? hookObject : hookObject.error);
@@ -2228,14 +1997,13 @@ var withHooks = function withHooks(_ref) {
2228
1997
  });
2229
1998
  };
2230
1999
  };
2231
- }; // A service mixin that adds `service.hooks()` method and functionality
2232
-
2000
+ };
2233
2001
 
2002
+ // A service mixin that adds `service.hooks()` method and functionality
2234
2003
  var hookMixin = exports.hookMixin = function hookMixin(service) {
2235
2004
  if (typeof service.hooks === 'function') {
2236
2005
  return;
2237
2006
  }
2238
-
2239
2007
  service.methods = Object.getOwnPropertyNames(service).filter(function (key) {
2240
2008
  return typeof service[key] === 'function' && service[key][ACTIVATE_HOOKS];
2241
2009
  }).reduce(function (result, methodName) {
@@ -2251,19 +2019,16 @@ var hookMixin = exports.hookMixin = function hookMixin(service) {
2251
2019
  remove: ['id', 'params']
2252
2020
  });
2253
2021
  var app = this;
2254
- var methodNames = Object.keys(service.methods); // Assemble the mixin object that contains all "hooked" service methods
2255
-
2022
+ var methodNames = Object.keys(service.methods);
2023
+ // Assemble the mixin object that contains all "hooked" service methods
2256
2024
  var mixin = methodNames.reduce(function (mixin, method) {
2257
2025
  if (typeof service[method] !== 'function') {
2258
2026
  return mixin;
2259
2027
  }
2260
-
2261
2028
  mixin[method] = function () {
2262
2029
  var service = this;
2263
2030
  var args = Array.from(arguments);
2264
-
2265
2031
  var original = service._super.bind(service);
2266
-
2267
2032
  return withHooks({
2268
2033
  app: app,
2269
2034
  service: service,
@@ -2274,32 +2039,30 @@ var hookMixin = exports.hookMixin = function hookMixin(service) {
2274
2039
  after: getHooks(app, service, 'after', method, true),
2275
2040
  error: getHooks(app, service, 'error', method, true),
2276
2041
  finally: getHooks(app, service, 'finally', method, true)
2277
- }).apply(void 0, _toConsumableArray(args));
2042
+ }).apply(void 0, args);
2278
2043
  };
2279
-
2280
2044
  return mixin;
2281
- }, {}); // Add .hooks method and properties to the service
2045
+ }, {});
2282
2046
 
2047
+ // Add .hooks method and properties to the service
2283
2048
  enableHooks(service, methodNames, app.hookTypes);
2284
2049
  service.mixin(mixin);
2285
2050
  };
2286
-
2287
2051
  module.exports = function () {
2288
2052
  return function (app) {
2289
2053
  // We store a reference of all supported hook types on the app
2290
2054
  // in case someone needs it
2291
2055
  Object.assign(app, {
2292
2056
  hookTypes: ['before', 'after', 'error', 'finally']
2293
- }); // Add functionality for hooks to be registered as app.hooks
2057
+ });
2294
2058
 
2059
+ // Add functionality for hooks to be registered as app.hooks
2295
2060
  enableHooks(app, app.methods, app.hookTypes);
2296
2061
  app.mixins.push(hookMixin);
2297
2062
  };
2298
2063
  };
2299
-
2300
2064
  module.exports.withHooks = withHooks;
2301
2065
  module.exports.ACTIVATE_HOOKS = ACTIVATE_HOOKS;
2302
-
2303
2066
  module.exports.activateHooks = function activateHooks(args) {
2304
2067
  return function (fn) {
2305
2068
  Object.defineProperty(fn, ACTIVATE_HOOKS, {
@@ -2318,32 +2081,28 @@ module.exports.activateHooks = function activateHooks(args) {
2318
2081
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2319
2082
 
2320
2083
  var Proto = __webpack_require__(/*! uberproto */ "../../node_modules/uberproto/lib/proto.js");
2321
-
2322
2084
  var Application = __webpack_require__(/*! ./application */ "../feathers/lib/application.js");
2323
-
2324
2085
  var version = __webpack_require__(/*! ./version */ "../feathers/lib/version.js");
2325
-
2326
2086
  var _require = __webpack_require__(/*! ./hooks */ "../feathers/lib/hooks/index.js"),
2327
- ACTIVATE_HOOKS = _require.ACTIVATE_HOOKS,
2328
- activateHooks = _require.activateHooks; // A base object Prototype that does not inherit from a
2087
+ ACTIVATE_HOOKS = _require.ACTIVATE_HOOKS,
2088
+ activateHooks = _require.activateHooks;
2089
+ // A base object Prototype that does not inherit from a
2329
2090
  // potentially polluted Object prototype
2330
-
2331
-
2332
2091
  var baseObject = Object.create(null);
2333
-
2334
2092
  function createApplication() {
2335
- var app = Object.create(baseObject); // Mix in the base application
2093
+ var app = Object.create(baseObject);
2336
2094
 
2095
+ // Mix in the base application
2337
2096
  Proto.mixin(Application, app);
2338
2097
  app.init();
2339
2098
  return app;
2340
2099
  }
2341
-
2342
2100
  createApplication.version = version;
2343
2101
  createApplication.ACTIVATE_HOOKS = ACTIVATE_HOOKS;
2344
2102
  createApplication.activateHooks = activateHooks;
2345
- module.exports = createApplication; // For better ES module (TypeScript) compatibility
2103
+ module.exports = createApplication;
2346
2104
 
2105
+ // For better ES module (TypeScript) compatibility
2347
2106
  module.exports["default"] = createApplication;
2348
2107
 
2349
2108
  /***/ }),
@@ -2354,7 +2113,7 @@ module.exports["default"] = createApplication;
2354
2113
  \**********************************/
2355
2114
  /***/ (function(module) {
2356
2115
 
2357
- module.exports = '4.5.15';
2116
+ module.exports = '4.5.17';
2358
2117
 
2359
2118
  /***/ }),
2360
2119
 
@@ -2365,12 +2124,10 @@ module.exports = '4.5.15';
2365
2124
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2366
2125
 
2367
2126
  var Service = __webpack_require__(/*! @feathersjs/transport-commons/client */ "../transport-commons/client.js");
2368
-
2369
2127
  function primusClient(connection, options) {
2370
2128
  if (!connection) {
2371
2129
  throw new Error('Primus connection needs to be provided');
2372
2130
  }
2373
-
2374
2131
  var defaultService = function defaultService(name) {
2375
2132
  return new Service(Object.assign({}, options, {
2376
2133
  name: name,
@@ -2378,21 +2135,17 @@ function primusClient(connection, options) {
2378
2135
  method: 'send'
2379
2136
  }));
2380
2137
  };
2381
-
2382
2138
  var initialize = function initialize(app) {
2383
2139
  if (typeof app.defaultService === 'function') {
2384
2140
  throw new Error('Only one default client provider can be configured');
2385
2141
  }
2386
-
2387
2142
  app.primus = connection;
2388
2143
  app.defaultService = defaultService;
2389
2144
  };
2390
-
2391
2145
  initialize.Service = Service;
2392
2146
  initialize.service = defaultService;
2393
2147
  return initialize;
2394
2148
  }
2395
-
2396
2149
  module.exports = primusClient;
2397
2150
  module.exports["default"] = primusClient;
2398
2151
 
@@ -2405,53 +2158,37 @@ module.exports["default"] = primusClient;
2405
2158
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2406
2159
 
2407
2160
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2408
-
2409
2161
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2410
-
2411
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2412
-
2162
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
2413
2163
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2414
-
2164
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2165
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2415
2166
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
2416
-
2417
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2418
-
2167
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2419
2168
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2420
-
2421
2169
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
2422
-
2423
2170
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2424
-
2425
2171
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2426
-
2427
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2428
-
2172
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2429
2173
  var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2430
-
2431
2174
  var AngularHttpService = /*#__PURE__*/function (_Base) {
2432
2175
  _inherits(AngularHttpService, _Base);
2433
-
2434
2176
  var _super = _createSuper(AngularHttpService);
2435
-
2436
2177
  function AngularHttpService() {
2437
2178
  _classCallCheck(this, AngularHttpService);
2438
-
2439
2179
  return _super.apply(this, arguments);
2440
2180
  }
2441
-
2442
2181
  _createClass(AngularHttpService, [{
2443
2182
  key: "request",
2444
2183
  value: function request(options, params) {
2445
2184
  var httpClient = this.connection;
2446
2185
  var HttpHeaders = this.options.HttpHeaders;
2447
-
2448
2186
  if (!httpClient || !HttpHeaders) {
2449
2187
  throw new Error("Please pass angular's 'httpClient' (instance) and and object with 'HttpHeaders' (class) to feathers-rest");
2450
2188
  }
2451
-
2452
2189
  var url = options.url;
2453
2190
  var _params$connection = params.connection,
2454
- connection = _params$connection === void 0 ? {} : _params$connection;
2191
+ connection = _params$connection === void 0 ? {} : _params$connection;
2455
2192
  var headers = new HttpHeaders(Object.assign({
2456
2193
  Accept: 'application/json'
2457
2194
  }, this.options.headers, options.headers, connection.headers));
@@ -2465,19 +2202,15 @@ var AngularHttpService = /*#__PURE__*/function (_Base) {
2465
2202
  httpClient.request(options.method, url, requestOptions).subscribe(resolve, reject);
2466
2203
  }).catch(function (error) {
2467
2204
  var e = error.error;
2468
-
2469
2205
  if (e) {
2470
2206
  throw typeof e === 'string' ? JSON.parse(e) : e;
2471
2207
  }
2472
-
2473
2208
  throw error;
2474
2209
  });
2475
2210
  }
2476
2211
  }]);
2477
-
2478
2212
  return AngularHttpService;
2479
2213
  }(Base);
2480
-
2481
2214
  module.exports = AngularHttpService;
2482
2215
 
2483
2216
  /***/ }),
@@ -2489,53 +2222,37 @@ module.exports = AngularHttpService;
2489
2222
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2490
2223
 
2491
2224
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2492
-
2493
2225
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2494
-
2495
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2496
-
2226
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
2497
2227
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2498
-
2228
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2229
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2499
2230
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
2500
-
2501
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2502
-
2231
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2503
2232
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2504
-
2505
2233
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
2506
-
2507
2234
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2508
-
2509
2235
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2510
-
2511
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2512
-
2236
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2513
2237
  var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2514
-
2515
2238
  var AngularService = /*#__PURE__*/function (_Base) {
2516
2239
  _inherits(AngularService, _Base);
2517
-
2518
2240
  var _super = _createSuper(AngularService);
2519
-
2520
2241
  function AngularService() {
2521
2242
  _classCallCheck(this, AngularService);
2522
-
2523
2243
  return _super.apply(this, arguments);
2524
2244
  }
2525
-
2526
2245
  _createClass(AngularService, [{
2527
2246
  key: "request",
2528
2247
  value: function request(options, params) {
2529
2248
  var http = this.connection;
2530
2249
  var Headers = this.options.Headers;
2531
-
2532
2250
  if (!http || !Headers) {
2533
2251
  throw new Error("Please pass angular's 'http' (instance) and and object with 'Headers' (class) to feathers-rest");
2534
2252
  }
2535
-
2536
2253
  var url = options.url;
2537
2254
  var _params$connection = params.connection,
2538
- connection = _params$connection === void 0 ? {} : _params$connection;
2255
+ connection = _params$connection === void 0 ? {} : _params$connection;
2539
2256
  var headers = new Headers(Object.assign({
2540
2257
  Accept: 'application/json'
2541
2258
  }, this.options.headers, options.headers, connection.headers));
@@ -2555,10 +2272,8 @@ var AngularService = /*#__PURE__*/function (_Base) {
2555
2272
  });
2556
2273
  }
2557
2274
  }]);
2558
-
2559
2275
  return AngularService;
2560
2276
  }(Base);
2561
-
2562
2277
  module.exports = AngularService;
2563
2278
 
2564
2279
  /***/ }),
@@ -2570,40 +2285,26 @@ module.exports = AngularService;
2570
2285
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2571
2286
 
2572
2287
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2573
-
2574
2288
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2575
-
2576
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2577
-
2289
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
2578
2290
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2579
-
2291
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2292
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2580
2293
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
2581
-
2582
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2583
-
2294
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2584
2295
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2585
-
2586
2296
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
2587
-
2588
2297
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2589
-
2590
2298
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2591
-
2592
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2593
-
2299
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2594
2300
  var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2595
-
2596
2301
  var AxiosService = /*#__PURE__*/function (_Base) {
2597
2302
  _inherits(AxiosService, _Base);
2598
-
2599
2303
  var _super = _createSuper(AxiosService);
2600
-
2601
2304
  function AxiosService() {
2602
2305
  _classCallCheck(this, AxiosService);
2603
-
2604
2306
  return _super.apply(this, arguments);
2605
2307
  }
2606
-
2607
2308
  _createClass(AxiosService, [{
2608
2309
  key: "request",
2609
2310
  value: function request(options, params) {
@@ -2623,10 +2324,8 @@ var AxiosService = /*#__PURE__*/function (_Base) {
2623
2324
  });
2624
2325
  }
2625
2326
  }]);
2626
-
2627
2327
  return AxiosService;
2628
2328
  }(Base);
2629
-
2630
2329
  module.exports = AxiosService;
2631
2330
 
2632
2331
  /***/ }),
@@ -2637,54 +2336,43 @@ module.exports = AxiosService;
2637
2336
  \**********************************/
2638
2337
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2639
2338
 
2339
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2640
2340
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2641
-
2642
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2643
-
2341
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
2644
2342
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2645
-
2343
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2344
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2646
2345
  var qs = __webpack_require__(/*! qs */ "../../node_modules/qs/lib/index.js");
2647
-
2648
2346
  var _require = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js"),
2649
- Unavailable = _require.Unavailable;
2650
-
2347
+ Unavailable = _require.Unavailable;
2651
2348
  var _require2 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"),
2652
- _ = _require2._;
2653
-
2349
+ _ = _require2._;
2654
2350
  var _require3 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"),
2655
- stripSlashes = _require3.stripSlashes;
2656
-
2351
+ stripSlashes = _require3.stripSlashes;
2657
2352
  var _require4 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js"),
2658
- convert = _require4.convert;
2659
-
2353
+ convert = _require4.convert;
2660
2354
  function toError(error) {
2661
2355
  if (error.code === 'ECONNREFUSED') {
2662
2356
  throw new Unavailable(error.message, _.pick(error, 'address', 'port', 'config'));
2663
2357
  }
2664
-
2665
2358
  throw convert(error);
2666
2359
  }
2667
-
2668
2360
  var Base = /*#__PURE__*/function () {
2669
2361
  function Base(settings) {
2670
2362
  _classCallCheck(this, Base);
2671
-
2672
2363
  this.name = stripSlashes(settings.name);
2673
2364
  this.options = settings.options;
2674
2365
  this.connection = settings.connection;
2675
2366
  this.base = "".concat(settings.base, "/").concat(this.name);
2676
2367
  }
2677
-
2678
2368
  _createClass(Base, [{
2679
2369
  key: "makeUrl",
2680
2370
  value: function makeUrl(query, id) {
2681
2371
  query = query || {};
2682
2372
  var url = this.base;
2683
-
2684
2373
  if (typeof id !== 'undefined' && id !== null) {
2685
2374
  url += "/".concat(encodeURIComponent(id));
2686
2375
  }
2687
-
2688
2376
  return url + this.getQuery(query);
2689
2377
  }
2690
2378
  }, {
@@ -2694,7 +2382,6 @@ var Base = /*#__PURE__*/function () {
2694
2382
  var queryString = qs.stringify(query);
2695
2383
  return "?".concat(queryString);
2696
2384
  }
2697
-
2698
2385
  return '';
2699
2386
  }
2700
2387
  }, {
@@ -2711,11 +2398,9 @@ var Base = /*#__PURE__*/function () {
2711
2398
  key: "get",
2712
2399
  value: function get(id) {
2713
2400
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2714
-
2715
2401
  if (typeof id === 'undefined') {
2716
2402
  return Promise.reject(new Error("id for 'get' can not be undefined"));
2717
2403
  }
2718
-
2719
2404
  return this.request({
2720
2405
  url: this.makeUrl(params.query, id),
2721
2406
  method: 'GET',
@@ -2739,11 +2424,9 @@ var Base = /*#__PURE__*/function () {
2739
2424
  key: "update",
2740
2425
  value: function update(id, body) {
2741
2426
  var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2742
-
2743
2427
  if (typeof id === 'undefined') {
2744
2428
  return Promise.reject(new Error("id for 'update' can not be undefined, only 'null' when updating multiple entries"));
2745
2429
  }
2746
-
2747
2430
  return this.request({
2748
2431
  url: this.makeUrl(params.query, id),
2749
2432
  body: body,
@@ -2757,11 +2440,9 @@ var Base = /*#__PURE__*/function () {
2757
2440
  key: "patch",
2758
2441
  value: function patch(id, body) {
2759
2442
  var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2760
-
2761
2443
  if (typeof id === 'undefined') {
2762
2444
  return Promise.reject(new Error("id for 'patch' can not be undefined, only 'null' when updating multiple entries"));
2763
2445
  }
2764
-
2765
2446
  return this.request({
2766
2447
  url: this.makeUrl(params.query, id),
2767
2448
  body: body,
@@ -2775,11 +2456,9 @@ var Base = /*#__PURE__*/function () {
2775
2456
  key: "remove",
2776
2457
  value: function remove(id) {
2777
2458
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2778
-
2779
2459
  if (typeof id === 'undefined') {
2780
2460
  return Promise.reject(new Error("id for 'remove' can not be undefined, only 'null' when removing multiple entries"));
2781
2461
  }
2782
-
2783
2462
  return this.request({
2784
2463
  url: this.makeUrl(params.query, id),
2785
2464
  method: 'DELETE',
@@ -2787,10 +2466,8 @@ var Base = /*#__PURE__*/function () {
2787
2466
  }, params).catch(toError);
2788
2467
  }
2789
2468
  }]);
2790
-
2791
2469
  return Base;
2792
2470
  }();
2793
-
2794
2471
  module.exports = Base;
2795
2472
 
2796
2473
  /***/ }),
@@ -2802,42 +2479,27 @@ module.exports = Base;
2802
2479
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2803
2480
 
2804
2481
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2805
-
2806
2482
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2807
-
2808
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2809
-
2483
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
2810
2484
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2811
-
2485
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2486
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2812
2487
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
2813
-
2814
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2815
-
2488
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2816
2489
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2817
-
2818
2490
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
2819
-
2820
2491
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2821
-
2822
2492
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2823
-
2824
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2825
-
2493
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2826
2494
  var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2827
-
2828
2495
  var errors = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
2829
-
2830
2496
  var FetchService = /*#__PURE__*/function (_Base) {
2831
2497
  _inherits(FetchService, _Base);
2832
-
2833
2498
  var _super = _createSuper(FetchService);
2834
-
2835
2499
  function FetchService() {
2836
2500
  _classCallCheck(this, FetchService);
2837
-
2838
2501
  return _super.apply(this, arguments);
2839
2502
  }
2840
-
2841
2503
  _createClass(FetchService, [{
2842
2504
  key: "request",
2843
2505
  value: function request(options, params) {
@@ -2845,17 +2507,14 @@ var FetchService = /*#__PURE__*/function (_Base) {
2845
2507
  fetchOptions.headers = Object.assign({
2846
2508
  Accept: 'application/json'
2847
2509
  }, this.options.headers, fetchOptions.headers);
2848
-
2849
2510
  if (options.body) {
2850
2511
  fetchOptions.body = JSON.stringify(options.body);
2851
2512
  }
2852
-
2853
2513
  var fetch = this.connection;
2854
2514
  return fetch(options.url, fetchOptions).then(this.checkStatus).then(function (response) {
2855
2515
  if (response.status === 204) {
2856
2516
  return null;
2857
2517
  }
2858
-
2859
2518
  return response.json();
2860
2519
  });
2861
2520
  }
@@ -2865,7 +2524,6 @@ var FetchService = /*#__PURE__*/function (_Base) {
2865
2524
  if (response.ok) {
2866
2525
  return response;
2867
2526
  }
2868
-
2869
2527
  return response.json().catch(function () {
2870
2528
  var ErrorClass = errors[response.status] || Error;
2871
2529
  return new ErrorClass('JSON parsing error');
@@ -2875,10 +2533,8 @@ var FetchService = /*#__PURE__*/function (_Base) {
2875
2533
  });
2876
2534
  }
2877
2535
  }]);
2878
-
2879
2536
  return FetchService;
2880
2537
  }(Base);
2881
-
2882
2538
  module.exports = FetchService;
2883
2539
 
2884
2540
  /***/ }),
@@ -2890,21 +2546,13 @@ module.exports = FetchService;
2890
2546
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2891
2547
 
2892
2548
  var jQueryClient = __webpack_require__(/*! ./jquery */ "../rest-client/lib/jquery.js");
2893
-
2894
2549
  var SuperagentClient = __webpack_require__(/*! ./superagent */ "../rest-client/lib/superagent.js");
2895
-
2896
2550
  var RequestClient = __webpack_require__(/*! ./request */ "../rest-client/lib/request.js");
2897
-
2898
2551
  var FetchClient = __webpack_require__(/*! ./fetch */ "../rest-client/lib/fetch.js");
2899
-
2900
2552
  var AxiosClient = __webpack_require__(/*! ./axios */ "../rest-client/lib/axios.js");
2901
-
2902
2553
  var AngularClient = __webpack_require__(/*! ./angular */ "../rest-client/lib/angular.js");
2903
-
2904
2554
  var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2905
-
2906
2555
  var AngularHttpClient = __webpack_require__(/*! ./angular-http-client */ "../rest-client/lib/angular-http-client.js");
2907
-
2908
2556
  var transports = {
2909
2557
  jquery: jQueryClient,
2910
2558
  superagent: SuperagentClient,
@@ -2914,7 +2562,6 @@ var transports = {
2914
2562
  angular: AngularClient,
2915
2563
  angularHttpClient: AngularHttpClient
2916
2564
  };
2917
-
2918
2565
  function restClient() {
2919
2566
  var base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2920
2567
  var result = {
@@ -2924,16 +2571,13 @@ function restClient() {
2924
2571
  result[key] = function (connection) {
2925
2572
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2926
2573
  var Service = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : transports[key];
2927
-
2928
2574
  if (!connection) {
2929
2575
  throw new Error("".concat(key, " has to be provided to feathers-rest"));
2930
2576
  }
2931
-
2932
2577
  if (typeof options === 'function') {
2933
2578
  Service = options;
2934
2579
  options = {};
2935
2580
  }
2936
-
2937
2581
  var defaultService = function defaultService(name) {
2938
2582
  return new Service({
2939
2583
  base: base,
@@ -2942,16 +2586,13 @@ function restClient() {
2942
2586
  options: options
2943
2587
  });
2944
2588
  };
2945
-
2946
2589
  var initialize = function initialize(app) {
2947
2590
  if (typeof app.defaultService === 'function') {
2948
2591
  throw new Error('Only one default client provider can be configured');
2949
2592
  }
2950
-
2951
2593
  app.rest = connection;
2952
2594
  app.defaultService = defaultService;
2953
2595
  };
2954
-
2955
2596
  initialize.Service = Service;
2956
2597
  initialize.service = defaultService;
2957
2598
  return initialize;
@@ -2959,7 +2600,6 @@ function restClient() {
2959
2600
  });
2960
2601
  return result;
2961
2602
  }
2962
-
2963
2603
  module.exports = Object.assign(restClient, {
2964
2604
  SuperagentClient: SuperagentClient,
2965
2605
  FetchClient: FetchClient,
@@ -2980,81 +2620,60 @@ module.exports["default"] = restClient;
2980
2620
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2981
2621
 
2982
2622
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2983
-
2984
2623
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2985
-
2986
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2987
-
2624
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
2988
2625
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2989
-
2626
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2627
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2990
2628
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
2991
-
2992
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2993
-
2629
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2994
2630
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2995
-
2996
2631
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
2997
-
2998
2632
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2999
-
3000
2633
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3001
-
3002
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3003
-
2634
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3004
2635
  var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
3005
-
3006
2636
  var JQueryService = /*#__PURE__*/function (_Base) {
3007
2637
  _inherits(JQueryService, _Base);
3008
-
3009
2638
  var _super = _createSuper(JQueryService);
3010
-
3011
2639
  function JQueryService() {
3012
2640
  _classCallCheck(this, JQueryService);
3013
-
3014
2641
  return _super.apply(this, arguments);
3015
2642
  }
3016
-
3017
2643
  _createClass(JQueryService, [{
3018
2644
  key: "request",
3019
2645
  value: function request(options, params) {
3020
2646
  var _this = this;
3021
-
3022
2647
  var _params$connection = params.connection,
3023
- connection = _params$connection === void 0 ? {} : _params$connection;
2648
+ connection = _params$connection === void 0 ? {} : _params$connection;
3024
2649
  var headers = Object.assign({}, options.headers, this.options.headers, connection.headers);
3025
2650
  var opts = Object.assign({
3026
2651
  dataType: options.type || 'json'
3027
2652
  }, connection, options, {
3028
2653
  headers: headers
3029
2654
  });
3030
-
3031
2655
  if (options.body) {
3032
2656
  opts.data = JSON.stringify(options.body);
3033
2657
  opts.contentType = 'application/json';
3034
2658
  }
3035
-
3036
2659
  delete opts.type;
3037
2660
  delete opts.body;
3038
2661
  return new Promise(function (resolve, reject) {
3039
2662
  _this.connection.ajax(opts).then(resolve, function (xhr) {
3040
2663
  var error = xhr.responseText;
3041
-
3042
2664
  try {
3043
2665
  error = JSON.parse(error);
3044
2666
  } catch (e) {
3045
2667
  error = new Error(xhr.responseText);
3046
2668
  }
3047
-
3048
2669
  error.xhr = error.response = xhr;
3049
2670
  reject(error);
3050
2671
  });
3051
2672
  });
3052
2673
  }
3053
2674
  }]);
3054
-
3055
2675
  return JQueryService;
3056
2676
  }(Base);
3057
-
3058
2677
  module.exports = JQueryService;
3059
2678
 
3060
2679
  /***/ }),
@@ -3066,50 +2685,34 @@ module.exports = JQueryService;
3066
2685
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3067
2686
 
3068
2687
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3069
-
3070
2688
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3071
-
3072
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3073
-
2689
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3074
2690
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3075
-
2691
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2692
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3076
2693
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
3077
-
3078
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3079
-
2694
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3080
2695
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
3081
-
3082
2696
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
3083
-
3084
2697
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3085
-
3086
2698
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3087
-
3088
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3089
-
2699
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3090
2700
  var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
3091
-
3092
2701
  var RequestService = /*#__PURE__*/function (_Base) {
3093
2702
  _inherits(RequestService, _Base);
3094
-
3095
2703
  var _super = _createSuper(RequestService);
3096
-
3097
2704
  function RequestService() {
3098
2705
  _classCallCheck(this, RequestService);
3099
-
3100
2706
  return _super.apply(this, arguments);
3101
2707
  }
3102
-
3103
2708
  _createClass(RequestService, [{
3104
2709
  key: "request",
3105
2710
  value: function request(options, params) {
3106
2711
  var _this = this;
3107
-
3108
2712
  return new Promise(function (resolve, reject) {
3109
2713
  var _params$connection = params.connection,
3110
- connection = _params$connection === void 0 ? {} : _params$connection;
2714
+ connection = _params$connection === void 0 ? {} : _params$connection;
3111
2715
  var headers = Object.assign({}, options.headers, connection.headers);
3112
-
3113
2716
  _this.connection(Object.assign({
3114
2717
  json: true
3115
2718
  }, options, params.connection, {
@@ -3118,25 +2721,20 @@ var RequestService = /*#__PURE__*/function (_Base) {
3118
2721
  if (error) {
3119
2722
  return reject(error);
3120
2723
  }
3121
-
3122
2724
  if (!error && res.statusCode >= 400) {
3123
2725
  if (typeof data === 'string') {
3124
2726
  return reject(new Error(data));
3125
2727
  }
3126
-
3127
2728
  data.response = res;
3128
2729
  return reject(Object.assign(new Error(data.message), data));
3129
2730
  }
3130
-
3131
2731
  resolve(data);
3132
2732
  });
3133
2733
  });
3134
2734
  }
3135
2735
  }]);
3136
-
3137
2736
  return RequestService;
3138
2737
  }(Base);
3139
-
3140
2738
  module.exports = RequestService;
3141
2739
 
3142
2740
  /***/ }),
@@ -3148,51 +2746,35 @@ module.exports = RequestService;
3148
2746
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3149
2747
 
3150
2748
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3151
-
3152
2749
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3153
-
3154
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3155
-
2750
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3156
2751
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3157
-
2752
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2753
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3158
2754
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
3159
-
3160
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3161
-
2755
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3162
2756
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
3163
-
3164
2757
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
3165
-
3166
2758
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3167
-
3168
2759
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3169
-
3170
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3171
-
2760
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3172
2761
  var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
3173
-
3174
2762
  var SuperagentService = /*#__PURE__*/function (_Base) {
3175
2763
  _inherits(SuperagentService, _Base);
3176
-
3177
2764
  var _super = _createSuper(SuperagentService);
3178
-
3179
2765
  function SuperagentService() {
3180
2766
  _classCallCheck(this, SuperagentService);
3181
-
3182
2767
  return _super.apply(this, arguments);
3183
2768
  }
3184
-
3185
2769
  _createClass(SuperagentService, [{
3186
2770
  key: "request",
3187
2771
  value: function request(options, params) {
3188
2772
  var superagent = this.connection(options.method, options.url).set(this.options.headers || {}).set('Accept', 'application/json').set(params.connection || {}).set(options.headers || {}).type(options.type || 'json');
3189
2773
  return new Promise(function (resolve, reject) {
3190
2774
  superagent.set(options.headers);
3191
-
3192
2775
  if (options.body) {
3193
2776
  superagent.send(options.body);
3194
2777
  }
3195
-
3196
2778
  superagent.end(function (error, res) {
3197
2779
  if (error) {
3198
2780
  try {
@@ -3200,19 +2782,15 @@ var SuperagentService = /*#__PURE__*/function (_Base) {
3200
2782
  error = JSON.parse(error.response.text);
3201
2783
  error.response = response;
3202
2784
  } catch (e) {}
3203
-
3204
2785
  return reject(error);
3205
2786
  }
3206
-
3207
2787
  resolve(res && res.body);
3208
2788
  });
3209
2789
  });
3210
2790
  }
3211
2791
  }]);
3212
-
3213
2792
  return SuperagentService;
3214
2793
  }(Base);
3215
-
3216
2794
  module.exports = SuperagentService;
3217
2795
 
3218
2796
  /***/ }),
@@ -3224,21 +2802,17 @@ module.exports = SuperagentService;
3224
2802
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3225
2803
 
3226
2804
  var Service = __webpack_require__(/*! @feathersjs/transport-commons/client */ "../transport-commons/client.js");
3227
-
3228
2805
  function socketioClient(connection, options) {
3229
2806
  if (!connection) {
3230
2807
  throw new Error('Socket.io connection needs to be provided');
3231
2808
  }
3232
-
3233
2809
  if (connection && connection.io && connection.io.engine && connection.io.engine.transport && connection.io.engine.transport.query && connection.io.engine.transport.query.EIO > 3) {
3234
2810
  // tslint:disable-next-line
3235
2811
  console.error('You are trying to use the Socket.io client version 3 or later with Feathers v4 which only supports Socket.io version 2. Please use socket.io-client version 2 instead.');
3236
2812
  throw new Error('socket.io-client must be version 2.x');
3237
2813
  }
3238
-
3239
2814
  var defaultService = function defaultService(name) {
3240
2815
  var _this = this;
3241
-
3242
2816
  var events = Object.keys(this.eventMappings || {}).map(function (method) {
3243
2817
  return _this.eventMappings[method];
3244
2818
  });
@@ -3250,21 +2824,17 @@ function socketioClient(connection, options) {
3250
2824
  });
3251
2825
  return new Service(settings);
3252
2826
  };
3253
-
3254
2827
  var initialize = function initialize(app) {
3255
2828
  if (typeof app.defaultService === 'function') {
3256
2829
  throw new Error('Only one default client provider can be configured');
3257
2830
  }
3258
-
3259
2831
  app.io = connection;
3260
2832
  app.defaultService = defaultService;
3261
2833
  };
3262
-
3263
2834
  initialize.Service = Service;
3264
2835
  initialize.service = defaultService;
3265
2836
  return initialize;
3266
2837
  }
3267
-
3268
2838
  module.exports = socketioClient;
3269
2839
  module.exports["default"] = socketioClient;
3270
2840
 
@@ -3289,70 +2859,56 @@ module.exports = __webpack_require__(/*! ./lib/client */ "../transport-commons/l
3289
2859
  "use strict";
3290
2860
 
3291
2861
 
2862
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3292
2863
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3293
-
3294
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3295
-
2864
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3296
2865
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3297
-
2866
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2867
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3298
2868
  var __importDefault = this && this.__importDefault || function (mod) {
3299
2869
  return mod && mod.__esModule ? mod : {
3300
2870
  "default": mod
3301
2871
  };
3302
2872
  };
3303
-
3304
2873
  Object.defineProperty(exports, "__esModule", ({
3305
2874
  value: true
3306
2875
  }));
3307
2876
  exports.Service = void 0;
3308
-
3309
2877
  var debug_1 = __importDefault(__webpack_require__(/*! debug */ "../../node_modules/debug/src/browser.js"));
3310
-
3311
2878
  var errors_1 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
3312
-
3313
2879
  var debug = (0, debug_1.default)('@feathersjs/transport-commons/client');
3314
2880
  var namespacedEmitterMethods = ['addListener', 'emit', 'listenerCount', 'listeners', 'on', 'once', 'prependListener', 'prependOnceListener', 'removeAllListeners', 'removeListener'];
3315
2881
  var otherEmitterMethods = ['eventNames', 'getMaxListeners', 'setMaxListeners'];
3316
-
3317
2882
  var addEmitterMethods = function addEmitterMethods(service) {
3318
2883
  otherEmitterMethods.forEach(function (method) {
3319
2884
  service[method] = function () {
3320
2885
  var _this$connection;
3321
-
3322
2886
  if (typeof this.connection[method] !== 'function') {
3323
2887
  throw new Error("Can not call '".concat(method, "' on the client service connection"));
3324
2888
  }
3325
-
3326
2889
  return (_this$connection = this.connection)[method].apply(_this$connection, arguments);
3327
2890
  };
3328
- }); // Methods that should add the namespace (service path)
3329
-
2891
+ });
2892
+ // Methods that should add the namespace (service path)
3330
2893
  namespacedEmitterMethods.forEach(function (method) {
3331
2894
  service[method] = function (name) {
3332
2895
  var _this$connection2;
3333
-
3334
2896
  if (typeof this.connection[method] !== 'function') {
3335
2897
  throw new Error("Can not call '".concat(method, "' on the client service connection"));
3336
2898
  }
3337
-
3338
2899
  var eventName = "".concat(this.path, " ").concat(name);
3339
2900
  debug("Calling emitter method ".concat(method, " with ") + "namespaced event '".concat(eventName, "'"));
3340
-
3341
2901
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3342
2902
  args[_key - 1] = arguments[_key];
3343
2903
  }
3344
-
3345
2904
  var result = (_this$connection2 = this.connection)[method].apply(_this$connection2, [eventName].concat(args));
3346
-
3347
2905
  return result === this.connection ? this : result;
3348
2906
  };
3349
2907
  });
3350
2908
  };
3351
-
3352
2909
  var Service = /*#__PURE__*/function () {
3353
2910
  function Service(options) {
3354
2911
  _classCallCheck(this, Service);
3355
-
3356
2912
  this.events = options.events;
3357
2913
  this.path = options.name;
3358
2914
  this.connection = options.connection;
@@ -3360,19 +2916,15 @@ var Service = /*#__PURE__*/function () {
3360
2916
  this.timeout = options.timeout || 5000;
3361
2917
  addEmitterMethods(this);
3362
2918
  }
3363
-
3364
2919
  _createClass(Service, [{
3365
2920
  key: "send",
3366
2921
  value: function send(method) {
3367
2922
  var _this = this;
3368
-
3369
2923
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
3370
2924
  args[_key2 - 1] = arguments[_key2];
3371
2925
  }
3372
-
3373
2926
  return new Promise(function (resolve, reject) {
3374
2927
  var _this$connection3;
3375
-
3376
2928
  var timeoutId = setTimeout(function () {
3377
2929
  return reject(new errors_1.Timeout("Timeout of ".concat(_this.timeout, "ms exceeded calling ").concat(method, " on ").concat(_this.path), {
3378
2930
  timeout: _this.timeout,
@@ -3387,7 +2939,6 @@ var Service = /*#__PURE__*/function () {
3387
2939
  return error ? reject(error) : resolve(data);
3388
2940
  });
3389
2941
  debug("Sending socket.".concat(_this.method), args);
3390
-
3391
2942
  (_this$connection3 = _this.connection)[_this.method].apply(_this$connection3, args);
3392
2943
  });
3393
2944
  }
@@ -3426,36 +2977,30 @@ var Service = /*#__PURE__*/function () {
3426
2977
  value: function remove(id) {
3427
2978
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3428
2979
  return this.send('remove', id, params.query || {});
3429
- } // `off` is actually not part of the Node event emitter spec
2980
+ }
2981
+ // `off` is actually not part of the Node event emitter spec
3430
2982
  // but we are adding it since everybody is expecting it because
3431
2983
  // of the emitter-component Socket.io is using
3432
-
3433
2984
  }, {
3434
2985
  key: "off",
3435
2986
  value: function off(name) {
3436
2987
  for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
3437
2988
  args[_key3 - 1] = arguments[_key3];
3438
2989
  }
3439
-
3440
2990
  if (typeof this.connection.off === 'function') {
3441
2991
  var _this$connection4;
3442
-
3443
2992
  var result = (_this$connection4 = this.connection).off.apply(_this$connection4, ["".concat(this.path, " ").concat(name)].concat(args));
3444
-
3445
2993
  return result === this.connection ? this : result;
3446
2994
  } else if (args.length === 0) {
3447
2995
  // @ts-ignore
3448
2996
  return this.removeAllListeners(name);
3449
- } // @ts-ignore
3450
-
3451
-
2997
+ }
2998
+ // @ts-ignore
3452
2999
  return this.removeListener.apply(this, [name].concat(args));
3453
3000
  }
3454
3001
  }]);
3455
-
3456
3002
  return Service;
3457
3003
  }();
3458
-
3459
3004
  exports.Service = Service;
3460
3005
 
3461
3006
  /***/ }),
@@ -4183,18 +3728,23 @@ var ThrowTypeError = $gOPD
4183
3728
  : throwTypeError;
4184
3729
 
4185
3730
  var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")();
3731
+ var hasProto = __webpack_require__(/*! has-proto */ "../../node_modules/has-proto/index.js")();
4186
3732
 
4187
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
3733
+ var getProto = Object.getPrototypeOf || (
3734
+ hasProto
3735
+ ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
3736
+ : null
3737
+ );
4188
3738
 
4189
3739
  var needsEval = {};
4190
3740
 
4191
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
3741
+ var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
4192
3742
 
4193
3743
  var INTRINSICS = {
4194
3744
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
4195
3745
  '%Array%': Array,
4196
3746
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
4197
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
3747
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
4198
3748
  '%AsyncFromSyncIteratorPrototype%': undefined,
4199
3749
  '%AsyncFunction%': needsEval,
4200
3750
  '%AsyncGenerator%': needsEval,
@@ -4202,6 +3752,8 @@ var INTRINSICS = {
4202
3752
  '%AsyncIteratorPrototype%': needsEval,
4203
3753
  '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
4204
3754
  '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
3755
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
3756
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
4205
3757
  '%Boolean%': Boolean,
4206
3758
  '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
4207
3759
  '%Date%': Date,
@@ -4222,10 +3774,10 @@ var INTRINSICS = {
4222
3774
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
4223
3775
  '%isFinite%': isFinite,
4224
3776
  '%isNaN%': isNaN,
4225
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
3777
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
4226
3778
  '%JSON%': typeof JSON === 'object' ? JSON : undefined,
4227
3779
  '%Map%': typeof Map === 'undefined' ? undefined : Map,
4228
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
3780
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
4229
3781
  '%Math%': Math,
4230
3782
  '%Number%': Number,
4231
3783
  '%Object%': Object,
@@ -4238,10 +3790,10 @@ var INTRINSICS = {
4238
3790
  '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
4239
3791
  '%RegExp%': RegExp,
4240
3792
  '%Set%': typeof Set === 'undefined' ? undefined : Set,
4241
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
3793
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
4242
3794
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
4243
3795
  '%String%': String,
4244
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
3796
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
4245
3797
  '%Symbol%': hasSymbols ? Symbol : undefined,
4246
3798
  '%SyntaxError%': $SyntaxError,
4247
3799
  '%ThrowTypeError%': ThrowTypeError,
@@ -4257,6 +3809,16 @@ var INTRINSICS = {
4257
3809
  '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
4258
3810
  };
4259
3811
 
3812
+ if (getProto) {
3813
+ try {
3814
+ null.error; // eslint-disable-line no-unused-expressions
3815
+ } catch (e) {
3816
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
3817
+ var errorProto = getProto(getProto(e));
3818
+ INTRINSICS['%Error.prototype%'] = errorProto;
3819
+ }
3820
+ }
3821
+
4260
3822
  var doEval = function doEval(name) {
4261
3823
  var value;
4262
3824
  if (name === '%AsyncFunction%') {
@@ -4272,7 +3834,7 @@ var doEval = function doEval(name) {
4272
3834
  }
4273
3835
  } else if (name === '%AsyncIteratorPrototype%') {
4274
3836
  var gen = doEval('%AsyncGenerator%');
4275
- if (gen) {
3837
+ if (gen && getProto) {
4276
3838
  value = getProto(gen.prototype);
4277
3839
  }
4278
3840
  }
@@ -4342,6 +3904,7 @@ var $concat = bind.call(Function.call, Array.prototype.concat);
4342
3904
  var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
4343
3905
  var $replace = bind.call(Function.call, String.prototype.replace);
4344
3906
  var $strSlice = bind.call(Function.call, String.prototype.slice);
3907
+ var $exec = bind.call(Function.call, RegExp.prototype.exec);
4345
3908
 
4346
3909
  /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
4347
3910
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
@@ -4397,6 +3960,9 @@ module.exports = function GetIntrinsic(name, allowMissing) {
4397
3960
  throw new $TypeError('"allowMissing" argument must be a boolean');
4398
3961
  }
4399
3962
 
3963
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
3964
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
3965
+ }
4400
3966
  var parts = stringToPath(name);
4401
3967
  var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
4402
3968
 
@@ -4470,6 +4036,28 @@ module.exports = function GetIntrinsic(name, allowMissing) {
4470
4036
  };
4471
4037
 
4472
4038
 
4039
+ /***/ }),
4040
+
4041
+ /***/ "../../node_modules/has-proto/index.js":
4042
+ /*!*********************************************!*\
4043
+ !*** ../../node_modules/has-proto/index.js ***!
4044
+ \*********************************************/
4045
+ /***/ (function(module) {
4046
+
4047
+ "use strict";
4048
+
4049
+
4050
+ var test = {
4051
+ foo: {}
4052
+ };
4053
+
4054
+ var $Object = Object;
4055
+
4056
+ module.exports = function hasProto() {
4057
+ return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
4058
+ };
4059
+
4060
+
4473
4061
  /***/ }),
4474
4062
 
4475
4063
  /***/ "../../node_modules/has-symbols/index.js":
@@ -4810,8 +4398,9 @@ function addNumericSeparator(num, str) {
4810
4398
  return $replace.call(str, sepRegex, '$&_');
4811
4399
  }
4812
4400
 
4813
- var inspectCustom = (__webpack_require__(/*! ./util.inspect */ "?c95a").custom);
4814
- var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
4401
+ var utilInspect = __webpack_require__(/*! ./util.inspect */ "?c95a");
4402
+ var inspectCustom = utilInspect.custom;
4403
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
4815
4404
 
4816
4405
  module.exports = function inspect_(obj, options, depth, seen) {
4817
4406
  var opts = options || {};
@@ -4901,7 +4490,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
4901
4490
  return inspect_(value, opts, depth + 1, seen);
4902
4491
  }
4903
4492
 
4904
- if (typeof obj === 'function') {
4493
+ if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
4905
4494
  var name = nameOf(obj);
4906
4495
  var keys = arrObjKeys(obj, inspect);
4907
4496
  return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
@@ -4931,31 +4520,35 @@ module.exports = function inspect_(obj, options, depth, seen) {
4931
4520
  }
4932
4521
  if (isError(obj)) {
4933
4522
  var parts = arrObjKeys(obj, inspect);
4934
- if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
4523
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
4935
4524
  return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
4936
4525
  }
4937
4526
  if (parts.length === 0) { return '[' + String(obj) + ']'; }
4938
4527
  return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
4939
4528
  }
4940
4529
  if (typeof obj === 'object' && customInspect) {
4941
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
4942
- return obj[inspectSymbol]();
4530
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
4531
+ return utilInspect(obj, { depth: maxDepth - depth });
4943
4532
  } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
4944
4533
  return obj.inspect();
4945
4534
  }
4946
4535
  }
4947
4536
  if (isMap(obj)) {
4948
4537
  var mapParts = [];
4949
- mapForEach.call(obj, function (value, key) {
4950
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
4951
- });
4538
+ if (mapForEach) {
4539
+ mapForEach.call(obj, function (value, key) {
4540
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
4541
+ });
4542
+ }
4952
4543
  return collectionOf('Map', mapSize.call(obj), mapParts, indent);
4953
4544
  }
4954
4545
  if (isSet(obj)) {
4955
4546
  var setParts = [];
4956
- setForEach.call(obj, function (value) {
4957
- setParts.push(inspect(value, obj));
4958
- });
4547
+ if (setForEach) {
4548
+ setForEach.call(obj, function (value) {
4549
+ setParts.push(inspect(value, obj));
4550
+ });
4551
+ }
4959
4552
  return collectionOf('Set', setSize.call(obj), setParts, indent);
4960
4553
  }
4961
4554
  if (isWeakMap(obj)) {
@@ -5372,7 +4965,8 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
5372
4965
  var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
5373
4966
 
5374
4967
  var parseValues = function parseQueryStringValues(str, options) {
5375
- var obj = {};
4968
+ var obj = { __proto__: null };
4969
+
5376
4970
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
5377
4971
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
5378
4972
  var parts = cleanStr.split(options.delimiter, limit);
@@ -5616,7 +5210,6 @@ var arrayPrefixGenerators = {
5616
5210
  };
5617
5211
 
5618
5212
  var isArray = Array.isArray;
5619
- var split = String.prototype.split;
5620
5213
  var push = Array.prototype.push;
5621
5214
  var pushToArray = function (arr, valueOrArray) {
5622
5215
  push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
@@ -5659,6 +5252,7 @@ var stringify = function stringify(
5659
5252
  object,
5660
5253
  prefix,
5661
5254
  generateArrayPrefix,
5255
+ commaRoundTrip,
5662
5256
  strictNullHandling,
5663
5257
  skipNulls,
5664
5258
  encoder,
@@ -5717,14 +5311,6 @@ var stringify = function stringify(
5717
5311
  if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
5718
5312
  if (encoder) {
5719
5313
  var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
5720
- if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
5721
- var valuesArray = split.call(String(obj), ',');
5722
- var valuesJoined = '';
5723
- for (var i = 0; i < valuesArray.length; ++i) {
5724
- valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
5725
- }
5726
- return [formatter(keyValue) + '=' + valuesJoined];
5727
- }
5728
5314
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
5729
5315
  }
5730
5316
  return [formatter(prefix) + '=' + formatter(String(obj))];
@@ -5739,6 +5325,9 @@ var stringify = function stringify(
5739
5325
  var objKeys;
5740
5326
  if (generateArrayPrefix === 'comma' && isArray(obj)) {
5741
5327
  // we need to join elements in
5328
+ if (encodeValuesOnly && encoder) {
5329
+ obj = utils.maybeMap(obj, encoder);
5330
+ }
5742
5331
  objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
5743
5332
  } else if (isArray(filter)) {
5744
5333
  objKeys = filter;
@@ -5747,6 +5336,8 @@ var stringify = function stringify(
5747
5336
  objKeys = sort ? keys.sort(sort) : keys;
5748
5337
  }
5749
5338
 
5339
+ var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
5340
+
5750
5341
  for (var j = 0; j < objKeys.length; ++j) {
5751
5342
  var key = objKeys[j];
5752
5343
  var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
@@ -5756,8 +5347,8 @@ var stringify = function stringify(
5756
5347
  }
5757
5348
 
5758
5349
  var keyPrefix = isArray(obj)
5759
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
5760
- : prefix + (allowDots ? '.' + key : '[' + key + ']');
5350
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
5351
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
5761
5352
 
5762
5353
  sideChannel.set(object, step);
5763
5354
  var valueSideChannel = getSideChannel();
@@ -5766,9 +5357,10 @@ var stringify = function stringify(
5766
5357
  value,
5767
5358
  keyPrefix,
5768
5359
  generateArrayPrefix,
5360
+ commaRoundTrip,
5769
5361
  strictNullHandling,
5770
5362
  skipNulls,
5771
- encoder,
5363
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
5772
5364
  filter,
5773
5365
  sort,
5774
5366
  allowDots,
@@ -5862,6 +5454,10 @@ module.exports = function (object, opts) {
5862
5454
  }
5863
5455
 
5864
5456
  var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
5457
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
5458
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
5459
+ }
5460
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
5865
5461
 
5866
5462
  if (!objKeys) {
5867
5463
  objKeys = Object.keys(obj);
@@ -5882,6 +5478,7 @@ module.exports = function (object, opts) {
5882
5478
  obj[key],
5883
5479
  key,
5884
5480
  generateArrayPrefix,
5481
+ commaRoundTrip,
5885
5482
  options.strictNullHandling,
5886
5483
  options.skipNulls,
5887
5484
  options.encode ? options.encoder : null,