@feathersjs/client 5.0.0-pre.30 → 5.0.0-pre.32

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
@@ -21,92 +21,60 @@ return /******/ (function() { // webpackBootstrap
21
21
 
22
22
 
23
23
  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); }
24
-
25
24
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
26
-
27
25
  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."); }
28
-
29
26
  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); }
30
-
31
27
  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; }
32
-
33
28
  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; }
34
-
35
29
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
36
-
37
30
  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); } }
38
-
39
31
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
40
-
41
32
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
42
-
43
33
  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); }
44
-
45
34
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
46
-
47
35
  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); }; }
48
-
49
36
  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); }
50
-
51
37
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
52
-
53
38
  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; } }
54
-
55
39
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
56
-
57
40
  Object.defineProperty(exports, "__esModule", ({
58
41
  value: true
59
42
  }));
60
43
  exports.AuthenticationClient = void 0;
61
-
62
44
  var errors_1 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
63
-
64
45
  var storage_1 = __webpack_require__(/*! ./storage */ "../authentication-client/lib/storage.js");
65
-
66
46
  var OauthError = /*#__PURE__*/function (_errors_1$FeathersErr) {
67
47
  _inherits(OauthError, _errors_1$FeathersErr);
68
-
69
48
  var _super = _createSuper(OauthError);
70
-
71
49
  function OauthError(message, data) {
72
50
  _classCallCheck(this, OauthError);
73
-
74
51
  return _super.call(this, message, 'OauthError', 401, 'oauth-error', data);
75
52
  }
76
-
77
53
  return _createClass(OauthError);
78
54
  }(errors_1.FeathersError);
79
-
80
55
  var getMatch = function getMatch(location, key) {
81
56
  var regex = new RegExp("(?:&?)".concat(key, "=([^&]*)"));
82
57
  var match = location.hash ? location.hash.match(regex) : null;
83
-
84
58
  if (match !== null) {
85
59
  var _match = _slicedToArray(match, 2),
86
- value = _match[1];
87
-
60
+ value = _match[1];
88
61
  return [value, regex];
89
62
  }
90
-
91
63
  return [null, regex];
92
64
  };
93
-
94
65
  var AuthenticationClient = /*#__PURE__*/function () {
95
66
  function AuthenticationClient(app, options) {
96
67
  _classCallCheck(this, AuthenticationClient);
97
-
98
68
  var socket = app.io;
99
69
  var storage = new storage_1.StorageWrapper(app.get('storage') || options.storage);
100
70
  this.app = app;
101
71
  this.options = options;
102
72
  this.authenticated = false;
103
73
  this.app.set('storage', storage);
104
-
105
74
  if (socket) {
106
75
  this.handleSocket(socket);
107
76
  }
108
77
  }
109
-
110
78
  _createClass(AuthenticationClient, [{
111
79
  key: "service",
112
80
  get: function get() {
@@ -121,7 +89,6 @@ var AuthenticationClient = /*#__PURE__*/function () {
121
89
  key: "handleSocket",
122
90
  value: function handleSocket(socket) {
123
91
  var _this = this;
124
-
125
92
  // Connection events happen on every reconnect
126
93
  var connected = this.app.io ? 'connect' : 'open';
127
94
  var disconnected = this.app.io ? 'disconnect' : 'disconnection';
@@ -130,13 +97,13 @@ var AuthenticationClient = /*#__PURE__*/function () {
130
97
  return socket.once(connected, function (data) {
131
98
  return resolve(data);
132
99
  });
133
- }) // Only reconnect when `reAuthenticate()` or `authenticate()`
100
+ })
101
+ // Only reconnect when `reAuthenticate()` or `authenticate()`
134
102
  // has been called explicitly first
135
103
  // Force reauthentication with the server
136
104
  .then(function () {
137
105
  return _this.authenticated ? _this.reAuthenticate(true) : null;
138
106
  });
139
-
140
107
  _this.app.set('authentication', authPromise);
141
108
  });
142
109
  }
@@ -144,25 +111,21 @@ var AuthenticationClient = /*#__PURE__*/function () {
144
111
  key: "getFromLocation",
145
112
  value: function getFromLocation(location) {
146
113
  var _getMatch = getMatch(location, this.options.locationKey),
147
- _getMatch2 = _slicedToArray(_getMatch, 2),
148
- accessToken = _getMatch2[0],
149
- tokenRegex = _getMatch2[1];
150
-
114
+ _getMatch2 = _slicedToArray(_getMatch, 2),
115
+ accessToken = _getMatch2[0],
116
+ tokenRegex = _getMatch2[1];
151
117
  if (accessToken !== null) {
152
118
  location.hash = location.hash.replace(tokenRegex, '');
153
119
  return Promise.resolve(accessToken);
154
120
  }
155
-
156
121
  var _getMatch3 = getMatch(location, this.options.locationErrorKey),
157
- _getMatch4 = _slicedToArray(_getMatch3, 2),
158
- message = _getMatch4[0],
159
- errorRegex = _getMatch4[1];
160
-
122
+ _getMatch4 = _slicedToArray(_getMatch3, 2),
123
+ message = _getMatch4[0],
124
+ errorRegex = _getMatch4[1];
161
125
  if (message !== null) {
162
126
  location.hash = location.hash.replace(errorRegex, '');
163
127
  return Promise.reject(new OauthError(decodeURIComponent(message)));
164
128
  }
165
-
166
129
  return Promise.resolve(null);
167
130
  }
168
131
  }, {
@@ -174,12 +137,10 @@ var AuthenticationClient = /*#__PURE__*/function () {
174
137
  key: "getAccessToken",
175
138
  value: function getAccessToken() {
176
139
  var _this2 = this;
177
-
178
140
  return this.storage.getItem(this.options.storageKey).then(function (accessToken) {
179
141
  if (!accessToken && typeof window !== 'undefined' && window.location) {
180
142
  return _this2.getFromLocation(window.location);
181
143
  }
182
-
183
144
  return accessToken || null;
184
145
  });
185
146
  }
@@ -199,7 +160,6 @@ var AuthenticationClient = /*#__PURE__*/function () {
199
160
  key: "handleError",
200
161
  value: function handleError(error, type) {
201
162
  var _this3 = this;
202
-
203
163
  if (error.code === 401 || error.code === 403) {
204
164
  var promise = this.removeAccessToken().then(function () {
205
165
  return _this3.reset();
@@ -208,26 +168,22 @@ var AuthenticationClient = /*#__PURE__*/function () {
208
168
  return Promise.reject(error);
209
169
  });
210
170
  }
211
-
212
171
  return Promise.reject(error);
213
172
  }
214
173
  }, {
215
174
  key: "reAuthenticate",
216
175
  value: function reAuthenticate() {
217
176
  var _this4 = this;
218
-
219
177
  var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
220
178
  var strategy = arguments.length > 1 ? arguments[1] : undefined;
221
179
  // Either returns the authentication state or
222
180
  // tries to re-authenticate with the stored JWT and strategy
223
181
  var authPromise = this.app.get('authentication');
224
-
225
182
  if (!authPromise || force === true) {
226
183
  authPromise = this.getAccessToken().then(function (accessToken) {
227
184
  if (!accessToken) {
228
185
  return _this4.handleError(new errors_1.NotAuthenticated('No accessToken found in storage'), 'authenticate');
229
186
  }
230
-
231
187
  return _this4.authenticate({
232
188
  strategy: strategy || _this4.options.jwtStrategy,
233
189
  accessToken: accessToken
@@ -235,26 +191,20 @@ var AuthenticationClient = /*#__PURE__*/function () {
235
191
  });
236
192
  this.app.set('authentication', authPromise);
237
193
  }
238
-
239
194
  return authPromise;
240
195
  }
241
196
  }, {
242
197
  key: "authenticate",
243
198
  value: function authenticate(authentication, params) {
244
199
  var _this5 = this;
245
-
246
200
  if (!authentication) {
247
201
  return this.reAuthenticate();
248
202
  }
249
-
250
203
  var promise = this.service.create(authentication, params).then(function (authResult) {
251
204
  var accessToken = authResult.accessToken;
252
205
  _this5.authenticated = true;
253
-
254
206
  _this5.app.emit('login', authResult);
255
-
256
207
  _this5.app.emit('authenticated', authResult);
257
-
258
208
  return _this5.setAccessToken(accessToken).then(function () {
259
209
  return authResult;
260
210
  });
@@ -268,14 +218,12 @@ var AuthenticationClient = /*#__PURE__*/function () {
268
218
  key: "logout",
269
219
  value: function logout() {
270
220
  var _this6 = this;
271
-
272
221
  return Promise.resolve(this.app.get('authentication')).then(function () {
273
222
  return _this6.service.remove(null).then(function (authResult) {
274
223
  return _this6.removeAccessToken().then(function () {
275
224
  return _this6.reset();
276
225
  }).then(function () {
277
226
  _this6.app.emit('logout', authResult);
278
-
279
227
  return authResult;
280
228
  });
281
229
  });
@@ -284,10 +232,8 @@ var AuthenticationClient = /*#__PURE__*/function () {
284
232
  });
285
233
  }
286
234
  }]);
287
-
288
235
  return AuthenticationClient;
289
236
  }();
290
-
291
237
  exports.AuthenticationClient = AuthenticationClient;
292
238
 
293
239
  /***/ }),
@@ -305,21 +251,17 @@ Object.defineProperty(exports, "__esModule", ({
305
251
  value: true
306
252
  }));
307
253
  exports.authentication = void 0;
308
-
309
254
  var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
310
-
311
255
  var authentication = function authentication() {
312
256
  return function (context, next) {
313
257
  var app = context.app,
314
- params = context.params,
315
- path = context.path,
316
- method = context.method,
317
- service = context.app.authentication;
318
-
258
+ params = context.params,
259
+ path = context.path,
260
+ method = context.method,
261
+ service = context.app.authentication;
319
262
  if ((0, commons_1.stripSlashes)(service.options.path) === path && method === 'create') {
320
263
  return next();
321
264
  }
322
-
323
265
  return Promise.resolve(app.get('authentication')).then(function (authResult) {
324
266
  if (authResult) {
325
267
  context.params = Object.assign({}, authResult, params);
@@ -327,7 +269,6 @@ var authentication = function authentication() {
327
269
  }).then(next);
328
270
  };
329
271
  };
330
-
331
272
  exports.authentication = authentication;
332
273
 
333
274
  /***/ }),
@@ -345,18 +286,14 @@ Object.defineProperty(exports, "__esModule", ({
345
286
  value: true
346
287
  }));
347
288
  exports.populateHeader = exports.authentication = void 0;
348
-
349
289
  var authentication_1 = __webpack_require__(/*! ./authentication */ "../authentication-client/lib/hooks/authentication.js");
350
-
351
290
  Object.defineProperty(exports, "authentication", ({
352
291
  enumerable: true,
353
292
  get: function get() {
354
293
  return authentication_1.authentication;
355
294
  }
356
295
  }));
357
-
358
296
  var populate_header_1 = __webpack_require__(/*! ./populate-header */ "../authentication-client/lib/hooks/populate-header.js");
359
-
360
297
  Object.defineProperty(exports, "populateHeader", ({
361
298
  enumerable: true,
362
299
  get: function get() {
@@ -376,30 +313,26 @@ Object.defineProperty(exports, "populateHeader", ({
376
313
 
377
314
 
378
315
  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; }
379
-
380
316
  Object.defineProperty(exports, "__esModule", ({
381
317
  value: true
382
318
  }));
383
319
  exports.populateHeader = void 0;
384
-
385
320
  var populateHeader = function populateHeader() {
386
321
  return function (context, next) {
387
322
  var app = context.app,
388
- accessToken = context.params.accessToken;
389
- var authentication = app.authentication; // Set REST header if necessary
390
-
323
+ accessToken = context.params.accessToken;
324
+ var authentication = app.authentication;
325
+ // Set REST header if necessary
391
326
  if (app.rest && accessToken) {
392
327
  var _authentication$optio = authentication.options,
393
- scheme = _authentication$optio.scheme,
394
- header = _authentication$optio.header;
328
+ scheme = _authentication$optio.scheme,
329
+ header = _authentication$optio.header;
395
330
  var authHeader = "".concat(scheme, " ").concat(accessToken);
396
331
  context.params.headers = Object.assign({}, _defineProperty({}, header, authHeader), context.params.headers);
397
332
  }
398
-
399
333
  return next();
400
334
  };
401
335
  };
402
-
403
336
  exports.populateHeader = populateHeader;
404
337
 
405
338
  /***/ }),
@@ -416,7 +349,6 @@ exports.populateHeader = populateHeader;
416
349
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
417
350
  if (k2 === undefined) k2 = k;
418
351
  var desc = Object.getOwnPropertyDescriptor(m, k);
419
-
420
352
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
421
353
  desc = {
422
354
  enumerable: true,
@@ -425,13 +357,11 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
425
357
  }
426
358
  };
427
359
  }
428
-
429
360
  Object.defineProperty(o, k2, desc);
430
361
  } : function (o, m, k, k2) {
431
362
  if (k2 === undefined) k2 = k;
432
363
  o[k2] = m[k];
433
364
  });
434
-
435
365
  var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
436
366
  Object.defineProperty(o, "default", {
437
367
  enumerable: true,
@@ -440,54 +370,41 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun
440
370
  } : function (o, v) {
441
371
  o["default"] = v;
442
372
  });
443
-
444
373
  var __importStar = this && this.__importStar || function (mod) {
445
374
  if (mod && mod.__esModule) return mod;
446
375
  var result = {};
447
376
  if (mod != null) for (var k in mod) {
448
377
  if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
449
378
  }
450
-
451
379
  __setModuleDefault(result, mod);
452
-
453
380
  return result;
454
381
  };
455
-
456
382
  Object.defineProperty(exports, "__esModule", ({
457
383
  value: true
458
384
  }));
459
385
  exports.defaults = exports.defaultStorage = exports.hooks = exports.MemoryStorage = exports.AuthenticationClient = exports.getDefaultStorage = void 0;
460
-
461
386
  var core_1 = __webpack_require__(/*! ./core */ "../authentication-client/lib/core.js");
462
-
463
387
  Object.defineProperty(exports, "AuthenticationClient", ({
464
388
  enumerable: true,
465
389
  get: function get() {
466
390
  return core_1.AuthenticationClient;
467
391
  }
468
392
  }));
469
-
470
393
  var hooks = __importStar(__webpack_require__(/*! ./hooks */ "../authentication-client/lib/hooks/index.js"));
471
-
472
394
  exports.hooks = hooks;
473
-
474
395
  var storage_1 = __webpack_require__(/*! ./storage */ "../authentication-client/lib/storage.js");
475
-
476
396
  Object.defineProperty(exports, "MemoryStorage", ({
477
397
  enumerable: true,
478
398
  get: function get() {
479
399
  return storage_1.MemoryStorage;
480
400
  }
481
401
  }));
482
-
483
402
  var getDefaultStorage = function getDefaultStorage() {
484
403
  try {
485
404
  return new storage_1.StorageWrapper(window.localStorage);
486
405
  } catch (error) {}
487
-
488
406
  return new storage_1.MemoryStorage();
489
407
  };
490
-
491
408
  exports.getDefaultStorage = getDefaultStorage;
492
409
  exports.defaultStorage = (0, exports.getDefaultStorage)();
493
410
  exports.defaults = {
@@ -501,10 +418,8 @@ exports.defaults = {
501
418
  Authentication: core_1.AuthenticationClient,
502
419
  storage: exports.defaultStorage
503
420
  };
504
-
505
421
  var init = function init() {
506
422
  var _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
507
-
508
423
  var options = Object.assign({}, exports.defaults, _options);
509
424
  var Authentication = options.Authentication;
510
425
  return function (app) {
@@ -516,9 +431,7 @@ var init = function init() {
516
431
  app.hooks([hooks.authentication(), hooks.populateHeader()]);
517
432
  };
518
433
  };
519
-
520
434
  exports["default"] = init;
521
-
522
435
  if (true) {
523
436
  module.exports = Object.assign(init, module.exports);
524
437
  }
@@ -535,23 +448,17 @@ if (true) {
535
448
 
536
449
 
537
450
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
538
-
539
451
  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); } }
540
-
541
452
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
542
-
543
453
  Object.defineProperty(exports, "__esModule", ({
544
454
  value: true
545
455
  }));
546
456
  exports.StorageWrapper = exports.MemoryStorage = void 0;
547
-
548
457
  var MemoryStorage = /*#__PURE__*/function () {
549
458
  function MemoryStorage() {
550
459
  _classCallCheck(this, MemoryStorage);
551
-
552
460
  this.store = {};
553
461
  }
554
-
555
462
  _createClass(MemoryStorage, [{
556
463
  key: "getItem",
557
464
  value: function getItem(key) {
@@ -570,19 +477,14 @@ var MemoryStorage = /*#__PURE__*/function () {
570
477
  return Promise.resolve(value);
571
478
  }
572
479
  }]);
573
-
574
480
  return MemoryStorage;
575
481
  }();
576
-
577
482
  exports.MemoryStorage = MemoryStorage;
578
-
579
483
  var StorageWrapper = /*#__PURE__*/function () {
580
484
  function StorageWrapper(storage) {
581
485
  _classCallCheck(this, StorageWrapper);
582
-
583
486
  this.storage = storage;
584
487
  }
585
-
586
488
  _createClass(StorageWrapper, [{
587
489
  key: "getItem",
588
490
  value: function getItem(key) {
@@ -599,10 +501,8 @@ var StorageWrapper = /*#__PURE__*/function () {
599
501
  return Promise.resolve(this.storage.removeItem(key));
600
502
  }
601
503
  }]);
602
-
603
504
  return StorageWrapper;
604
505
  }();
605
-
606
506
  exports.StorageWrapper = StorageWrapper;
607
507
 
608
508
  /***/ }),
@@ -621,33 +521,26 @@ Object.defineProperty(exports, "__esModule", ({
621
521
  }));
622
522
  exports.createDebug = exports.setDebug = exports.noopDebug = void 0;
623
523
  var debuggers = {};
624
-
625
524
  function noopDebug() {
626
525
  return function () {};
627
526
  }
628
-
629
527
  exports.noopDebug = noopDebug;
630
528
  var defaultInitializer = noopDebug;
631
-
632
529
  function setDebug(debug) {
633
530
  defaultInitializer = debug;
634
531
  Object.keys(debuggers).forEach(function (name) {
635
532
  debuggers[name] = debug(name);
636
533
  });
637
534
  }
638
-
639
535
  exports.setDebug = setDebug;
640
-
641
536
  function createDebug(name) {
642
537
  if (!debuggers[name]) {
643
538
  debuggers[name] = defaultInitializer(name);
644
539
  }
645
-
646
540
  return function () {
647
541
  return debuggers[name].apply(debuggers, arguments);
648
542
  };
649
543
  }
650
-
651
544
  exports.createDebug = createDebug;
652
545
 
653
546
  /***/ }),
@@ -662,25 +555,16 @@ exports.createDebug = createDebug;
662
555
 
663
556
 
664
557
  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; }
665
-
666
558
  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); }
667
-
668
559
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
669
-
670
560
  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."); }
671
-
672
561
  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); }
