@bringg/dashboard-sdk 8.25.0 → 8.27.0-pre

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.
@@ -171,7 +171,7 @@ eval("\nvar __extends = (this && this.__extends) || (function () {\n var exte
171
171
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
172
172
 
173
173
  "use strict";
174
- eval("\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AsyncOperationStatus = exports.UPDATE_ASYNC_OPERATION_REALTIME_EVENT = void 0;\nvar realtime_subscriptions_1 = __webpack_require__(/*! ../realtime-subscriptions */ \"./dist/realtime-subscriptions.js\");\nexports.UPDATE_ASYNC_OPERATION_REALTIME_EVENT = 'async operation status';\nvar AsyncOperationStatus = /** @class */ (function () {\n function AsyncOperationStatus(session) {\n var _this = this;\n // In case of adding listener for a request that status update was already received, we will save that so nothing will be lost\n this.unackedStatusUpdates = new Map();\n this.listeners = new Map();\n this.cleanupUnackedMessageThatPassedTTL = function () {\n var e_1, _a;\n var now = Date.now();\n try {\n for (var _b = __values(_this.unackedStatusUpdates), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read(_c.value, 2), key = _d[0], queue = _d[1];\n var liveMessages = queue.filter(function (_a) {\n var messageTimeInMs = _a.messageTimeInMs;\n return now - messageTimeInMs < AsyncOperationStatus.UNACKED_MESSAGES_TTL;\n });\n // If there are no live messages, we can remove the whole queue (this shouldn't happen as we have a check for this earlier\n if (liveMessages.length === 0) {\n _this.unackedStatusUpdates.delete(key);\n }\n else {\n // Only keep the live messages\n _this.unackedStatusUpdates.set(key, liveMessages);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n this.realtimeSubscriptions = new realtime_subscriptions_1.default(session);\n this.listenToEvent();\n this.cleanupInterval = setInterval(this.cleanupUnackedMessageThatPassedTTL, AsyncOperationStatus.UNACKED_MESSAGES_TTL);\n }\n AsyncOperationStatus.prototype.listenToEvent = function () {\n var _this = this;\n this.unsubscribe = this.realtimeSubscriptions.subscribe(exports.UPDATE_ASYNC_OPERATION_REALTIME_EVENT, function (event) {\n var listener = _this.listeners.get(event.request_id);\n if (listener) {\n try {\n listener(event);\n }\n catch (_a) {\n // ignore\n }\n return;\n }\n var queue = _this.unackedStatusUpdates.get(event.request_id);\n if (!queue) {\n queue = [];\n _this.unackedStatusUpdates.set(event.request_id, queue);\n }\n queue.push({\n event: event,\n messageTimeInMs: Date.now()\n });\n return;\n });\n };\n AsyncOperationStatus.prototype.addListener = function (_a) {\n var e_2, _b;\n var _this = this;\n var requestId = _a.requestId, handler = _a.handler, signal = _a.signal;\n if (signal.aborted) {\n return;\n }\n var abortedInTheMiddle = false;\n if (this.unackedStatusUpdates.has(requestId)) {\n var unackedStatusUpdates = this.unackedStatusUpdates.get(requestId);\n var processedMessages = 0;\n try {\n for (var unackedStatusUpdates_1 = __values(unackedStatusUpdates), unackedStatusUpdates_1_1 = unackedStatusUpdates_1.next(); !unackedStatusUpdates_1_1.done; unackedStatusUpdates_1_1 = unackedStatusUpdates_1.next()) {\n var event_1 = unackedStatusUpdates_1_1.value.event;\n abortedInTheMiddle = signal.aborted;\n if (abortedInTheMiddle) {\n break;\n }\n try {\n handler(event_1);\n }\n catch (_c) {\n // ignore\n }\n processedMessages++;\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (unackedStatusUpdates_1_1 && !unackedStatusUpdates_1_1.done && (_b = unackedStatusUpdates_1.return)) _b.call(unackedStatusUpdates_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (abortedInTheMiddle) {\n // Remove the processed messages\n unackedStatusUpdates.splice(0, processedMessages);\n }\n else {\n this.unackedStatusUpdates.delete(requestId);\n }\n }\n if (signal.aborted) {\n return;\n }\n // Because we call the handlers synchronously, it is ok that we add the listener afterwards\n // If we would wait for the handler this would have be needed to move before handling the unacked messages\n this.listeners.set(requestId, handler);\n signal.addEventListener('abort', function () {\n _this.listeners.delete(requestId);\n }, { once: true });\n };\n AsyncOperationStatus.prototype.hasUnackedStatusUpdates = function () {\n return this.unackedStatusUpdates.size > 0;\n };\n AsyncOperationStatus.prototype.unregisterCleanUnackedMessage = function () {\n clearInterval(this.cleanupInterval);\n this.cleanupInterval = undefined;\n };\n AsyncOperationStatus.prototype.cleanup = function () {\n var _a;\n this.unregisterCleanUnackedMessage();\n (_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);\n this.unsubscribe = undefined;\n this.listeners.clear();\n this.unackedStatusUpdates.clear();\n };\n AsyncOperationStatus.UNACKED_MESSAGES_TTL = 1000 * 60 * 3; // 3 minutes\n return AsyncOperationStatus;\n}());\nexports.AsyncOperationStatus = AsyncOperationStatus;\n//# sourceMappingURL=AsyncOperationStatus.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/AsyncOperationStatus/AsyncOperationStatus.js?");
174
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AsyncOperationStatus = exports.UPDATE_ASYNC_OPERATION_REALTIME_EVENT = void 0;\nvar async_operation_status_1 = __webpack_require__(/*! @bringg/types/types/async_operation_status */ \"./node_modules/@bringg/types/types/async_operation_status.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar ExceptionReason_1 = __webpack_require__(/*! ../Core/ExceptionReason */ \"./dist/Core/ExceptionReason.js\");\nvar realtime_subscriptions_1 = __webpack_require__(/*! ../realtime-subscriptions */ \"./dist/realtime-subscriptions.js\");\nvar abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar promises_1 = __webpack_require__(/*! ../utils/promises */ \"./dist/utils/promises.js\");\nexports.UPDATE_ASYNC_OPERATION_REALTIME_EVENT = 'async operation status';\nvar AsyncOperationStatus = /** @class */ (function () {\n function AsyncOperationStatus(session) {\n var _this = this;\n // In case of adding listener for a request that status update was already received, we will save that so nothing will be lost\n this.unackedStatusUpdates = new Map();\n this.listeners = new Map();\n this.cleanupUnackedMessageThatPassedTTL = function () {\n var e_1, _a;\n var now = Date.now();\n try {\n for (var _b = __values(_this.unackedStatusUpdates), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read(_c.value, 2), key = _d[0], queue = _d[1];\n var liveMessages = queue.filter(function (_a) {\n var messageTimeInMs = _a.messageTimeInMs;\n return now - messageTimeInMs < AsyncOperationStatus.UNACKED_MESSAGES_TTL;\n });\n // If there are no live messages, we can remove the whole queue (this shouldn't happen as we have a check for this earlier\n if (liveMessages.length === 0) {\n _this.unackedStatusUpdates.delete(key);\n }\n else {\n // Only keep the live messages\n _this.unackedStatusUpdates.set(key, liveMessages);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n this.realtimeSubscriptions = new realtime_subscriptions_1.default(session);\n this.listenToEvent();\n this.cleanupInterval = setInterval(this.cleanupUnackedMessageThatPassedTTL, AsyncOperationStatus.UNACKED_MESSAGES_TTL);\n }\n AsyncOperationStatus.prototype.listenToEvent = function () {\n var _this = this;\n this.unsubscribe = this.realtimeSubscriptions.subscribe(exports.UPDATE_ASYNC_OPERATION_REALTIME_EVENT, function (event) {\n var listener = _this.listeners.get(event.request_id);\n if (listener) {\n try {\n listener(event);\n }\n catch (_a) {\n // ignore\n }\n return;\n }\n var queue = _this.unackedStatusUpdates.get(event.request_id);\n if (!queue) {\n queue = [];\n _this.unackedStatusUpdates.set(event.request_id, queue);\n }\n queue.push({\n event: event,\n messageTimeInMs: Date.now()\n });\n return;\n });\n };\n AsyncOperationStatus.prototype.addListener = function (_a) {\n var requestId = _a.requestId, handler = _a.handler, signal = _a.signal, _b = _a.once, once = _b === void 0 ? false : _b;\n return once\n ? this._once({ requestId: requestId, handler: handler, signal: signal, once: once })\n : this._addListener({ requestId: requestId, handler: handler, signal: signal });\n };\n AsyncOperationStatus.prototype._addListener = function (_a) {\n var e_2, _b;\n var _this = this;\n var requestId = _a.requestId, handler = _a.handler, signal = _a.signal;\n if (signal.aborted) {\n return;\n }\n if (this.listeners.has(requestId)) {\n console.warn(\"Listener for request \".concat(requestId, \" already exists\"));\n }\n var abortedInTheMiddle = false;\n if (this.unackedStatusUpdates.has(requestId)) {\n var unackedStatusUpdates = this.unackedStatusUpdates.get(requestId);\n var processedMessages = 0;\n try {\n for (var unackedStatusUpdates_1 = __values(unackedStatusUpdates), unackedStatusUpdates_1_1 = unackedStatusUpdates_1.next(); !unackedStatusUpdates_1_1.done; unackedStatusUpdates_1_1 = unackedStatusUpdates_1.next()) {\n var event_1 = unackedStatusUpdates_1_1.value.event;\n abortedInTheMiddle = signal.aborted;\n if (abortedInTheMiddle) {\n break;\n }\n try {\n handler(event_1);\n }\n catch (_c) {\n // ignore\n }\n processedMessages++;\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (unackedStatusUpdates_1_1 && !unackedStatusUpdates_1_1.done && (_b = unackedStatusUpdates_1.return)) _b.call(unackedStatusUpdates_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (abortedInTheMiddle) {\n // Remove the processed messages\n unackedStatusUpdates.splice(0, processedMessages);\n }\n else {\n this.unackedStatusUpdates.delete(requestId);\n }\n }\n if (signal.aborted) {\n return;\n }\n // Because we call the handlers synchronously, it is ok that we add the listener afterwards\n // If we would wait for the handler this would have be needed to move before handling the unacked messages\n this.listeners.set(requestId, handler);\n signal.addEventListener('abort', function () {\n _this.listeners.delete(requestId);\n }, { once: true });\n };\n AsyncOperationStatus.prototype._once = function (_a) {\n var requestId = _a.requestId, handler = _a.handler, signal = _a.signal;\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n return;\n }\n // Merge the signal with the signal of the once cleanup\n var mergedAc = new AbortController();\n function handlerWrapper(payload) {\n // Cleaning up the listener, must be before calling the handler as it might throw\n mergedAc.abort();\n return handler(payload);\n }\n // Propagate the abort event to the merged signal\n signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', mergedAc.abort.bind(mergedAc), {\n once: true,\n // Cleanup this listener when the mergedAc is aborted\n signal: mergedAc.signal\n });\n this._addListener({ requestId: requestId, handler: handlerWrapper, signal: mergedAc.signal });\n };\n /**\n * This is suitable for cases where the user send a request in HTTP and should get the response in realtime\n */\n AsyncOperationStatus.prototype.waitForResponse = function (_a) {\n var requestId = _a.requestId, signal = _a.signal, timeoutInMs = _a.timeoutInMs;\n return __awaiter(this, void 0, void 0, function () {\n function handler(_a) {\n var status = _a.status, payload = _a.payload;\n abortReason = 'already-fulfilled';\n mergedAc.abort();\n if (status === async_operation_status_1.AsyncOperationStatusType.FAILURE) {\n reject(new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.UNSUCCESSFUL_RESULT, \"Got unsuccessful result for request id \".concat(requestId), undefined, payload));\n }\n else {\n resolve(payload);\n }\n }\n function onSignalInputAborted() {\n abortReason = 'abort';\n mergedAc.abort();\n }\n var timeout, abortReason, _b, promise, resolve, reject, mergedAc;\n return __generator(this, function (_c) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal);\n }\n _b = (0, promises_1.createDeferredPromise)(), promise = _b.promise, resolve = _b.resolve, reject = _b.reject;\n mergedAc = new AbortController();\n mergedAc.signal.addEventListener('abort', function () {\n switch (abortReason) {\n // Handled manually\n case 'already-fulfilled':\n return;\n case 'abort':\n reject((0, abort_1.createAbortError)(signal));\n return;\n case 'timeout':\n reject(new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.TIMEOUT, \"Timeout of \".concat(timeoutInMs, \"ms exceeded while waiting for response for request id \").concat(requestId)));\n return;\n // This will happen on resolve\n default:\n return;\n }\n });\n this._addListener({ requestId: requestId, handler: handler, signal: mergedAc.signal });\n // Can happen when have unacked messages\n if (!mergedAc.signal.aborted) {\n // Propagate the abort event to the merged signal\n signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', onSignalInputAborted, {\n once: true\n });\n if (timeoutInMs) {\n timeout = setTimeout(function () {\n abortReason = 'timeout';\n mergedAc.abort();\n }, timeoutInMs);\n }\n }\n return [2 /*return*/, promise.finally(function () {\n signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', onSignalInputAborted);\n clearTimeout(timeout);\n })];\n });\n });\n };\n AsyncOperationStatus.prototype.hasUnackedStatusUpdates = function () {\n return this.unackedStatusUpdates.size > 0;\n };\n AsyncOperationStatus.prototype.unregisterCleanUnackedMessage = function () {\n clearInterval(this.cleanupInterval);\n this.cleanupInterval = undefined;\n };\n AsyncOperationStatus.prototype.cleanup = function () {\n var _a;\n this.unregisterCleanUnackedMessage();\n (_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);\n this.unsubscribe = undefined;\n this.listeners.clear();\n this.unackedStatusUpdates.clear();\n };\n AsyncOperationStatus.UNACKED_MESSAGES_TTL = 1000 * 60 * 3; // 3 minutes\n return AsyncOperationStatus;\n}());\nexports.AsyncOperationStatus = AsyncOperationStatus;\n//# sourceMappingURL=AsyncOperationStatus.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/AsyncOperationStatus/AsyncOperationStatus.js?");
175
175
 
176
176
  /***/ }),
177
177
 
@@ -413,7 +413,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
413
413
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
414
414
 
415
415
  "use strict";
