@bringg/dashboard-sdk 9.49.0-pre.2 → 9.49.0-pre.4

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.
@@ -842,7 +842,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
842
842
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
843
843
 
844
844
  "use strict";
845
- 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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ExclusionWindowApi = void 0;\nvar data_store_1 = __importDefault(__webpack_require__(/*! ../../data-store */ \"./dist/data-store.js\"));\nvar storable_data_service_1 = __importDefault(__webpack_require__(/*! ../../storable-data-service */ \"./dist/storable-data-service.js\"));\nvar exclusion_window_consts_1 = __webpack_require__(/*! ./exclusion-window.consts */ \"./dist/ExclusionWindow/v2/exclusion-window.consts.js\");\nvar exclusion_window_service_1 = __importDefault(__webpack_require__(/*! ./exclusion-window-service */ \"./dist/ExclusionWindow/v2/exclusion-window-service.js\"));\nvar ExclusionWindowApi = /** @class */ (function () {\n function ExclusionWindowApi(session) {\n var groupFilters = [\n {\n groupType: exclusion_window_consts_1.ExclusionWindowsFilterGroups.Team,\n keyFunc: function (exclusionWindow) { return exclusionWindow.team_id; }\n }\n ];\n this.exclusionWindowStore = new data_store_1.default(groupFilters);\n this.exclusionWindowService = new exclusion_window_service_1.default(session);\n this.storableDataService = new storable_data_service_1.default(this.exclusionWindowStore);\n }\n ExclusionWindowApi.prototype.loadAllByTeam = function (request, options) {\n var _this = this;\n return this.storableDataService.loadAll('loadAllByTeam', function () { return _this.exclusionWindowService.loadAllByTeam(request); }, __assign(__assign({}, options), { groupType: exclusion_window_consts_1.ExclusionWindowsFilterGroups.Team, groupValue: request.team_id }));\n };\n ExclusionWindowApi.prototype.loadAllWithoutTeam = function (request, options) {\n var _this = this;\n return this.storableDataService.loadAll('loadAllWithoutTeam', function () { return _this.exclusionWindowService.loadAllWithoutTeam(request); }, __assign(__assign({}, options), { groupType: exclusion_window_consts_1.ExclusionWindowsFilterGroups.Team, groupValue: null }));\n };\n ExclusionWindowApi.prototype.create = function (request) {\n var _this = this;\n return this.storableDataService.modify('create', function () { return _this.exclusionWindowService.create(request); });\n };\n ExclusionWindowApi.prototype.update = function (id, request) {\n var _this = this;\n return this.storableDataService.modify('update', function () { return _this.exclusionWindowService.update(id, request); });\n };\n ExclusionWindowApi.prototype.createMany = function (request) {\n var _this = this;\n return this.storableDataService.modifyMany('createMany', function () { return _this.exclusionWindowService.createMany(request); });\n };\n ExclusionWindowApi.prototype.delete = function (id) {\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.storableDataService.delete('delete', function () { 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.exclusionWindowService.delete(id)];\n case 1:\n response = _a.sent();\n return [2 /*return*/];\n }\n });\n }); }, id)];\n case 1:\n _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n ExclusionWindowApi.prototype.copyFromMerchant = function (teamId, exclusionWindowId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.exclusionWindowService.copyFromMerchant(teamId, exclusionWindowId)];\n });\n });\n };\n ExclusionWindowApi.prototype.get = function (id) {\n return this.exclusionWindowStore.get(id);\n };\n ExclusionWindowApi.prototype.getByIds = function (ids) {\n var _this = this;\n return ids.map(function (id) { return _this.get(id); });\n };\n ExclusionWindowApi.prototype.getAll = function () {\n return this.exclusionWindowStore.getAll();\n };\n ExclusionWindowApi.prototype.removeAll = function () {\n this.exclusionWindowStore.removeAll();\n };\n ExclusionWindowApi.prototype.getGroup = function (group, groupValue) {\n return this.exclusionWindowStore.getGroup(group, groupValue);\n };\n return ExclusionWindowApi;\n}());\nexports.ExclusionWindowApi = ExclusionWindowApi;\n//# sourceMappingURL=exclusion-window-api.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/ExclusionWindow/v2/exclusion-window-api.js?");
845
+ 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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ExclusionWindowApi = void 0;\nvar data_store_1 = __importDefault(__webpack_require__(/*! ../../data-store */ \"./dist/data-store.js\"));\nvar storable_data_service_1 = __importDefault(__webpack_require__(/*! ../../storable-data-service */ \"./dist/storable-data-service.js\"));\nvar exclusion_window_consts_1 = __webpack_require__(/*! ./exclusion-window.consts */ \"./dist/ExclusionWindow/v2/exclusion-window.consts.js\");\nvar exclusion_window_service_1 = __importDefault(__webpack_require__(/*! ./exclusion-window-service */ \"./dist/ExclusionWindow/v2/exclusion-window-service.js\"));\nvar ExclusionWindowApi = /** @class */ (function () {\n function ExclusionWindowApi(session) {\n var groupFilters = [\n {\n groupType: exclusion_window_consts_1.ExclusionWindowsFilterGroups.Team,\n keyFunc: function (exclusionWindow) { return exclusionWindow.team_id; }\n }\n ];\n this.exclusionWindowStore = new data_store_1.default(groupFilters);\n this.exclusionWindowService = new exclusion_window_service_1.default(session);\n this.storableDataService = new storable_data_service_1.default(this.exclusionWindowStore);\n }\n ExclusionWindowApi.prototype.loadAllByTeam = function (request, options) {\n var _this = this;\n return this.storableDataService.loadAll('loadAllByTeam', function () { return _this.exclusionWindowService.loadAllByTeam(request); }, __assign(__assign({}, options), { groupType: exclusion_window_consts_1.ExclusionWindowsFilterGroups.Team, groupValue: request.team_id }));\n };\n ExclusionWindowApi.prototype.loadAllWithoutTeam = function (request, options) {\n var _this = this;\n return this.storableDataService.loadAll('loadAllWithoutTeam', function () { return _this.exclusionWindowService.loadAllWithoutTeam(request); }, __assign(__assign({}, options), { groupType: exclusion_window_consts_1.ExclusionWindowsFilterGroups.Team, groupValue: null }));\n };\n ExclusionWindowApi.prototype.create = function (request) {\n var _this = this;\n return this.storableDataService.modify('create', function () { return _this.exclusionWindowService.create(request); });\n };\n ExclusionWindowApi.prototype.update = function (id, request) {\n var _this = this;\n return this.storableDataService.modify('update', function () { return _this.exclusionWindowService.update(id, request); });\n };\n ExclusionWindowApi.prototype.createMany = function (request) {\n var _this = this;\n return this.storableDataService.modifyMany('createMany', function () { return _this.exclusionWindowService.createMany(request); });\n };\n ExclusionWindowApi.prototype.delete = function (id) {\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.storableDataService.delete('delete', function () { 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.exclusionWindowService.delete(id)];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n }); }, id)];\n case 1:\n _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n ExclusionWindowApi.prototype.copyFromMerchant = function (teamId, exclusionWindowId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.exclusionWindowService.copyFromMerchant(teamId, exclusionWindowId)];\n });\n });\n };\n ExclusionWindowApi.prototype.get = function (id) {\n return this.exclusionWindowStore.get(id);\n };\n ExclusionWindowApi.prototype.getByIds = function (ids) {\n var _this = this;\n return ids.map(function (id) { return _this.get(id); });\n };\n ExclusionWindowApi.prototype.getAll = function () {\n return this.exclusionWindowStore.getAll();\n };\n ExclusionWindowApi.prototype.removeAll = function () {\n this.exclusionWindowStore.removeAll();\n };\n ExclusionWindowApi.prototype.getGroup = function (group, groupValue) {\n return this.exclusionWindowStore.getGroup(group, groupValue);\n };\n return ExclusionWindowApi;\n}());\nexports.ExclusionWindowApi = ExclusionWindowApi;\n//# sourceMappingURL=exclusion-window-api.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/ExclusionWindow/v2/exclusion-window-api.js?");
846
846
 
847
847
  /***/ }),