673
-
674
562
  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; }
675
-
676
563
  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; }
677
-
678
564
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
679
-
680
565
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
681
566
  if (k2 === undefined) k2 = k;
682
567
  var desc = Object.getOwnPropertyDescriptor(m, k);
683
-
684
568
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
685
569
  desc = {
686
570
  enumerable: true,
@@ -689,30 +573,26 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
689
573
  }
690
574
  };
691
575
  }
692
-
693
576
  Object.defineProperty(o, k2, desc);
694
577
  } : function (o, m, k, k2) {
695
578
  if (k2 === undefined) k2 = k;
696
579
  o[k2] = m[k];
697
580
  });
698
-
699
581
  var __exportStar = this && this.__exportStar || function (m, exports) {
700
582
  for (var p in m) {
701
583
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
702
584
  }
703
585
  };
704
-
705
586
  Object.defineProperty(exports, "__esModule", ({
706
587
  value: true
707
588
  }));
708
- exports.createSymbol = exports.isPromise = exports._ = exports.stripSlashes = void 0; // Removes all leading and trailing slashes from a path
709
-
589
+ exports.createSymbol = exports.isPromise = exports._ = exports.stripSlashes = void 0;
590
+ // Removes all leading and trailing slashes from a path
710
591
  function stripSlashes(name) {
711
592
  return name.replace(/^(\/+)|(\/+)$/g, '');
712
593
  }
713
-
714
- exports.stripSlashes = stripSlashes; // A set of lodash-y utility functions that use ES6
715
-
594
+ exports.stripSlashes = stripSlashes;
595
+ // A set of lodash-y utility functions that use ES6
716
596
  exports._ = {
717
597
  each: function each(obj, callback) {
718
598
  if (obj && typeof obj.forEach === 'function') {
@@ -728,9 +608,8 @@ exports._ = {
728
608
  return [value[key], key];
729
609
  }).some(function (_ref) {
730
610
  var _ref2 = _slicedToArray(_ref, 2),
731
- val = _ref2[0],
732
- key = _ref2[1];
733
-
611
+ val = _ref2[0],
612
+ key = _ref2[1];
734
613
  return callback(val, key);
735
614
  });
736
615
  },
@@ -739,9 +618,8 @@ exports._ = {
739
618
  return [value[key], key];
740
619
  }).every(function (_ref3) {
741
620
  var _ref4 = _slicedToArray(_ref3, 2),
742
- val = _ref4[0],
743
- key = _ref4[1];
744
-
621
+ val = _ref4[0],
622
+ key = _ref4[1];
745
623
  return callback(val, key);
746
624
  });
747
625
  },
@@ -771,16 +649,13 @@ exports._ = {
771
649
  for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
772
650
  rest[_key - 1] = arguments[_key];
773
651
  }
774
-
775
652
  return Object.assign.apply(Object, [first].concat(rest));
776
653
  },
777
654
  omit: function omit(obj) {
778
655
  var result = exports._.extend({}, obj);
779
-
780
656
  for (var _len2 = arguments.length, keys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
781
657
  keys[_key2 - 1] = arguments[_key2];
782
658
  }
783
-
784
659
  keys.forEach(function (key) {
785
660
  return delete result[key];
786
661
  });
@@ -790,12 +665,10 @@ exports._ = {
790
665
  for (var _len3 = arguments.length, keys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
791
666
  keys[_key3 - 1] = arguments[_key3];
792
667
  }
793
-
794
668
  return keys.reduce(function (result, key) {
795
669
  if (source[key] !== undefined) {
796
670
  result[key] = source[key];
797
671
  }
798
-
799
672
  return result;
800
673
  }, {});
801
674
  },
@@ -807,30 +680,24 @@ exports._ = {
807
680
  if (!target[key]) {
808
681
  Object.assign(target, _defineProperty({}, key, {}));
809
682
  }
810
-
811
683
  exports._.merge(target[key], source[key]);
812
684
  } else {
813
685
  Object.assign(target, _defineProperty({}, key, source[key]));
814
686
  }
815
687
  });
816
688
  }
817
-
818
689
  return target;
819
690
  }
820
- }; // Duck-checks if an object looks like a promise
821
-
691
+ };
692
+ // Duck-checks if an object looks like a promise
822
693
  function isPromise(result) {
823
694
  return exports._.isObject(result) && typeof result.then === 'function';
824
695
  }
825
-
826
696
  exports.isPromise = isPromise;
827
-
828
697
  function createSymbol(name) {
829
698
  return typeof Symbol !== 'undefined' ? Symbol(name) : name;
830
699
  }
831
-
832
700
  exports.createSymbol = createSymbol;
833
-
834
701
  __exportStar(__webpack_require__(/*! ./debug */ "../commons/lib/debug.js"), exports);
835
702
 
836
703
  /***/ }),
@@ -845,54 +712,32 @@ __exportStar(__webpack_require__(/*! ./debug */ "../commons/lib/debug.js"), expo
845
712
 
846
713
 
847
714
  var _excluded = ["message", "errors"];
848
-
849
715
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
850
-
851
716
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
852
-
853
717
  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); }
854
-
855
718
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
856
-
857
719
  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); } }
858
-
859
720
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
860
-
861
721
  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); }
862
-
863
722
  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); }; }
864
-
865
723
  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); }
866
-
867
724
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
868
-
869
725
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
870
-
871
726
  function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
872
-
873
727
  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; } }
874
-
875
728
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
876
-
877
729
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
878
-
879
730
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
880
-
881
731
  Object.defineProperty(exports, "__esModule", ({
882
732
  value: true
883
733
  }));
884
734
  exports.convert = exports.errors = exports.Unavailable = exports.BadGateway = exports.NotImplemented = exports.GeneralError = exports.TooManyRequests = exports.Unprocessable = exports.LengthRequired = exports.Gone = exports.Conflict = exports.Timeout = exports.NotAcceptable = exports.MethodNotAllowed = exports.NotFound = exports.Forbidden = exports.PaymentError = exports.NotAuthenticated = exports.BadRequest = exports.FeathersError = void 0;
885
-
886
735
  var FeathersError = /*#__PURE__*/function (_Error) {
887
736
  _inherits(FeathersError, _Error);
888
-
889
737
  var _super = _createSuper(FeathersError);
890
-
891
738
  function FeathersError(err, name, code, className, _data) {
892
739
  var _this;
893
-
894
740
  _classCallCheck(this, FeathersError);
895
-
896
741
  var msg = typeof err === 'string' ? err : 'Error';
897
742
  var properties = {
898
743
  name: name,
@@ -900,25 +745,21 @@ var FeathersError = /*#__PURE__*/function (_Error) {
900
745
  className: className,
901
746
  type: 'FeathersError'
902
747
  };
903
-
904
748
  if (Array.isArray(_data)) {
905
749
  properties.data = _data;
906
750
  } else if (_typeof(err) === 'object' || _data !== undefined) {
907
- var _ref = _typeof(err) === 'object' ? err : _data,
908
- message = _ref.message,
909
- errors = _ref.errors,
910
- rest = _objectWithoutProperties(_ref, _excluded);
911
-
751
+ var _ref = err !== null && _typeof(err) === 'object' ? err : _data,
752
+ message = _ref.message,
753
+ errors = _ref.errors,
754
+ rest = _objectWithoutProperties(_ref, _excluded);
912
755
  msg = message || msg;
913
756
  properties.errors = errors;
914
757
  properties.data = rest;
915
758
  }
916
-
917
759
  _this = _super.call(this, msg);
918
760
  Object.assign(_assertThisInitialized(_this), properties);
919
761
  return _this;
920
762
  }
921
-
922
763
  _createClass(FeathersError, [{
923
764
  key: "toJSON",
924
765
  value: function toJSON() {
@@ -928,294 +769,203 @@ var FeathersError = /*#__PURE__*/function (_Error) {
928
769
  code: this.code,
929
770
  className: this.className
930
771
  };
931
-
932
772
  if (this.data !== undefined) {
933
773
  result.data = this.data;
934
774
  }
935
-
936
775
  if (this.errors !== undefined) {
937
776
  result.errors = this.errors;
938
777
  }
939
-
940
778
  return result;
941
779
  }
942
780
  }]);
943
-
944
781
  return FeathersError;
945
782
  }( /*#__PURE__*/_wrapNativeSuper(Error));
946
-
947
783
  exports.FeathersError = FeathersError;
948
-
949
784
  var BadRequest = /*#__PURE__*/function (_FeathersError) {
950
785
  _inherits(BadRequest, _FeathersError);
951
-
952
786
  var _super2 = _createSuper(BadRequest);
953
-
954
787
  function BadRequest(message, data) {
955
788
  _classCallCheck(this, BadRequest);
956
-
957
789
  return _super2.call(this, message, 'BadRequest', 400, 'bad-request', data);
958
790
  }
959
-
960
791
  return _createClass(BadRequest);
961
792
  }(FeathersError);
962
-
963
- exports.BadRequest = BadRequest; // 401 - Not Authenticated
964
-
793
+ exports.BadRequest = BadRequest;
794
+ // 401 - Not Authenticated
965
795
  var NotAuthenticated = /*#__PURE__*/function (_FeathersError2) {
966
796
  _inherits(NotAuthenticated, _FeathersError2);
967
-
968
797
  var _super3 = _createSuper(NotAuthenticated);
969
-
970
798
  function NotAuthenticated(message, data) {
971
799
  _classCallCheck(this, NotAuthenticated);
972
-
973
800
  return _super3.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);
974
801
  }
975
-
976
802
  return _createClass(NotAuthenticated);
977
803
  }(FeathersError);
978
-
979
- exports.NotAuthenticated = NotAuthenticated; // 402 - Payment Error
980
-
804
+ exports.NotAuthenticated = NotAuthenticated;
805
+ // 402 - Payment Error
981
806
  var PaymentError = /*#__PURE__*/function (_FeathersError3) {
982
807
  _inherits(PaymentError, _FeathersError3);
983
-
984
808
  var _super4 = _createSuper(PaymentError);
985
-
986
809
  function PaymentError(message, data) {
987
810
  _classCallCheck(this, PaymentError);
988
-
989
811
  return _super4.call(this, message, 'PaymentError', 402, 'payment-error', data);
990
812
  }
991
-
992
813
  return _createClass(PaymentError);
993
814
  }(FeathersError);
994
-
995
- exports.PaymentError = PaymentError; // 403 - Forbidden
996
-
815
+ exports.PaymentError = PaymentError;
816
+ // 403 - Forbidden
997
817
  var Forbidden = /*#__PURE__*/function (_FeathersError4) {
998
818
  _inherits(Forbidden, _FeathersError4);
999
-
1000
819
  var _super5 = _createSuper(Forbidden);
1001
-
1002
820
  function Forbidden(message, data) {
1003
821
  _classCallCheck(this, Forbidden);
1004
-
1005
822
  return _super5.call(this, message, 'Forbidden', 403, 'forbidden', data);
1006
823
  }
1007
-
1008
824
  return _createClass(Forbidden);
1009
825
  }(FeathersError);
1010
-
1011
- exports.Forbidden = Forbidden; // 404 - Not Found
1012
-
826
+ exports.Forbidden = Forbidden;
827
+ // 404 - Not Found
1013
828
  var NotFound = /*#__PURE__*/function (_FeathersError5) {
1014
829
  _inherits(NotFound, _FeathersError5);
1015
-
1016
830
  var _super6 = _createSuper(NotFound);
1017
-
1018
831
  function NotFound(message, data) {
1019
832
  _classCallCheck(this, NotFound);
1020
-
1021
833
  return _super6.call(this, message, 'NotFound', 404, 'not-found', data);
1022
834
  }
1023
-
1024
835
  return _createClass(NotFound);
1025
836
  }(FeathersError);
