@weapnl/js-junction 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ return /******/ (() => { // webpackBootstrap
26
26
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
27
27
 
28
28
  "use strict";
29
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Api)\n/* harmony export */ });\n/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./request */ \"./src/request.js\");\n/* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./batch */ \"./src/batch.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\nvar Api = /*#__PURE__*/function () {\n function Api() {\n _classCallCheck(this, Api);\n this.setHeader('X-Requested-With', 'XMLHttpRequest');\n this._requests = {};\n this.host('/').suffix('');\n this._onSuccess = function () {};\n this._onError = function () {};\n this._onValidationError = function () {};\n this._onUnauthorized = function () {};\n this._onForbidden = function () {};\n }\n\n /**\n * @param {string} host\n *\n * @returns {this} The current instance.\n */\n _createClass(Api, [{\n key: \"host\",\n value: function host(_host) {\n this._host = _host;\n return this;\n }\n\n /**\n * @param {string} suffix\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"suffix\",\n value: function suffix(_suffix) {\n if (!_.startsWith(_suffix, '/') && _suffix) {\n _suffix = \"/\".concat(_suffix);\n }\n this._suffix = _suffix;\n return this;\n }\n\n /**\n * @returns {string} Url containing the host and suffix.\n */\n }, {\n key: \"baseUrl\",\n get: function get() {\n var url = '';\n if (this._host) url += this._host;\n if (this._suffix) url += this._suffix;\n return url;\n }\n }, {\n key: \"cancelRunning\",\n value: function cancelRunning(request) {\n var _this$_requests$reque;\n if (!request.key) {\n return;\n }\n (_this$_requests$reque = this._requests[request.key]) === null || _this$_requests$reque === void 0 || _this$_requests$reque.cancel();\n this._requests[request.key] = request;\n }\n\n /**\n * @param {string} uri\n *\n * @returns {Request} The created request.\n */\n }, {\n key: \"request\",\n value: function request(uri) {\n if (!uri) throw new Error(\"Request url is empty.\");\n if (!_.startsWith(uri, '/')) {\n uri = \"/\".concat(uri);\n }\n var request = new _request__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n request.setUrl(uri).setApi(this).onSuccess(this._onSuccess).onError(this._onError).onValidationError(this._onValidationError).onUnauthorized(this._onUnauthorized).onForbidden(this._onForbidden);\n return request;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"cancelRequests\",\n value: function cancelRequests() {\n this._requests.forEach(function (request) {\n request.cancel();\n });\n this._requests = [];\n return this;\n }\n\n /**\n * @param {array} requests\n * @returns Batch\n */\n }, {\n key: \"batch\",\n value: function batch(requests) {\n return new _batch__WEBPACK_IMPORTED_MODULE_1__[\"default\"](requests);\n }\n\n /**\n * @param {string} token\n */\n }, {\n key: \"setBearer\",\n value: function setBearer(token) {\n this.setHeader('Authorization', 'Bearer ' + token);\n }\n }, {\n key: \"resetBearer\",\n value: function resetBearer() {\n this.removeHeader('Authorization');\n }\n\n /**\n * @param {string} token\n */\n }, {\n key: \"setCsrf\",\n value: function setCsrf(token) {\n this.setHeader('X-CSRF-TOKEN', token);\n }\n }, {\n key: \"resetCsrf\",\n value: function resetCsrf() {\n this.removeHeader('X-CSRF-TOKEN');\n }\n\n /**\n * @param {string} key\n * @param {string} value\n */\n }, {\n key: \"setHeader\",\n value: function setHeader(key, value) {\n axios__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaults.headers.common[key] = value;\n }\n\n /**\n * @param {string} key\n */\n }, {\n key: \"removeHeader\",\n value: function removeHeader(key) {\n delete axios__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaults.headers.common[key];\n }\n\n /**\n * Set the default 'onSuccess'. Can be overridden in the Request class.\n *\n * @param {function(Response.data)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onSuccess\",\n value: function onSuccess() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onSuccess = callback;\n return this;\n }\n\n /**\n * Set the default 'onError'. Can be overridden in the Request class.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onError\",\n value: function onError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onError = callback;\n return this;\n }\n\n /**\n * Set the default 'onValidationError'. Can be overridden in the Request class.\n *\n * @param {function(Response.validation)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onValidationError\",\n value: function onValidationError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onValidationError = callback;\n return this;\n }\n\n /**\n * Set the default 'onUnauthorized'. Can be overridden in the Request class.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onUnauthorized\",\n value: function onUnauthorized() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onUnauthorized = callback;\n return this;\n }\n\n /**\n * Set the default 'onForbidden'. Can be overridden in the Request class.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onForbidden\",\n value: function onForbidden() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onForbidden = callback;\n return this;\n }\n\n /**\n * @param {function(Response)} onSuccess\n * @param {function(Error)} onError\n *\n * @returns {this}\n */\n }, {\n key: \"responseInterceptors\",\n value: function responseInterceptors() {\n var onSuccess = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n var onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n axios__WEBPACK_IMPORTED_MODULE_2__[\"default\"].interceptors.response.use(function (response) {\n onSuccess(response);\n return response;\n }, function (error) {\n onError(error);\n return Promise.reject(error);\n });\n return this;\n }\n }]);\n return Api;\n}();\n\n\n//# sourceURL=webpack://Api/./src/api.js?");
29
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Api)\n/* harmony export */ });\n/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./request */ \"./src/request.js\");\n/* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./batch */ \"./src/batch.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\nvar Api = /*#__PURE__*/function () {\n function Api() {\n _classCallCheck(this, Api);\n this.setHeader('X-Requested-With', 'XMLHttpRequest');\n this._requests = [];\n this.host('/').suffix('');\n this._onSuccess = null;\n this._onError = null;\n this._onValidationError = null;\n this._onUnauthorized = null;\n this._onForbidden = null;\n this._onFinished = null;\n this._onCancelled = null;\n }\n\n /**\n * @param {string} host\n *\n * @returns {this} The current instance.\n */\n _createClass(Api, [{\n key: \"host\",\n value: function host(_host) {\n this._host = _host;\n return this;\n }\n\n /**\n * @param {string} suffix\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"suffix\",\n value: function suffix(_suffix) {\n if (!_.startsWith(_suffix, '/') && _suffix) {\n _suffix = \"/\".concat(_suffix);\n }\n this._suffix = _suffix;\n return this;\n }\n\n /**\n * @returns {string} Url containing the host and suffix.\n */\n }, {\n key: \"baseUrl\",\n get: function get() {\n var url = '';\n if (this._host) url += this._host;\n if (this._suffix) url += this._suffix;\n return url;\n }\n\n /**\n * @param {Request} request\n */\n }, {\n key: \"cancelRunning\",\n value: function cancelRunning(request) {\n var _this$_requests$reque;\n if (!request.key) {\n return;\n }\n (_this$_requests$reque = this._requests[request.key]) === null || _this$_requests$reque === void 0 || _this$_requests$reque.cancel();\n this._requests[request.key] = request;\n }\n\n /**\n * @param {Request} request\n */\n }, {\n key: \"removeRequest\",\n value: function removeRequest(request) {\n if (!request.key) {\n return;\n }\n if (request.response.isFinished) {\n delete this._requests[request.key];\n }\n }\n\n /**\n * @param {string} uri\n *\n * @returns {Request} The created request.\n */\n }, {\n key: \"request\",\n value: function request(uri) {\n if (!uri) throw new Error(\"Request url is empty.\");\n if (!_.startsWith(uri, '/')) {\n uri = \"/\".concat(uri);\n }\n var request = new _request__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n request.setUrl(uri).setApi(this);\n if (this._onSuccess) request.onSuccess(this._onSuccess);\n if (this._onError) request.onError(this._onError);\n if (this._onValidationError) request.onValidationError(this._onValidationError);\n if (this._onUnauthorized) request.onUnauthorized(this._onUnauthorized);\n if (this._onForbidden) request.onForbidden(this._onForbidden);\n if (this._onFinished) request.onFinished(this._onFinished);\n if (this._onCancelled) request.onCancelled(this._onCancelled);\n return request;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"cancelRequests\",\n value: function cancelRequests() {\n this._requests.forEach(function (request) {\n request.cancel();\n });\n this._requests = [];\n return this;\n }\n\n /**\n * @param {array} requests\n * @returns Batch\n */\n }, {\n key: \"batch\",\n value: function batch(requests) {\n return new _batch__WEBPACK_IMPORTED_MODULE_1__[\"default\"](requests);\n }\n\n /**\n * @param {string} token\n */\n }, {\n key: \"setBearer\",\n value: function setBearer(token) {\n this.setHeader('Authorization', 'Bearer ' + token);\n }\n }, {\n key: \"resetBearer\",\n value: function resetBearer() {\n this.removeHeader('Authorization');\n }\n\n /**\n * @param {string} token\n */\n }, {\n key: \"setCsrf\",\n value: function setCsrf(token) {\n this.setHeader('X-CSRF-TOKEN', token);\n }\n }, {\n key: \"resetCsrf\",\n value: function resetCsrf() {\n this.removeHeader('X-CSRF-TOKEN');\n }\n\n /**\n * @param {string} key\n * @param {string} value\n */\n }, {\n key: \"setHeader\",\n value: function setHeader(key, value) {\n axios__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaults.headers.common[key] = value;\n }\n\n /**\n * @param {string} key\n */\n }, {\n key: \"removeHeader\",\n value: function removeHeader(key) {\n delete axios__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaults.headers.common[key];\n }\n\n /**\n * Set the default 'onSuccess' event handler.\n *\n * @param {function(Response.data)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onSuccess\",\n value: function onSuccess() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onSuccess = callback;\n return this;\n }\n\n /**\n * Set the default 'onError' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onError\",\n value: function onError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onError = callback;\n return this;\n }\n\n /**\n * Set the default 'onValidationError' event handler.\n *\n * @param {function(Response.validation)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onValidationError\",\n value: function onValidationError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onValidationError = callback;\n return this;\n }\n\n /**\n * Set the default 'onUnauthorized' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onUnauthorized\",\n value: function onUnauthorized() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onUnauthorized = callback;\n return this;\n }\n\n /**\n * Set the default 'onForbidden' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onForbidden\",\n value: function onForbidden() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onForbidden = callback;\n return this;\n }\n\n /**\n * Set the default 'onFinished' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onFinished\",\n value: function onFinished() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onFinished = callback;\n return this;\n }\n\n /**\n * Set the default 'onCancelled' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onCancelled\",\n value: function onCancelled() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onCancelled = callback;\n return this;\n }\n\n /**\n * @param {function(Response)} onSuccess\n * @param {function(Error)} onError\n *\n * @returns {this}\n */\n }, {\n key: \"responseInterceptors\",\n value: function responseInterceptors() {\n var onSuccess = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n var onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n axios__WEBPACK_IMPORTED_MODULE_2__[\"default\"].interceptors.response.use(function (response) {\n onSuccess(response);\n return response;\n }, function (error) {\n onError(error);\n return Promise.reject(error);\n });\n return this;\n }\n }]);\n return Api;\n}();\n\n\n//# sourceURL=webpack://Api/./src/api.js?");
30
30
 
31
31
  /***/ }),
32
32
 
@@ -37,7 +37,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
37
37
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
38
38
 
39
39
  "use strict";