848
848
 
@@ -2184,7 +2184,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
2184
2184
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2185
2185
 
2186
2186
  "use strict";
2187
- 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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ServiceAreaApi = void 0;\nvar data_entity_1 = __webpack_require__(/*! ../../data-entity */ \"./dist/data-entity.js\");\nvar data_store_1 = __importDefault(__webpack_require__(/*! ../../data-store */ \"./dist/data-store.js\"));\nvar storable_data_service_1 = __importDefault(__webpack_require__(/*! ../../storable-data-service */ \"./dist/storable-data-service.js\"));\nvar service_area_consts_1 = __webpack_require__(/*! ./service-area.consts */ \"./dist/ServiceArea/v2/service-area.consts.js\");\nvar service_area_service_1 = __importDefault(__webpack_require__(/*! ./service-area-service */ \"./dist/ServiceArea/v2/service-area-service.js\"));\nvar ServiceAreaApi = /** @class */ (function () {\n function ServiceAreaApi(session) {\n var groupFilters = [\n {\n groupType: service_area_consts_1.ServiceAreaFilterGroups.Teams,\n keyFunc: function (serviceArea) { return serviceArea.team_ids; }\n }\n ];\n this.serviceAreaStore = new data_store_1.default(groupFilters);\n this.serviceAreaService = new service_area_service_1.default(session);\n this.storableDataService = new storable_data_service_1.default(this.serviceAreaStore);\n }\n ServiceAreaApi.prototype.loadAll = function (options) {\n var _this = this;\n return this.storableDataService.loadAll('loadAll', function () { return _this.serviceAreaService.loadAll(options); }, options);\n };\n ServiceAreaApi.prototype.create = function (request) {\n var _this = this;\n return this.storableDataService.modify('create', function () { return _this.serviceAreaService.create(request); });\n };\n ServiceAreaApi.prototype.update = function (id, request) {\n var _this = this;\n return this.storableDataService.modify('update', function () { return _this.serviceAreaService.update(id, request); });\n };\n ServiceAreaApi.prototype.delete = function (id) {\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.storableDataService.delete('delete', function () { 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.serviceAreaService.delete(id)];\n case 1:\n response = _a.sent();\n return [2 /*return*/];\n }\n });\n }); }, id)];\n case 1:\n _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n ServiceAreaApi.prototype.loadAllByTeams = function (request, options) {\n if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.storableDataService.loadAll('loadAllByTeams', function (teams_ids) { return _this.serviceAreaService.loadAllByTeams(__assign(__assign({}, request), { teams_ids: teams_ids }), options); }, __assign(__assign({}, options), { groupType: service_area_consts_1.ServiceAreaFilterGroups.Teams, groupValue: request.teams_ids }))];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n ServiceAreaApi.prototype.assign = function (id, userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.serviceAreaService.assign(id, userId)];\n });\n });\n };\n ServiceAreaApi.prototype.unassignUser = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.serviceAreaService.unassign(userId)];\n });\n });\n };\n ServiceAreaApi.prototype.get = function (id) {\n return this.serviceAreaStore.get(id);\n };\n ServiceAreaApi.prototype.getByIds = function (ids) {\n var _this = this;\n return ids.map(function (id) { return _this.get(id); });\n };\n ServiceAreaApi.prototype.getAll = function () {\n return this.serviceAreaStore.getAll();\n };\n ServiceAreaApi.prototype.removeAll = function () {\n this.serviceAreaStore.removeAll();\n };\n ServiceAreaApi.prototype.getGroup = function (group, groupValue) {\n return this.serviceAreaStore.getGroup(group, groupValue);\n };\n return ServiceAreaApi;\n}());\nexports.ServiceAreaApi = ServiceAreaApi;\n//# sourceMappingURL=service-area-api.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/ServiceArea/v2/service-area-api.js?");
2187
+ 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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ServiceAreaApi = void 0;\nvar data_entity_1 = __webpack_require__(/*! ../../data-entity */ \"./dist/data-entity.js\");\nvar data_store_1 = __importDefault(__webpack_require__(/*! ../../data-store */ \"./dist/data-store.js\"));\nvar storable_data_service_1 = __importDefault(__webpack_require__(/*! ../../storable-data-service */ \"./dist/storable-data-service.js\"));\nvar service_area_consts_1 = __webpack_require__(/*! ./service-area.consts */ \"./dist/ServiceArea/v2/service-area.consts.js\");\nvar service_area_service_1 = __importDefault(__webpack_require__(/*! ./service-area-service */ \"./dist/ServiceArea/v2/service-area-service.js\"));\nvar ServiceAreaApi = /** @class */ (function () {\n function ServiceAreaApi(session) {\n var groupFilters = [\n {\n groupType: service_area_consts_1.ServiceAreaFilterGroups.Teams,\n keyFunc: function (serviceArea) { return serviceArea.team_ids; }\n }\n ];\n this.serviceAreaStore = new data_store_1.default(groupFilters);\n this.serviceAreaService = new service_area_service_1.default(session);\n this.storableDataService = new storable_data_service_1.default(this.serviceAreaStore);\n }\n ServiceAreaApi.prototype.loadAll = function (options) {\n var _this = this;\n return this.storableDataService.loadAll('loadAll', function () { return _this.serviceAreaService.loadAll(options); }, options);\n };\n ServiceAreaApi.prototype.create = function (request) {\n var _this = this;\n return this.storableDataService.modify('create', function () { return _this.serviceAreaService.create(request); });\n };\n ServiceAreaApi.prototype.update = function (id, request) {\n var _this = this;\n return this.storableDataService.modify('update', function () { return _this.serviceAreaService.update(id, request); });\n };\n ServiceAreaApi.prototype.delete = function (id) {\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.storableDataService.delete('delete', function () { 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.serviceAreaService.delete(id)];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n }); }, id)];\n case 1:\n _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n ServiceAreaApi.prototype.loadAllByTeams = function (request, options) {\n if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.storableDataService.loadAll('loadAllByTeams', function (teams_ids) { return _this.serviceAreaService.loadAllByTeams(__assign(__assign({}, request), { teams_ids: teams_ids }), options); }, __assign(__assign({}, options), { groupType: service_area_consts_1.ServiceAreaFilterGroups.Teams, groupValue: request.teams_ids }))];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n ServiceAreaApi.prototype.assign = function (id, userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.serviceAreaService.assign(id, userId)];\n });\n });\n };\n ServiceAreaApi.prototype.unassignUser = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.serviceAreaService.unassign(userId)];\n });\n });\n };\n ServiceAreaApi.prototype.get = function (id) {\n return this.serviceAreaStore.get(id);\n };\n ServiceAreaApi.prototype.getByIds = function (ids) {\n var _this = this;\n return ids.map(function (id) { return _this.get(id); });\n };\n ServiceAreaApi.prototype.getAll = function () {\n return this.serviceAreaStore.getAll();\n };\n ServiceAreaApi.prototype.removeAll = function () {\n this.serviceAreaStore.removeAll();\n };\n ServiceAreaApi.prototype.getGroup = function (group, groupValue) {\n return this.serviceAreaStore.getGroup(group, groupValue);\n };\n return ServiceAreaApi;\n}());\nexports.ServiceAreaApi = ServiceAreaApi;\n//# sourceMappingURL=service-area-api.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/ServiceArea/v2/service-area-api.js?");
2188
2188
 
