@feathersjs/client 5.0.0-pre.6 → 5.0.0

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/core.js CHANGED
@@ -12,2420 +12,2118 @@ return /******/ (function() { // webpackBootstrap
12
12
  /******/ "use strict";
13
13
  /******/ var __webpack_modules__ = ({
14
14
 
15
- /***/ "../../node_modules/@feathersjs/hooks/lib/base.js":
16
- /*!********************************************************!*\
17
- !*** ../../node_modules/@feathersjs/hooks/lib/base.js ***!
18
- \********************************************************/
19
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
20
-
21
-
22
-
23
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
24
-
25
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
26
-
27
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
28
-
29
- 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); }; }
30
-
31
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
32
-
33
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
34
-
35
- 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; } }
36
-
37
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
38
-
39
- 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); } }
15
+ /***/ "../commons/lib/debug.js":
16
+ /*!*******************************!*\
17
+ !*** ../commons/lib/debug.js ***!
18
+ \*******************************/
19
+ /***/ (function(__unused_webpack_module, exports) {
40
20
 
41
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
42
21
 
43
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
44
22
 
45
23
  Object.defineProperty(exports, "__esModule", ({
46
24
  value: true
47
25
  }));
48
- exports.setMiddleware = exports.getMiddleware = exports.setManager = exports.getManager = exports.convertOptions = exports.HookManager = exports.BaseHookContext = exports.HOOKS = void 0;
49
-
50
- var utils_1 = __webpack_require__(/*! ./utils */ "../../node_modules/@feathersjs/hooks/lib/utils.js");
51
-
52
- exports.HOOKS = Symbol('@feathersjs/hooks');
53
- /**
54
- * The base hook context.
55
- */
56
-
57
- var BaseHookContext = function BaseHookContext() {
58
- var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26
+ exports.createDebug = exports.setDebug = exports.noopDebug = void 0;
27
+ var debuggers = {};
28
+ function noopDebug() {
29
+ return function () {};
30
+ }
31
+ exports.noopDebug = noopDebug;
32
+ var defaultInitializer = noopDebug;
33
+ function setDebug(debug) {
34
+ defaultInitializer = debug;
35
+ Object.keys(debuggers).forEach(function (name) {
36
+ debuggers[name] = debug(name);
37
+ });
38
+ }
39
+ exports.setDebug = setDebug;
40
+ function createDebug(name) {
41
+ if (!debuggers[name]) {
42
+ debuggers[name] = defaultInitializer(name);
43
+ }
44
+ return function () {
45
+ return debuggers[name].apply(debuggers, arguments);
46
+ };
47
+ }
48
+ exports.createDebug = createDebug;
59
49
 
60
- _classCallCheck(this, BaseHookContext);
50
+ /***/ }),
61
51
 
62
- Object.defineProperty(this, "self", {
63
- enumerable: true,
64
- configurable: true,
65
- writable: true,
66
- value: void 0
67
- });
68
- Object.assign(this, data);
69
- };
52
+ /***/ "../commons/lib/index.js":
53
+ /*!*******************************!*\
54
+ !*** ../commons/lib/index.js ***!
55
+ \*******************************/
56
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
70
57
 
71
- exports.BaseHookContext = BaseHookContext;
72
58
 
73
- var HookManager = /*#__PURE__*/function () {
74
- function HookManager() {
75
- _classCallCheck(this, HookManager);
76
59
 
77
- Object.defineProperty(this, "_parent", {
78
- enumerable: true,
79
- configurable: true,
80
- writable: true,
81
- value: null
82
- });
83
- Object.defineProperty(this, "_params", {
60
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
61
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
62
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
63
+ 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); }
64
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
65
+ 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."); }
66
+ 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); }
67
+ 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; }
68
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
69
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
70
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
71
+ if (k2 === undefined) k2 = k;
72
+ var desc = Object.getOwnPropertyDescriptor(m, k);
73
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
74
+ desc = {
84
75
  enumerable: true,
85
- configurable: true,
86
- writable: true,
87
- value: null
76
+ get: function get() {
77
+ return m[k];
78
+ }
79
+ };
80
+ }
81
+ Object.defineProperty(o, k2, desc);
82
+ } : function (o, m, k, k2) {
83
+ if (k2 === undefined) k2 = k;
84
+ o[k2] = m[k];
85
+ });
86
+ var __exportStar = this && this.__exportStar || function (m, exports) {
87
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
88
+ };
89
+ Object.defineProperty(exports, "__esModule", ({
90
+ value: true
91
+ }));
92
+ exports.createSymbol = exports.isPromise = exports._ = exports.stripSlashes = void 0;
93
+ // Removes all leading and trailing slashes from a path
94
+ function stripSlashes(name) {
95
+ return name.replace(/^(\/+)|(\/+)$/g, '');
96
+ }
97
+ exports.stripSlashes = stripSlashes;
98
+ // A set of lodash-y utility functions that use ES6
99
+ exports._ = {
100
+ each: function each(obj, callback) {
101
+ if (obj && typeof obj.forEach === 'function') {
102
+ obj.forEach(callback);
103
+ } else if (exports._.isObject(obj)) {
104
+ Object.keys(obj).forEach(function (key) {
105
+ return callback(obj[key], key);
106
+ });
107
+ }
108
+ },
109
+ some: function some(value, callback) {
110
+ return Object.keys(value).map(function (key) {
111
+ return [value[key], key];
112
+ }).some(function (_ref) {
113
+ var _ref2 = _slicedToArray(_ref, 2),
114
+ val = _ref2[0],
115
+ key = _ref2[1];
116
+ return callback(val, key);
88
117
  });
89
- Object.defineProperty(this, "_middleware", {
90
- enumerable: true,
91
- configurable: true,
92
- writable: true,
93
- value: null
118
+ },
119
+ every: function every(value, callback) {
120
+ return Object.keys(value).map(function (key) {
121
+ return [value[key], key];
122
+ }).every(function (_ref3) {
123
+ var _ref4 = _slicedToArray(_ref3, 2),
124
+ val = _ref4[0],
125
+ key = _ref4[1];
126
+ return callback(val, key);
94
127
  });
95
- Object.defineProperty(this, "_props", {
96
- enumerable: true,
97
- configurable: true,
98
- writable: true,
99
- value: null
128
+ },
129
+ keys: function keys(obj) {
130
+ return Object.keys(obj);
131
+ },
132
+ values: function values(obj) {
133
+ return exports._.keys(obj).map(function (key) {
134
+ return obj[key];
100
135
  });
101
- Object.defineProperty(this, "_defaults", {
102
- enumerable: true,
103
- configurable: true,
104
- writable: true,
105
- value: void 0
136
+ },
137
+ isMatch: function isMatch(obj, item) {
138
+ return exports._.keys(item).every(function (key) {
139
+ return obj[key] === item[key];
106
140
  });
107
- }
108
-
109
- _createClass(HookManager, [{
110
- key: "parent",
111
- value: function parent(_parent) {
112
- this._parent = _parent;
113
- return this;
141
+ },
142
+ isEmpty: function isEmpty(obj) {
143
+ return exports._.keys(obj).length === 0;
144
+ },
145
+ isObject: function isObject(item) {
146
+ return _typeof(item) === 'object' && !Array.isArray(item) && item !== null;
147
+ },
148
+ isObjectOrArray: function isObjectOrArray(value) {
149
+ return _typeof(value) === 'object' && value !== null;
150
+ },
151
+ extend: function extend(first) {
152
+ for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
153
+ rest[_key - 1] = arguments[_key];
114
154
  }
115
- }, {
116
- key: "middleware",
117
- value: function middleware(_middleware) {
118
- this._middleware = (_middleware === null || _middleware === void 0 ? void 0 : _middleware.length) ? _middleware : null;
119
- return this;
155
+ return Object.assign.apply(Object, [first].concat(rest));
156
+ },
157
+ omit: function omit(obj) {
158
+ var result = exports._.extend({}, obj);
159
+ for (var _len2 = arguments.length, keys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
160
+ keys[_key2 - 1] = arguments[_key2];
120
161
  }
121
- }, {
122
- key: "getMiddleware",
123
- value: function getMiddleware() {
124
- var _a;
125
-
126
- var previous = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.getMiddleware();
127
-
128
- if (previous && this._middleware) {
129
- return previous.concat(this._middleware);
130
- }
131
-
132
- return previous || this._middleware;
162
+ keys.forEach(function (key) {
163
+ return delete result[key];
164
+ });
165
+ return result;
166
+ },
167
+ pick: function pick(source) {
168
+ for (var _len3 = arguments.length, keys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
169
+ keys[_key3 - 1] = arguments[_key3];
133
170
  }
134
- }, {
135
- key: "collectMiddleware",
136
- value: function collectMiddleware(self, _args) {
137
- var otherMiddleware = getMiddleware(self);
138
- var middleware = this.getMiddleware();
139
-
140
- if (otherMiddleware && middleware) {
141
- return otherMiddleware.concat(middleware);
171
+ return keys.reduce(function (result, key) {
172
+ if (source[key] !== undefined) {
173
+ result[key] = source[key];
142
174
  }
143
-
144
- return otherMiddleware || middleware || [];
175
+ return result;
176
+ }, {});
177
+ },
178
+ // Recursively merge the source object into the target object
179
+ merge: function merge(target, source) {
180
+ if (exports._.isObject(target) && exports._.isObject(source)) {
181
+ Object.keys(source).forEach(function (key) {
182
+ if (exports._.isObject(source[key])) {
183
+ if (!target[key]) {
184
+ Object.assign(target, _defineProperty({}, key, {}));
185
+ }
186
+ exports._.merge(target[key], source[key]);
187
+ } else {
188
+ Object.assign(target, _defineProperty({}, key, source[key]));
189
+ }
190
+ });
145
191
  }
146
- }, {
147
- key: "props",
148
- value: function props(_props) {
149
- if (!this._props) {
150
- this._props = {};
151
- }
192
+ return target;
193
+ }
194
+ };
195
+ // Duck-checks if an object looks like a promise
196
+ function isPromise(result) {
197
+ return exports._.isObject(result) && typeof result.then === 'function';
198
+ }
199
+ exports.isPromise = isPromise;
200
+ function createSymbol(name) {
201
+ return typeof Symbol !== 'undefined' ? Symbol(name) : name;
202
+ }
203
+ exports.createSymbol = createSymbol;
204
+ __exportStar(__webpack_require__(/*! ./debug */ "../commons/lib/debug.js"), exports);
152
205
 
153
- utils_1.copyProperties(this._props, _props);
154
- return this;
155
- }
156
- }, {
157
- key: "getProps",
158
- value: function getProps() {
159
- var _a;
206
+ /***/ }),
160
207
 
161
- var previous = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.getProps();
208
+ /***/ "../feathers/lib/application.js":
209
+ /*!**************************************!*\
210
+ !*** ../feathers/lib/application.js ***!
211
+ \**************************************/
212
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
162
213
 
163
- if (previous && this._props) {
164
- return utils_1.copyProperties({}, previous, this._props);
165
- }
166
214
 
167
- return previous || this._props || null;
168
- }
169
- }, {
170
- key: "params",
171
- value: function params() {
172
- for (var _len = arguments.length, _params = new Array(_len), _key = 0; _key < _len; _key++) {
173
- _params[_key] = arguments[_key];
174
- }
175
215
 
176
- this._params = _params;
177
- return this;
216
+ 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); }
217
+ 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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
218
+ 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); } }
219
+ 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); }); }; }
220
+ 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; } } }; }
221
+ 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); }
222
+ 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; }
223
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
224
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
225
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
226
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
227
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
228
+ 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); }
229
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
230
+ 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); }; }
231
+ 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); }
232
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
233
+ 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; } }
234
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
235
+ var __importDefault = this && this.__importDefault || function (mod) {
236
+ return mod && mod.__esModule ? mod : {
237
+ "default": mod
238
+ };
239
+ };
240
+ Object.defineProperty(exports, "__esModule", ({
241
+ value: true
242
+ }));
243
+ exports.Feathers = void 0;
244
+ var version_1 = __importDefault(__webpack_require__(/*! ./version */ "../feathers/lib/version.js"));
245
+ var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
246
+ var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
247
+ var hooks_1 = __webpack_require__(/*! @feathersjs/hooks */ "../../node_modules/@feathersjs/hooks/script/index.js");
248
+ var events_2 = __webpack_require__(/*! ./events */ "../feathers/lib/events.js");
249
+ var hooks_2 = __webpack_require__(/*! ./hooks */ "../feathers/lib/hooks.js");
250
+ var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
251
+ var hooks_3 = __webpack_require__(/*! ./hooks */ "../feathers/lib/hooks.js");
252
+ var debug = (0, commons_1.createDebug)('@feathersjs/feathers');
253
+ var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
254
+ _inherits(Feathers, _events_1$EventEmitte);
255
+ var _super = _createSuper(Feathers);
256
+ function Feathers() {
257
+ var _this;
258
+ _classCallCheck(this, Feathers);
259
+ _this = _super.call(this);
260
+ _this.services = {};
261
+ _this.settings = {};
262
+ _this.mixins = [hooks_2.hookMixin, events_2.eventMixin];
263
+ _this.version = version_1.default;
264
+ _this._isSetup = false;
265
+ _this.registerHooks = (0, hooks_3.enableHooks)(_assertThisInitialized(_this));
266
+ _this.registerHooks({
267
+ around: [events_2.eventHook]
268
+ });
269
+ return _this;
270
+ }
271
+ _createClass(Feathers, [{
272
+ key: "get",
273
+ value: function get(name) {
274
+ return this.settings[name];
178
275
  }
179
276
  }, {
180
- key: "getParams",
181
- value: function getParams() {
182
- var _a;
183
-
184
- var previous = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.getParams();
185
-
186
- if (previous && this._params) {
187
- return previous.concat(this._params);
188
- }
189
-
190
- return previous || this._params;
277
+ key: "set",
278
+ value: function set(name, value) {
279
+ this.settings[name] = value;
280
+ return this;
191
281
  }
192
282
  }, {
193
- key: "defaults",
194
- value: function defaults(_defaults) {
195
- this._defaults = _defaults;
283
+ key: "configure",
284
+ value: function configure(callback) {
285
+ callback.call(this, this);
196
286
  return this;
197
287
  }
198
288
  }, {
199
- key: "getDefaults",
200
- value: function getDefaults(self, args, context) {
201
- var _a;
202
-
203
- var defaults = typeof this._defaults === 'function' ? this._defaults(self, args, context) : null;
204
- var previous = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.getDefaults(self, args, context);
205
-
206
- if (previous && defaults) {
207
- return Object.assign({}, previous, defaults);
289
+ key: "defaultService",
290
+ value: function defaultService(location) {
291
+ throw new Error("Can not find service '".concat(location, "'"));
292
+ }
293
+ }, {
294
+ key: "service",
295
+ value: function service(location) {
296
+ var path = (0, commons_1.stripSlashes)(location) || '/';
297
+ var current = this.services[path];
298
+ if (typeof current === 'undefined') {
299
+ this.use(path, this.defaultService(path));
300
+ return this.service(path);
208
301
  }
209
-
210
- return previous || defaults;
302
+ return current;
211
303
  }
212
304
  }, {
213
- key: "getContextClass",
214
- value: function getContextClass() {
215
- var Base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : BaseHookContext;
216
-
217
- var ContextClass = /*#__PURE__*/function (_Base) {
218
- _inherits(ContextClass, _Base);
219
-
220
- var _super = _createSuper(ContextClass);
221
-
222
- function ContextClass(data) {
223
- var _this;
224
-
225
- _classCallCheck(this, ContextClass);
226
-
227
- _this = _super.call(this, data);
228
- utils_1.copyToSelf(_assertThisInitialized(_this));
229
- return _this;
230
- }
231
-
232
- return ContextClass;
233
- }(Base);
234
-
235
- var params = this.getParams();
236
- var props = this.getProps();
237
-
238
- if (params) {
239
- params.forEach(function (name, index) {
240
- if ((props === null || props === void 0 ? void 0 : props[name]) !== undefined) {
241
- throw new Error("Hooks can not have a property and param named '".concat(name, "'. Use .defaults instead."));
305
+ key: "_setup",
306
+ value: function _setup() {
307
+ var _this2 = this;
308
+ this._isSetup = true;
309
+ return Object.keys(this.services).reduce(function (current, path) {
310
+ return current.then(function () {
311
+ var service = _this2.service(path);
312
+ if (typeof service.setup === 'function') {
313
+ debug("Setting up service for `".concat(path, "`"));
314
+ return service.setup(_this2, path);
242
315
  }
243
-
244
- Object.defineProperty(ContextClass.prototype, name, {
245
- enumerable: true,
246
- get: function get() {
247
- return this === null || this === void 0 ? void 0 : this.arguments[index];
248
- },
249
- set: function set(value) {
250
- this.arguments[index] = value;
251
- }
252
- });
253
316
  });
254
- }
255
-
256
- if (props) {
257
- utils_1.copyProperties(ContextClass.prototype, props);
258
- }
259
-
260
- return ContextClass;
317
+ }, Promise.resolve()).then(function () {
318
+ return _this2;
319
+ });
261
320
  }
262
321
  }, {
263
- key: "initializeContext",
264
- value: function initializeContext(self, args, context) {
265
- var ctx = this._parent ? this._parent.initializeContext(self, args, context) : context;
266
- var defaults = this.getDefaults(self, args, ctx);
267
-
268
- if (self) {
269
- ctx.self = self;
322
+ key: "setup",
323
+ get: function get() {
324
+ return this._setup;
325
+ },
326
+ set: function set(value) {
327
+ this._setup = value[hooks_1.HOOKS] ? value : (0, hooks_1.hooks)(value, (0, hooks_1.middleware)().params('server').props({
328
+ app: this
329
+ }));
330
+ }
331
+ }, {
332
+ key: "_teardown",
333
+ value: function _teardown() {
334
+ var _this3 = this;
335
+ this._isSetup = false;
336
+ return Object.keys(this.services).reduce(function (current, path) {
337
+ return current.then(function () {
338
+ var service = _this3.service(path);
339
+ if (typeof service.teardown === 'function') {
340
+ debug("Tearing down service for `".concat(path, "`"));
341
+ return service.teardown(_this3, path);
342
+ }
343
+ });
344
+ }, Promise.resolve()).then(function () {
345
+ return _this3;
346
+ });
347
+ }
348
+ }, {
349
+ key: "teardown",
350
+ get: function get() {
351
+ return this._teardown;
352
+ },
353
+ set: function set(value) {
354
+ this._teardown = value[hooks_1.HOOKS] ? value : (0, hooks_1.hooks)(value, (0, hooks_1.middleware)().params('server').props({
355
+ app: this
356
+ }));
357
+ }
358
+ }, {
359
+ key: "use",
360
+ value: function use(path, service, options) {
361
+ var _this4 = this;
362
+ if (typeof path !== 'string') {
363
+ throw new Error("'".concat(path, "' is not a valid service path."));
270
364
  }
271
-
272
- ctx.arguments = args;
273
-
274
- if (defaults) {
275
- for (var _i = 0, _Object$keys = Object.keys(defaults); _i < _Object$keys.length; _i++) {
276
- var name = _Object$keys[_i];
277
-
278
- if (ctx[name] === undefined) {
279
- ctx[name] = defaults[name];
365
+ var location = (0, commons_1.stripSlashes)(path) || '/';
366
+ var subApp = service;
367
+ var isSubApp = typeof subApp.service === 'function' && subApp.services;
368
+ if (isSubApp) {
369
+ Object.keys(subApp.services).forEach(function (subPath) {
370
+ return _this4.use("".concat(location, "/").concat(subPath), subApp.service(subPath));
371
+ });
372
+ return this;
373
+ }
374
+ var protoService = (0, service_1.wrapService)(location, service, options);
375
+ var serviceOptions = (0, service_1.getServiceOptions)(protoService);
376
+ var _iterator = _createForOfIteratorHelper(service_1.protectedMethods),
377
+ _step;
378
+ try {
379
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
380
+ var name = _step.value;
381
+ if (serviceOptions.methods.includes(name)) {
382
+ throw new Error("'".concat(name, "' on service '").concat(location, "' is not allowed as a custom method name"));
280
383
  }
281
384
  }
385
+ } catch (err) {
386
+ _iterator.e(err);
387
+ } finally {
388
+ _iterator.f();
282
389
  }
283
-
284
- return ctx;
390
+ debug("Registering new service at `".concat(location, "`"));
391
+ // Add all the mixins
392
+ this.mixins.forEach(function (fn) {
393
+ return fn.call(_this4, protoService, location, serviceOptions);
394
+ });
395
+ this.services[location] = protoService;
396
+ // If we ran setup already, set this service up explicitly, this will not `await`
397
+ if (this._isSetup && typeof protoService.setup === 'function') {
398
+ debug("Setting up service for `".concat(location, "`"));
399
+ protoService.setup(this, location);
400
+ }
401
+ return this;
402
+ }
403
+ }, {
404
+ key: "unuse",
405
+ value: function () {
406
+ var _unuse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(location) {
407
+ var path, service;
408
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
409
+ while (1) switch (_context.prev = _context.next) {
410
+ case 0:
411
+ path = (0, commons_1.stripSlashes)(location) || '/';
412
+ service = this.services[path];
413
+ if (!(service && typeof service.teardown === 'function')) {
414
+ _context.next = 5;
415
+ break;
416
+ }
417
+ _context.next = 5;
418
+ return service.teardown(this, path);
419
+ case 5:
420
+ delete this.services[path];
421
+ return _context.abrupt("return", service);
422
+ case 7:
423
+ case "end":
424
+ return _context.stop();
425
+ }
426
+ }, _callee, this);
427
+ }));
428
+ function unuse(_x) {
429
+ return _unuse.apply(this, arguments);
430
+ }
431
+ return unuse;
432
+ }()
433
+ }, {
434
+ key: "hooks",
435
+ value: function hooks(hookMap) {
436
+ var untypedMap = hookMap;
437
+ if (untypedMap.before || untypedMap.after || untypedMap.error || untypedMap.around) {
438
+ // regular hooks for all service methods
439
+ this.registerHooks(untypedMap);
440
+ } else if (untypedMap.setup || untypedMap.teardown) {
441
+ // .setup and .teardown application hooks
442
+ (0, hooks_1.hooks)(this, untypedMap);
443
+ } else {
444
+ // Other registration formats are just `around` hooks
445
+ this.registerHooks({
446
+ around: untypedMap
447
+ });
448
+ }
449
+ return this;
285
450
  }
286
451
  }]);
452
+ return Feathers;
453
+ }(events_1.EventEmitter);
454
+ exports.Feathers = Feathers;
287
455
 
288
- return HookManager;
289
- }();
290
-
291
- exports.HookManager = HookManager;
292
-
293
- function convertOptions() {
294
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
295
-
296
- if (!options) {
297
- return new HookManager();
298
- }
299
-
300
- return Array.isArray(options) ? new HookManager().middleware(options) : options;
301
- }
302
-
303
- exports.convertOptions = convertOptions;
304
-
305
- function getManager(target) {
306
- return target && target[exports.HOOKS] || null;
307
- }
456
+ /***/ }),
308
457
 
309
- exports.getManager = getManager;
458
+ /***/ "../feathers/lib/declarations.js":
459
+ /*!***************************************!*\
460
+ !*** ../feathers/lib/declarations.js ***!
461
+ \***************************************/
462
+ /***/ (function(__unused_webpack_module, exports) {
310
463
 
311
- function setManager(target, manager) {
312
- var parent = getManager(target);
313
- target[exports.HOOKS] = manager.parent(parent);
314
- return target;
315
- }
316
464
 
317
- exports.setManager = setManager;
318
465
 
319
- function getMiddleware(target) {
320
- var manager = getManager(target);
321
- return manager ? manager.getMiddleware() : null;
322
- }
466
+ Object.defineProperty(exports, "__esModule", ({
467
+ value: true
468
+ }));
323
469
 
324
- exports.getMiddleware = getMiddleware;
470
+ /***/ }),
325
471
 
326
- function setMiddleware(target, middleware) {
327
- var manager = new HookManager().middleware(middleware);
328
- return setManager(target, manager);
329
- }
472
+ /***/ "../feathers/lib/events.js":
473
+ /*!*********************************!*\
474
+ !*** ../feathers/lib/events.js ***!
475
+ \*********************************/
476
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
330
477
 
331
- exports.setMiddleware = setMiddleware;
332
478
 
333
- /***/ }),
334
-
335
- /***/ "../../node_modules/@feathersjs/hooks/lib/compose.js":
336
- /*!***********************************************************!*\
337
- !*** ../../node_modules/@feathersjs/hooks/lib/compose.js ***!
338
- \***********************************************************/
339
- /***/ (function(__unused_webpack_module, exports) {
340
479
 
480
+ Object.defineProperty(exports, "__esModule", ({
481
+ value: true
482
+ }));
483
+ exports.eventMixin = exports.eventHook = void 0;
484
+ var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
485
+ var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
486
+ function eventHook(context, next) {
487
+ var _ref = (0, service_1.getServiceOptions)(context.self),
488
+ events = _ref.events;
489
+ var defaultEvent = service_1.defaultEventMap[context.method] || null;
490
+ context.event = defaultEvent;
491
+ return next().then(function () {
492
+ // Send the event only if the service does not do so already (indicated in the `events` option)
493
+ // This is used for custom events and for client services receiving event from the server
494
+ if (typeof context.event === 'string' && !events.includes(context.event)) {
495
+ var results = Array.isArray(context.result) ? context.result : [context.result];
496
+ results.forEach(function (element) {
497
+ return context.self.emit(context.event, element, context);
498
+ });
499
+ }
500
+ });
501
+ }
502
+ exports.eventHook = eventHook;
503
+ function eventMixin(service) {
504
+ var isEmitter = typeof service.on === 'function' && typeof service.emit === 'function';
505
+ if (!isEmitter) {
506
+ Object.assign(service, events_1.EventEmitter.prototype);
507
+ }
508
+ return service;
509
+ }
510
+ exports.eventMixin = eventMixin;
341
511
 
512
+ /***/ }),
342
513
 
343
- 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; } } }; }
514
+ /***/ "../feathers/lib/hooks.js":
515
+ /*!********************************!*\
516
+ !*** ../feathers/lib/hooks.js ***!
517
+ \********************************/
518
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
344
519
 