416
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ExceptionReason = void 0;\nvar HttpStatus = __webpack_require__(/*! http-status-codes */ \"./node_modules/http-status-codes/index.js\");\nvar HTTP_SERIES = function (statusCode) { return 100000 + statusCode; };\nvar reasonCodeToExceptionReasonMapper = new Map();\nvar ExceptionReason = /** @class */ (function () {\n function ExceptionReason(errorString, errorCode) {\n this.name = errorString;\n this.code = errorCode;\n reasonCodeToExceptionReasonMapper.set(errorCode, this);\n }\n ExceptionReason.fromHttpStatusCode = function (httpStatusCode) {\n return (reasonCodeToExceptionReasonMapper.get(HTTP_SERIES(httpStatusCode)) ||\n new ExceptionReason(\"HTTP_\".concat(httpStatusCode), HTTP_SERIES(httpStatusCode)));\n };\n ExceptionReason.UNCAUGHT = new ExceptionReason('UNCAUGHT', 0);\n ExceptionReason.UNSUCCESSFUL_RESULT = new ExceptionReason('UNSUCCESSFUL_RESULT', 1);\n ExceptionReason.INTERNAL_ROUTING_ERROR = new ExceptionReason('INTERNAL_ROUTING_ERROR', 2);\n ExceptionReason.INCOMPATIBLE_SERVICE_RESPONSE = new ExceptionReason('INCOMPATIBLE_SERVICE_RESPONSE', 3);\n ExceptionReason.ENTITY_NOT_FOUND = new ExceptionReason('ENTITY_NOT_FOUND', 4);\n ExceptionReason.ILLEGAL_STATE = new ExceptionReason('ILLEGAL_STATE', 5);\n ExceptionReason.INVALID_ARGUMENTS = new ExceptionReason('INVALID_ARGUMENTS', 6);\n ExceptionReason.CAPTCHA_VERIFICATION_REQUIRED = new ExceptionReason('CAPTCHA_VERIFICATION_REQUIRED', 7);\n /* 1xxxxxx Http Series */\n ExceptionReason.HTTP_ACCEPTED = new ExceptionReason('HTTP_ACCEPTED', HTTP_SERIES(HttpStatus.ACCEPTED));\n ExceptionReason.HTTP_BAD_GATEWAY = new ExceptionReason('HTTP_BAD_GATEWAY', HTTP_SERIES(HttpStatus.BAD_GATEWAY));\n ExceptionReason.HTTP_BAD_REQUEST = new ExceptionReason('HTTP_BAD_REQUEST', HTTP_SERIES(HttpStatus.BAD_REQUEST));\n ExceptionReason.HTTP_CONFLICT = new ExceptionReason('HTTP_CONFLICT', HTTP_SERIES(HttpStatus.CONFLICT));\n ExceptionReason.HTTP_CONTINUE = new ExceptionReason('HTTP_CONTINUE', HTTP_SERIES(HttpStatus.CONTINUE));\n ExceptionReason.HTTP_CREATED = new ExceptionReason('HTTP_CREATED', HTTP_SERIES(HttpStatus.CREATED));\n ExceptionReason.HTTP_EXPECTATION_FAILED = new ExceptionReason('HTTP_EXPECTATION_FAILED', HTTP_SERIES(HttpStatus.EXPECTATION_FAILED));\n ExceptionReason.HTTP_FAILED_DEPENDENCY = new ExceptionReason('HTTP_FAILED_DEPENDENCY', HTTP_SERIES(HttpStatus.FAILED_DEPENDENCY));\n ExceptionReason.HTTP_FORBIDDEN = new ExceptionReason('HTTP_FORBIDDEN', HTTP_SERIES(HttpStatus.FORBIDDEN));\n ExceptionReason.HTTP_GATEWAY_TIMEOUT = new ExceptionReason('HTTP_GATEWAY_TIMEOUT', HTTP_SERIES(HttpStatus.GATEWAY_TIMEOUT));\n ExceptionReason.HTTP_GONE = new ExceptionReason('HTTP_GONE', HTTP_SERIES(HttpStatus.GONE));\n ExceptionReason.HTTP_HTTP_VERSION_NOT_SUPPORTED = new ExceptionReason('HTTP_HTTP_VERSION_NOT_SUPPORTED', HTTP_SERIES(HttpStatus.HTTP_VERSION_NOT_SUPPORTED));\n ExceptionReason.HTTP_IM_A_TEAPOT = new ExceptionReason('HTTP_IM_A_TEAPOT', HTTP_SERIES(HttpStatus.IM_A_TEAPOT));\n ExceptionReason.HTTP_INSUFFICIENT_SPACE_ON_RESOURCE = new ExceptionReason('HTTP_INSUFFICIENT_SPACE_ON_RESOURCE', HTTP_SERIES(HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE));\n ExceptionReason.HTTP_INSUFFICIENT_STORAGE = new ExceptionReason('HTTP_INSUFFICIENT_STORAGE', HTTP_SERIES(HttpStatus.INSUFFICIENT_STORAGE));\n ExceptionReason.HTTP_INTERNAL_SERVER_ERROR = new ExceptionReason('HTTP_INTERNAL_SERVER_ERROR', HTTP_SERIES(HttpStatus.INTERNAL_SERVER_ERROR));\n ExceptionReason.HTTP_LENGTH_REQUIRED = new ExceptionReason('HTTP_LENGTH_REQUIRED', HTTP_SERIES(HttpStatus.LENGTH_REQUIRED));\n ExceptionReason.HTTP_LOCKED = new ExceptionReason('HTTP_LOCKED', HTTP_SERIES(HttpStatus.LOCKED));\n ExceptionReason.HTTP_METHOD_FAILURE = new ExceptionReason('HTTP_METHOD_FAILURE', HTTP_SERIES(HttpStatus.METHOD_FAILURE));\n ExceptionReason.HTTP_METHOD_NOT_ALLOWED = new ExceptionReason('HTTP_METHOD_NOT_ALLOWED', HTTP_SERIES(HttpStatus.METHOD_NOT_ALLOWED));\n ExceptionReason.HTTP_MOVED_PERMANENTLY = new ExceptionReason('HTTP_MOVED_PERMANENTLY', HTTP_SERIES(HttpStatus.MOVED_PERMANENTLY));\n ExceptionReason.HTTP_MOVED_TEMPORARILY = new ExceptionReason('HTTP_MOVED_TEMPORARILY', HTTP_SERIES(HttpStatus.MOVED_TEMPORARILY));\n ExceptionReason.HTTP_MULTI_STATUS = new ExceptionReason('HTTP_MULTI_STATUS', HTTP_SERIES(HttpStatus.MULTI_STATUS));\n ExceptionReason.HTTP_MULTIPLE_CHOICES = new ExceptionReason('HTTP_MULTIPLE_CHOICES', HTTP_SERIES(HttpStatus.MULTIPLE_CHOICES));\n ExceptionReason.HTTP_NETWORK_AUTHENTICATION_REQUIRED = new ExceptionReason('HTTP_NETWORK_AUTHENTICATION_REQUIRED', HTTP_SERIES(HttpStatus.NETWORK_AUTHENTICATION_REQUIRED));\n ExceptionReason.HTTP_NO_CONTENT = new ExceptionReason('HTTP_NO_CONTENT', HTTP_SERIES(HttpStatus.NO_CONTENT));\n ExceptionReason.HTTP_NON_AUTHORITATIVE_INFORMATION = new ExceptionReason('HTTP_NON_AUTHORITATIVE_INFORMATION', HTTP_SERIES(HttpStatus.NON_AUTHORITATIVE_INFORMATION));\n ExceptionReason.HTTP_NOT_ACCEPTABLE = new ExceptionReason('HTTP_NOT_ACCEPTABLE', HTTP_SERIES(HttpStatus.NOT_ACCEPTABLE));\n ExceptionReason.HTTP_NOT_FOUND = new ExceptionReason('HTTP_NOT_FOUND', HTTP_SERIES(HttpStatus.NOT_FOUND));\n ExceptionReason.HTTP_NOT_IMPLEMENTED = new ExceptionReason('HTTP_NOT_IMPLEMENTED', HTTP_SERIES(HttpStatus.NOT_IMPLEMENTED));\n ExceptionReason.HTTP_NOT_MODIFIED = new ExceptionReason('HTTP_NOT_MODIFIED', HTTP_SERIES(HttpStatus.NOT_MODIFIED));\n ExceptionReason.HTTP_OK = new ExceptionReason('HTTP_OK', HTTP_SERIES(HttpStatus.OK));\n ExceptionReason.HTTP_PARTIAL_CONTENT = new ExceptionReason('HTTP_PARTIAL_CONTENT', HTTP_SERIES(HttpStatus.PARTIAL_CONTENT));\n ExceptionReason.HTTP_PAYMENT_REQUIRED = new ExceptionReason('HTTP_PAYMENT_REQUIRED', HTTP_SERIES(HttpStatus.PAYMENT_REQUIRED));\n ExceptionReason.HTTP_PERMANENT_REDIRECT = new ExceptionReason('HTTP_PERMANENT_REDIRECT', HTTP_SERIES(HttpStatus.PERMANENT_REDIRECT));\n ExceptionReason.HTTP_PRECONDITION_FAILED = new ExceptionReason('HTTP_PRECONDITION_FAILED', HTTP_SERIES(HttpStatus.PRECONDITION_FAILED));\n ExceptionReason.HTTP_PRECONDITION_REQUIRED = new ExceptionReason('HTTP_PRECONDITION_REQUIRED', HTTP_SERIES(HttpStatus.PRECONDITION_REQUIRED));\n ExceptionReason.HTTP_PROCESSING = new ExceptionReason('HTTP_PROCESSING', HTTP_SERIES(HttpStatus.PROCESSING));\n ExceptionReason.HTTP_PROXY_AUTHENTICATION_REQUIRED = new ExceptionReason('HTTP_PROXY_AUTHENTICATION_REQUIRED', HTTP_SERIES(HttpStatus.PROXY_AUTHENTICATION_REQUIRED));\n ExceptionReason.HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = new ExceptionReason('HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE', HTTP_SERIES(HttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE));\n ExceptionReason.HTTP_REQUEST_TIMEOUT = new ExceptionReason('HTTP_REQUEST_TIMEOUT', HTTP_SERIES(HttpStatus.REQUEST_TIMEOUT));\n ExceptionReason.HTTP_REQUEST_TOO_LONG = new ExceptionReason('HTTP_REQUEST_TOO_LONG', HTTP_SERIES(HttpStatus.REQUEST_TOO_LONG));\n ExceptionReason.HTTP_REQUEST_URI_TOO_LONG = new ExceptionReason('HTTP_REQUEST_URI_TOO_LONG', HTTP_SERIES(HttpStatus.REQUEST_URI_TOO_LONG));\n ExceptionReason.HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = new ExceptionReason('HTTP_REQUESTED_RANGE_NOT_SATISFIABLE', HTTP_SERIES(HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE));\n ExceptionReason.HTTP_RESET_CONTENT = new ExceptionReason('HTTP_RESET_CONTENT', HTTP_SERIES(HttpStatus.RESET_CONTENT));\n ExceptionReason.HTTP_SEE_OTHER = new ExceptionReason('HTTP_SEE_OTHER', HTTP_SERIES(HttpStatus.SEE_OTHER));\n ExceptionReason.HTTP_SERVICE_UNAVAILABLE = new ExceptionReason('HTTP_SERVICE_UNAVAILABLE', HTTP_SERIES(HttpStatus.SERVICE_UNAVAILABLE));\n ExceptionReason.HTTP_SWITCHING_PROTOCOLS = new ExceptionReason('HTTP_SWITCHING_PROTOCOLS', HTTP_SERIES(HttpStatus.SWITCHING_PROTOCOLS));\n ExceptionReason.HTTP_TEMPORARY_REDIRECT = new ExceptionReason('HTTP_TEMPORARY_REDIRECT', HTTP_SERIES(HttpStatus.TEMPORARY_REDIRECT));\n ExceptionReason.HTTP_TOO_MANY_REQUESTS = new ExceptionReason('HTTP_TOO_MANY_REQUESTS', HTTP_SERIES(HttpStatus.TOO_MANY_REQUESTS));\n ExceptionReason.HTTP_UNAUTHORIZED = new ExceptionReason('HTTP_UNAUTHORIZED', HTTP_SERIES(HttpStatus.UNAUTHORIZED));\n ExceptionReason.HTTP_UNPROCESSABLE_ENTITY = new ExceptionReason('HTTP_UNPROCESSABLE_ENTITY', HTTP_SERIES(HttpStatus.UNPROCESSABLE_ENTITY));\n ExceptionReason.HTTP_UNSUPPORTED_MEDIA_TYPE = new ExceptionReason('HTTP_UNSUPPORTED_MEDIA_TYPE', HTTP_SERIES(HttpStatus.UNSUPPORTED_MEDIA_TYPE));\n ExceptionReason.HTTP_USE_PROXY = new ExceptionReason('HTTP_USE_PROXY', HTTP_SERIES(HttpStatus.USE_PROXY));\n return ExceptionReason;\n}());\nexports.ExceptionReason = ExceptionReason;\n//# sourceMappingURL=ExceptionReason.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Core/ExceptionReason.js?");
416
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ExceptionReason = void 0;\nvar HttpStatus = __webpack_require__(/*! http-status-codes */ \"./node_modules/http-status-codes/index.js\");\nvar HTTP_SERIES = function (statusCode) { return 100000 + statusCode; };\nvar reasonCodeToExceptionReasonMapper = new Map();\nvar ExceptionReason = /** @class */ (function () {\n function ExceptionReason(errorString, errorCode) {\n this.name = errorString;\n this.code = errorCode;\n reasonCodeToExceptionReasonMapper.set(errorCode, this);\n }\n ExceptionReason.fromHttpStatusCode = function (httpStatusCode) {\n return (reasonCodeToExceptionReasonMapper.get(HTTP_SERIES(httpStatusCode)) ||\n new ExceptionReason(\"HTTP_\".concat(httpStatusCode), HTTP_SERIES(httpStatusCode)));\n };\n ExceptionReason.UNCAUGHT = new ExceptionReason('UNCAUGHT', 0);\n ExceptionReason.UNSUCCESSFUL_RESULT = new ExceptionReason('UNSUCCESSFUL_RESULT', 1);\n ExceptionReason.INTERNAL_ROUTING_ERROR = new ExceptionReason('INTERNAL_ROUTING_ERROR', 2);\n ExceptionReason.INCOMPATIBLE_SERVICE_RESPONSE = new ExceptionReason('INCOMPATIBLE_SERVICE_RESPONSE', 3);\n ExceptionReason.ENTITY_NOT_FOUND = new ExceptionReason('ENTITY_NOT_FOUND', 4);\n ExceptionReason.ILLEGAL_STATE = new ExceptionReason('ILLEGAL_STATE', 5);\n ExceptionReason.INVALID_ARGUMENTS = new ExceptionReason('INVALID_ARGUMENTS', 6);\n ExceptionReason.CAPTCHA_VERIFICATION_REQUIRED = new ExceptionReason('CAPTCHA_VERIFICATION_REQUIRED', 7);\n ExceptionReason.TIMEOUT = new ExceptionReason('TIMEOUT', 8);\n /* 1xxxxxx Http Series */\n ExceptionReason.HTTP_ACCEPTED = new ExceptionReason('HTTP_ACCEPTED', HTTP_SERIES(HttpStatus.ACCEPTED));\n ExceptionReason.HTTP_BAD_GATEWAY = new ExceptionReason('HTTP_BAD_GATEWAY', HTTP_SERIES(HttpStatus.BAD_GATEWAY));\n ExceptionReason.HTTP_BAD_REQUEST = new ExceptionReason('HTTP_BAD_REQUEST', HTTP_SERIES(HttpStatus.BAD_REQUEST));\n ExceptionReason.HTTP_CONFLICT = new ExceptionReason('HTTP_CONFLICT', HTTP_SERIES(HttpStatus.CONFLICT));\n ExceptionReason.HTTP_CONTINUE = new ExceptionReason('HTTP_CONTINUE', HTTP_SERIES(HttpStatus.CONTINUE));\n ExceptionReason.HTTP_CREATED = new ExceptionReason('HTTP_CREATED', HTTP_SERIES(HttpStatus.CREATED));\n ExceptionReason.HTTP_EXPECTATION_FAILED = new ExceptionReason('HTTP_EXPECTATION_FAILED', HTTP_SERIES(HttpStatus.EXPECTATION_FAILED));\n ExceptionReason.HTTP_FAILED_DEPENDENCY = new ExceptionReason('HTTP_FAILED_DEPENDENCY', HTTP_SERIES(HttpStatus.FAILED_DEPENDENCY));\n ExceptionReason.HTTP_FORBIDDEN = new ExceptionReason('HTTP_FORBIDDEN', HTTP_SERIES(HttpStatus.FORBIDDEN));\n ExceptionReason.HTTP_GATEWAY_TIMEOUT = new ExceptionReason('HTTP_GATEWAY_TIMEOUT', HTTP_SERIES(HttpStatus.GATEWAY_TIMEOUT));\n ExceptionReason.HTTP_GONE = new ExceptionReason('HTTP_GONE', HTTP_SERIES(HttpStatus.GONE));\n ExceptionReason.HTTP_HTTP_VERSION_NOT_SUPPORTED = new ExceptionReason('HTTP_HTTP_VERSION_NOT_SUPPORTED', HTTP_SERIES(HttpStatus.HTTP_VERSION_NOT_SUPPORTED));\n ExceptionReason.HTTP_IM_A_TEAPOT = new ExceptionReason('HTTP_IM_A_TEAPOT', HTTP_SERIES(HttpStatus.IM_A_TEAPOT));\n ExceptionReason.HTTP_INSUFFICIENT_SPACE_ON_RESOURCE = new ExceptionReason('HTTP_INSUFFICIENT_SPACE_ON_RESOURCE', HTTP_SERIES(HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE));\n ExceptionReason.HTTP_INSUFFICIENT_STORAGE = new ExceptionReason('HTTP_INSUFFICIENT_STORAGE', HTTP_SERIES(HttpStatus.INSUFFICIENT_STORAGE));\n ExceptionReason.HTTP_INTERNAL_SERVER_ERROR = new ExceptionReason('HTTP_INTERNAL_SERVER_ERROR', HTTP_SERIES(HttpStatus.INTERNAL_SERVER_ERROR));\n ExceptionReason.HTTP_LENGTH_REQUIRED = new ExceptionReason('HTTP_LENGTH_REQUIRED', HTTP_SERIES(HttpStatus.LENGTH_REQUIRED));\n ExceptionReason.HTTP_LOCKED = new ExceptionReason('HTTP_LOCKED', HTTP_SERIES(HttpStatus.LOCKED));\n ExceptionReason.HTTP_METHOD_FAILURE = new ExceptionReason('HTTP_METHOD_FAILURE', HTTP_SERIES(HttpStatus.METHOD_FAILURE));\n ExceptionReason.HTTP_METHOD_NOT_ALLOWED = new ExceptionReason('HTTP_METHOD_NOT_ALLOWED', HTTP_SERIES(HttpStatus.METHOD_NOT_ALLOWED));\n ExceptionReason.HTTP_MOVED_PERMANENTLY = new ExceptionReason('HTTP_MOVED_PERMANENTLY', HTTP_SERIES(HttpStatus.MOVED_PERMANENTLY));\n ExceptionReason.HTTP_MOVED_TEMPORARILY = new ExceptionReason('HTTP_MOVED_TEMPORARILY', HTTP_SERIES(HttpStatus.MOVED_TEMPORARILY));\n ExceptionReason.HTTP_MULTI_STATUS = new ExceptionReason('HTTP_MULTI_STATUS', HTTP_SERIES(HttpStatus.MULTI_STATUS));\n ExceptionReason.HTTP_MULTIPLE_CHOICES = new ExceptionReason('HTTP_MULTIPLE_CHOICES', HTTP_SERIES(HttpStatus.MULTIPLE_CHOICES));\n ExceptionReason.HTTP_NETWORK_AUTHENTICATION_REQUIRED = new ExceptionReason('HTTP_NETWORK_AUTHENTICATION_REQUIRED', HTTP_SERIES(HttpStatus.NETWORK_AUTHENTICATION_REQUIRED));\n ExceptionReason.HTTP_NO_CONTENT = new ExceptionReason('HTTP_NO_CONTENT', HTTP_SERIES(HttpStatus.NO_CONTENT));\n ExceptionReason.HTTP_NON_AUTHORITATIVE_INFORMATION = new ExceptionReason('HTTP_NON_AUTHORITATIVE_INFORMATION', HTTP_SERIES(HttpStatus.NON_AUTHORITATIVE_INFORMATION));\n ExceptionReason.HTTP_NOT_ACCEPTABLE = new ExceptionReason('HTTP_NOT_ACCEPTABLE', HTTP_SERIES(HttpStatus.NOT_ACCEPTABLE));\n ExceptionReason.HTTP_NOT_FOUND = new ExceptionReason('HTTP_NOT_FOUND', HTTP_SERIES(HttpStatus.NOT_FOUND));\n ExceptionReason.HTTP_NOT_IMPLEMENTED = new ExceptionReason('HTTP_NOT_IMPLEMENTED', HTTP_SERIES(HttpStatus.NOT_IMPLEMENTED));\n ExceptionReason.HTTP_NOT_MODIFIED = new ExceptionReason('HTTP_NOT_MODIFIED', HTTP_SERIES(HttpStatus.NOT_MODIFIED));\n ExceptionReason.HTTP_OK = new ExceptionReason('HTTP_OK', HTTP_SERIES(HttpStatus.OK));\n ExceptionReason.HTTP_PARTIAL_CONTENT = new ExceptionReason('HTTP_PARTIAL_CONTENT', HTTP_SERIES(HttpStatus.PARTIAL_CONTENT));\n ExceptionReason.HTTP_PAYMENT_REQUIRED = new ExceptionReason('HTTP_PAYMENT_REQUIRED', HTTP_SERIES(HttpStatus.PAYMENT_REQUIRED));\n ExceptionReason.HTTP_PERMANENT_REDIRECT = new ExceptionReason('HTTP_PERMANENT_REDIRECT', HTTP_SERIES(HttpStatus.PERMANENT_REDIRECT));\n ExceptionReason.HTTP_PRECONDITION_FAILED = new ExceptionReason('HTTP_PRECONDITION_FAILED', HTTP_SERIES(HttpStatus.PRECONDITION_FAILED));\n ExceptionReason.HTTP_PRECONDITION_REQUIRED = new ExceptionReason('HTTP_PRECONDITION_REQUIRED', HTTP_SERIES(HttpStatus.PRECONDITION_REQUIRED));\n ExceptionReason.HTTP_PROCESSING = new ExceptionReason('HTTP_PROCESSING', HTTP_SERIES(HttpStatus.PROCESSING));\n ExceptionReason.HTTP_PROXY_AUTHENTICATION_REQUIRED = new ExceptionReason('HTTP_PROXY_AUTHENTICATION_REQUIRED', HTTP_SERIES(HttpStatus.PROXY_AUTHENTICATION_REQUIRED));\n ExceptionReason.HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = new ExceptionReason('HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE', HTTP_SERIES(HttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE));\n ExceptionReason.HTTP_REQUEST_TIMEOUT = new ExceptionReason('HTTP_REQUEST_TIMEOUT', HTTP_SERIES(HttpStatus.REQUEST_TIMEOUT));\n ExceptionReason.HTTP_REQUEST_TOO_LONG = new ExceptionReason('HTTP_REQUEST_TOO_LONG', HTTP_SERIES(HttpStatus.REQUEST_TOO_LONG));\n ExceptionReason.HTTP_REQUEST_URI_TOO_LONG = new ExceptionReason('HTTP_REQUEST_URI_TOO_LONG', HTTP_SERIES(HttpStatus.REQUEST_URI_TOO_LONG));\n ExceptionReason.HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = new ExceptionReason('HTTP_REQUESTED_RANGE_NOT_SATISFIABLE', HTTP_SERIES(HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE));\n ExceptionReason.HTTP_RESET_CONTENT = new ExceptionReason('HTTP_RESET_CONTENT', HTTP_SERIES(HttpStatus.RESET_CONTENT));\n ExceptionReason.HTTP_SEE_OTHER = new ExceptionReason('HTTP_SEE_OTHER', HTTP_SERIES(HttpStatus.SEE_OTHER));\n ExceptionReason.HTTP_SERVICE_UNAVAILABLE = new ExceptionReason('HTTP_SERVICE_UNAVAILABLE', HTTP_SERIES(HttpStatus.SERVICE_UNAVAILABLE));\n ExceptionReason.HTTP_SWITCHING_PROTOCOLS = new ExceptionReason('HTTP_SWITCHING_PROTOCOLS', HTTP_SERIES(HttpStatus.SWITCHING_PROTOCOLS));\n ExceptionReason.HTTP_TEMPORARY_REDIRECT = new ExceptionReason('HTTP_TEMPORARY_REDIRECT', HTTP_SERIES(HttpStatus.TEMPORARY_REDIRECT));\n ExceptionReason.HTTP_TOO_MANY_REQUESTS = new ExceptionReason('HTTP_TOO_MANY_REQUESTS', HTTP_SERIES(HttpStatus.TOO_MANY_REQUESTS));\n ExceptionReason.HTTP_UNAUTHORIZED = new ExceptionReason('HTTP_UNAUTHORIZED', HTTP_SERIES(HttpStatus.UNAUTHORIZED));\n ExceptionReason.HTTP_UNPROCESSABLE_ENTITY = new ExceptionReason('HTTP_UNPROCESSABLE_ENTITY', HTTP_SERIES(HttpStatus.UNPROCESSABLE_ENTITY));\n ExceptionReason.HTTP_UNSUPPORTED_MEDIA_TYPE = new ExceptionReason('HTTP_UNSUPPORTED_MEDIA_TYPE', HTTP_SERIES(HttpStatus.UNSUPPORTED_MEDIA_TYPE));\n ExceptionReason.HTTP_USE_PROXY = new ExceptionReason('HTTP_USE_PROXY', HTTP_SERIES(HttpStatus.USE_PROXY));\n return ExceptionReason;\n}());\nexports.ExceptionReason = ExceptionReason;\n//# sourceMappingURL=ExceptionReason.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Core/ExceptionReason.js?");
417
417
 