40
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Batch)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction 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); } }\nfunction _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); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar Batch = /*#__PURE__*/function () {\n function Batch(requests) {\n _classCallCheck(this, Batch);\n this._requests = requests;\n }\n _createClass(Batch, [{\n key: \"successful\",\n get: function get() {\n return _.isEmpty(this.failedRequests);\n }\n }, {\n key: \"successfulRequests\",\n get: function get() {\n return _.filter(this._requests, ['response.failed', false]);\n }\n }, {\n key: \"failedRequests\",\n get: function get() {\n return _.filter(this._requests, ['response.failed', true]);\n }\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", this.execute('get'));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get() {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", this.execute('post'));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post() {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this.execute('put'));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put() {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this.execute('delete'));\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete() {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }, {\n key: \"index\",\n value: function () {\n var _index = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n return _context5.abrupt(\"return\", this.execute('index'));\n case 1:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function index() {\n return _index.apply(this, arguments);\n }\n return index;\n }()\n }, {\n key: \"show\",\n value: function () {\n var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n return _context6.abrupt(\"return\", this.execute('show'));\n case 1:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function show() {\n return _show.apply(this, arguments);\n }\n return show;\n }()\n }, {\n key: \"store\",\n value: function () {\n var _store = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n return _context7.abrupt(\"return\", this.execute('store'));\n case 1:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function store() {\n return _store.apply(this, arguments);\n }\n return store;\n }()\n }, {\n key: \"update\",\n value: function () {\n var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n return _context8.abrupt(\"return\", this.execute('update'));\n case 1:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function update() {\n return _update.apply(this, arguments);\n }\n return update;\n }()\n }, {\n key: \"destroy\",\n value: function () {\n var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {\n return _regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n return _context9.abrupt(\"return\", this.execute('destroy'));\n case 1:\n case \"end\":\n return _context9.stop();\n }\n }, _callee9, this);\n }));\n function destroy() {\n return _destroy.apply(this, arguments);\n }\n return destroy;\n }()\n }, {\n key: \"save\",\n value: function () {\n var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {\n return _regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n return _context10.abrupt(\"return\", this.execute('save'));\n case 1:\n case \"end\":\n return _context10.stop();\n }\n }, _callee10, this);\n }));\n function save() {\n return _save.apply(this, arguments);\n }\n return save;\n }()\n }, {\n key: \"storeFiles\",\n value: function () {\n var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {\n return _regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n return _context11.abrupt(\"return\", this.execute('storeFiles'));\n case 1:\n case \"end\":\n return _context11.stop();\n }\n }, _callee11, this);\n }));\n function storeFiles() {\n return _storeFiles.apply(this, arguments);\n }\n return storeFiles;\n }()\n /**\n * @param {string} method The methods used to execute the requests. Should be `index`, `show`, `store`, `update` or `delete`.\n * @returns {array} List of results if all requests were successful.\n */\n }, {\n key: \"execute\",\n value: function () {\n var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(method) {\n return _regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n _context12.next = 2;\n return Promise.all(_.map(this._requests, function (request) {\n return request[method]();\n }));\n case 2:\n return _context12.abrupt(\"return\", _context12.sent);\n case 3:\n case \"end\":\n return _context12.stop();\n }\n }, _callee12, this);\n }));\n function execute(_x) {\n return _execute.apply(this, arguments);\n }\n return execute;\n }()\n }]);\n return Batch;\n}();\n\n\n//# sourceURL=webpack://Api/./src/batch.js?");
40
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Batch)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction 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); } }\nfunction _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); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar Batch = /*#__PURE__*/function () {\n function Batch(requests) {\n _classCallCheck(this, Batch);\n this._requests = requests;\n }\n _createClass(Batch, [{\n key: \"successful\",\n get: function get() {\n return _.isEmpty(this.failedRequests);\n }\n }, {\n key: \"successfulRequests\",\n get: function get() {\n return _.filter(this._requests, ['response.isFailed', false]);\n }\n }, {\n key: \"failedRequests\",\n get: function get() {\n return _.filter(this._requests, ['response.isFailed', true]);\n }\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", this.execute('get'));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get() {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", this.execute('post'));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post() {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this.execute('put'));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put() {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this.execute('delete'));\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete() {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }, {\n key: \"index\",\n value: function () {\n var _index = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n return _context5.abrupt(\"return\", this.execute('index'));\n case 1:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function index() {\n return _index.apply(this, arguments);\n }\n return index;\n }()\n }, {\n key: \"show\",\n value: function () {\n var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n return _context6.abrupt(\"return\", this.execute('show'));\n case 1:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function show() {\n return _show.apply(this, arguments);\n }\n return show;\n }()\n }, {\n key: \"store\",\n value: function () {\n var _store = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n return _context7.abrupt(\"return\", this.execute('store'));\n case 1:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function store() {\n return _store.apply(this, arguments);\n }\n return store;\n }()\n }, {\n key: \"update\",\n value: function () {\n var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n return _context8.abrupt(\"return\", this.execute('update'));\n case 1:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function update() {\n return _update.apply(this, arguments);\n }\n return update;\n }()\n }, {\n key: \"destroy\",\n value: function () {\n var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {\n return _regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n return _context9.abrupt(\"return\", this.execute('destroy'));\n case 1:\n case \"end\":\n return _context9.stop();\n }\n }, _callee9, this);\n }));\n function destroy() {\n return _destroy.apply(this, arguments);\n }\n return destroy;\n }()\n }, {\n key: \"save\",\n value: function () {\n var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {\n return _regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n return _context10.abrupt(\"return\", this.execute('save'));\n case 1:\n case \"end\":\n return _context10.stop();\n }\n }, _callee10, this);\n }));\n function save() {\n return _save.apply(this, arguments);\n }\n return save;\n }()\n }, {\n key: \"storeFiles\",\n value: function () {\n var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {\n return _regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n return _context11.abrupt(\"return\", this.execute('storeFiles'));\n case 1:\n case \"end\":\n return _context11.stop();\n }\n }, _callee11, this);\n }));\n function storeFiles() {\n return _storeFiles.apply(this, arguments);\n }\n return storeFiles;\n }()\n /**\n * @param {string} method The methods used to execute the requests. Should be `index`, `show`, `store`, `update` or `delete`.\n * @returns {array} List of results if all requests were successful.\n */\n }, {\n key: \"execute\",\n value: function () {\n var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(method) {\n return _regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n _context12.next = 2;\n return Promise.all(_.map(this._requests, function (request) {\n return request[method]();\n }));\n case 2:\n return _context12.abrupt(\"return\", _context12.sent);\n case 3:\n case \"end\":\n return _context12.stop();\n }\n }, _callee12, this);\n }));\n function execute(_x) {\n return _execute.apply(this, arguments);\n }\n return execute;\n }()\n }]);\n return Batch;\n}();\n\n\n//# sourceURL=webpack://Api/./src/batch.js?");
41
41
 
42
42
  /***/ }),
43
43
 
@@ -59,7 +59,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
59
59
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
60
60
 
61
61
  "use strict";
62
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Model)\n/* harmony export */ });\n/* harmony import */ var _properties_accessors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./properties/accessors */ \"./src/builder/properties/accessors.js\");\n/* harmony import */ var _properties_attributes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./properties/attributes */ \"./src/builder/properties/attributes.js\");\n/* harmony import */ var _properties_counts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./properties/counts */ \"./src/builder/properties/counts.js\");\n/* harmony import */ var _properties_relations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./properties/relations */ \"./src/builder/properties/relations.js\");\n/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../request */ \"./src/request.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction 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); } }\nfunction _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); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _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); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _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); }; }\nfunction _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); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _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; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\nvar Model = /*#__PURE__*/function (_Request) {\n _inherits(Model, _Request);\n var _super = _createSuper(Model);\n function Model() {\n var _this;\n var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Model);\n _this = _super.call(this);\n _this._accessors = new _properties_accessors__WEBPACK_IMPORTED_MODULE_0__[\"default\"](_assertThisInitialized(_this));\n _this._attributes = new _properties_attributes__WEBPACK_IMPORTED_MODULE_1__[\"default\"](_assertThisInitialized(_this));\n _this._counts = new _properties_counts__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assertThisInitialized(_this));\n _this._relations = new _properties_relations__WEBPACK_IMPORTED_MODULE_3__[\"default\"](_assertThisInitialized(_this));\n _this.setApi(api);\n _this.fill(defaults);\n return _this;\n }\n\n /**\n * Create an instance of the model for the given json object.\n *\n * @param {Object} json\n *\n * @returns {this} An instance of the model.\n */\n _createClass(Model, [{\n key: \"toJson\",\n value:\n /**\n * Convert the attributes of the current instance to json.\n *\n * @return {Object} The attributes of the current instance as json object.\n */\n function toJson() {\n return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, this._accessors.toJson()), this._attributes.toJson()), this._counts.toJson()), this._relations.toJson());\n }\n\n /**\n * @param values\n * @returns {this}\n */\n }, {\n key: \"fill\",\n value: function fill() {\n var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this._attributes.set(values);\n this._relations.set(values);\n return this;\n }\n\n /**\n * The accessors of the model which were appended on the api side.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"_identifier\",\n get:\n /**\n * @returns {int} Identifier attribute name of the model.\n */\n function get() {\n return _.get(this, 'id');\n }\n\n /**\n * Get a list of models.\n *\n * @returns {this[]} List of models.\n */\n }, {\n key: \"index\",\n value: function () {\n var _index = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this2 = this;\n var items;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this._connection.get(this._queryString(), this.bodyParameters);\n case 2:\n this._response = _context.sent;\n if (this._response.data) {\n items = _.map(this._response.data.items, function (item) {\n return _this2.constructor.fromJson(item);\n });\n }\n _context.next = 6;\n return this.triggerResponseEvents(this._response, items);\n case 6:\n return _context.abrupt(\"return\", items);\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function index() {\n return _index.apply(this, arguments);\n }\n return index;\n }()\n /**\n * Get a single model.\n *\n * @param {int} [identifier]\n *\n * @returns {this} Model found for the given id.\n */\n }, {\n key: \"show\",\n value: function () {\n var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(identifier) {\n var _identifier;\n var item;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n (_identifier = identifier) !== null && _identifier !== void 0 ? _identifier : identifier = this._identifier;\n if (identifier) {\n _context2.next = 3;\n break;\n }\n return _context2.abrupt(\"return\", null);\n case 3:\n _context2.next = 5;\n return this._connection.get(this._queryString(identifier), this.bodyParameters);\n case 5:\n this._response = _context2.sent;\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n _context2.next = 9;\n return this.triggerResponseEvents(this._response, item);\n case 9:\n return _context2.abrupt(\"return\", item);\n case 10:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function show(_x) {\n return _show.apply(this, arguments);\n }\n return show;\n }()\n /**\n * Create an model.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The created model.\n */\n }, {\n key: \"store\",\n value: function () {\n var _store = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var extraData,\n item,\n _args3 = arguments;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n extraData = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};\n _context3.next = 3;\n return this._connection.post(this._queryString(), _objectSpread(_objectSpread({}, this._attributes.toJson()), extraData));\n case 3:\n this._response = _context3.sent;\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n _context3.next = 7;\n return this.triggerResponseEvents(this._response, item);\n case 7:\n return _context3.abrupt(\"return\", item);\n case 8:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function store() {\n return _store.apply(this, arguments);\n }\n return store;\n }()\n /**\n * Update the current model.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The updated model.\n */\n }, {\n key: \"update\",\n value: function () {\n var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var extraData,\n item,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n extraData = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};\n _context4.next = 3;\n return this._connection.put(this._queryString(this._identifier), _objectSpread(_objectSpread({}, this._attributes.toJson()), extraData));\n case 3:\n this._response = _context4.sent;\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n _context4.next = 7;\n return this.triggerResponseEvents(this._response, item);\n case 7:\n return _context4.abrupt(\"return\", item);\n case 8:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function update() {\n return _update.apply(this, arguments);\n }\n return update;\n }()\n /**\n * Delete the current model.\n *\n * @returns {boolean} Whether the deletion was successful.\n */\n }, {\n key: \"destroy\",\n value: function () {\n var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return this._connection[\"delete\"](this._queryString(this._identifier));\n case 2:\n this._response = _context5.sent;\n _context5.next = 5;\n return this.triggerResponseEvents(this._response);\n case 5:\n return _context5.abrupt(\"return\", !!this._response.data);\n case 6:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function destroy() {\n return _destroy.apply(this, arguments);\n }\n return destroy;\n }()\n /**\n * Save the current model. Based on the value of the identifier `store` or `update` will be called.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The created or updated model.\n */\n }, {\n key: \"save\",\n value: function () {\n var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n var extraData,\n _args6 = arguments;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n extraData = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};\n return _context6.abrupt(\"return\", !this._identifier ? this.store(extraData) : this.update(extraData));\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function save() {\n return _save.apply(this, arguments);\n }\n return save;\n }()\n /**\n * @returns {this} The new clone of the current model.\n */\n }, {\n key: \"clone\",\n value: function clone() {\n return this.constructor.fromJson(this.toJson());\n }\n\n /**\n * Generate the query string for this model.\n * @private\n *\n * @param {int} [identifier] The identifier of the model.\n *\n * @returns {string} The querystring for the model.\n */\n }, {\n key: \"_queryString\",\n value: function _queryString(identifier) {\n return this.constructor.endpoint + (identifier ? \"/\".concat(identifier) : '');\n }\n }], [{\n key: \"fromJson\",\n value: function fromJson(json) {\n var instance = new this();\n instance._accessors.fromJson(json);\n instance._attributes.fromJson(json);\n instance._counts.fromJson(json);\n instance._relations.fromJson(json);\n return instance;\n }\n }, {\n key: \"accessors\",\n value: function accessors() {\n return {};\n }\n\n /**\n * The attributes of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"attributes\",\n value: function attributes() {\n return {};\n }\n\n /**\n * The counts of relations of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"counts\",\n value: function counts() {\n return {};\n }\n\n /**\n * The relations of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"relations\",\n value: function relations() {\n return {};\n }\n\n /**\n * @returns {string} Endpoint of the model for the API.\n */\n }, {\n key: \"endpoint\",\n get: function get() {\n throw new Error('No endpoint defined in the model.');\n }\n }]);\n return Model;\n}(_request__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n\n\n//# sourceURL=webpack://Api/./src/builder/model.js?");
62
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Model)\n/* harmony export */ });\n/* harmony import */ var _properties_accessors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./properties/accessors */ \"./src/builder/properties/accessors.js\");\n/* harmony import */ var _properties_attributes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./properties/attributes */ \"./src/builder/properties/attributes.js\");\n/* harmony import */ var _properties_counts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./properties/counts */ \"./src/builder/properties/counts.js\");\n/* harmony import */ var _properties_relations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./properties/relations */ \"./src/builder/properties/relations.js\");\n/* harmony import */ var _properties_mediaCollections__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./properties/mediaCollections */ \"./src/builder/properties/mediaCollections.js\");\n/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../request */ \"./src/request.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction 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); } }\nfunction _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); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _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); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _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); }; }\nfunction _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); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _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; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\nvar Model = /*#__PURE__*/function (_Request) {\n _inherits(Model, _Request);\n var _super = _createSuper(Model);\n function Model() {\n var _this;\n var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Model);\n _this = _super.call(this);\n _this._accessors = new _properties_accessors__WEBPACK_IMPORTED_MODULE_0__[\"default\"](_assertThisInitialized(_this));\n _this._attributes = new _properties_attributes__WEBPACK_IMPORTED_MODULE_1__[\"default\"](_assertThisInitialized(_this));\n _this._counts = new _properties_counts__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assertThisInitialized(_this));\n _this._relations = new _properties_relations__WEBPACK_IMPORTED_MODULE_3__[\"default\"](_assertThisInitialized(_this));\n _this._mediaCollections = new _properties_mediaCollections__WEBPACK_IMPORTED_MODULE_4__[\"default\"](_assertThisInitialized(_this));\n _this.setApi(api);\n _this.fill(defaults);\n return _this;\n }\n\n /**\n * Create an instance of the model for the given json object.\n *\n * @param {Object} json\n *\n * @returns {this} An instance of the model.\n */\n _createClass(Model, [{\n key: \"toJson\",\n value:\n /**\n * Convert the attributes of the current instance to json.\n *\n * @return {Object} The attributes of the current instance as json object.\n */\n function toJson() {\n return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, this._accessors.toJson(this)), this._attributes.toJson(this)), this._counts.toJson(this)), this._relations.toJson(this)), this._mediaCollections.toJson(this));\n }\n\n /**\n * @param values\n * @returns {this}\n */\n }, {\n key: \"fill\",\n value: function fill() {\n var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this._attributes.set(this, values);\n this._relations.set(this, values);\n return this;\n }\n\n /**\n * The accessors of the model which were appended on the api side.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"_identifier\",\n get:\n /**\n * @returns {int} Identifier attribute name of the model.\n */\n function get() {\n return _.get(this, 'id');\n }\n\n /**\n * Get a list of models.\n *\n * @returns {this[]} List of models.\n */\n }, {\n key: \"index\",\n value: function () {\n var _index = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this2 = this;\n var items;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n this._connection.cancelRunning(this);\n _context.next = 3;\n return this._connection.post(this._queryString() + '/index', this.bodyParameters);\n case 3:\n this._response = _context.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n items = _.map(this._response.data.items, function (item) {\n return _this2.constructor.fromJson(item);\n });\n }\n _context.next = 8;\n return this.triggerResponseEvents(this._response, items);\n case 8:\n return _context.abrupt(\"return\", items);\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function index() {\n return _index.apply(this, arguments);\n }\n return index;\n }()\n /**\n * Get a single model.\n *\n * @param {int} [identifier]\n *\n * @returns {this} Model found for the given id.\n */\n }, {\n key: \"show\",\n value: function () {\n var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(identifier) {\n var _identifier;\n var item;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n (_identifier = identifier) !== null && _identifier !== void 0 ? _identifier : identifier = this._identifier;\n if (identifier) {\n _context2.next = 3;\n break;\n }\n return _context2.abrupt(\"return\", null);\n case 3:\n this._connection.cancelRunning(this);\n _context2.next = 6;\n return this._connection.post(this._queryString(identifier) + '/show', this.bodyParameters);\n case 6:\n this._response = _context2.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n _context2.next = 11;\n return this.triggerResponseEvents(this._response, item);\n case 11:\n return _context2.abrupt(\"return\", item);\n case 12:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function show(_x) {\n return _show.apply(this, arguments);\n }\n return show;\n }()\n /**\n * Create an model.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The created model.\n */\n }, {\n key: \"store\",\n value: function () {\n var _store = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var extraData,\n item,\n _args3 = arguments;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n extraData = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};\n this._connection.cancelRunning(this);\n _context3.next = 4;\n return this._connection.post(this._queryString(), _objectSpread(_objectSpread(_objectSpread({}, this._attributes.toJson(this)), this._mediaCollections.toJson(this)), extraData));\n case 4:\n this._response = _context3.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n _context3.next = 9;\n return this.triggerResponseEvents(this._response, item);\n case 9:\n return _context3.abrupt(\"return\", item);\n case 10:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function store() {\n return _store.apply(this, arguments);\n }\n return store;\n }()\n /**\n * Update the current model.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The updated model.\n */\n }, {\n key: \"update\",\n value: function () {\n var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var extraData,\n item,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n extraData = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};\n this._connection.cancelRunning(this);\n _context4.next = 4;\n return this._connection.put(this._queryString(this._identifier), _objectSpread(_objectSpread(_objectSpread({}, this._attributes.toJson(this)), this._mediaCollections.toJson(this)), extraData));\n case 4:\n this._response = _context4.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n _context4.next = 9;\n return this.triggerResponseEvents(this._response, item);\n case 9:\n return _context4.abrupt(\"return\", item);\n case 10:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function update() {\n return _update.apply(this, arguments);\n }\n return update;\n }()\n /**\n * Delete the current model.\n *\n * @returns {boolean} Whether the deletion was successful.\n */\n }, {\n key: \"destroy\",\n value: function () {\n var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n this._connection.cancelRunning(this);\n _context5.next = 3;\n return this._connection[\"delete\"](this._queryString(this._identifier));\n case 3:\n this._response = _context5.sent;\n this._connection.removeRequest(this);\n _context5.next = 7;\n return this.triggerResponseEvents(this._response);\n case 7:\n return _context5.abrupt(\"return\", !!this._response.data);\n case 8:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function destroy() {\n return _destroy.apply(this, arguments);\n }\n return destroy;\n }()\n /**\n * Upload an temporary media file to the API.\n *\n * @param {array|File} [files] The uploaded file or files.\n * @param {string} [collection] The name of the file collection.\n *\n * @returns {array} The received media ids.\n */\n }, {\n key: \"upload\",\n value: function () {\n var _upload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(files, collection) {\n var _this$_media;\n var filesArray, request;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n (_this$_media = this._media) !== null && _this$_media !== void 0 ? _this$_media : this._media = {};\n filesArray = (Array.isArray(files) ? files : [files]).filter(function (value) {\n return value !== null;\n });\n if (!(filesArray.length === 0)) {\n _context6.next = 5;\n break;\n }\n this._media[collection] = {};\n return _context6.abrupt(\"return\");\n case 5:\n _context6.next = 7;\n return this.storeFiles({\n files: _.flatMapDeep(filesArray)\n }, {}, '/media/upload');\n case 7:\n request = _context6.sent;\n this._media[collection] = request._response.data;\n return _context6.abrupt(\"return\", request._response.data);\n case 10:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function upload(_x2, _x3) {\n return _upload.apply(this, arguments);\n }\n return upload;\n }()\n /**\n * Save the current model. Based on the value of the identifier `store` or `update` will be called.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The created or updated model.\n */\n }, {\n key: \"save\",\n value: function () {\n var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n var extraData,\n _args7 = arguments;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n extraData = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};\n return _context7.abrupt(\"return\", !this._identifier ? this.store(extraData) : this.update(extraData));\n case 2:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function save() {\n return _save.apply(this, arguments);\n }\n return save;\n }()\n /**\n * @returns {this} The new clone of the current model.\n */\n }, {\n key: \"clone\",\n value: function clone() {\n return this.constructor.fromJson(this.toJson());\n }\n\n /**\n * Generate the query string for this model.\n * @private\n *\n * @param {int} [identifier] The identifier of the model.\n *\n * @returns {string} The querystring for the model.\n */\n }, {\n key: \"_queryString\",\n value: function _queryString(identifier) {\n return this.constructor.endpoint + (identifier ? \"/\".concat(identifier) : '');\n }\n }], [{\n key: \"fromJson\",\n value: function fromJson(json) {\n var instance = new this();\n instance._accessors.fromJson(instance, json);\n instance._attributes.fromJson(instance, json);\n instance._counts.fromJson(instance, json);\n instance._relations.fromJson(instance, json);\n return instance;\n }\n }, {\n key: \"accessors\",\n value: function accessors() {\n return {};\n }\n\n /**\n * The attributes of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"attributes\",\n value: function attributes() {\n return {};\n }\n\n /**\n * The counts of relations of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"counts\",\n value: function counts() {\n return {};\n }\n\n /**\n * The relations of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"relations\",\n value: function relations() {\n return {};\n }\n\n /**\n * The media collections of the model\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"mediaCollections\",\n value: function mediaCollections() {\n return {};\n }\n\n /**\n * @returns {string} Endpoint of the model for the API.\n */\n }, {\n key: \"endpoint\",\n get: function get() {\n throw new Error('No endpoint defined in the model.');\n }\n }]);\n return Model;\n}(_request__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n\n\n//# sourceURL=webpack://Api/./src/builder/model.js?");
63
63
 