345
- 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); }
346
520
 
347
- 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; }
348
521
 
522
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
523
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
524
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
525
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
526
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
527
+ 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); }
528
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
529
+ 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); }
530
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
531
+ 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); }; }
532
+ 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); }
533
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
534
+ 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; } }
535
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
536
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
537
+ 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."); }
538
+ 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); }
539
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
540
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
541
+ 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; }
542
+ 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); }
349
543
  Object.defineProperty(exports, "__esModule", ({
350
544
  value: true
351
545
  }));
352
- exports.compose = void 0;
353
-
354
- function compose(middleware) {
355
- if (!Array.isArray(middleware)) {
356
- throw new TypeError('Middleware stack must be an array!');
546
+ exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.enableHooks = exports.collectHooks = exports.convertHookData = void 0;
547
+ var hooks_1 = __webpack_require__(/*! @feathersjs/hooks */ "../../node_modules/@feathersjs/hooks/script/index.js");
548
+ var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
549
+ var types = ['before', 'after', 'error', 'around'];
550
+ var isType = function isType(value) {
551
+ return types.includes(value);
552
+ };
553
+ // Converts different hook registration formats into the
554
+ // same internal format
555
+ function convertHookData(input) {
556
+ var result = {};
557
+ if (Array.isArray(input)) {
558
+ result.all = input;
559
+ } else if (_typeof(input) !== 'object') {
560
+ result.all = [input];
561
+ } else {
562
+ for (var _i = 0, _Object$keys = Object.keys(input); _i < _Object$keys.length; _i++) {
563
+ var key = _Object$keys[_i];
564
+ var value = input[key];
565
+ result[key] = Array.isArray(value) ? value : [value];
566
+ }
357
567
  }
358
-
359
- var _iterator = _createForOfIteratorHelper(middleware),
360
- _step;
361
-
362
- try {
363
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
364
- var fn = _step.value;
365
-
366
- if (typeof fn !== 'function') {
367
- throw new TypeError('Middleware must be composed of functions!');
568
+ return result;
569
+ }
570
+ exports.convertHookData = convertHookData;
571
+ function collectHooks(target, method) {
572
+ var _target$__hooks = target.__hooks,
573
+ collected = _target$__hooks.collected,
574
+ collectedAll = _target$__hooks.collectedAll,
575
+ around = _target$__hooks.around;
576
+ return [].concat(_toConsumableArray(around.all || []), _toConsumableArray(around[method] || []), _toConsumableArray(collectedAll.before || []), _toConsumableArray(collected[method] || []), _toConsumableArray(collectedAll.after || []));
577
+ }
578
+ exports.collectHooks = collectHooks;
579
+ // Add `.hooks` functionality to an object
580
+ function enableHooks(object) {
581
+ var store = {
582
+ around: {},
583
+ before: {},
584
+ after: {},
585
+ error: {},
586
+ collected: {},
587
+ collectedAll: {}
588
+ };
589
+ Object.defineProperty(object, '__hooks', {
590
+ configurable: true,
591
+ value: store,
592
+ writable: true
593
+ });
594
+ return function registerHooks(input) {
595
+ var store = this.__hooks;
596
+ var map = Object.keys(input).reduce(function (map, type) {
597
+ if (!isType(type)) {
598
+ throw new Error("'".concat(type, "' is not a valid hook type"));
368
599
  }
600
+ map[type] = convertHookData(input[type]);
601
+ return map;
602
+ }, {});
603
+ var types = Object.keys(map);
604
+ types.forEach(function (type) {
605
+ return Object.keys(map[type]).forEach(function (method) {
606
+ var _a;
607
+ var mapHooks = map[type][method];
608
+ var storeHooks = (_a = store[type])[method] || (_a[method] = []);
609
+ storeHooks.push.apply(storeHooks, _toConsumableArray(mapHooks));
610
+ if (method === 'all') {
611
+ if (store.before[method] || store.error[method]) {
612
+ var beforeAll = (0, hooks_1.collect)({
613
+ before: store.before[method] || [],
614
+ error: store.error[method] || []
615
+ });
616
+ store.collectedAll.before = [beforeAll];
617
+ }
618
+ if (store.after[method]) {
619
+ var afterAll = (0, hooks_1.collect)({
620
+ after: store.after[method] || []
621
+ });
622
+ store.collectedAll.after = [afterAll];
623
+ }
624
+ } else {
625
+ if (store.before[method] || store.after[method] || store.error[method]) {
626
+ var collected = (0, hooks_1.collect)({
627
+ before: store.before[method] || [],
628
+ after: store.after[method] || [],
629
+ error: store.error[method] || []
630
+ });
631
+ store.collected[method] = [collected];
632
+ }
633
+ }
634
+ });
635
+ });
636
+ return this;
637
+ };
638
+ }
639
+ exports.enableHooks = enableHooks;
640
+ function createContext(service, method) {
641
+ var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
642
+ var createContext = service[method].createContext;
643
+ if (typeof createContext !== 'function') {
644
+ throw new Error("Can not create context for method ".concat(method));
645
+ }
646
+ return createContext(data);
647
+ }
648
+ exports.createContext = createContext;
649
+ var FeathersHookManager = /*#__PURE__*/function (_hooks_1$HookManager) {
650
+ _inherits(FeathersHookManager, _hooks_1$HookManager);
651
+ var _super = _createSuper(FeathersHookManager);
652
+ function FeathersHookManager(app, method) {
653
+ var _this;
654
+ _classCallCheck(this, FeathersHookManager);
655
+ _this = _super.call(this);
656
+ _this.app = app;
657
+ _this.method = method;
658
+ _this._middleware = [];
659
+ return _this;
660
+ }
661
+ _createClass(FeathersHookManager, [{
662
+ key: "collectMiddleware",
663
+ value: function collectMiddleware(self, args) {
664
+ var appHooks = collectHooks(this.app, this.method);
665
+ var middleware = _get(_getPrototypeOf(FeathersHookManager.prototype), "collectMiddleware", this).call(this, self, args);
666
+ var methodHooks = collectHooks(self, this.method);
667
+ return [].concat(_toConsumableArray(appHooks), _toConsumableArray(middleware), _toConsumableArray(methodHooks));
369
668
  }
370
- } catch (err) {
371
- _iterator.e(err);
372
- } finally {
373
- _iterator.f();
669
+ }, {
670
+ key: "initializeContext",
671
+ value: function initializeContext(self, args, context) {
672
+ var ctx = _get(_getPrototypeOf(FeathersHookManager.prototype), "initializeContext", this).call(this, self, args, context);
673
+ ctx.params = ctx.params || {};
674
+ return ctx;
675
+ }
676
+ }, {
677
+ key: "middleware",
678
+ value: function middleware(mw) {
679
+ var _this$_middleware;
680
+ (_this$_middleware = this._middleware).push.apply(_this$_middleware, _toConsumableArray(mw));
681
+ return this;
682
+ }
683
+ }]);
684
+ return FeathersHookManager;
685
+ }(hooks_1.HookManager);
686
+ exports.FeathersHookManager = FeathersHookManager;
687
+ function hookMixin(service, path, options) {
688
+ var _this2 = this;
689
+ if (typeof service.hooks === 'function') {
690
+ return service;
374
691
  }
375
-
376
- return function (context, next) {
377
- // last called middleware #
378
- var index = -1;
379
- return dispatch.call(this, 0);
380
-
381
- function dispatch(i) {
382
- if (i <= index) {
383
- return Promise.reject(new Error('next() called multiple times'));
384
- }
385
-
386
- index = i;
387
- var fn = middleware[i];
388
-
389
- if (i === middleware.length) {
390
- fn = next;
391
- }
392
-
393
- if (!fn) {
394
- return Promise.resolve();
395
- }
396
-
397
- try {
398
- return Promise.resolve(fn.call(this, context, dispatch.bind(this, i + 1)));
399
- } catch (err) {
400
- return Promise.reject(err);
692
+ var hookMethods = (0, service_1.getHookMethods)(service, options);
693
+ var serviceMethodHooks = hookMethods.reduce(function (res, method) {
694
+ var _FeathersHookManager;
695
+ var params = service_1.defaultServiceArguments[method] || ['data', 'params'];
696
+ res[method] = (_FeathersHookManager = new FeathersHookManager(_this2, method)).params.apply(_FeathersHookManager, _toConsumableArray(params)).props({
697
+ app: _this2,
698
+ path: path,
699
+ method: method,
700
+ service: service,
701
+ event: null,
702
+ type: 'around',
703
+ get statusCode() {
704
+ var _a;
705
+ return (_a = this.http) === null || _a === void 0 ? void 0 : _a.status;
706
+ },
707
+ set statusCode(value) {
708
+ this.http = this.http || {};
709
+ this.http.status = value;
401
710
  }
711
+ });
712
+ return res;
713
+ }, {});
714
+ var registerHooks = enableHooks(service);
715
+ (0, hooks_1.hooks)(service, serviceMethodHooks);
716
+ service.hooks = function (hookOptions) {
717
+ var _this3 = this;
718
+ if (hookOptions.before || hookOptions.after || hookOptions.error || hookOptions.around) {
719
+ return registerHooks.call(this, hookOptions);
402
720
  }
721
+ if (Array.isArray(hookOptions)) {
722
+ return (0, hooks_1.hooks)(this, hookOptions);
723
+ }
724
+ Object.keys(hookOptions).forEach(function (method) {
725
+ var manager = (0, hooks_1.getManager)(_this3[method]);
726
+ if (!(manager instanceof FeathersHookManager)) {
727
+ throw new Error("Method ".concat(method, " is not a Feathers hooks enabled service method"));
728
+ }
729
+ manager.middleware(hookOptions[method]);
730
+ });
731
+ return this;
403
732
  };
733
+ return service;
404
734
  }
405
-
406
- exports.compose = compose;
735
+ exports.hookMixin = hookMixin;
407
736
 
408
737
  /***/ }),
409
738
 
410
- /***/ "../../node_modules/@feathersjs/hooks/lib/hooks.js":
411
- /*!*********************************************************!*\
412
- !*** ../../node_modules/@feathersjs/hooks/lib/hooks.js ***!
413
- \*********************************************************/
414
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
739
+ /***/ "../feathers/lib/index.js":
740
+ /*!********************************!*\
741
+ !*** ../feathers/lib/index.js ***!
742
+ \********************************/
743
+ /***/ (function(module, exports, __webpack_require__) {
415
744
 
416
745
 
417
746
 
747
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
748
+ if (k2 === undefined) k2 = k;
749
+ var desc = Object.getOwnPropertyDescriptor(m, k);
750
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
751
+ desc = {
752
+ enumerable: true,
753
+ get: function get() {
754
+ return m[k];
755
+ }
756
+ };
757
+ }
758
+ Object.defineProperty(o, k2, desc);
759
+ } : function (o, m, k, k2) {
760
+ if (k2 === undefined) k2 = k;
761
+ o[k2] = m[k];
762
+ });
763
+ var __exportStar = this && this.__exportStar || function (m, exports) {
764
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
765
+ };
766
+ var __importDefault = this && this.__importDefault || function (mod) {
767
+ return mod && mod.__esModule ? mod : {
768
+ "default": mod
769
+ };
770
+ };
418
771
  Object.defineProperty(exports, "__esModule", ({
419
772
  value: true
420
773
  }));
421
- exports.hookDecorator = exports.objectHooks = exports.functionHooks = exports.getOriginal = void 0;
422
-
423
- var compose_1 = __webpack_require__(/*! ./compose */ "../../node_modules/@feathersjs/hooks/lib/compose.js");
424
-
425
- var base_1 = __webpack_require__(/*! ./base */ "../../node_modules/@feathersjs/hooks/lib/base.js");
426
-
427
- var utils_1 = __webpack_require__(/*! ./utils */ "../../node_modules/@feathersjs/hooks/lib/utils.js");
428
-
429
- function getOriginal(fn) {
430
- return typeof fn.original === 'function' ? getOriginal(fn.original) : fn;
431
- }
432
-
433
- exports.getOriginal = getOriginal;
434
-
435
- function functionHooks(fn, managerOrMiddleware) {
436
- if (typeof fn !== 'function') {
437
- throw new Error('Can not apply hooks to non-function');
774
+ exports.Feathers = exports.version = exports.feathers = void 0;
775
+ var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
776
+ var version_1 = __importDefault(__webpack_require__(/*! ./version */ "../feathers/lib/version.js"));
777
+ exports.version = version_1.default;
778
+ var application_1 = __webpack_require__(/*! ./application */ "../feathers/lib/application.js");
779
+ Object.defineProperty(exports, "Feathers", ({
780
+ enumerable: true,
781
+ get: function get() {
782
+ return application_1.Feathers;
438
783
  }
784
+ }));
785
+ function feathers() {
786
+ return new application_1.Feathers();
787
+ }
788
+ exports.feathers = feathers;
789
+ feathers.setDebug = commons_1.setDebug;
790
+ __exportStar(__webpack_require__(/*! ./hooks */ "../feathers/lib/hooks.js"), exports);
791
+ __exportStar(__webpack_require__(/*! ./declarations */ "../feathers/lib/declarations.js"), exports);
792
+ __exportStar(__webpack_require__(/*! ./service */ "../feathers/lib/service.js"), exports);
793
+ if (true) {
794
+ module.exports = Object.assign(feathers, module.exports);
795
+ }
439
796
 
440
- var manager = base_1.convertOptions(managerOrMiddleware);
441
-
442
- var wrapper = function wrapper() {
443
- var _this = this;
444
-
445
- var Context = wrapper.Context,
446
- original = wrapper.original; // If we got passed an existing HookContext instance, we want to return it as well
447
-
448
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
449
- args[_key] = arguments[_key];
450
- }
451
-
452
- var returnContext = args[args.length - 1] instanceof Context; // Use existing context or default
797
+ /***/ }),
453
798
 
454
- var base = returnContext ? args.pop() : new Context(); // Initialize the context
799
+ /***/ "../feathers/lib/service.js":
800
+ /*!**********************************!*\
801
+ !*** ../feathers/lib/service.js ***!
802
+ \**********************************/
803
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
455
804
 
456
- var context = manager.initializeContext(this, args, base); // Assemble the hook chain
457
805
 
458
- var hookChain = [// Return `ctx.result` or the context
459
- function (ctx, next) {
460
- return next().then(function () {
461
- return returnContext ? ctx : ctx.result;
462
- });
463
- }]; // Create the hook chain by calling the `collectMiddleware function
464
806
 
465
- var mw = manager.collectMiddleware(this, args);
466
-
467
- if (mw) {
468
- Array.prototype.push.apply(hookChain, mw);
469
- } // Runs the actual original method if `ctx.result` is not already set
470
-
471
-
472
- hookChain.push(function (ctx, next) {
473
- if (!Object.prototype.hasOwnProperty.call(context, 'result')) {
474
- return Promise.resolve(original.apply(_this, ctx.arguments)).then(function (result) {
475
- ctx.result = result;
476
- return next();
477
- });
478
- }
479
-
480
- return next();
481
- });
482
- return compose_1.compose(hookChain).call(this, context);
483
- };
484
-
485
- utils_1.copyFnProperties(wrapper, fn);
486
- utils_1.copyProperties(wrapper, fn);
487
- base_1.setManager(wrapper, manager);
488
- return Object.assign(wrapper, {
489
- original: getOriginal(fn),
490
- Context: manager.getContextClass(),
491
- createContext: function createContext() {
492
- var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
493
- return new wrapper.Context(data);
494
- }
807
+ 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); }
808
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
809
+ 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."); }
810
+ 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); }
811
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
812
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
813
+ 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; }
814
+ 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; }
815
+ 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; }
816
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
817
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
818
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
819
+ Object.defineProperty(exports, "__esModule", ({
820
+ value: true
821
+ }));
822
+ exports.wrapService = exports.normalizeServiceOptions = exports.getServiceOptions = exports.getHookMethods = exports.protectedMethods = exports.defaultServiceEvents = exports.defaultEventMap = exports.defaultServiceMethods = exports.defaultServiceArguments = exports.SERVICE = void 0;
823
+ var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
824
+ var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
825
+ exports.SERVICE = (0, commons_1.createSymbol)('@feathersjs/service');
826
+ exports.defaultServiceArguments = {
827
+ find: ['params'],
828
+ get: ['id', 'params'],
829
+ create: ['data', 'params'],
830
+ update: ['id', 'data', 'params'],
831
+ patch: ['id', 'data', 'params'],
832
+ remove: ['id', 'params']
833
+ };
834
+ exports.defaultServiceMethods = ['find', 'get', 'create', 'update', 'patch', 'remove'];
835
+ exports.defaultEventMap = {
836
+ create: 'created',
837
+ update: 'updated',
838
+ patch: 'patched',
839
+ remove: 'removed'
840
+ };
841
+ exports.defaultServiceEvents = Object.values(exports.defaultEventMap);
842
+ exports.protectedMethods = Object.keys(Object.prototype).concat(Object.keys(events_1.EventEmitter.prototype)).concat(['all', 'around', 'before', 'after', 'error', 'hooks', 'setup', 'teardown', 'publish']);
843
+ function getHookMethods(service, options) {
844
+ var methods = options.methods;
845
+ return exports.defaultServiceMethods.filter(function (m) {
846
+ return typeof service[m] === 'function' && !methods.includes(m);
847
+ }).concat(methods);
848
+ }
849
+ exports.getHookMethods = getHookMethods;
850
+ function getServiceOptions(service) {
851
+ return service[exports.SERVICE];
852
+ }
853
+ exports.getServiceOptions = getServiceOptions;
854
+ var normalizeServiceOptions = function normalizeServiceOptions(service) {
855
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
856
+ var _options$methods = options.methods,
857
+ methods = _options$methods === void 0 ? exports.defaultServiceMethods.filter(function (method) {
858
+ return typeof service[method] === 'function';
859
+ }) : _options$methods,
860
+ _options$events = options.events,
861
+ events = _options$events === void 0 ? service.events || [] : _options$events;
862
+ var serviceEvents = options.serviceEvents || exports.defaultServiceEvents.concat(events);
863
+ return _objectSpread(_objectSpread({}, options), {}, {
864
+ events: events,
865
+ methods: methods,
866
+ serviceEvents: serviceEvents
867
+ });
868
+ };
869
+ exports.normalizeServiceOptions = normalizeServiceOptions;
870
+ function wrapService(location, service, options) {
871
+ // Do nothing if this is already an initialized
872
+ if (service[exports.SERVICE]) {
873
+ return service;
874
+ }
875
+ var protoService = Object.create(service);
876
+ var serviceOptions = (0, exports.normalizeServiceOptions)(service, options);
877
+ if (Object.keys(serviceOptions.methods).length === 0 && ![].concat(_toConsumableArray(exports.defaultServiceMethods), ['setup', 'teardown']).some(function (method) {
878
+ return typeof service[method] === 'function';
879
+ })) {
880
+ throw new Error("Invalid service object passed for path `".concat(location, "`"));
881
+ }
882
+ Object.defineProperty(protoService, exports.SERVICE, {
883
+ value: serviceOptions
495
884
  });
885
+ return protoService;
496
886
  }