418
418
  /***/ }),
419
419
 
@@ -534,7 +534,7 @@ eval("\nvar __extends = (this && this.__extends) || (function () {\n var exte
534
534
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
535
535
 
536
536
  "use strict";
537
- eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar rxjs_1 = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/_esm5/index.js\");\nvar operators_1 = __webpack_require__(/*! rxjs/operators */ \"./node_modules/rxjs/_esm5/operators/index.js\");\nvar BaseStore_1 = __webpack_require__(/*! ../../Core/BaseStore */ \"./dist/Core/BaseStore.js\");\nvar CrewService_1 = __webpack_require__(/*! ../Service/CrewService */ \"./dist/Crew/Service/CrewService.js\");\nvar CrewStore = /** @class */ (function (_super) {\n __extends(CrewStore, _super);\n function CrewStore(session) {\n var _this = _super.call(this) || this;\n _this.driverCurrentlyAssigned = new Map();\n _this.crewsByTeam = new Map();\n _this.state$.subscribe(function (state) {\n var crews = _this.getItems();\n var users = [];\n crews.forEach(function (crew) {\n var normalizedDrivers = crew.drivers.map(function (driver) { return (__assign(__assign({}, driver), { team_ids: [crew.team_id] })); });\n var normalizedPrimaryDriver = __assign(__assign({}, crew.primary_driver), { team_ids: [crew.team_id] });\n users.push.apply(users, __spreadArray(__spreadArray([], __read(normalizedDrivers), false), [normalizedPrimaryDriver], false));\n });\n (0, rxjs_1.from)(users)\n .pipe((0, operators_1.groupBy)(function (user) { return (0, lodash_1.first)(user.team_ids); }, function (user) { return user; }), (0, operators_1.mergeMap)(function (group) { return (0, rxjs_1.zip)((0, rxjs_1.of)(group.key), group.pipe((0, operators_1.toArray)())); }))\n .subscribe(function (_a) {\n var _b = __read(_a, 2), teamId = _b[0], users = _b[1];\n _this.driverCurrentlyAssigned.set(teamId, users.map(function (user) { return user.id; }));\n });\n });\n _this.state$.subscribe(function (state) {\n (0, rxjs_1.from)(_this.getItems())\n .pipe((0, operators_1.groupBy)(function (crew) { return crew.team_id; }, function (crew) { return crew; }), (0, operators_1.mergeMap)(function (group) { return (0, rxjs_1.zip)((0, rxjs_1.of)(group.key), group.pipe((0, operators_1.toArray)())); }))\n .subscribe(function (_a) {\n var _b = __read(_a, 2), teamId = _b[0], crews = _b[1];\n _this.crewsByTeam.set(teamId, crews);\n });\n });\n _this.crewService = new CrewService_1.default(session, _this);\n return _this;\n }\n CrewStore.prototype.getCrewPlannedRoute = function (crewId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getById(crewId)];\n case 1:\n _a.sent();\n return [2 /*return*/, this.getItem(crewId).planned_route];\n }\n });\n });\n };\n CrewStore.prototype.getAllByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.getAllByTeam(teamId)];\n case 1:\n response = _a.sent();\n if (this.crewsByTeam.get(teamId)) {\n response.forEach(function (item) { return _this.updateInStore(item); });\n }\n else {\n response.forEach(function (item) { return _this.addToStore(item); });\n }\n return [2 /*return*/, response];\n }\n });\n });\n };\n CrewStore.prototype.getById = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.getItem(id);\n if (_a) return [3 /*break*/, 2];\n return [4 /*yield*/, this._fetch(id)];\n case 1:\n _a = (_b.sent());\n _b.label = 2;\n case 2: return [2 /*return*/, _a];\n }\n });\n });\n };\n CrewStore.prototype.create = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.create(request)];\n case 1:\n response = _a.sent();\n this.addToStore(response);\n return [2 /*return*/, response];\n }\n });\n });\n };\n CrewStore.prototype.update = function (id, crew) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.update(id, crew)];\n case 1:\n response = _a.sent();\n this.updateInStore(response);\n return [2 /*return*/, response];\n }\n });\n });\n };\n CrewStore.prototype.delete = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.delete(id)];\n case 1:\n _a.sent();\n this.removeFromStore(id);\n return [2 /*return*/];\n }\n });\n });\n };\n CrewStore.prototype._fetch = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.get(id)];\n case 1:\n response = _a.sent();\n this.addToStore(response);\n return [2 /*return*/, response];\n }\n });\n });\n };\n return CrewStore;\n}(BaseStore_1.default));\nexports[\"default\"] = CrewStore;\n//# sourceMappingURL=CrewStore.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Crew/Store/CrewStore.js?");
537
+ eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar rxjs_1 = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/_esm5/index.js\");\nvar operators_1 = __webpack_require__(/*! rxjs/operators */ \"./node_modules/rxjs/_esm5/operators/index.js\");\nvar BaseStore_1 = __webpack_require__(/*! ../../Core/BaseStore */ \"./dist/Core/BaseStore.js\");\nvar CrewService_1 = __webpack_require__(/*! ../Service/CrewService */ \"./dist/Crew/Service/CrewService.js\");\nvar CrewStore = /** @class */ (function (_super) {\n __extends(CrewStore, _super);\n function CrewStore(session) {\n var _this = _super.call(this) || this;\n _this.driverCurrentlyAssigned = new Map();\n _this.crewsByTeam = new Map();\n _this.state$.subscribe(function (state) {\n var crews = _this.getItems();\n var users = [];\n crews.forEach(function (crew) {\n var normalizedDrivers = (crew.drivers || []).map(function (driver) { return (__assign(__assign({}, driver), { team_ids: [crew.team_id] })); });\n var normalizedPrimaryDriver = __assign(__assign({}, crew.primary_driver), { team_ids: [crew.team_id] });\n users.push.apply(users, __spreadArray(__spreadArray([], __read(normalizedDrivers), false), [normalizedPrimaryDriver], false));\n });\n (0, rxjs_1.from)(users)\n .pipe((0, operators_1.groupBy)(function (user) { return (0, lodash_1.first)(user.team_ids); }, function (user) { return user; }), (0, operators_1.mergeMap)(function (group) { return (0, rxjs_1.zip)((0, rxjs_1.of)(group.key), group.pipe((0, operators_1.toArray)())); }))\n .subscribe(function (_a) {\n var _b = __read(_a, 2), teamId = _b[0], users = _b[1];\n _this.driverCurrentlyAssigned.set(teamId, users.map(function (user) { return user.id; }));\n });\n });\n _this.state$.subscribe(function (state) {\n (0, rxjs_1.from)(_this.getItems())\n .pipe((0, operators_1.groupBy)(function (crew) { return crew.team_id; }, function (crew) { return crew; }), (0, operators_1.mergeMap)(function (group) { return (0, rxjs_1.zip)((0, rxjs_1.of)(group.key), group.pipe((0, operators_1.toArray)())); }))\n .subscribe(function (_a) {\n var _b = __read(_a, 2), teamId = _b[0], crews = _b[1];\n _this.crewsByTeam.set(teamId, crews);\n });\n });\n _this.crewService = new CrewService_1.default(session, _this);\n return _this;\n }\n CrewStore.prototype.getCrewPlannedRoute = function (crewId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getById(crewId)];\n case 1:\n _a.sent();\n return [2 /*return*/, this.getItem(crewId).planned_route];\n }\n });\n });\n };\n CrewStore.prototype.getAllByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.getAllByTeam(teamId)];\n case 1:\n response = _a.sent();\n if (this.crewsByTeam.get(teamId)) {\n response.forEach(function (item) { return _this.updateInStore(item); });\n }\n else {\n response.forEach(function (item) { return _this.addToStore(item); });\n }\n return [2 /*return*/, response];\n }\n });\n });\n };\n CrewStore.prototype.getById = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.getItem(id);\n if (_a) return [3 /*break*/, 2];\n return [4 /*yield*/, this._fetch(id)];\n case 1:\n _a = (_b.sent());\n _b.label = 2;\n case 2: return [2 /*return*/, _a];\n }\n });\n });\n };\n CrewStore.prototype.create = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.create(request)];\n case 1:\n response = _a.sent();\n this.addToStore(response);\n return [2 /*return*/, response];\n }\n });\n });\n };\n CrewStore.prototype.update = function (id, crew) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.update(id, crew)];\n case 1:\n response = _a.sent();\n this.updateInStore(response);\n return [2 /*return*/, response];\n }\n });\n });\n };\n CrewStore.prototype.delete = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.delete(id)];\n case 1:\n _a.sent();\n this.removeFromStore(id);\n return [2 /*return*/];\n }\n });\n });\n };\n CrewStore.prototype._fetch = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.crewService.get(id)];\n case 1:\n response = _a.sent();\n this.addToStore(response);\n return [2 /*return*/, response];\n }\n });\n });\n };\n return CrewStore;\n}(BaseStore_1.default));\nexports[\"default\"] = CrewStore;\n//# sourceMappingURL=CrewStore.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Crew/Store/CrewStore.js?");
538
538
 