64
64
  /***/ }),
65
65
 
@@ -70,7 +70,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
70
70
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
71
71
 
72
72
  "use strict";
73
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Accessors)\n/* harmony export */ });\n/* harmony import */ var _caster__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../caster */ \"./src/builder/caster.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\n\n/**\n * @implements {Property}\n */\nvar _model = /*#__PURE__*/new WeakMap();\nvar Accessors = /*#__PURE__*/function () {\n /**\n * @param {Model} model Instance of the model.\n */\n function Accessors(model) {\n var _this = this;\n _classCallCheck(this, Accessors);\n _classPrivateFieldInitSpec(this, _model, {\n writable: true,\n value: void 0\n });\n _classPrivateFieldSet(this, _model, model);\n _.each(model.constructor.accessors(), function (options, key) {\n _this.set(key, _.has(options, 'default') ? options[\"default\"] : null);\n });\n }\n\n /**\n * @param {Object} json.\n */\n _createClass(Accessors, [{\n key: \"fromJson\",\n value: function fromJson(json) {\n var _this2 = this;\n _.each(_classPrivateFieldGet(this, _model).constructor.accessors(), function (options, key) {\n var _options$jsonKey;\n var value = _.get(json, (_options$jsonKey = options.jsonKey) !== null && _options$jsonKey !== void 0 ? _options$jsonKey : _.snakeCase(key), _.get(json, _.camelCase(key)));\n if (_.isNil(value)) {\n value = _.has(options, 'default') ? options[\"default\"] : null;\n } else {\n value = Accessors._getCastedFromJsonValue(value, options);\n }\n _this2.set(key, value);\n });\n }\n\n /**\n * @return {Object} The attributes casted to a json object.\n */\n }, {\n key: \"toJson\",\n value: function toJson() {\n var _this3 = this;\n var json = {};\n _.each(_classPrivateFieldGet(this, _model).constructor.accessors(), function (options, key) {\n var _options$jsonKey2;\n var jsonValue = _this3.get(key);\n jsonValue = Accessors._getCastedToJsonValue(jsonValue, options);\n _.set(json, (_options$jsonKey2 = options.jsonKey) !== null && _options$jsonKey2 !== void 0 ? _options$jsonKey2 : _.snakeCase(key), jsonValue);\n });\n return json;\n }\n\n /**\n * @param {string} attribute\n *\n * @returns {*} The value of the attribute.\n */\n }, {\n key: \"get\",\n value: function get(attribute) {\n return _.get(_classPrivateFieldGet(this, _model), attribute);\n }\n\n /**\n * @param {string} attribute\n * @param {*} value\n *\n * @returns {*} The value that was set.\n */\n }, {\n key: \"set\",\n value: function set(attribute, value) {\n _classPrivateFieldGet(this, _model)[attribute] = value;\n return value;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }], [{\n key: \"_getCastedFromJsonValue\",\n value: function _getCastedFromJsonValue(value, options) {\n if (_.has(options, 'type') || _.has(options, 'fromJson')) {\n var cast = options.type ? options.type : options.fromJson;\n if (_.isArray(value)) {\n return _.map(value, function (val) {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, val);\n });\n } else {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, value);\n }\n }\n return value;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }, {\n key: \"_getCastedToJsonValue\",\n value: function _getCastedToJsonValue(value, options) {\n if (_.has(options, 'type') || _.has(options, 'toJson')) {\n var cast = options.type ? options.type : options.toJson;\n if (_.isArray(value)) {\n return _.map(value, function (val) {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, val);\n });\n } else {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, value);\n }\n }\n return value;\n }\n }]);\n return Accessors;\n}();\n\n\n//# sourceURL=webpack://Api/./src/builder/properties/accessors.js?");
73
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Accessors)\n/* harmony export */ });\n/* harmony import */ var _caster__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../caster */ \"./src/builder/caster.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n/**\n * @implements {Property}\n */\nvar Accessors = /*#__PURE__*/function () {\n /**\n * @param {Model} model Instance of the model.\n */\n function Accessors(model) {\n var _this = this;\n _classCallCheck(this, Accessors);\n _.each(model.constructor.accessors(), function (options, key) {\n _this.set(model, key, _.has(options, 'default') ? options[\"default\"] : null);\n });\n }\n\n /**\n * @param {Model} model\n * @param {Object} json.\n */\n _createClass(Accessors, [{\n key: \"fromJson\",\n value: function fromJson(model, json) {\n var _this2 = this;\n _.each(model.constructor.accessors(), function (options, key) {\n var _options$jsonKey;\n var value = _.get(json, (_options$jsonKey = options.jsonKey) !== null && _options$jsonKey !== void 0 ? _options$jsonKey : _.snakeCase(key), _.get(json, _.camelCase(key)));\n if (_.isNil(value)) {\n value = _.has(options, 'default') ? options[\"default\"] : null;\n } else {\n value = Accessors._getCastedFromJsonValue(value, options);\n }\n _this2.set(model, key, value);\n });\n }\n\n /**\n * @param {Model} model\n *\n * @return {Object} The attributes casted to a json object.\n */\n }, {\n key: \"toJson\",\n value: function toJson(model) {\n var _this3 = this;\n var json = {};\n _.each(model.constructor.accessors(), function (options, key) {\n var _options$jsonKey2;\n var jsonValue = _this3.get(model, key);\n jsonValue = Accessors._getCastedToJsonValue(jsonValue, options);\n _.set(json, (_options$jsonKey2 = options.jsonKey) !== null && _options$jsonKey2 !== void 0 ? _options$jsonKey2 : _.snakeCase(key), jsonValue);\n });\n return json;\n }\n\n /**\n * @param {Model} model\n * @param {string} attribute\n *\n * @returns {*} The value of the attribute.\n */\n }, {\n key: \"get\",\n value: function get(model, attribute) {\n return _.get(model, attribute);\n }\n\n /**\n * @param {Model} model\n * @param {string} attribute\n * @param {*} value\n *\n * @returns {*} The value that was set.\n */\n }, {\n key: \"set\",\n value: function set(model, attribute, value) {\n model[attribute] = value;\n return value;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }], [{\n key: \"_getCastedFromJsonValue\",\n value: function _getCastedFromJsonValue(value, options) {\n if (_.has(options, 'type') || _.has(options, 'fromJson')) {\n var cast = options.type ? options.type : options.fromJson;\n if (_.isArray(value)) {\n return _.map(value, function (val) {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, val);\n });\n } else {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, value);\n }\n }\n return value;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }, {\n key: \"_getCastedToJsonValue\",\n value: function _getCastedToJsonValue(value, options) {\n if (_.has(options, 'type') || _.has(options, 'toJson')) {\n var cast = options.type ? options.type : options.toJson;\n if (_.isArray(value)) {\n return _.map(value, function (val) {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, val);\n });\n } else {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, value);\n }\n }\n return value;\n }\n }]);\n return Accessors;\n}();\n\n\n//# sourceURL=webpack://Api/./src/builder/properties/accessors.js?");
74
74
 