887
+ exports.wrapService = wrapService;
497
888
 
498
- exports.functionHooks = functionHooks;
499
- ;
889
+ /***/ }),
500
890
 
501
- function objectHooks(_obj, hooks) {
502
- var obj = typeof _obj === 'function' ? _obj.prototype : _obj;
891
+ /***/ "../feathers/lib/version.js":
892
+ /*!**********************************!*\
893
+ !*** ../feathers/lib/version.js ***!
894
+ \**********************************/
895
+ /***/ (function(__unused_webpack_module, exports) {
503
896
 
504
- if (Array.isArray(hooks)) {
505
- return base_1.setMiddleware(obj, hooks);
506
- }
507
897
 
508
- return Object.keys(hooks).reduce(function (result, method) {
509
- var fn = obj[method];
510
898
 
511
- if (typeof fn !== 'function') {
512
- throw new Error("Can not apply hooks. '".concat(method, "' is not a function"));
513
- }
899
+ Object.defineProperty(exports, "__esModule", ({
900
+ value: true
901
+ }));
902
+ exports["default"] = 'development';
514
903
 
515
- var manager = base_1.convertOptions(hooks[method]);
516
- result[method] = functionHooks(fn, manager.props({
517
- method: method
518
- }));
519
- return result;
520
- }, obj);
521
- }
904
+ /***/ }),
522
905
 
523
- exports.objectHooks = objectHooks;
524
- ;
906
+ /***/ "../../node_modules/events/events.js":
907
+ /*!*******************************************!*\
908
+ !*** ../../node_modules/events/events.js ***!
909
+ \*******************************************/
910
+ /***/ (function(module) {
525
911
 
526
- var hookDecorator = function hookDecorator(managerOrMiddleware) {
527
- var wrapper = function wrapper(_target, method, descriptor) {
528
- var manager = base_1.convertOptions(managerOrMiddleware);
912
+ // Copyright Joyent, Inc. and other Node contributors.
913
+ //
914
+ // Permission is hereby granted, free of charge, to any person obtaining a
915
+ // copy of this software and associated documentation files (the
916
+ // "Software"), to deal in the Software without restriction, including
917
+ // without limitation the rights to use, copy, modify, merge, publish,
918
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
919
+ // persons to whom the Software is furnished to do so, subject to the
920
+ // following conditions:
921
+ //
922
+ // The above copyright notice and this permission notice shall be included
923
+ // in all copies or substantial portions of the Software.
924
+ //
925
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
926
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
927
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
928
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
929
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
930
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
931
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
529
932
 
530
- if (!descriptor) {
531
- base_1.setManager(_target.prototype, manager);
532
- return _target;
533
- }
534
933
 
535
- var fn = descriptor.value;
536
934
 
537
- if (typeof fn !== 'function') {
538
- throw new Error("Can not apply hooks. '".concat(method, "' is not a function"));
539
- }
935
+ var R = typeof Reflect === 'object' ? Reflect : null
936
+ var ReflectApply = R && typeof R.apply === 'function'
937
+ ? R.apply
938
+ : function ReflectApply(target, receiver, args) {
939
+ return Function.prototype.apply.call(target, receiver, args);
940
+ }
540
941
 
541
- descriptor.value = functionHooks(fn, manager.props({
542
- method: method
543
- }));
544
- return descriptor;
942
+ var ReflectOwnKeys
943
+ if (R && typeof R.ownKeys === 'function') {
944
+ ReflectOwnKeys = R.ownKeys
945
+ } else if (Object.getOwnPropertySymbols) {
946
+ ReflectOwnKeys = function ReflectOwnKeys(target) {
947
+ return Object.getOwnPropertyNames(target)
948
+ .concat(Object.getOwnPropertySymbols(target));
545
949
  };
950
+ } else {
951
+ ReflectOwnKeys = function ReflectOwnKeys(target) {
952
+ return Object.getOwnPropertyNames(target);
953
+ };
954
+ }
546
955
 
547
- return wrapper;
548
- };
549
-
550
- exports.hookDecorator = hookDecorator;
551
-
552
- /***/ }),
553
-
554
- /***/ "../../node_modules/@feathersjs/hooks/lib/index.js":
555
- /*!*********************************************************!*\
556
- !*** ../../node_modules/@feathersjs/hooks/lib/index.js ***!
557
- \*********************************************************/
558
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
559
-
560
-
956
+ function ProcessEmitWarning(warning) {
957
+ if (console && console.warn) console.warn(warning);
958
+ }
561
959
 
562
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
960
+ var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
961
+ return value !== value;
962
+ }
563
963
 
564
- 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."); }
964
+ function EventEmitter() {
965
+ EventEmitter.init.call(this);
966
+ }
967
+ module.exports = EventEmitter;
968
+ module.exports.once = once;
565
969
 
566
- 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); }
970
+ // Backwards-compat with node 0.10.x
971
+ EventEmitter.EventEmitter = EventEmitter;
567
972
 
568
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
973
+ EventEmitter.prototype._events = undefined;
974
+ EventEmitter.prototype._eventsCount = 0;
975
+ EventEmitter.prototype._maxListeners = undefined;
569
976
 
570
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
977
+ // By default EventEmitters will print a warning if more than 10 listeners are
978
+ // added to it. This is a useful default which helps finding memory leaks.
979
+ var defaultMaxListeners = 10;
571
980
 
572
- 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; }
981
+ function checkListener(listener) {
982
+ if (typeof listener !== 'function') {
983
+ throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
984
+ }
985
+ }
573
986
 
574
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
575
- if (k2 === undefined) k2 = k;
576
- Object.defineProperty(o, k2, {
577
- enumerable: true,
578
- get: function get() {
579
- return m[k];
987
+ Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
988
+ enumerable: true,
989
+ get: function() {
990
+ return defaultMaxListeners;
991
+ },
992
+ set: function(arg) {
993
+ if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
994
+ throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
580
995
  }
581
- });
582
- } : function (o, m, k, k2) {
583
- if (k2 === undefined) k2 = k;
584
- o[k2] = m[k];
996
+ defaultMaxListeners = arg;
997
+ }
585
998
  });
586
999
 
587
- var __exportStar = this && this.__exportStar || function (m, exports) {
588
- for (var p in m) {
589
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1000
+ EventEmitter.init = function() {
1001
+
1002
+ if (this._events === undefined ||
1003
+ this._events === Object.getPrototypeOf(this)._events) {
1004
+ this._events = Object.create(null);
1005
+ this._eventsCount = 0;
590
1006
  }
1007
+
1008
+ this._maxListeners = this._maxListeners || undefined;
591
1009
  };
592
1010
 
593
- Object.defineProperty(exports, "__esModule", ({
594
- value: true
595
- }));
596
- exports.hooks = exports.middleware = void 0;
1011
+ // Obviously not all Emitters should be limited to 10. This function allows
1012
+ // that to be increased. Set to zero for unlimited.
1013
+ EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
1014
+ if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
1015
+ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
1016
+ }
1017
+ this._maxListeners = n;
1018
+ return this;
1019
+ };
597
1020
 
598
- var base_1 = __webpack_require__(/*! ./base */ "../../node_modules/@feathersjs/hooks/lib/base.js");
1021
+ function _getMaxListeners(that) {
1022
+ if (that._maxListeners === undefined)
1023
+ return EventEmitter.defaultMaxListeners;
1024
+ return that._maxListeners;
1025
+ }
599
1026
 
600
- var hooks_1 = __webpack_require__(/*! ./hooks */ "../../node_modules/@feathersjs/hooks/lib/hooks.js");
1027
+ EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
1028
+ return _getMaxListeners(this);
1029
+ };
601
1030
 
602
- __exportStar(__webpack_require__(/*! ./hooks */ "../../node_modules/@feathersjs/hooks/lib/hooks.js"), exports);
1031
+ EventEmitter.prototype.emit = function emit(type) {
1032
+ var args = [];
1033
+ for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
1034
+ var doError = (type === 'error');
603
1035
 
604
- __exportStar(__webpack_require__(/*! ./compose */ "../../node_modules/@feathersjs/hooks/lib/compose.js"), exports);
1036
+ var events = this._events;
1037
+ if (events !== undefined)
1038
+ doError = (doError && events.error === undefined);
1039
+ else if (!doError)
1040
+ return false;
605
1041
 
606
- __exportStar(__webpack_require__(/*! ./base */ "../../node_modules/@feathersjs/hooks/lib/base.js"), exports);
607
- /**
608
- * Initializes a hook settings object with the given middleware.
609
- * @param mw The list of middleware
610
- * @param options Middleware options (params, default, props)
611
- */
1042
+ // If there is no 'error' event listener then throw.
1043
+ if (doError) {
1044
+ var er;
1045
+ if (args.length > 0)
1046
+ er = args[0];
1047
+ if (er instanceof Error) {
1048
+ // Note: The comments on the `throw` lines are intentional, they show
1049
+ // up in Node's output if this results in an unhandled exception.
1050
+ throw er; // Unhandled 'error' event
1051
+ }
1052
+ // At least give some kind of context to the user
1053
+ var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
1054
+ err.context = er;
1055
+ throw err; // Unhandled 'error' event
1056
+ }
612
1057
 
1058
+ var handler = events[type];
613
1059
 
614
- function middleware(mw, options) {
615
- var manager = new base_1.HookManager().middleware(mw);
1060
+ if (handler === undefined)
1061
+ return false;
616
1062
 
617
- if (options) {
618
- if (options.params) {
619
- manager.params.apply(manager, _toConsumableArray(options.params));
1063
+ if (typeof handler === 'function') {
1064
+ ReflectApply(handler, this, args);
1065
+ } else {
1066
+ var len = handler.length;
1067
+ var listeners = arrayClone(handler, len);
1068
+ for (var i = 0; i < len; ++i)
1069
+ ReflectApply(listeners[i], this, args);
1070
+ }
1071
+
1072
+ return true;
1073
+ };
1074
+
1075
+ function _addListener(target, type, listener, prepend) {
1076
+ var m;
1077
+ var events;
1078
+ var existing;
1079
+
1080
+ checkListener(listener);
1081
+
1082
+ events = target._events;
1083
+ if (events === undefined) {
1084
+ events = target._events = Object.create(null);
1085
+ target._eventsCount = 0;
1086
+ } else {
1087
+ // To avoid recursion in the case that type === "newListener"! Before
1088
+ // adding it to the listeners, first emit "newListener".
1089
+ if (events.newListener !== undefined) {
1090
+ target.emit('newListener', type,
1091
+ listener.listener ? listener.listener : listener);
1092
+
1093
+ // Re-assign `events` because a newListener handler could have caused the
1094
+ // this._events to be assigned to a new object
1095
+ events = target._events;
620
1096
  }
1097
+ existing = events[type];
1098
+ }
621
1099
 
622
- if (options.defaults) {
623
- manager.defaults(options.defaults);
1100
+ if (existing === undefined) {
1101
+ // Optimize the case of one listener. Don't need the extra array object.
1102
+ existing = events[type] = listener;
1103
+ ++target._eventsCount;
1104
+ } else {
1105
+ if (typeof existing === 'function') {
1106
+ // Adding the second element, need to change to array.
1107
+ existing = events[type] =
1108
+ prepend ? [listener, existing] : [existing, listener];
1109
+ // If we've already got an array, just append.
1110
+ } else if (prepend) {
1111
+ existing.unshift(listener);
1112
+ } else {
1113
+ existing.push(listener);
624
1114
  }
625
1115
 
626
- if (options.props) {
627
- manager.props(options.props);
1116
+ // Check for listener leak
1117
+ m = _getMaxListeners(target);
1118
+ if (m > 0 && existing.length > m && !existing.warned) {
1119
+ existing.warned = true;
1120
+ // No error code for this since it is a Warning
1121
+ // eslint-disable-next-line no-restricted-syntax
1122
+ var w = new Error('Possible EventEmitter memory leak detected. ' +
1123
+ existing.length + ' ' + String(type) + ' listeners ' +
1124
+ 'added. Use emitter.setMaxListeners() to ' +
1125
+ 'increase limit');
1126
+ w.name = 'MaxListenersExceededWarning';
1127
+ w.emitter = target;
1128
+ w.type = type;
1129
+ w.count = existing.length;
1130
+ ProcessEmitWarning(w);
628
1131
  }
629
1132
  }
630
1133
 
631
- return manager;
1134
+ return target;
632
1135
  }
633
1136
 
634
- exports.middleware = middleware; // Fallthrough to actual implementation
635
-
636
- function hooks() {
637
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
638
- args[_key] = arguments[_key];
639
- }
1137
+ EventEmitter.prototype.addListener = function addListener(type, listener) {
1138
+ return _addListener(this, type, listener, false);
1139
+ };
640
1140
 
641
- var target = args[0],
642
- _hooks = args[1];
1141
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
643
1142
 
644
- if (typeof target === 'function' && (_hooks instanceof base_1.HookManager || Array.isArray(_hooks) || args.length === 1)) {
645
- return hooks_1.functionHooks(target, _hooks);
646
- }
1143
+ EventEmitter.prototype.prependListener =
1144
+ function prependListener(type, listener) {
1145
+ return _addListener(this, type, listener, true);
1146
+ };
647
1147
 
648
- if (args.length === 2) {
649
- return hooks_1.objectHooks(target, _hooks);
1148
+ function onceWrapper() {
1149
+ if (!this.fired) {
1150
+ this.target.removeListener(this.type, this.wrapFn);
1151
+ this.fired = true;
1152
+ if (arguments.length === 0)
1153
+ return this.listener.call(this.target);
1154
+ return this.listener.apply(this.target, arguments);
650
1155
  }
651
-
652
- return hooks_1.hookDecorator(target);
653
1156
  }
654
1157
 
655
- exports.hooks = hooks;
656
-
657
- /***/ }),
1158
+ function _onceWrap(target, type, listener) {
1159
+ var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
1160
+ var wrapped = onceWrapper.bind(state);
1161
+ wrapped.listener = listener;
1162
+ state.wrapFn = wrapped;
1163
+ return wrapped;
1164
+ }
658
1165
 
659
- /***/ "../../node_modules/@feathersjs/hooks/lib/utils.js":
660
- /*!*********************************************************!*\
661
- !*** ../../node_modules/@feathersjs/hooks/lib/utils.js ***!
662
- \*********************************************************/
663
- /***/ (function(__unused_webpack_module, exports) {
1166
+ EventEmitter.prototype.once = function once(type, listener) {
1167
+ checkListener(listener);
1168
+ this.on(type, _onceWrap(this, type, listener));
1169
+ return this;
1170
+ };
664
1171
 
1172
+ EventEmitter.prototype.prependOnceListener =
1173
+ function prependOnceListener(type, listener) {
1174
+ checkListener(listener);
1175
+ this.prependListener(type, _onceWrap(this, type, listener));
1176
+ return this;
1177
+ };
665
1178
 
1179
+ // Emits a 'removeListener' event if and only if the listener was removed.
1180
+ EventEmitter.prototype.removeListener =
1181
+ function removeListener(type, listener) {
1182
+ var list, events, position, i, originalListener;
666
1183
 
667
- 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; } } }; }
1184
+ checkListener(listener);
668
1185
 
669
- 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); }
1186
+ events = this._events;
1187
+ if (events === undefined)
1188
+ return this;
670
1189
 
671
- 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; }
1190
+ list = events[type];
1191
+ if (list === undefined)
1192
+ return this;
672
1193
 