539
539
  /***/ }),
540
540
 
@@ -2349,7 +2349,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
2349
2349
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2350
2350
 
2351
2351
  "use strict";
2352
- eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar Logger_1 = __webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\");\nvar abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '8.25.0';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) {\n //\n }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, authenticationToken, \n // eslint-disable-next-line @typescript-eslint/ban-types\n headers, responseType, signal) {\n // NiceToHave: move headers to HttpHeaders class\n this.headers = __assign(__assign({ 'Content-Type': 'application/json' }, headers), { 'sdk-version': version, Client: clientId });\n this.timeout = timeout;\n this.validateStatus = lodash_1.stubTrue;\n if (queryString) {\n this.params = queryString;\n }\n if (authenticationToken) {\n this.headers['Authorization'] = \"Token token=\".concat(authenticationToken);\n }\n if (responseType) {\n this.responseType = responseType;\n }\n if (signal) {\n this.signal = signal;\n }\n }\n RequestOptions.new = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.clientId, clientId = _c === void 0 ? 'Bringg Dashboard' : _c, _d = _b.timeout, timeout = _d === void 0 ? DEFAULT_TIMEOUT : _d, queryString = _b.queryString, authenticationToken = _b.authenticationToken, headers = _b.headers, responseType = _b.responseType, signal = _b.signal;\n return new RequestOptions(clientId, timeout || DEFAULT_TIMEOUT, queryString, authenticationToken, headers, responseType, signal);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response, signal) {\n this.axiosPromise = response;\n this.signal = signal;\n }\n ResponseHandler.prototype.handle = function (consumer) {\n return __awaiter(this, void 0, void 0, function () {\n var axiosResponse, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if ((0, lodash_1.isUndefined)(consumer)) {\n throw new Error('consumer must be defined');\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.axiosPromise];\n case 2:\n axiosResponse = _a.sent();\n return [2 /*return*/, consumer(axiosResponse)];\n case 3:\n e_1 = _a.sent();\n if (axios_1.default.isCancel(e_1)) {\n (0, abort_1.throwAbortError)(this.signal, 'Request Aborted');\n }\n if (e_1 instanceof BringgException_1.BringgException) {\n throw e_1;\n }\n return [2 /*return*/, consumer(e_1)];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n return ResponseHandler;\n}());\nexports.ResponseHandler = ResponseHandler;\nfunction get(axiosInstance, host, uri, queryString, signal) {\n return new ResponseHandler(axiosInstance.get(\"\".concat(host).concat(uri), { params: queryString, signal: signal }), signal);\n}\nfunction post(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.post(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction put(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.put(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction patch(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.patch(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction remove(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.delete(\"\".concat(host).concat(uri), { params: queryString, data: payload, signal: signal }), signal);\n}\nfunction routify(axiosInstance, endpoint, route, \n// eslint-disable-next-line @typescript-eslint/ban-types\nrouteParams, queryString, payload, signal) {\n switch (route.httpMethod) {\n case 0 /* HttpMethod.GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, signal);\n case 1 /* HttpMethod.POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 2 /* HttpMethod.PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 3 /* HttpMethod.PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 4 /* HttpMethod.DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n }\n}\nfunction wrapWithInterceptors(axios) {\n axios.interceptors.request.use(function (req) {\n var method = req.method, url = req.url, params = req.params, headers = req.headers, data = req.data;\n try {\n Logger_1.default.debug('REQUEST:', method.toUpperCase(), url);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.trace('REQUEST-query-string:', params);\n Logger_1.default.trace('REQUEST-headers:', headers);\n Logger_1.default.trace('REQUEST-data:', data);\n }\n catch (e) {\n //\n }\n return req;\n });\n axios.interceptors.response.use(function (res) {\n var statusText = res.statusText, status = res.status, headers = res.headers, data = res.data;\n try {\n Logger_1.default.debug('RESPONSE:', res.config.url, status, statusText);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) {\n //\n }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, \n// eslint-disable-next-line @typescript-eslint/ban-types\nheaders, responseType, timeout, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers, responseType: responseType, timeout: timeout, signal: signal })));\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction anonymousAxiosInstance(clientId, headers, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers, signal: signal })));\n}\nvar AuthorizedServiceRequest = /** @class */ (function () {\n function AuthorizedServiceRequest(clientId, authToken) {\n this.authToken = authToken;\n this.clientId = clientId;\n }\n AuthorizedServiceRequest.prototype.invoke = function (endpoint, route, \n // eslint-disable-next-line @typescript-eslint/ban-types\n routeParams, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, payload, \n // eslint-disable-next-line @typescript-eslint/ban-types\n headers, responseType, timeout, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(axiosInstance(this.clientId, this.authToken, headers, responseType, timeout), endpoint, route, routeParams, queryString, payload, signal);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId, headers) {\n this.clientId = clientId;\n this.headers = headers;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, \n // eslint-disable-next-line @typescript-eslint/ban-types\n routeParams, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, payload, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(anonymousAxiosInstance(this.clientId, this.headers, signal), endpoint, route, routeParams, queryString, payload);\n };\n return AnonymousServiceRequest;\n}());\nexports.AnonymousServiceRequest = AnonymousServiceRequest;\n//# sourceMappingURL=ServiceRequest.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/ServiceRequest.js?");
2352
+ eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar Logger_1 = __webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\");\nvar abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '8.27.0-pre';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) {\n //\n }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, authenticationToken, \n // eslint-disable-next-line @typescript-eslint/ban-types\n headers, responseType, signal) {\n // NiceToHave: move headers to HttpHeaders class\n this.headers = __assign(__assign({ 'Content-Type': 'application/json' }, headers), { 'sdk-version': version, Client: clientId });\n this.timeout = timeout;\n this.validateStatus = lodash_1.stubTrue;\n if (queryString) {\n this.params = queryString;\n }\n if (authenticationToken) {\n this.headers['Authorization'] = \"Token token=\".concat(authenticationToken);\n }\n if (responseType) {\n this.responseType = responseType;\n }\n if (signal) {\n this.signal = signal;\n }\n }\n RequestOptions.new = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.clientId, clientId = _c === void 0 ? 'Bringg Dashboard' : _c, _d = _b.timeout, timeout = _d === void 0 ? DEFAULT_TIMEOUT : _d, queryString = _b.queryString, authenticationToken = _b.authenticationToken, headers = _b.headers, responseType = _b.responseType, signal = _b.signal;\n return new RequestOptions(clientId, timeout || DEFAULT_TIMEOUT, queryString, authenticationToken, headers, responseType, signal);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response, signal) {\n this.axiosPromise = response;\n this.signal = signal;\n }\n ResponseHandler.prototype.handle = function (consumer) {\n return __awaiter(this, void 0, void 0, function () {\n var axiosResponse, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if ((0, lodash_1.isUndefined)(consumer)) {\n throw new Error('consumer must be defined');\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.axiosPromise];\n case 2:\n axiosResponse = _a.sent();\n return [2 /*return*/, consumer(axiosResponse)];\n case 3:\n e_1 = _a.sent();\n if (axios_1.default.isCancel(e_1)) {\n (0, abort_1.throwAbortError)(this.signal, 'Request Aborted');\n }\n if (e_1 instanceof BringgException_1.BringgException) {\n throw e_1;\n }\n return [2 /*return*/, consumer(e_1)];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n return ResponseHandler;\n}());\nexports.ResponseHandler = ResponseHandler;\nfunction get(axiosInstance, host, uri, queryString, signal) {\n return new ResponseHandler(axiosInstance.get(\"\".concat(host).concat(uri), { params: queryString, signal: signal }), signal);\n}\nfunction post(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.post(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction put(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.put(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction patch(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.patch(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction remove(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.delete(\"\".concat(host).concat(uri), { params: queryString, data: payload, signal: signal }), signal);\n}\nfunction routify(axiosInstance, endpoint, route, \n// eslint-disable-next-line @typescript-eslint/ban-types\nrouteParams, queryString, payload, signal) {\n switch (route.httpMethod) {\n case 0 /* HttpMethod.GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, signal);\n case 1 /* HttpMethod.POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 2 /* HttpMethod.PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 3 /* HttpMethod.PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 4 /* HttpMethod.DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n }\n}\nfunction wrapWithInterceptors(axios) {\n axios.interceptors.request.use(function (req) {\n var method = req.method, url = req.url, params = req.params, headers = req.headers, data = req.data;\n try {\n Logger_1.default.debug('REQUEST:', method.toUpperCase(), url);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.trace('REQUEST-query-string:', params);\n Logger_1.default.trace('REQUEST-headers:', headers);\n Logger_1.default.trace('REQUEST-data:', data);\n }\n catch (e) {\n //\n }\n return req;\n });\n axios.interceptors.response.use(function (res) {\n var statusText = res.statusText, status = res.status, headers = res.headers, data = res.data;\n try {\n Logger_1.default.debug('RESPONSE:', res.config.url, status, statusText);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) {\n //\n }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, \n// eslint-disable-next-line @typescript-eslint/ban-types\nheaders, responseType, timeout, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers, responseType: responseType, timeout: timeout, signal: signal })));\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction anonymousAxiosInstance(clientId, headers, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers, signal: signal })));\n}\nvar AuthorizedServiceRequest = /** @class */ (function () {\n function AuthorizedServiceRequest(clientId, authToken) {\n this.authToken = authToken;\n this.clientId = clientId;\n }\n AuthorizedServiceRequest.prototype.invoke = function (endpoint, route, \n // eslint-disable-next-line @typescript-eslint/ban-types\n routeParams, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, payload, \n // eslint-disable-next-line @typescript-eslint/ban-types\n headers, responseType, timeout, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(axiosInstance(this.clientId, this.authToken, headers, responseType, timeout), endpoint, route, routeParams, queryString, payload, signal);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId, headers) {\n this.clientId = clientId;\n this.headers = headers;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, \n // eslint-disable-next-line @typescript-eslint/ban-types\n routeParams, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, payload, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(anonymousAxiosInstance(this.clientId, this.headers, signal), endpoint, route, routeParams, queryString, payload);\n };\n return AnonymousServiceRequest;\n}());\nexports.AnonymousServiceRequest = AnonymousServiceRequest;\n//# sourceMappingURL=ServiceRequest.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/ServiceRequest.js?");
2353
2353
 
2354
2354
  /***/ }),
2355
2355
 
@@ -2932,7 +2932,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
2932
2932
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2933
2933
 
2934
2934
  "use strict";