75
75
  /***/ }),
76
76
 
@@ -81,7 +81,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
81
81
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
82
82
 
83
83
  "use strict";
84
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Attributes)\n/* harmony export */ });\n/* harmony import */ var _caster__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../caster */ \"./src/builder/caster.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\n\n/**\n * @implements {Property}\n */\nvar _model = /*#__PURE__*/new WeakMap();\nvar Attributes = /*#__PURE__*/function () {\n /**\n * @param {Model} model Instance of the model.\n */\n function Attributes(model) {\n var _this = this;\n _classCallCheck(this, Attributes);\n _classPrivateFieldInitSpec(this, _model, {\n writable: true,\n value: void 0\n });\n _classPrivateFieldSet(this, _model, model);\n _.each(model.constructor.attributes(), function (options, key) {\n _this.set(key, _.has(options, 'default') ? options[\"default\"] : null);\n });\n }\n\n /**\n * @param {Object} json.\n */\n _createClass(Attributes, [{\n key: \"fromJson\",\n value: function fromJson(json) {\n var _this2 = this;\n _.each(_classPrivateFieldGet(this, _model).constructor.attributes(), function (options, key) {\n var _options$jsonKey;\n var value = _.get(json, (_options$jsonKey = options.jsonKey) !== null && _options$jsonKey !== void 0 ? _options$jsonKey : _.snakeCase(key), _.get(json, _.camelCase(key)));\n if (_.isNil(value)) {\n value = _.has(options, 'default') ? options[\"default\"] : null;\n } else {\n value = Attributes._getCastedFromJsonValue(value, options);\n }\n _this2.set(key, value);\n });\n }\n\n /**\n * @return {Object} The attributes casted to a json object.\n */\n }, {\n key: \"toJson\",\n value: function toJson() {\n var _this3 = this;\n var json = {};\n _.each(_classPrivateFieldGet(this, _model).constructor.attributes(), function (options, key) {\n var _options$jsonKey2;\n var jsonValue = _this3.get(key);\n jsonValue = Attributes._getCastedToJsonValue(jsonValue, options);\n _.set(json, (_options$jsonKey2 = options.jsonKey) !== null && _options$jsonKey2 !== void 0 ? _options$jsonKey2 : _.snakeCase(key), jsonValue);\n });\n return json;\n }\n\n /**\n * @param {string} attribute\n *\n * @returns {*} The value of the attribute.\n */\n }, {\n key: \"get\",\n value: function get(attribute) {\n return _.get(_classPrivateFieldGet(this, _model), attribute);\n }\n\n /**\n * @param {string|Object} attribute\n * @param {*} value\n *\n * @returns {Attributes}\n */\n }, {\n key: \"set\",\n value: function set(attribute) {\n var _this4 = this;\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n if (_.isObject(attribute)) {\n _.each(_classPrivateFieldGet(this, _model).constructor.attributes(), function (options, key) {\n if (!_.has(attribute, key)) return;\n _this4.set(key, attribute[key]);\n });\n return this;\n }\n _classPrivateFieldGet(this, _model)[attribute] = value;\n return this;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }], [{\n key: \"_getCastedFromJsonValue\",\n value: function _getCastedFromJsonValue(value, options) {\n if (_.has(options, 'type') || _.has(options, 'fromJson')) {\n var cast = options.type ? options.type : options.fromJson;\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, value);\n }\n return value;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }, {\n key: \"_getCastedToJsonValue\",\n value: function _getCastedToJsonValue(value, options) {\n if (_.has(options, 'type') || _.has(options, 'toJson')) {\n var cast = options.type ? options.type : options.toJson;\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, value);\n }\n return value;\n }\n }]);\n return Attributes;\n}();\n\n\n//# sourceURL=webpack://Api/./src/builder/properties/attributes.js?");
84
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Attributes)\n/* harmony export */ });\n/* harmony import */ var _caster__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../caster */ \"./src/builder/caster.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n/**\n * @implements {Property}\n */\nvar Attributes = /*#__PURE__*/function () {\n /**\n * @param {Model} model Instance of the model.\n */\n function Attributes(model) {\n var _this = this;\n _classCallCheck(this, Attributes);\n _.each(model.constructor.attributes(), function (options, key) {\n _this.set(model, key, _.has(options, 'default') ? options[\"default\"] : null);\n });\n }\n\n /**\n * @param {Model} model\n * @param {Object} json.\n */\n _createClass(Attributes, [{\n key: \"fromJson\",\n value: function fromJson(model, json) {\n var _this2 = this;\n _.each(model.constructor.attributes(), function (options, key) {\n var _options$jsonKey;\n var value = _.get(json, (_options$jsonKey = options.jsonKey) !== null && _options$jsonKey !== void 0 ? _options$jsonKey : _.snakeCase(key), _.get(json, _.camelCase(key)));\n if (_.isNil(value)) {\n value = _.has(options, 'default') ? options[\"default\"] : null;\n } else {\n value = Attributes._getCastedFromJsonValue(value, options);\n }\n _this2.set(model, key, value);\n });\n }\n\n /**\n * @param {Model} model\n *\n * @return {Object} The attributes casted to a json object.\n */\n }, {\n key: \"toJson\",\n value: function toJson(model) {\n var _this3 = this;\n var json = {};\n _.each(model.constructor.attributes(), function (options, key) {\n var _options$jsonKey2;\n var jsonValue = _this3.get(model, key);\n jsonValue = Attributes._getCastedToJsonValue(jsonValue, options);\n _.set(json, (_options$jsonKey2 = options.jsonKey) !== null && _options$jsonKey2 !== void 0 ? _options$jsonKey2 : _.snakeCase(key), jsonValue);\n });\n return json;\n }\n\n /**\n * @param {Model} model\n * @param {string} attribute\n *\n * @returns {*} The value of the attribute.\n */\n }, {\n key: \"get\",\n value: function get(model, attribute) {\n return _.get(model, attribute);\n }\n\n /**\n * @param {Model} model\n * @param {string|Object} attribute\n * @param {*} value\n *\n * @returns {Attributes}\n */\n }, {\n key: \"set\",\n value: function set(model, attribute) {\n var _this4 = this;\n var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n if (_.isObject(attribute)) {\n _.each(model.constructor.attributes(), function (options, key) {\n if (!_.has(attribute, key)) return;\n _this4.set(model, key, attribute[key]);\n });\n return this;\n }\n model[attribute] = value;\n return this;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }], [{\n key: \"_getCastedFromJsonValue\",\n value: function _getCastedFromJsonValue(value, options) {\n if (_.has(options, 'type') || _.has(options, 'fromJson')) {\n var cast = options.type ? options.type : options.fromJson;\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, value);\n }\n return value;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }, {\n key: \"_getCastedToJsonValue\",\n value: function _getCastedToJsonValue(value, options) {\n if (_.has(options, 'type') || _.has(options, 'toJson')) {\n var cast = options.type ? options.type : options.toJson;\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, value);\n }\n return value;\n }\n }]);\n return Attributes;\n}();\n\n\n//# sourceURL=webpack://Api/./src/builder/properties/attributes.js?");
85
85
 
