@bringg/dashboard-sdk 0.4.49 → 0.4.50

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.
@@ -1669,7 +1669,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Ro
1669
1669
  /***/ (function(module, exports, __webpack_require__) {
1670
1670
 
1671
1671
  "use strict";
1672
- eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RunsService = exports.Routes = void 0;\nvar SessionBasedService_1 = __webpack_require__(/*! ../../Services/SessionBasedService */ \"./dist/Services/SessionBasedService.js\");\nvar BringgException_1 = __webpack_require__(/*! ../../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar runs_consts_1 = __webpack_require__(/*! ../runs.consts */ \"./dist/Run/runs.consts.js\");\nvar Route_1 = __webpack_require__(/*! ../../Services/Route */ \"./dist/Services/Route.js\");\nexports.Routes = {\n GET_RUNS: new Route_1.Route('/runs', 0 /* GET */),\n GET_RUN: new Route_1.Route('/runs/{:id}', 0 /* GET */),\n GET_RUN_HISTORY: new Route_1.Route('/runs/{:id}/history', 0 /* GET */),\n GET_RUN_LOCATIONS: new Route_1.Route('/runs/{:id}/locations', 0 /* GET */),\n GET_RUN_CASHOUT: new Route_1.Route('/runs/{:id}/cashout', 0 /* GET */),\n ASSIGN_DRIVER: new Route_1.Route('/runs/{:id}/assign', 2 /* PUT */),\n UNASSIGN_DRIVER: new Route_1.Route('/runs/{:id}/unassign', 2 /* PUT */),\n ASSIGN_VEHICLE: new Route_1.Route('/runs/{:id}/assign_vehicle', 2 /* PUT */),\n UNASSIGN_VEHICLE: new Route_1.Route('/runs/{:id}/unassign_vehicle', 2 /* PUT */),\n BULK_CLOSE: new Route_1.Route('/runs/bulk_close', 1 /* POST */),\n MARK_DONE_PLANNING: new Route_1.Route('/runs/mark_done_planning', 1 /* POST */),\n GET_ACTUAL_BREAKS: new Route_1.Route('/runs/actual_breaks', 0 /* GET */)\n};\nvar RunsService = /** @class */ (function (_super) {\n __extends(RunsService, _super);\n function RunsService(session) {\n return _super.call(this, session.config.getApiEndpoint(), session) || this;\n }\n RunsService.prototype.getPage = function (page) {\n if (page === void 0) { page = 0; }\n return __awaiter(this, void 0, void 0, function () {\n var runsResponse;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUNS, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to get Runs'), undefined, undefined, { page: page })];\n case 1:\n runsResponse = _a.sent();\n return [2 /*return*/, runsResponse];\n }\n });\n });\n };\n RunsService.prototype.getAll = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var runsResponse;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUNS, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to get Runs'), undefined, undefined, options)];\n case 1:\n runsResponse = _a.sent();\n return [2 /*return*/, runsResponse];\n }\n });\n });\n };\n RunsService.prototype.get = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var run;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUN, runs_consts_1.runExtractor, BringgException_1.BringgException.serviceException('Failed to get Run'), undefined, { id: id })];\n case 1:\n run = _a.sent();\n return [2 /*return*/, run];\n }\n });\n });\n };\n RunsService.prototype.getHistory = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var runHistory;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUN_HISTORY, runs_consts_1.runsHistoryExtractor, BringgException_1.BringgException.serviceException('Failed to get run history'), undefined, { id: id })];\n case 1:\n runHistory = _a.sent();\n return [2 /*return*/, runHistory.run_histories];\n }\n });\n });\n };\n RunsService.prototype.getLocations = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var runLocations;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUN_LOCATIONS, runs_consts_1.runsLocationsExtractor, BringgException_1.BringgException.serviceException('Failed to get run locations'), undefined, { id: id })];\n case 1:\n runLocations = _a.sent();\n return [2 /*return*/, runLocations.run_locations];\n }\n });\n });\n };\n RunsService.prototype.getCashout = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var runLocations;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUN_CASHOUT, runs_consts_1.runCashoutExtractor, BringgException_1.BringgException.serviceException('Failed to get run cashout'), undefined, { id: id })];\n case 1:\n runLocations = _a.sent();\n return [2 /*return*/, runLocations.run_cashout];\n }\n });\n });\n };\n RunsService.prototype.assignDriver = function (id, userId) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.ASSIGN_DRIVER, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to assign driver to run'), { user_id: userId }, { id: id })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n RunsService.prototype.unassignDriver = function (id, userId) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.UNASSIGN_DRIVER, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to assign driver to run'), { user_id: userId }, { id: id })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n RunsService.prototype.assignVehicle = function (id, vehicleId, previousVehicleId, tasksIds) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.ASSIGN_VEHICLE, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to assign vehicle to run'), {\n vehicle_id: vehicleId,\n previous_vehicle_id: previousVehicleId,\n task_ids: tasksIds\n }, { id: id })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n RunsService.prototype.unassignVehicle = function (id, previousVehicleId, tasksIds) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.UNASSIGN_VEHICLE, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to unassign vehicle from run'), {\n previous_vehicle_id: previousVehicleId,\n task_ids: tasksIds\n }, { id: id })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n RunsService.prototype.bulkClose = function (runIds) {\n return __awaiter(this, void 0, void 0, function () {\n var runBulkClose;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.BULK_CLOSE, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to bulk close runs'), {\n run_ids: runIds\n })];\n case 1:\n runBulkClose = _a.sent();\n return [2 /*return*/, runBulkClose];\n }\n });\n });\n };\n RunsService.prototype.markDonePlanning = function (runIds) {\n return __awaiter(this, void 0, void 0, function () {\n var markDonePlanning;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.MARK_DONE_PLANNING, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to mark done planning for runs'), { run_ids: runIds })];\n case 1:\n markDonePlanning = _a.sent();\n return [2 /*return*/, markDonePlanning];\n }\n });\n });\n };\n RunsService.prototype.getActualBreaks = function (runIds) {\n return __awaiter(this, void 0, void 0, function () {\n var actualBreaksByRunIdResponse;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_ACTUAL_BREAKS, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to get actual breaks of runs'), {}, {}, { run_ids: runIds })];\n case 1:\n actualBreaksByRunIdResponse = _a.sent();\n return [2 /*return*/, actualBreaksByRunIdResponse];\n }\n });\n });\n };\n return RunsService;\n}(SessionBasedService_1.SessionBasedService));\nexports.RunsService = RunsService;\n//# sourceMappingURL=runs.service.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Run/Service/runs.service.js?");
1672
+ eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RunsService = exports.Routes = void 0;\nvar SessionBasedService_1 = __webpack_require__(/*! ../../Services/SessionBasedService */ \"./dist/Services/SessionBasedService.js\");\nvar BringgException_1 = __webpack_require__(/*! ../../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar runs_consts_1 = __webpack_require__(/*! ../runs.consts */ \"./dist/Run/runs.consts.js\");\nvar Route_1 = __webpack_require__(/*! ../../Services/Route */ \"./dist/Services/Route.js\");\nexports.Routes = {\n GET_RUNS: new Route_1.Route('/runs', 0 /* GET */),\n GET_RUN: new Route_1.Route('/runs/{:id}', 0 /* GET */),\n GET_RUN_HISTORY: new Route_1.Route('/runs/{:id}/history', 0 /* GET */),\n GET_RUN_LOCATIONS: new Route_1.Route('/runs/{:id}/locations', 0 /* GET */),\n GET_RUN_CASHOUT: new Route_1.Route('/runs/{:id}/cashout', 0 /* GET */),\n ASSIGN_DRIVER: new Route_1.Route('/runs/{:id}/assign', 2 /* PUT */),\n UNASSIGN_DRIVER: new Route_1.Route('/runs/{:id}/unassign', 2 /* PUT */),\n ASSIGN_VEHICLE: new Route_1.Route('/runs/{:id}/assign_vehicle', 2 /* PUT */),\n UNASSIGN_VEHICLE: new Route_1.Route('/runs/{:id}/unassign_vehicle', 2 /* PUT */),\n BULK_CLOSE: new Route_1.Route('/runs/bulk_close', 1 /* POST */),\n MARK_DONE_PLANNING: new Route_1.Route('/runs/mark_done_planning', 1 /* POST */),\n GET_ACTUAL_BREAKS: new Route_1.Route('/runs/actual_breaks', 0 /* GET */)\n};\nvar RunsService = /** @class */ (function (_super) {\n __extends(RunsService, _super);\n function RunsService(session) {\n return _super.call(this, session.config.getApiEndpoint(), session) || this;\n }\n RunsService.prototype.getPage = function (page) {\n if (page === void 0) { page = 0; }\n return __awaiter(this, void 0, void 0, function () {\n var runsResponse;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUNS, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to get Runs'), undefined, undefined, { page: page })];\n case 1:\n runsResponse = _a.sent();\n return [2 /*return*/, runsResponse];\n }\n });\n });\n };\n RunsService.prototype.getAll = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var runsResponse;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUNS, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to get Runs'), undefined, undefined, options)];\n case 1:\n runsResponse = _a.sent();\n return [2 /*return*/, runsResponse];\n }\n });\n });\n };\n RunsService.prototype.get = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var run;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUN, runs_consts_1.runExtractor, BringgException_1.BringgException.serviceException('Failed to get Run'), undefined, { id: id })];\n case 1:\n run = _a.sent();\n return [2 /*return*/, run];\n }\n });\n });\n };\n RunsService.prototype.getHistory = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var runHistory;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUN_HISTORY, runs_consts_1.runsHistoryExtractor, BringgException_1.BringgException.serviceException('Failed to get run history'), undefined, { id: id })];\n case 1:\n runHistory = _a.sent();\n return [2 /*return*/, runHistory.run_histories];\n }\n });\n });\n };\n RunsService.prototype.getLocations = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var runLocations;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUN_LOCATIONS, runs_consts_1.runsLocationsExtractor, BringgException_1.BringgException.serviceException('Failed to get run locations'), undefined, { id: id })];\n case 1:\n runLocations = _a.sent();\n return [2 /*return*/, runLocations.run_locations];\n }\n });\n });\n };\n RunsService.prototype.getCashout = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var runLocations;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_RUN_CASHOUT, runs_consts_1.runCashoutExtractor, BringgException_1.BringgException.serviceException('Failed to get run cashout'), undefined, { id: id })];\n case 1:\n runLocations = _a.sent();\n return [2 /*return*/, runLocations.run_cashout];\n }\n });\n });\n };\n RunsService.prototype.assignDriver = function (id, userId, targetRun) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.ASSIGN_DRIVER, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to assign driver to run'), { user_id: userId, target_run: targetRun }, { id: id })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n RunsService.prototype.unassignDriver = function (id, userId) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.UNASSIGN_DRIVER, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to assign driver to run'), { user_id: userId }, { id: id })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n RunsService.prototype.assignVehicle = function (id, vehicleId, previousVehicleId, tasksIds) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.ASSIGN_VEHICLE, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to assign vehicle to run'), {\n vehicle_id: vehicleId,\n previous_vehicle_id: previousVehicleId,\n task_ids: tasksIds\n }, { id: id })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n RunsService.prototype.unassignVehicle = function (id, previousVehicleId, tasksIds) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.UNASSIGN_VEHICLE, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to unassign vehicle from run'), {\n previous_vehicle_id: previousVehicleId,\n task_ids: tasksIds\n }, { id: id })];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response];\n }\n });\n });\n };\n RunsService.prototype.bulkClose = function (runIds) {\n return __awaiter(this, void 0, void 0, function () {\n var runBulkClose;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.BULK_CLOSE, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to bulk close runs'), {\n run_ids: runIds\n })];\n case 1:\n runBulkClose = _a.sent();\n return [2 /*return*/, runBulkClose];\n }\n });\n });\n };\n RunsService.prototype.markDonePlanning = function (runIds) {\n return __awaiter(this, void 0, void 0, function () {\n var markDonePlanning;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.MARK_DONE_PLANNING, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to mark done planning for runs'), { run_ids: runIds })];\n case 1:\n markDonePlanning = _a.sent();\n return [2 /*return*/, markDonePlanning];\n }\n });\n });\n };\n RunsService.prototype.getActualBreaks = function (runIds) {\n return __awaiter(this, void 0, void 0, function () {\n var actualBreaksByRunIdResponse;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.handleAuthorizedRequest(exports.Routes.GET_ACTUAL_BREAKS, runs_consts_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to get actual breaks of runs'), {}, {}, { run_ids: runIds })];\n case 1:\n actualBreaksByRunIdResponse = _a.sent();\n return [2 /*return*/, actualBreaksByRunIdResponse];\n }\n });\n });\n };\n return RunsService;\n}(SessionBasedService_1.SessionBasedService));\nexports.RunsService = RunsService;\n//# sourceMappingURL=runs.service.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Run/Service/runs.service.js?");
1673
1673
 
1674
1674
  /***/ }),