2935
- eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar PubSubEvents_1 = __webpack_require__(/*! ../../Services/PubSubEvents */ \"./dist/Services/PubSubEvents.js\");\nvar PubSubService_1 = __webpack_require__(/*! ../../Services/PubSubService */ \"./dist/Services/PubSubService.js\");\nvar Route_1 = __webpack_require__(/*! ../../Services/Route */ \"./dist/Services/Route.js\");\nvar keyset_pagination_consts_1 = __webpack_require__(/*! ../../utils/consts/keyset-pagination.consts */ \"./dist/utils/consts/keyset-pagination.consts.js\");\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar ROUTES = {\n GET: new Route_1.Route('/users/{:userId}', 0 /* HttpMethod.GET */),\n GET_ALL: new Route_1.Route('/users/', 0 /* HttpMethod.GET */),\n GET_ALL_DRIVERS: new Route_1.Route('/users/drivers', 0 /* HttpMethod.GET */),\n GET_USERS_WITH_USER_TYPE: new Route_1.Route('/user_types/{:userTypeId}/users', 0 /* HttpMethod.GET */),\n GET_DRIVERS_BY_TEAM: new Route_1.Route('/teams/{:teamId}/users', 0 /* HttpMethod.GET */),\n MAKE_ADMIN: new Route_1.Route('/users/{:userId}/admin', 1 /* HttpMethod.POST */),\n CREATE_USER: new Route_1.Route('/users/', 1 /* HttpMethod.POST */),\n INVITE: new Route_1.Route('/users/{:userId}/reinvite', 1 /* HttpMethod.POST */),\n TOTAL_TASKS: new Route_1.Route('/users/{:userId}/tasks/count', 0 /* HttpMethod.GET */),\n TOTAL_EMPLOYEES: new Route_1.Route('/users/count', 0 /* HttpMethod.GET */),\n TOTAL_DRIVERS: new Route_1.Route('/users/drivers/count', 0 /* HttpMethod.GET */),\n UNLOCK: new Route_1.Route('/users/{:userId}/unlock', 1 /* HttpMethod.POST */),\n INVITE_VIA_EMAIL: new Route_1.Route('/users/{:userId}/reinvite_via_email', 1 /* HttpMethod.POST */),\n VALIDATE_PHONE: new Route_1.Route('/api/user/validate_phone', 0 /* HttpMethod.GET */),\n CLOSED_TASKS: new Route_1.Route('/users/{:userId}/tasks/closed_tasks', 0 /* HttpMethod.GET */),\n UPDATE: new Route_1.Route('/users/{:id}', 3 /* HttpMethod.PATCH */),\n DELETE: new Route_1.Route('/users/{:id}', 4 /* HttpMethod.DELETE */),\n GET_PROFILE_IMAGE: new Route_1.Route('/users/{:userId}/profile_image', 0 /* HttpMethod.GET */),\n MESSAGE_DRIVER: new Route_1.Route('/announcement/user/{:userId}', 2 /* HttpMethod.PUT */)\n};\nvar UsersService = /** @class */ (function (_super) {\n __extends(UsersService, _super);\n function UsersService(session, store) {\n var _this = _super.call(this, session.config.getApiEndpoint(), session) || this;\n _this.store = store;\n return _this;\n }\n UsersService.prototype.create = function (user) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.CREATE_USER,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not create user'),\n payload: user\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.getDriversByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_DRIVERS_BY_TEAM,\n extractor: User_consts_1.defaultExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get drivers'),\n routeParams: { teamId: teamId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.get = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET,\n extractor: User_consts_1.defaultExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get user \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.getAll = function (page, limit) {\n if (page === void 0) { page = 1; }\n if (limit === void 0) { limit = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_ALL,\n extractor: function (response) { return ({ has_next_page: response.has_next_page, users: response.users }); },\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get users'),\n queryString: { page: page, limit: limit }\n })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersService.prototype.getAllKeysetPagination = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var limit, page_action, cursor, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n limit = request.limit, page_action = request.page_action, cursor = request.cursor;\n return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_ALL,\n extractor: function (response) { return ({\n next_page_cursor: response.next_page_cursor,\n previous_page_cursor: response.previous_page_cursor,\n users: response.users\n }); },\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get users'),\n queryString: { pgver: keyset_pagination_consts_1.KEYSET_PAGINATION_VER, limit: limit, page_action: page_action, cursor: cursor }\n })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersService.prototype.invite = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.INVITE,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not invite user with id: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.unlock = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.UNLOCK,\n extractor: User_consts_1.successExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not unlock user with id: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.assignedTasksCount = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.TOTAL_TASKS,\n extractor: User_consts_1.countExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get task count for user with id: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.totalEmployeesCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.TOTAL_EMPLOYEES,\n extractor: User_consts_1.countExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get total employee count\"; })\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.totalDriversCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.TOTAL_DRIVERS,\n extractor: User_consts_1.countExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get total drivers count\"; })\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.inviteByEmail = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.INVITE_VIA_EMAIL,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not invite user with id: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.validatePhone = function (phone) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.VALIDATE_PHONE,\n extractor: function (response) { return response.phone_valid; },\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Phone is not valid: \".concat(phone); }),\n queryString: { phone: phone }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.closedTasks = function (userId, page) {\n if (page === void 0) { page = 0; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.CLOSED_TASKS,\n extractor: User_consts_1.defaultExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get tasks for user: \".concat(userId); }),\n routeParams: { userId: userId },\n queryString: { page: page }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.update = function (id, userDelta) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.UPDATE,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not update user: \".concat(id); }),\n payload: __assign({ id: id }, userDelta),\n routeParams: { id: id }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.getAllAdminsAndDispatchers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var limit, page_action, cursor, scopes, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n limit = request.limit, page_action = request.page_action, cursor = request.cursor;\n scopes = [User_consts_1.UsersScopes.DISPATCHERS, User_consts_1.UsersScopes.ADMINS];\n return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_ALL,\n extractor: function (response) { return ({\n next_page_cursor: response.next_page_cursor,\n previous_page_cursor: response.previous_page_cursor,\n users: response.users\n }); },\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get admins and dispatchers'),\n queryString: { pgver: keyset_pagination_consts_1.KEYSET_PAGINATION_VER, scopes: scopes, limit: limit, page_action: page_action, cursor: cursor }\n })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersService.prototype.getAllDrivers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var limit, page_action, cursor, options, scopes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n limit = request.limit, page_action = request.page_action, cursor = request.cursor, options = request.options;\n scopes = [];\n if ((0, lodash_1.get)(options, 'onlyCustomers')) {\n scopes.push(User_consts_1.UsersScopes.CUSTOMERS);\n }\n else {\n scopes.push(User_consts_1.UsersScopes.DRIVERS);\n }\n if (options.onlyOnlineDriver) {\n scopes.push(User_consts_1.UsersScopes.MARKED_AS_ONLINE);\n }\n return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_ALL,\n extractor: function (response) { return ({\n next_page_cursor: response.next_page_cursor,\n previous_page_cursor: response.previous_page_cursor,\n users: response.users\n }); },\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get drivers'),\n queryString: { pgver: keyset_pagination_consts_1.KEYSET_PAGINATION_VER, scopes: scopes, limit: limit, page_action: page_action, cursor: cursor }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.delete = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.DELETE,\n extractor: User_consts_1.successExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not delete user: \".concat(id); }),\n routeParams: { id: id }\n })];\n case 1:\n result = _a.sent();\n return [2 /*return*/, result];\n }\n });\n });\n };\n UsersService.prototype.getProfileImage = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_PROFILE_IMAGE,\n extractor: function (response) { return response.profile_image; },\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get user's \".concat(userId, \" profile image\"); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.messageDriver = function (userId, message) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.MESSAGE_DRIVER,\n extractor: function (response) { return response.announcement_id; },\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not message to user \".concat(userId); }),\n payload: { user_id: userId, message: message },\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.byUserType = function (userTypeId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_USERS_WITH_USER_TYPE,\n extractor: User_consts_1.usersExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get users'),\n routeParams: { userTypeId: userTypeId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.makeAdmin = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.MAKE_ADMIN,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not set admin on userId: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.attachSubscriptions = function () {\n var _this = this;\n this.subscribeToEvent(PubSubEvents_1.DELETE_EMPLOYEE, function (user) {\n _this.store.removeFromStore(user.user_id);\n });\n this.subscribeToEvent(PubSubEvents_1.EMPLOYEE_UPDATE_EVENT, function (user) {\n _this.store.updateInStore(user);\n });\n this.subscribeToEvent(PubSubEvents_1.NEW_EMPLOYEE, function (user) {\n _this.store.addToStore(user);\n });\n };\n return UsersService;\n}(PubSubService_1.PubSubService));\nexports[\"default\"] = UsersService;\n//# sourceMappingURL=UsersService.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/Service/UsersService.js?");
2935
+ eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar RouteGenerator_1 = __webpack_require__(/*! ../../Core/RouteGenerator */ \"./dist/Core/RouteGenerator.js\");\nvar PubSubEvents_1 = __webpack_require__(/*! ../../Services/PubSubEvents */ \"./dist/Services/PubSubEvents.js\");\nvar PubSubService_1 = __webpack_require__(/*! ../../Services/PubSubService */ \"./dist/Services/PubSubService.js\");\nvar Route_1 = __webpack_require__(/*! ../../Services/Route */ \"./dist/Services/Route.js\");\nvar keyset_pagination_consts_1 = __webpack_require__(/*! ../../utils/consts/keyset-pagination.consts */ \"./dist/utils/consts/keyset-pagination.consts.js\");\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar ROUTES = {\n GET: new Route_1.Route('/users/{:userId}', 0 /* HttpMethod.GET */),\n GET_ALL: new Route_1.Route('/users/', 0 /* HttpMethod.GET */),\n GET_ALL_DRIVERS: new Route_1.Route('/users/drivers', 0 /* HttpMethod.GET */),\n GET_USERS_WITH_USER_TYPE: new Route_1.Route('/user_types/{:userTypeId}/users', 0 /* HttpMethod.GET */),\n GET_DRIVERS_BY_TEAM: new Route_1.Route('/teams/{:teamId}/users', 0 /* HttpMethod.GET */),\n MAKE_ADMIN: new Route_1.Route('/users/{:userId}/admin', 1 /* HttpMethod.POST */),\n CREATE_USER: new Route_1.Route('/users/', 1 /* HttpMethod.POST */),\n INVITE: new Route_1.Route('/users/{:userId}/reinvite', 1 /* HttpMethod.POST */),\n TOTAL_TASKS: new Route_1.Route('/users/{:userId}/tasks/count', 0 /* HttpMethod.GET */),\n TOTAL_EMPLOYEES: new Route_1.Route('/users/count', 0 /* HttpMethod.GET */),\n TOTAL_DRIVERS: new Route_1.Route('/users/drivers/count', 0 /* HttpMethod.GET */),\n UNLOCK: new Route_1.Route('/users/{:userId}/unlock', 1 /* HttpMethod.POST */),\n INVITE_VIA_EMAIL: new Route_1.Route('/users/{:userId}/reinvite_via_email', 1 /* HttpMethod.POST */),\n VALIDATE_PHONE: new Route_1.Route('/api/user/validate_phone', 0 /* HttpMethod.GET */),\n CLOSED_TASKS: new Route_1.Route('/users/{:userId}/tasks/closed_tasks', 0 /* HttpMethod.GET */),\n UPDATE: new Route_1.Route('/users/{:id}', 3 /* HttpMethod.PATCH */),\n DELETE: new Route_1.Route('/users/{:id}', 4 /* HttpMethod.DELETE */),\n GET_PROFILE_IMAGE: new Route_1.Route('/users/{:userId}/profile_image', 0 /* HttpMethod.GET */),\n MESSAGE_DRIVER: new Route_1.Route('/announcement/user/{:userId}', 2 /* HttpMethod.PUT */)\n};\nvar UsersService = /** @class */ (function (_super) {\n __extends(UsersService, _super);\n function UsersService(session, store) {\n var _this = _super.call(this, session.config.getApiEndpoint(), session) || this;\n _this.store = store;\n return _this;\n }\n UsersService.prototype.create = function (user) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.CREATE_USER,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not create user'),\n payload: user\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.getDriversByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_DRIVERS_BY_TEAM,\n extractor: User_consts_1.defaultExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get drivers'),\n routeParams: { teamId: teamId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.get = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET,\n extractor: User_consts_1.defaultExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get user \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.getMany = function (_a, commonOptions) {\n var usersId = _a.usersId, _b = _a.page, page = _b === void 0 ? 1 : _b, _c = _a.limit, limit = _c === void 0 ? 50 : _c;\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_d) {\n return [2 /*return*/, new RouteGenerator_1.Request(this, ROUTES.GET_ALL)\n .withQueryString({ ids: usersId, page: page, limit: limit })\n .withExtractor(function (response) { return ({ has_next_page: response.has_next_page, users: response.users }); })\n .setException('Could not get users by ids')\n .withCommonOptions(commonOptions)\n .invoke()];\n });\n });\n };\n UsersService.prototype.getAll = function (page, limit) {\n if (page === void 0) { page = 1; }\n if (limit === void 0) { limit = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_ALL,\n extractor: function (response) { return ({ has_next_page: response.has_next_page, users: response.users }); },\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get users'),\n queryString: { page: page, limit: limit }\n })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersService.prototype.getAllKeysetPagination = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var limit, page_action, cursor, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n limit = request.limit, page_action = request.page_action, cursor = request.cursor;\n return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_ALL,\n extractor: function (response) { return ({\n next_page_cursor: response.next_page_cursor,\n previous_page_cursor: response.previous_page_cursor,\n users: response.users\n }); },\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get users'),\n queryString: { pgver: keyset_pagination_consts_1.KEYSET_PAGINATION_VER, limit: limit, page_action: page_action, cursor: cursor }\n })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersService.prototype.invite = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.INVITE,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not invite user with id: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.unlock = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.UNLOCK,\n extractor: User_consts_1.successExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not unlock user with id: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.assignedTasksCount = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.TOTAL_TASKS,\n extractor: User_consts_1.countExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get task count for user with id: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.totalEmployeesCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.TOTAL_EMPLOYEES,\n extractor: User_consts_1.countExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get total employee count\"; })\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.totalDriversCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.TOTAL_DRIVERS,\n extractor: User_consts_1.countExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get total drivers count\"; })\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.inviteByEmail = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.INVITE_VIA_EMAIL,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not invite user with id: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.validatePhone = function (phone) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.VALIDATE_PHONE,\n extractor: function (response) { return response.phone_valid; },\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Phone is not valid: \".concat(phone); }),\n queryString: { phone: phone }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.closedTasks = function (userId, page) {\n if (page === void 0) { page = 0; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.CLOSED_TASKS,\n extractor: User_consts_1.defaultExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get tasks for user: \".concat(userId); }),\n routeParams: { userId: userId },\n queryString: { page: page }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.update = function (id, userDelta) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.UPDATE,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not update user: \".concat(id); }),\n payload: __assign({ id: id }, userDelta),\n routeParams: { id: id }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.getAllAdminsAndDispatchers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var limit, page_action, cursor, scopes, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n limit = request.limit, page_action = request.page_action, cursor = request.cursor;\n scopes = [User_consts_1.UsersScopes.DISPATCHERS, User_consts_1.UsersScopes.ADMINS];\n return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_ALL,\n extractor: function (response) { return ({\n next_page_cursor: response.next_page_cursor,\n previous_page_cursor: response.previous_page_cursor,\n users: response.users\n }); },\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get admins and dispatchers'),\n queryString: { pgver: keyset_pagination_consts_1.KEYSET_PAGINATION_VER, scopes: scopes, limit: limit, page_action: page_action, cursor: cursor }\n })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersService.prototype.getAllDrivers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var limit, page_action, cursor, options, scopes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n limit = request.limit, page_action = request.page_action, cursor = request.cursor, options = request.options;\n scopes = [];\n if ((0, lodash_1.get)(options, 'onlyCustomers')) {\n scopes.push(User_consts_1.UsersScopes.CUSTOMERS);\n }\n else {\n scopes.push(User_consts_1.UsersScopes.DRIVERS);\n }\n if (options.onlyOnlineDriver) {\n scopes.push(User_consts_1.UsersScopes.MARKED_AS_ONLINE);\n }\n return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_ALL,\n extractor: function (response) { return ({\n next_page_cursor: response.next_page_cursor,\n previous_page_cursor: response.previous_page_cursor,\n users: response.users\n }); },\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get drivers'),\n queryString: { pgver: keyset_pagination_consts_1.KEYSET_PAGINATION_VER, scopes: scopes, limit: limit, page_action: page_action, cursor: cursor }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.delete = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.DELETE,\n extractor: User_consts_1.successExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not delete user: \".concat(id); }),\n routeParams: { id: id }\n })];\n case 1:\n result = _a.sent();\n return [2 /*return*/, result];\n }\n });\n });\n };\n UsersService.prototype.getProfileImage = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_PROFILE_IMAGE,\n extractor: function (response) { return response.profile_image; },\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not get user's \".concat(userId, \" profile image\"); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.messageDriver = function (userId, message) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.MESSAGE_DRIVER,\n extractor: function (response) { return response.announcement_id; },\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not message to user \".concat(userId); }),\n payload: { user_id: userId, message: message },\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.byUserType = function (userTypeId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.GET_USERS_WITH_USER_TYPE,\n extractor: User_consts_1.usersExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException('Could not get users'),\n routeParams: { userTypeId: userTypeId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.makeAdmin = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest({\n route: ROUTES.MAKE_ADMIN,\n extractor: User_consts_1.userExtractor,\n exceptionProducer: BringgException_1.BringgException.serviceException(function () { return \"Could not set admin on userId: \".concat(userId); }),\n routeParams: { userId: userId }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.fetchAllPages = function (fn, options) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var result, hasMore, cursor, _b, values, hasMoreInPage, nextCursor;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n result = [];\n hasMore = true;\n cursor = undefined;\n _c.label = 1;\n case 1:\n if (!hasMore) return [3 /*break*/, 3];\n if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {\n throw new Error('Aborted');\n }\n return [4 /*yield*/, fn(cursor)];\n case 2:\n _b = _c.sent(), values = _b.values, hasMoreInPage = _b.hasMore, nextCursor = _b.nextCursor;\n result = result.concat(values);\n hasMore = hasMoreInPage;\n cursor = nextCursor;\n return [3 /*break*/, 1];\n case 3: return [2 /*return*/, result];\n }\n });\n });\n };\n UsersService.prototype.attachSubscriptions = function () {\n var _this = this;\n this.subscribeToEvent(PubSubEvents_1.DELETE_EMPLOYEE, function (user) {\n _this.store.removeFromStore(user.user_id);\n });\n this.subscribeToEvent(PubSubEvents_1.EMPLOYEE_UPDATE_EVENT, function (user) {\n _this.store.updateInStore(user);\n });\n this.subscribeToEvent(PubSubEvents_1.NEW_EMPLOYEE, function (user) {\n _this.store.addToStore(user);\n });\n };\n return UsersService;\n}(PubSubService_1.PubSubService));\nexports[\"default\"] = UsersService;\n//# sourceMappingURL=UsersService.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/Service/UsersService.js?");
2936
2936
 