673
- Object.defineProperty(exports, "__esModule", ({
674
- value: true
675
- }));
676
- exports.copyFnProperties = exports.copyProperties = exports.copyToSelf = void 0;
677
- var proto = Object.prototype; // These are non-standard but offer a more reliable prototype based
678
- // lookup for properties
1194
+ if (list === listener || list.listener === listener) {
1195
+ if (--this._eventsCount === 0)
1196
+ this._events = Object.create(null);
1197
+ else {
1198
+ delete events[type];
1199
+ if (events.removeListener)
1200
+ this.emit('removeListener', type, list.listener || listener);
1201
+ }
1202
+ } else if (typeof list !== 'function') {
1203
+ position = -1;
679
1204
 
680
- var hasProtoDefinitions = typeof proto.__lookupGetter__ === 'function' && typeof proto.__defineGetter__ === 'function' && typeof proto.__defineSetter__ === 'function';
1205
+ for (i = list.length - 1; i >= 0; i--) {
1206
+ if (list[i] === listener || list[i].listener === listener) {
1207
+ originalListener = list[i].listener;
1208
+ position = i;
1209
+ break;
1210
+ }
1211
+ }
681
1212
 
682
- function copyToSelf(target) {
683
- // tslint:disable-next-line
684
- for (var key in target) {
685
- if (!target.hasOwnProperty(key)) {
686
- var getter = hasProtoDefinitions ? target.constructor.prototype.__lookupGetter__(key) : Object.getOwnPropertyDescriptor(target, key);
1213
+ if (position < 0)
1214
+ return this;
687
1215
 
688
- if (hasProtoDefinitions && getter) {
689
- target.__defineGetter__(key, getter);
1216
+ if (position === 0)
1217
+ list.shift();
1218
+ else {
1219
+ spliceOne(list, position);
1220
+ }
690
1221
 
691
- var setter = target.constructor.prototype.__lookupSetter__(key);
1222
+ if (list.length === 1)
1223
+ events[type] = list[0];
692
1224
 
693
- if (setter) {
694
- target.__defineSetter__(key, setter);
695
- }
696
- } else if (getter) {
697
- Object.defineProperty(target, key, getter);
698
- } else {
699
- target[key] = target[key];
1225
+ if (events.removeListener !== undefined)
1226
+ this.emit('removeListener', type, originalListener || listener);
700
1227
  }
701
- }
702
- }
703
- }
704
-
705
- exports.copyToSelf = copyToSelf;
706
1228
 
707
- function copyProperties(target) {
708
- for (var _len = arguments.length, originals = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
709
- originals[_key - 1] = arguments[_key];
710
- }
1229
+ return this;
1230
+ };
711
1231
 
712
- for (var _i = 0, _originals = originals; _i < _originals.length; _i++) {
713
- var original = _originals[_i];
714
- var originalProps = Object.keys(original).concat(Object.getOwnPropertySymbols(original));
1232
+ EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
715
1233
 
716
- var _iterator = _createForOfIteratorHelper(originalProps),
717
- _step;
1234
+ EventEmitter.prototype.removeAllListeners =
1235
+ function removeAllListeners(type) {
1236
+ var listeners, events, i;
718
1237
 
719
- try {
720
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
721
- var prop = _step.value;
722
- var propDescriptor = Object.getOwnPropertyDescriptor(original, prop);
1238
+ events = this._events;
1239
+ if (events === undefined)
1240
+ return this;
723
1241
 
724
- if (propDescriptor && !Object.prototype.hasOwnProperty.call(target, prop)) {
725
- Object.defineProperty(target, prop, propDescriptor);
1242
+ // not listening for removeListener, no need to emit
1243
+ if (events.removeListener === undefined) {
1244
+ if (arguments.length === 0) {
1245
+ this._events = Object.create(null);
1246
+ this._eventsCount = 0;
1247
+ } else if (events[type] !== undefined) {
1248
+ if (--this._eventsCount === 0)
1249
+ this._events = Object.create(null);
1250
+ else
1251
+ delete events[type];
726
1252
  }
1253
+ return this;
727
1254
  }
728
- } catch (err) {
729
- _iterator.e(err);
730
- } finally {
731
- _iterator.f();
732
- }
733
- }
734
-
735
- return target;
736
- }
737
1255
 
738
- exports.copyProperties = copyProperties;
1256
+ // emit removeListener for all listeners on all events
1257
+ if (arguments.length === 0) {
1258
+ var keys = Object.keys(events);
1259
+ var key;
1260
+ for (i = 0; i < keys.length; ++i) {
1261
+ key = keys[i];
1262
+ if (key === 'removeListener') continue;
1263
+ this.removeAllListeners(key);
1264
+ }
1265
+ this.removeAllListeners('removeListener');
1266
+ this._events = Object.create(null);
1267
+ this._eventsCount = 0;
1268
+ return this;
1269
+ }
739
1270
 
740
- function copyFnProperties(target, original) {
741
- var internalProps = ['name', 'length'];
1271
+ listeners = events[type];
742
1272
 
743
- try {
744
- for (var _i2 = 0, _internalProps = internalProps; _i2 < _internalProps.length; _i2++) {
745
- var prop = _internalProps[_i2];
746
- var value = original[prop];
747
- Object.defineProperty(target, prop, {
748
- value: value
749
- });
750
- }
751
- } catch (e) {// Avoid IE error
752
- }
1273
+ if (typeof listeners === 'function') {
1274
+ this.removeListener(type, listeners);
1275
+ } else if (listeners !== undefined) {
1276
+ // LIFO order
1277
+ for (i = listeners.length - 1; i >= 0; i--) {
1278
+ this.removeListener(type, listeners[i]);
1279
+ }
1280
+ }
753
1281
 
754
- return target;
755
- }
1282
+ return this;
1283
+ };
756
1284
 
757
- exports.copyFnProperties = copyFnProperties;
1285
+ function _listeners(target, type, unwrap) {
1286
+ var events = target._events;
758
1287
 
759
- /***/ }),
1288
+ if (events === undefined)
1289
+ return [];
760
1290
 
761
- /***/ "../commons/lib/debug.js":
762
- /*!*******************************!*\
763
- !*** ../commons/lib/debug.js ***!
764
- \*******************************/
765
- /***/ (function(__unused_webpack_module, exports) {
1291
+ var evlistener = events[type];
1292
+ if (evlistener === undefined)
1293
+ return [];
766
1294
 
1295
+ if (typeof evlistener === 'function')
1296
+ return unwrap ? [evlistener.listener || evlistener] : [evlistener];
767
1297
 
1298
+ return unwrap ?
1299
+ unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
1300
+ }
768
1301
 
769
- Object.defineProperty(exports, "__esModule", ({
770
- value: true
771
- }));
772
- exports.createDebug = exports.setDebug = exports.noopDebug = void 0;
773
- var debuggers = {};
1302
+ EventEmitter.prototype.listeners = function listeners(type) {
1303
+ return _listeners(this, type, true);
1304
+ };
774
1305
 
775
- function noopDebug() {
776
- return function () {};
777
- }
1306
+ EventEmitter.prototype.rawListeners = function rawListeners(type) {
1307
+ return _listeners(this, type, false);
1308
+ };
778
1309
 
779
- exports.noopDebug = noopDebug;
780
- var defaultInitializer = noopDebug;
1310
+ EventEmitter.listenerCount = function(emitter, type) {
1311
+ if (typeof emitter.listenerCount === 'function') {
1312
+ return emitter.listenerCount(type);
1313
+ } else {
1314
+ return listenerCount.call(emitter, type);
1315
+ }
1316
+ };
781
1317
 
782
- function setDebug(debug) {
783
- defaultInitializer = debug;
784
- Object.keys(debuggers).forEach(function (name) {
785
- debuggers[name] = debug(name);
786
- });
787
- }
1318
+ EventEmitter.prototype.listenerCount = listenerCount;
1319
+ function listenerCount(type) {
1320
+ var events = this._events;
788
1321
 
789
- exports.setDebug = setDebug;
1322
+ if (events !== undefined) {
1323
+ var evlistener = events[type];
790
1324
 
791
- function createDebug(name) {
792
- if (!debuggers[name]) {
793
- debuggers[name] = defaultInitializer(name);
1325
+ if (typeof evlistener === 'function') {
1326
+ return 1;
1327
+ } else if (evlistener !== undefined) {
1328
+ return evlistener.length;
1329
+ }
794
1330
  }
795
1331
 
796
- return function () {
797
- return debuggers[name].apply(debuggers, arguments);
798
- };
1332
+ return 0;
799
1333
  }
800
1334
 
801
- exports.createDebug = createDebug;
1335
+ EventEmitter.prototype.eventNames = function eventNames() {
1336
+ return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
1337
+ };
802
1338
 
803
- /***/ }),
1339
+ function arrayClone(arr, n) {
1340
+ var copy = new Array(n);
1341
+ for (var i = 0; i < n; ++i)
1342
+ copy[i] = arr[i];
1343
+ return copy;
1344
+ }
804
1345
 
805
- /***/ "../commons/lib/index.js":
806
- /*!*******************************!*\
807
- !*** ../commons/lib/index.js ***!
808
- \*******************************/
809
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1346
+ function spliceOne(list, index) {
1347
+ for (; index + 1 < list.length; index++)
1348
+ list[index] = list[index + 1];
1349
+ list.pop();
1350
+ }
810
1351
 
1352
+ function unwrapListeners(arr) {
1353
+ var ret = new Array(arr.length);
1354
+ for (var i = 0; i < ret.length; ++i) {
1355
+ ret[i] = arr[i].listener || arr[i];
1356
+ }
1357
+ return ret;
1358
+ }
811
1359
 
1360
+ function once(emitter, name) {
1361
+ return new Promise(function (resolve, reject) {
1362
+ function errorListener(err) {
1363
+ emitter.removeListener(name, resolver);
1364
+ reject(err);
1365
+ }
812
1366
 
813
- 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; }
1367
+ function resolver() {
1368
+ if (typeof emitter.removeListener === 'function') {
1369
+ emitter.removeListener('error', errorListener);
1370
+ }
1371
+ resolve([].slice.call(arguments));
1372
+ };
814
1373
 
815
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1374
+ eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
1375
+ if (name !== 'error') {
1376
+ addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
1377
+ }
1378
+ });
1379
+ }
816
1380
 
817
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1381
+ function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
1382
+ if (typeof emitter.on === 'function') {
1383
+ eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
1384
+ }
1385
+ }
818
1386
 
819
- 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."); }
1387
+ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
1388
+ if (typeof emitter.on === 'function') {
1389
+ if (flags.once) {
1390
+ emitter.once(name, listener);
1391
+ } else {
1392
+ emitter.on(name, listener);
1393
+ }
1394
+ } else if (typeof emitter.addEventListener === 'function') {
1395
+ // EventTarget does not have `error` event semantics like Node
1396
+ // EventEmitters, we do not listen for `error` events here.
1397
+ emitter.addEventListener(name, function wrapListener(arg) {
1398
+ // IE does not have builtin `{ once: true }` support so we
1399
+ // have to do it manually.
1400
+ if (flags.once) {
1401
+ emitter.removeEventListener(name, wrapListener);
1402
+ }
1403
+ listener(arg);
1404
+ });
1405
+ } else {
1406
+ throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
1407
+ }
1408
+ }
820
1409
 
821
- 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); }
822
1410
 
823
- 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; }
1411
+ /***/ }),
824
1412
 
825
- 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; }
1413
+ /***/ "./src/core.ts":
1414
+ /*!*********************!*\
1415
+ !*** ./src/core.ts ***!
1416
+ \*********************/
1417
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
826
1418
 
827
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
828
1419
 
829
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
830
- if (k2 === undefined) k2 = k;
831
- Object.defineProperty(o, k2, {
832
- enumerable: true,
833
- get: function get() {
834
- return m[k];
1420
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1421
+ if (k2 === undefined) k2 = k;
1422
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1423
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1424
+ desc = { enumerable: true, get: function() { return m[k]; } };
835
1425
  }
836
- });
837
- } : function (o, m, k, k2) {
838
- if (k2 === undefined) k2 = k;
839
- o[k2] = m[k];
840
- });
841
-
842
- var __exportStar = this && this.__exportStar || function (m, exports) {
843
- for (var p in m) {
844
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
845
- }
1426
+ Object.defineProperty(o, k2, desc);
1427
+ }) : (function(o, m, k, k2) {
1428
+ if (k2 === undefined) k2 = k;
1429
+ o[k2] = m[k];
1430
+ }));
1431
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1432
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
846
1433
  };
1434
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1435
+ __exportStar(__webpack_require__(/*! @feathersjs/feathers */ "../feathers/lib/index.js"), exports);
847
1436
 
848
- Object.defineProperty(exports, "__esModule", ({
849
- value: true
850
- }));
851
- exports.createSymbol = exports.isPromise = exports._ = exports.stripSlashes = void 0; // Removes all leading and trailing slashes from a path
852
1437
 
853
- function stripSlashes(name) {
854
- return name.replace(/^(\/+)|(\/+)$/g, '');
855
- }
1438
+ /***/ }),
856
1439
 
857
- exports.stripSlashes = stripSlashes; // A set of lodash-y utility functions that use ES6
1440
+ /***/ "../../node_modules/@feathersjs/hooks/script/base.js":
1441
+ /*!***********************************************************!*\
1442
+ !*** ../../node_modules/@feathersjs/hooks/script/base.js ***!
1443
+ \***********************************************************/
1444
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
858
1445
 