2189
2189
  /***/ }),
2190
2190
 
@@ -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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __importDefault(__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 = __importDefault(__webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\"));\nvar abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '9.49.0-pre.2';\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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __importDefault(__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 = __importDefault(__webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\"));\nvar abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '9.49.0-pre.4';\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
 
@@ -3031,7 +3031,7 @@ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, targ
3031
3031
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3032
3032
 
3033
3033
  "use strict";
3034
- 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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar merge_mapper_1 = __webpack_require__(/*! ../../Data/merge-mapper */ \"./dist/Data/merge-mapper.js\");\nvar storable_realtime_subscriptions_1 = __importDefault(__webpack_require__(/*! ../../Data/storable-realtime-subscriptions */ \"./dist/Data/storable-realtime-subscriptions.js\"));\nvar data_store_1 = __importDefault(__webpack_require__(/*! ../../data-store */ \"./dist/data-store.js\"));\nvar storable_data_service_1 = __importDefault(__webpack_require__(/*! ../../storable-data-service */ \"./dist/storable-data-service.js\"));\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar users_service_1 = __importDefault(__webpack_require__(/*! ./users-service */ \"./dist/User/v2/users-service.js\"));\nvar UsersApi = /** @class */ (function () {\n function UsersApi(session) {\n var _this = this;\n this.userStore = new data_store_1.default(undefined, { shallow: true });\n this.usersService = new users_service_1.default(session);\n this.storableDataService = new storable_data_service_1.default(this.userStore, function (user) {\n return merge_mapper_1.mergeMapper.mergeIntoExisting(_this.userStore, user);\n });\n this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, this.userStore, this.storableDataService);\n this.storableRealtimeSubscriptions.updateStoreOnEvents([{ name: User_consts_1.RealtimeEvents.Update, isDelete: false }]);\n }\n UsersApi.prototype.loadAll = function (options) {\n var _this = this;\n return this.storableDataService.loadAll('loadAll', function () { 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.usersService.loadAll({}, options)];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response.users];\n }\n });\n }); }, options);\n };\n UsersApi.prototype.getGroup = function (group) {\n return this.userStore.getGroup(User_consts_1.UserGroupTypes.Main, group);\n };\n UsersApi.prototype.get = function (id) {\n return this.userStore.get(id);\n };\n UsersApi.prototype.getMany = function (ids) {\n return this.userStore.getMany(ids);\n };\n UsersApi.prototype.loadMany = function (ids, options) {\n if (options === void 0) { options = { useCache: true }; }\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n // If no IDs provided, return empty array without making API call\n if (ids.length === 0) {\n return [2 /*return*/, []];\n }\n return [2 /*return*/, this.storableDataService.loadMany('loadMany', function (idsToLoad) { 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.usersService.loadAll({ ids: idsToLoad })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response.users];\n }\n });\n }); }, ids, __assign(__assign({}, options), { chunkSize: options.chunkSize || 500 }))];\n });\n });\n };\n UsersApi.prototype.onUpdate = function (callback) {\n return this.storableRealtimeSubscriptions.onEvent(User_consts_1.RealtimeEvents.Update, callback);\n };\n UsersApi.prototype.loadDriversByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.loadAllByTeams(teamId)];\n case 1:\n users = _a.sent();\n this.storableDataService.updateManyInStores(users);\n return [2 /*return*/, users];\n }\n });\n });\n };\n return UsersApi;\n}());\nexports[\"default\"] = UsersApi;\n//# sourceMappingURL=users-api.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/v2/users-api.js?");
3034
+ 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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar merge_mapper_1 = __webpack_require__(/*! ../../Data/merge-mapper */ \"./dist/Data/merge-mapper.js\");\nvar storable_realtime_subscriptions_1 = __importDefault(__webpack_require__(/*! ../../Data/storable-realtime-subscriptions */ \"./dist/Data/storable-realtime-subscriptions.js\"));\nvar data_store_1 = __importDefault(__webpack_require__(/*! ../../data-store */ \"./dist/data-store.js\"));\nvar storable_data_service_1 = __importDefault(__webpack_require__(/*! ../../storable-data-service */ \"./dist/storable-data-service.js\"));\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar users_service_1 = __importDefault(__webpack_require__(/*! ./users-service */ \"./dist/User/v2/users-service.js\"));\nvar UsersApi = /** @class */ (function () {\n function UsersApi(session) {\n var _this = this;\n this.userStore = new data_store_1.default(undefined, { shallow: true });\n this.usersService = new users_service_1.default(session);\n this.storableDataService = new storable_data_service_1.default(this.userStore, function (user) {\n return merge_mapper_1.mergeMapper.mergeIntoExisting(_this.userStore, user);\n });\n this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, this.userStore, this.storableDataService);\n this.storableRealtimeSubscriptions.updateStoreOnEvents([{ name: User_consts_1.RealtimeEvents.Update, isDelete: false }]);\n }\n UsersApi.prototype.delete = function (userId) {\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.storableDataService.delete('delete', function () { 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.delete(userId)];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n }); }, userId)];\n case 1:\n _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersApi.prototype.loadAll = function (options) {\n var _this = this;\n return this.storableDataService.loadAll('loadAll', function () { 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.usersService.loadAll({}, options)];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response.users];\n }\n });\n }); }, options);\n };\n UsersApi.prototype.getGroup = function (group) {\n return this.userStore.getGroup(User_consts_1.UserGroupTypes.Main, group);\n };\n UsersApi.prototype.get = function (id) {\n return this.userStore.get(id);\n };\n UsersApi.prototype.getMany = function (ids) {\n return this.userStore.getMany(ids);\n };\n UsersApi.prototype.loadMany = function (ids, options) {\n if (options === void 0) { options = { useCache: true }; }\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n // If no IDs provided, return empty array without making API call\n if (ids.length === 0) {\n return [2 /*return*/, []];\n }\n return [2 /*return*/, this.storableDataService.loadMany('loadMany', function (idsToLoad) { 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.usersService.loadAll({ ids: idsToLoad })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response.users];\n }\n });\n }); }, ids, __assign(__assign({}, options), { chunkSize: options.chunkSize || 500 }))];\n });\n });\n };\n UsersApi.prototype.onUpdate = function (callback) {\n return this.storableRealtimeSubscriptions.onEvent(User_consts_1.RealtimeEvents.Update, callback);\n };\n UsersApi.prototype.loadDriversByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.loadAllByTeams(teamId)];\n case 1:\n users = _a.sent();\n this.storableDataService.updateManyInStores(users);\n return [2 /*return*/, users];\n }\n });\n });\n };\n return UsersApi;\n}());\nexports[\"default\"] = UsersApi;\n//# sourceMappingURL=users-api.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/v2/users-api.js?");
3035
3035
 
3036
3036
  /***/ }),