86
86
  /***/ }),
87
87
 
@@ -92,7 +92,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
92
92
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
93
93
 
94
94
  "use strict";
95
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Counts)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\nvar _model = /*#__PURE__*/new WeakMap();\n/**\n * @implements {Property}\n */\nvar Counts = /*#__PURE__*/function () {\n /**\n * @param {Model} model Instance of the model.\n */\n function Counts(model) {\n var _this = this;\n _classCallCheck(this, Counts);\n _classPrivateFieldInitSpec(this, _model, {\n writable: true,\n value: void 0\n });\n _classPrivateFieldSet(this, _model, model);\n _.each(model.constructor.counts(), function (options, key) {\n _this.set(_this.key(key, true), _.has(options, 'default') ? options[\"default\"] : null);\n });\n }\n\n /**\n * @param {Object} json.\n */\n _createClass(Counts, [{\n key: \"fromJson\",\n value: function fromJson(json) {\n var _this2 = this;\n _.each(_classPrivateFieldGet(this, _model).constructor.counts(), function (options, key) {\n var value = _.get(json, _this2.key(key));\n value = value !== undefined ? _.toInteger(value) : null;\n _this2.set(_this2.key(key, true), value);\n });\n }\n\n /**\n * @return {Object} The attributes casted to a json object.\n */\n }, {\n key: \"toJson\",\n value: function toJson() {\n var _this3 = this;\n var json = {};\n _.each(_classPrivateFieldGet(this, _model).constructor.counts(), function (options, key) {\n _.set(json, key, _this3.get(key));\n });\n return json;\n }\n\n /**\n * @param {string} attribute\n *\n * @returns {*} The value of the attribute.\n */\n }, {\n key: \"get\",\n value: function get(attribute) {\n return _.get(_classPrivateFieldGet(this, _model), this.key(attribute, true));\n }\n\n /**\n * @param {string} attribute\n * @param {*} value\n *\n * @returns {*} The value that was set.\n */\n }, {\n key: \"set\",\n value: function set(attribute, value) {\n _classPrivateFieldGet(this, _model)[this.key(attribute, true)] = value;\n return value;\n }\n\n /**\n * @param {string} key\n * @param {boolean} camelCase\n * @returns {string} The key with `count` appended to it, in specified casing.\n */\n }, {\n key: \"key\",\n value: function key(_key) {\n var camelCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n _key = _.snakeCase(_key);\n if (!_.endsWith(_key, '_count')) {\n _key = \"\".concat(_key, \"_count\");\n }\n return camelCase ? _.camelCase(_key) : _key;\n }\n }]);\n return Counts;\n}();\n\n\n//# sourceURL=webpack://Api/./src/builder/properties/counts.js?");
95
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Counts)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @implements {Property}\n */\nvar Counts = /*#__PURE__*/function () {\n /**\n * @param {Model} model Instance of the model.\n */\n function Counts(model) {\n var _this = this;\n _classCallCheck(this, Counts);\n _.each(model.constructor.counts(), function (options, key) {\n _this.set(model, _this.key(key, true), _.has(options, 'default') ? options[\"default\"] : null);\n });\n }\n\n /**\n * @param {Model} model\n * @param {Object} json.\n */\n _createClass(Counts, [{\n key: \"fromJson\",\n value: function fromJson(model, json) {\n var _this2 = this;\n _.each(model.constructor.counts(), function (options, key) {\n var value = _.get(json, _this2.key(key));\n value = value !== undefined ? _.toInteger(value) : null;\n _this2.set(model, _this2.key(key, true), value);\n });\n }\n\n /**\n * @param {Model} model\n *\n * @return {Object} The attributes casted to a json object.\n */\n }, {\n key: \"toJson\",\n value: function toJson(model) {\n var _this3 = this;\n var json = {};\n _.each(model.constructor.counts(), function (options, key) {\n _.set(json, key, _this3.get(model, key));\n });\n return json;\n }\n\n /**\n * @param {Model} model\n * @param {string} attribute\n *\n * @returns {*} The value of the attribute.\n */\n }, {\n key: \"get\",\n value: function get(model, attribute) {\n return _.get(model, this.key(attribute, true));\n }\n\n /**\n * @param {Model} model\n * @param {string} attribute\n * @param {*} value\n *\n * @returns {*} The value that was set.\n */\n }, {\n key: \"set\",\n value: function set(model, attribute, value) {\n model[this.key(attribute, true)] = value;\n return value;\n }\n\n /**\n * @param {string} key\n * @param {boolean} camelCase\n * @returns {string} The key with `count` appended to it, in specified casing.\n */\n }, {\n key: \"key\",\n value: function key(_key) {\n var camelCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n _key = _.snakeCase(_key);\n if (!_.endsWith(_key, '_count')) {\n _key = \"\".concat(_key, \"_count\");\n }\n return camelCase ? _.camelCase(_key) : _key;\n }\n }]);\n return Counts;\n}();\n\n\n//# sourceURL=webpack://Api/./src/builder/properties/counts.js?");
96
+
97
+ /***/ }),
98
+
99
+ /***/ "./src/builder/properties/mediaCollections.js":
100
+ /*!****************************************************!*\
101
+ !*** ./src/builder/properties/mediaCollections.js ***!
102
+ \****************************************************/
103
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
104
+
105
+ "use strict";
106
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MediaCollections)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @implements {Property}\n */\nvar MediaCollections = /*#__PURE__*/function () {\n /**\n * @param {Model} model Instance of the model.\n */\n function MediaCollections(model) {\n _classCallCheck(this, MediaCollections);\n }\n\n /**\n * @param {Model} model\n *\n * @return {Object} The attributes casted to a json object.\n */\n _createClass(MediaCollections, [{\n key: \"toJson\",\n value: function toJson(model) {\n var json = {};\n _.each(model.constructor.mediaCollections(), function (options, key) {\n var _options$jsonKey;\n var mediaPrefix = '_media.';\n var value = _.get(model, (_options$jsonKey = options.jsonKey) !== null && _options$jsonKey !== void 0 ? _options$jsonKey : mediaPrefix + key, _.get(model, mediaPrefix + _.camelCase(key)));\n _.set(json, mediaPrefix + key, value !== null && value !== void 0 ? value : []);\n });\n return json;\n }\n }]);\n return MediaCollections;\n}();\n\n\n//# sourceURL=webpack://Api/./src/builder/properties/mediaCollections.js?");
96
107
 
97
108
  /***/ }),
98
109
 
@@ -103,7 +114,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
103
114
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
104
115
 
105
116
  "use strict";
106
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Relations)\n/* harmony export */ });\n/* harmony import */ var _caster__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../caster */ \"./src/builder/caster.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\n\n/**\n * @implements {Property}\n */\nvar _model = /*#__PURE__*/new WeakMap();\nvar Relations = /*#__PURE__*/function () {\n /**\n * @param {Model} model Instance of the model.\n */\n function Relations(model) {\n var _this = this;\n _classCallCheck(this, Relations);\n _classPrivateFieldInitSpec(this, _model, {\n writable: true,\n value: void 0\n });\n _classPrivateFieldSet(this, _model, model);\n _.each(model.constructor.relations(), function (options, key) {\n _this.set(key, _.has(options, 'default') ? options[\"default\"] : null);\n });\n }\n\n /**\n * @param {Object} json.\n */\n _createClass(Relations, [{\n key: \"fromJson\",\n value: function fromJson(json) {\n var _this2 = this;\n _.each(_classPrivateFieldGet(this, _model).constructor.relations(), function (options, key) {\n var _options$jsonKey;\n var value = _.get(json, (_options$jsonKey = options.jsonKey) !== null && _options$jsonKey !== void 0 ? _options$jsonKey : _.snakeCase(key), _.get(json, _.camelCase(key)));\n value = value ? Relations._getCastedFromJsonValue(value, options) : value;\n _this2.set(key, value);\n });\n }\n\n /**\n * @return {Object} The attributes casted to a json object.\n */\n }, {\n key: \"toJson\",\n value: function toJson() {\n var _this3 = this;\n var json = {};\n _.each(_classPrivateFieldGet(this, _model).constructor.relations(), function (options, key) {\n var _options$jsonKey2;\n var jsonValue = _this3.get(key);\n jsonValue = Relations._getCastedToJsonValue(jsonValue, options);\n _.set(json, (_options$jsonKey2 = options.jsonKey) !== null && _options$jsonKey2 !== void 0 ? _options$jsonKey2 : _.snakeCase(key), jsonValue);\n });\n return json;\n }\n\n /**\n * @param {string} relation\n *\n * @returns {*} The value of the relation.\n */\n }, {\n key: \"get\",\n value: function get(relation) {\n return _.get(_classPrivateFieldGet(this, _model), relation);\n }\n\n /**\n * @param {string|Object} relation\n * @param {*} value\n *\n * @returns {Relations}\n */\n }, {\n key: \"set\",\n value: function set(relation) {\n var _this4 = this;\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n if (_.isObject(relation)) {\n _.each(_classPrivateFieldGet(this, _model).constructor.relations(), function (options, key) {\n if (!_.has(relation, key)) return;\n _this4.set(key, relation[key]);\n });\n return this;\n }\n _classPrivateFieldGet(this, _model)[relation] = value;\n return this;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }], [{\n key: \"_getCastedFromJsonValue\",\n value: function _getCastedFromJsonValue(value, options) {\n if (_.has(options, 'type')) {\n var cast = options.type;\n if (_.isArray(value)) {\n return _.map(value, function (val) {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, val);\n });\n } else {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, value);\n }\n }\n return value;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }, {\n key: \"_getCastedToJsonValue\",\n value: function _getCastedToJsonValue(value, options) {\n if (_.has(options, 'type')) {\n var cast = options.type;\n if (_.isArray(value)) {\n return _.map(value, function (val) {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, val);\n });\n } else {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, value);\n }\n }\n return value;\n }\n }]);\n return Relations;\n}();\n\n\n//# sourceURL=webpack://Api/./src/builder/properties/relations.js?");
117
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Relations)\n/* harmony export */ });\n/* harmony import */ var _caster__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../caster */ \"./src/builder/caster.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n/**\n * @implements {Property}\n */\nvar Relations = /*#__PURE__*/function () {\n /**\n * @param {Model} model Instance of the model.\n */\n function Relations(model) {\n var _this = this;\n _classCallCheck(this, Relations);\n _.each(model.constructor.relations(), function (options, key) {\n _this.set(model, key, _.has(options, 'default') ? options[\"default\"] : null);\n });\n }\n\n /**\n * @param {Model} model\n * @param {Object} json.\n */\n _createClass(Relations, [{\n key: \"fromJson\",\n value: function fromJson(model, json) {\n var _this2 = this;\n _.each(model.constructor.relations(), function (options, key) {\n var _options$jsonKey;\n var value = _.get(json, (_options$jsonKey = options.jsonKey) !== null && _options$jsonKey !== void 0 ? _options$jsonKey : _.snakeCase(key), _.get(json, _.camelCase(key)));\n value = value ? Relations._getCastedFromJsonValue(value, options) : value;\n _this2.set(model, key, value);\n });\n }\n\n /**\n * @param {Model} model\n *\n * @return {Object} The attributes casted to a json object.\n */\n }, {\n key: \"toJson\",\n value: function toJson(model) {\n var _this3 = this;\n var json = {};\n _.each(model.constructor.relations(), function (options, key) {\n var _options$jsonKey2;\n var jsonValue = _this3.get(model, key);\n jsonValue = Relations._getCastedToJsonValue(jsonValue, options);\n _.set(json, (_options$jsonKey2 = options.jsonKey) !== null && _options$jsonKey2 !== void 0 ? _options$jsonKey2 : _.snakeCase(key), jsonValue);\n });\n return json;\n }\n\n /**\n * @param {Model} model\n * @param {string} relation\n *\n * @returns {*} The value of the relation.\n */\n }, {\n key: \"get\",\n value: function get(model, relation) {\n return _.get(model, relation);\n }\n\n /**\n * @param {Model} model\n * @param {string|Object} relation\n * @param {*} value\n *\n * @returns {Relations}\n */\n }, {\n key: \"set\",\n value: function set(model, relation) {\n var _this4 = this;\n var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n if (_.isObject(relation)) {\n _.each(model.constructor.relations(), function (options, key) {\n if (!_.has(relation, key)) return;\n _this4.set(model, key, relation[key]);\n });\n return this;\n }\n model[relation] = value;\n return this;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }], [{\n key: \"_getCastedFromJsonValue\",\n value: function _getCastedFromJsonValue(value, options) {\n if (_.has(options, 'type')) {\n var cast = options.type;\n if (_.isArray(value)) {\n return _.map(value, function (val) {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, val);\n });\n } else {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fromJson(cast, value);\n }\n }\n return value;\n }\n\n /**\n * @private\n *\n * @param {*} value\n * @param {Object} options\n *\n * @returns {*} The casted value.\n */\n }, {\n key: \"_getCastedToJsonValue\",\n value: function _getCastedToJsonValue(value, options) {\n if (_.has(options, 'type')) {\n var cast = options.type;\n if (_.isArray(value)) {\n return _.map(value, function (val) {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, val);\n });\n } else {\n return _caster__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJson(cast, value);\n }\n }\n return value;\n }\n }]);\n return Relations;\n}();\n\n\n//# sourceURL=webpack://Api/./src/builder/properties/relations.js?");
107
118
 