859
- exports._ = {
860
- each: function each(obj, callback) {
861
- if (obj && typeof obj.forEach === 'function') {
862
- obj.forEach(callback);
863
- } else if (exports._.isObject(obj)) {
864
- Object.keys(obj).forEach(function (key) {
865
- return callback(obj[key], key);
866
- });
867
- }
868
- },
869
- some: function some(value, callback) {
870
- return Object.keys(value).map(function (key) {
871
- return [value[key], key];
872
- }).some(function (_ref) {
873
- var _ref2 = _slicedToArray(_ref, 2),
874
- val = _ref2[0],
875
- key = _ref2[1];
876
1446
 
877
- return callback(val, key);
878
- });
879
- },
880
- every: function every(value, callback) {
881
- return Object.keys(value).map(function (key) {
882
- return [value[key], key];
883
- }).every(function (_ref3) {
884
- var _ref4 = _slicedToArray(_ref3, 2),
885
- val = _ref4[0],
886
- key = _ref4[1];
887
1447
 
888
- return callback(val, key);
889
- });
890
- },
891
- keys: function keys(obj) {
892
- return Object.keys(obj);
893
- },
894
- values: function values(obj) {
895
- return exports._.keys(obj).map(function (key) {
896
- return obj[key];
1448
+ 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); }
1449
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1450
+ 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); }; }
1451
+ 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); }
1452
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1453
+ 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; } }
1454
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1455
+ 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); }
1456
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1457
+ 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."); }
1458
+ 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); }
1459
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1460
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1461
+ 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; }
1462
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1463
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
1464
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1465
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
1466
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1467
+ Object.defineProperty(exports, "__esModule", ({
1468
+ value: true
1469
+ }));
1470
+ exports.setMiddleware = exports.getMiddleware = exports.setManager = exports.getManager = exports.convertOptions = exports.HookManager = exports.BaseHookContext = exports.HOOKS = void 0;
1471
+ var utils_js_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@feathersjs/hooks/script/utils.js");
1472
+ exports.HOOKS = Symbol('@feathersjs/hooks');
1473
+ /**
1474
+ * The base hook context.
1475
+ */
1476
+ var BaseHookContext = /*#__PURE__*/function () {
1477
+ function BaseHookContext() {
1478
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1479
+ _classCallCheck(this, BaseHookContext);
1480
+ Object.defineProperty(this, "self", {
1481
+ enumerable: true,
1482
+ configurable: true,
1483
+ writable: true,
1484
+ value: void 0
897
1485
  });
898
- },
899
- isMatch: function isMatch(obj, item) {
900
- return exports._.keys(item).every(function (key) {
901
- return obj[key] === item[key];
902
- });
903
- },
904
- isEmpty: function isEmpty(obj) {
905
- return exports._.keys(obj).length === 0;
906
- },
907
- isObject: function isObject(item) {
908
- return _typeof(item) === 'object' && !Array.isArray(item) && item !== null;
909
- },
910
- isObjectOrArray: function isObjectOrArray(value) {
911
- return _typeof(value) === 'object' && value !== null;
912
- },
913
- extend: function extend(first) {
914
- for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
915
- rest[_key - 1] = arguments[_key];
916
- }
917
-
918
- return Object.assign.apply(Object, [first].concat(rest));
919
- },
920
- omit: function omit(obj) {
921
- var result = exports._.extend({}, obj);
922
-
923
- for (var _len2 = arguments.length, keys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
924
- keys[_key2 - 1] = arguments[_key2];
925
- }
926
-
927
- keys.forEach(function (key) {
928
- return delete result[key];
929
- });
930
- return result;
931
- },
932
- pick: function pick(source) {
933
- for (var _len3 = arguments.length, keys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
934
- keys[_key3 - 1] = arguments[_key3];
935
- }
936
-
937
- return keys.reduce(function (result, key) {
938
- if (source[key] !== undefined) {
939
- result[key] = source[key];
1486
+ Object.assign(this, data);
1487
+ }
1488
+ _createClass(BaseHookContext, [{
1489
+ key: "toJSON",
1490
+ value: function toJSON() {
1491
+ var _this = this;
1492
+ var keys = Object.keys(this);
1493
+ var proto = Object.getPrototypeOf(this);
1494
+ while (proto) {
1495
+ keys.push.apply(keys, _toConsumableArray(Object.keys(proto)));
1496
+ proto = Object.getPrototypeOf(proto);
940
1497
  }
941
-
942
- return result;
943
- }, {});
944
- },
945
- // Recursively merge the source object into the target object
946
- merge: function merge(target, source) {
947
- if (exports._.isObject(target) && exports._.isObject(source)) {
948
- Object.keys(source).forEach(function (key) {
949
- if (exports._.isObject(source[key])) {
950
- if (!target[key]) {
951
- Object.assign(target, _defineProperty({}, key, {}));
952
- }
953
-
954
- exports._.merge(target[key], source[key]);
955
- } else {
956
- Object.assign(target, _defineProperty({}, key, source[key]));
957
- }
958
- });
1498
+ return keys.reduce(function (result, key) {
1499
+ result[key] = _this[key];
1500
+ return result;
1501
+ }, {});
959
1502
  }
960
-
961
- return target;
962
- }
963
- }; // Duck-checks if an object looks like a promise
964
-
965
- function isPromise(result) {
966
- return exports._.isObject(result) && typeof result.then === 'function';
967
- }
968
-
969
- exports.isPromise = isPromise;
970
-
971
- function createSymbol(name) {
972
- return typeof Symbol !== 'undefined' ? Symbol(name) : name;
973
- }
974
-
975
- exports.createSymbol = createSymbol;
976
-
977
- __exportStar(__webpack_require__(/*! ./debug */ "../commons/lib/debug.js"), exports);
978
-
979
- /***/ }),
980
-
981
- /***/ "../feathers/lib/application.js":
982
- /*!**************************************!*\
983
- !*** ../feathers/lib/application.js ***!
984
- \**************************************/
985
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
986
-
987
-
988
-
989
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
990
-
991
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
992
-
993
- 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."); }
994
-
995
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
996
-
997
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
998
-
999
- 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; } } }; }
1000
-
1001
- 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); }
1002
-
1003
- 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; }
1004
-
1005
- 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; }
1006
-
1007
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1008
-
1009
- 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); } }
1010
-
1011
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1012
-
1013
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
1014
-
1015
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1016
-
1017
- 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); }; }
1018
-
1019
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
1020
-
1021
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1022
-
1023
- 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; } }
1024
-
1025
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1026
-
1027
- var __importDefault = this && this.__importDefault || function (mod) {
1028
- return mod && mod.__esModule ? mod : {
1029
- "default": mod
1030
- };
1031
- };
1032
-
1033
- Object.defineProperty(exports, "__esModule", ({
1034
- value: true
1035
- }));
1036
- exports.Feathers = void 0;
1037
-
1038
- var version_1 = __importDefault(__webpack_require__(/*! ./version */ "../feathers/lib/version.js"));
1039
-
1040
- var dependencies_1 = __webpack_require__(/*! ./dependencies */ "../feathers/lib/dependencies.js");
1041
-
1042
- var events_1 = __webpack_require__(/*! ./events */ "../feathers/lib/events.js");
1043
-
1044
- var index_1 = __webpack_require__(/*! ./hooks/index */ "../feathers/lib/hooks/index.js");
1045
-
1046
- var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
1047
-
1048
- var legacy_1 = __webpack_require__(/*! ./hooks/legacy */ "../feathers/lib/hooks/legacy.js");
1049
-
1050
- var debug = dependencies_1.createDebug('@feathersjs/feathers');
1051
-
1052
- var Feathers = /*#__PURE__*/function (_dependencies_1$Event) {
1053
- _inherits(Feathers, _dependencies_1$Event);
1054
-
1055
- var _super = _createSuper(Feathers);
1056
-
1057
- function Feathers() {
1058
- var _this;
1059
-
1060
- _classCallCheck(this, Feathers);
1061
-
1062
- _this = _super.call(this);
1063
- _this.services = {};
1064
- _this.settings = {};
1065
- _this.mixins = [index_1.hookMixin, events_1.eventMixin];
1066
- _this.version = version_1.default;
1067
- _this._isSetup = false;
1068
- _this.appHooks = _defineProperty({}, dependencies_1.HOOKS, [events_1.eventHook]);
1069
- _this.legacyHooks = legacy_1.enableLegacyHooks(_assertThisInitialized(_this));
1070
- return _this;
1503
+ }]);
1504
+ return BaseHookContext;
1505
+ }();
1506
+ exports.BaseHookContext = BaseHookContext;
1507
+ var HookManager = /*#__PURE__*/function () {
1508
+ function HookManager() {
1509
+ _classCallCheck(this, HookManager);
1510
+ Object.defineProperty(this, "_parent", {
1511
+ enumerable: true,
1512
+ configurable: true,
1513
+ writable: true,
1514
+ value: null
1515
+ });
1516
+ Object.defineProperty(this, "_params", {
1517
+ enumerable: true,
1518
+ configurable: true,
1519
+ writable: true,
1520
+ value: null
1521
+ });
1522
+ Object.defineProperty(this, "_middleware", {
1523
+ enumerable: true,
1524
+ configurable: true,
1525
+ writable: true,
1526
+ value: null
1527
+ });
1528
+ Object.defineProperty(this, "_props", {
1529
+ enumerable: true,
1530
+ configurable: true,
1531
+ writable: true,
1532
+ value: null
1533
+ });
1534
+ Object.defineProperty(this, "_defaults", {
1535
+ enumerable: true,
1536
+ configurable: true,
1537
+ writable: true,
1538
+ value: void 0
1539
+ });
1071
1540
  }
1072
-
1073
- _createClass(Feathers, [{
1074
- key: "get",
1075
- value: function get(name) {
1076
- return this.settings[name];
1077
- }
1078
- }, {
1079
- key: "set",
1080
- value: function set(name, value) {
1081
- this.settings[name] = value;
1541
+ _createClass(HookManager, [{
1542
+ key: "parent",
1543
+ value: function parent(_parent) {
1544
+ this._parent = _parent;
1082
1545
  return this;
1083
1546
  }
1084
1547
  }, {
1085
- key: "configure",
1086
- value: function configure(callback) {
1087
- callback.call(this, this);
1548
+ key: "middleware",
1549
+ value: function middleware(_middleware) {
1550
+ this._middleware = _middleware !== null && _middleware !== void 0 && _middleware.length ? _middleware : null;
1088
1551
  return this;
1089
1552
  }
1090
1553
  }, {
1091
- key: "defaultService",
1092
- value: function defaultService(location) {
1093
- throw new Error("Can not find service '".concat(location, "'"));
1554
+ key: "getMiddleware",
1555
+ value: function getMiddleware() {
1556
+ var _this$_parent;
1557
+ var previous = (_this$_parent = this._parent) === null || _this$_parent === void 0 ? void 0 : _this$_parent.getMiddleware();
1558
+ if (previous && this._middleware) {
1559
+ return previous.concat(this._middleware);
1560
+ }
1561
+ return previous || this._middleware;
1094
1562
  }
1095
1563
  }, {
1096
- key: "service",
1097
- value: function service(location) {
1098
- var path = dependencies_1.stripSlashes(location) || '/';
1099
- var current = this.services[path];
1100
-
1101
- if (typeof current === 'undefined') {
1102
- this.use(path, this.defaultService(path));
1103
- return this.service(path);
1564
+ key: "collectMiddleware",
1565
+ value: function collectMiddleware(self, _args) {
1566
+ var otherMiddleware = getMiddleware(self);
1567
+ var middleware = this.getMiddleware();
1568
+ if (otherMiddleware && middleware) {
1569
+ return otherMiddleware.concat(middleware);
1104
1570
  }
1105
-
1106
- return current;
1571
+ return otherMiddleware || middleware || [];
1107
1572
  }
1108
1573
  }, {
1109
- key: "use",
1110
- value: function use(path, service, options) {
1111
- var _this2 = this;
1112
-
1113
- if (typeof path !== 'string') {
1114
- throw new Error("'".concat(path, "' is not a valid service path."));
1574
+ key: "props",
1575
+ value: function props(_props) {
1576
+ if (!this._props) {
1577
+ this._props = {};
1115
1578
  }
1116
-
1117
- var location = dependencies_1.stripSlashes(path) || '/';
1118
- var subApp = service;
1119
- var isSubApp = typeof subApp.service === 'function' && subApp.services;
1120
-
1121
- if (isSubApp) {
1122
- Object.keys(subApp.services).forEach(function (subPath) {
1123
- return _this2.use("".concat(location, "/").concat(subPath), subApp.service(subPath));
1124
- });
1125
- return this;
1579
+ (0, utils_js_1.copyProperties)(this._props, _props);
1580
+ return this;
1581
+ }
1582
+ }, {
1583
+ key: "getProps",
1584
+ value: function getProps() {
1585
+ var _this$_parent2;
1586
+ var previous = (_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 ? void 0 : _this$_parent2.getProps();
1587
+ if (previous && this._props) {
1588
+ return (0, utils_js_1.copyProperties)({}, previous, this._props);
1126
1589
  }
1127
-
1128
- var protoService = service_1.wrapService(location, service, options);
1129
- var serviceOptions = service_1.getServiceOptions(service, options);
1130
-
1131
- var _iterator = _createForOfIteratorHelper(service_1.protectedMethods),
1132
- _step;
1133
-
1134
- try {
1135
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
1136
- var name = _step.value;
1137
-
1138
- if (serviceOptions.methods.includes(name)) {
1139
- throw new Error("'".concat(name, "' on service '").concat(location, "' is not allowed as a custom method name"));
1140
- }
1141
- }
1142
- } catch (err) {
1143
- _iterator.e(err);
1144
- } finally {
1145
- _iterator.f();
1590
+ return previous || this._props || null;
1591
+ }
1592
+ }, {
1593
+ key: "params",
1594
+ value: function params() {
1595
+ for (var _len = arguments.length, _params = new Array(_len), _key = 0; _key < _len; _key++) {
1596
+ _params[_key] = arguments[_key];
1146
1597
  }
1147
-
1148
- debug("Registering new service at `".concat(location, "`")); // Add all the mixins
1149
-
1150
- this.mixins.forEach(function (fn) {
1151
- return fn.call(_this2, protoService, location, serviceOptions);
1152
- }); // If we ran setup already, set this service up explicitly, this will not `await`
1153
-
1154
- if (this._isSetup && typeof protoService.setup === 'function') {
1155
- debug("Setting up service for `".concat(location, "`"));
1156
- protoService.setup(this, location);
1598
+ this._params = _params;
1599
+ return this;
1600
+ }
1601
+ }, {
1602
+ key: "getParams",
1603
+ value: function getParams() {
1604
+ var _this$_parent3;
1605
+ var previous = (_this$_parent3 = this._parent) === null || _this$_parent3 === void 0 ? void 0 : _this$_parent3.getParams();
1606
+ if (previous && this._params) {
1607
+ return previous.concat(this._params);
1157
1608
  }
1158
-
1159
- this.services[location] = protoService;
1609
+ return previous || this._params;
1610
+ }
1611
+ }, {
1612
+ key: "defaults",
1613
+ value: function defaults(_defaults) {
1614
+ this._defaults = _defaults;
1160
1615
  return this;
1161
1616
  }
1162
1617
  }, {
1163
- key: "hooks",
1164
- value: function hooks(hookMap) {
1165
- var _this3 = this;
1166
-
1167
- var legacyMap = hookMap;
1168
-
1169
- if (legacyMap.before || legacyMap.after || legacyMap.error) {
1170
- return this.legacyHooks(legacyMap);
1618
+ key: "getDefaults",
1619
+ value: function getDefaults(self, args, context) {
1620
+ var _this$_parent4;
1621
+ var defaults = typeof this._defaults === 'function' ? this._defaults(self, args, context) : null;
1622
+ var previous = (_this$_parent4 = this._parent) === null || _this$_parent4 === void 0 ? void 0 : _this$_parent4.getDefaults(self, args, context);
1623
+ if (previous && defaults) {
1624
+ return Object.assign({}, previous, defaults);
1171
1625
  }
1172
-
1173
- if (Array.isArray(hookMap)) {
1174
- var _this$appHooks$depend;
1175
-
1176
- (_this$appHooks$depend = this.appHooks[dependencies_1.HOOKS]).push.apply(_this$appHooks$depend, _toConsumableArray(hookMap));
1177
- } else {
1178
- var methodHookMap = hookMap;
1179
- Object.keys(methodHookMap).forEach(function (key) {
1180
- var methodHooks = _this3.appHooks[key] || [];
1181
- _this3.appHooks[key] = methodHooks.concat(methodHookMap[key]);
1626
+ return previous || defaults;
1627
+ }
1628
+ }, {
1629
+ key: "getContextClass",
1630
+ value: function getContextClass() {
1631
+ var Base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : BaseHookContext;
1632
+ var ContextClass = /*#__PURE__*/function (_Base) {
1633
+ _inherits(ContextClass, _Base);
1634
+ var _super = _createSuper(ContextClass);
1635
+ function ContextClass(data) {
1636
+ _classCallCheck(this, ContextClass);
1637
+ return _super.call(this, data);
1638
+ }
1639
+ return _createClass(ContextClass);
1640
+ }(Base);
1641
+ var params = this.getParams();
1642
+ var props = this.getProps();
1643
+ if (params) {
1644
+ params.forEach(function (name, index) {
1645
+ if ((props === null || props === void 0 ? void 0 : props[name]) !== undefined) {
1646
+ throw new Error("Hooks can not have a property and param named '".concat(name, "'. Use .defaults instead."));
1647
+ }
1648
+ Object.defineProperty(ContextClass.prototype, name, {
1649
+ enumerable: true,
1650
+ get: function get() {
1651
+ return this === null || this === void 0 ? void 0 : this.arguments[index];
1652
+ },
1653
+ set: function set(value) {
1654
+ this.arguments[index] = value;
1655
+ }
1656
+ });
1182
1657
  });
1183
1658
  }
1184
-
1185
- return this;
1659
+ if (props) {
1660
+ (0, utils_js_1.copyProperties)(ContextClass.prototype, props);
1661
+ }
1662
+ return ContextClass;
1186
1663
  }
1187
1664
  }, {
1188
- key: "setup",
1189
- value: function setup() {
1190
- var _this4 = this;
1191
-
1192
- var promise = Promise.resolve(); // Setup each service (pass the app so that they can look up other services etc.)
1193
-
1194
- var _loop = function _loop() {
1195
- var path = _Object$keys[_i];
1196
- promise = promise.then(function () {
1197
- var service = _this4.service(path);
1198
-
1199
- if (typeof service.setup === 'function') {
1200
- debug("Setting up service for `".concat(path, "`"));
1201
- return service.setup(_this4, path);
1665
+ key: "initializeContext",
1666
+ value: function initializeContext(self, args, context) {
1667
+ var ctx = this._parent ? this._parent.initializeContext(self, args, context) : context;
1668
+ var defaults = this.getDefaults(self, args, ctx);
1669
+ if (self) {
1670
+ ctx.self = self;
1671
+ }
1672
+ ctx.arguments = args;
1673
+ if (defaults) {
1674
+ for (var _i = 0, _Object$keys = Object.keys(defaults); _i < _Object$keys.length; _i++) {
1675
+ var name = _Object$keys[_i];
1676
+ if (ctx[name] === undefined) {
1677
+ ctx[name] = defaults[name];
1202
1678
  }
1203
- });
1204
- };
1205
-
1206
- for (var _i = 0, _Object$keys = Object.keys(this.services); _i < _Object$keys.length; _i++) {
1207
- _loop();
1679
+ }
1208
1680
  }
1209
-
1210
- return promise.then(function () {
1211
- _this4._isSetup = true;
1212
- return _this4;
1213
- });
1681
+ return ctx;
1214
1682
  }
1215
1683
  }]);
1216
-
1217
- return Feathers;
1218
- }(dependencies_1.EventEmitter);
1219
-
1220
- exports.Feathers = Feathers;
1221
-
1222
- /***/ }),
1223
-
1224
- /***/ "../feathers/lib/declarations.js":
1225
- /*!***************************************!*\
1226
- !*** ../feathers/lib/declarations.js ***!
1227
- \***************************************/
1228
- /***/ (function(__unused_webpack_module, exports) {
1229
-
1230
-
1231
-
1232
- Object.defineProperty(exports, "__esModule", ({
1233
- value: true
1234
- }));
1235
-
1236
- /***/ }),
1237
-
1238
- /***/ "../feathers/lib/dependencies.js":
1239
- /*!***************************************!*\
1240
- !*** ../feathers/lib/dependencies.js ***!
1241
- \***************************************/
1242
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1243
-
1244
-
1245
-
1246
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1247
- if (k2 === undefined) k2 = k;
1248
- Object.defineProperty(o, k2, {
1249
- enumerable: true,
1250
- get: function get() {
1251
- return m[k];
1252
- }
1253
- });
1254
- } : function (o, m, k, k2) {
1255
- if (k2 === undefined) k2 = k;
1256
- o[k2] = m[k];
1257
- });
1258
-
1259
- var __exportStar = this && this.__exportStar || function (m, exports) {
1260
- for (var p in m) {
1261
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1262
- }
1263
- };
1264
-
1265
- Object.defineProperty(exports, "__esModule", ({
1266
- value: true
1267
- }));
1268
- exports.EventEmitter = void 0;
1269
-
1270
- var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
1271
-
1272
- Object.defineProperty(exports, "EventEmitter", ({
1273
- enumerable: true,
1274
- get: function get() {
1275
- return events_1.EventEmitter;
1276
- }
1277
- }));
1278
-
1279
- __exportStar(__webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"), exports);
1280
-
1281
- __exportStar(__webpack_require__(/*! @feathersjs/hooks */ "../../node_modules/@feathersjs/hooks/lib/index.js"), exports);
1282
-
1283
- /***/ }),
1284
-
1285
- /***/ "../feathers/lib/events.js":
1286
- /*!*********************************!*\
1287
- !*** ../feathers/lib/events.js ***!
1288
- \*********************************/
1289
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1290
-
1291
-
1292
-
1293
- Object.defineProperty(exports, "__esModule", ({
1294
- value: true
1295
- }));
1296
- exports.eventMixin = exports.eventHook = void 0;
1297
-
1298
- var dependencies_1 = __webpack_require__(/*! ./dependencies */ "../feathers/lib/dependencies.js");
1299
-
1300
- var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
1301
-
1302
- function eventHook(context, next) {
1303
- var _service_1$getService = service_1.getServiceOptions(context.self),
1304
- events = _service_1$getService.events;
1305
-
1306
- var defaultEvent = service_1.defaultEventMap[context.method] || null;
1307
- context.event = defaultEvent;
1308
- return next().then(function () {
1309
- // Send the event only if the service does not do so already (indicated in the `events` option)
1310
- // This is used for custom events and for client services receiving event from the server
1311
- if (typeof context.event === 'string' && !events.includes(context.event)) {
1312
- var results = Array.isArray(context.result) ? context.result : [context.result];
1313
- results.forEach(function (element) {
1314
- return context.self.emit(context.event, element, context);
1315
- });
1316
- }
1317
- });
1318
- }
1319
-
1320
- exports.eventHook = eventHook;
1321
-
1322
- function eventMixin(service) {
1323
- var isEmitter = typeof service.on === 'function' && typeof service.emit === 'function';
1324
-
1325
- if (!isEmitter) {
1326
- Object.assign(service, dependencies_1.EventEmitter.prototype);
1684
+ return HookManager;
1685
+ }();
1686
+ exports.HookManager = HookManager;
1687
+ function convertOptions() {
1688
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1689
+ if (!options) {
1690
+ return new HookManager();
1327
1691
  }
1328
-
1329
- return service;
1692
+ return Array.isArray(options) ? new HookManager().middleware(options) : options;
1330
1693
  }
1331
-
1332
- exports.eventMixin = eventMixin;
1333
-
1334
- /***/ }),
1335
-
1336
- /***/ "../feathers/lib/hooks/index.js":
1337
- /*!**************************************!*\
1338
- !*** ../feathers/lib/hooks/index.js ***!
1339
- \**************************************/
1340
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1341
-
1342
-
1343
-
1344
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1345
-
1346
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1347
-
1348
- 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."); }
1349
-
1350
- 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); }
1351
-
1352
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1353
-
1354
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1355
-
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; }
1357
-
1358
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1359
-
1360
- 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); } }
1361
-
1362
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1363
-
1364
- function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } 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(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
1365
-
1366
- function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
1367
-
1368
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
1369
-
1370
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1371
-
1372
- 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); }; }
1373
-
1374
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
1375
-
1376
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1377
-
1378
- 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; } }
1379
-
1380
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1381
-
1382
- Object.defineProperty(exports, "__esModule", ({
1383
- value: true
1384
- }));
1385
- exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.fromErrorHooks = exports.fromBeforeHook = exports.fromAfterHook = void 0;
1386
-
1387
- var dependencies_1 = __webpack_require__(/*! ../dependencies */ "../feathers/lib/dependencies.js");
1388
-
1389
- var service_1 = __webpack_require__(/*! ../service */ "../feathers/lib/service.js");
1390
-
1391
- var legacy_1 = __webpack_require__(/*! ./legacy */ "../feathers/lib/hooks/legacy.js");
1392
-
1393
- Object.defineProperty(exports, "fromAfterHook", ({
1394
- enumerable: true,
1395
- get: function get() {
1396
- return legacy_1.fromAfterHook;
1397
- }
1398
- }));
1399
- Object.defineProperty(exports, "fromBeforeHook", ({
1400
- enumerable: true,
1401
- get: function get() {
1402
- return legacy_1.fromBeforeHook;
1403
- }
1404
- }));
1405
- Object.defineProperty(exports, "fromErrorHooks", ({
1406
- enumerable: true,
1407
- get: function get() {
1408
- return legacy_1.fromErrorHooks;
1409
- }
1410
- }));
1411
-
1412
- function createContext(service, method) {
1413
- var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1414
- var createContext = service[method].createContext;
1415
-
1416
- if (typeof createContext !== 'function') {
1417
- throw new Error("Can not create context for method ".concat(method));
1418
- }
1419
-
1420
- return createContext(data);
1421
- }
1422
-
1423
- exports.createContext = createContext;
1424
-
1425
- var FeathersHookManager = /*#__PURE__*/function (_dependencies_1$HookM) {
1426
- _inherits(FeathersHookManager, _dependencies_1$HookM);
1427
-
1428
- var _super = _createSuper(FeathersHookManager);
1429
-
1430
- function FeathersHookManager(app, method) {
1431
- var _this;
1432
-
1433
- _classCallCheck(this, FeathersHookManager);
1434
-
1435
- _this = _super.call(this);
1436
- _this.app = app;
1437
- _this.method = method;
1438
- _this._middleware = [];
1439
- return _this;
1440
- }
1441
-
1442
- _createClass(FeathersHookManager, [{
1443
- key: "collectMiddleware",
1444
- value: function collectMiddleware(self, args) {
1445
- var app = this.app;
1446
- var appHooks = app.appHooks[dependencies_1.HOOKS].concat(app.appHooks[this.method] || []);
1447
- var legacyAppHooks = legacy_1.collectLegacyHooks(this.app, this.method);
1448
-
1449
- var middleware = _get(_getPrototypeOf(FeathersHookManager.prototype), "collectMiddleware", this).call(this, self, args);
1450
-
1451
- var legacyHooks = legacy_1.collectLegacyHooks(self, this.method);
1452
- return [].concat(_toConsumableArray(appHooks), _toConsumableArray(legacyAppHooks), _toConsumableArray(middleware), _toConsumableArray(legacyHooks));
1453
- }
1454
- }, {
1455
- key: "initializeContext",
1456
- value: function initializeContext(self, args, context) {
1457
- var ctx = _get(_getPrototypeOf(FeathersHookManager.prototype), "initializeContext", this).call(this, self, args, context);
1458
-
1459
- ctx.params = ctx.params || {};
1460
- return ctx;
1461
- }
1462
- }, {
1463
- key: "middleware",
1464
- value: function middleware(mw) {
1465
- var _this$_middleware;
1466
-
1467
- (_this$_middleware = this._middleware).push.apply(_this$_middleware, _toConsumableArray(mw));
1468
-
1469
- return this;
1470
- }
1471
- }]);
1472
-
1473
- return FeathersHookManager;
1474
- }(dependencies_1.HookManager);
1475
-
1476
- exports.FeathersHookManager = FeathersHookManager;
1477
-
1478
- function hookMixin(service, path, options) {
1479
- if (typeof service.hooks === 'function') {
1480
- return service;
1481
- }
1482
-
1483
- var app = this;
1484
- var serviceMethodHooks = service_1.getHookMethods(service, options).reduce(function (res, method) {
1485
- var _FeathersHookManager;
1486
-
1487
- var params = service_1.defaultServiceArguments[method] || ['data', 'params'];
1488
- res[method] = (_FeathersHookManager = new FeathersHookManager(app, method)).params.apply(_FeathersHookManager, _toConsumableArray(params)).props({
1489
- app: app,
1490
- path: path,
1491
- method: method,
1492
- service: service,
1493
- event: null,
1494
- type: null
1495
- });
1496
- return res;
1497
- }, {});
1498
- var handleLegacyHooks = legacy_1.enableLegacyHooks(service);
1499
- dependencies_1.hooks(service, serviceMethodHooks);
1500
-
1501
- service.hooks = function (hookOptions) {
1502
- var _this2 = this;
1503
-
1504
- if (hookOptions.before || hookOptions.after || hookOptions.error) {
1505
- return handleLegacyHooks.call(this, hookOptions);
1506
- }
1507
-
1508
- if (Array.isArray(hookOptions)) {
1509
- return dependencies_1.hooks(this, hookOptions);
1510
- }
1511
-
1512
- Object.keys(hookOptions).forEach(function (method) {
1513
- var manager = dependencies_1.getManager(_this2[method]);
1514
-
1515
- if (!(manager instanceof FeathersHookManager)) {
1516
- throw new Error("Method ".concat(method, " is not a Feathers hooks enabled service method"));
1517
- }
1518
-
1519
- manager.middleware(hookOptions[method]);
1520
- });
1521
- return this;
1522
- };
1523
-
1524
- return service;
1525
- }
1526
-
1527
- exports.hookMixin = hookMixin;
1528
-
1529
- /***/ }),
1530
-
1531
- /***/ "../feathers/lib/hooks/legacy.js":
1532
- /*!***************************************!*\
1533
- !*** ../feathers/lib/hooks/legacy.js ***!
1534
- \***************************************/
1535
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1536
-
1537
-
1538
-
1539
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1540
-
1541
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1542
-
1543
- 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."); }
1544
-
1545
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1546
-
1547
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1548
-
1549
- 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; } } }; }
1550
-
1551
- 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); }
1552
-
1553
- 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; }
1554
-
1555
- Object.defineProperty(exports, "__esModule", ({
1556
- value: true
1557
- }));
1558
- exports.enableLegacyHooks = exports.convertHookData = exports.collectLegacyHooks = exports.fromErrorHooks = exports.fromAfterHook = exports.fromBeforeHook = void 0;
1559
-
1560
- var dependencies_1 = __webpack_require__(/*! ../dependencies */ "../feathers/lib/dependencies.js");
1561
-
1562
- var each = dependencies_1._.each;
1563
-
1564
- function fromBeforeHook(hook) {
1565
- return function (context, next) {
1566
- context.type = 'before';
1567
- return Promise.resolve(hook.call(context.self, context)).then(function () {
1568
- context.type = null;
1569
- return next();
1570
- });
1571
- };
1572
- }
1573
-
1574
- exports.fromBeforeHook = fromBeforeHook;
1575
-
1576
- function fromAfterHook(hook) {
1577
- return function (context, next) {
1578
- return next().then(function () {
1579
- context.type = 'after';
1580
- return hook.call(context.self, context);
1581
- }).then(function () {
1582
- context.type = null;
1583
- });
1584
- };
1585
- }
1586
-
1587
- exports.fromAfterHook = fromAfterHook;
1588
-
1589
- function fromErrorHooks(hooks) {
1590
- return function (context, next) {
1591
- return next().catch(function (error) {
1592
- var promise = Promise.resolve();
1593
- context.original = Object.assign({}, context);
1594
- context.error = error;
1595
- context.type = 'error';
1596
- delete context.result;
1597
-
1598
- var _iterator = _createForOfIteratorHelper(hooks),
1599
- _step;
1600
-
1601
- try {
1602
- var _loop = function _loop() {
1603
- var hook = _step.value;
1604
- promise = promise.then(function () {
1605
- return hook.call(context.self, context);
1606
- });
1607
- };
1608
-
1609
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
1610
- _loop();
1611
- }
1612
- } catch (err) {
1613
- _iterator.e(err);
1614
- } finally {
1615
- _iterator.f();
1616
- }
1617
-
1618
- return promise.then(function () {
1619
- context.type = null;
1620
-
1621
- if (context.result === undefined) {
1622
- throw context.error;
1623
- }
1624
- });
1625
- });
1626
- };
1627
- }
1628
-
1629
- exports.fromErrorHooks = fromErrorHooks;
1630
-
1631
- function collectLegacyHooks(target, method) {
1632
- var _target$__hooks = target.__hooks,
1633
- _target$__hooks$befor = _target$__hooks.before[method],
1634
- before = _target$__hooks$befor === void 0 ? [] : _target$__hooks$befor,
1635
- _target$__hooks$after = _target$__hooks.after[method],
1636
- after = _target$__hooks$after === void 0 ? [] : _target$__hooks$after,
1637
- _target$__hooks$error = _target$__hooks.error[method],
1638
- error = _target$__hooks$error === void 0 ? [] : _target$__hooks$error;
1639
- var beforeHooks = before;
1640
-
1641
- var afterHooks = _toConsumableArray(after).reverse();
1642
-
1643
- var errorHook = fromErrorHooks(error);
1644
- return [errorHook].concat(_toConsumableArray(beforeHooks), _toConsumableArray(afterHooks));
1645
- }
1646
-
1647
- exports.collectLegacyHooks = collectLegacyHooks; // Converts different hook registration formats into the
1648
- // same internal format
1649
-
1650
- function convertHookData(obj) {
1651
- var hook = {};
1652
-
1653
- if (Array.isArray(obj)) {
1654
- hook = {
1655
- all: obj
1656
- };
1657
- } else if (_typeof(obj) !== 'object') {
1658
- hook = {
1659
- all: [obj]
1660
- };
1661
- } else {
1662
- each(obj, function (value, key) {
1663
- hook[key] = !Array.isArray(value) ? [value] : value;
1664
- });
1665
- }
1666
-
1667
- return hook;
1668
- }
1669
-
1670
- exports.convertHookData = convertHookData; // Add `.hooks` functionality to an object
1671
-
1672
- function enableLegacyHooks(obj) {
1673
- var methods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['find', 'get', 'create', 'update', 'patch', 'remove'];
1674
- var types = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['before', 'after', 'error'];
1675
- var hookData = {};
1676
- types.forEach(function (type) {
1677
- // Initialize properties where hook functions are stored
1678
- hookData[type] = {};
1679
- }); // Add non-enumerable `__hooks` property to the object
1680
-
1681
- Object.defineProperty(obj, '__hooks', {
1682
- configurable: true,
1683
- value: hookData,
1684
- writable: true
1685
- });
1686
- return function legacyHooks(allHooks) {
1687
- var _this = this;
1688
-
1689
- each(allHooks, function (current, type) {
1690
- if (!_this.__hooks[type]) {
1691
- throw new Error("'".concat(type, "' is not a valid hook type"));
1692
- }
1693
-
1694
- var hooks = convertHookData(current);
1695
- each(hooks, function (_value, method) {
1696
- if (method !== 'all' && methods.indexOf(method) === -1) {
1697
- throw new Error("'".concat(method, "' is not a valid hook method"));
1698
- }
1699
- });
1700
- methods.forEach(function (method) {
1701
- var _this$__hooks$type$me;
1702
-
1703
- var currentHooks = [].concat(_toConsumableArray(hooks.all || []), _toConsumableArray(hooks[method] || []));
1704
- _this.__hooks[type][method] = _this.__hooks[type][method] || [];
1705
-
1706
- if (type === 'before') {
1707
- currentHooks = currentHooks.map(fromBeforeHook);
1708
- }
1709
-
1710
- if (type === 'after') {
1711
- currentHooks = currentHooks.map(fromAfterHook);
1712
- }
1713
-
1714
- (_this$__hooks$type$me = _this.__hooks[type][method]).push.apply(_this$__hooks$type$me, _toConsumableArray(currentHooks));
1715
- });
1716
- });
1717
- return this;
1718
- };
1719
- }
1720
-
1721
- exports.enableLegacyHooks = enableLegacyHooks;
1722
-
1723
- /***/ }),
1724
-
1725
- /***/ "../feathers/lib/index.js":
1726
- /*!********************************!*\
1727
- !*** ../feathers/lib/index.js ***!
1728
- \********************************/
1729
- /***/ (function(module, exports, __webpack_require__) {
1730
-
1731
-
1732
-
1733
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1734
- if (k2 === undefined) k2 = k;
1735
- Object.defineProperty(o, k2, {
1736
- enumerable: true,
1737
- get: function get() {
1738
- return m[k];
1739
- }
1740
- });
1741
- } : function (o, m, k, k2) {
1742
- if (k2 === undefined) k2 = k;
1743
- o[k2] = m[k];
1744
- });
1745
-
1746
- var __exportStar = this && this.__exportStar || function (m, exports) {
1747
- for (var p in m) {
1748
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1749
- }
1750
- };
1751
-
1752
- var __importDefault = this && this.__importDefault || function (mod) {
1753
- return mod && mod.__esModule ? mod : {
1754
- "default": mod
1755
- };
1756
- };
1757
-
1758
- Object.defineProperty(exports, "__esModule", ({
1759
- value: true
1760
- }));
1761
- exports.Feathers = exports.version = exports.feathers = void 0;
1762
-
1763
- var dependencies_1 = __webpack_require__(/*! ./dependencies */ "../feathers/lib/dependencies.js");
1764
-
1765
- var version_1 = __importDefault(__webpack_require__(/*! ./version */ "../feathers/lib/version.js"));
1766
-
1767
- exports.version = version_1.default;
1768
-
1769
- var application_1 = __webpack_require__(/*! ./application */ "../feathers/lib/application.js");
1770
-
1771
- Object.defineProperty(exports, "Feathers", ({
1772
- enumerable: true,
1773
- get: function get() {
1774
- return application_1.Feathers;
1775
- }
1776
- }));
1777
-
1778
- function feathers() {
1779
- return new application_1.Feathers();
1780
- }
1781
-
1782
- exports.feathers = feathers;
1783
- feathers.setDebug = dependencies_1.setDebug;
1784
-
1785
- __exportStar(__webpack_require__(/*! ./hooks/index */ "../feathers/lib/hooks/index.js"), exports);
1786
-
1787
- __exportStar(__webpack_require__(/*! ./declarations */ "../feathers/lib/declarations.js"), exports);
1788
-
1789
- __exportStar(__webpack_require__(/*! ./service */ "../feathers/lib/service.js"), exports);
1790
-
1791
- if (true) {
1792
- module.exports = Object.assign(feathers, module.exports);
1793
- }
1794
-
1795
- /***/ }),
1796
-
1797
- /***/ "../feathers/lib/service.js":
1798
- /*!**********************************!*\
1799
- !*** ../feathers/lib/service.js ***!
1800
- \**********************************/
1801
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1802
-
1803
-
1804
-
1805
- Object.defineProperty(exports, "__esModule", ({
1806
- value: true
1807
- }));
1808
- exports.wrapService = exports.getServiceOptions = exports.getHookMethods = exports.protectedMethods = exports.defaultEventMap = exports.defaultServiceMethods = exports.defaultServiceArguments = exports.SERVICE = void 0;
1809
-
1810
- var dependencies_1 = __webpack_require__(/*! ./dependencies */ "../feathers/lib/dependencies.js");
1811
-
1812
- exports.SERVICE = dependencies_1.createSymbol('@feathersjs/service');
1813
- exports.defaultServiceArguments = {
1814
- find: ['params'],
1815
- get: ['id', 'params'],
1816
- create: ['data', 'params'],
1817
- update: ['id', 'data', 'params'],
1818
- patch: ['id', 'data', 'params'],
1819
- remove: ['id', 'params']
1820
- };
1821
- exports.defaultServiceMethods = Object.keys(exports.defaultServiceArguments);
1822
- exports.defaultEventMap = {
1823
- create: 'created',
1824
- update: 'updated',
1825
- patch: 'patched',
1826
- remove: 'removed'
1827
- };
1828
- exports.protectedMethods = Object.keys(Object.prototype).concat(Object.keys(dependencies_1.EventEmitter.prototype)).concat(['before', 'after', 'error', 'hooks', 'setup', 'publish']);
1829
-
1830
- function getHookMethods(service, options) {
1831
- var methods = options.methods;
1832
- return exports.defaultServiceMethods.filter(function (m) {
1833
- return typeof service[m] === 'function' && !methods.includes(m);
1834
- }).concat(methods);
1835
- }
1836
-
1837
- exports.getHookMethods = getHookMethods;
1838
-
1839
- function getServiceOptions(service) {
1840
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1841
- var existingOptions = service[exports.SERVICE];
1842
-
1843
- if (existingOptions) {
1844
- return existingOptions;
1845
- }
1846
-
1847
- var _options$methods = options.methods,
1848
- methods = _options$methods === void 0 ? exports.defaultServiceMethods.filter(function (method) {
1849
- return typeof service[method] === 'function';
1850
- }) : _options$methods,
1851
- _options$events = options.events,
1852
- events = _options$events === void 0 ? service.events || [] : _options$events;
1853
- var _options$serviceEvent = options.serviceEvents,
1854
- serviceEvents = _options$serviceEvent === void 0 ? Object.values(exports.defaultEventMap).concat(events) : _options$serviceEvent;
1855
- return Object.assign(Object.assign({}, options), {
1856
- events: events,
1857
- methods: methods,
1858
- serviceEvents: serviceEvents
1859
- });
1860
- }
1861
-
1862
- exports.getServiceOptions = getServiceOptions;
1863
-
1864
- function wrapService(location, service, options) {
1865
- // Do nothing if this is already an initialized
1866
- if (service[exports.SERVICE]) {
1867
- return service;
1868
- }
1869
-
1870
- var protoService = Object.create(service);
1871
- var serviceOptions = getServiceOptions(service, options);
1872
-
1873
- if (Object.keys(serviceOptions.methods).length === 0 && typeof service.setup !== 'function') {
1874
- throw new Error("Invalid service object passed for path `".concat(location, "`"));
1875
- }
1876
-
1877
- Object.defineProperty(protoService, exports.SERVICE, {
1878
- value: serviceOptions
1879
- });
1880
- return protoService;
1881
- }
1882
-
1883
- exports.wrapService = wrapService;
1884
-
1885
- /***/ }),
1886
-
1887
- /***/ "../feathers/lib/version.js":
1888
- /*!**********************************!*\
1889
- !*** ../feathers/lib/version.js ***!
1890
- \**********************************/
1891
- /***/ (function(__unused_webpack_module, exports) {
1892
-
1893
-
1894
-
1895
- Object.defineProperty(exports, "__esModule", ({
1896
- value: true
1897
- }));
1898
- exports.default = 'development';
1899
-
1900
- /***/ }),
1901
-
1902
- /***/ "../../node_modules/events/events.js":
1903
- /*!*******************************************!*\
1904
- !*** ../../node_modules/events/events.js ***!
1905
- \*******************************************/
1906
- /***/ (function(module) {
1907
-
1908
- // Copyright Joyent, Inc. and other Node contributors.
1909
- //
1910
- // Permission is hereby granted, free of charge, to any person obtaining a
1911
- // copy of this software and associated documentation files (the
1912
- // "Software"), to deal in the Software without restriction, including
1913
- // without limitation the rights to use, copy, modify, merge, publish,
1914
- // distribute, sublicense, and/or sell copies of the Software, and to permit
1915
- // persons to whom the Software is furnished to do so, subject to the
1916
- // following conditions:
1917
- //
1918
- // The above copyright notice and this permission notice shall be included
1919
- // in all copies or substantial portions of the Software.
1920
- //
1921
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1922
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1923
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1924
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1925
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1926
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1927
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
1928
-
1929
-
1930
-
1931
- var R = typeof Reflect === 'object' ? Reflect : null
1932
- var ReflectApply = R && typeof R.apply === 'function'
1933
- ? R.apply
1934
- : function ReflectApply(target, receiver, args) {
1935
- return Function.prototype.apply.call(target, receiver, args);
1936
- }
1937
-
1938
- var ReflectOwnKeys
1939
- if (R && typeof R.ownKeys === 'function') {
1940
- ReflectOwnKeys = R.ownKeys
1941
- } else if (Object.getOwnPropertySymbols) {
1942
- ReflectOwnKeys = function ReflectOwnKeys(target) {
1943
- return Object.getOwnPropertyNames(target)
1944
- .concat(Object.getOwnPropertySymbols(target));
1945
- };
1946
- } else {
1947
- ReflectOwnKeys = function ReflectOwnKeys(target) {
1948
- return Object.getOwnPropertyNames(target);
1949
- };
1950
- }
1951
-
1952
- function ProcessEmitWarning(warning) {
1953
- if (console && console.warn) console.warn(warning);
1954
- }
1955
-
1956
- var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
1957
- return value !== value;
1958
- }
1959
-
1960
- function EventEmitter() {
1961
- EventEmitter.init.call(this);
1962
- }
1963
- module.exports = EventEmitter;
1964
- module.exports.once = once;
1965
-
1966
- // Backwards-compat with node 0.10.x
1967
- EventEmitter.EventEmitter = EventEmitter;
1968
-
1969
- EventEmitter.prototype._events = undefined;
1970
- EventEmitter.prototype._eventsCount = 0;
1971
- EventEmitter.prototype._maxListeners = undefined;
1972
-
1973
- // By default EventEmitters will print a warning if more than 10 listeners are
1974
- // added to it. This is a useful default which helps finding memory leaks.
1975
- var defaultMaxListeners = 10;
1976
-
1977
- function checkListener(listener) {
1978
- if (typeof listener !== 'function') {
1979
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
1980
- }
1981
- }
1982
-
1983
- Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
1984
- enumerable: true,
1985
- get: function() {
1986
- return defaultMaxListeners;
1987
- },
1988
- set: function(arg) {
1989
- if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
1990
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
1991
- }
1992
- defaultMaxListeners = arg;
1993
- }
1994
- });
1995
-
1996
- EventEmitter.init = function() {
1997
-
1998
- if (this._events === undefined ||
1999
- this._events === Object.getPrototypeOf(this)._events) {
2000
- this._events = Object.create(null);
2001
- this._eventsCount = 0;
2002
- }
2003
-
2004
- this._maxListeners = this._maxListeners || undefined;
2005
- };
2006
-
2007
- // Obviously not all Emitters should be limited to 10. This function allows
2008
- // that to be increased. Set to zero for unlimited.
2009
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
2010
- if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
2011
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
2012
- }
2013
- this._maxListeners = n;
2014
- return this;
2015
- };
2016
-
2017
- function _getMaxListeners(that) {
2018
- if (that._maxListeners === undefined)
2019
- return EventEmitter.defaultMaxListeners;
2020
- return that._maxListeners;
2021
- }
2022
-
2023
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
2024
- return _getMaxListeners(this);
2025
- };
2026
-
2027
- EventEmitter.prototype.emit = function emit(type) {
2028
- var args = [];
2029
- for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
2030
- var doError = (type === 'error');
2031
-
2032
- var events = this._events;
2033
- if (events !== undefined)
2034
- doError = (doError && events.error === undefined);
2035
- else if (!doError)
2036
- return false;
2037
-
2038
- // If there is no 'error' event listener then throw.
2039
- if (doError) {
2040
- var er;
2041
- if (args.length > 0)
2042
- er = args[0];
2043
- if (er instanceof Error) {
2044
- // Note: The comments on the `throw` lines are intentional, they show
2045
- // up in Node's output if this results in an unhandled exception.
2046
- throw er; // Unhandled 'error' event
2047
- }
2048
- // At least give some kind of context to the user
2049
- var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
2050
- err.context = er;
2051
- throw err; // Unhandled 'error' event
2052
- }
2053
-
2054
- var handler = events[type];
2055
-
2056
- if (handler === undefined)
2057
- return false;
2058
-
2059
- if (typeof handler === 'function') {
2060
- ReflectApply(handler, this, args);
2061
- } else {
2062
- var len = handler.length;
2063
- var listeners = arrayClone(handler, len);
2064
- for (var i = 0; i < len; ++i)
2065
- ReflectApply(listeners[i], this, args);
2066
- }
2067
-
2068
- return true;
2069
- };
2070
-
2071
- function _addListener(target, type, listener, prepend) {
2072
- var m;
2073
- var events;
2074
- var existing;
2075
-
2076
- checkListener(listener);
2077
-
2078
- events = target._events;
2079
- if (events === undefined) {
2080
- events = target._events = Object.create(null);
2081
- target._eventsCount = 0;
2082
- } else {
2083
- // To avoid recursion in the case that type === "newListener"! Before
2084
- // adding it to the listeners, first emit "newListener".
2085
- if (events.newListener !== undefined) {
2086
- target.emit('newListener', type,
2087
- listener.listener ? listener.listener : listener);
2088
-
2089
- // Re-assign `events` because a newListener handler could have caused the
2090
- // this._events to be assigned to a new object
2091
- events = target._events;
2092
- }
2093
- existing = events[type];
2094
- }
2095
-
2096
- if (existing === undefined) {
2097
- // Optimize the case of one listener. Don't need the extra array object.
2098
- existing = events[type] = listener;
2099
- ++target._eventsCount;
2100
- } else {
2101
- if (typeof existing === 'function') {
2102
- // Adding the second element, need to change to array.
2103
- existing = events[type] =
2104
- prepend ? [listener, existing] : [existing, listener];
2105
- // If we've already got an array, just append.
2106
- } else if (prepend) {
2107
- existing.unshift(listener);
2108
- } else {
2109
- existing.push(listener);
2110
- }
2111
-
2112
- // Check for listener leak
2113
- m = _getMaxListeners(target);
2114
- if (m > 0 && existing.length > m && !existing.warned) {
2115
- existing.warned = true;
2116
- // No error code for this since it is a Warning
2117
- // eslint-disable-next-line no-restricted-syntax
2118
- var w = new Error('Possible EventEmitter memory leak detected. ' +
2119
- existing.length + ' ' + String(type) + ' listeners ' +
2120
- 'added. Use emitter.setMaxListeners() to ' +
2121
- 'increase limit');
2122
- w.name = 'MaxListenersExceededWarning';
2123
- w.emitter = target;
2124
- w.type = type;
2125
- w.count = existing.length;
2126
- ProcessEmitWarning(w);
2127
- }
2128
- }
2129
-
1694
+ exports.convertOptions = convertOptions;
1695
+ function getManager(target) {
1696
+ return target && target[exports.HOOKS] || null;
1697
+ }
1698
+ exports.getManager = getManager;
1699
+ function setManager(target, manager) {
1700
+ var parent = getManager(target);
1701
+ target[exports.HOOKS] = manager.parent(parent);
2130
1702
  return target;
2131
1703
  }
2132
-
2133
- EventEmitter.prototype.addListener = function addListener(type, listener) {
2134
- return _addListener(this, type, listener, false);
2135
- };
2136
-
2137
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
2138
-
2139
- EventEmitter.prototype.prependListener =
2140
- function prependListener(type, listener) {
2141
- return _addListener(this, type, listener, true);
2142
- };
2143
-
2144
- function onceWrapper() {
2145
- if (!this.fired) {
2146
- this.target.removeListener(this.type, this.wrapFn);
2147
- this.fired = true;
2148
- if (arguments.length === 0)
2149
- return this.listener.call(this.target);
2150
- return this.listener.apply(this.target, arguments);
2151
- }
1704
+ exports.setManager = setManager;
1705
+ function getMiddleware(target) {
1706
+ var manager = getManager(target);
1707
+ return manager ? manager.getMiddleware() : null;
2152
1708
  }
2153
-
2154
- function _onceWrap(target, type, listener) {
2155
- var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
2156
- var wrapped = onceWrapper.bind(state);
2157
- wrapped.listener = listener;
2158
- state.wrapFn = wrapped;
2159
- return wrapped;
1709
+ exports.getMiddleware = getMiddleware;
1710
+ function setMiddleware(target, middleware) {
1711
+ var manager = new HookManager().middleware(middleware);
1712
+ return setManager(target, manager);
2160
1713
  }
1714
+ exports.setMiddleware = setMiddleware;
2161
1715
 
2162
- EventEmitter.prototype.once = function once(type, listener) {
2163
- checkListener(listener);
2164
- this.on(type, _onceWrap(this, type, listener));
2165
- return this;
2166
- };
2167
-
2168
- EventEmitter.prototype.prependOnceListener =
2169
- function prependOnceListener(type, listener) {
2170
- checkListener(listener);
2171
- this.prependListener(type, _onceWrap(this, type, listener));
2172
- return this;
2173
- };
2174
-
2175
- // Emits a 'removeListener' event if and only if the listener was removed.
2176
- EventEmitter.prototype.removeListener =
2177
- function removeListener(type, listener) {
2178
- var list, events, position, i, originalListener;
2179
-
2180
- checkListener(listener);
2181
-
2182
- events = this._events;
2183
- if (events === undefined)
2184
- return this;
2185
-
2186
- list = events[type];
2187
- if (list === undefined)
2188
- return this;
2189
-
2190
- if (list === listener || list.listener === listener) {
2191
- if (--this._eventsCount === 0)
2192
- this._events = Object.create(null);
2193
- else {
2194
- delete events[type];
2195
- if (events.removeListener)
2196
- this.emit('removeListener', type, list.listener || listener);
2197
- }
2198
- } else if (typeof list !== 'function') {
2199
- position = -1;
2200
-
2201
- for (i = list.length - 1; i >= 0; i--) {
2202
- if (list[i] === listener || list[i].listener === listener) {
2203
- originalListener = list[i].listener;
2204
- position = i;
2205
- break;
2206
- }
2207
- }
1716
+ /***/ }),
2208
1717
 
2209
- if (position < 0)
2210
- return this;
1718
+ /***/ "../../node_modules/@feathersjs/hooks/script/compose.js":
1719
+ /*!**************************************************************!*\
1720
+ !*** ../../node_modules/@feathersjs/hooks/script/compose.js ***!
1721
+ \**************************************************************/
1722
+ /***/ (function(__unused_webpack_module, exports) {
2211
1723
 
2212
- if (position === 0)
2213
- list.shift();
2214
- else {
2215
- spliceOne(list, position);
2216
- }
2217
1724
 
2218
- if (list.length === 1)
2219
- events[type] = list[0];
2220
1725
 
2221
- if (events.removeListener !== undefined)
2222
- this.emit('removeListener', type, originalListener || listener);
1726
+ 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; } } }; }
1727
+ 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); }
1728
+ 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; }
1729
+ Object.defineProperty(exports, "__esModule", ({
1730
+ value: true
1731
+ }));
1732
+ exports.compose = void 0;
1733
+ function compose(middleware) {
1734
+ if (!Array.isArray(middleware)) {
1735
+ throw new TypeError('Middleware stack must be an array!');
1736
+ }
1737
+ var _iterator = _createForOfIteratorHelper(middleware),
1738
+ _step;
1739
+ try {
1740
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1741
+ var fn = _step.value;
1742
+ if (typeof fn !== 'function') {
1743
+ throw new TypeError('Middleware must be composed of functions!');
2223
1744
  }
2224
-
2225
- return this;
2226
- };
2227
-
2228
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
2229
-
2230
- EventEmitter.prototype.removeAllListeners =
2231
- function removeAllListeners(type) {
2232
- var listeners, events, i;
2233
-
2234
- events = this._events;
2235
- if (events === undefined)
2236
- return this;
2237
-
2238
- // not listening for removeListener, no need to emit
2239
- if (events.removeListener === undefined) {
2240
- if (arguments.length === 0) {
2241
- this._events = Object.create(null);
2242
- this._eventsCount = 0;
2243
- } else if (events[type] !== undefined) {
2244
- if (--this._eventsCount === 0)
2245
- this._events = Object.create(null);
2246
- else
2247
- delete events[type];
2248
- }
2249
- return this;
1745
+ }
1746
+ } catch (err) {
1747
+ _iterator.e(err);
1748
+ } finally {
1749
+ _iterator.f();
1750
+ }
1751
+ return function (context, next) {
1752
+ // last called middleware #
1753
+ var index = -1;
1754
+ return dispatch.call(this, 0);
1755
+ function dispatch(i) {
1756
+ if (i <= index) {
1757
+ return Promise.reject(new Error('next() called multiple times'));
2250
1758
  }
2251
-
2252
- // emit removeListener for all listeners on all events
2253
- if (arguments.length === 0) {
2254
- var keys = Object.keys(events);
2255
- var key;
2256
- for (i = 0; i < keys.length; ++i) {
2257
- key = keys[i];
2258
- if (key === 'removeListener') continue;
2259
- this.removeAllListeners(key);
2260
- }
2261
- this.removeAllListeners('removeListener');
2262
- this._events = Object.create(null);
2263
- this._eventsCount = 0;
2264
- return this;
1759
+ index = i;
1760
+ var fn = middleware[i];
1761
+ if (i === middleware.length) {
1762
+ fn = next;
2265
1763
  }
2266
-
2267
- listeners = events[type];
2268
-
2269
- if (typeof listeners === 'function') {
2270
- this.removeListener(type, listeners);
2271
- } else if (listeners !== undefined) {
2272
- // LIFO order
2273
- for (i = listeners.length - 1; i >= 0; i--) {
2274
- this.removeListener(type, listeners[i]);
2275
- }
1764
+ if (!fn) {
1765
+ return Promise.resolve();
2276
1766
  }
1767
+ try {
1768
+ return Promise.resolve(fn.call(this, context, dispatch.bind(this, i + 1)));
1769
+ } catch (err) {
1770
+ return Promise.reject(err);
1771
+ }
1772
+ }
1773
+ };
1774
+ }
1775
+ exports.compose = compose;
2277
1776
 
2278
- return this;
2279
- };
2280
-
2281
- function _listeners(target, type, unwrap) {
2282
- var events = target._events;
1777
+ /***/ }),
2283
1778
 