2937
2937
  /***/ }),
2938
2938
 
@@ -2943,7 +2943,7 @@ eval("\nvar __extends = (this && this.__extends) || (function () {\n var exte
2943
2943
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2944
2944
 
2945
2945
  "use strict";
2946
- eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar types_1 = __webpack_require__(/*! @bringg/types */ \"./node_modules/@bringg/types/index.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar rxjs_1 = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/_esm5/index.js\");\nvar operators_1 = __webpack_require__(/*! rxjs/operators */ \"./node_modules/rxjs/_esm5/operators/index.js\");\nvar BaseStore_1 = __webpack_require__(/*! ../../Core/BaseStore */ \"./dist/Core/BaseStore.js\");\nvar UsersService_1 = __webpack_require__(/*! ../Service/UsersService */ \"./dist/User/Service/UsersService.js\");\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar UserHelpers_1 = __webpack_require__(/*! ../UserHelpers */ \"./dist/User/UserHelpers.js\");\nvar THROTTLE_TIME = 500;\nvar UsersStore = /** @class */ (function (_super) {\n __extends(UsersStore, _super);\n function UsersStore(session, throttleTimeValue) {\n var e_1, _a;\n var _this = _super.call(this) || this;\n _this.groupUpdateEvents = [];\n _this.groupedValues = new Map();\n _this.drivers = [];\n _this.fetchedStatus = {\n drivers: false,\n customers: false,\n adminsAndDispatchers: false\n };\n _this.usersService = new UsersService_1.default(session, _this);\n _this.onlineDriversCounterByTeam = new Map();\n try {\n for (var _b = __values(Object.keys(User_consts_1.GROUP_VALUES)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var groupId = _c.value;\n _this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], new Set());\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n throttleTimeValue = throttleTimeValue || THROTTLE_TIME;\n _this.onItemRemoved(function (userId, user) {\n var e_2, _a;\n var isDriverOnline = (user === null || user === void 0 ? void 0 : user.status) === types_1.Connection.Online;\n if (isDriverOnline && user.team_ids) {\n try {\n for (var _b = __values(user.team_ids), _c = _b.next(); !_c.done; _c = _b.next()) {\n var teamId = _c.value;\n _this.onlineDriversCounterByTeam.set(teamId, Math.max(_this.onlineDriversCounterByTeam.get(teamId) - 1, 0));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n });\n //group by and save ids | can add config to throttle through users( maybe increase if admin )\n _this.state$\n .pipe((0, operators_1.throttleTime)(throttleTimeValue, rxjs_1.asyncScheduler, { trailing: true, leading: false }))\n .subscribe(function (users) {\n _this.initGroups(users.values());\n _this.emitGroupEvents();\n });\n return _this;\n }\n UsersStore.prototype.getRelevantDrivers = function (groupsToInit) {\n if (groupsToInit.length === Object.keys(User_consts_1.GROUP_VALUES).length) {\n return [];\n }\n else {\n return this.drivers.filter(function (driver) {\n return !((UserHelpers_1.UserHelpers.isOnlineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnlineDrivers)) ||\n (UserHelpers_1.UserHelpers.isOfflineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OfflineDrivers)) ||\n (UserHelpers_1.UserHelpers.isOnShiftDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnShiftDrivers)) ||\n (UserHelpers_1.UserHelpers.isAdmin(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Admins)) ||\n (UserHelpers_1.UserHelpers.isDispatcher(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Dispatchers)) ||\n (UserHelpers_1.UserHelpers.isCustomer(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Customers)));\n });\n }\n };\n UsersStore.prototype.initGroups = function (users, groupsToInit) {\n var e_3, _a, _b, e_4, _c, e_5, _d, e_6, _e, e_7, _f;\n if (groupsToInit === void 0) { groupsToInit = Object.keys(User_consts_1.GROUP_VALUES); }\n var groups = {};\n try {\n for (var groupsToInit_1 = __values(groupsToInit), groupsToInit_1_1 = groupsToInit_1.next(); !groupsToInit_1_1.done; groupsToInit_1_1 = groupsToInit_1.next()) {\n var groupId = groupsToInit_1_1.value;\n groups[groupId] = new Set();\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (groupsToInit_1_1 && !groupsToInit_1_1.done && (_a = groupsToInit_1.return)) _a.call(groupsToInit_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n var relevantDrivers = this.getRelevantDrivers(groupsToInit);\n this.drivers.length = 0; // do not change drivers ref - manu pointer rely on it on their state on bringg-web\n (_b = this.drivers).push.apply(_b, __spreadArray([], __read(relevantDrivers), false));\n this.onlineDriversCounterByTeam = new Map();\n try {\n for (var users_1 = __values(users), users_1_1 = users_1.next(); !users_1_1.done; users_1_1 = users_1.next()) {\n var user = users_1_1.value;\n if (user.driver) {\n this.drivers.push(user);\n var isDriverOnline = user.status === types_1.Connection.Online;\n if (isDriverOnline && user.team_ids) {\n try {\n for (var _g = (e_5 = void 0, __values(user.team_ids)), _h = _g.next(); !_h.done; _h = _g.next()) {\n var teamId = _h.value;\n this.onlineDriversCounterByTeam.set(teamId, this.onlineDriversCounterByTeam.has(teamId)\n ? this.onlineDriversCounterByTeam.get(teamId) + 1\n : 1);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_d = _g.return)) _d.call(_g);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n var groupIds = (0, User_consts_1.userToGroupsMapper)(user);\n try {\n for (var groupIds_1 = (e_6 = void 0, __values(groupIds)), groupIds_1_1 = groupIds_1.next(); !groupIds_1_1.done; groupIds_1_1 = groupIds_1.next()) {\n var groupId = groupIds_1_1.value;\n if (groups[groupId]) {\n groups[groupId].add(user);\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (groupIds_1_1 && !groupIds_1_1.done && (_e = groupIds_1.return)) _e.call(groupIds_1);\n }\n finally { if (e_6) throw e_6.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (users_1_1 && !users_1_1.done && (_c = users_1.return)) _c.call(users_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n try {\n for (var groupsToInit_2 = __values(groupsToInit), groupsToInit_2_1 = groupsToInit_2.next(); !groupsToInit_2_1.done; groupsToInit_2_1 = groupsToInit_2.next()) {\n var groupId = groupsToInit_2_1.value;\n this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], groups[groupId] || new Set());\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (groupsToInit_2_1 && !groupsToInit_2_1.done && (_f = groupsToInit_2.return)) _f.call(groupsToInit_2);\n }\n finally { if (e_7) throw e_7.error; }\n }\n };\n UsersStore.prototype.create = function (user) {\n return __awaiter(this, void 0, void 0, function () {\n var newUser;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.create(user)];\n case 1:\n newUser = _a.sent();\n this.addToStore(newUser);\n return [2 /*return*/, newUser];\n }\n });\n });\n };\n UsersStore.prototype.getDriversByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getDriversByTeam(teamId)];\n case 1:\n users = _a.sent();\n users.forEach(function (user) { return _this.addToStore(user); });\n return [2 /*return*/, users];\n }\n });\n });\n };\n UsersStore.prototype.getAll = function (page, limit) {\n if (page === void 0) { page = 1; }\n if (limit === void 0) { limit = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getAll(page, limit)];\n case 1:\n response = _a.sent();\n (0, lodash_1.forEach)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.getAllKeysetPagination = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getAllKeysetPagination(request)];\n case 1:\n response = _a.sent();\n (0, lodash_1.forEach)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });\n this.initGroups(this.getItems());\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.invite = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.invite(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.inviteByEmail = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.inviteByEmail(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.getAllAdminsAndDispatchers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n return [2 /*return*/, this.getOrFetchUsers(request, this.fetchedStatus.adminsAndDispatchers, function (isAllAdminsAndDispatchersFetched) {\n return (_this.fetchedStatus.adminsAndDispatchers = isAllAdminsAndDispatchersFetched);\n }, function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = _this.usersService).getAllAdminsAndDispatchers.apply(_a, __spreadArray([], __read(args), false));\n }, function () { return _this.getAllLocalAdminsAndDispatchers(); })];\n });\n });\n };\n UsersStore.prototype.getAllDrivers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var options, response, isOnlyCustomer, isOnlyOnlineDrivers, groups;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = request.options;\n isOnlyCustomer = options === null || options === void 0 ? void 0 : options.onlyCustomers;\n isOnlyOnlineDrivers = options === null || options === void 0 ? void 0 : options.onlyOnlineDriver;\n if (!isOnlyCustomer) return [3 /*break*/, 2];\n return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.customers, function (isAllCustomersFetched) { return (_this.fetchedStatus.customers = isAllCustomersFetched); }, this.usersService.getAllDrivers, function () { return _this.getCustomers(); })];\n case 1:\n response = _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.drivers, function (isAllDriversFetched) { return (_this.fetchedStatus.drivers = isAllDriversFetched); }, function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = _this.usersService).getAllDrivers.apply(_a, __spreadArray([], __read(args), false));\n }, function () { return (isOnlyOnlineDrivers ? __spreadArray([], __read(_this.getOnlineDrivers()), false) : __spreadArray([], __read(_this.getAllLocalDrivers()), false)); })];\n case 3:\n response = _a.sent();\n _a.label = 4;\n case 4:\n groups = isOnlyCustomer\n ? [User_consts_1.GROUP_VALUES.Customers]\n : isOnlyOnlineDrivers\n ? [User_consts_1.GROUP_VALUES.OnlineDrivers]\n : [User_consts_1.GROUP_VALUES.OfflineDrivers, User_consts_1.GROUP_VALUES.OnlineDrivers, User_consts_1.GROUP_VALUES.OnShiftDrivers];\n this.initGroups(response.users, groups);\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.getOrFetchUsers = function (request, isFetchedFlag, setIsFetchedFlag, fetchUsers, getLocalUsers) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!isFetchedFlag) return [3 /*break*/, 2];\n return [4 /*yield*/, fetchUsers(request)];\n case 1:\n response = _a.sent();\n response.users.forEach(function (driver) { return _this.addToStore(driver); });\n if (!response.next_page_cursor && !response.previous_page_cursor) {\n setIsFetchedFlag(true);\n }\n return [2 /*return*/, response];\n case 2: return [2 /*return*/, {\n next_page_cursor: null,\n previous_page_cursor: null,\n users: getLocalUsers()\n }];\n }\n });\n });\n };\n UsersStore.prototype.byUserType = function (userTypeId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.byUserType(userTypeId)];\n case 1:\n users = _a.sent();\n users.forEach(function (user) { return _this.addToStore(user); });\n return [2 /*return*/, users];\n }\n });\n });\n };\n UsersStore.prototype.makeAdmin = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.makeAdmin(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.update = function (userId, userDelta) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.update(userId, userDelta)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.delete = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var success;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.delete(userId)];\n case 1:\n success = _a.sent();\n if (success) {\n this.removeFromStore(userId);\n }\n return [2 /*return*/, success];\n }\n });\n });\n };\n UsersStore.prototype.get = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.getItem(id);\n if (_a) return [3 /*break*/, 2];\n return [4 /*yield*/, this.usersService.get(id)];\n case 1:\n _a = (_b.sent());\n _b.label = 2;\n case 2: return [2 /*return*/, _a];\n }\n });\n });\n };\n UsersStore.prototype.unlock = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.unlock(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.assignedTasksCount = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.assignedTasksCount(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.totalEmployeesCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.totalEmployeesCount()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.totalDriversCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.totalDriversCount()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.getProfileImage = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getProfileImage(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.validatePhone = function (phone) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.validatePhone(phone)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.closedTasks = function (userId, page) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.closedTasks(userId, page)];\n case 1: return [2 /*return*/, _a.sent()]; // in future - add this tasks to store :)\n }\n });\n });\n };\n UsersStore.prototype.messageDriver = function (userId, message) {\n return this.usersService.messageDriver(userId, message);\n };\n UsersStore.prototype.subscribeToGroupUpdates = function (fn) {\n this.groupUpdateEvents.push(fn);\n };\n UsersStore.prototype.getOfflineDrivers = function () {\n return this.groupedValues.get(User_consts_1.GROUP_VALUES.OfflineDrivers) || new Set();\n };\n UsersStore.prototype.getOnlineDrivers = function () {\n return this.groupedValues.get(User_consts_1.GROUP_VALUES.OnlineDrivers) || new Set();\n };\n UsersStore.prototype.getOnShiftDrivers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.OnShiftDrivers) || []);\n };\n UsersStore.prototype.getCustomers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Customers) || []);\n };\n UsersStore.prototype.getAdmins = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Admins) || []);\n };\n UsersStore.prototype.getDispatchers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Dispatchers) || []);\n };\n UsersStore.prototype.emitGroupEvents = function () {\n var _this = this;\n this.groupUpdateEvents.forEach(function (fn) { return fn(_this.groupedValues); });\n };\n UsersStore.prototype.getAllLocalDrivers = function () {\n return this.drivers;\n };\n UsersStore.prototype.getOnlineDriversCountByTeam = function (teamId) {\n return this.onlineDriversCounterByTeam.get(teamId) || 0;\n };\n UsersStore.prototype.getAllLocalAdminsAndDispatchers = function () {\n return __spreadArray([], __read(new Set(this.getAdmins().concat(this.getDispatchers()))), false);\n };\n return UsersStore;\n}(BaseStore_1.default));\nexports[\"default\"] = UsersStore;\n//# sourceMappingURL=UsersStore.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/Store/UsersStore.js?");
2946
+ eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar types_1 = __webpack_require__(/*! @bringg/types */ \"./node_modules/@bringg/types/index.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar rxjs_1 = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/_esm5/index.js\");\nvar operators_1 = __webpack_require__(/*! rxjs/operators */ \"./node_modules/rxjs/_esm5/operators/index.js\");\nvar BaseStore_1 = __webpack_require__(/*! ../../Core/BaseStore */ \"./dist/Core/BaseStore.js\");\nvar UsersService_1 = __webpack_require__(/*! ../Service/UsersService */ \"./dist/User/Service/UsersService.js\");\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar UserHelpers_1 = __webpack_require__(/*! ../UserHelpers */ \"./dist/User/UserHelpers.js\");\nvar THROTTLE_TIME = 500;\nvar UsersStore = /** @class */ (function (_super) {\n __extends(UsersStore, _super);\n function UsersStore(session, throttleTimeValue) {\n var e_1, _a;\n var _this = _super.call(this) || this;\n _this.groupUpdateEvents = [];\n _this.groupedValues = new Map();\n _this.drivers = [];\n _this.fetchedStatus = {\n drivers: false,\n customers: false,\n adminsAndDispatchers: false\n };\n _this.usersService = new UsersService_1.default(session, _this);\n _this.onlineDriversCounterByTeam = new Map();\n try {\n for (var _b = __values(Object.keys(User_consts_1.GROUP_VALUES)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var groupId = _c.value;\n _this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], new Set());\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n throttleTimeValue = throttleTimeValue || THROTTLE_TIME;\n _this.onItemRemoved(function (userId, user) {\n var e_2, _a;\n var isDriverOnline = (user === null || user === void 0 ? void 0 : user.status) === types_1.Connection.Online;\n if (isDriverOnline && user.team_ids) {\n try {\n for (var _b = __values(user.team_ids), _c = _b.next(); !_c.done; _c = _b.next()) {\n var teamId = _c.value;\n _this.onlineDriversCounterByTeam.set(teamId, Math.max(_this.onlineDriversCounterByTeam.get(teamId) - 1, 0));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n });\n //group by and save ids | can add config to throttle through users( maybe increase if admin )\n _this.state$\n .pipe((0, operators_1.throttleTime)(throttleTimeValue, rxjs_1.asyncScheduler, { trailing: true, leading: false }))\n .subscribe(function (users) {\n _this.initGroups(users.values());\n _this.emitGroupEvents();\n });\n return _this;\n }\n UsersStore.prototype.getRelevantDrivers = function (groupsToInit) {\n if (groupsToInit.length === Object.keys(User_consts_1.GROUP_VALUES).length) {\n return [];\n }\n else {\n return this.drivers.filter(function (driver) {\n return !((UserHelpers_1.UserHelpers.isOnlineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnlineDrivers)) ||\n (UserHelpers_1.UserHelpers.isOfflineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OfflineDrivers)) ||\n (UserHelpers_1.UserHelpers.isOnShiftDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnShiftDrivers)) ||\n (UserHelpers_1.UserHelpers.isAdmin(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Admins)) ||\n (UserHelpers_1.UserHelpers.isDispatcher(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Dispatchers)) ||\n (UserHelpers_1.UserHelpers.isCustomer(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Customers)));\n });\n }\n };\n UsersStore.prototype.initGroups = function (users, groupsToInit) {\n var e_3, _a, _b, e_4, _c, e_5, _d, e_6, _e, e_7, _f;\n if (groupsToInit === void 0) { groupsToInit = Object.keys(User_consts_1.GROUP_VALUES); }\n var groups = {};\n try {\n for (var groupsToInit_1 = __values(groupsToInit), groupsToInit_1_1 = groupsToInit_1.next(); !groupsToInit_1_1.done; groupsToInit_1_1 = groupsToInit_1.next()) {\n var groupId = groupsToInit_1_1.value;\n groups[groupId] = new Set();\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (groupsToInit_1_1 && !groupsToInit_1_1.done && (_a = groupsToInit_1.return)) _a.call(groupsToInit_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n var relevantDrivers = this.getRelevantDrivers(groupsToInit);\n this.drivers.length = 0; // do not change drivers ref - manu pointer rely on it on their state on bringg-web\n (_b = this.drivers).push.apply(_b, __spreadArray([], __read(relevantDrivers), false));\n this.onlineDriversCounterByTeam = new Map();\n try {\n for (var users_1 = __values(users), users_1_1 = users_1.next(); !users_1_1.done; users_1_1 = users_1.next()) {\n var user = users_1_1.value;\n if (user.driver) {\n this.drivers.push(user);\n var isDriverOnline = user.status === types_1.Connection.Online;\n if (isDriverOnline && user.team_ids) {\n try {\n for (var _g = (e_5 = void 0, __values(user.team_ids)), _h = _g.next(); !_h.done; _h = _g.next()) {\n var teamId = _h.value;\n this.onlineDriversCounterByTeam.set(teamId, this.onlineDriversCounterByTeam.has(teamId)\n ? this.onlineDriversCounterByTeam.get(teamId) + 1\n : 1);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_d = _g.return)) _d.call(_g);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n var groupIds = (0, User_consts_1.userToGroupsMapper)(user);\n try {\n for (var groupIds_1 = (e_6 = void 0, __values(groupIds)), groupIds_1_1 = groupIds_1.next(); !groupIds_1_1.done; groupIds_1_1 = groupIds_1.next()) {\n var groupId = groupIds_1_1.value;\n if (groups[groupId]) {\n groups[groupId].add(user);\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (groupIds_1_1 && !groupIds_1_1.done && (_e = groupIds_1.return)) _e.call(groupIds_1);\n }\n finally { if (e_6) throw e_6.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (users_1_1 && !users_1_1.done && (_c = users_1.return)) _c.call(users_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n try {\n for (var groupsToInit_2 = __values(groupsToInit), groupsToInit_2_1 = groupsToInit_2.next(); !groupsToInit_2_1.done; groupsToInit_2_1 = groupsToInit_2.next()) {\n var groupId = groupsToInit_2_1.value;\n this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], groups[groupId] || new Set());\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (groupsToInit_2_1 && !groupsToInit_2_1.done && (_f = groupsToInit_2.return)) _f.call(groupsToInit_2);\n }\n finally { if (e_7) throw e_7.error; }\n }\n };\n UsersStore.prototype.create = function (user) {\n return __awaiter(this, void 0, void 0, function () {\n var newUser;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.create(user)];\n case 1:\n newUser = _a.sent();\n this.addToStore(newUser);\n return [2 /*return*/, newUser];\n }\n });\n });\n };\n UsersStore.prototype.getDriversByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getDriversByTeam(teamId)];\n case 1:\n users = _a.sent();\n users.forEach(function (user) { return _this.addToStore(user); });\n return [2 /*return*/, users];\n }\n });\n });\n };\n UsersStore.prototype.getAll = function (page, limit) {\n if (page === void 0) { page = 1; }\n if (limit === void 0) { limit = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getAll(page, limit)];\n case 1:\n response = _a.sent();\n (0, lodash_1.forEach)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.getAllKeysetPagination = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getAllKeysetPagination(request)];\n case 1:\n response = _a.sent();\n (0, lodash_1.forEach)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });\n this.initGroups(this.getItems());\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.invite = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.invite(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.inviteByEmail = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.inviteByEmail(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.getAllAdminsAndDispatchers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n return [2 /*return*/, this.getOrFetchUsers(request, this.fetchedStatus.adminsAndDispatchers, function (isAllAdminsAndDispatchersFetched) {\n return (_this.fetchedStatus.adminsAndDispatchers = isAllAdminsAndDispatchersFetched);\n }, function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = _this.usersService).getAllAdminsAndDispatchers.apply(_a, __spreadArray([], __read(args), false));\n }, function () { return _this.getAllLocalAdminsAndDispatchers(); })];\n });\n });\n };\n UsersStore.prototype.getAllDrivers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var options, response, isOnlyCustomer, isOnlyOnlineDrivers, groups;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = request.options;\n isOnlyCustomer = options === null || options === void 0 ? void 0 : options.onlyCustomers;\n isOnlyOnlineDrivers = options === null || options === void 0 ? void 0 : options.onlyOnlineDriver;\n if (!isOnlyCustomer) return [3 /*break*/, 2];\n return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.customers, function (isAllCustomersFetched) { return (_this.fetchedStatus.customers = isAllCustomersFetched); }, this.usersService.getAllDrivers, function () { return _this.getCustomers(); })];\n case 1:\n response = _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.drivers, function (isAllDriversFetched) { return (_this.fetchedStatus.drivers = isAllDriversFetched); }, function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = _this.usersService).getAllDrivers.apply(_a, __spreadArray([], __read(args), false));\n }, function () { return (isOnlyOnlineDrivers ? __spreadArray([], __read(_this.getOnlineDrivers()), false) : __spreadArray([], __read(_this.getAllLocalDrivers()), false)); })];\n case 3:\n response = _a.sent();\n _a.label = 4;\n case 4:\n groups = isOnlyCustomer\n ? [User_consts_1.GROUP_VALUES.Customers]\n : isOnlyOnlineDrivers\n ? [User_consts_1.GROUP_VALUES.OnlineDrivers]\n : [User_consts_1.GROUP_VALUES.OfflineDrivers, User_consts_1.GROUP_VALUES.OnlineDrivers, User_consts_1.GROUP_VALUES.OnShiftDrivers];\n this.initGroups(response.users, groups);\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.getOrFetchUsers = function (request, isFetchedFlag, setIsFetchedFlag, fetchUsers, getLocalUsers) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!isFetchedFlag) return [3 /*break*/, 2];\n return [4 /*yield*/, fetchUsers(request)];\n case 1:\n response = _a.sent();\n response.users.forEach(function (driver) { return _this.addToStore(driver); });\n if (!response.next_page_cursor && !response.previous_page_cursor) {\n setIsFetchedFlag(true);\n }\n return [2 /*return*/, response];\n case 2: return [2 /*return*/, {\n next_page_cursor: null,\n previous_page_cursor: null,\n users: getLocalUsers()\n }];\n }\n });\n });\n };\n UsersStore.prototype.byUserType = function (userTypeId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.byUserType(userTypeId)];\n case 1:\n users = _a.sent();\n users.forEach(function (user) { return _this.addToStore(user); });\n return [2 /*return*/, users];\n }\n });\n });\n };\n UsersStore.prototype.makeAdmin = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.makeAdmin(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.update = function (userId, userDelta) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.update(userId, userDelta)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.delete = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var success;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.delete(userId)];\n case 1:\n success = _a.sent();\n if (success) {\n this.removeFromStore(userId);\n }\n return [2 /*return*/, success];\n }\n });\n });\n };\n UsersStore.prototype.get = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.getItem(id);\n if (_a) return [3 /*break*/, 2];\n return [4 /*yield*/, this.usersService.get(id)];\n case 1:\n _a = (_b.sent());\n _b.label = 2;\n case 2: return [2 /*return*/, _a];\n }\n });\n });\n };\n UsersStore.prototype.getMany = function (ids, commonOptions) {\n return __awaiter(this, void 0, void 0, function () {\n var foundedItems, idsSet, missingIds, missingUsers;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n foundedItems = this.getItemsByIds(ids);\n if (foundedItems.length === ids.length) {\n return [2 /*return*/, foundedItems];\n }\n idsSet = new Set(ids);\n foundedItems.forEach(function (user) { return idsSet.delete(user.id); });\n missingIds = Array.from(idsSet);\n return [4 /*yield*/, this.usersService.fetchAllPages(function (page) {\n if (page === void 0) { page = 1; }\n return __awaiter(_this, void 0, void 0, function () {\n var response, fetchedUsers;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getMany({\n usersId: missingIds,\n page: page,\n limit: 50\n }, commonOptions)];\n case 1:\n response = _a.sent();\n fetchedUsers = response.users;\n // Adding here and not after getting all, so we won't stop the event loop for too long, if we have a lot\n this.addItems(fetchedUsers);\n return [2 /*return*/, {\n values: fetchedUsers,\n hasMore: response.has_next_page,\n nextCursor: page + 1\n }];\n }\n });\n });\n }, { signal: commonOptions === null || commonOptions === void 0 ? void 0 : commonOptions.signal })];\n case 1:\n missingUsers = _a.sent();\n return [2 /*return*/, foundedItems.concat(missingUsers)];\n }\n });\n });\n };\n UsersStore.prototype.unlock = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.unlock(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.assignedTasksCount = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.assignedTasksCount(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.totalEmployeesCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.totalEmployeesCount()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.totalDriversCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.totalDriversCount()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.getProfileImage = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getProfileImage(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.validatePhone = function (phone) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.validatePhone(phone)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.closedTasks = function (userId, page) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.closedTasks(userId, page)];\n case 1: return [2 /*return*/, _a.sent()]; // in future - add this tasks to store :)\n }\n });\n });\n };\n UsersStore.prototype.messageDriver = function (userId, message) {\n return this.usersService.messageDriver(userId, message);\n };\n UsersStore.prototype.subscribeToGroupUpdates = function (fn) {\n this.groupUpdateEvents.push(fn);\n };\n UsersStore.prototype.getOfflineDrivers = function () {\n return this.groupedValues.get(User_consts_1.GROUP_VALUES.OfflineDrivers) || new Set();\n };\n UsersStore.prototype.getOnlineDrivers = function () {\n return this.groupedValues.get(User_consts_1.GROUP_VALUES.OnlineDrivers) || new Set();\n };\n UsersStore.prototype.getOnShiftDrivers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.OnShiftDrivers) || []);\n };\n UsersStore.prototype.getCustomers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Customers) || []);\n };\n UsersStore.prototype.getAdmins = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Admins) || []);\n };\n UsersStore.prototype.getDispatchers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Dispatchers) || []);\n };\n UsersStore.prototype.emitGroupEvents = function () {\n var _this = this;\n this.groupUpdateEvents.forEach(function (fn) { return fn(_this.groupedValues); });\n };\n UsersStore.prototype.getAllLocalDrivers = function () {\n return this.drivers;\n };\n UsersStore.prototype.getOnlineDriversCountByTeam = function (teamId) {\n return this.onlineDriversCounterByTeam.get(teamId) || 0;\n };\n UsersStore.prototype.getAllLocalAdminsAndDispatchers = function () {\n return __spreadArray([], __read(new Set(this.getAdmins().concat(this.getDispatchers()))), false);\n };\n return UsersStore;\n}(BaseStore_1.default));\nexports[\"default\"] = UsersStore;\n//# sourceMappingURL=UsersStore.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/Store/UsersStore.js?");
2947
2947
 
2948
2948
  /***/ }),