108
119
  /***/ }),
109
120
 
@@ -114,7 +125,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
114
125
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
115
126
 
116
127
  "use strict";
117
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Connection)\n/* harmony export */ });\n/* harmony import */ var _response__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./response */ \"./src/response.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction 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); } }\nfunction _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); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\nvar Connection = /*#__PURE__*/function () {\n function Connection() {\n _classCallCheck(this, Connection);\n this._abortController = null;\n this._config = {};\n this._api = null;\n this.running = false;\n this.canceled = false;\n this.failed = false;\n this._request = null;\n }\n _createClass(Connection, [{\n key: \"cancel\",\n value: function cancel() {\n if (!this._abortController || !this.running) return this;\n this._abortController.abort();\n this.canceled = true;\n }\n }, {\n key: \"setRequest\",\n value: function setRequest(request) {\n this._request = request;\n }\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this._config = config;\n }\n }, {\n key: \"setApi\",\n value: function setApi(api) {\n this._api = api;\n }\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query, params) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", this._execute(query, 'get', params));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get(_x, _x2) {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(query, data) {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", this._execute(query, 'post', data));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post(_x3, _x4) {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query, params) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this._execute(query, 'put', params));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put(_x5, _x6) {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query) {\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this._execute(query, 'delete'));\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete(_x7) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }, {\n key: \"_execute\",\n value: function () {\n var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(url, method, data) {\n var _this = this;\n var config, request, response;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n this.running = true;\n if (!_.startsWith(url, '/')) {\n url = \"/\".concat(url);\n }\n this._api.cancelRunning(this._request);\n config = _objectSpread(_objectSpread({\n url: (this._api ? this._api.baseUrl : api.baseUrl) + url,\n method: method\n }, _defineProperty({}, method === 'get' ? 'params' : 'data', data)), {}, {\n signal: (this._abortController = new AbortController()).signal\n });\n request = (0,axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Object.assign(config, this._config));\n response = new _response__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n _context5.next = 8;\n return request.then(function (axiosResponse) {\n response.set(axiosResponse.status, axiosResponse);\n })[\"catch\"](function (error) {\n _this.failed = true;\n var statusCode = 0;\n if (error.response) {\n statusCode = error.response.status;\n }\n response.set(statusCode, error);\n })[\"finally\"](function () {\n _this.running = false;\n });\n case 8:\n return _context5.abrupt(\"return\", response);\n case 9:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function _execute(_x8, _x9, _x10) {\n return _execute2.apply(this, arguments);\n }\n return _execute;\n }()\n }]);\n return Connection;\n}();\n\n\n//# sourceURL=webpack://Api/./src/connection.js?");
128
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Connection)\n/* harmony export */ });\n/* harmony import */ var _response__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./response */ \"./src/response.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction 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); } }\nfunction _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); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\nvar Connection = /*#__PURE__*/function () {\n function Connection() {\n _classCallCheck(this, Connection);\n this._abortController = null;\n this._config = {};\n this._api = null;\n this.running = false;\n this.canceled = false;\n this.failed = false;\n }\n _createClass(Connection, [{\n key: \"cancel\",\n value: function cancel() {\n if (!this._abortController || !this.running) return this;\n this._abortController.abort();\n this.canceled = true;\n }\n }, {\n key: \"cancelRunning\",\n value: function cancelRunning(request) {\n this._api.cancelRunning(request);\n }\n }, {\n key: \"removeRequest\",\n value: function removeRequest(request) {\n this._api.removeRequest(request);\n }\n }, {\n key: \"getConfig\",\n value: function getConfig() {\n return this._config;\n }\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this._config = config;\n }\n }, {\n key: \"setApi\",\n value: function setApi(api) {\n this._api = api;\n }\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query, params) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", this._execute(query, 'get', params));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get(_x, _x2) {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(query, data) {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", this._execute(query, 'post', data));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post(_x3, _x4) {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query, params) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this._execute(query, 'put', params));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put(_x5, _x6) {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query) {\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this._execute(query, 'delete'));\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete(_x7) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }, {\n key: \"_execute\",\n value: function () {\n var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(url, method, data) {\n var _this = this;\n var config, request, response;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n this.running = true;\n if (!_.startsWith(url, '/')) {\n url = \"/\".concat(url);\n }\n config = _objectSpread(_objectSpread({\n url: (this._api ? this._api.baseUrl : api.baseUrl) + url,\n method: method\n }, _defineProperty({}, method === 'get' ? 'params' : 'data', data)), {}, {\n signal: (this._abortController = new AbortController()).signal\n });\n request = (0,axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Object.assign(config, this._config));\n response = new _response__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n _context5.next = 7;\n return request.then(function (axiosResponse) {\n response.setAxiosResponse(axiosResponse);\n })[\"catch\"](function (axiosError) {\n _this.failed = true;\n response.setAxiosError(axiosError);\n })[\"finally\"](function () {\n _this.running = false;\n });\n case 7:\n return _context5.abrupt(\"return\", response);\n case 8:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function _execute(_x8, _x9, _x10) {\n return _execute2.apply(this, arguments);\n }\n return _execute;\n }()\n }]);\n return Connection;\n}();\n\n\n//# sourceURL=webpack://Api/./src/connection.js?");
118
129
 
119
130
  /***/ }),
120
131
 
@@ -301,7 +312,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
301
312
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
302
313
 
303
314
  "use strict";
304
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * @mixin paginationMixin\n */\nvar paginationMixin = {\n /**\n * @param {int} page\n * @param {int} [perPage]\n * @param {null|int} [findPageForId] Find the page the given id is on.\n * @returns {this}\n */\n pagination: function pagination(page) {\n var perPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;\n var findPageForId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n this._pagination.page(page);\n this._pagination.perPage(perPage);\n this._pagination.findPageForId(findPageForId);\n return this;\n }\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (paginationMixin);\n\n//# sourceURL=webpack://Api/./src/mixins/paginationMixin.js?");
315
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * @mixin paginationMixin\n */\nvar paginationMixin = {\n /**\n * @param {int} page\n * @param {int} [perPage]\n * @param {null|int} [findPageForId] Find the page the given id is on.\n * @returns {this}\n */\n pagination: function pagination(page) {\n var perPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;\n var findPageForId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n this._pagination.page(page);\n this._pagination.perPage(perPage);\n this._pagination.findPageForId(findPageForId);\n this._pagination.simplePagination(false);\n return this;\n },\n /**\n * @param {int} page\n * @param {int} [perPage]\n * @returns {this}\n */\n simplePagination: function simplePagination(page) {\n var perPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;\n this._pagination.page(page);\n this._pagination.perPage(perPage);\n this._pagination.simplePagination(true);\n return this;\n }\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (paginationMixin);\n\n//# sourceURL=webpack://Api/./src/mixins/paginationMixin.js?");
305
316
 
306
317
  /***/ }),
307
318
 
@@ -356,7 +367,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
356
367
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
357
368
 
358
369
  "use strict";