1675
1675
 
@@ -1695,7 +1695,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexport
1695
1695
  /***/ (function(module, exports, __webpack_require__) {
1696
1696
 
1697
1697
  "use strict";
1698
- 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 (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar runs_service_1 = __webpack_require__(/*! ./Service/runs.service */ \"./dist/Run/Service/runs.service.js\");\nvar Runs = /** @class */ (function () {\n function Runs(session) {\n this.runsService = new runs_service_1.RunsService(session);\n }\n // keep this for backward compitability - remove after app deploy\n Runs.prototype.getPage = function (page) {\n if (page === void 0) { page = 0; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.getPage(page)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getAll = function (options) {\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.runsService.getAll(options)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.get = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.get(id)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getHistory = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.getHistory(id)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getLocations = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.getLocations(id)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getCashout = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.getCashout(id)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.assignDriver = function (id, userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.assignDriver(id, userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.unassignDriver = function (id, userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.unassignDriver(id, userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.assignVehicle = function (id, vehicleId, previousVehicleId, tasksIds) {\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.runsService.assignVehicle(id, vehicleId, previousVehicleId, tasksIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.unassignVehicle = function (id, previousVehicleId, tasksIds) {\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.runsService.unassignVehicle(id, previousVehicleId, tasksIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.bulkClose = function (runIds) {\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.runsService.bulkClose(runIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.markDonePlanning = function (runIds) {\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.runsService.markDonePlanning(runIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getActualBreaks = function (runIds) {\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.runsService.getActualBreaks(runIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Runs;\n}());\nexports.default = Runs;\n//# sourceMappingURL=runs.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Run/runs.js?");
1698
+ 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 (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar runs_service_1 = __webpack_require__(/*! ./Service/runs.service */ \"./dist/Run/Service/runs.service.js\");\nvar Runs = /** @class */ (function () {\n function Runs(session) {\n this.runsService = new runs_service_1.RunsService(session);\n }\n // keep this for backward compitability - remove after app deploy\n Runs.prototype.getPage = function (page) {\n if (page === void 0) { page = 0; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.getPage(page)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getAll = function (options) {\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.runsService.getAll(options)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.get = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.get(id)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getHistory = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.getHistory(id)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getLocations = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.getLocations(id)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getCashout = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.getCashout(id)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.assignDriver = function (id, userId, targetRun) {\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.runsService.assignDriver(id, userId, targetRun)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.unassignDriver = function (id, userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.runsService.unassignDriver(id, userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.assignVehicle = function (id, vehicleId, previousVehicleId, tasksIds) {\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.runsService.assignVehicle(id, vehicleId, previousVehicleId, tasksIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.unassignVehicle = function (id, previousVehicleId, tasksIds) {\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.runsService.unassignVehicle(id, previousVehicleId, tasksIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.bulkClose = function (runIds) {\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.runsService.bulkClose(runIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.markDonePlanning = function (runIds) {\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.runsService.markDonePlanning(runIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Runs.prototype.getActualBreaks = function (runIds) {\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.runsService.getActualBreaks(runIds)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Runs;\n}());\nexports.default = Runs;\n//# sourceMappingURL=runs.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Run/runs.js?");
1699
1699
 
1700
1700
  /***/ }),
1701
1701
 
@@ -1890,7 +1890,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexport
1890
1890
  /***/ (function(module, exports, __webpack_require__) {
1891
1891
 
1892
1892
  "use strict";
1893
- 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 (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar Logger_1 = __webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar version = '0.4.49';\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 try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) { }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) { }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, queryString, authenticationToken, headers) {\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=\" + authenticationToken;\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, _e = _b.queryString, queryString = _e === void 0 ? undefined : _e, _f = _b.authenticationToken, authenticationToken = _f === void 0 ? undefined : _f, _g = _b.headers, headers = _g === void 0 ? undefined : _g;\n return new RequestOptions(clientId, timeout, queryString, authenticationToken, headers);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response) {\n this.axiosPromise = response;\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 (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 (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) {\n return new ResponseHandler(axiosInstance.get(\"\" + host + uri, { params: queryString }));\n}\nfunction post(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.post(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction put(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.put(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction patch(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.patch(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction remove(axiosInstance, host, uri, queryString) {\n return new ResponseHandler(axiosInstance.delete(\"\" + host + uri, { params: queryString }));\n}\nfunction routify(axiosInstance, endpoint, route, routeParams, queryString, payload) {\n switch (route.httpMethod) {\n case 0 /* GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString);\n case 1 /* POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 2 /* PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 3 /* PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 4 /* DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString);\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 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 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 try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) { }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, headers) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers })));\n}\nfunction anonymousAxiosInstance(clientId, headers) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers })));\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, routeParams, queryString, payload, headers) {\n return routify(axiosInstance(this.clientId, this.authToken, headers), endpoint, route, routeParams, queryString, payload);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId) {\n this.clientId = clientId;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload) {\n return routify(anonymousAxiosInstance(this.clientId), 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?");
1893
+ 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 (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar Logger_1 = __webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar version = '0.4.50';\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 try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) { }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) { }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, queryString, authenticationToken, headers) {\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=\" + authenticationToken;\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, _e = _b.queryString, queryString = _e === void 0 ? undefined : _e, _f = _b.authenticationToken, authenticationToken = _f === void 0 ? undefined : _f, _g = _b.headers, headers = _g === void 0 ? undefined : _g;\n return new RequestOptions(clientId, timeout, queryString, authenticationToken, headers);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response) {\n this.axiosPromise = response;\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 (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 (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) {\n return new ResponseHandler(axiosInstance.get(\"\" + host + uri, { params: queryString }));\n}\nfunction post(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.post(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction put(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.put(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction patch(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.patch(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction remove(axiosInstance, host, uri, queryString) {\n return new ResponseHandler(axiosInstance.delete(\"\" + host + uri, { params: queryString }));\n}\nfunction routify(axiosInstance, endpoint, route, routeParams, queryString, payload) {\n switch (route.httpMethod) {\n case 0 /* GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString);\n case 1 /* POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 2 /* PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 3 /* PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 4 /* DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString);\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 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 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 try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) { }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, headers) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers })));\n}\nfunction anonymousAxiosInstance(clientId, headers) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers })));\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, routeParams, queryString, payload, headers) {\n return routify(axiosInstance(this.clientId, this.authToken, headers), endpoint, route, routeParams, queryString, payload);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId) {\n this.clientId = clientId;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload) {\n return routify(anonymousAxiosInstance(this.clientId), 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?");
1894
1894
 
1895
1895
  /***/ }),
1896
1896