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