359
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Request)\n/* harmony export */ });\n/* harmony import */ var _request_action__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./request/action */ \"./src/request/action.js\");\n/* harmony import */ var _connection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./connection */ \"./src/connection.js\");\n/* harmony import */ var _filters_filters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters/filters */ \"./src/filters/filters.js\");\n/* harmony import */ var _modifiers_modifiers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/modifiers */ \"./src/modifiers/modifiers.js\");\n/* harmony import */ var _request_pagination__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./request/pagination */ \"./src/request/pagination.js\");\n/* harmony import */ var _mixins_actionMixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mixins/actionMixin */ \"./src/mixins/actionMixin.js\");\n/* harmony import */ var _mixins_filterMixin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mixins/filterMixin */ \"./src/mixins/filterMixin.js\");\n/* harmony import */ var _mixins_modifierMixin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mixins/modifierMixin */ \"./src/mixins/modifierMixin.js\");\n/* harmony import */ var _mixins_paginationMixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./mixins/paginationMixin */ \"./src/mixins/paginationMixin.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _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.\"); }\nfunction _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); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _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; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction 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); } }\nfunction _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); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n\n\n\n/**\n * @mixes actionMixin\n * @mixes filterMixin\n * @mixes modifierMixin\n * @mixes paginationMixin\n */\nvar Request = /*#__PURE__*/function () {\n function Request() {\n _classCallCheck(this, Request);\n this.url = null;\n this._action = new _request_action__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this._filters = new _filters_filters__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n this._modifiers = new _modifiers_modifiers__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n this._pagination = new _request_pagination__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n this._customParameters = [];\n this._onSuccess = function () {};\n this._onError = function () {};\n this._onValidationError = function () {};\n this._onUnauthorized = function () {};\n this._onForbidden = function () {};\n this._connection = new _connection__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this._connection.setRequest(this);\n this._response = null;\n this.key = null;\n }\n _createClass(Request, [{\n key: \"setKey\",\n value: function setKey(name) {\n this.key = name;\n return this;\n }\n }, {\n key: \"response\",\n get: function get() {\n return this._response;\n }\n\n /**\n * @param {string} url\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setUrl\",\n value: function setUrl(url) {\n this.url = url;\n return this;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"cancel\",\n value: function cancel() {\n this._connection.cancel();\n return this;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this$url;\n var url;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n url = (_this$url = this.url) !== null && _this$url !== void 0 ? _this$url : this.constructor.endpoint;\n _context.next = 3;\n return this._connection.get(\"\".concat(url), this.bodyParameters);\n case 3:\n this._response = _context.sent;\n _context.next = 6;\n return this.triggerResponseEvents(this._response);\n case 6:\n return _context.abrupt(\"return\", this);\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get() {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n /**\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _this$url2;\n var data,\n url,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n data = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};\n url = (_this$url2 = this.url) !== null && _this$url2 !== void 0 ? _this$url2 : this.constructor.endpoint;\n _context2.next = 4;\n return this._connection.post(\"\".concat(url), data);\n case 4:\n this._response = _context2.sent;\n _context2.next = 7;\n return this.triggerResponseEvents(this._response);\n case 7:\n return _context2.abrupt(\"return\", this);\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post() {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n /**\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _this$url3;\n var data,\n url,\n _args3 = arguments;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n data = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};\n url = (_this$url3 = this.url) !== null && _this$url3 !== void 0 ? _this$url3 : this.constructor.endpoint;\n _context3.next = 4;\n return this._connection.put(\"\".concat(url), _objectSpread(_objectSpread({}, data), this.bodyParameters));\n case 4:\n this._response = _context3.sent;\n _context3.next = 7;\n return this.triggerResponseEvents(this._response);\n case 7:\n return _context3.abrupt(\"return\", this);\n case 8:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put() {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _this$url4;\n var url;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n url = (_this$url4 = this.url) !== null && _this$url4 !== void 0 ? _this$url4 : this.constructor.endpoint;\n _context4.next = 3;\n return this._connection[\"delete\"](\"\".concat(url));\n case 3:\n this._response = _context4.sent;\n _context4.next = 6;\n return this.triggerResponseEvents(this._response);\n case 6:\n return _context4.abrupt(\"return\", this);\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete() {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n /**\n * @param {Object} files\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"storeFiles\",\n value: function () {\n var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var _this$url5;\n var files,\n data,\n url,\n formData,\n _args5 = arguments;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n files = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};\n data = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};\n url = (_this$url5 = this.url) !== null && _this$url5 !== void 0 ? _this$url5 : this.constructor.endpoint;\n this._connection.setConfig({\n headers: {\n 'Content-Type': 'multipart/form-data'\n }\n });\n formData = this._createFormData(_.merge({}, files, data));\n _context5.next = 7;\n return this._connection.post(\"\".concat(url, \"?\").concat(this.bodyParameters), formData);\n case 7:\n this._response = _context5.sent;\n _context5.next = 10;\n return this.triggerResponseEvents(this._response);\n case 10:\n return _context5.abrupt(\"return\", this);\n case 11:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function storeFiles() {\n return _storeFiles.apply(this, arguments);\n }\n return storeFiles;\n }()\n /**\n * @returns {Object} Filter and modifier query parameters.\n */\n }, {\n key: \"bodyParameters\",\n get: function get() {\n var _ref, _ref2;\n return (_ref = _).merge.apply(_ref, _toConsumableArray(_.compact([this._filters.toObject(), this._modifiers.toObject(), this._pagination.toObject(), this._action.toObject(), (_ref2 = _).merge.apply(_ref2, _toConsumableArray(this._customParameters))])));\n }\n\n /**\n * @param {function(Response.data)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onSuccess\",\n value: function onSuccess() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onSuccess = callback;\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onError\",\n value: function onError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onError = callback;\n return this;\n }\n\n /**\n * @param {function(Response.validation)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onValidationError\",\n value: function onValidationError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onValidationError = callback;\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onUnauthorized\",\n value: function onUnauthorized() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onUnauthorized = callback;\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onForbidden\",\n value: function onForbidden() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onForbidden = callback;\n return this;\n }\n\n /**\n * @param {Response} response\n * @param {*} successResponse\n */\n }, {\n key: \"triggerResponseEvents\",\n value: function () {\n var _triggerResponseEvents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(response) {\n var successResponse,\n validation,\n _args6 = arguments;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n successResponse = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : null;\n if (!(response.statusCode >= 200 && response.statusCode < 300)) {\n _context6.next = 7;\n break;\n }\n if (this._onSuccess) {\n _context6.next = 4;\n break;\n }\n return _context6.abrupt(\"return\");\n case 4:\n _context6.next = 6;\n return this._onSuccess.apply(this, _toConsumableArray([successResponse, response.data].filter(function (value) {\n return !!value;\n })));\n case 6:\n return _context6.abrupt(\"return\", _context6.sent);\n case 7:\n _context6.t0 = response.statusCode;\n _context6.next = _context6.t0 === 401 ? 10 : _context6.t0 === 403 ? 14 : _context6.t0 === 422 ? 18 : 24;\n break;\n case 10:\n if (!this._onUnauthorized) {\n _context6.next = 13;\n break;\n }\n _context6.next = 13;\n return this._onUnauthorized(response);\n case 13:\n return _context6.abrupt(\"break\", 28);\n case 14:\n if (!this._onForbidden) {\n _context6.next = 17;\n break;\n }\n _context6.next = 17;\n return this._onForbidden(response);\n case 17:\n return _context6.abrupt(\"break\", 28);\n case 18:\n validation = {\n message: response.validation.message,\n errors: {}\n };\n _.each(response.validation.errors, function (value, key) {\n return _.set(validation.errors, key, value);\n });\n if (!this._onValidationError) {\n _context6.next = 23;\n break;\n }\n _context6.next = 23;\n return this._onValidationError(validation);\n case 23:\n return _context6.abrupt(\"break\", 28);\n case 24:\n if (!this._onError) {\n _context6.next = 27;\n break;\n }\n _context6.next = 27;\n return this._onError(response);\n case 27:\n return _context6.abrupt(\"break\", 28);\n case 28:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function triggerResponseEvents(_x) {\n return _triggerResponseEvents.apply(this, arguments);\n }\n return triggerResponseEvents;\n }()\n /**\n * Add custom parameters to the request.\n *\n * @param {Object} parameters\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"customParameters\",\n value: function customParameters() {\n var parameters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this._customParameters.push(parameters);\n return this;\n }\n\n /**\n * Convert data to FormData.\n *\n * @param {Object} data\n *\n * @returns {FormData}\n */\n }, {\n key: \"_createFormData\",\n value: function _createFormData() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var formData = new FormData();\n function appendFormData(data, name) {\n name = name || '';\n if (data instanceof File) {\n formData.append(name, data);\n } else if (data === true || data === false) {\n formData.append(name, data ? '1' : '0');\n } else if (_.isArray(data) || _.isObject(data)) {\n if (_.size(data) <= 0) {\n formData.append(name, '');\n } else {\n _.forOwn(data, function (dataItem, key) {\n var newName = name === '' ? key : name + '[' + key + ']';\n appendFormData(dataItem, newName);\n });\n }\n } else {\n formData.append(name, data);\n }\n }\n appendFormData(data);\n return formData;\n }\n\n /**\n * @param {Api} api\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setApi\",\n value: function setApi(api) {\n this._connection.setApi(api);\n return this;\n }\n }]);\n return Request;\n}();\n\nObject.assign(Request.prototype, _mixins_actionMixin__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\nObject.assign(Request.prototype, _mixins_filterMixin__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\nObject.assign(Request.prototype, _mixins_modifierMixin__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\nObject.assign(Request.prototype, _mixins_paginationMixin__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\n\n//# sourceURL=webpack://Api/./src/request.js?");
370
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Request)\n/* harmony export */ });\n/* harmony import */ var _request_action__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./request/action */ \"./src/request/action.js\");\n/* harmony import */ var _connection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./connection */ \"./src/connection.js\");\n/* harmony import */ var _filters_filters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters/filters */ \"./src/filters/filters.js\");\n/* harmony import */ var _modifiers_modifiers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/modifiers */ \"./src/modifiers/modifiers.js\");\n/* harmony import */ var _request_pagination__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./request/pagination */ \"./src/request/pagination.js\");\n/* harmony import */ var _mixins_actionMixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mixins/actionMixin */ \"./src/mixins/actionMixin.js\");\n/* harmony import */ var _mixins_filterMixin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mixins/filterMixin */ \"./src/mixins/filterMixin.js\");\n/* harmony import */ var _mixins_modifierMixin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mixins/modifierMixin */ \"./src/mixins/modifierMixin.js\");\n/* harmony import */ var _mixins_paginationMixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./mixins/paginationMixin */ \"./src/mixins/paginationMixin.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _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.\"); }\nfunction _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); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _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; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction 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); } }\nfunction _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); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n\n\n\n/**\n * @mixes actionMixin\n * @mixes filterMixin\n * @mixes modifierMixin\n * @mixes paginationMixin\n */\nvar Request = /*#__PURE__*/function () {\n function Request() {\n _classCallCheck(this, Request);\n this.url = null;\n this._action = new _request_action__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this._filters = new _filters_filters__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n this._modifiers = new _modifiers_modifiers__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n this._pagination = new _request_pagination__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n this._customParameters = [];\n this._onSuccessCallbacks = [];\n this._onErrorCallbacks = [];\n this._onValidationErrorCallbacks = [];\n this._onUnauthorizedCallbacks = [];\n this._onForbiddenCallbacks = [];\n this._onFinishedCallbacks = [];\n this._onCancelledCallbacks = [];\n this._connection = new _connection__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this._response = null;\n this.key = null;\n }\n _createClass(Request, [{\n key: \"setKey\",\n value: function setKey(key) {\n this.key = key;\n return this;\n }\n }, {\n key: \"response\",\n get: function get() {\n return this._response;\n }\n\n /**\n * @param {string} url\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setUrl\",\n value: function setUrl(url) {\n this.url = url;\n return this;\n }\n\n /**\n * @param {object} config\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this._connection.setConfig(_.merge(this._connection.getConfig(), config));\n return this;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"cancel\",\n value: function cancel() {\n this._connection.cancel();\n return this;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this$url;\n var url;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n url = (_this$url = this.url) !== null && _this$url !== void 0 ? _this$url : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context.next = 4;\n return this._connection.get(url, this.bodyParameters);\n case 4:\n this._response = _context.sent;\n this._connection.removeRequest(this);\n _context.next = 8;\n return this.triggerResponseEvents(this._response);\n case 8:\n return _context.abrupt(\"return\", this);\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get() {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n /**\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _this$url2;\n var data,\n url,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n data = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};\n url = (_this$url2 = this.url) !== null && _this$url2 !== void 0 ? _this$url2 : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context2.next = 5;\n return this._connection.post(url, _objectSpread(_objectSpread({}, data), this.bodyParameters));\n case 5:\n this._response = _context2.sent;\n this._connection.removeRequest(this);\n _context2.next = 9;\n return this.triggerResponseEvents(this._response);\n case 9:\n return _context2.abrupt(\"return\", this);\n case 10:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post() {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n /**\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _this$url3;\n var data,\n url,\n _args3 = arguments;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n data = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};\n url = (_this$url3 = this.url) !== null && _this$url3 !== void 0 ? _this$url3 : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context3.next = 5;\n return this._connection.put(url, _objectSpread(_objectSpread({}, data), this.bodyParameters));\n case 5:\n this._response = _context3.sent;\n this._connection.removeRequest(this);\n _context3.next = 9;\n return this.triggerResponseEvents(this._response);\n case 9:\n return _context3.abrupt(\"return\", this);\n case 10:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put() {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _this$url4;\n var url;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n url = (_this$url4 = this.url) !== null && _this$url4 !== void 0 ? _this$url4 : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context4.next = 4;\n return this._connection[\"delete\"](url);\n case 4:\n this._response = _context4.sent;\n this._connection.removeRequest(this);\n _context4.next = 8;\n return this.triggerResponseEvents(this._response);\n case 8:\n return _context4.abrupt(\"return\", this);\n case 9:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete() {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n /**\n * @param {Object} files\n * @param {Object} data\n * @param {string|null} url\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"storeFiles\",\n value: function () {\n var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var _ref;\n var files,\n data,\n url,\n queryUrl,\n formData,\n _args5 = arguments;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n files = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};\n data = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};\n url = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : null;\n queryUrl = (_ref = url !== null && url !== void 0 ? url : this.url) !== null && _ref !== void 0 ? _ref : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n this.setConfig({\n headers: {\n 'Content-Type': 'multipart/form-data'\n }\n });\n formData = this._createFormData(_.merge({}, files, data));\n if (!_.isEmpty(this.bodyParameters)) {\n queryUrl = \"\".concat(queryUrl, \"?\").concat(this.bodyParameters);\n }\n _context5.next = 10;\n return this._connection.post(queryUrl, formData);\n case 10:\n this._response = _context5.sent;\n this._connection.removeRequest(this);\n this.setConfig({\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n _context5.next = 15;\n return this.triggerResponseEvents(this._response);\n case 15:\n return _context5.abrupt(\"return\", this);\n case 16:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function storeFiles() {\n return _storeFiles.apply(this, arguments);\n }\n return storeFiles;\n }()\n /**\n * @returns {Object} Filter and modifier query parameters.\n */\n }, {\n key: \"bodyParameters\",\n get: function get() {\n var _ref2, _ref3;\n return (_ref2 = _).merge.apply(_ref2, _toConsumableArray(_.compact([this._filters.toObject(), this._modifiers.toObject(), this._pagination.toObject(), this._action.toObject(), (_ref3 = _).merge.apply(_ref3, _toConsumableArray(this._customParameters))])));\n }\n\n /**\n * @param {function(Response.data)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onSuccess\",\n value: function onSuccess() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onSuccessCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onError\",\n value: function onError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onErrorCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response.validation)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onValidationError\",\n value: function onValidationError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onValidationErrorCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onUnauthorized\",\n value: function onUnauthorized() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onUnauthorizedCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onForbidden\",\n value: function onForbidden() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onForbiddenCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onFinished\",\n value: function onFinished() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onFinishedCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onCancelled\",\n value: function onCancelled() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onCancelledCallbacks.push(callback);\n return this;\n }\n\n /**\n * Clears all `onSuccess` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnSuccessCallbacks\",\n value: function clearOnSuccessCallbacks() {\n this._onSuccessCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onError` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnErrorCallbacks\",\n value: function clearOnErrorCallbacks() {\n this._onErrorCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onValidationError` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnValidationErrorCallbacks\",\n value: function clearOnValidationErrorCallbacks() {\n this._onValidationErrorCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onUnauthorized` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnUnauthorizedCallbacks\",\n value: function clearOnUnauthorizedCallbacks() {\n this._onUnauthorizedCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onForbidden` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnForbiddenCallbacks\",\n value: function clearOnForbiddenCallbacks() {\n this._onForbiddenCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onFinished` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnFinishedCallbacks\",\n value: function clearOnFinishedCallbacks() {\n this._onFinishedCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onCancelled` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnCancelledCallbacks\",\n value: function clearOnCancelledCallbacks() {\n this._onCancelledCallbacks = [];\n return this;\n }\n\n /**\n * @param {Response} response\n * @param {*} successResponse\n */\n }, {\n key: \"triggerResponseEvents\",\n value: function () {\n var _triggerResponseEvents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(response) {\n var successResponse,\n executeCallbacks,\n validation,\n _args7 = arguments;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n executeCallbacks = function _executeCallbacks(callbacks) {\n for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n return Promise.all(callbacks.map( /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(callback) {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return callback.apply(void 0, data);\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return function (_x2) {\n return _ref4.apply(this, arguments);\n };\n }()));\n };\n successResponse = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : null;\n if (!(response.statusCode >= 200 && response.statusCode < 300)) {\n _context7.next = 7;\n break;\n }\n _context7.next = 5;\n return executeCallbacks.apply(void 0, [this._onSuccessCallbacks].concat(_toConsumableArray([successResponse, response.data].filter(function (value) {\n return !!value;\n }))));\n case 5:\n _context7.next = 24;\n break;\n case 7:\n _context7.t0 = response.statusCode;\n _context7.next = _context7.t0 === 401 ? 10 : _context7.t0 === 403 ? 13 : _context7.t0 === 422 ? 16 : 21;\n break;\n case 10:\n _context7.next = 12;\n return executeCallbacks(this._onUnauthorizedCallbacks, response);\n case 12:\n return _context7.abrupt(\"break\", 24);\n case 13:\n _context7.next = 15;\n return executeCallbacks(this._onForbiddenCallbacks, response);\n case 15:\n return _context7.abrupt(\"break\", 24);\n case 16:\n validation = {\n message: response.validation.message,\n errors: {}\n };\n _.each(response.validation.errors, function (value, key) {\n return _.set(validation.errors, key, value);\n });\n _context7.next = 20;\n return executeCallbacks(this._onValidationErrorCallbacks, validation);\n case 20:\n return _context7.abrupt(\"break\", 24);\n case 21:\n _context7.next = 23;\n return executeCallbacks(this._onErrorCallbacks, response);\n case 23:\n return _context7.abrupt(\"break\", 24);\n case 24:\n if (!response.isFinished) {\n _context7.next = 27;\n break;\n }\n _context7.next = 27;\n return executeCallbacks(this._onFinishedCallbacks, response);\n case 27:\n if (!response.isCancelled) {\n _context7.next = 30;\n break;\n }\n _context7.next = 30;\n return executeCallbacks(this._onCancelledCallbacks, response);\n case 30:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function triggerResponseEvents(_x) {\n return _triggerResponseEvents.apply(this, arguments);\n }\n return triggerResponseEvents;\n }()\n /**\n * Add custom parameters to the request.\n *\n * @param {Object} parameters\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"customParameters\",\n value: function customParameters() {\n var parameters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this._customParameters.push(parameters);\n return this;\n }\n\n /**\n * Convert data to FormData.\n *\n * @param {Object} data\n *\n * @returns {FormData}\n */\n }, {\n key: \"_createFormData\",\n value: function _createFormData() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var formData = new FormData();\n function appendFormData(data, name) {\n name = name || '';\n if (data instanceof File) {\n formData.append(name, data);\n } else if (data === true || data === false) {\n formData.append(name, data ? '1' : '0');\n } else if (_.isArray(data) || _.isObject(data)) {\n if (_.size(data) <= 0) {\n formData.append(name, '');\n } else {\n _.forOwn(data, function (dataItem, key) {\n var newName = name === '' ? key : name + '[' + key + ']';\n appendFormData(dataItem, newName);\n });\n }\n } else {\n formData.append(name, data);\n }\n }\n appendFormData(data);\n return formData;\n }\n\n /**\n * @param {Api} api\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setApi\",\n value: function setApi(api) {\n this._connection.setApi(api);\n return this;\n }\n }]);\n return Request;\n}();\n\nObject.assign(Request.prototype, _mixins_actionMixin__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\nObject.assign(Request.prototype, _mixins_filterMixin__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\nObject.assign(Request.prototype, _mixins_modifierMixin__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\nObject.assign(Request.prototype, _mixins_paginationMixin__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\n\n//# sourceURL=webpack://Api/./src/request.js?");
360
371
 