1026
-
1027
- exports.NotFound = NotFound; // 405 - Method Not Allowed
1028
-
837
+ exports.NotFound = NotFound;
838
+ // 405 - Method Not Allowed
1029
839
  var MethodNotAllowed = /*#__PURE__*/function (_FeathersError6) {
1030
840
  _inherits(MethodNotAllowed, _FeathersError6);
1031
-
1032
841
  var _super7 = _createSuper(MethodNotAllowed);
1033
-
1034
842
  function MethodNotAllowed(message, data) {
1035
843
  _classCallCheck(this, MethodNotAllowed);
1036
-
1037
844
  return _super7.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);
1038
845
  }
1039
-
1040
846
  return _createClass(MethodNotAllowed);
1041
847
  }(FeathersError);
1042
-
1043
- exports.MethodNotAllowed = MethodNotAllowed; // 406 - Not Acceptable
1044
-
848
+ exports.MethodNotAllowed = MethodNotAllowed;
849
+ // 406 - Not Acceptable
1045
850
  var NotAcceptable = /*#__PURE__*/function (_FeathersError7) {
1046
851
  _inherits(NotAcceptable, _FeathersError7);
1047
-
1048
852
  var _super8 = _createSuper(NotAcceptable);
1049
-
1050
853
  function NotAcceptable(message, data) {
1051
854
  _classCallCheck(this, NotAcceptable);
1052
-
1053
855
  return _super8.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);
1054
856
  }
1055
-
1056
857
  return _createClass(NotAcceptable);
1057
858
  }(FeathersError);
1058
-
1059
- exports.NotAcceptable = NotAcceptable; // 408 - Timeout
1060
-
859
+ exports.NotAcceptable = NotAcceptable;
860
+ // 408 - Timeout
1061
861
  var Timeout = /*#__PURE__*/function (_FeathersError8) {
1062
862
  _inherits(Timeout, _FeathersError8);
1063
-
1064
863
  var _super9 = _createSuper(Timeout);
1065
-
1066
864
  function Timeout(message, data) {
1067
865
  _classCallCheck(this, Timeout);
1068
-
1069
866
  return _super9.call(this, message, 'Timeout', 408, 'timeout', data);
1070
867
  }
1071
-
1072
868
  return _createClass(Timeout);
1073
869
  }(FeathersError);
1074
-
1075
- exports.Timeout = Timeout; // 409 - Conflict
1076
-
870
+ exports.Timeout = Timeout;
871
+ // 409 - Conflict
1077
872
  var Conflict = /*#__PURE__*/function (_FeathersError9) {
1078
873
  _inherits(Conflict, _FeathersError9);
1079
-
1080
874
  var _super10 = _createSuper(Conflict);
1081
-
1082
875
  function Conflict(message, data) {
1083
876
  _classCallCheck(this, Conflict);
1084
-
1085
877
  return _super10.call(this, message, 'Conflict', 409, 'conflict', data);
1086
878
  }
1087
-
1088
879
  return _createClass(Conflict);
1089
880
  }(FeathersError);
1090
-
1091
- exports.Conflict = Conflict; // 410 - Gone
1092
-
881
+ exports.Conflict = Conflict;
882
+ // 410 - Gone
1093
883
  var Gone = /*#__PURE__*/function (_FeathersError10) {
1094
884
  _inherits(Gone, _FeathersError10);
1095
-
1096
885
  var _super11 = _createSuper(Gone);
1097
-
1098
886
  function Gone(message, data) {
1099
887
  _classCallCheck(this, Gone);
1100
-
1101
888
  return _super11.call(this, message, 'Gone', 410, 'gone', data);
1102
889
  }
1103
-
1104
890
  return _createClass(Gone);
1105
891
  }(FeathersError);
1106
-
1107
- exports.Gone = Gone; // 411 - Length Required
1108
-
892
+ exports.Gone = Gone;
893
+ // 411 - Length Required
1109
894
  var LengthRequired = /*#__PURE__*/function (_FeathersError11) {
1110
895
  _inherits(LengthRequired, _FeathersError11);
1111
-
1112
896
  var _super12 = _createSuper(LengthRequired);
1113
-
1114
897
  function LengthRequired(message, data) {
1115
898
  _classCallCheck(this, LengthRequired);
1116
-
1117
899
  return _super12.call(this, message, 'LengthRequired', 411, 'length-required', data);
1118
900
  }
1119
-
1120
901
  return _createClass(LengthRequired);
1121
902
  }(FeathersError);
1122
-
1123
- exports.LengthRequired = LengthRequired; // 422 Unprocessable
1124
-
903
+ exports.LengthRequired = LengthRequired;
904
+ // 422 Unprocessable
1125
905
  var Unprocessable = /*#__PURE__*/function (_FeathersError12) {
1126
906
  _inherits(Unprocessable, _FeathersError12);
1127
-
1128
907
  var _super13 = _createSuper(Unprocessable);
1129
-
1130
908
  function Unprocessable(message, data) {
1131
909
  _classCallCheck(this, Unprocessable);
1132
-
1133
910
  return _super13.call(this, message, 'Unprocessable', 422, 'unprocessable', data);
1134
911
  }
1135
-
1136
912
  return _createClass(Unprocessable);
1137
913
  }(FeathersError);
1138
-
1139
- exports.Unprocessable = Unprocessable; // 429 Too Many Requests
1140
-
914
+ exports.Unprocessable = Unprocessable;
915
+ // 429 Too Many Requests
1141
916
  var TooManyRequests = /*#__PURE__*/function (_FeathersError13) {
1142
917
  _inherits(TooManyRequests, _FeathersError13);
1143
-
1144
918
  var _super14 = _createSuper(TooManyRequests);
1145
-
1146
919
  function TooManyRequests(message, data) {
1147
920
  _classCallCheck(this, TooManyRequests);
1148
-
1149
921
  return _super14.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);
1150
922
  }
1151
-
1152
923
  return _createClass(TooManyRequests);
1153
924
  }(FeathersError);
1154
-
1155
- exports.TooManyRequests = TooManyRequests; // 500 - General Error
1156
-
925
+ exports.TooManyRequests = TooManyRequests;
926
+ // 500 - General Error
1157
927
  var GeneralError = /*#__PURE__*/function (_FeathersError14) {
1158
928
  _inherits(GeneralError, _FeathersError14);
1159
-
1160
929
  var _super15 = _createSuper(GeneralError);
1161
-
1162
930
  function GeneralError(message, data) {
1163
931
  _classCallCheck(this, GeneralError);
1164
-
1165
932
  return _super15.call(this, message, 'GeneralError', 500, 'general-error', data);
1166
933
  }
1167
-
1168
934
  return _createClass(GeneralError);
1169
935
  }(FeathersError);
1170
-
1171
- exports.GeneralError = GeneralError; // 501 - Not Implemented
1172
-
936
+ exports.GeneralError = GeneralError;
937
+ // 501 - Not Implemented
1173
938
  var NotImplemented = /*#__PURE__*/function (_FeathersError15) {
1174
939
  _inherits(NotImplemented, _FeathersError15);
1175
-
1176
940
  var _super16 = _createSuper(NotImplemented);
1177
-
1178
941
  function NotImplemented(message, data) {
1179
942
  _classCallCheck(this, NotImplemented);
1180
-
1181
943
  return _super16.call(this, message, 'NotImplemented', 501, 'not-implemented', data);
1182
944
  }
1183
-
1184
945
  return _createClass(NotImplemented);
1185
946
  }(FeathersError);
1186
-
1187
- exports.NotImplemented = NotImplemented; // 502 - Bad Gateway
1188
-
947
+ exports.NotImplemented = NotImplemented;
948
+ // 502 - Bad Gateway
1189
949
  var BadGateway = /*#__PURE__*/function (_FeathersError16) {
1190
950
  _inherits(BadGateway, _FeathersError16);
1191
-
1192
951
  var _super17 = _createSuper(BadGateway);
1193
-
1194
952
  function BadGateway(message, data) {
1195
953
  _classCallCheck(this, BadGateway);
1196
-
1197
954
  return _super17.call(this, message, 'BadGateway', 502, 'bad-gateway', data);
1198
955
  }
1199
-
1200
956
  return _createClass(BadGateway);
1201
957
  }(FeathersError);
1202
-
1203
- exports.BadGateway = BadGateway; // 503 - Unavailable
1204
-
958
+ exports.BadGateway = BadGateway;
959
+ // 503 - Unavailable
1205
960
  var Unavailable = /*#__PURE__*/function (_FeathersError17) {
1206
961
  _inherits(Unavailable, _FeathersError17);
1207
-
1208
962
  var _super18 = _createSuper(Unavailable);
1209
-
1210
963
  function Unavailable(message, data) {
1211
964
  _classCallCheck(this, Unavailable);
1212
-
1213
965
  return _super18.call(this, message, 'Unavailable', 503, 'unavailable', data);
1214
966
  }
1215
-
1216
967
  return _createClass(Unavailable);
1217
968
  }(FeathersError);
1218
-
1219
969
  exports.Unavailable = Unavailable;
1220
970
  exports.errors = {
1221
971
  FeathersError: FeathersError,
@@ -1253,22 +1003,17 @@ exports.errors = {
1253
1003
  502: BadGateway,
1254
1004
  503: Unavailable
1255
1005
  };
1256
-
1257
1006
  function convert(error) {
1258
1007
  if (!error) {
1259
1008
  return error;
1260
1009
  }
1261
-
1262
1010
  var FeathersError = exports.errors[error.name];
1263
1011
  var result = FeathersError ? new FeathersError(error.message, error.data) : new Error(error.message || error);
1264
-
1265
1012
  if (_typeof(error) === 'object') {
1266
1013
  Object.assign(result, error);
1267
1014
  }
1268
-
1269
1015
  return result;
1270
1016
  }
1271
-
1272
1017
  exports.convert = convert;
1273
1018
 
1274
1019
  /***/ }),
@@ -1283,78 +1028,46 @@ exports.convert = convert;
1283
1028
 
1284
1029
 
1285
1030
  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); }
1286
-
1287
1031
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
1288
-
1289
1032
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
1290
-
1291
1033
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
1292
-
1293
1034
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
1294
-
1295
1035
  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); }
1296
-
1297
1036
  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; }
1298
-
1299
1037
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1300
-
1301
1038
  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); } }
1302
-
1303
1039
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1304
-
1305
1040
  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); }
1306
-
1307
1041
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1308
-
1309
1042
  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); }; }
1310
-
1311
1043
  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); }
1312
-
1313
1044
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1314
-
1315
1045
  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; } }
1316
-
1317
1046
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1318
-
1319
1047
  var __importDefault = this && this.__importDefault || function (mod) {
1320
1048
  return mod && mod.__esModule ? mod : {
1321
1049
  "default": mod
1322
1050
  };
1323
1051
  };
1324
-
1325
1052
  Object.defineProperty(exports, "__esModule", ({
1326
1053
  value: true
1327
1054
  }));
1328
1055
  exports.Feathers = void 0;
1329
-
1330
1056
  var version_1 = __importDefault(__webpack_require__(/*! ./version */ "../feathers/lib/version.js"));
1331
-
1332
1057
  var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
1333
-
1334
1058
  var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
1335
-
1336
1059
  var hooks_1 = __webpack_require__(/*! @feathersjs/hooks */ "../../node_modules/@feathersjs/hooks/script/index.js");
1337
-
1338
1060
  var events_2 = __webpack_require__(/*! ./events */ "../feathers/lib/events.js");
1339
-
1340
1061
  var hooks_2 = __webpack_require__(/*! ./hooks */ "../feathers/lib/hooks.js");
1341
-
1342
1062
  var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
1343
-
1344
1063
  var hooks_3 = __webpack_require__(/*! ./hooks */ "../feathers/lib/hooks.js");
1345
-
1346
1064
  var debug = (0, commons_1.createDebug)('@feathersjs/feathers');
1347
-
1348
1065
  var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
1349
1066
  _inherits(Feathers, _events_1$EventEmitte);
1350
-
1351
1067
  var _super = _createSuper(Feathers);
1352
-
1353
1068
  function Feathers() {
1354
1069
  var _this;
1355
-
1356
1070
  _classCallCheck(this, Feathers);
1357
-
1358
1071
  _this = _super.call(this);
1359
1072
  _this.services = {};
1360
1073
  _this.settings = {};
@@ -1362,14 +1075,11 @@ var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
1362
1075
  _this.version = version_1.default;
1363
1076
  _this._isSetup = false;
1364
1077
  _this.registerHooks = (0, hooks_3.enableHooks)(_assertThisInitialized(_this));
1365
-
1366
1078
  _this.registerHooks({
1367
1079
  around: [events_2.eventHook]
1368
1080
  });
1369
-
1370
1081
  return _this;
1371
1082
  }
