@feathersjs/client 5.0.0-pre.21 → 5.0.0-pre.24
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 +24 -0
- package/dist/core.js +228 -457
- package/dist/core.js.map +1 -1
- package/dist/core.min.js +1 -1
- package/dist/feathers.js +308 -499
- package/dist/feathers.js.map +1 -1
- package/dist/feathers.min.js +1 -1
- package/package.json +17 -17
- package/src/core.ts +1 -1
- package/src/feathers.ts +9 -9
package/dist/feathers.js
CHANGED
|
@@ -42,7 +42,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
42
42
|
|
|
43
43
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
44
44
|
|
|
45
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
45
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
46
46
|
|
|
47
47
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
48
48
|
|
|
@@ -52,7 +52,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
52
52
|
|
|
53
53
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
54
54
|
|
|
55
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
56
56
|
|
|
57
57
|
Object.defineProperty(exports, "__esModule", ({
|
|
58
58
|
value: true
|
|
@@ -867,15 +867,15 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
867
867
|
|
|
868
868
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
869
869
|
|
|
870
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
870
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
871
871
|
|
|
872
872
|
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; } }
|
|
873
873
|
|
|
874
874
|
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
875
875
|
|
|
876
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
876
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
877
877
|
|
|
878
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
878
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
879
879
|
|
|
880
880
|
Object.defineProperty(exports, "__esModule", ({
|
|
881
881
|
value: true
|
|
@@ -1283,22 +1283,12 @@ exports.convert = convert;
|
|
|
1283
1283
|
|
|
1284
1284
|
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); }
|
|
1285
1285
|
|
|
1286
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
1287
|
-
|
|
1288
|
-
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."); }
|
|
1289
|
-
|
|
1290
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
1291
|
-
|
|
1292
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
1293
|
-
|
|
1294
1286
|
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; } } }; }
|
|
1295
1287
|
|
|
1296
1288
|
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); }
|
|
1297
1289
|
|
|
1298
1290
|
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; }
|
|
1299
1291
|
|
|
1300
|
-
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; }
|
|
1301
|
-
|
|
1302
1292
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1303
1293
|
|
|
1304
1294
|
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); } }
|
|
@@ -1307,7 +1297,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
1307
1297
|
|
|
1308
1298
|
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); }
|
|
1309
1299
|
|
|
1310
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
1300
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1311
1301
|
|
|
1312
1302
|
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); }; }
|
|
1313
1303
|
|
|
@@ -1317,7 +1307,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
1317
1307
|
|
|
1318
1308
|
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; } }
|
|
1319
1309
|
|
|
1320
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1310
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1321
1311
|
|
|
1322
1312
|
var __importDefault = this && this.__importDefault || function (mod) {
|
|
1323
1313
|
return mod && mod.__esModule ? mod : {
|
|
@@ -1332,20 +1322,24 @@ exports.Feathers = void 0;
|
|
|
1332
1322
|
|
|
1333
1323
|
var version_1 = __importDefault(__webpack_require__(/*! ./version */ "../feathers/lib/version.js"));
|
|
1334
1324
|
|
|
1335
|
-
var
|
|
1325
|
+
var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
|
|
1326
|
+
|
|
1327
|
+
var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
|
|
1328
|
+
|
|
1329
|
+
var hooks_1 = __webpack_require__(/*! @feathersjs/hooks */ "../../node_modules/@feathersjs/hooks/script/index.js");
|
|
1336
1330
|
|
|
1337
|
-
var
|
|
1331
|
+
var events_2 = __webpack_require__(/*! ./events */ "../feathers/lib/events.js");
|
|
1338
1332
|
|
|
1339
|
-
var
|
|
1333
|
+
var hooks_2 = __webpack_require__(/*! ./hooks */ "../feathers/lib/hooks.js");
|
|
1340
1334
|
|
|
1341
1335
|
var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
|
|
1342
1336
|
|
|
1343
|
-
var
|
|
1337
|
+
var hooks_3 = __webpack_require__(/*! ./hooks */ "../feathers/lib/hooks.js");
|
|
1344
1338
|
|
|
1345
|
-
var debug = (0,
|
|
1339
|
+
var debug = (0, commons_1.createDebug)('@feathersjs/feathers');
|
|
1346
1340
|
|
|
1347
|
-
var Feathers = /*#__PURE__*/function (
|
|
1348
|
-
_inherits(Feathers,
|
|
1341
|
+
var Feathers = /*#__PURE__*/function (_events_1$EventEmitte) {
|
|
1342
|
+
_inherits(Feathers, _events_1$EventEmitte);
|
|
1349
1343
|
|
|
1350
1344
|
var _super = _createSuper(Feathers);
|
|
1351
1345
|
|
|
@@ -1357,19 +1351,23 @@ var Feathers = /*#__PURE__*/function (_dependencies_1$Event) {
|
|
|
1357
1351
|
_this = _super.call(this);
|
|
1358
1352
|
_this.services = {};
|
|
1359
1353
|
_this.settings = {};
|
|
1360
|
-
_this.mixins = [
|
|
1354
|
+
_this.mixins = [hooks_2.hookMixin, events_2.eventMixin];
|
|
1361
1355
|
_this.version = version_1.default;
|
|
1362
1356
|
_this._isSetup = false;
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
(0, dependencies_1.hooks)(_assertThisInitialized(_this), {
|
|
1366
|
-
setup: (0, dependencies_1.middleware)().params('server').props({
|
|
1357
|
+
(0, hooks_1.hooks)(_assertThisInitialized(_this), {
|
|
1358
|
+
setup: (0, hooks_1.middleware)().params('server').props({
|
|
1367
1359
|
app: _assertThisInitialized(_this)
|
|
1368
1360
|
}),
|
|
1369
|
-
teardown: (0,
|
|
1361
|
+
teardown: (0, hooks_1.middleware)().params('server').props({
|
|
1370
1362
|
app: _assertThisInitialized(_this)
|
|
1371
1363
|
})
|
|
1372
1364
|
});
|
|
1365
|
+
_this.registerHooks = (0, hooks_3.enableHooks)(_assertThisInitialized(_this));
|
|
1366
|
+
|
|
1367
|
+
_this.registerHooks({
|
|
1368
|
+
around: [events_2.eventHook]
|
|
1369
|
+
});
|
|
1370
|
+
|
|
1373
1371
|
return _this;
|
|
1374
1372
|
}
|
|
1375
1373
|
|
|
@@ -1398,7 +1396,7 @@ var Feathers = /*#__PURE__*/function (_dependencies_1$Event) {
|
|
|
1398
1396
|
}, {
|
|
1399
1397
|
key: "service",
|
|
1400
1398
|
value: function service(location) {
|
|
1401
|
-
var path = (0,
|
|
1399
|
+
var path = (0, commons_1.stripSlashes)(location) || '/';
|
|
1402
1400
|
var current = this.services[path];
|
|
1403
1401
|
|
|
1404
1402
|
if (typeof current === 'undefined') {
|
|
@@ -1417,7 +1415,7 @@ var Feathers = /*#__PURE__*/function (_dependencies_1$Event) {
|
|
|
1417
1415
|
throw new Error("'".concat(path, "' is not a valid service path."));
|
|
1418
1416
|
}
|
|
1419
1417
|
|
|
1420
|
-
var location = (0,
|
|
1418
|
+
var location = (0, commons_1.stripSlashes)(path) || '/';
|
|
1421
1419
|
var subApp = service;
|
|
1422
1420
|
var isSubApp = typeof subApp.service === 'function' && subApp.services;
|
|
1423
1421
|
|
|
@@ -1465,23 +1463,18 @@ var Feathers = /*#__PURE__*/function (_dependencies_1$Event) {
|
|
|
1465
1463
|
}, {
|
|
1466
1464
|
key: "hooks",
|
|
1467
1465
|
value: function hooks(hookMap) {
|
|
1468
|
-
var _this3 = this;
|
|
1469
|
-
|
|
1470
1466
|
var untypedMap = hookMap;
|
|
1471
1467
|
|
|
1472
|
-
if (untypedMap.before || untypedMap.after || untypedMap.error) {
|
|
1473
|
-
|
|
1468
|
+
if (untypedMap.before || untypedMap.after || untypedMap.error || untypedMap.around) {
|
|
1469
|
+
// regular hooks for all service methods
|
|
1470
|
+
this.registerHooks(untypedMap);
|
|
1474
1471
|
} else if (untypedMap.setup || untypedMap.teardown) {
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
var _this$appHooks$depend;
|
|
1478
|
-
|
|
1479
|
-
(_this$appHooks$depend = this.appHooks[dependencies_1.HOOKS]).push.apply(_this$appHooks$depend, _toConsumableArray(hookMap));
|
|
1472
|
+
// .setup and .teardown application hooks
|
|
1473
|
+
(0, hooks_1.hooks)(this, untypedMap);
|
|
1480
1474
|
} else {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
_this3.appHooks[key] = methodHooks.concat(methodHookMap[key]);
|
|
1475
|
+
// Other registration formats are just `around` hooks
|
|
1476
|
+
this.registerHooks({
|
|
1477
|
+
around: untypedMap
|
|
1485
1478
|
});
|
|
1486
1479
|
}
|
|
1487
1480
|
|
|
@@ -1490,45 +1483,45 @@ var Feathers = /*#__PURE__*/function (_dependencies_1$Event) {
|
|
|
1490
1483
|
}, {
|
|
1491
1484
|
key: "setup",
|
|
1492
1485
|
value: function setup() {
|
|
1493
|
-
var
|
|
1486
|
+
var _this3 = this;
|
|
1494
1487
|
|
|
1495
1488
|
this._isSetup = true;
|
|
1496
1489
|
return Object.keys(this.services).reduce(function (current, path) {
|
|
1497
1490
|
return current.then(function () {
|
|
1498
|
-
var service =
|
|
1491
|
+
var service = _this3.service(path);
|
|
1499
1492
|
|
|
1500
1493
|
if (typeof service.setup === 'function') {
|
|
1501
1494
|
debug("Setting up service for `".concat(path, "`"));
|
|
1502
|
-
return service.setup(
|
|
1495
|
+
return service.setup(_this3, path);
|
|
1503
1496
|
}
|
|
1504
1497
|
});
|
|
1505
1498
|
}, Promise.resolve()).then(function () {
|
|
1506
|
-
return
|
|
1499
|
+
return _this3;
|
|
1507
1500
|
});
|
|
1508
1501
|
}
|
|
1509
1502
|
}, {
|
|
1510
1503
|
key: "teardown",
|
|
1511
1504
|
value: function teardown() {
|
|
1512
|
-
var
|
|
1505
|
+
var _this4 = this;
|
|
1513
1506
|
|
|
1514
1507
|
this._isSetup = false;
|
|
1515
1508
|
return Object.keys(this.services).reduce(function (current, path) {
|
|
1516
1509
|
return current.then(function () {
|
|
1517
|
-
var service =
|
|
1510
|
+
var service = _this4.service(path);
|
|
1518
1511
|
|
|
1519
1512
|
if (typeof service.teardown === 'function') {
|
|
1520
1513
|
debug("Tearing down service for `".concat(path, "`"));
|
|
1521
|
-
return service.teardown(
|
|
1514
|
+
return service.teardown(_this4, path);
|
|
1522
1515
|
}
|
|
1523
1516
|
});
|
|
1524
1517
|
}, Promise.resolve()).then(function () {
|
|
1525
|
-
return
|
|
1518
|
+
return _this4;
|
|
1526
1519
|
});
|
|
1527
1520
|
}
|
|
1528
1521
|
}]);
|
|
1529
1522
|
|
|
1530
1523
|
return Feathers;
|
|
1531
|
-
}(
|
|
1524
|
+
}(events_1.EventEmitter);
|
|
1532
1525
|
|
|
1533
1526
|
exports.Feathers = Feathers;
|
|
1534
1527
|
|
|
@@ -1549,60 +1542,6 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1549
1542
|
|
|
1550
1543
|
/***/ }),
|
|
1551
1544
|
|
|
1552
|
-
/***/ "../feathers/lib/dependencies.js":
|
|
1553
|
-
/*!***************************************!*\
|
|
1554
|
-
!*** ../feathers/lib/dependencies.js ***!
|
|
1555
|
-
\***************************************/
|
|
1556
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1557
|
-
|
|
1558
|
-
"use strict";
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1562
|
-
if (k2 === undefined) k2 = k;
|
|
1563
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1564
|
-
|
|
1565
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1566
|
-
desc = {
|
|
1567
|
-
enumerable: true,
|
|
1568
|
-
get: function get() {
|
|
1569
|
-
return m[k];
|
|
1570
|
-
}
|
|
1571
|
-
};
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
Object.defineProperty(o, k2, desc);
|
|
1575
|
-
} : function (o, m, k, k2) {
|
|
1576
|
-
if (k2 === undefined) k2 = k;
|
|
1577
|
-
o[k2] = m[k];
|
|
1578
|
-
});
|
|
1579
|
-
|
|
1580
|
-
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1581
|
-
for (var p in m) {
|
|
1582
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1583
|
-
}
|
|
1584
|
-
};
|
|
1585
|
-
|
|
1586
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
1587
|
-
value: true
|
|
1588
|
-
}));
|
|
1589
|
-
exports.EventEmitter = void 0;
|
|
1590
|
-
|
|
1591
|
-
var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
|
|
1592
|
-
|
|
1593
|
-
Object.defineProperty(exports, "EventEmitter", ({
|
|
1594
|
-
enumerable: true,
|
|
1595
|
-
get: function get() {
|
|
1596
|
-
return events_1.EventEmitter;
|
|
1597
|
-
}
|
|
1598
|
-
}));
|
|
1599
|
-
|
|
1600
|
-
__exportStar(__webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"), exports);
|
|
1601
|
-
|
|
1602
|
-
__exportStar(__webpack_require__(/*! @feathersjs/hooks */ "../../node_modules/@feathersjs/hooks/script/index.js"), exports);
|
|
1603
|
-
|
|
1604
|
-
/***/ }),
|
|
1605
|
-
|
|
1606
1545
|
/***/ "../feathers/lib/events.js":
|
|
1607
1546
|
/*!*********************************!*\
|
|
1608
1547
|
!*** ../feathers/lib/events.js ***!
|
|
@@ -1617,7 +1556,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
1617
1556
|
}));
|
|
1618
1557
|
exports.eventMixin = exports.eventHook = void 0;
|
|
1619
1558
|
|
|
1620
|
-
var
|
|
1559
|
+
var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
|
|
1621
1560
|
|
|
1622
1561
|
var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
|
|
1623
1562
|
|
|
@@ -1645,7 +1584,7 @@ function eventMixin(service) {
|
|
|
1645
1584
|
var isEmitter = typeof service.on === 'function' && typeof service.emit === 'function';
|
|
1646
1585
|
|
|
1647
1586
|
if (!isEmitter) {
|
|
1648
|
-
Object.assign(service,
|
|
1587
|
+
Object.assign(service, events_1.EventEmitter.prototype);
|
|
1649
1588
|
}
|
|
1650
1589
|
|
|
1651
1590
|
return service;
|
|
@@ -1655,42 +1594,28 @@ exports.eventMixin = eventMixin;
|
|
|
1655
1594
|
|
|
1656
1595
|
/***/ }),
|
|
1657
1596
|
|
|
1658
|
-
/***/ "../feathers/lib/hooks
|
|
1659
|
-
|
|
1660
|
-
!*** ../feathers/lib/hooks
|
|
1661
|
-
|
|
1597
|
+
/***/ "../feathers/lib/hooks.js":
|
|
1598
|
+
/*!********************************!*\
|
|
1599
|
+
!*** ../feathers/lib/hooks.js ***!
|
|
1600
|
+
\********************************/
|
|
1662
1601
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1663
1602
|
|
|
1664
1603
|
"use strict";
|
|
1665
1604
|
|
|
1666
1605
|
|
|
1667
|
-
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); }
|
|
1668
|
-
|
|
1669
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
1670
|
-
|
|
1671
|
-
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."); }
|
|
1672
|
-
|
|
1673
|
-
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); }
|
|
1674
|
-
|
|
1675
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
1676
|
-
|
|
1677
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
1678
|
-
|
|
1679
|
-
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; }
|
|
1680
|
-
|
|
1681
1606
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1682
1607
|
|
|
1683
1608
|
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); } }
|
|
1684
1609
|
|
|
1685
1610
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1686
1611
|
|
|
1687
|
-
function _get() { 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(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
1612
|
+
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); }
|
|
1688
1613
|
|
|
1689
1614
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
1690
1615
|
|
|
1691
1616
|
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); }
|
|
1692
1617
|
|
|
1693
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
1618
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1694
1619
|
|
|
1695
1620
|
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); }; }
|
|
1696
1621
|
|
|
@@ -1700,57 +1625,146 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
1700
1625
|
|
|
1701
1626
|
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; } }
|
|
1702
1627
|
|
|
1703
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1628
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1629
|
+
|
|
1630
|
+
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; } } }; }
|
|
1631
|
+
|
|
1632
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
1633
|
+
|
|
1634
|
+
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."); }
|
|
1635
|
+
|
|
1636
|
+
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); }
|
|
1637
|
+
|
|
1638
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
1639
|
+
|
|
1640
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
1641
|
+
|
|
1642
|
+
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; }
|
|
1643
|
+
|
|
1644
|
+
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); }
|
|
1704
1645
|
|
|
1705
1646
|
Object.defineProperty(exports, "__esModule", ({
|
|
1706
1647
|
value: true
|
|
1707
1648
|
}));
|
|
1708
|
-
exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.
|
|
1649
|
+
exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.enableHooks = exports.convertHookData = exports.collectHooks = void 0;
|
|
1709
1650
|
|
|
1710
|
-
var
|
|
1651
|
+
var hooks_1 = __webpack_require__(/*! @feathersjs/hooks */ "../../node_modules/@feathersjs/hooks/script/index.js");
|
|
1711
1652
|
|
|
1712
|
-
var service_1 = __webpack_require__(/*!
|
|
1653
|
+
var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
|
|
1713
1654
|
|
|
1714
|
-
|
|
1655
|
+
function collectHooks(target, method) {
|
|
1656
|
+
return target.__hooks.hooks[method] || [];
|
|
1657
|
+
}
|
|
1715
1658
|
|
|
1716
|
-
|
|
1659
|
+
exports.collectHooks = collectHooks; // Converts different hook registration formats into the
|
|
1660
|
+
// same internal format
|
|
1717
1661
|
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
}))
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
enumerable: true,
|
|
1732
|
-
get: function get() {
|
|
1733
|
-
return regular_2.fromAfterHook;
|
|
1734
|
-
}
|
|
1735
|
-
}));
|
|
1736
|
-
Object.defineProperty(exports, "fromAfterHooks", ({
|
|
1737
|
-
enumerable: true,
|
|
1738
|
-
get: function get() {
|
|
1739
|
-
return regular_2.fromAfterHooks;
|
|
1740
|
-
}
|
|
1741
|
-
}));
|
|
1742
|
-
Object.defineProperty(exports, "fromErrorHook", ({
|
|
1743
|
-
enumerable: true,
|
|
1744
|
-
get: function get() {
|
|
1745
|
-
return regular_2.fromErrorHook;
|
|
1662
|
+
function convertHookData(input) {
|
|
1663
|
+
var result = {};
|
|
1664
|
+
|
|
1665
|
+
if (Array.isArray(input)) {
|
|
1666
|
+
result.all = input;
|
|
1667
|
+
} else if (_typeof(input) !== 'object') {
|
|
1668
|
+
result.all = [input];
|
|
1669
|
+
} else {
|
|
1670
|
+
for (var _i = 0, _Object$keys = Object.keys(input); _i < _Object$keys.length; _i++) {
|
|
1671
|
+
var key = _Object$keys[_i];
|
|
1672
|
+
var value = input[key];
|
|
1673
|
+
result[key] = Array.isArray(value) ? value : [value];
|
|
1674
|
+
}
|
|
1746
1675
|
}
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1676
|
+
|
|
1677
|
+
return result;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
exports.convertHookData = convertHookData;
|
|
1681
|
+
var types = ['before', 'after', 'error', 'around'];
|
|
1682
|
+
|
|
1683
|
+
var isType = function isType(value) {
|
|
1684
|
+
return types.includes(value);
|
|
1685
|
+
};
|
|
1686
|
+
|
|
1687
|
+
var createMap = function createMap(input, methods) {
|
|
1688
|
+
var map = {};
|
|
1689
|
+
Object.keys(input).forEach(function (type) {
|
|
1690
|
+
if (!isType(type)) {
|
|
1691
|
+
throw new Error("'".concat(type, "' is not a valid hook type"));
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
var data = convertHookData(input[type]);
|
|
1695
|
+
Object.keys(data).forEach(function (method) {
|
|
1696
|
+
if (method !== 'all' && !methods.includes(method) && !service_1.defaultServiceMethods.includes(method)) {
|
|
1697
|
+
throw new Error("'".concat(method, "' is not a valid hook method"));
|
|
1698
|
+
}
|
|
1699
|
+
});
|
|
1700
|
+
map[type] = data;
|
|
1701
|
+
});
|
|
1702
|
+
return map;
|
|
1703
|
+
};
|
|
1704
|
+
|
|
1705
|
+
var updateStore = function updateStore(store, map) {
|
|
1706
|
+
return Object.keys(store.hooks).forEach(function (method) {
|
|
1707
|
+
Object.keys(map).forEach(function (key) {
|
|
1708
|
+
var _a;
|
|
1709
|
+
|
|
1710
|
+
var type = key;
|
|
1711
|
+
var allHooks = map[type].all || [];
|
|
1712
|
+
var methodHooks = map[type][method] || [];
|
|
1713
|
+
|
|
1714
|
+
if (allHooks.length || methodHooks.length) {
|
|
1715
|
+
var list = [].concat(_toConsumableArray(allHooks), _toConsumableArray(methodHooks));
|
|
1716
|
+
var hooks = (_a = store[type])[method] || (_a[method] = []);
|
|
1717
|
+
hooks.push.apply(hooks, _toConsumableArray(list));
|
|
1718
|
+
}
|
|
1719
|
+
});
|
|
1720
|
+
var collected = (0, hooks_1.collect)({
|
|
1721
|
+
before: store.before[method] || [],
|
|
1722
|
+
after: store.after[method] || [],
|
|
1723
|
+
error: store.error[method] || []
|
|
1724
|
+
});
|
|
1725
|
+
store.hooks[method] = [].concat(_toConsumableArray(store.around[method] || []), [collected]);
|
|
1726
|
+
});
|
|
1727
|
+
}; // Add `.hooks` functionality to an object
|
|
1728
|
+
|
|
1729
|
+
|
|
1730
|
+
function enableHooks(object) {
|
|
1731
|
+
var methods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : service_1.defaultServiceMethods;
|
|
1732
|
+
var store = {
|
|
1733
|
+
around: {},
|
|
1734
|
+
before: {},
|
|
1735
|
+
after: {},
|
|
1736
|
+
error: {},
|
|
1737
|
+
hooks: {}
|
|
1738
|
+
};
|
|
1739
|
+
|
|
1740
|
+
var _iterator = _createForOfIteratorHelper(methods),
|
|
1741
|
+
_step;
|
|
1742
|
+
|
|
1743
|
+
try {
|
|
1744
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1745
|
+
var method = _step.value;
|
|
1746
|
+
store.hooks[method] = [];
|
|
1747
|
+
}
|
|
1748
|
+
} catch (err) {
|
|
1749
|
+
_iterator.e(err);
|
|
1750
|
+
} finally {
|
|
1751
|
+
_iterator.f();
|
|
1752
1752
|
}
|
|
1753
|
-
|
|
1753
|
+
|
|
1754
|
+
Object.defineProperty(object, '__hooks', {
|
|
1755
|
+
configurable: true,
|
|
1756
|
+
value: store,
|
|
1757
|
+
writable: true
|
|
1758
|
+
});
|
|
1759
|
+
return function registerHooks(input) {
|
|
1760
|
+
var store = this.__hooks;
|
|
1761
|
+
var map = createMap(input, methods);
|
|
1762
|
+
updateStore(store, map);
|
|
1763
|
+
return this;
|
|
1764
|
+
};
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
exports.enableHooks = enableHooks;
|
|
1754
1768
|
|
|
1755
1769
|
function createContext(service, method) {
|
|
1756
1770
|
var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -1765,8 +1779,8 @@ function createContext(service, method) {
|
|
|
1765
1779
|
|
|
1766
1780
|
exports.createContext = createContext;
|
|
1767
1781
|
|
|
1768
|
-
var FeathersHookManager = /*#__PURE__*/function (
|
|
1769
|
-
_inherits(FeathersHookManager,
|
|
1782
|
+
var FeathersHookManager = /*#__PURE__*/function (_hooks_1$HookManager) {
|
|
1783
|
+
_inherits(FeathersHookManager, _hooks_1$HookManager);
|
|
1770
1784
|
|
|
1771
1785
|
var _super = _createSuper(FeathersHookManager);
|
|
1772
1786
|
|
|
@@ -1785,14 +1799,12 @@ var FeathersHookManager = /*#__PURE__*/function (_dependencies_1$HookM) {
|
|
|
1785
1799
|
_createClass(FeathersHookManager, [{
|
|
1786
1800
|
key: "collectMiddleware",
|
|
1787
1801
|
value: function collectMiddleware(self, args) {
|
|
1788
|
-
var
|
|
1789
|
-
var appHooks = app.appHooks[dependencies_1.HOOKS].concat(app.appHooks[this.method] || []);
|
|
1790
|
-
var regularAppHooks = (0, regular_1.collectRegularHooks)(this.app, this.method);
|
|
1802
|
+
var appHooks = collectHooks(this.app, this.method);
|
|
1791
1803
|
|
|
1792
1804
|
var middleware = _get(_getPrototypeOf(FeathersHookManager.prototype), "collectMiddleware", this).call(this, self, args);
|
|
1793
1805
|
|
|
1794
|
-
var
|
|
1795
|
-
return [].concat(_toConsumableArray(appHooks), _toConsumableArray(
|
|
1806
|
+
var methodHooks = collectHooks(self, this.method);
|
|
1807
|
+
return [].concat(_toConsumableArray(appHooks), _toConsumableArray(middleware), _toConsumableArray(methodHooks));
|
|
1796
1808
|
}
|
|
1797
1809
|
}, {
|
|
1798
1810
|
key: "initializeContext",
|
|
@@ -1814,23 +1826,24 @@ var FeathersHookManager = /*#__PURE__*/function (_dependencies_1$HookM) {
|
|
|
1814
1826
|
}]);
|
|
1815
1827
|
|
|
1816
1828
|
return FeathersHookManager;
|
|
1817
|
-
}(
|
|
1829
|
+
}(hooks_1.HookManager);
|
|
1818
1830
|
|
|
1819
1831
|
exports.FeathersHookManager = FeathersHookManager;
|
|
1820
1832
|
|
|
1821
1833
|
function hookMixin(service, path, options) {
|
|
1834
|
+
var _this2 = this;
|
|
1835
|
+
|
|
1822
1836
|
if (typeof service.hooks === 'function') {
|
|
1823
1837
|
return service;
|
|
1824
1838
|
}
|
|
1825
1839
|
|
|
1826
|
-
var app = this;
|
|
1827
1840
|
var hookMethods = (0, service_1.getHookMethods)(service, options);
|
|
1828
1841
|
var serviceMethodHooks = hookMethods.reduce(function (res, method) {
|
|
1829
1842
|
var _FeathersHookManager;
|
|
1830
1843
|
|
|
1831
1844
|
var params = service_1.defaultServiceArguments[method] || ['data', 'params'];
|
|
1832
|
-
res[method] = (_FeathersHookManager = new FeathersHookManager(
|
|
1833
|
-
app:
|
|
1845
|
+
res[method] = (_FeathersHookManager = new FeathersHookManager(_this2, method)).params.apply(_FeathersHookManager, _toConsumableArray(params)).props({
|
|
1846
|
+
app: _this2,
|
|
1834
1847
|
path: path,
|
|
1835
1848
|
method: method,
|
|
1836
1849
|
service: service,
|
|
@@ -1844,28 +1857,29 @@ function hookMixin(service, path, options) {
|
|
|
1844
1857
|
},
|
|
1845
1858
|
|
|
1846
1859
|
set statusCode(value) {
|
|
1847
|
-
|
|
1860
|
+
this.http = this.http || {};
|
|
1861
|
+
this.http.status = value;
|
|
1848
1862
|
}
|
|
1849
1863
|
|
|
1850
1864
|
});
|
|
1851
1865
|
return res;
|
|
1852
1866
|
}, {});
|
|
1853
|
-
var
|
|
1854
|
-
(0,
|
|
1867
|
+
var registerHooks = enableHooks(service, hookMethods);
|
|
1868
|
+
(0, hooks_1.hooks)(service, serviceMethodHooks);
|
|
1855
1869
|
|
|
1856
1870
|
service.hooks = function (hookOptions) {
|
|
1857
|
-
var
|
|
1871
|
+
var _this3 = this;
|
|
1858
1872
|
|
|
1859
|
-
if (hookOptions.before || hookOptions.after || hookOptions.error) {
|
|
1860
|
-
return
|
|
1873
|
+
if (hookOptions.before || hookOptions.after || hookOptions.error || hookOptions.around) {
|
|
1874
|
+
return registerHooks.call(this, hookOptions);
|
|
1861
1875
|
}
|
|
1862
1876
|
|
|
1863
1877
|
if (Array.isArray(hookOptions)) {
|
|
1864
|
-
return (0,
|
|
1878
|
+
return (0, hooks_1.hooks)(this, hookOptions);
|
|
1865
1879
|
}
|
|
1866
1880
|
|
|
1867
1881
|
Object.keys(hookOptions).forEach(function (method) {
|
|
1868
|
-
var manager = (0,
|
|
1882
|
+
var manager = (0, hooks_1.getManager)(_this3[method]);
|
|
1869
1883
|
|
|
1870
1884
|
if (!(manager instanceof FeathersHookManager)) {
|
|
1871
1885
|
throw new Error("Method ".concat(method, " is not a Feathers hooks enabled service method"));
|
|
@@ -1883,267 +1897,6 @@ exports.hookMixin = hookMixin;
|
|
|
1883
1897
|
|
|
1884
1898
|
/***/ }),
|
|
1885
1899
|
|
|
1886
|
-
/***/ "../feathers/lib/hooks/regular.js":
|
|
1887
|
-
/*!****************************************!*\
|
|
1888
|
-
!*** ../feathers/lib/hooks/regular.js ***!
|
|
1889
|
-
\****************************************/
|
|
1890
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1891
|
-
|
|
1892
|
-
"use strict";
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
1896
|
-
|
|
1897
|
-
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."); }
|
|
1898
|
-
|
|
1899
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
1900
|
-
|
|
1901
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
1902
|
-
|
|
1903
|
-
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; } } }; }
|
|
1904
|
-
|
|
1905
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
1906
|
-
|
|
1907
|
-
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; }
|
|
1908
|
-
|
|
1909
|
-
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); }
|
|
1910
|
-
|
|
1911
|
-
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; }
|
|
1912
|
-
|
|
1913
|
-
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; }
|
|
1914
|
-
|
|
1915
|
-
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; }
|
|
1916
|
-
|
|
1917
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
1918
|
-
value: true
|
|
1919
|
-
}));
|
|
1920
|
-
exports.enableRegularHooks = exports.convertHookData = exports.collectRegularHooks = exports.fromErrorHooks = exports.fromAfterHooks = exports.fromBeforeHooks = exports.fromErrorHook = exports.fromAfterHook = exports.fromBeforeHook = void 0;
|
|
1921
|
-
|
|
1922
|
-
var service_1 = __webpack_require__(/*! ../service */ "../feathers/lib/service.js");
|
|
1923
|
-
|
|
1924
|
-
var runHook = function runHook(hook, context, type) {
|
|
1925
|
-
if (type) context.type = type;
|
|
1926
|
-
return Promise.resolve(hook.call(context.self, context)).then(function (res) {
|
|
1927
|
-
if (type) context.type = null;
|
|
1928
|
-
|
|
1929
|
-
if (res && res !== context) {
|
|
1930
|
-
Object.assign(context, res);
|
|
1931
|
-
}
|
|
1932
|
-
});
|
|
1933
|
-
};
|
|
1934
|
-
|
|
1935
|
-
function fromBeforeHook(hook) {
|
|
1936
|
-
return function (context, next) {
|
|
1937
|
-
return runHook(hook, context, 'before').then(next);
|
|
1938
|
-
};
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
exports.fromBeforeHook = fromBeforeHook;
|
|
1942
|
-
|
|
1943
|
-
function fromAfterHook(hook) {
|
|
1944
|
-
return function (context, next) {
|
|
1945
|
-
return next().then(function () {
|
|
1946
|
-
return runHook(hook, context, 'after');
|
|
1947
|
-
});
|
|
1948
|
-
};
|
|
1949
|
-
}
|
|
1950
|
-
|
|
1951
|
-
exports.fromAfterHook = fromAfterHook;
|
|
1952
|
-
|
|
1953
|
-
function fromErrorHook(hook) {
|
|
1954
|
-
return function (context, next) {
|
|
1955
|
-
return next().catch(function (error) {
|
|
1956
|
-
if (context.error !== error || context.result !== undefined) {
|
|
1957
|
-
context.original = _objectSpread({}, context);
|
|
1958
|
-
context.error = error;
|
|
1959
|
-
delete context.result;
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
return runHook(hook, context, 'error').then(function () {
|
|
1963
|
-
if (context.result === undefined && context.error !== undefined) {
|
|
1964
|
-
throw context.error;
|
|
1965
|
-
}
|
|
1966
|
-
});
|
|
1967
|
-
});
|
|
1968
|
-
};
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
exports.fromErrorHook = fromErrorHook;
|
|
1972
|
-
|
|
1973
|
-
var RunHooks = function RunHooks(hooks) {
|
|
1974
|
-
return function (context) {
|
|
1975
|
-
return hooks.reduce(function (promise, hook) {
|
|
1976
|
-
return promise.then(function () {
|
|
1977
|
-
return runHook(hook, context);
|
|
1978
|
-
});
|
|
1979
|
-
}, Promise.resolve(undefined));
|
|
1980
|
-
};
|
|
1981
|
-
};
|
|
1982
|
-
|
|
1983
|
-
function fromBeforeHooks(hooks) {
|
|
1984
|
-
return fromBeforeHook(RunHooks(hooks));
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
exports.fromBeforeHooks = fromBeforeHooks;
|
|
1988
|
-
|
|
1989
|
-
function fromAfterHooks(hooks) {
|
|
1990
|
-
return fromAfterHook(RunHooks(hooks));
|
|
1991
|
-
}
|
|
1992
|
-
|
|
1993
|
-
exports.fromAfterHooks = fromAfterHooks;
|
|
1994
|
-
|
|
1995
|
-
function fromErrorHooks(hooks) {
|
|
1996
|
-
return fromErrorHook(RunHooks(hooks));
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
exports.fromErrorHooks = fromErrorHooks;
|
|
2000
|
-
|
|
2001
|
-
function collectRegularHooks(target, method) {
|
|
2002
|
-
return target.__hooks.hooks[method] || [];
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
exports.collectRegularHooks = collectRegularHooks; // Converts different hook registration formats into the
|
|
2006
|
-
// same internal format
|
|
2007
|
-
|
|
2008
|
-
function convertHookData(input) {
|
|
2009
|
-
var result = {};
|
|
2010
|
-
|
|
2011
|
-
if (Array.isArray(input)) {
|
|
2012
|
-
result.all = input;
|
|
2013
|
-
} else if (_typeof(input) !== 'object') {
|
|
2014
|
-
result.all = [input];
|
|
2015
|
-
} else {
|
|
2016
|
-
for (var _i = 0, _Object$keys = Object.keys(input); _i < _Object$keys.length; _i++) {
|
|
2017
|
-
var key = _Object$keys[_i];
|
|
2018
|
-
var value = input[key];
|
|
2019
|
-
result[key] = Array.isArray(value) ? value : [value];
|
|
2020
|
-
}
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
return result;
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
exports.convertHookData = convertHookData;
|
|
2027
|
-
var types = ['before', 'after', 'error'];
|
|
2028
|
-
|
|
2029
|
-
var isType = function isType(value) {
|
|
2030
|
-
return types.includes(value);
|
|
2031
|
-
};
|
|
2032
|
-
|
|
2033
|
-
var wrappers = {
|
|
2034
|
-
before: fromBeforeHooks,
|
|
2035
|
-
after: fromAfterHooks,
|
|
2036
|
-
error: fromErrorHooks
|
|
2037
|
-
};
|
|
2038
|
-
|
|
2039
|
-
var createStore = function createStore(methods) {
|
|
2040
|
-
var store = {
|
|
2041
|
-
before: {},
|
|
2042
|
-
after: {},
|
|
2043
|
-
error: {},
|
|
2044
|
-
hooks: {}
|
|
2045
|
-
};
|
|
2046
|
-
|
|
2047
|
-
var _iterator = _createForOfIteratorHelper(methods),
|
|
2048
|
-
_step;
|
|
2049
|
-
|
|
2050
|
-
try {
|
|
2051
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2052
|
-
var method = _step.value;
|
|
2053
|
-
store.hooks[method] = [];
|
|
2054
|
-
}
|
|
2055
|
-
} catch (err) {
|
|
2056
|
-
_iterator.e(err);
|
|
2057
|
-
} finally {
|
|
2058
|
-
_iterator.f();
|
|
2059
|
-
}
|
|
2060
|
-
|
|
2061
|
-
return store;
|
|
2062
|
-
};
|
|
2063
|
-
|
|
2064
|
-
var setStore = function setStore(object, store) {
|
|
2065
|
-
Object.defineProperty(object, '__hooks', {
|
|
2066
|
-
configurable: true,
|
|
2067
|
-
value: store,
|
|
2068
|
-
writable: true
|
|
2069
|
-
});
|
|
2070
|
-
};
|
|
2071
|
-
|
|
2072
|
-
var getStore = function getStore(object) {
|
|
2073
|
-
return object.__hooks;
|
|
2074
|
-
};
|
|
2075
|
-
|
|
2076
|
-
var createMap = function createMap(input, methods) {
|
|
2077
|
-
var map = {};
|
|
2078
|
-
Object.keys(input).forEach(function (type) {
|
|
2079
|
-
if (!isType(type)) {
|
|
2080
|
-
throw new Error("'".concat(type, "' is not a valid hook type"));
|
|
2081
|
-
}
|
|
2082
|
-
|
|
2083
|
-
var data = convertHookData(input[type]);
|
|
2084
|
-
Object.keys(data).forEach(function (method) {
|
|
2085
|
-
if (method !== 'all' && !methods.includes(method) && !service_1.defaultServiceMethods.includes(method)) {
|
|
2086
|
-
throw new Error("'".concat(method, "' is not a valid hook method"));
|
|
2087
|
-
}
|
|
2088
|
-
});
|
|
2089
|
-
map[type] = data;
|
|
2090
|
-
});
|
|
2091
|
-
return map;
|
|
2092
|
-
};
|
|
2093
|
-
|
|
2094
|
-
var createAdapter = function createAdapter(type) {
|
|
2095
|
-
var hooks = [];
|
|
2096
|
-
var hook = wrappers[type](hooks);
|
|
2097
|
-
var adapter = Object.assign(hook, {
|
|
2098
|
-
hooks: hooks
|
|
2099
|
-
});
|
|
2100
|
-
return adapter;
|
|
2101
|
-
};
|
|
2102
|
-
|
|
2103
|
-
var updateStore = function updateStore(store, map) {
|
|
2104
|
-
Object.keys(store.hooks).forEach(function (method) {
|
|
2105
|
-
var adapted = false;
|
|
2106
|
-
Object.keys(map).forEach(function (key) {
|
|
2107
|
-
var _a;
|
|
2108
|
-
|
|
2109
|
-
var type = key;
|
|
2110
|
-
var allHooks = map[type].all || [];
|
|
2111
|
-
var methodHooks = map[type][method] || [];
|
|
2112
|
-
|
|
2113
|
-
if (allHooks.length || methodHooks.length) {
|
|
2114
|
-
var _adapter$hooks;
|
|
2115
|
-
|
|
2116
|
-
var adapter = (_a = store[type])[method] || (_a[method] = (adapted = true, createAdapter(type)));
|
|
2117
|
-
|
|
2118
|
-
(_adapter$hooks = adapter.hooks).push.apply(_adapter$hooks, _toConsumableArray(allHooks).concat(_toConsumableArray(methodHooks)));
|
|
2119
|
-
}
|
|
2120
|
-
});
|
|
2121
|
-
|
|
2122
|
-
if (adapted) {
|
|
2123
|
-
store.hooks[method] = [store.error[method], store.before[method], store.after[method]].filter(function (hook) {
|
|
2124
|
-
return hook;
|
|
2125
|
-
});
|
|
2126
|
-
}
|
|
2127
|
-
});
|
|
2128
|
-
}; // Add `.hooks` functionality to an object
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
function enableRegularHooks(object) {
|
|
2132
|
-
var methods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : service_1.defaultServiceMethods;
|
|
2133
|
-
var store = createStore(methods);
|
|
2134
|
-
setStore(object, store);
|
|
2135
|
-
return function regularHooks(input) {
|
|
2136
|
-
var store = getStore(this);
|
|
2137
|
-
var map = createMap(input, methods);
|
|
2138
|
-
updateStore(store, map);
|
|
2139
|
-
return this;
|
|
2140
|
-
};
|
|
2141
|
-
}
|
|
2142
|
-
|
|
2143
|
-
exports.enableRegularHooks = enableRegularHooks;
|
|
2144
|
-
|
|
2145
|
-
/***/ }),
|
|
2146
|
-
|
|
2147
1900
|
/***/ "../feathers/lib/index.js":
|
|
2148
1901
|
/*!********************************!*\
|
|
2149
1902
|
!*** ../feathers/lib/index.js ***!
|
|
@@ -2189,7 +1942,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2189
1942
|
}));
|
|
2190
1943
|
exports.Feathers = exports.version = exports.feathers = void 0;
|
|
2191
1944
|
|
|
2192
|
-
var
|
|
1945
|
+
var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
|
|
2193
1946
|
|
|
2194
1947
|
var version_1 = __importDefault(__webpack_require__(/*! ./version */ "../feathers/lib/version.js"));
|
|
2195
1948
|
|
|
@@ -2209,9 +1962,9 @@ function feathers() {
|
|
|
2209
1962
|
}
|
|
2210
1963
|
|
|
2211
1964
|
exports.feathers = feathers;
|
|
2212
|
-
feathers.setDebug =
|
|
1965
|
+
feathers.setDebug = commons_1.setDebug;
|
|
2213
1966
|
|
|
2214
|
-
__exportStar(__webpack_require__(/*! ./hooks
|
|
1967
|
+
__exportStar(__webpack_require__(/*! ./hooks */ "../feathers/lib/hooks.js"), exports);
|
|
2215
1968
|
|
|
2216
1969
|
__exportStar(__webpack_require__(/*! ./declarations */ "../feathers/lib/declarations.js"), exports);
|
|
2217
1970
|
|
|
@@ -2243,9 +1996,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2243
1996
|
}));
|
|
2244
1997
|
exports.wrapService = exports.getServiceOptions = exports.getHookMethods = exports.protectedMethods = exports.defaultEventMap = exports.defaultServiceMethods = exports.defaultServiceArguments = exports.SERVICE = void 0;
|
|
2245
1998
|
|
|
2246
|
-
var
|
|
1999
|
+
var events_1 = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
|
|
2000
|
+
|
|
2001
|
+
var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
|
|
2247
2002
|
|
|
2248
|
-
exports.SERVICE = (0,
|
|
2003
|
+
exports.SERVICE = (0, commons_1.createSymbol)('@feathersjs/service');
|
|
2249
2004
|
exports.defaultServiceArguments = {
|
|
2250
2005
|
find: ['params'],
|
|
2251
2006
|
get: ['id', 'params'],
|
|
@@ -2261,7 +2016,7 @@ exports.defaultEventMap = {
|
|
|
2261
2016
|
patch: 'patched',
|
|
2262
2017
|
remove: 'removed'
|
|
2263
2018
|
};
|
|
2264
|
-
exports.protectedMethods = Object.keys(Object.prototype).concat(Object.keys(
|
|
2019
|
+
exports.protectedMethods = Object.keys(Object.prototype).concat(Object.keys(events_1.EventEmitter.prototype)).concat(['all', 'around', 'before', 'after', 'error', 'hooks', 'setup', 'teardown', 'publish']);
|
|
2265
2020
|
|
|
2266
2021
|
function getHookMethods(service, options) {
|
|
2267
2022
|
var methods = options.methods;
|
|
@@ -2355,7 +2110,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
2355
2110
|
|
|
2356
2111
|
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); }
|
|
2357
2112
|
|
|
2358
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
2113
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
2359
2114
|
|
|
2360
2115
|
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); }; }
|
|
2361
2116
|
|
|
@@ -2365,7 +2120,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
2365
2120
|
|
|
2366
2121
|
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; } }
|
|
2367
2122
|
|
|
2368
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2123
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2369
2124
|
|
|
2370
2125
|
Object.defineProperty(exports, "__esModule", ({
|
|
2371
2126
|
value: true
|
|
@@ -2511,8 +2266,7 @@ var Base = /*#__PURE__*/function () {
|
|
|
2511
2266
|
}
|
|
2512
2267
|
}, {
|
|
2513
2268
|
key: "find",
|
|
2514
|
-
value: function find() {
|
|
2515
|
-
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2269
|
+
value: function find(params) {
|
|
2516
2270
|
return this.request({
|
|
2517
2271
|
url: this.makeUrl(params.query),
|
|
2518
2272
|
method: 'GET',
|
|
@@ -2521,11 +2275,9 @@ var Base = /*#__PURE__*/function () {
|
|
|
2521
2275
|
}
|
|
2522
2276
|
}, {
|
|
2523
2277
|
key: "get",
|
|
2524
|
-
value: function get(id) {
|
|
2525
|
-
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2526
|
-
|
|
2278
|
+
value: function get(id, params) {
|
|
2527
2279
|
if (typeof id === 'undefined') {
|
|
2528
|
-
return Promise.reject(new Error(
|
|
2280
|
+
return Promise.reject(new Error("id for 'get' can not be undefined"));
|
|
2529
2281
|
}
|
|
2530
2282
|
|
|
2531
2283
|
return this.request({
|
|
@@ -2536,8 +2288,7 @@ var Base = /*#__PURE__*/function () {
|
|
|
2536
2288
|
}
|
|
2537
2289
|
}, {
|
|
2538
2290
|
key: "create",
|
|
2539
|
-
value: function create(body) {
|
|
2540
|
-
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2291
|
+
value: function create(body, params) {
|
|
2541
2292
|
return this.request({
|
|
2542
2293
|
url: this.makeUrl(params.query),
|
|
2543
2294
|
body: body,
|
|
@@ -2549,11 +2300,9 @@ var Base = /*#__PURE__*/function () {
|
|
|
2549
2300
|
}
|
|
2550
2301
|
}, {
|
|
2551
2302
|
key: "update",
|
|
2552
|
-
value: function update(id, body) {
|
|
2553
|
-
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2554
|
-
|
|
2303
|
+
value: function update(id, body, params) {
|
|
2555
2304
|
if (typeof id === 'undefined') {
|
|
2556
|
-
return Promise.reject(new Error(
|
|
2305
|
+
return Promise.reject(new Error("id for 'update' can not be undefined, only 'null' when updating multiple entries"));
|
|
2557
2306
|
}
|
|
2558
2307
|
|
|
2559
2308
|
return this.request({
|
|
@@ -2567,11 +2316,9 @@ var Base = /*#__PURE__*/function () {
|
|
|
2567
2316
|
}
|
|
2568
2317
|
}, {
|
|
2569
2318
|
key: "patch",
|
|
2570
|
-
value: function patch(id, body) {
|
|
2571
|
-
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2572
|
-
|
|
2319
|
+
value: function patch(id, body, params) {
|
|
2573
2320
|
if (typeof id === 'undefined') {
|
|
2574
|
-
return Promise.reject(new Error(
|
|
2321
|
+
return Promise.reject(new Error("id for 'patch' can not be undefined, only 'null' when updating multiple entries"));
|
|
2575
2322
|
}
|
|
2576
2323
|
|
|
2577
2324
|
return this.request({
|
|
@@ -2585,11 +2332,9 @@ var Base = /*#__PURE__*/function () {
|
|
|
2585
2332
|
}
|
|
2586
2333
|
}, {
|
|
2587
2334
|
key: "remove",
|
|
2588
|
-
value: function remove(id) {
|
|
2589
|
-
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2590
|
-
|
|
2335
|
+
value: function remove(id, params) {
|
|
2591
2336
|
if (typeof id === 'undefined') {
|
|
2592
|
-
return Promise.reject(new Error(
|
|
2337
|
+
return Promise.reject(new Error("id for 'remove' can not be undefined, only 'null' when removing multiple entries"));
|
|
2593
2338
|
}
|
|
2594
2339
|
|
|
2595
2340
|
return this.request({
|
|
@@ -2626,7 +2371,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
2626
2371
|
|
|
2627
2372
|
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); }
|
|
2628
2373
|
|
|
2629
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
2374
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
2630
2375
|
|
|
2631
2376
|
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); }; }
|
|
2632
2377
|
|
|
@@ -2636,7 +2381,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
2636
2381
|
|
|
2637
2382
|
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; } }
|
|
2638
2383
|
|
|
2639
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2384
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2640
2385
|
|
|
2641
2386
|
Object.defineProperty(exports, "__esModule", ({
|
|
2642
2387
|
value: true
|
|
@@ -2711,11 +2456,25 @@ exports.FetchClient = FetchClient;
|
|
|
2711
2456
|
"use strict";
|
|
2712
2457
|
|
|
2713
2458
|
|
|
2459
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2460
|
+
|
|
2461
|
+
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."); }
|
|
2462
|
+
|
|
2463
|
+
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); }
|
|
2464
|
+
|
|
2465
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
2466
|
+
|
|
2467
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
2468
|
+
|
|
2469
|
+
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; }
|
|
2470
|
+
|
|
2714
2471
|
Object.defineProperty(exports, "__esModule", ({
|
|
2715
2472
|
value: true
|
|
2716
2473
|
}));
|
|
2717
2474
|
exports.SuperagentClient = exports.FetchClient = exports.AxiosClient = void 0;
|
|
2718
2475
|
|
|
2476
|
+
var feathers_1 = __webpack_require__(/*! @feathersjs/feathers */ "../feathers/lib/index.js");
|
|
2477
|
+
|
|
2719
2478
|
var base_1 = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
|
|
2720
2479
|
|
|
2721
2480
|
var axios_1 = __webpack_require__(/*! ./axios */ "../rest-client/lib/axios.js");
|
|
@@ -2785,6 +2544,14 @@ function restClient() {
|
|
|
2785
2544
|
|
|
2786
2545
|
app.rest = connection;
|
|
2787
2546
|
app.defaultService = defaultService;
|
|
2547
|
+
app.mixins.unshift(function (service, _location, options) {
|
|
2548
|
+
if (options && options.methods && service instanceof base_1.Base) {
|
|
2549
|
+
var customMethods = options.methods.filter(function (name) {
|
|
2550
|
+
return !feathers_1.defaultServiceMethods.includes(name);
|
|
2551
|
+
});
|
|
2552
|
+
service.methods.apply(service, _toConsumableArray(customMethods));
|
|
2553
|
+
}
|
|
2554
|
+
});
|
|
2788
2555
|
};
|
|
2789
2556
|
|
|
2790
2557
|
initialize.Service = Service;
|
|
@@ -2822,7 +2589,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
2822
2589
|
|
|
2823
2590
|
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); }
|
|
2824
2591
|
|
|
2825
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
2592
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
2826
2593
|
|
|
2827
2594
|
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); }; }
|
|
2828
2595
|
|
|
@@ -2832,7 +2599,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
2832
2599
|
|
|
2833
2600
|
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; } }
|
|
2834
2601
|
|
|
2835
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2602
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2836
2603
|
|
|
2837
2604
|
Object.defineProperty(exports, "__esModule", ({
|
|
2838
2605
|
value: true
|
|
@@ -2896,6 +2663,18 @@ exports.SuperagentClient = SuperagentClient;
|
|
|
2896
2663
|
"use strict";
|
|
2897
2664
|
|
|
2898
2665
|
|
|
2666
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2667
|
+
|
|
2668
|
+
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."); }
|
|
2669
|
+
|
|
2670
|
+
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); }
|
|
2671
|
+
|
|
2672
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
2673
|
+
|
|
2674
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
2675
|
+
|
|
2676
|
+
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; }
|
|
2677
|
+
|
|
2899
2678
|
Object.defineProperty(exports, "__esModule", ({
|
|
2900
2679
|
value: true
|
|
2901
2680
|
}));
|
|
@@ -2927,6 +2706,14 @@ function socketioClient(connection, options) {
|
|
|
2927
2706
|
|
|
2928
2707
|
app.io = connection;
|
|
2929
2708
|
app.defaultService = defaultService;
|
|
2709
|
+
app.mixins.unshift(function (service, _location, options) {
|
|
2710
|
+
if (options && options.methods && service instanceof client_1.Service) {
|
|
2711
|
+
var customMethods = options.methods.filter(function (name) {
|
|
2712
|
+
return !feathers_1.defaultServiceMethods.includes(name);
|
|
2713
|
+
});
|
|
2714
|
+
service.methods.apply(service, _toConsumableArray(customMethods));
|
|
2715
|
+
}
|
|
2716
|
+
});
|
|
2930
2717
|
};
|
|
2931
2718
|
|
|
2932
2719
|
initialize.Service = client_1.Service;
|
|
@@ -2971,6 +2758,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2971
2758
|
value: true
|
|
2972
2759
|
}));
|
|
2973
2760
|
exports.Service = void 0;
|
|
2761
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2974
2762
|
|
|
2975
2763
|
var errors_1 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
|
|
2976
2764
|
|
|
@@ -4015,6 +3803,7 @@ var $concat = bind.call(Function.call, Array.prototype.concat);
|
|
|
4015
3803
|
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
4016
3804
|
var $replace = bind.call(Function.call, String.prototype.replace);
|
|
4017
3805
|
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
3806
|
+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
4018
3807
|
|
|
4019
3808
|
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
4020
3809
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
@@ -4070,6 +3859,9 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|
|
4070
3859
|
throw new $TypeError('"allowMissing" argument must be a boolean');
|
|
4071
3860
|
}
|
|
4072
3861
|
|
|
3862
|
+
if ($exec(/^%?[^%]*%?$/g, name) === null) {
|
|
3863
|
+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
3864
|
+
}
|
|
4073
3865
|
var parts = stringToPath(name);
|
|
4074
3866
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
4075
3867
|
|
|
@@ -4311,8 +4103,9 @@ function addNumericSeparator(num, str) {
|
|
|
4311
4103
|
return $replace.call(str, sepRegex, '$&_');
|
|
4312
4104
|
}
|
|
4313
4105
|
|
|
4314
|
-
var
|
|
4315
|
-
var
|
|
4106
|
+
var utilInspect = __webpack_require__(/*! ./util.inspect */ "?c95a");
|
|
4107
|
+
var inspectCustom = utilInspect.custom;
|
|
4108
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
4316
4109
|
|
|
4317
4110
|
module.exports = function inspect_(obj, options, depth, seen) {
|
|
4318
4111
|
var opts = options || {};
|
|
@@ -4402,7 +4195,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
4402
4195
|
return inspect_(value, opts, depth + 1, seen);
|
|
4403
4196
|
}
|
|
4404
4197
|
|
|
4405
|
-
if (typeof obj === 'function') {
|
|
4198
|
+
if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
|
|
4406
4199
|
var name = nameOf(obj);
|
|
4407
4200
|
var keys = arrObjKeys(obj, inspect);
|
|
4408
4201
|
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
@@ -4432,15 +4225,15 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
4432
4225
|
}
|
|
4433
4226
|
if (isError(obj)) {
|
|
4434
4227
|
var parts = arrObjKeys(obj, inspect);
|
|
4435
|
-
if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
4228
|
+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
4436
4229
|
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
4437
4230
|
}
|
|
4438
4231
|
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
4439
4232
|
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
4440
4233
|
}
|
|
4441
4234
|
if (typeof obj === 'object' && customInspect) {
|
|
4442
|
-
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
|
|
4443
|
-
return obj
|
|
4235
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
4236
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
4444
4237
|
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
4445
4238
|
return obj.inspect();
|
|
4446
4239
|
}
|
|
@@ -5224,7 +5017,7 @@ var stringify = function stringify(
|
|
|
5224
5017
|
for (var i = 0; i < valuesArray.length; ++i) {
|
|
5225
5018
|
valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
|
|
5226
5019
|
}
|
|
5227
|
-
return [formatter(keyValue) + '=' + valuesJoined];
|
|
5020
|
+
return [formatter(keyValue) + (isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
|
|
5228
5021
|
}
|
|
5229
5022
|
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
|
|
5230
5023
|
}
|
|
@@ -5248,6 +5041,8 @@ var stringify = function stringify(
|
|
|
5248
5041
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
5249
5042
|
}
|
|
5250
5043
|
|
|
5044
|
+
var adjustedPrefix = generateArrayPrefix === 'comma' && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
|
|
5045
|
+
|
|
5251
5046
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
5252
5047
|
var key = objKeys[j];
|
|
5253
5048
|
var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
@@ -5257,8 +5052,8 @@ var stringify = function stringify(
|
|
|
5257
5052
|
}
|
|
5258
5053
|
|
|
5259
5054
|
var keyPrefix = isArray(obj)
|
|
5260
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(
|
|
5261
|
-
:
|
|
5055
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
|
|
5056
|
+
: adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
|
|
5262
5057
|
|
|
5263
5058
|
sideChannel.set(object, step);
|
|
5264
5059
|
var valueSideChannel = getSideChannel();
|
|
@@ -5894,7 +5689,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5894
5689
|
|
|
5895
5690
|
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); }
|
|
5896
5691
|
|
|
5897
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
5692
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
5898
5693
|
|
|
5899
5694
|
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); }; }
|
|
5900
5695
|
|
|
@@ -5904,7 +5699,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
5904
5699
|
|
|
5905
5700
|
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; } }
|
|
5906
5701
|
|
|
5907
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
5702
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
5908
5703
|
|
|
5909
5704
|
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); } }
|
|
5910
5705
|
|
|
@@ -6560,7 +6355,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6560
6355
|
Object.defineProperty(exports, "__esModule", ({
|
|
6561
6356
|
value: true
|
|
6562
6357
|
}));
|
|
6563
|
-
exports.collect = exports.fromErrorHook = exports.fromAfterHook = exports.fromBeforeHook = void 0;
|
|
6358
|
+
exports.collect = exports.fromErrorHook = exports.fromAfterHook = exports.fromBeforeHook = exports.runHooks = exports.runHook = void 0;
|
|
6564
6359
|
|
|
6565
6360
|
var compose_js_1 = __webpack_require__(/*! ./compose.js */ "../../node_modules/@feathersjs/hooks/script/compose.js");
|
|
6566
6361
|
|
|
@@ -6575,9 +6370,23 @@ var runHook = function runHook(hook, context, type) {
|
|
|
6575
6370
|
});
|
|
6576
6371
|
};
|
|
6577
6372
|
|
|
6373
|
+
exports.runHook = runHook;
|
|
6374
|
+
|
|
6375
|
+
var runHooks = function runHooks(hooks) {
|
|
6376
|
+
return function (context) {
|
|
6377
|
+
return hooks.reduce(function (promise, hook) {
|
|
6378
|
+
return promise.then(function () {
|
|
6379
|
+
return (0, exports.runHook)(hook, context);
|
|
6380
|
+
});
|
|
6381
|
+
}, Promise.resolve(context));
|
|
6382
|
+
};
|
|
6383
|
+
};
|
|
6384
|
+
|
|
6385
|
+
exports.runHooks = runHooks;
|
|
6386
|
+
|
|
6578
6387
|
function fromBeforeHook(hook) {
|
|
6579
6388
|
return function (context, next) {
|
|
6580
|
-
return runHook(hook, context, 'before').then(next);
|
|
6389
|
+
return (0, exports.runHook)(hook, context, 'before').then(next);
|
|
6581
6390
|
};
|
|
6582
6391
|
}
|
|
6583
6392
|
|
|
@@ -6586,7 +6395,7 @@ exports.fromBeforeHook = fromBeforeHook;
|
|
|
6586
6395
|
function fromAfterHook(hook) {
|
|
6587
6396
|
return function (context, next) {
|
|
6588
6397
|
return next().then(function () {
|
|
6589
|
-
return runHook(hook, context, 'after');
|
|
6398
|
+
return (0, exports.runHook)(hook, context, 'after');
|
|
6590
6399
|
});
|
|
6591
6400
|
};
|
|
6592
6401
|
}
|
|
@@ -6602,7 +6411,7 @@ function fromErrorHook(hook) {
|
|
|
6602
6411
|
delete context.result;
|
|
6603
6412
|
}
|
|
6604
6413
|
|
|
6605
|
-
return runHook(hook, context, 'error').then(function () {
|
|
6414
|
+
return (0, exports.runHook)(hook, context, 'error').then(function () {
|
|
6606
6415
|
if (context.result === undefined && context.error !== undefined) {
|
|
6607
6416
|
throw context.error;
|
|
6608
6417
|
}
|
|
@@ -6624,8 +6433,8 @@ function collect(_ref) {
|
|
|
6624
6433
|
|
|
6625
6434
|
var afterHooks = _toConsumableArray(after).reverse().map(fromAfterHook);
|
|
6626
6435
|
|
|
6627
|
-
var errorHooks = error.
|
|
6628
|
-
return (0, compose_js_1.compose)([].concat(
|
|
6436
|
+
var errorHooks = error.length ? [fromErrorHook((0, exports.runHooks)(error))] : [];
|
|
6437
|
+
return (0, compose_js_1.compose)([].concat(errorHooks, _toConsumableArray(beforeHooks), _toConsumableArray(afterHooks)));
|
|
6629
6438
|
}
|
|
6630
6439
|
|
|
6631
6440
|
exports.collect = collect;
|