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