2949
2949
 
@@ -2976,7 +2976,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
2976
2976
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2977
2977
 
2978
2978
  "use strict";
2979
- eval("\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar ExceptionReason_1 = __webpack_require__(/*! ../Core/ExceptionReason */ \"./dist/Core/ExceptionReason.js\");\nvar keyset_pagination_consts_1 = __webpack_require__(/*! ../utils/consts/keyset-pagination.consts */ \"./dist/utils/consts/keyset-pagination.consts.js\");\nvar UsersStore_1 = __webpack_require__(/*! ./Store/UsersStore */ \"./dist/User/Store/UsersStore.js\");\nvar User_consts_1 = __webpack_require__(/*! ./User.consts */ \"./dist/User/User.consts.js\");\nvar Users = /** @class */ (function () {\n function Users(session) {\n this.usersStore = new UsersStore_1.default(session);\n //keep previous names for backward compatibility\n this.onListUpdate = this.usersStore.onListUpdate;\n this.onUpdate = this.usersStore.onItemUpdate;\n this.onDelete = this.usersStore.onItemRemoved;\n this.onCreate = this.usersStore.onItemCreated;\n this.unsubscribe = this.usersStore.unsubscribe;\n }\n Users.prototype.create = function (user) {\n if ((0, lodash_1.isNil)(user.email) && (0, lodash_1.isNil)(user.phone)) {\n throw new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.INVALID_ARGUMENTS, 'Phone or Email is required');\n }\n return this.usersStore.create(user);\n };\n Users.prototype.getAllAdminsAndDispatchers = function (_a) {\n var _b = _a.limit, limit = _b === void 0 ? 25 : _b, _c = _a.page_action, page_action = _c === void 0 ? keyset_pagination_consts_1.KeysetPaginationPageAction.NEXT : _c, cursor = _a.cursor;\n return this.usersStore.getAllAdminsAndDispatchers({ limit: limit, page_action: page_action, cursor: cursor });\n };\n Users.prototype.getAllDrivers = function (_a) {\n var _b = _a.limit, limit = _b === void 0 ? 25 : _b, _c = _a.page_action, page_action = _c === void 0 ? keyset_pagination_consts_1.KeysetPaginationPageAction.NEXT : _c, cursor = _a.cursor, options = _a.options;\n var optionsWithDefaults = (0, lodash_1.defaults)(options, { onlyOnlineDriver: false, onlyCustomers: false });\n return this.usersStore.getAllDrivers({ limit: limit, page_action: page_action, cursor: cursor, options: optionsWithDefaults });\n };\n Users.prototype.byUserType = function (userTypeId) {\n return this.usersStore.byUserType(userTypeId);\n };\n Users.prototype.makeAdmin = function (userId) {\n return this.usersStore.makeAdmin(userId);\n };\n Users.prototype.totalEmployeesCount = function () {\n return this.usersStore.totalEmployeesCount();\n };\n Users.prototype.totalDriversCount = function () {\n return this.usersStore.totalDriversCount();\n };\n Users.prototype.getAdmin = function (adminId) {\n return this.usersStore.get(adminId);\n };\n Users.prototype.getDriver = function (driverId) {\n return this.usersStore.get(driverId);\n };\n Users.prototype.getDispatcher = function (dispatcherId) {\n return this.usersStore.get(dispatcherId);\n };\n Users.prototype.getDriversByTeam = function (teamId) {\n return this.usersStore.getDriversByTeam(teamId);\n };\n Users.prototype.getAll = function (page, limit) {\n if (page === void 0) { page = 1; }\n if (limit === void 0) { limit = 50; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersStore.getAll(page, limit)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Users.prototype.getAllKeysetPagination = function (_a) {\n var _b = _a.limit, limit = _b === void 0 ? 2500 : _b, _c = _a.page_action, page_action = _c === void 0 ? keyset_pagination_consts_1.KeysetPaginationPageAction.NEXT : _c, cursor = _a.cursor;\n return this.usersStore.getAllKeysetPagination({ limit: limit, page_action: page_action, cursor: cursor });\n };\n Users.prototype.get = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersStore.get(userId)];\n case 1:\n user = _a.sent();\n this.usersStore.addToStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n Users.prototype.getLocal = function (userId) {\n return this.usersStore.getItem(userId);\n };\n Users.prototype.invite = function (userId) {\n return this.usersStore.invite(userId);\n };\n Users.prototype.unlock = function (userId) {\n return this.usersStore.unlock(userId);\n };\n Users.prototype.assignedTasksCount = function (userId) {\n return this.usersStore.assignedTasksCount(userId);\n };\n Users.prototype.inviteByEmail = function (userId) {\n return this.usersStore.inviteByEmail(userId);\n };\n Users.prototype.validatePhone = function (phone) {\n return this.usersStore.validatePhone(phone);\n };\n Users.prototype.closedTasks = function (userId, page) {\n return this.usersStore.closedTasks(userId, page);\n };\n Users.prototype.update = function (userId, userDelta) {\n var _this = this;\n return this.usersStore.update(userId, userDelta).then(function (user) { return _this.updateCurrentUserIfNeeded(user); });\n };\n Users.prototype.updateCurrentUserIfNeeded = function (user) {\n var currentUser = this.usersStore.usersService.session.user;\n if (currentUser.id === user.id) {\n this.usersStore.usersService.session.user = (0, lodash_1.merge)(currentUser, user);\n this.usersStore.usersService.session.sendDataEvent(User_consts_1.UserEvents.CURRENT_USER_UPDATED, this.usersStore.usersService.session.user);\n }\n return user;\n };\n Users.prototype.delete = function (userId) {\n return this.usersStore.delete(userId);\n };\n Users.prototype.getProfileImage = function (userId) {\n return this.usersStore.getProfileImage(userId);\n };\n Users.prototype.subscribeToGroupUpdates = function (fn) {\n this.usersStore.subscribeToGroupUpdates(fn);\n };\n Users.prototype.getOfflineDrivers = function () {\n return this.usersStore.getOfflineDrivers();\n };\n Users.prototype.getOnlineDrivers = function () {\n return this.usersStore.getOnlineDrivers();\n };\n Users.prototype.getAllLocalDrivers = function () {\n return this.usersStore.getAllLocalDrivers();\n };\n Users.prototype.getOnShiftDrivers = function () {\n return this.usersStore.getOnShiftDrivers();\n };\n Users.prototype.getAdmins = function () {\n return this.usersStore.getAdmins();\n };\n Users.prototype.getDispatchers = function () {\n return this.usersStore.getDispatchers();\n };\n Users.prototype.messageDriver = function (userId, message) {\n return this.usersStore.messageDriver(userId, message);\n };\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"create\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAllAdminsAndDispatchers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAllDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"byUserType\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"makeAdmin\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"totalEmployeesCount\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"totalDriversCount\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAdmin\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getDriver\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getDispatcher\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getDriversByTeam\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAll\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAllKeysetPagination\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"get\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"invite\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"unlock\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"assignedTasksCount\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"inviteByEmail\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"validatePhone\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"closedTasks\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"update\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"delete\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getProfileImage\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"subscribeToGroupUpdates\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getOfflineDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getOnlineDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAllLocalDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getOnShiftDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAdmins\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getDispatchers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"messageDriver\", null);\n return Users;\n}());\nexports[\"default\"] = Users;\n//# sourceMappingURL=Users.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/Users.js?");
2979
+ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar ExceptionReason_1 = __webpack_require__(/*! ../Core/ExceptionReason */ \"./dist/Core/ExceptionReason.js\");\nvar keyset_pagination_consts_1 = __webpack_require__(/*! ../utils/consts/keyset-pagination.consts */ \"./dist/utils/consts/keyset-pagination.consts.js\");\nvar UsersStore_1 = __webpack_require__(/*! ./Store/UsersStore */ \"./dist/User/Store/UsersStore.js\");\nvar User_consts_1 = __webpack_require__(/*! ./User.consts */ \"./dist/User/User.consts.js\");\nvar Users = /** @class */ (function () {\n function Users(session) {\n this.usersStore = new UsersStore_1.default(session);\n //keep previous names for backward compatibility\n this.onListUpdate = this.usersStore.onListUpdate;\n this.onUpdate = this.usersStore.onItemUpdate;\n this.onDelete = this.usersStore.onItemRemoved;\n this.onCreate = this.usersStore.onItemCreated;\n this.unsubscribe = this.usersStore.unsubscribe;\n }\n Users.prototype.create = function (user) {\n if ((0, lodash_1.isNil)(user.email) && (0, lodash_1.isNil)(user.phone)) {\n throw new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.INVALID_ARGUMENTS, 'Phone or Email is required');\n }\n return this.usersStore.create(user);\n };\n Users.prototype.getAllAdminsAndDispatchers = function (_a) {\n var _b = _a.limit, limit = _b === void 0 ? 25 : _b, _c = _a.page_action, page_action = _c === void 0 ? keyset_pagination_consts_1.KeysetPaginationPageAction.NEXT : _c, cursor = _a.cursor;\n return this.usersStore.getAllAdminsAndDispatchers({ limit: limit, page_action: page_action, cursor: cursor });\n };\n Users.prototype.getAllDrivers = function (_a) {\n var _b = _a.limit, limit = _b === void 0 ? 25 : _b, _c = _a.page_action, page_action = _c === void 0 ? keyset_pagination_consts_1.KeysetPaginationPageAction.NEXT : _c, cursor = _a.cursor, options = _a.options;\n var optionsWithDefaults = (0, lodash_1.defaults)(options, { onlyOnlineDriver: false, onlyCustomers: false });\n return this.usersStore.getAllDrivers({ limit: limit, page_action: page_action, cursor: cursor, options: optionsWithDefaults });\n };\n Users.prototype.byUserType = function (userTypeId) {\n return this.usersStore.byUserType(userTypeId);\n };\n Users.prototype.makeAdmin = function (userId) {\n return this.usersStore.makeAdmin(userId);\n };\n Users.prototype.totalEmployeesCount = function () {\n return this.usersStore.totalEmployeesCount();\n };\n Users.prototype.totalDriversCount = function () {\n return this.usersStore.totalDriversCount();\n };\n Users.prototype.getAdmin = function (adminId) {\n return this.usersStore.get(adminId);\n };\n Users.prototype.getDriver = function (driverId) {\n return this.usersStore.get(driverId);\n };\n Users.prototype.getDispatcher = function (dispatcherId) {\n return this.usersStore.get(dispatcherId);\n };\n Users.prototype.getDriversByTeam = function (teamId) {\n return this.usersStore.getDriversByTeam(teamId);\n };\n Users.prototype.getAll = function (page, limit) {\n if (page === void 0) { page = 1; }\n if (limit === void 0) { limit = 50; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersStore.getAll(page, limit)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Users.prototype.getAllKeysetPagination = function (_a) {\n var _b = _a.limit, limit = _b === void 0 ? 2500 : _b, _c = _a.page_action, page_action = _c === void 0 ? keyset_pagination_consts_1.KeysetPaginationPageAction.NEXT : _c, cursor = _a.cursor;\n return this.usersStore.getAllKeysetPagination({ limit: limit, page_action: page_action, cursor: cursor });\n };\n Users.prototype.get = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersStore.get(userId)];\n case 1:\n user = _a.sent();\n this.usersStore.addToStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n Users.prototype.getMany = function (userIds, commonOptions) {\n return this.usersStore.getMany(userIds, commonOptions);\n };\n Users.prototype.getLocal = function (userId) {\n return this.usersStore.getItem(userId);\n };\n Users.prototype.invite = function (userId) {\n return this.usersStore.invite(userId);\n };\n Users.prototype.unlock = function (userId) {\n return this.usersStore.unlock(userId);\n };\n Users.prototype.assignedTasksCount = function (userId) {\n return this.usersStore.assignedTasksCount(userId);\n };\n Users.prototype.inviteByEmail = function (userId) {\n return this.usersStore.inviteByEmail(userId);\n };\n Users.prototype.validatePhone = function (phone) {\n return this.usersStore.validatePhone(phone);\n };\n Users.prototype.closedTasks = function (userId, page) {\n return this.usersStore.closedTasks(userId, page);\n };\n Users.prototype.update = function (userId, userDelta) {\n var _this = this;\n return this.usersStore.update(userId, userDelta).then(function (user) { return _this.updateCurrentUserIfNeeded(user); });\n };\n Users.prototype.updateCurrentUserIfNeeded = function (user) {\n var currentUser = this.usersStore.usersService.session.user;\n if (currentUser.id === user.id) {\n this.usersStore.usersService.session.user = (0, lodash_1.merge)(currentUser, user);\n this.usersStore.usersService.session.sendDataEvent(User_consts_1.UserEvents.CURRENT_USER_UPDATED, this.usersStore.usersService.session.user);\n }\n return user;\n };\n Users.prototype.delete = function (userId) {\n return this.usersStore.delete(userId);\n };\n Users.prototype.getProfileImage = function (userId) {\n return this.usersStore.getProfileImage(userId);\n };\n Users.prototype.subscribeToGroupUpdates = function (fn) {\n this.usersStore.subscribeToGroupUpdates(fn);\n };\n Users.prototype.getOfflineDrivers = function () {\n return this.usersStore.getOfflineDrivers();\n };\n Users.prototype.getOnlineDrivers = function () {\n return this.usersStore.getOnlineDrivers();\n };\n Users.prototype.getAllLocalDrivers = function () {\n return this.usersStore.getAllLocalDrivers();\n };\n Users.prototype.getOnShiftDrivers = function () {\n return this.usersStore.getOnShiftDrivers();\n };\n Users.prototype.getAdmins = function () {\n return this.usersStore.getAdmins();\n };\n Users.prototype.getDispatchers = function () {\n return this.usersStore.getDispatchers();\n };\n Users.prototype.messageDriver = function (userId, message) {\n return this.usersStore.messageDriver(userId, message);\n };\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"create\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAllAdminsAndDispatchers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAllDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"byUserType\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"makeAdmin\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"totalEmployeesCount\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"totalDriversCount\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAdmin\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getDriver\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getDispatcher\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getDriversByTeam\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAll\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAllKeysetPagination\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"get\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getMany\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"invite\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"unlock\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"assignedTasksCount\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"inviteByEmail\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"validatePhone\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"closedTasks\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"update\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"delete\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getProfileImage\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"subscribeToGroupUpdates\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getOfflineDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getOnlineDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAllLocalDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getOnShiftDrivers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getAdmins\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"getDispatchers\", null);\n __decorate([\n BringgException_1.logOnException\n ], Users.prototype, \"messageDriver\", null);\n return Users;\n}());\nexports[\"default\"] = Users;\n//# sourceMappingURL=Users.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/Users.js?");
2980
2980
 