361
372
  /***/ }),
362
373
 
@@ -378,7 +389,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
378
389
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
379
390
 
380
391
  "use strict";
381
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Pagination)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar Pagination = /*#__PURE__*/function () {\n function Pagination() {\n _classCallCheck(this, Pagination);\n this._page = null;\n this._perPage = null;\n this._findPageForId = null;\n }\n _createClass(Pagination, [{\n key: \"filled\",\n value: function filled() {\n return this._perPage && (this._page || this._findPageForId);\n }\n }, {\n key: \"page\",\n value: function page(_page) {\n this._page = _page;\n }\n }, {\n key: \"perPage\",\n value: function perPage(_perPage) {\n this._perPage = _perPage;\n }\n }, {\n key: \"findPageForId\",\n value: function findPageForId(id) {\n this._findPageForId = id;\n }\n }, {\n key: \"toObject\",\n value: function toObject() {\n var data = {};\n if (this.filled()) {\n data.page = this._page;\n data.paginate = this._perPage;\n data.page_for_id = this._findPageForId;\n }\n return data;\n }\n }]);\n return Pagination;\n}();\n\n\n//# sourceURL=webpack://Api/./src/request/pagination.js?");
392
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Pagination)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar Pagination = /*#__PURE__*/function () {\n function Pagination() {\n _classCallCheck(this, Pagination);\n this._page = null;\n this._perPage = null;\n this._findPageForId = null;\n this._simplePagination = false;\n }\n _createClass(Pagination, [{\n key: \"filled\",\n value: function filled() {\n return this._perPage && (this._page || this._findPageForId);\n }\n }, {\n key: \"page\",\n value: function page(_page) {\n this._page = _page;\n }\n }, {\n key: \"perPage\",\n value: function perPage(_perPage) {\n this._perPage = _perPage;\n }\n }, {\n key: \"findPageForId\",\n value: function findPageForId(id) {\n this._findPageForId = id;\n }\n }, {\n key: \"simplePagination\",\n value: function simplePagination(_simplePagination) {\n this._simplePagination = _simplePagination;\n }\n }, {\n key: \"toObject\",\n value: function toObject() {\n var data = {};\n if (this.filled()) {\n data.page = this._page;\n data.paginate = this._perPage;\n data.page_for_id = this._findPageForId;\n data.simple_pagination = this._simplePagination;\n }\n return data;\n }\n }]);\n return Pagination;\n}();\n\n\n//# sourceURL=webpack://Api/./src/request/pagination.js?");
382
393
 
383
394
  /***/ }),
384
395
 
@@ -389,7 +400,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
389
400
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
390
401
 
391
402
  "use strict";
392
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Response)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar Response = /*#__PURE__*/function () {\n function Response() {\n _classCallCheck(this, Response);\n this._axiosResponse = null;\n this.statusCode = null;\n this.data = null;\n this.validation = null;\n }\n _createClass(Response, [{\n key: \"failed\",\n get: function get() {\n return this.statusCode >= 400;\n }\n }, {\n key: \"set\",\n value: function set(statusCode, axiosResponse) {\n this._axiosResponse = axiosResponse;\n this.statusCode = statusCode;\n switch (this.statusCode) {\n case 200:\n this.data = this._axiosResponse.data;\n break;\n case 400:\n this.data = this._axiosResponse.response.data;\n break;\n case 422:\n this.validation = this._axiosResponse.response.data;\n break;\n }\n }\n }]);\n return Response;\n}();\n\n\n//# sourceURL=webpack://Api/./src/response.js?");
403
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Response)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\nvar Response = /*#__PURE__*/function () {\n function Response() {\n _classCallCheck(this, Response);\n this._axiosResponse = null;\n this._axiosError = null;\n this.data = null;\n this.validation = null;\n }\n\n /**\n * @deprecated Use `isFailed` instead.\n * @returns {boolean}\n */\n _createClass(Response, [{\n key: \"failed\",\n get: function get() {\n return this.isFailed;\n }\n\n /**\n * @returns {boolean}\n */\n }, {\n key: \"isFailed\",\n get: function get() {\n return this.statusCode >= 400;\n }\n\n /**\n * Check whether the request is finished and returned a response.\n *\n * @returns {boolean}\n */\n }, {\n key: \"isFinished\",\n get: function get() {\n return this._axiosResponse !== null;\n }\n\n /**\n * Check whether the request was cancelled.\n *\n * @returns {boolean}\n */\n }, {\n key: \"isCancelled\",\n get: function get() {\n return axios__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isCancel(this._axiosError);\n }\n\n /**\n * @returns {Number} The HTTP response status code.\n */\n }, {\n key: \"statusCode\",\n get: function get() {\n var _this$_axiosResponse;\n return (_this$_axiosResponse = this._axiosResponse) === null || _this$_axiosResponse === void 0 ? void 0 : _this$_axiosResponse.status;\n }\n }, {\n key: \"setAxiosResponse\",\n value: function setAxiosResponse(axiosResponse) {\n this._axiosResponse = axiosResponse;\n switch (this.statusCode) {\n case 200:\n case 400:\n this.data = this._axiosResponse.data;\n break;\n case 422:\n this.validation = this._axiosResponse.data;\n break;\n }\n }\n }, {\n key: \"setAxiosError\",\n value: function setAxiosError(axiosError) {\n this._axiosError = axiosError;\n if (axiosError.response) {\n this.setAxiosResponse(axiosError.response);\n }\n }\n }]);\n return Response;\n}();\n\n\n//# sourceURL=webpack://Api/./src/response.js?");
393
404
 
394
405
  /***/ }),
395
406