3037
3037
 
@@ -3042,7 +3042,7 @@ eval("\nvar __assign = (this && this.__assign) || function () {\n __assign =
3042
3042
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3043
3043
 
3044
3044
  "use strict";
3045
- 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 __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar CrudService_1 = __importDefault(__webpack_require__(/*! ../../Core/CrudService */ \"./dist/Core/CrudService.js\"));\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar UsersService = /** @class */ (function () {\n function UsersService(session) {\n this.service = new CrudService_1.default(session, 'users');\n }\n UsersService.prototype.loadAll = function (query, commonOptions) {\n if (query === void 0) { query = {}; }\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.service.routeGenerator\n .get(User_consts_1.Routes.GET_ALL)\n .withQueryString(query)\n .withExtractor(function (response) { return ({ has_next_page: response.has_next_page, users: response.users }); })\n .setException('Could not get users')\n .withCommonOptions(commonOptions)\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.loadAllByTeams = function (teamId, commonOptions) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(User_consts_1.Routes.GET_DRIVERS_BY_TEAM)\n .withRouteParams({ teamId: teamId })\n .setException(\"failed to get teams drivers for team \".concat(teamId))\n .withCommonOptions(commonOptions)\n .invoke()];\n });\n });\n };\n return UsersService;\n}());\nexports[\"default\"] = UsersService;\n//# sourceMappingURL=users-service.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/v2/users-service.js?");
3045
+ 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 __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar CrudService_1 = __importDefault(__webpack_require__(/*! ../../Core/CrudService */ \"./dist/Core/CrudService.js\"));\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar UsersService = /** @class */ (function () {\n function UsersService(session) {\n this.service = new CrudService_1.default(session, 'users');\n }\n UsersService.prototype.delete = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.delete(userId)];\n });\n });\n };\n UsersService.prototype.loadAll = function (query, commonOptions) {\n if (query === void 0) { query = {}; }\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.service.routeGenerator\n .get(User_consts_1.Routes.GET_ALL)\n .withQueryString(query)\n .withExtractor(function (response) { return ({ has_next_page: response.has_next_page, users: response.users }); })\n .setException('Could not get users')\n .withCommonOptions(commonOptions)\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersService.prototype.loadAllByTeams = function (teamId, commonOptions) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(User_consts_1.Routes.GET_DRIVERS_BY_TEAM)\n .withRouteParams({ teamId: teamId })\n .setException(\"failed to get teams drivers for team \".concat(teamId))\n .withCommonOptions(commonOptions)\n .invoke()];\n });\n });\n };\n return UsersService;\n}());\nexports[\"default\"] = UsersService;\n//# sourceMappingURL=users-service.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/v2/users-service.js?");
3046
3046
 
3047
3047
  /***/ }),
3048
3048
 
@@ -3449,7 +3449,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar
3449
3449
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3450
3450
 
3451
3451
  "use strict";
3452
- 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};\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 BringgDashboardSDK_1 = __webpack_require__(/*! ./BringgDashboardSDK */ \"./dist/BringgDashboardSDK.js\");\nvar data_entity_1 = __webpack_require__(/*! ./data-entity */ \"./dist/data-entity.js\");\nvar StorableDataService = /** @class */ (function () {\n function StorableDataService(dataStore, mapper, extraDataStores) {\n var _this = this;\n this.dataStore = dataStore;\n this.extraDataStores = extraDataStores || [];\n this.mapper = mapper || (function (item) { return ({ current: item, diff: _this.dataStore.get(item.id) }); });\n }\n StorableDataService.prototype.loadAll = function (action, loadFunc, options) {\n return __awaiter(this, void 0, void 0, function () {\n var unloadedItems, shouldLoad, groupValue, loadFnIdsParams, items, mappedItems_1;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = (0, lodash_1.defaults)(options, data_entity_1.DEFAULT_OPTIONS);\n unloadedItems = [];\n shouldLoad = false;\n if (Array.isArray(options.groupValue)) {\n unloadedItems = options.groupValue.filter(function (value) { return !_this.dataStore.isGroupInitialized(options.groupType, value); });\n shouldLoad = unloadedItems.length > 0;\n groupValue = unloadedItems;\n }\n else {\n shouldLoad = !this.dataStore.isGroupInitialized(options.groupType, options.groupValue);\n groupValue = options.groupValue;\n }\n if (!(!options.useCache || shouldLoad)) return [3 /*break*/, 2];\n loadFnIdsParams = groupValue;\n if (!options.useCache) {\n loadFnIdsParams = options.groupValue;\n }\n return [4 /*yield*/, loadFunc(loadFnIdsParams)];\n case 1:\n items = _a.sent();\n mappedItems_1 = items.map(function (item) { return _this.mapper(item, { action: action }); });\n if (options.groupType) {\n this.dataStore.setGroup(options.groupType, groupValue, mappedItems_1);\n }\n else {\n this.dataStore.setAll(mappedItems_1);\n }\n this.extraDataStores.forEach(function (dataStore) { return dataStore.setMany(mappedItems_1, options.fields); });\n _a.label = 2;\n case 2: return [2 /*return*/, options.groupType\n ? this.dataStore.getGroup(options.groupType, options.groupValue)\n : this.dataStore.getAll()];\n }\n });\n });\n };\n StorableDataService.prototype.loadMany = function (action, loadFunc, ids, options) {\n return __awaiter(this, void 0, void 0, function () {\n var unloadedIds, clientItems;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = (0, lodash_1.defaults)(options, data_entity_1.DEFAULT_OPTIONS);\n if (!options.useCache) {\n return [2 /*return*/, this.loadInChunks(ids, loadFunc, action, options)];\n }\n unloadedIds = ids.filter(function (id) {\n var item = _this.dataStore.get(id);\n if (!item) {\n return true;\n }\n return _this.extraDataStores.some(function (dataStore) { return !dataStore.has(item, options.fields); });\n });\n if (!(ids.length === 0 || unloadedIds.length > 0)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.loadInChunks(unloadedIds, loadFunc, action, options)];\n case 1:\n clientItems = _a.sent();\n if (ids.length === 0) {\n return [2 /*return*/, clientItems];\n }\n _a.label = 2;\n case 2: return [2 /*return*/, ids.map(function (id) { return _this.dataStore.get(id); }).filter(Boolean)];\n }\n });\n });\n };\n StorableDataService.prototype.loadInChunks = function (idsToLoad, loadFunc, action, options) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var allClientItems, items, clientItems, chunkSize, i, chunkIds, items, clientItems;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n allClientItems = [];\n if (!(idsToLoad.length === 0)) return [3 /*break*/, 2];\n return [4 /*yield*/, loadFunc([])];\n case 1:\n items = _b.sent();\n clientItems = this.updateManyInStores(items, action, options.fields);\n allClientItems.push.apply(allClientItems, __spreadArray([], __read(clientItems), false));\n return [3 /*break*/, 6];\n case 2:\n chunkSize = options.chunkSize || idsToLoad.length;\n i = 0;\n _b.label = 3;\n case 3:\n if (!(i < idsToLoad.length)) return [3 /*break*/, 6];\n if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {\n throw new Error('Operation was aborted');\n }\n chunkIds = idsToLoad.slice(i, i + chunkSize);\n return [4 /*yield*/, loadFunc(chunkIds)];\n case 4:\n items = _b.sent();\n clientItems = this.updateManyInStores(items, action, options.fields);\n allClientItems.push.apply(allClientItems, __spreadArray([], __read(clientItems), false));\n _b.label = 5;\n case 5:\n i += chunkSize;\n return [3 /*break*/, 3];\n case 6: return [2 /*return*/, allClientItems.map(function (mappedItems) { return mappedItems.current; })];\n }\n });\n });\n };\n StorableDataService.prototype.load = function (action, loadFunc, id, options) {\n return __awaiter(this, void 0, void 0, function () {\n var item;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = (0, lodash_1.defaults)(options, data_entity_1.DEFAULT_OPTIONS);\n if (!(!options.useCache || !this.dataStore.get(id))) return [3 /*break*/, 2];\n return [4 /*yield*/, loadFunc()];\n case 1:\n item = _a.sent();\n this.updateInStores(item, action);\n _a.label = 2;\n case 2: return [2 /*return*/, this.dataStore.get(id)];\n }\n });\n });\n };\n StorableDataService.prototype.modify = function (action, updateFunc, onUpdate) {\n return __awaiter(this, void 0, void 0, function () {\n var item, modifiedItems;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, updateFunc()];\n case 1:\n item = _a.sent();\n modifiedItems = this.updateInStores(item, action);\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(modifiedItems);\n return [2 /*return*/, modifiedItems.current];\n }\n });\n });\n };\n StorableDataService.prototype.modifyMany = function (action, updateFunc, fields, onUpdate) {\n return __awaiter(this, void 0, void 0, function () {\n var items, modifiedItems;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, updateFunc()];\n case 1:\n items = _a.sent();\n modifiedItems = this.updateManyInStores(items, action, fields);\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(modifiedItems);\n return [2 /*return*/, modifiedItems.map(function (mappedItems) { return mappedItems.current; })];\n }\n });\n });\n };\n StorableDataService.prototype.delete = function (action, deleteFunc, 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*/, deleteFunc()];\n case 1:\n _a.sent();\n return [2 /*return*/, this.removeFromStores(id)];\n }\n });\n });\n };\n StorableDataService.prototype.deleteMany = function (action, deleteFunc, ids) {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, deleteFunc()];\n case 1:\n _a.sent();\n return [2 /*return*/, (0, BringgDashboardSDK_1.getGlobals)().mobx.runInAction(function () {\n return ids.map(function (id) { return _this.removeFromStores(id); });\n })];\n }\n });\n });\n };\n StorableDataService.prototype.updateInStores = function (item, action, fields, extraMapperParams) {\n return this.updateManyInStores([item], action, fields, extraMapperParams)[0];\n };\n StorableDataService.prototype.updateManyInStores = function (items, action, fields, extraMapperParams) {\n var _this = this;\n return (0, BringgDashboardSDK_1.getGlobals)().mobx.runInAction(function () {\n var clientItems = items.map(function (item) { return _this.mapper(item, __assign({ action: action }, extraMapperParams)); });\n _this.dataStore.setMany(clientItems);\n _this.extraDataStores.forEach(function (dataStore) { return dataStore.setMany(clientItems, fields); });\n return clientItems;\n });\n };\n StorableDataService.prototype.removeFromStores = function (id) {\n var item = this.dataStore.get(id);\n this.dataStore.remove(id);\n this.extraDataStores.forEach(function (dataStore) { return dataStore.remove(id); });\n return item;\n };\n StorableDataService.prototype.getFromStores = function (ids, fields) {\n var _this = this;\n return ids\n .map(function (id) {\n var item = _this.dataStore.get(id);\n return item && (!fields || _this.extraDataStores.every(function (dataStore) { return dataStore.has(item, fields); }))\n ? item\n : undefined;\n })\n .filter(Boolean);\n };\n return StorableDataService;\n}());\nexports[\"default\"] = StorableDataService;\n//# sourceMappingURL=storable-data-service.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/storable-data-service.js?");
3452
+ 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};\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 BringgDashboardSDK_1 = __webpack_require__(/*! ./BringgDashboardSDK */ \"./dist/BringgDashboardSDK.js\");\nvar data_entity_1 = __webpack_require__(/*! ./data-entity */ \"./dist/data-entity.js\");\nvar StorableDataService = /** @class */ (function () {\n function StorableDataService(dataStore, mapper, extraDataStores) {\n var _this = this;\n this.dataStore = dataStore;\n this.extraDataStores = extraDataStores || [];\n this.mapper = mapper || (function (item) { return ({ current: item, diff: _this.dataStore.get(item.id) }); });\n }\n StorableDataService.prototype.loadAll = function (action, loadFunc, options) {\n return __awaiter(this, void 0, void 0, function () {\n var unloadedItems, shouldLoad, groupValue, loadFnIdsParams, items, mappedItems_1;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = (0, lodash_1.defaults)(options, data_entity_1.DEFAULT_OPTIONS);\n unloadedItems = [];\n shouldLoad = false;\n if (Array.isArray(options.groupValue)) {\n unloadedItems = options.groupValue.filter(function (value) { return !_this.dataStore.isGroupInitialized(options.groupType, value); });\n shouldLoad = unloadedItems.length > 0;\n groupValue = unloadedItems;\n }\n else {\n shouldLoad = !this.dataStore.isGroupInitialized(options.groupType, options.groupValue);\n groupValue = options.groupValue;\n }\n if (!(!options.useCache || shouldLoad)) return [3 /*break*/, 2];\n loadFnIdsParams = groupValue;\n if (!options.useCache) {\n loadFnIdsParams = options.groupValue;\n }\n return [4 /*yield*/, loadFunc(loadFnIdsParams)];\n case 1:\n items = _a.sent();\n mappedItems_1 = items.map(function (item) { return _this.mapper(item, { action: action }); });\n if (options.groupType) {\n this.dataStore.setGroup(options.groupType, groupValue, mappedItems_1);\n }\n else {\n this.dataStore.setAll(mappedItems_1);\n }\n this.extraDataStores.forEach(function (dataStore) { return dataStore.setMany(mappedItems_1, options.fields); });\n _a.label = 2;\n case 2: return [2 /*return*/, options.groupType\n ? this.dataStore.getGroup(options.groupType, options.groupValue)\n : this.dataStore.getAll()];\n }\n });\n });\n };\n StorableDataService.prototype.loadMany = function (action, loadFunc, ids, options) {\n return __awaiter(this, void 0, void 0, function () {\n var unloadedIds, clientItems;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = (0, lodash_1.defaults)(options, data_entity_1.DEFAULT_OPTIONS);\n if (!options.useCache) {\n return [2 /*return*/, this.loadInChunks(ids, loadFunc, action, options)];\n }\n unloadedIds = ids.filter(function (id) {\n var item = _this.dataStore.get(id);\n if (!item) {\n return true;\n }\n return _this.extraDataStores.some(function (dataStore) { return !dataStore.has(item, options.fields); });\n });\n if (!(ids.length === 0 || unloadedIds.length > 0)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.loadInChunks(unloadedIds, loadFunc, action, options)];\n case 1:\n clientItems = _a.sent();\n if (ids.length === 0) {\n return [2 /*return*/, clientItems];\n }\n _a.label = 2;\n case 2: return [2 /*return*/, ids.map(function (id) { return _this.dataStore.get(id); }).filter(Boolean)];\n }\n });\n });\n };\n StorableDataService.prototype.loadInChunks = function (idsToLoad, loadFunc, action, options) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var allClientItems, items, clientItems, chunkSize, i, chunkIds, items, clientItems;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n allClientItems = [];\n if (!(idsToLoad.length === 0)) return [3 /*break*/, 2];\n return [4 /*yield*/, loadFunc([])];\n case 1:\n items = _b.sent();\n clientItems = this.updateManyInStores(items, action, options.fields);\n allClientItems.push.apply(allClientItems, __spreadArray([], __read(clientItems), false));\n return [3 /*break*/, 6];\n case 2:\n chunkSize = options.chunkSize || idsToLoad.length;\n i = 0;\n _b.label = 3;\n case 3:\n if (!(i < idsToLoad.length)) return [3 /*break*/, 6];\n if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {\n throw new Error('Operation was aborted');\n }\n chunkIds = idsToLoad.slice(i, i + chunkSize);\n return [4 /*yield*/, loadFunc(chunkIds)];\n case 4:\n items = _b.sent();\n clientItems = this.updateManyInStores(items, action, options.fields);\n allClientItems.push.apply(allClientItems, __spreadArray([], __read(clientItems), false));\n _b.label = 5;\n case 5:\n i += chunkSize;\n return [3 /*break*/, 3];\n case 6: return [2 /*return*/, allClientItems.map(function (mappedItems) { return mappedItems.current; })];\n }\n });\n });\n };\n StorableDataService.prototype.load = function (action, loadFunc, id, options) {\n return __awaiter(this, void 0, void 0, function () {\n var item;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = (0, lodash_1.defaults)(options, data_entity_1.DEFAULT_OPTIONS);\n if (!(!options.useCache || !this.dataStore.get(id))) return [3 /*break*/, 2];\n return [4 /*yield*/, loadFunc()];\n case 1:\n item = _a.sent();\n this.updateInStores(item, action);\n _a.label = 2;\n case 2: return [2 /*return*/, this.dataStore.get(id)];\n }\n });\n });\n };\n StorableDataService.prototype.modify = function (action, updateFunc, onUpdate) {\n return __awaiter(this, void 0, void 0, function () {\n var item, modifiedItems;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, updateFunc()];\n case 1:\n item = _a.sent();\n modifiedItems = this.updateInStores(item, action);\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(modifiedItems);\n return [2 /*return*/, modifiedItems.current];\n }\n });\n });\n };\n StorableDataService.prototype.modifyMany = function (action, updateFunc, fields, onUpdate) {\n return __awaiter(this, void 0, void 0, function () {\n var items, modifiedItems;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, updateFunc()];\n case 1:\n items = _a.sent();\n modifiedItems = this.updateManyInStores(items, action, fields);\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(modifiedItems);\n return [2 /*return*/, modifiedItems.map(function (mappedItems) { return mappedItems.current; })];\n }\n });\n });\n };\n StorableDataService.prototype.delete = function (action, deleteFunc, 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*/, deleteFunc()];\n case 1:\n response = _a.sent();\n if (response.success) {\n return [2 /*return*/, this.removeFromStores(id)];\n }\n return [2 /*return*/, undefined];\n }\n });\n });\n };\n StorableDataService.prototype.deleteMany = function (action, deleteFunc, ids) {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, deleteFunc()];\n case 1:\n _a.sent();\n return [2 /*return*/, (0, BringgDashboardSDK_1.getGlobals)().mobx.runInAction(function () {\n return ids.map(function (id) { return _this.removeFromStores(id); });\n })];\n }\n });\n });\n };\n StorableDataService.prototype.updateInStores = function (item, action, fields, extraMapperParams) {\n return this.updateManyInStores([item], action, fields, extraMapperParams)[0];\n };\n StorableDataService.prototype.updateManyInStores = function (items, action, fields, extraMapperParams) {\n var _this = this;\n return (0, BringgDashboardSDK_1.getGlobals)().mobx.runInAction(function () {\n var clientItems = items.map(function (item) { return _this.mapper(item, __assign({ action: action }, extraMapperParams)); });\n _this.dataStore.setMany(clientItems);\n _this.extraDataStores.forEach(function (dataStore) { return dataStore.setMany(clientItems, fields); });\n return clientItems;\n });\n };\n StorableDataService.prototype.removeFromStores = function (id) {\n var item = this.dataStore.get(id);\n this.dataStore.remove(id);\n this.extraDataStores.forEach(function (dataStore) { return dataStore.remove(id); });\n return item;\n };\n StorableDataService.prototype.getFromStores = function (ids, fields) {\n var _this = this;\n return ids\n .map(function (id) {\n var item = _this.dataStore.get(id);\n return item && (!fields || _this.extraDataStores.every(function (dataStore) { return dataStore.has(item, fields); }))\n ? item\n : undefined;\n })\n .filter(Boolean);\n };\n return StorableDataService;\n}());\nexports[\"default\"] = StorableDataService;\n//# sourceMappingURL=storable-data-service.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/storable-data-service.js?");
3453
3453
 
3454
3454
  /***/ }),
3455
3455