2284
- if (events === undefined)
2285
- return [];
1779
+ /***/ "../../node_modules/@feathersjs/hooks/script/hooks.js":
1780
+ /*!************************************************************!*\
1781
+ !*** ../../node_modules/@feathersjs/hooks/script/hooks.js ***!
1782
+ \************************************************************/
1783
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2286
1784
 
2287
- var evlistener = events[type];
2288
- if (evlistener === undefined)
2289
- return [];
2290
1785
 
2291
- if (typeof evlistener === 'function')
2292
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
2293
1786
 
2294
- return unwrap ?
2295
- unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
1787
+ Object.defineProperty(exports, "__esModule", ({
1788
+ value: true
1789
+ }));
1790
+ exports.hookDecorator = exports.objectHooks = exports.functionHooks = exports.getOriginal = void 0;
1791
+ var compose_js_1 = __webpack_require__(/*! ./compose.js */ "../../node_modules/@feathersjs/hooks/script/compose.js");
1792
+ var base_js_1 = __webpack_require__(/*! ./base.js */ "../../node_modules/@feathersjs/hooks/script/base.js");
1793
+ var utils_js_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@feathersjs/hooks/script/utils.js");
1794
+ function getOriginal(fn) {
1795
+ return typeof fn.original === 'function' ? getOriginal(fn.original) : fn;
1796
+ }
1797
+ exports.getOriginal = getOriginal;
1798
+ function functionHooks(fn, managerOrMiddleware) {
1799
+ if (typeof fn !== 'function') {
1800
+ throw new Error('Can not apply hooks to non-function');
1801
+ }
1802
+ var manager = (0, base_js_1.convertOptions)(managerOrMiddleware);
1803
+ var wrapper = function wrapper() {
1804
+ var _this = this;
1805
+ var Context = wrapper.Context,
1806
+ original = wrapper.original;
1807
+ // If we got passed an existing HookContext instance, we want to return it as well
1808
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1809
+ args[_key] = arguments[_key];
1810
+ }
1811
+ var returnContext = args[args.length - 1] instanceof Context;
1812
+ // Use existing context or default
1813
+ var base = returnContext ? args.pop() : new Context();
1814
+ // Initialize the context
1815
+ var context = manager.initializeContext(this, args, base);
1816
+ // Assemble the hook chain
1817
+ var hookChain = [
1818
+ // Return `ctx.result` or the context
1819
+ function (ctx, next) {
1820
+ return next().then(function () {
1821
+ return returnContext ? ctx : ctx.result;
1822
+ });
1823
+ }];
1824
+ // Create the hook chain by calling the `collectMiddleware function
1825
+ var mw = manager.collectMiddleware(this, args);
1826
+ if (mw) {
1827
+ Array.prototype.push.apply(hookChain, mw);
1828
+ }
1829
+ // Runs the actual original method if `ctx.result` is not already set
1830
+ hookChain.push(function (ctx, next) {
1831
+ if (!Object.prototype.hasOwnProperty.call(context, 'result')) {
1832
+ return Promise.resolve(original.apply(_this, ctx.arguments)).then(function (result) {
1833
+ ctx.result = result;
1834
+ return next();
1835
+ });
1836
+ }
1837
+ return next();
1838
+ });
1839
+ return (0, compose_js_1.compose)(hookChain).call(this, context);
1840
+ };
1841
+ (0, utils_js_1.copyFnProperties)(wrapper, fn);
1842
+ (0, utils_js_1.copyProperties)(wrapper, fn);
1843
+ (0, base_js_1.setManager)(wrapper, manager);
1844
+ return Object.assign(wrapper, {
1845
+ original: getOriginal(fn),
1846
+ Context: manager.getContextClass(),
1847
+ createContext: function createContext() {
1848
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1849
+ return new wrapper.Context(data);
1850
+ }
1851
+ });
1852
+ }
1853
+ exports.functionHooks = functionHooks;
1854
+ function objectHooks(obj, hooks) {
1855
+ if (Array.isArray(hooks)) {
1856
+ return (0, base_js_1.setMiddleware)(obj, hooks);
1857
+ }
1858
+ for (var _i = 0, _Object$keys = Object.keys(hooks); _i < _Object$keys.length; _i++) {
1859
+ var method = _Object$keys[_i];
1860
+ var target = typeof obj[method] === 'function' ? obj : obj.prototype;
1861
+ var fn = target && target[method];
1862
+ if (typeof fn !== 'function') {
1863
+ throw new Error("Can not apply hooks. '".concat(method, "' is not a function"));
1864
+ }
1865
+ var manager = (0, base_js_1.convertOptions)(hooks[method]);
1866
+ target[method] = functionHooks(fn, manager.props({
1867
+ method: method
1868
+ }));
1869
+ }
1870
+ return obj;
2296
1871
  }