1372
-
1373
1083
  _createClass(Feathers, [{
1374
1084
  key: "get",
1375
1085
  value: function get(name) {
@@ -1397,24 +1107,20 @@ var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
1397
1107
  value: function service(location) {
1398
1108
  var path = (0, commons_1.stripSlashes)(location) || '/';
1399
1109
  var current = this.services[path];
1400
-
1401
1110
  if (typeof current === 'undefined') {
1402
1111
  this.use(path, this.defaultService(path));
1403
1112
  return this.service(path);
1404
1113
  }
1405
-
1406
1114
  return current;
1407
1115
  }
1408
1116
  }, {
1409
1117
  key: "_setup",
1410
1118
  value: function _setup() {
1411
1119
  var _this2 = this;
1412
-
1413
1120
  this._isSetup = true;
1414
1121
  return Object.keys(this.services).reduce(function (current, path) {
1415
1122
  return current.then(function () {
1416
1123
  var service = _this2.service(path);
1417
-
1418
1124
  if (typeof service.setup === 'function') {
1419
1125
  debug("Setting up service for `".concat(path, "`"));
1420
1126
  return service.setup(_this2, path);
@@ -1438,12 +1144,10 @@ var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
1438
1144
  key: "_teardown",
1439
1145
  value: function _teardown() {
1440
1146
  var _this3 = this;
1441
-
1442
1147
  this._isSetup = false;
1443
1148
  return Object.keys(this.services).reduce(function (current, path) {
1444
1149
  return current.then(function () {
1445
1150
  var service = _this3.service(path);
1446
-
1447
1151
  if (typeof service.teardown === 'function') {
1448
1152
  debug("Tearing down service for `".concat(path, "`"));
1449
1153
  return service.teardown(_this3, path);
@@ -1467,32 +1171,25 @@ var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
1467
1171
  key: "use",
1468
1172
  value: function use(path, service, options) {
1469
1173
  var _this4 = this;
1470
-
1471
1174
  if (typeof path !== 'string') {
1472
1175
  throw new Error("'".concat(path, "' is not a valid service path."));
1473
1176
  }
1474
-
1475
1177
  var location = (0, commons_1.stripSlashes)(path) || '/';
1476
1178
  var subApp = service;
1477
1179
  var isSubApp = typeof subApp.service === 'function' && subApp.services;
1478
-
1479
1180
  if (isSubApp) {
1480
1181
  Object.keys(subApp.services).forEach(function (subPath) {
1481
1182
  return _this4.use("".concat(location, "/").concat(subPath), subApp.service(subPath));
1482
1183
  });
1483
1184
  return this;
1484
1185
  }
1485
-
1486
1186
  var protoService = (0, service_1.wrapService)(location, service, options);
1487
1187
  var serviceOptions = (0, service_1.getServiceOptions)(protoService);
1488
-
1489
1188
  var _iterator = _createForOfIteratorHelper(service_1.protectedMethods),
1490
- _step;
1491
-
1189
+ _step;
1492
1190
  try {
1493
1191
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
1494
1192
  var name = _step.value;
1495
-
1496
1193
  if (serviceOptions.methods.includes(name)) {
1497
1194
  throw new Error("'".concat(name, "' on service '").concat(location, "' is not allowed as a custom method name"));
1498
1195
  }
@@ -1502,19 +1199,17 @@ var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
1502
1199
  } finally {
1503
1200
  _iterator.f();
1504
1201
  }
1505
-
1506
- debug("Registering new service at `".concat(location, "`")); // Add all the mixins
1507
-
1202
+ debug("Registering new service at `".concat(location, "`"));
1203
+ // Add all the mixins
1508
1204
  this.mixins.forEach(function (fn) {
1509
1205
  return fn.call(_this4, protoService, location, serviceOptions);
1510
1206
  });
1511
- this.services[location] = protoService; // If we ran setup already, set this service up explicitly, this will not `await`
1512
-
1207
+ this.services[location] = protoService;
1208
+ // If we ran setup already, set this service up explicitly, this will not `await`
1513
1209
  if (this._isSetup && typeof protoService.setup === 'function') {
1514
1210
  debug("Setting up service for `".concat(location, "`"));
1515
1211
  protoService.setup(this, location);
1516
1212
  }
1517
-
1518
1213
  return this;
1519
1214
  }
1520
1215
  }, {
@@ -1528,19 +1223,15 @@ var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
1528
1223
  case 0:
1529
1224
  path = (0, commons_1.stripSlashes)(location) || '/';
1530
1225
  service = this.services[path];
1531
-
1532
1226
  if (!(service && typeof service.teardown === 'function')) {
1533
1227
  _context.next = 5;
1534
1228
  break;
1535
1229
  }
1536
-
1537
1230
  _context.next = 5;
1538
1231
  return service.teardown(this, path);
1539
-
1540
1232
  case 5:
1541
1233
  delete this.services[path];
1542
1234
  return _context.abrupt("return", service);
1543
-
1544
1235
  case 7:
1545
1236
  case "end":
1546
1237
  return _context.stop();
@@ -1548,18 +1239,15 @@ var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
1548
1239
  }
1549
1240
  }, _callee, this);
1550
1241
  }));
1551
-
1552
1242
  function unuse(_x) {
1553
1243
  return _unuse.apply(this, arguments);
1554
1244
  }
1555
-
1556
1245
  return unuse;
1557
1246
  }()
1558
1247
  }, {
1559
1248
  key: "hooks",
1560
1249
  value: function hooks(hookMap) {
1561
1250
  var untypedMap = hookMap;
1562
-
1563
1251
  if (untypedMap.before || untypedMap.after || untypedMap.error || untypedMap.around) {
1564
1252
  // regular hooks for all service methods
1565
1253
  this.registerHooks(untypedMap);
@@ -1572,14 +1260,11 @@ var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
1572
1260
  around: untypedMap
1573
1261
  });
1574
1262
  }
1575
-
1576
1263
  return this;
1577
1264
  }
1578
1265
  }]);
1579
-
1580
1266
  return Feathers;
1581
1267
  }(events_1.EventEmitter);
1582
-
1583
1268
  exports.Feathers = Feathers;
1584
1269
 
1585
1270
  /***/ }),
@@ -1612,15 +1297,11 @@ Object.defineProperty(exports, "__esModule", ({
1612
1297
  value: true
1613
1298
  }));
1614
1299
  exports.eventMixin = exports.eventHook = void 0;
1615
-
1616
1300
  var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
1617
-
1618
1301
  var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
1619
-
1620
1302
  function eventHook(context, next) {
1621
1303
  var _ref = (0, service_1.getServiceOptions)(context.self),
1622
- events = _ref.events;
1623
-
1304
+ events = _ref.events;
1624
1305
  var defaultEvent = service_1.defaultEventMap[context.method] || null;
1625
1306
  context.event = defaultEvent;
1626
1307
  return next().then(function () {
@@ -1634,19 +1315,14 @@ function eventHook(context, next) {
1634
1315
  }
1635
1316
  });
1636
1317
  }
1637
-
1638
1318
  exports.eventHook = eventHook;
1639
-
1640
1319
  function eventMixin(service) {
1641
1320
  var isEmitter = typeof service.on === 'function' && typeof service.emit === 'function';
1642
-
1643
1321
  if (!isEmitter) {
1644
1322
  Object.assign(service, events_1.EventEmitter.prototype);
1645
1323
  }
1646
-
1647
1324
  return service;
1648
1325
  }
1649
-
1650
1326
  exports.eventMixin = eventMixin;
1651
1327
 
1652
1328
  /***/ }),
@@ -1661,63 +1337,38 @@ exports.eventMixin = eventMixin;
1661
1337
 
1662
1338
 
1663
1339
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1664
-
1665
1340
  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); } }
1666
-
1667
1341
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1668
-
1669
1342
  function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
1670
-
1671
1343
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
1672
-
1673
1344
  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); }
1674
-
1675
1345
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1676
-
1677
1346
  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); }; }
1678
-
1679
1347
  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); }
1680
-
1681
1348
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1682
-
1683
1349
  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; } }
1684
-
1685
1350
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1686
-
1687
1351
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1688
-
1689
1352
  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."); }
1690
-
1691
1353
  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); }
1692
-
1693
1354
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1694
-
1695
1355
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1696
-
1697
1356
  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; }
1698
-
1699
1357
  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); }
1700
-
1701
1358
  Object.defineProperty(exports, "__esModule", ({
1702
1359
  value: true
1703
1360
  }));
1704
1361
  exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.enableHooks = exports.collectHooks = exports.convertHookData = void 0;
1705
-
1706
1362
  var hooks_1 = __webpack_require__(/*! @feathersjs/hooks */ "../../node_modules/@feathersjs/hooks/script/index.js");
1707
-
1708
1363
  var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
1709
-
1710
1364
  var types = ['before', 'after', 'error', 'around'];
1711
-
1712
1365
  var isType = function isType(value) {
1713
1366
  return types.includes(value);
1714
- }; // Converts different hook registration formats into the
1367
+ };
1368
+ // Converts different hook registration formats into the
1715
1369
  // same internal format
1716
-
1717
-
1718
1370
  function convertHookData(input) {
1719
1371
  var result = {};
1720
-
1721
1372
  if (Array.isArray(input)) {
1722
1373
  result.all = input;
1723
1374
  } else if (_typeof(input) !== 'object') {
@@ -1729,21 +1380,17 @@ function convertHookData(input) {
1729
1380
  result[key] = Array.isArray(value) ? value : [value];
1730
1381
  }
1731
1382
  }
1732
-
1733
1383
  return result;
1734
1384
  }
1735
-
1736
1385
  exports.convertHookData = convertHookData;
1737
-
1738
1386
  function collectHooks(target, method) {
1739
1387
  var _target$__hooks = target.__hooks,
1740
- collected = _target$__hooks.collected,
1741
- around = _target$__hooks.around;
1388
+ collected = _target$__hooks.collected,
1389
+ around = _target$__hooks.around;
1742
1390
  return [].concat(_toConsumableArray(around.all || []), _toConsumableArray(around[method] || []), _toConsumableArray(collected.all || []), _toConsumableArray(collected[method] || []));
1743
1391
  }
1744
-
1745
- exports.collectHooks = collectHooks; // Add `.hooks` functionality to an object
1746
-
1392
+ exports.collectHooks = collectHooks;
1393
+ // Add `.hooks` functionality to an object
1747
1394
  function enableHooks(object) {
1748
1395
  var store = {
1749
1396
  around: {},
@@ -1763,7 +1410,6 @@ function enableHooks(object) {
1763
1410
  if (!isType(type)) {
1764
1411
  throw new Error("'".concat(type, "' is not a valid hook type"));
1765
1412
  }
1766
-
1767
1413
  map[type] = convertHookData(input[type]);
1768
1414
  return map;
1769
1415
  }, {});
@@ -1771,11 +1417,9 @@ function enableHooks(object) {
1771
1417
  types.forEach(function (type) {
1772
1418
  return Object.keys(map[type]).forEach(function (method) {
1773
1419
  var _a;
1774
-
1775
1420
  var mapHooks = map[type][method];
1776
1421
  var storeHooks = (_a = store[type])[method] || (_a[method] = []);
1777
1422
  storeHooks.push.apply(storeHooks, _toConsumableArray(mapHooks));
1778
-
1779
1423
  if (store.before[method] || store.after[method] || store.error[method]) {
1780
1424
  var collected = (0, hooks_1.collect)({
1781
1425
  before: store.before[method] || [],
@@ -1789,46 +1433,33 @@ function enableHooks(object) {
1789
1433
  return this;
1790
1434
  };
1791
1435
  }
1792
-
1793
1436
  exports.enableHooks = enableHooks;
1794
-
1795
1437
  function createContext(service, method) {
1796
1438
  var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1797
1439
  var createContext = service[method].createContext;
1798
-
1799
1440
  if (typeof createContext !== 'function') {
1800
1441
  throw new Error("Can not create context for method ".concat(method));
1801
1442
  }
1802
-
1803
1443
  return createContext(data);
1804
1444
  }
1805
-
1806
1445
  exports.createContext = createContext;
1807
-
1808
1446
  var FeathersHookManager = /*#__PURE__*/function (_hooks_1$HookManager) {
1809
1447
  _inherits(FeathersHookManager, _hooks_1$HookManager);
1810
-
1811
1448
  var _super = _createSuper(FeathersHookManager);
1812
-
1813
1449
  function FeathersHookManager(app, method) {
1814
1450
  var _this;
1815
-
1816
1451
  _classCallCheck(this, FeathersHookManager);
1817
-
1818
1452
  _this = _super.call(this);
1819
1453
  _this.app = app;
1820
1454
  _this.method = method;
1821
1455
  _this._middleware = [];
1822
1456
  return _this;
1823
1457
  }
1824
-
1825
1458
  _createClass(FeathersHookManager, [{
1826
1459
  key: "collectMiddleware",
1827
1460
  value: function collectMiddleware(self, args) {
1828
1461
  var appHooks = collectHooks(this.app, this.method);
1829
-
1830
1462
  var middleware = _get(_getPrototypeOf(FeathersHookManager.prototype), "collectMiddleware", this).call(this, self, args);
1831
-
1832
1463
  var methodHooks = collectHooks(self, this.method);
1833
1464
  return [].concat(_toConsumableArray(appHooks), _toConsumableArray(middleware), _toConsumableArray(methodHooks));
1834
1465
  }
@@ -1836,7 +1467,6 @@ var FeathersHookManager = /*#__PURE__*/function (_hooks_1$HookManager) {
1836
1467
  key: "initializeContext",
1837
1468
  value: function initializeContext(self, args, context) {
1838
1469
  var ctx = _get(_getPrototypeOf(FeathersHookManager.prototype), "initializeContext", this).call(this, self, args, context);
1839
-
1840
1470
  ctx.params = ctx.params || {};
1841
1471
  return ctx;
1842
1472
  }
@@ -1844,29 +1474,21 @@ var FeathersHookManager = /*#__PURE__*/function (_hooks_1$HookManager) {
1844
1474
  key: "middleware",
1845
1475
  value: function middleware(mw) {
1846
1476
  var _this$_middleware;
1847
-
1848
1477
  (_this$_middleware = this._middleware).push.apply(_this$_middleware, _toConsumableArray(mw));
1849
-
1850
1478
  return this;
1851
1479
  }
1852
1480
  }]);
1853
-
1854
1481
  return FeathersHookManager;
1855
1482
  }(hooks_1.HookManager);
1856
-
1857
1483
  exports.FeathersHookManager = FeathersHookManager;
1858
-
1859
1484
  function hookMixin(service, path, options) {
1860
1485
  var _this2 = this;
1861
-
1862
1486
  if (typeof service.hooks === 'function') {
1863
1487
  return service;
1864
1488
  }
1865
-
1866
1489
  var hookMethods = (0, service_1.getHookMethods)(service, options);
1867
1490
  var serviceMethodHooks = hookMethods.reduce(function (res, method) {
1868
1491
  var _FeathersHookManager;
1869
-
1870
1492
  var params = service_1.defaultServiceArguments[method] || ['data', 'params'];
1871
1493
  res[method] = (_FeathersHookManager = new FeathersHookManager(_this2, method)).params.apply(_FeathersHookManager, _toConsumableArray(params)).props({
1872
1494
  app: _this2,
@@ -1875,50 +1497,38 @@ function hookMixin(service, path, options) {
1875
1497
  service: service,
1876
1498
  event: null,
1877
1499
  type: null,
1878
-
1879
1500
  get statusCode() {
1880
1501
  var _a;
1881
-
1882
1502
  return (_a = this.http) === null || _a === void 0 ? void 0 : _a.status;
1883
1503
  },
1884
-
1885
1504
  set statusCode(value) {
1886
1505
  this.http = this.http || {};
1887
1506
  this.http.status = value;
1888
1507
  }
1889
-
1890
1508
  });
1891
1509
  return res;
1892
1510
  }, {});
1893
1511
  var registerHooks = enableHooks(service);
1894
1512
  (0, hooks_1.hooks)(service, serviceMethodHooks);
1895
-
1896
1513
  service.hooks = function (hookOptions) {
1897
1514
  var _this3 = this;
1898
-
1899
1515
  if (hookOptions.before || hookOptions.after || hookOptions.error || hookOptions.around) {
1900
1516
  return registerHooks.call(this, hookOptions);
1901
1517
  }
1902
-
1903
1518
  if (Array.isArray(hookOptions)) {
1904
1519
  return (0, hooks_1.hooks)(this, hookOptions);
1905
1520
  }
1906
-
1907
1521
  Object.keys(hookOptions).forEach(function (method) {
1908
1522
  var manager = (0, hooks_1.getManager)(_this3[method]);
1909
-
1910
1523
  if (!(manager instanceof FeathersHookManager)) {
1911
1524
  throw new Error("Method ".concat(method, " is not a Feathers hooks enabled service method"));
1912
1525
  }
1913
-
1914
1526
  manager.middleware(hookOptions[method]);
1915
1527
  });
1916
1528
  return this;
1917
1529
  };
1918
-
1919
1530
  return service;
1920
1531
  }
1921
-
1922
1532
  exports.hookMixin = hookMixin;
1923
1533
 
1924
1534
  /***/ }),
@@ -1935,7 +1545,6 @@ exports.hookMixin = hookMixin;
1935
1545
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1936
1546
  if (k2 === undefined) k2 = k;
1937
1547
  var desc = Object.getOwnPropertyDescriptor(m, k);
1938
-
1939
1548
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1940
1549
  desc = {
1941
1550
  enumerable: true,
@@ -1944,58 +1553,43 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
1944
1553
  }
1945
1554
  };
1946
1555
  }
1947
-
1948
1556
  Object.defineProperty(o, k2, desc);
1949
1557
  } : function (o, m, k, k2) {
1950
1558
  if (k2 === undefined) k2 = k;
1951
1559
  o[k2] = m[k];
1952
1560
  });
1953
-
1954
1561
  var __exportStar = this && this.__exportStar || function (m, exports) {
1955
1562
  for (var p in m) {
1956
1563
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1957
1564
  }
1958
1565
  };
1959
-
1960
1566
  var __importDefault = this && this.__importDefault || function (mod) {
1961
1567
  return mod && mod.__esModule ? mod : {
1962
1568
  "default": mod
1963
1569
  };
1964
1570
  };
1965
-
1966
1571
  Object.defineProperty(exports, "__esModule", ({
1967
1572
  value: true
1968
1573
  }));
1969
1574
  exports.Feathers = exports.version = exports.feathers = void 0;
1970
-
1971
1575
  var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
1972
-
1973
1576
  var version_1 = __importDefault(__webpack_require__(/*! ./version */ "../feathers/lib/version.js"));
1974
-
1975
1577
  exports.version = version_1.default;
1976
-
1977
1578
  var application_1 = __webpack_require__(/*! ./application */ "../feathers/lib/application.js");
1978
-
1979
1579
  Object.defineProperty(exports, "Feathers", ({
1980
1580
  enumerable: true,
1981
1581
  get: function get() {
1982
1582
  return application_1.Feathers;
1983
1583
  }
1984
1584
  }));
1985
-
1986
1585
  function feathers() {
1987
1586
  return new application_1.Feathers();
1988
1587
  }
1989
-
1990
1588
  exports.feathers = feathers;
1991
1589
  feathers.setDebug = commons_1.setDebug;
1992
-
1993
1590
  __exportStar(__webpack_require__(/*! ./hooks */ "../feathers/lib/hooks.js"), exports);
1994
-
1995
1591
  __exportStar(__webpack_require__(/*! ./declarations */ "../feathers/lib/declarations.js"), exports);
1996
-
1997
1592
  __exportStar(__webpack_require__(/*! ./service */ "../feathers/lib/service.js"), exports);
1998
-
1999
1593
  if (true) {
2000
1594
  module.exports = Object.assign(feathers, module.exports);
2001
1595
  }
@@ -2012,20 +1606,14 @@ if (true) {
2012
1606
 
2013
1607
 
2014
1608
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2015
-
2016
1609
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2017
-
2018
1610
  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; }
2019
-
2020
1611
  Object.defineProperty(exports, "__esModule", ({
2021
1612
  value: true
2022
1613
  }));
2023
1614
  exports.wrapService = exports.getServiceOptions = exports.getHookMethods = exports.protectedMethods = exports.defaultEventMap = exports.defaultServiceMethods = exports.defaultServiceArguments = exports.SERVICE = void 0;
2024
-
2025
1615
  var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
2026
-
2027
1616
  var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
2028
-
2029
1617
  exports.SERVICE = (0, commons_1.createSymbol)('@feathersjs/service');
2030
1618
  exports.defaultServiceArguments = {
2031
1619
  find: ['params'],
@@ -2035,7 +1623,7 @@ exports.defaultServiceArguments = {
2035
1623
  patch: ['id', 'data', 'params'],
2036
1624
  remove: ['id', 'params']
2037
1625
  };
2038
- exports.defaultServiceMethods = Object.keys(exports.defaultServiceArguments);
1626
+ exports.defaultServiceMethods = ['find', 'get', 'create', 'update', 'patch', 'remove'];
2039
1627
  exports.defaultEventMap = {
2040
1628
  create: 'created',
2041
1629
  update: 'updated',
@@ -2043,60 +1631,49 @@ exports.defaultEventMap = {
2043
1631
  remove: 'removed'
2044
1632
  };
2045
1633
  exports.protectedMethods = Object.keys(Object.prototype).concat(Object.keys(events_1.EventEmitter.prototype)).concat(['all', 'around', 'before', 'after', 'error', 'hooks', 'setup', 'teardown', 'publish']);
2046
-
2047
1634
  function getHookMethods(service, options) {
2048
1635
  var methods = options.methods;
2049
1636
  return exports.defaultServiceMethods.filter(function (m) {
2050
1637
  return typeof service[m] === 'function' && !methods.includes(m);
2051
1638
  }).concat(methods);
2052
1639
  }
2053
-
2054
1640
  exports.getHookMethods = getHookMethods;
2055
-
2056
1641
  function getServiceOptions(service) {
2057
1642
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2058
1643
  var existingOptions = service[exports.SERVICE];
2059
-
2060
1644
  if (existingOptions) {
2061
1645
  return existingOptions;
2062
1646
  }
2063
-
2064
1647
  var _options$methods = options.methods,
2065
- methods = _options$methods === void 0 ? exports.defaultServiceMethods.filter(function (method) {
2066
- return typeof service[method] === 'function';
2067
- }) : _options$methods,
2068
- _options$events = options.events,
2069
- events = _options$events === void 0 ? service.events || [] : _options$events;
1648
+ methods = _options$methods === void 0 ? exports.defaultServiceMethods.filter(function (method) {
1649
+ return typeof service[method] === 'function';
1650
+ }) : _options$methods,
1651
+ _options$events = options.events,
1652
+ events = _options$events === void 0 ? service.events || [] : _options$events;
2070
1653
  var _options$serviceEvent = options.serviceEvents,
2071
- serviceEvents = _options$serviceEvent === void 0 ? Object.values(exports.defaultEventMap).concat(events) : _options$serviceEvent;
1654
+ serviceEvents = _options$serviceEvent === void 0 ? Object.values(exports.defaultEventMap).concat(events) : _options$serviceEvent;
2072
1655
  return _objectSpread(_objectSpread({}, options), {}, {
2073
1656
  events: events,
2074
1657
  methods: methods,
2075
1658
  serviceEvents: serviceEvents
2076
1659
  });
2077
1660
  }
2078
-
2079
1661
  exports.getServiceOptions = getServiceOptions;
2080
-
2081
1662
  function wrapService(location, service, options) {
2082
1663
  // Do nothing if this is already an initialized
2083
1664
  if (service[exports.SERVICE]) {
2084
1665
  return service;
2085
1666
  }
2086
-
2087
1667
  var protoService = Object.create(service);
2088
1668
  var serviceOptions = getServiceOptions(service, options);
2089
-
2090
1669
  if (Object.keys(serviceOptions.methods).length === 0 && typeof service.setup !== 'function') {
2091
1670
  throw new Error("Invalid service object passed for path `".concat(location, "`"));
2092
1671
  }
2093
-
2094
1672
  Object.defineProperty(protoService, exports.SERVICE, {
2095
1673
  value: serviceOptions
2096
1674
  });
2097
1675
  return protoService;
2098
1676
  }
2099
-
2100
1677
  exports.wrapService = wrapService;
2101
1678
 
2102
1679
  /***/ }),
@@ -2127,45 +1704,28 @@ exports["default"] = 'development';
2127
1704
 
2128
1705
 
2129
1706
  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); }
2130
-
2131
1707
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2132
-
2133
1708
  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); } }