2981
2981
  /***/ }),
2982
2982
 
@@ -3383,7 +3383,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
3383
3383
  /***/ ((__unused_webpack_module, exports) => {
3384
3384
 
3385
3385
  "use strict";
3386
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isAbortError = exports.throwAbortError = void 0;\nvar kIsAbortError = Symbol('kIsAbortError');\nfunction throwAbortError(signal, message) {\n if (signal === null || signal === void 0 ? void 0 : signal.reason) {\n if (typeof signal.reason === 'object') {\n signal.reason[kIsAbortError] = true;\n }\n // Throwing the abort reason as the spec to comply with WHATWG specs\n // https://dom.spec.whatwg.org/#aborting-ongoing-activities\n throw signal.reason;\n }\n // If no reason than throw DOMException with abort error according to the specs\n // https://dom.spec.whatwg.org/#interface-abortcontroller\n var error = new DOMException(message || 'Aborted', 'AbortError');\n error[kIsAbortError] = true;\n throw error;\n}\nexports.throwAbortError = throwAbortError;\nfunction isAbortError(error) {\n if (!error || typeof error !== 'object') {\n return false;\n }\n return error[kIsAbortError] || error.name === 'AbortError';\n}\nexports.isAbortError = isAbortError;\n//# sourceMappingURL=abort.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/utils/abort.js?");
3386
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isAbortError = exports.throwAbortError = exports.createAbortError = void 0;\nvar kIsAbortError = Symbol('kIsAbortError');\nfunction createAbortError(signal, message) {\n if (signal === null || signal === void 0 ? void 0 : signal.reason) {\n if (typeof signal.reason === 'object') {\n signal.reason[kIsAbortError] = true;\n }\n // Throwing the abort reason as the spec to comply with WHATWG specs\n // https://dom.spec.whatwg.org/#aborting-ongoing-activities\n throw signal.reason;\n }\n // If no reason than throw DOMException with abort error according to the specs\n // https://dom.spec.whatwg.org/#interface-abortcontroller\n var error = new DOMException(message || 'Aborted', 'AbortError');\n error[kIsAbortError] = true;\n return error;\n}\nexports.createAbortError = createAbortError;\nfunction throwAbortError(signal, message) {\n throw createAbortError(signal, message);\n}\nexports.throwAbortError = throwAbortError;\nfunction isAbortError(error) {\n if (!error || typeof error !== 'object') {\n return false;\n }\n return error[kIsAbortError] || error.name === 'AbortError';\n}\nexports.isAbortError = isAbortError;\n//# sourceMappingURL=abort.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/utils/abort.js?");
3387
3387
 
3388
3388
  /***/ }),
3389
3389
 
@@ -3431,6 +3431,17 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunc
3431
3431
 
3432
3432
  /***/ }),
3433
3433
 
3434
+ /***/ "./dist/utils/promises.js":
3435
+ /*!********************************!*\
3436
+ !*** ./dist/utils/promises.js ***!
3437
+ \********************************/
3438
+ /***/ ((__unused_webpack_module, exports) => {
3439
+
3440
+ "use strict";
3441
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.createDeferredPromise = void 0;\nfunction createDeferredPromise() {\n var resolve;\n var reject;\n var promise = new Promise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n return {\n promise: promise,\n resolve: resolve,\n reject: reject\n };\n}\nexports.createDeferredPromise = createDeferredPromise;\n//# sourceMappingURL=promises.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/utils/promises.js?");
3442
+
3443
+ /***/ }),
3444
+
3434
3445
  /***/ "./dist/utils/responseMessageToString.js":
3435
3446
  /*!***********************************************!*\
3436
3447
  !*** ./dist/utils/responseMessageToString.js ***!