2297
-
2298
- EventEmitter.prototype.listeners = function listeners(type) {
2299
- return _listeners(this, type, true);
1872
+ exports.objectHooks = objectHooks;
1873
+ var hookDecorator = function hookDecorator(managerOrMiddleware) {
1874
+ var wrapper = function wrapper(_target, method, descriptor) {
1875
+ var manager = (0, base_js_1.convertOptions)(managerOrMiddleware);
1876
+ if (!descriptor) {
1877
+ (0, base_js_1.setManager)(_target.prototype, manager);
1878
+ return _target;
1879
+ }
1880
+ var fn = descriptor.value;
1881
+ if (typeof fn !== 'function') {
1882
+ throw new Error("Can not apply hooks. '".concat(method, "' is not a function"));
1883
+ }
1884
+ descriptor.value = functionHooks(fn, manager.props({
1885
+ method: method
1886
+ }));
1887
+ return descriptor;
1888
+ };
1889
+ return wrapper;
2300
1890
  };
1891
+ exports.hookDecorator = hookDecorator;
2301
1892
 
2302
- EventEmitter.prototype.rawListeners = function rawListeners(type) {
2303
- return _listeners(this, type, false);
2304
- };
1893
+ /***/ }),
2305
1894
 
2306
- EventEmitter.listenerCount = function(emitter, type) {
2307
- if (typeof emitter.listenerCount === 'function') {
2308
- return emitter.listenerCount(type);
2309
- } else {
2310
- return listenerCount.call(emitter, type);
2311
- }
2312
- };
1895
+ /***/ "../../node_modules/@feathersjs/hooks/script/index.js":
1896
+ /*!************************************************************!*\
1897
+ !*** ../../node_modules/@feathersjs/hooks/script/index.js ***!
1898
+ \************************************************************/
1899
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2313
1900
 