2134
-
2135
1709
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2136
-
2137
1710
  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); }
2138
-
2139
1711
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2140
-
2141
1712
  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); }; }
2142
-
2143
1713
  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); }
2144
-
2145
1714
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2146
-
2147
1715
  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; } }
2148
-
2149
1716
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2150
-
2151
1717
  Object.defineProperty(exports, "__esModule", ({
2152
1718
  value: true
2153
1719
  }));
2154
1720
  exports.AxiosClient = void 0;
2155
-
2156
1721
  var base_1 = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2157
-
2158
1722
  var AxiosClient = /*#__PURE__*/function (_base_1$Base) {
2159
1723
  _inherits(AxiosClient, _base_1$Base);
2160
-
2161
1724
  var _super = _createSuper(AxiosClient);
2162
-
2163
1725
  function AxiosClient() {
2164
1726
  _classCallCheck(this, AxiosClient);
2165
-
2166
1727
  return _super.apply(this, arguments);
2167
1728
  }
2168
-
2169
1729
  _createClass(AxiosClient, [{
2170
1730
  key: "request",
2171
1731
  value: function request(options, params) {
@@ -2185,10 +1745,8 @@ var AxiosClient = /*#__PURE__*/function (_base_1$Base) {
2185
1745
  });
2186
1746
  }
2187
1747
  }]);
2188
-
2189
1748
  return AxiosClient;
2190
1749
  }(base_1.Base);
2191
-
2192
1750
  exports.AxiosClient = AxiosClient;
2193
1751
 
2194
1752
  /***/ }),
@@ -2203,56 +1761,42 @@ exports.AxiosClient = AxiosClient;
2203
1761
 
2204
1762
 
2205
1763
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2206
-
2207
1764
  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); } }
2208
-
2209
1765
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2210
-
2211
1766
  var __importDefault = this && this.__importDefault || function (mod) {
2212
1767
  return mod && mod.__esModule ? mod : {
2213
1768
  "default": mod
2214
1769
  };
2215
1770
  };
2216
-
2217
1771
  Object.defineProperty(exports, "__esModule", ({
2218
1772
  value: true
2219
1773
  }));
2220
1774
  exports.Base = void 0;
2221
-
2222
1775
  var qs_1 = __importDefault(__webpack_require__(/*! qs */ "../../node_modules/qs/lib/index.js"));
2223
-
2224
1776
  var errors_1 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
2225
-
2226
1777
  var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
2227
-
2228
1778
  function toError(error) {
2229
1779
  if (error.code === 'ECONNREFUSED') {
2230
1780
  throw new errors_1.Unavailable(error.message, commons_1._.pick(error, 'address', 'port', 'config'));
2231
1781
  }
2232
-
2233
1782
  throw (0, errors_1.convert)(error);
2234
1783
  }
2235
-
2236
1784
  var Base = /*#__PURE__*/function () {
2237
1785
  function Base(settings) {
2238
1786
  _classCallCheck(this, Base);
2239
-
2240
1787
  this.name = (0, commons_1.stripSlashes)(settings.name);
2241
1788
  this.options = settings.options;
2242
1789
  this.connection = settings.connection;
2243
1790
  this.base = "".concat(settings.base, "/").concat(this.name);
2244
1791
  }
2245
-
2246
1792
  _createClass(Base, [{
2247
1793
  key: "makeUrl",
2248
1794
  value: function makeUrl(query, id) {
2249
1795
  var url = this.base;
2250
1796
  query = query || {};
2251
-
2252
1797
  if (typeof id !== 'undefined' && id !== null) {
2253
1798
  url += "/".concat(encodeURIComponent(id));
2254
1799
  }
2255
-
2256
1800
  return url + this.getQuery(query);
2257
1801
  }
2258
1802
  }, {
@@ -2262,18 +1806,15 @@ var Base = /*#__PURE__*/function () {
2262
1806
  var queryString = qs_1.default.stringify(query);
2263
1807
  return "?".concat(queryString);
2264
1808
  }
2265
-
2266
1809
  return '';
2267
1810
  }
2268
1811
  }, {
2269
1812
  key: "methods",
2270
1813
  value: function methods() {
2271
1814
  var _this = this;
2272
-
2273
1815
  for (var _len = arguments.length, names = new Array(_len), _key = 0; _key < _len; _key++) {
2274
1816
  names[_key] = arguments[_key];
2275
1817
  }
2276
-
2277
1818
  names.forEach(function (method) {
2278
1819
  _this[method] = function (body) {
2279
1820
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -2305,7 +1846,6 @@ var Base = /*#__PURE__*/function () {
2305
1846
  if (typeof id === 'undefined') {
2306
1847
  return Promise.reject(new Error("id for 'get' can not be undefined"));
2307
1848
  }
2308
-
2309
1849
  return this.request({
2310
1850
  url: this.makeUrl(params.query, id),
2311
1851
  method: 'GET',
@@ -2330,7 +1870,6 @@ var Base = /*#__PURE__*/function () {
2330
1870
  if (typeof id === 'undefined') {
2331
1871
  return Promise.reject(new Error("id for 'update' can not be undefined, only 'null' when updating multiple entries"));
2332
1872
  }
2333
-
2334
1873
  return this.request({
2335
1874
  url: this.makeUrl(params.query, id),
2336
1875
  body: body,
@@ -2346,7 +1885,6 @@ var Base = /*#__PURE__*/function () {
2346
1885
  if (typeof id === 'undefined') {
2347
1886
  return Promise.reject(new Error("id for 'patch' can not be undefined, only 'null' when updating multiple entries"));
2348
1887
  }
2349
-
2350
1888
  return this.request({
2351
1889
  url: this.makeUrl(params.query, id),
2352
1890
  body: body,
@@ -2362,7 +1900,6 @@ var Base = /*#__PURE__*/function () {
2362
1900
  if (typeof id === 'undefined') {
2363
1901
  return Promise.reject(new Error("id for 'remove' can not be undefined, only 'null' when removing multiple entries"));
2364
1902
  }
2365
-
2366
1903
  return this.request({
2367
1904
  url: this.makeUrl(params.query, id),
2368
1905
  method: 'DELETE',
@@ -2370,10 +1907,8 @@ var Base = /*#__PURE__*/function () {
2370
1907
  }, params).catch(toError);
2371
1908
  }
2372
1909
  }]);
2373
-
2374
1910
  return Base;
2375
1911
  }();
2376
-
2377
1912
  exports.Base = Base;
2378
1913
 
2379
1914
  /***/ }),
@@ -2388,47 +1923,29 @@ exports.Base = Base;
2388
1923
 
2389
1924
 
2390
1925
  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); }
2391
-
2392
1926
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2393
-
2394
1927
  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); } }
2395
-
2396
1928
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2397
-
2398
1929
  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); }
2399
-
2400
1930
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2401
-
2402
1931
  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); }; }
2403
-
2404
1932
  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); }
2405
-
2406
1933
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2407
-
2408
1934
  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; } }
2409
-
2410
1935
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2411
-
2412
1936
  Object.defineProperty(exports, "__esModule", ({
2413
1937
  value: true
2414
1938
  }));
2415
1939
  exports.FetchClient = void 0;
2416
-
2417
1940
  var errors_1 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
2418
-
2419
1941
  var base_1 = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2420
-
2421
1942
  var FetchClient = /*#__PURE__*/function (_base_1$Base) {
2422
1943
  _inherits(FetchClient, _base_1$Base);
2423
-
2424
1944
  var _super = _createSuper(FetchClient);
2425
-
2426
1945
  function FetchClient() {
2427
1946
  _classCallCheck(this, FetchClient);
2428
-
2429
1947
  return _super.apply(this, arguments);
2430
1948
  }
2431
-
2432
1949
  _createClass(FetchClient, [{
2433
1950
  key: "request",
2434
1951
  value: function request(options, params) {
@@ -2436,16 +1953,13 @@ var FetchClient = /*#__PURE__*/function (_base_1$Base) {
2436
1953
  fetchOptions.headers = Object.assign({
2437
1954
  Accept: 'application/json'
2438
1955
  }, this.options.headers, fetchOptions.headers);
2439
-
2440
1956
  if (options.body) {
2441
1957
  fetchOptions.body = JSON.stringify(options.body);
2442
1958
  }
2443
-
2444
1959
  return this.connection(options.url, fetchOptions).then(this.checkStatus).then(function (response) {
2445
1960
  if (response.status === 204) {
2446
1961
  return null;
2447
1962
  }
2448
-
2449
1963
  return response.json();
2450
1964
  });
2451
1965
  }
@@ -2455,7 +1969,6 @@ var FetchClient = /*#__PURE__*/function (_base_1$Base) {
2455
1969
  if (response.ok) {
2456
1970
  return response;
2457
1971
  }
2458
-
2459
1972
  return response.json().catch(function () {
2460
1973
  var ErrorClass = errors_1.errors[response.status] || Error;
2461
1974
  return new ErrorClass('JSON parsing error');
@@ -2465,10 +1978,8 @@ var FetchClient = /*#__PURE__*/function (_base_1$Base) {
2465
1978
  });
2466
1979
  }
2467
1980
  }]);
2468
-
2469
1981
  return FetchClient;
2470
1982
  }(base_1.Base);
2471
-
2472
1983
  exports.FetchClient = FetchClient;
2473
1984
 
2474
1985
  /***/ }),
@@ -2483,46 +1994,32 @@ exports.FetchClient = FetchClient;
2483
1994
 
2484
1995
 
2485
1996
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2486
-
2487
1997
  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."); }
2488
-
2489
1998
  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); }
2490
-
2491
1999
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
2492
-
2493
2000
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
2494
-
2495
2001
  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; }
2496
-
2497
2002
  Object.defineProperty(exports, "__esModule", ({
2498
2003
  value: true
2499
2004
  }));
2500
2005
  exports.SuperagentClient = exports.FetchClient = exports.AxiosClient = void 0;
2501
-
2502
2006
  var feathers_1 = __webpack_require__(/*! @feathersjs/feathers */ "../feathers/lib/index.js");
2503
-
2504
2007
  var base_1 = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2505
-
2506
2008
  var axios_1 = __webpack_require__(/*! ./axios */ "../rest-client/lib/axios.js");
2507
-
2508
2009
  Object.defineProperty(exports, "AxiosClient", ({
2509
2010
  enumerable: true,
2510
2011
  get: function get() {
2511
2012
  return axios_1.AxiosClient;
2512
2013
  }
2513
2014
  }));
2514
-
2515
2015
  var fetch_1 = __webpack_require__(/*! ./fetch */ "../rest-client/lib/fetch.js");
2516
-
2517
2016
  Object.defineProperty(exports, "FetchClient", ({
2518
2017
  enumerable: true,
2519
2018
  get: function get() {
2520
2019
  return fetch_1.FetchClient;
2521
2020
  }
2522
2021
  }));
2523
-
2524
2022
  var superagent_1 = __webpack_require__(/*! ./superagent */ "../rest-client/lib/superagent.js");
2525
-
2526
2023
  Object.defineProperty(exports, "SuperagentClient", ({
2527
2024
  enumerable: true,
2528
2025
  get: function get() {
@@ -2534,7 +2031,6 @@ var transports = {
2534
2031
  fetch: fetch_1.FetchClient,
2535
2032
  axios: axios_1.AxiosClient
2536
2033
  };
2537
-
2538
2034
  function restClient() {
2539
2035
  var base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2540
2036
  var result = {
@@ -2544,16 +2040,13 @@ function restClient() {
2544
2040
  result[key] = function (connection) {
2545
2041
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2546
2042
  var Service = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : transports[key];
2547
-
2548
2043
  if (!connection) {
2549
2044
  throw new Error("".concat(key, " has to be provided to feathers-rest"));
2550
2045
  }
2551
-
2552
2046
  if (typeof options === 'function') {
2553
2047
  Service = options;
2554
2048
  options = {};
2555
2049
  }
2556
-
2557
2050
  var defaultService = function defaultService(name) {
2558
2051
  return new Service({
2559
2052
  base: base,
@@ -2562,12 +2055,10 @@ function restClient() {
2562
2055
  options: options
2563
2056
  });
2564
2057
  };
2565
-
2566
2058
  var initialize = function initialize(app) {
2567
2059
  if (app.rest !== undefined) {
2568
2060
  throw new Error('Only one default client provider can be configured');
2569
2061
  }
2570
-
2571
2062
  app.rest = connection;
2572
2063
  app.defaultService = defaultService;
2573
2064
  app.mixins.unshift(function (service, _location, options) {
@@ -2579,7 +2070,6 @@ function restClient() {
2579
2070
  }
2580
2071
  });
2581
2072
  };
2582
-
2583
2073
  initialize.Service = Service;
2584
2074
  initialize.service = defaultService;
2585
2075
  return initialize;
@@ -2587,9 +2077,7 @@ function restClient() {
2587
2077
  });
2588
2078
  return result;
2589
2079
  }
2590
-
2591
2080
  exports["default"] = restClient;
2592
-
2593
2081
  if (true) {
2594
2082
  module.exports = Object.assign(restClient, module.exports);
2595
2083
  }
@@ -2606,56 +2094,37 @@ if (true) {
2606
2094
 
2607
2095
 
2608
2096
  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); }
2609
-
2610
2097
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2611
-
2612
2098
  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); } }
2613
-
2614
2099
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2615
-
2616
2100
  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); }
2617
-
2618
2101
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2619
-
2620
2102
  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); }; }
2621
-
2622
2103
  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); }
2623
-
2624
2104
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2625
-
2626
2105
  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; } }
2627
-
2628
2106
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2629
-
2630
2107
  Object.defineProperty(exports, "__esModule", ({
2631
2108
  value: true
2632
2109
  }));
2633
2110
  exports.SuperagentClient = void 0;
2634
-
2635
2111
  var base_1 = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2636
-
2637
2112
  var SuperagentClient = /*#__PURE__*/function (_base_1$Base) {
2638
2113
  _inherits(SuperagentClient, _base_1$Base);
2639
-
2640
2114
  var _super = _createSuper(SuperagentClient);
2641
-
2642
2115
  function SuperagentClient() {
2643
2116
  _classCallCheck(this, SuperagentClient);
2644
-
2645
2117
  return _super.apply(this, arguments);
2646
2118
  }
2647
-
2648
2119
  _createClass(SuperagentClient, [{
2649
2120
  key: "request",
2650
2121
  value: function request(options, params) {
2651
2122
  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');
2652
2123
  return new Promise(function (resolve, reject) {
2653
2124
  superagent.set(options.headers);
2654
-
2655
2125
  if (options.body) {
2656
2126
  superagent.send(options.body);
2657
2127
  }
2658
-
2659
2128
  superagent.end(function (error, res) {
2660
2129
  if (error) {
2661
2130
  try {
@@ -2663,19 +2132,15 @@ var SuperagentClient = /*#__PURE__*/function (_base_1$Base) {
2663
2132
  error = JSON.parse(error.response.text);
2664
2133
  error.response = response;
2665
2134
  } catch (e) {}
2666
-
2667
2135
  return reject(error);
2668
2136
  }
2669
-
2670
2137
  resolve(res && res.body);
2671
2138
  });
2672
2139
  });
2673
2140
  }
2674
2141
  }]);
2675
-
2676
2142
  return SuperagentClient;
2677
2143
  }(base_1.Base);
2678
-
2679
2144
  exports.SuperagentClient = SuperagentClient;
2680
2145
 
2681
2146
  /***/ }),
@@ -2690,30 +2155,20 @@ exports.SuperagentClient = SuperagentClient;
2690
2155
 
2691
2156
 
2692
2157
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2693
-
2694
2158
  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."); }
2695
-
2696
2159
  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); }
2697
-
2698
2160
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
2699
-
2700
2161
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
2701
-
2702
2162
  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; }
2703
-
2704
2163
  Object.defineProperty(exports, "__esModule", ({
2705
2164
  value: true
2706
2165
  }));
2707
-
2708
2166
  var client_1 = __webpack_require__(/*! @feathersjs/transport-commons/client */ "../transport-commons/client.js");
2709
-
2710
2167
  var feathers_1 = __webpack_require__(/*! @feathersjs/feathers */ "../feathers/lib/index.js");
2711
-
2712
2168
  function socketioClient(connection, options) {
2713
2169
  if (!connection) {
2714
2170
  throw new Error('Socket.io connection needs to be provided');
2715
2171
  }
2716
-
2717
2172
  var defaultService = function defaultService(name) {
2718
2173
  var events = Object.values(feathers_1.defaultEventMap);
2719
2174
  var settings = Object.assign({}, options, {
@@ -2724,12 +2179,10 @@ function socketioClient(connection, options) {
2724
2179
  });
2725
2180
  return new client_1.Service(settings);
2726
2181
  };
2727
-
2728
2182
  var initialize = function initialize(app) {
2729
2183
  if (app.io !== undefined) {
2730
2184
  throw new Error('Only one default client provider can be configured');
2731
2185
  }
2732
-
2733
2186
  app.io = connection;
2734
2187
  app.defaultService = defaultService;
2735
2188
  app.mixins.unshift(function (service, _location, options) {
@@ -2741,14 +2194,11 @@ function socketioClient(connection, options) {
2741
2194
  }
2742
2195
  });
2743
2196
  };
2744
-
2745
2197
  initialize.Service = client_1.Service;
2746
2198
  initialize.service = defaultService;
2747
2199
  return initialize;
2748
2200
  }
2749
-
2750
2201
  exports["default"] = socketioClient;
2751
-
2752
2202
  if (true) {
2753
2203
  module.exports = Object.assign(socketioClient, module.exports);
2754
2204
  }
@@ -2775,89 +2225,68 @@ module.exports = __webpack_require__(/*! ./lib/client */ "../transport-commons/l
2775
2225
 
2776
2226
 
2777
2227
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2778
-
2779
2228
  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); } }
2780
-
2781
2229
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2782
-
2783
2230
  Object.defineProperty(exports, "__esModule", ({
2784
2231
  value: true
2785
2232
  }));
2786
2233
  exports.Service = void 0;
2787
2234
  /* eslint-disable @typescript-eslint/ban-ts-comment */
2788
-
2789
2235
  var errors_1 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
2790
-
2791
2236
  var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
2792
-
2793
2237
  var debug = (0, commons_1.createDebug)('@feathersjs/transport-commons/client');
2794
2238
  var namespacedEmitterMethods = ['addListener', 'addEventListener', 'emit', 'listenerCount', 'listeners', 'on', 'once', 'prependListener', 'prependOnceListener', 'removeAllListeners', 'removeEventListener', 'removeListener'];
2795
2239
  var otherEmitterMethods = ['eventNames', 'getMaxListeners', 'setMaxListeners'];
2796
-
2797
2240
  var addEmitterMethods = function addEmitterMethods(service) {
2798
2241
  otherEmitterMethods.forEach(function (method) {
2799
2242
  service[method] = function () {
2800
2243
  var _this$connection;
2801
-
2802
2244
  if (typeof this.connection[method] !== 'function') {
2803
2245
  throw new Error("Can not call '".concat(method, "' on the client service connection"));
2804
2246
  }
2805
-
2806
2247
  return (_this$connection = this.connection)[method].apply(_this$connection, arguments);
2807
2248
  };
2808
- }); // Methods that should add the namespace (service path)
2809
-
2249
+ });
2250
+ // Methods that should add the namespace (service path)
2810
2251
  namespacedEmitterMethods.forEach(function (method) {
2811
2252
  service[method] = function (name) {
2812
2253
  var _this$connection2;
2813
-
2814
2254
  if (typeof this.connection[method] !== 'function') {
2815
2255
  throw new Error("Can not call '".concat(method, "' on the client service connection"));
2816
2256
  }
2817
-
2818
2257
  var eventName = "".concat(this.path, " ").concat(name);
2819
2258
  debug("Calling emitter method ".concat(method, " with ") + "namespaced event '".concat(eventName, "'"));
2820
-
2821
2259
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2822
2260
  args[_key - 1] = arguments[_key];
2823
2261
  }
2824
-
2825
2262
  var result = (_this$connection2 = this.connection)[method].apply(_this$connection2, [eventName].concat(args));
2826
-
2827
2263
  return result === this.connection ? this : result;
2828
2264
  };
2829
2265
  });
2830
2266
  };
2831
-
2832
2267
  var Service = /*#__PURE__*/function () {
2833
2268
  function Service(options) {
2834
2269
  _classCallCheck(this, Service);
2835
-
2836
2270
  this.events = options.events;
2837
2271
  this.path = options.name;
2838
2272
  this.connection = options.connection;
2839
2273
  this.method = options.method;
2840
2274
  addEmitterMethods(this);
2841
2275
  }
2842
-
2843
2276
  _createClass(Service, [{
2844
2277
  key: "send",
2845
2278
  value: function send(method) {
2846
2279
  var _this = this;
2847
-
2848
2280
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2849
2281
  args[_key2 - 1] = arguments[_key2];
2850
2282
  }
2851
-
2852
2283
  return new Promise(function (resolve, reject) {
2853
2284
  var _this$connection3;
2854
-
2855
2285
  args.unshift(method, _this.path);
2856
2286
  args.push(function (error, data) {
2857
2287
  return error ? reject((0, errors_1.convert)(error)) : resolve(data);
2858
2288
  });
2859
2289
  debug("Sending socket.".concat(_this.method), args);
2860
-
2861
2290
  (_this$connection3 = _this.connection)[_this.method].apply(_this$connection3, args);
2862
2291
  });
2863
2292
  }
@@ -2865,11 +2294,9 @@ var Service = /*#__PURE__*/function () {
2865
2294
  key: "methods",
2866
2295
  value: function methods() {
2867
2296
  var _this2 = this;
2868
-
2869
2297
  for (var _len3 = arguments.length, names = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
2870
2298
  names[_key3] = arguments[_key3];
2871
2299
  }
2872
-
2873
2300
  names.forEach(function (name) {
2874
2301
  _this2[name] = function (data) {
2875
2302
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -2913,36 +2340,30 @@ var Service = /*#__PURE__*/function () {
2913
2340
  value: function remove(id) {
2914
2341
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2915
2342
  return this.send('remove', id, params.query || {});
2916
- } // `off` is actually not part of the Node event emitter spec
2343
+ }
2344
+ // `off` is actually not part of the Node event emitter spec
2917
2345
  // but we are adding it since everybody is expecting it because
2918
2346
  // of the emitter-component Socket.io is using
2919
-
2920
2347
  }, {
2921
2348
  key: "off",
2922
2349
  value: function off(name) {
2923
2350
  for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
2924
2351
  args[_key4 - 1] = arguments[_key4];
2925
2352
  }
2926
-
2927
2353
  if (typeof this.connection.off === 'function') {
2928
2354
  var _this$connection4;
2929
-
2930
2355
  var result = (_this$connection4 = this.connection).off.apply(_this$connection4, ["".concat(this.path, " ").concat(name)].concat(args));
2931
-
2932
2356
  return result === this.connection ? this : result;
2933
2357
  } else if (args.length === 0) {
2934
2358
  // @ts-ignore
2935
2359
  return this.removeAllListeners(name);
2936
- } // @ts-ignore
2937
-
2938
-
2360
+ }
2361
+ // @ts-ignore
2939
2362
  return this.removeListener.apply(this, [name].concat(args));
2940
2363
  }
2941
2364
  }]);
2942
-
2943
2365
  return Service;
2944
2366
  }();
2945
-
2946
2367
  exports.Service = Service;
2947
2368
 
2948
2369
  /***/ }),
@@ -5719,44 +5140,28 @@ if (true) {
5719
5140
 
5720
5141
 
5721
5142
  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); }
5722
-
5723
5143
  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); }
5724
-
5725
5144
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
5726
-
5727
5145
  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); }; }
5728
-
5729
5146
  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); }
5730
-
5731
5147
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
5732
-
5733
5148
  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; } }
5734
-
5735
5149
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
5736
-
5737
5150
  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); } }
5738
-
5739
5151
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5740
-
5741
5152
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5742
-
5743
5153
  Object.defineProperty(exports, "__esModule", ({
5744
5154
  value: true
5745
5155
  }));