2314
- EventEmitter.prototype.listenerCount = listenerCount;
2315
- function listenerCount(type) {
2316
- var events = this._events;
2317
1901
 
2318
- if (events !== undefined) {
2319
- var evlistener = events[type];
2320
1902
 
2321
- if (typeof evlistener === 'function') {
2322
- return 1;
2323
- } else if (evlistener !== undefined) {
2324
- return evlistener.length;
1903
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1904
+ 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."); }
1905
+ 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); }
1906
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1907
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1908
+ 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; }
1909
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1910
+ if (k2 === undefined) k2 = k;
1911
+ Object.defineProperty(o, k2, {
1912
+ enumerable: true,
1913
+ get: function get() {
1914
+ return m[k];
1915
+ }
1916
+ });
1917
+ } : function (o, m, k, k2) {
1918
+ if (k2 === undefined) k2 = k;
1919
+ o[k2] = m[k];
1920
+ });
1921
+ var __exportStar = this && this.__exportStar || function (m, exports) {
1922
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1923
+ };
1924
+ Object.defineProperty(exports, "__esModule", ({
1925
+ value: true
1926
+ }));
1927
+ exports.hooks = exports.middleware = void 0;
1928
+ var base_js_1 = __webpack_require__(/*! ./base.js */ "../../node_modules/@feathersjs/hooks/script/base.js");
1929
+ var hooks_js_1 = __webpack_require__(/*! ./hooks.js */ "../../node_modules/@feathersjs/hooks/script/hooks.js");
1930
+ __exportStar(__webpack_require__(/*! ./hooks.js */ "../../node_modules/@feathersjs/hooks/script/hooks.js"), exports);
1931
+ __exportStar(__webpack_require__(/*! ./compose.js */ "../../node_modules/@feathersjs/hooks/script/compose.js"), exports);
1932
+ __exportStar(__webpack_require__(/*! ./base.js */ "../../node_modules/@feathersjs/hooks/script/base.js"), exports);
1933
+ __exportStar(__webpack_require__(/*! ./regular.js */ "../../node_modules/@feathersjs/hooks/script/regular.js"), exports);
1934
+ /**
1935
+ * Initializes a hook settings object with the given middleware.
1936
+ * @param mw The list of middleware
1937
+ * @param options Middleware options (params, default, props)
1938
+ */
1939
+ function middleware(mw, options) {
1940
+ var manager = new base_js_1.HookManager().middleware(mw);
1941
+ if (options) {
1942
+ if (options.params) {
1943
+ manager.params.apply(manager, _toConsumableArray(options.params));
1944
+ }
1945
+ if (options.defaults) {
1946
+ manager.defaults(options.defaults);
1947
+ }
1948
+ if (options.props) {
1949
+ manager.props(options.props);
2325
1950
  }
2326
1951
  }
2327
-
2328
- return 0;
1952
+ return manager;
2329
1953
  }
2330
-
2331
- EventEmitter.prototype.eventNames = function eventNames() {
2332
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
2333
- };
2334
-
2335
- function arrayClone(arr, n) {
2336
- var copy = new Array(n);
2337
- for (var i = 0; i < n; ++i)
2338
- copy[i] = arr[i];
2339
- return copy;
1954
+ exports.middleware = middleware;
1955
+ // Fallthrough to actual implementation
1956
+ function hooks() {
1957
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1958
+ args[_key] = arguments[_key];
1959
+ }
1960
+ var target = args[0],
1961
+ _hooks = args[1];
1962
+ if (typeof target === 'function' && (_hooks instanceof base_js_1.HookManager || Array.isArray(_hooks) || args.length === 1)) {
1963
+ return (0, hooks_js_1.functionHooks)(target, _hooks);
1964
+ }
1965
+ if (args.length === 2) {
1966
+ return (0, hooks_js_1.objectHooks)(target, _hooks);
1967
+ }
1968
+ return (0, hooks_js_1.hookDecorator)(target);
2340
1969
  }
1970
+ exports.hooks = hooks;
2341
1971
 
2342
- function spliceOne(list, index) {
2343
- for (; index + 1 < list.length; index++)
2344
- list[index] = list[index + 1];
2345
- list.pop();
2346
- }
1972
+ /***/ }),
2347
1973
 
2348
- function unwrapListeners(arr) {
2349
- var ret = new Array(arr.length);
2350
- for (var i = 0; i < ret.length; ++i) {
2351
- ret[i] = arr[i].listener || arr[i];
2352
- }
2353
- return ret;
2354
- }
1974
+ /***/ "../../node_modules/@feathersjs/hooks/script/regular.js":
1975
+ /*!**************************************************************!*\
1976
+ !*** ../../node_modules/@feathersjs/hooks/script/regular.js ***!
1977
+ \**************************************************************/
1978
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2355
1979
 
2356
- function once(emitter, name) {
2357
- return new Promise(function (resolve, reject) {
2358
- function errorListener(err) {
2359
- emitter.removeListener(name, resolver);
2360
- reject(err);
2361
- }
2362
1980
 
2363
- function resolver() {
2364
- if (typeof emitter.removeListener === 'function') {
2365
- emitter.removeListener('error', errorListener);
2366
- }
2367
- resolve([].slice.call(arguments));
2368
- };
2369
1981
 
2370
- eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
2371
- if (name !== 'error') {
2372
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
1982
+ 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); }
1983
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1984
+ 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."); }
1985
+ 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); }
1986
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1987
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1988
+ 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; }
1989
+ 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; }
1990
+ 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; }
1991
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1992
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
1993
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1994
+ Object.defineProperty(exports, "__esModule", ({
1995
+ value: true
1996
+ }));
1997
+ exports.collect = exports.fromErrorHook = exports.fromAfterHook = exports.fromBeforeHook = exports.runHooks = exports.runHook = void 0;
1998
+ var compose_js_1 = __webpack_require__(/*! ./compose.js */ "../../node_modules/@feathersjs/hooks/script/compose.js");
1999
+ var runHook = function runHook(hook, context, type) {
2000
+ var typeBefore = context.type;
2001
+ if (type) context.type = type;
2002
+ return Promise.resolve(hook.call(context.self, context)).then(function (res) {
2003
+ if (type) context.type = typeBefore;
2004
+ if (res && res !== context) {
2005
+ Object.assign(context, res);
2373
2006
  }
2374
2007
  });
2008
+ };
2009
+ exports.runHook = runHook;
2010
+ var runHooks = function runHooks(hooks) {
2011
+ return function (context) {
2012
+ return hooks.reduce(function (promise, hook) {
2013
+ return promise.then(function () {
2014
+ return (0, exports.runHook)(hook, context);
2015
+ });
2016
+ }, Promise.resolve(context));
2017
+ };
2018
+ };
2019
+ exports.runHooks = runHooks;
2020
+ function fromBeforeHook(hook) {
2021
+ return function (context, next) {
2022
+ return (0, exports.runHook)(hook, context, 'before').then(next);
2023
+ };
2375
2024
  }
2376
-
2377
- function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
2378
- if (typeof emitter.on === 'function') {
2379
- eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
2380
- }
2025
+ exports.fromBeforeHook = fromBeforeHook;
2026
+ function fromAfterHook(hook) {
2027
+ return function (context, next) {
2028
+ return next().then(function () {
2029
+ return (0, exports.runHook)(hook, context, 'after');
2030
+ });
2031
+ };
2381
2032
  }
2382
-
2383
- function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
2384
- if (typeof emitter.on === 'function') {
2385
- if (flags.once) {
2386
- emitter.once(name, listener);
2387
- } else {
2388
- emitter.on(name, listener);
2389
- }
2390
- } else if (typeof emitter.addEventListener === 'function') {
2391
- // EventTarget does not have `error` event semantics like Node
2392
- // EventEmitters, we do not listen for `error` events here.
2393
- emitter.addEventListener(name, function wrapListener(arg) {
2394
- // IE does not have builtin `{ once: true }` support so we
2395
- // have to do it manually.
2396
- if (flags.once) {
2397
- emitter.removeEventListener(name, wrapListener);
2033
+ exports.fromAfterHook = fromAfterHook;
2034
+ function fromErrorHook(hook) {
2035
+ return function (context, next) {
2036
+ return next().catch(function (error) {
2037
+ if (context.error !== error || context.result !== undefined) {
2038
+ context.original = _objectSpread({}, context);
2039
+ context.error = error;
2040
+ delete context.result;
2398
2041
  }
2399
- listener(arg);
2042
+ return (0, exports.runHook)(hook, context, 'error').then(function () {
2043
+ if (context.result === undefined && context.error !== undefined) {
2044
+ throw context.error;
2045
+ }
2046
+ }).catch(function (error) {
2047
+ context.error = error;
2048
+ throw context.error;
2049
+ });
2400
2050
  });
2401
- } else {
2402
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
2403
- }
2051
+ };
2404
2052
  }
2405
-
2053
+ exports.fromErrorHook = fromErrorHook;
2054
+ function collect(_ref) {
2055
+ var _ref$before = _ref.before,
2056
+ before = _ref$before === void 0 ? [] : _ref$before,
2057
+ _ref$after = _ref.after,
2058
+ after = _ref$after === void 0 ? [] : _ref$after,
2059
+ _ref$error = _ref.error,
2060
+ error = _ref$error === void 0 ? [] : _ref$error;
2061
+ var beforeHooks = before.map(fromBeforeHook);
2062
+ var afterHooks = _toConsumableArray(after).reverse().map(fromAfterHook);
2063
+ var errorHooks = error.length ? [fromErrorHook((0, exports.runHooks)(error))] : [];
2064
+ return (0, compose_js_1.compose)([].concat(errorHooks, _toConsumableArray(beforeHooks), _toConsumableArray(afterHooks)));
2065
+ }
2066
+ exports.collect = collect;
2406
2067
 
2407
2068
  /***/ }),
2408
2069
 
2409
- /***/ "./src/core.ts":
2410
- /*!*********************!*\
2411
- !*** ./src/core.ts ***!
2412
- \*********************/
2413
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2070
+ /***/ "../../node_modules/@feathersjs/hooks/script/utils.js":
2071
+ /*!************************************************************!*\
2072
+ !*** ../../node_modules/@feathersjs/hooks/script/utils.js ***!
2073
+ \************************************************************/
2074
+ /***/ (function(__unused_webpack_module, exports) {
2414
2075
 
2415
2076
 
2416
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2417
- if (k2 === undefined) k2 = k;
2418
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2419
- }) : (function(o, m, k, k2) {
2420
- if (k2 === undefined) k2 = k;
2421
- o[k2] = m[k];
2422
- }));
2423
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
2424
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2425
- };
2426
- Object.defineProperty(exports, "__esModule", ({ value: true }));
2427
- __exportStar(__webpack_require__(/*! @feathersjs/feathers */ "../feathers/lib/index.js"), exports);
2428
2077
 
2078
+ 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; } } }; }
2079
+ 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); }
2080
+ 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; }
2081
+ Object.defineProperty(exports, "__esModule", ({
2082
+ value: true
2083
+ }));
2084
+ exports.copyFnProperties = exports.copyProperties = void 0;
2085
+ function copyProperties(target) {
2086
+ for (var _len = arguments.length, originals = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2087
+ originals[_key - 1] = arguments[_key];
2088
+ }
2089
+ for (var _i = 0, _originals = originals; _i < _originals.length; _i++) {
2090
+ var original = _originals[_i];
2091
+ var originalProps = Object.keys(original).concat(Object.getOwnPropertySymbols(original));
2092
+ var _iterator = _createForOfIteratorHelper(originalProps),
2093
+ _step;
2094
+ try {
2095
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
2096
+ var prop = _step.value;
2097
+ var propDescriptor = Object.getOwnPropertyDescriptor(original, prop);
2098
+ if (propDescriptor && !Object.prototype.hasOwnProperty.call(target, prop)) {
2099
+ Object.defineProperty(target, prop, propDescriptor);
2100
+ }
2101
+ }
2102
+ } catch (err) {
2103
+ _iterator.e(err);
2104
+ } finally {
2105
+ _iterator.f();
2106
+ }
2107
+ }
2108
+ return target;
2109
+ }
2110
+ exports.copyProperties = copyProperties;
2111
+ function copyFnProperties(target, original) {
2112
+ var internalProps = ['name', 'length'];
2113
+ try {
2114
+ for (var _i2 = 0, _internalProps = internalProps; _i2 < _internalProps.length; _i2++) {
2115
+ var prop = _internalProps[_i2];
2116
+ var value = original[prop];
2117
+ Object.defineProperty(target, prop, {
2118
+ value: value
2119
+ });
2120
+ }
2121
+ } catch (_e) {
2122
+ // Avoid IE error
2123
+ }
2124
+ return target;
2125
+ }
2126
+ exports.copyFnProperties = copyFnProperties;
2429
2127
 
2430
2128
  /***/ })
2431
2129