5746
5156
  exports.setMiddleware = exports.getMiddleware = exports.setManager = exports.getManager = exports.convertOptions = exports.HookManager = exports.BaseHookContext = exports.HOOKS = void 0;
5747
-
5748
5157
  var utils_js_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@feathersjs/hooks/script/utils.js");
5749
-
5750
5158
  exports.HOOKS = Symbol('@feathersjs/hooks');
5751
5159
  /**
5752
5160
  * The base hook context.
5753
5161
  */
5754
-
5755
5162
  var BaseHookContext = /*#__PURE__*/_createClass(function BaseHookContext() {
5756
5163
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5757
-
5758
5164
  _classCallCheck(this, BaseHookContext);
5759
-
5760
5165
  Object.defineProperty(this, "self", {
5761
5166
  enumerable: true,
5762
5167
  configurable: true,
@@ -5765,13 +5170,10 @@ var BaseHookContext = /*#__PURE__*/_createClass(function BaseHookContext() {
5765
5170
  });
5766
5171
  Object.assign(this, data);
5767
5172
  });
5768
-
5769
5173
  exports.BaseHookContext = BaseHookContext;
5770
-
5771
5174
  var HookManager = /*#__PURE__*/function () {
5772
5175
  function HookManager() {
5773
5176
  _classCallCheck(this, HookManager);
5774
-
5775
5177
  Object.defineProperty(this, "_parent", {
5776
5178
  enumerable: true,
5777
5179
  configurable: true,
@@ -5803,7 +5205,6 @@ var HookManager = /*#__PURE__*/function () {
5803
5205
  value: void 0
5804
5206
  });
5805
5207
  }
5806
-
5807
5208
  _createClass(HookManager, [{
5808
5209
  key: "parent",
5809
5210
  value: function parent(_parent) {
@@ -5820,13 +5221,10 @@ var HookManager = /*#__PURE__*/function () {
5820
5221
  key: "getMiddleware",
5821
5222
  value: function getMiddleware() {
5822
5223
  var _this$_parent;
5823
-
5824
5224
  var previous = (_this$_parent = this._parent) === null || _this$_parent === void 0 ? void 0 : _this$_parent.getMiddleware();
5825
-
5826
5225
  if (previous && this._middleware) {
5827
5226
  return previous.concat(this._middleware);
5828
5227
  }
5829
-
5830
5228
  return previous || this._middleware;
5831
5229
  }
5832
5230
  }, {
@@ -5834,11 +5232,9 @@ var HookManager = /*#__PURE__*/function () {
5834
5232
  value: function collectMiddleware(self, _args) {
5835
5233
  var otherMiddleware = getMiddleware(self);
5836
5234
  var middleware = this.getMiddleware();
5837
-
5838
5235
  if (otherMiddleware && middleware) {
5839
5236
  return otherMiddleware.concat(middleware);
5840
5237
  }
5841
-
5842
5238
  return otherMiddleware || middleware || [];
5843
5239
  }
5844
5240
  }, {
@@ -5847,7 +5243,6 @@ var HookManager = /*#__PURE__*/function () {
5847
5243
  if (!this._props) {
5848
5244
  this._props = {};
5849
5245
  }
5850
-
5851
5246
  (0, utils_js_1.copyProperties)(this._props, _props);
5852
5247
  return this;
5853
5248
  }
@@ -5855,13 +5250,10 @@ var HookManager = /*#__PURE__*/function () {
5855
5250
  key: "getProps",
5856
5251
  value: function getProps() {
5857
5252
  var _this$_parent2;
5858
-
5859
5253
  var previous = (_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 ? void 0 : _this$_parent2.getProps();
5860
-
5861
5254
  if (previous && this._props) {
5862
5255
  return (0, utils_js_1.copyProperties)({}, previous, this._props);
5863
5256
  }
5864
-
5865
5257
  return previous || this._props || null;
5866
5258
  }
5867
5259
  }, {
@@ -5870,7 +5262,6 @@ var HookManager = /*#__PURE__*/function () {
5870
5262
  for (var _len = arguments.length, _params = new Array(_len), _key = 0; _key < _len; _key++) {
5871
5263
  _params[_key] = arguments[_key];
5872
5264
  }
5873
-
5874
5265
  this._params = _params;
5875
5266
  return this;
5876
5267
  }
@@ -5878,13 +5269,10 @@ var HookManager = /*#__PURE__*/function () {
5878
5269
  key: "getParams",
5879
5270
  value: function getParams() {
5880
5271
  var _this$_parent3;
5881
-
5882
5272
  var previous = (_this$_parent3 = this._parent) === null || _this$_parent3 === void 0 ? void 0 : _this$_parent3.getParams();
5883
-
5884
5273
  if (previous && this._params) {
5885
5274
  return previous.concat(this._params);
5886
5275
  }
5887
-
5888
5276
  return previous || this._params;
5889
5277
  }
5890
5278
  }, {
@@ -5897,48 +5285,36 @@ var HookManager = /*#__PURE__*/function () {
5897
5285
  key: "getDefaults",
5898
5286
  value: function getDefaults(self, args, context) {
5899
5287
  var _this$_parent4;
5900
-
5901
5288
  var defaults = typeof this._defaults === 'function' ? this._defaults(self, args, context) : null;
5902
5289
  var previous = (_this$_parent4 = this._parent) === null || _this$_parent4 === void 0 ? void 0 : _this$_parent4.getDefaults(self, args, context);
5903
-
5904
5290
  if (previous && defaults) {
5905
5291
  return Object.assign({}, previous, defaults);
5906
5292
  }
5907
-
5908
5293
  return previous || defaults;
5909
5294
  }
5910
5295
  }, {
5911
5296
  key: "getContextClass",
5912
5297
  value: function getContextClass() {
5913
5298
  var Base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : BaseHookContext;
5914
-
5915
5299
  var ContextClass = /*#__PURE__*/function (_Base) {
5916
5300
  _inherits(ContextClass, _Base);
5917
-
5918
5301
  var _super = _createSuper(ContextClass);
5919
-
5920
5302
  function ContextClass(data) {
5921
5303
  var _this;
5922
-
5923
5304
  _classCallCheck(this, ContextClass);
5924
-
5925
5305
  _this = _super.call(this, data);
5926
5306
  (0, utils_js_1.copyToSelf)(_assertThisInitialized(_this));
5927
5307
  return _this;
5928
5308
  }
5929
-
5930
5309
  return _createClass(ContextClass);
5931
5310
  }(Base);
5932
-
5933
5311
  var params = this.getParams();
5934
5312
  var props = this.getProps();
5935
-
5936
5313
  if (params) {
5937
5314
  params.forEach(function (name, index) {
5938
5315
  if ((props === null || props === void 0 ? void 0 : props[name]) !== undefined) {
5939
5316
  throw new Error("Hooks can not have a property and param named '".concat(name, "'. Use .defaults instead."));
5940
5317
  }
5941
-
5942
5318
  Object.defineProperty(ContextClass.prototype, name, {
5943
5319
  enumerable: true,
5944
5320
  get: function get() {
@@ -5950,11 +5326,9 @@ var HookManager = /*#__PURE__*/function () {
5950
5326
  });
5951
5327
  });
5952
5328
  }
5953
-
5954
5329
  if (props) {
5955
5330
  (0, utils_js_1.copyProperties)(ContextClass.prototype, props);
5956
5331
  }
5957
-
5958
5332
  return ContextClass;
5959
5333
  }
5960
5334
  }, {
@@ -5962,70 +5336,51 @@ var HookManager = /*#__PURE__*/function () {
5962
5336
  value: function initializeContext(self, args, context) {
5963
5337
  var ctx = this._parent ? this._parent.initializeContext(self, args, context) : context;
5964
5338
  var defaults = this.getDefaults(self, args, ctx);
5965
-
5966
5339
  if (self) {
5967
5340
  ctx.self = self;
5968
5341
  }
5969
-
5970
5342
  ctx.arguments = args;
5971
-
5972
5343
  if (defaults) {
5973
5344
  for (var _i = 0, _Object$keys = Object.keys(defaults); _i < _Object$keys.length; _i++) {
5974
5345
  var name = _Object$keys[_i];
5975
-
5976
5346
  if (ctx[name] === undefined) {
5977
5347
  ctx[name] = defaults[name];
5978
5348
  }
5979
5349
  }
5980
5350
  }
5981
-
5982
5351
  return ctx;
5983
5352
  }
5984
5353
  }]);
5985
-
5986
5354
  return HookManager;
5987
5355
  }();
5988
-
5989
5356
  exports.HookManager = HookManager;
5990
-
5991
5357
  function convertOptions() {
5992
5358
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5993
-
5994
5359
  if (!options) {
5995
5360
  return new HookManager();
5996
5361
  }
5997
-
5998
5362
  return Array.isArray(options) ? new HookManager().middleware(options) : options;
5999
5363
  }
6000
-
6001
5364
  exports.convertOptions = convertOptions;
6002
-
6003
5365
  function getManager(target) {
6004
5366
  return target && target[exports.HOOKS] || null;
6005
5367
  }
6006
-
6007
5368
  exports.getManager = getManager;
6008
-
6009
5369
  function setManager(target, manager) {
6010
5370
  var parent = getManager(target);
6011
5371
  target[exports.HOOKS] = manager.parent(parent);
6012
5372
  return target;
6013
5373
  }
6014
-
6015
5374
  exports.setManager = setManager;
6016
-
6017
5375
  function getMiddleware(target) {
6018
5376
  var manager = getManager(target);
6019
5377
  return manager ? manager.getMiddleware() : null;
6020
5378
  }
6021
-
6022
5379
  exports.getMiddleware = getMiddleware;
6023
-
6024
5380
  function setMiddleware(target, middleware) {
6025
5381
  var manager = new HookManager().middleware(middleware);
6026
5382
  return setManager(target, manager);
6027
5383
  }
6028
-
6029
5384
  exports.setMiddleware = setMiddleware;
6030
5385
 
6031
5386
  /***/ }),
@@ -6040,28 +5395,21 @@ exports.setMiddleware = setMiddleware;
6040
5395
 
6041
5396
 
6042
5397
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6043
-
6044
5398
  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); }
6045
-
6046
5399
  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; }
6047
-
6048
5400
  Object.defineProperty(exports, "__esModule", ({
6049
5401
  value: true
6050
5402
  }));
6051
5403
  exports.compose = void 0;
6052
-
6053
5404
  function compose(middleware) {
6054
5405
  if (!Array.isArray(middleware)) {
6055
5406
  throw new TypeError('Middleware stack must be an array!');
6056
5407
  }
6057
-
6058
5408
  var _iterator = _createForOfIteratorHelper(middleware),
6059
- _step;
6060
-
5409
+ _step;
6061
5410
  try {
6062
5411
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
6063
5412
  var fn = _step.value;
6064
-
6065
5413
  if (typeof fn !== 'function') {
6066
5414
  throw new TypeError('Middleware must be composed of functions!');
6067
5415
  }
@@ -6071,28 +5419,22 @@ function compose(middleware) {
6071
5419
  } finally {
6072
5420
  _iterator.f();
6073
5421
  }
6074
-
6075
5422
  return function (context, next) {
6076
5423
  // last called middleware #
6077
5424
  var index = -1;
6078
5425
  return dispatch.call(this, 0);
6079
-
6080
5426
  function dispatch(i) {
6081
5427
  if (i <= index) {
6082
5428
  return Promise.reject(new Error('next() called multiple times'));
6083
5429
  }
6084
-
6085
5430
  index = i;
6086
5431
  var fn = middleware[i];
6087
-
6088
5432
  if (i === middleware.length) {
6089
5433
  fn = next;
6090
5434
  }
6091
-
6092
5435
  if (!fn) {
6093
5436
  return Promise.resolve();
6094
5437
  }
6095
-
6096
5438
  try {
6097
5439
  return Promise.resolve(fn.call(this, context, dispatch.bind(this, i + 1)));
6098
5440
  } catch (err) {
@@ -6101,7 +5443,6 @@ function compose(middleware) {
6101
5443
  }
6102
5444
  };
6103
5445
  }
6104
-
6105
5446
  exports.compose = compose;
6106
5447
 
6107
5448
  /***/ }),
@@ -6119,56 +5460,45 @@ Object.defineProperty(exports, "__esModule", ({
6119
5460
  value: true
6120
5461
  }));
6121
5462
  exports.hookDecorator = exports.objectHooks = exports.functionHooks = exports.getOriginal = void 0;
6122
-
6123
5463
  var compose_js_1 = __webpack_require__(/*! ./compose.js */ "../../node_modules/@feathersjs/hooks/script/compose.js");
6124
-
6125
5464
  var base_js_1 = __webpack_require__(/*! ./base.js */ "../../node_modules/@feathersjs/hooks/script/base.js");
6126
-
6127
5465
  var utils_js_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@feathersjs/hooks/script/utils.js");
6128
-
6129
5466
  function getOriginal(fn) {
6130
5467
  return typeof fn.original === 'function' ? getOriginal(fn.original) : fn;
6131
5468
  }
6132
-
6133
5469
  exports.getOriginal = getOriginal;
6134
-
6135
5470
  function functionHooks(fn, managerOrMiddleware) {
6136
5471
  if (typeof fn !== 'function') {
6137
5472
  throw new Error('Can not apply hooks to non-function');
6138
5473
  }
6139
-
6140
5474
  var manager = (0, base_js_1.convertOptions)(managerOrMiddleware);
6141
-
6142
5475
  var wrapper = function wrapper() {
6143
5476
  var _this = this;
6144
-
6145
5477
  var Context = wrapper.Context,
6146
- original = wrapper.original; // If we got passed an existing HookContext instance, we want to return it as well
6147
-
5478
+ original = wrapper.original;
5479
+ // If we got passed an existing HookContext instance, we want to return it as well
6148
5480
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6149
5481
  args[_key] = arguments[_key];
6150
5482
  }
6151
-
6152
- var returnContext = args[args.length - 1] instanceof Context; // Use existing context or default
6153
-
6154
- var base = returnContext ? args.pop() : new Context(); // Initialize the context
6155
-
6156
- var context = manager.initializeContext(this, args, base); // Assemble the hook chain
6157
-
6158
- var hookChain = [// Return `ctx.result` or the context
5483
+ var returnContext = args[args.length - 1] instanceof Context;
5484
+ // Use existing context or default
5485
+ var base = returnContext ? args.pop() : new Context();
5486
+ // Initialize the context
5487
+ var context = manager.initializeContext(this, args, base);
5488
+ // Assemble the hook chain
5489
+ var hookChain = [
5490
+ // Return `ctx.result` or the context
6159
5491
  function (ctx, next) {
6160
5492
  return next().then(function () {
6161
5493
  return returnContext ? ctx : ctx.result;
6162
5494
  });
6163
- }]; // Create the hook chain by calling the `collectMiddleware function
6164
-
5495
+ }];
5496
+ // Create the hook chain by calling the `collectMiddleware function
6165
5497
  var mw = manager.collectMiddleware(this, args);
6166
-
6167
5498
  if (mw) {
6168
5499
  Array.prototype.push.apply(hookChain, mw);
6169
- } // Runs the actual original method if `ctx.result` is not already set
6170
-
6171
-
5500
+ }
5501
+ // Runs the actual original method if `ctx.result` is not already set
6172
5502
  hookChain.push(function (ctx, next) {
6173
5503
  if (!Object.prototype.hasOwnProperty.call(context, 'result')) {
6174
5504
  return Promise.resolve(original.apply(_this, ctx.arguments)).then(function (result) {
@@ -6176,12 +5506,10 @@ function functionHooks(fn, managerOrMiddleware) {
6176
5506
  return next();
6177
5507
  });
6178
5508
  }
6179
-
6180
5509
  return next();
6181
5510
  });
6182
5511
  return (0, compose_js_1.compose)(hookChain).call(this, context);
6183
5512
  };
6184
-
6185
5513
  (0, utils_js_1.copyFnProperties)(wrapper, fn);
6186
5514
  (0, utils_js_1.copyProperties)(wrapper, fn);
6187
5515
  (0, base_js_1.setManager)(wrapper, manager);
@@ -6194,58 +5522,44 @@ function functionHooks(fn, managerOrMiddleware) {
6194
5522
  }
6195
5523
  });
6196
5524
  }
6197
-
6198
5525
  exports.functionHooks = functionHooks;
6199
-
6200
5526
  function objectHooks(obj, hooks) {
6201
5527
  if (Array.isArray(hooks)) {
6202
5528
  return (0, base_js_1.setMiddleware)(obj, hooks);
6203
5529
  }
6204
-
6205
5530
  for (var _i = 0, _Object$keys = Object.keys(hooks); _i < _Object$keys.length; _i++) {
6206
5531
  var method = _Object$keys[_i];
6207
5532
  var target = typeof obj[method] === 'function' ? obj : obj.prototype;
6208
5533
  var fn = target && target[method];
6209
-
6210
5534
  if (typeof fn !== 'function') {
6211
5535
  throw new Error("Can not apply hooks. '".concat(method, "' is not a function"));
6212
5536
  }
6213
-
6214
5537
  var manager = (0, base_js_1.convertOptions)(hooks[method]);
6215
5538
  target[method] = functionHooks(fn, manager.props({
6216
5539
  method: method
6217
5540
  }));
6218
5541
  }
6219
-
6220
5542
  return obj;
6221
5543
  }
6222
-
6223
5544
  exports.objectHooks = objectHooks;
6224
-
6225
5545
  var hookDecorator = function hookDecorator(managerOrMiddleware) {
6226
5546
  var wrapper = function wrapper(_target, method, descriptor) {
6227
5547
  var manager = (0, base_js_1.convertOptions)(managerOrMiddleware);
6228
-
6229
5548
  if (!descriptor) {
6230
5549
  (0, base_js_1.setManager)(_target.prototype, manager);
6231
5550
  return _target;
6232
5551
  }
6233
-
6234
5552
  var fn = descriptor.value;
6235
-
6236
5553
  if (typeof fn !== 'function') {
6237
5554
  throw new Error("Can not apply hooks. '".concat(method, "' is not a function"));
6238
5555
  }
6239
-
6240
5556
  descriptor.value = functionHooks(fn, manager.props({
6241
5557
  method: method
6242
5558
  }));
6243
5559
  return descriptor;
6244
5560
  };
6245
-
6246
5561
  return wrapper;
6247
5562
  };
6248
-
6249
5563
  exports.hookDecorator = hookDecorator;
6250
5564
 
6251
5565
  /***/ }),
@@ -6260,17 +5574,11 @@ exports.hookDecorator = hookDecorator;
6260
5574
 
6261
5575
 
6262
5576
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6263
-
6264
5577
  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."); }
6265
-
6266
5578
  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); }
6267
-
6268
5579
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6269
-
6270
5580
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6271
-
6272
5581
  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; }
6273
-
6274
5582
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
6275
5583
  if (k2 === undefined) k2 = k;
6276
5584
  Object.defineProperty(o, k2, {
@@ -6283,77 +5591,57 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
6283
5591
  if (k2 === undefined) k2 = k;
6284
5592
  o[k2] = m[k];
6285
5593
  });
6286
-
6287
5594
  var __exportStar = this && this.__exportStar || function (m, exports) {
6288
5595
  for (var p in m) {
6289
5596
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
6290
5597
  }
6291
5598
  };
6292
-
6293
5599
  Object.defineProperty(exports, "__esModule", ({
6294
5600
  value: true
6295
5601
  }));
6296
5602
  exports.hooks = exports.middleware = void 0;
6297
-
6298
5603
  var base_js_1 = __webpack_require__(/*! ./base.js */ "../../node_modules/@feathersjs/hooks/script/base.js");
6299
-
6300
5604
  var hooks_js_1 = __webpack_require__(/*! ./hooks.js */ "../../node_modules/@feathersjs/hooks/script/hooks.js");
6301
-
6302
5605
  __exportStar(__webpack_require__(/*! ./hooks.js */ "../../node_modules/@feathersjs/hooks/script/hooks.js"), exports);
6303
-
6304
5606
  __exportStar(__webpack_require__(/*! ./compose.js */ "../../node_modules/@feathersjs/hooks/script/compose.js"), exports);
6305
-
6306
5607
  __exportStar(__webpack_require__(/*! ./base.js */ "../../node_modules/@feathersjs/hooks/script/base.js"), exports);
6307
-
6308
5608
  __exportStar(__webpack_require__(/*! ./regular.js */ "../../node_modules/@feathersjs/hooks/script/regular.js"), exports);
6309
5609
  /**
6310
5610
  * Initializes a hook settings object with the given middleware.
6311
5611
  * @param mw The list of middleware
6312
5612
  * @param options Middleware options (params, default, props)
6313
5613
  */
6314
-
6315
-
6316
5614
  function middleware(mw, options) {
6317
5615
  var manager = new base_js_1.HookManager().middleware(mw);
6318
-
6319
5616
  if (options) {
6320
5617
  if (options.params) {
6321
5618
  manager.params.apply(manager, _toConsumableArray(options.params));
6322
5619
  }
6323
-
6324
5620
  if (options.defaults) {
6325
5621
  manager.defaults(options.defaults);
6326
5622
  }
6327
-
6328
5623
  if (options.props) {
6329
5624
  manager.props(options.props);
6330
5625
  }
6331
5626
  }
6332
-
6333
5627
  return manager;
6334
5628
  }
6335
-
6336
- exports.middleware = middleware; // Fallthrough to actual implementation
6337
-
5629
+ exports.middleware = middleware;
5630
+ // Fallthrough to actual implementation
6338
5631
  function hooks() {
6339
5632
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6340
5633
  args[_key] = arguments[_key];
6341
5634
  }
6342
-
6343
5635
  var target = args[0],
6344
- _hooks = args[1];
6345
-
5636
+ _hooks = args[1];
6346
5637
  if (typeof target === 'function' && (_hooks instanceof base_js_1.HookManager || Array.isArray(_hooks) || args.length === 1)) {
6347
5638
  return (0, hooks_js_1.functionHooks)(target, _hooks);
6348
5639
  }
6349
-
6350
5640
  if (args.length === 2) {
6351
5641
  return (0, hooks_js_1.objectHooks)(target, _hooks);
6352
5642
  }
6353
-
6354
5643
  return (0, hooks_js_1.hookDecorator)(target);
6355
5644
  }
6356
-
6357
5645
  exports.hooks = hooks;
6358
5646
 
6359
5647
  /***/ }),
@@ -6368,43 +5656,29 @@ exports.hooks = hooks;
6368
5656
 
6369
5657
 
6370
5658
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6371
-
6372
5659
  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."); }
6373
-
6374
5660
  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); }
6375
-
6376
5661
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6377
-
6378
5662
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6379
-
6380
5663
  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; }
6381
-
6382
5664
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6383
-
6384
5665
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6385
-
6386
5666
  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; }
6387
-
6388
5667
  Object.defineProperty(exports, "__esModule", ({
6389
5668
  value: true
6390
5669
  }));
6391
5670
  exports.collect = exports.fromErrorHook = exports.fromAfterHook = exports.fromBeforeHook = exports.runHooks = exports.runHook = void 0;
6392
-
6393
5671
  var compose_js_1 = __webpack_require__(/*! ./compose.js */ "../../node_modules/@feathersjs/hooks/script/compose.js");
6394
-
6395
5672
  var runHook = function runHook(hook, context, type) {
6396
5673
  if (type) context.type = type;
6397
5674
  return Promise.resolve(hook.call(context.self, context)).then(function (res) {
6398
5675
  if (type) context.type = null;
6399
-
6400
5676
  if (res && res !== context) {
6401
5677
  Object.assign(context, res);
6402
5678
  }
6403
5679
  });
6404
5680
  };
6405
-
6406
5681
  exports.runHook = runHook;
6407
-
6408
5682
  var runHooks = function runHooks(hooks) {
6409
5683
  return function (context) {
6410
5684
  return hooks.reduce(function (promise, hook) {
@@ -6414,17 +5688,13 @@ var runHooks = function runHooks(hooks) {
6414
5688
  }, Promise.resolve(context));
6415
5689
  };
6416
5690
  };
6417
-
6418
5691
  exports.runHooks = runHooks;
6419
-
6420
5692
  function fromBeforeHook(hook) {
6421
5693
  return function (context, next) {
6422
5694
  return (0, exports.runHook)(hook, context, 'before').then(next);
6423
5695
  };
6424
5696
  }
6425
-
6426
5697
  exports.fromBeforeHook = fromBeforeHook;
6427
-
6428
5698
  function fromAfterHook(hook) {
6429
5699
  return function (context, next) {
6430
5700
  return next().then(function () {
@@ -6432,9 +5702,7 @@ function fromAfterHook(hook) {
6432
5702
  });
6433
5703
  };
6434
5704
  }
6435
-
6436
5705
  exports.fromAfterHook = fromAfterHook;
6437
-
6438
5706
  function fromErrorHook(hook) {
6439
5707
  return function (context, next) {
6440
5708
  return next().catch(function (error) {
@@ -6443,7 +5711,6 @@ function fromErrorHook(hook) {
6443
5711
  context.error = error;
6444
5712
  delete context.result;
6445
5713
  }
6446
-
6447
5714
  return (0, exports.runHook)(hook, context, 'error').then(function () {
6448
5715
  if (context.result === undefined && context.error !== undefined) {
6449
5716
  throw context.error;
@@ -6452,24 +5719,19 @@ function fromErrorHook(hook) {
6452
5719
  });
6453
5720
  };
6454
5721
  }
6455
-
6456
5722
  exports.fromErrorHook = fromErrorHook;
6457
-
6458
5723
  function collect(_ref) {
6459
5724
  var _ref$before = _ref.before,
6460
- before = _ref$before === void 0 ? [] : _ref$before,
6461
- _ref$after = _ref.after,
6462
- after = _ref$after === void 0 ? [] : _ref$after,
6463
- _ref$error = _ref.error,
6464
- error = _ref$error === void 0 ? [] : _ref$error;
5725
+ before = _ref$before === void 0 ? [] : _ref$before,
5726
+ _ref$after = _ref.after,
5727
+ after = _ref$after === void 0 ? [] : _ref$after,
5728
+ _ref$error = _ref.error,
5729
+ error = _ref$error === void 0 ? [] : _ref$error;
6465
5730
  var beforeHooks = before.map(fromBeforeHook);
6466
-
6467
5731
  var afterHooks = _toConsumableArray(after).reverse().map(fromAfterHook);
6468
-
6469
5732
  var errorHooks = error.length ? [fromErrorHook((0, exports.runHooks)(error))] : [];
6470
5733
  return (0, compose_js_1.compose)([].concat(errorHooks, _toConsumableArray(beforeHooks), _toConsumableArray(afterHooks)));
6471
5734
  }
6472
-
6473
5735
  exports.collect = collect;
6474
5736
 
6475
5737
  /***/ }),
@@ -6484,31 +5746,24 @@ exports.collect = collect;
6484
5746
 
6485
5747
 
6486
5748
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6487
-
6488
5749
  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); }
6489
-
6490
5750
  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; }
6491
-
6492
5751
  Object.defineProperty(exports, "__esModule", ({
6493
5752
  value: true
6494
5753
  }));
6495
5754
  exports.copyFnProperties = exports.copyProperties = exports.copyToSelf = void 0;
6496
- var proto = Object.prototype; // These are non-standard but offer a more reliable prototype based
5755
+ var proto = Object.prototype;
5756
+ // These are non-standard but offer a more reliable prototype based
6497
5757
  // lookup for properties
6498
-
6499
5758
  var hasProtoDefinitions = typeof proto.__lookupGetter__ === 'function' && typeof proto.__defineGetter__ === 'function' && typeof proto.__defineSetter__ === 'function';
6500
-
6501
5759
  function copyToSelf(target) {
6502
5760
  // tslint:disable-next-line
6503
5761
  for (var key in target) {
6504
5762
  if (!Object.hasOwnProperty.call(target, key)) {
6505
5763
  var getter = hasProtoDefinitions ? target.constructor.prototype.__lookupGetter__(key) : Object.getOwnPropertyDescriptor(target, key);
6506
-
6507
5764
  if (hasProtoDefinitions && getter) {
6508
5765
  target.__defineGetter__(key, getter);
6509
-
6510
5766
  var setter = target.constructor.prototype.__lookupSetter__(key);
6511
-
6512
5767
  if (setter) {
6513
5768
  target.__defineSetter__(key, setter);
6514
5769
  }
@@ -6520,26 +5775,20 @@ function copyToSelf(target) {
6520
5775
  }
6521
5776
  }
6522
5777
  }
6523
-
6524
5778
  exports.copyToSelf = copyToSelf;
6525
-
6526
5779
  function copyProperties(target) {
6527
5780
  for (var _len = arguments.length, originals = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
6528
5781
  originals[_key - 1] = arguments[_key];
6529
5782
  }
6530
-
6531
5783
  for (var _i = 0, _originals = originals; _i < _originals.length; _i++) {
6532
5784
  var original = _originals[_i];
6533
5785
  var originalProps = Object.keys(original).concat(Object.getOwnPropertySymbols(original));
6534
-
6535
5786
  var _iterator = _createForOfIteratorHelper(originalProps),
6536
- _step;
6537
-
5787
+ _step;
6538
5788
  try {
6539
5789
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
6540
5790
  var prop = _step.value;
6541
5791
  var propDescriptor = Object.getOwnPropertyDescriptor(original, prop);
6542
-
6543
5792
  if (propDescriptor && !Object.prototype.hasOwnProperty.call(target, prop)) {
6544
5793
  Object.defineProperty(target, prop, propDescriptor);
6545
5794
  }
@@ -6550,15 +5799,11 @@ function copyProperties(target) {
6550
5799
  _iterator.f();
6551
5800
  }
6552
5801
  }
6553
-
6554
5802
  return target;
6555
5803
  }
6556
-
6557
5804
  exports.copyProperties = copyProperties;
6558
-
6559
5805
  function copyFnProperties(target, original) {
6560
5806
  var internalProps = ['name', 'length'];
6561
-
6562
5807
  try {
6563
5808
  for (var _i2 = 0, _internalProps = internalProps; _i2 < _internalProps.length; _i2++) {
6564
5809
  var prop = _internalProps[_i2];
@@ -6567,12 +5812,11 @@ function copyFnProperties(target, original) {
6567
5812
  value: value
6568
5813
  });
6569
5814
  }
6570
- } catch (_e) {// Avoid IE error
5815
+ } catch (_e) {
5816
+ // Avoid IE error
6571
5817
  }
6572
-
6573
5818
  return target;
6574
5819
  }
6575
-
6576
5820
  exports.copyFnProperties = copyFnProperties;
6577
5821
 
6578
5822
  /***/ })