@bringg/dashboard-sdk 0.6.2 → 0.7.0

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.
@@ -850,7 +850,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
850
850
  /***/ (function(module, exports, __webpack_require__) {
851
851
 
852
852
  "use strict";
853
- eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=DeliveryBlocks.consts.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/DeliveryBlocks/DeliveryBlocks.consts.js?");
853
+ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DateRangeType = void 0;\nvar DateRangeType;\n(function (DateRangeType) {\n DateRangeType[DateRangeType[\"startsInRange\"] = 1] = \"startsInRange\";\n DateRangeType[DateRangeType[\"overlapsWithRange\"] = 2] = \"overlapsWithRange\";\n})(DateRangeType = exports.DateRangeType || (exports.DateRangeType = {}));\n//# sourceMappingURL=DeliveryBlocks.consts.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/DeliveryBlocks/DeliveryBlocks.consts.js?");
854
854
 
855
855
  /***/ }),
856
856
 
@@ -863,7 +863,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# so
863
863
  /***/ (function(module, exports, __webpack_require__) {
864
864
 
865
865
  "use strict";
866
- eval("\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) 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.DeliveryBlocksApi = void 0;\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar DeliveryBlocksEntity_1 = __webpack_require__(/*! ./Entity/DeliveryBlocksEntity */ \"./dist/DeliveryBlocks/Entity/DeliveryBlocksEntity.js\");\nvar DeliveryBlocksApi = /** @class */ (function () {\n function DeliveryBlocksApi(session) {\n this.deliveryBlocksEntity = new DeliveryBlocksEntity_1.default(session);\n }\n DeliveryBlocksApi.prototype.get = function (teamId, startTime, endTime) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.get(teamId, startTime, endTime)];\n });\n });\n };\n DeliveryBlocksApi.prototype.create = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.create(options)];\n });\n });\n };\n DeliveryBlocksApi.prototype.update = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.update(options)];\n });\n });\n };\n DeliveryBlocksApi.prototype.delete = function (id, recurring) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.delete(id, recurring)];\n });\n });\n };\n DeliveryBlocksApi.prototype.getByDriverId = function (driverId, startTime, endTime) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.getByDriverId(driverId, startTime, endTime)];\n });\n });\n };\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"get\", null);\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"create\", null);\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"update\", null);\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"delete\", null);\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"getByDriverId\", null);\n return DeliveryBlocksApi;\n}());\nexports.DeliveryBlocksApi = DeliveryBlocksApi;\n//# sourceMappingURL=DeliveryBlocksApi.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/DeliveryBlocks/DeliveryBlocksApi.js?");
866
+ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) 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.DeliveryBlocksApi = void 0;\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar DeliveryBlocksEntity_1 = __webpack_require__(/*! ./Entity/DeliveryBlocksEntity */ \"./dist/DeliveryBlocks/Entity/DeliveryBlocksEntity.js\");\nvar DeliveryBlocksApi = /** @class */ (function () {\n function DeliveryBlocksApi(session) {\n this.deliveryBlocksEntity = new DeliveryBlocksEntity_1.default(session);\n }\n DeliveryBlocksApi.prototype.get = function (teamId, startTime, endTime, dateRangeType) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.get(teamId, startTime, endTime, dateRangeType)];\n });\n });\n };\n DeliveryBlocksApi.prototype.create = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.create(options)];\n });\n });\n };\n DeliveryBlocksApi.prototype.update = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.update(options)];\n });\n });\n };\n DeliveryBlocksApi.prototype.delete = function (id, recurring) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.delete(id, recurring)];\n });\n });\n };\n DeliveryBlocksApi.prototype.getByDriverId = function (driverId, startTime, endTime) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.deliveryBlocksEntity.getByDriverId(driverId, startTime, endTime)];\n });\n });\n };\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"get\", null);\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"create\", null);\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"update\", null);\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"delete\", null);\n __decorate([\n BringgException_1.logOnException\n ], DeliveryBlocksApi.prototype, \"getByDriverId\", null);\n return DeliveryBlocksApi;\n}());\nexports.DeliveryBlocksApi = DeliveryBlocksApi;\n//# sourceMappingURL=DeliveryBlocksApi.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/DeliveryBlocks/DeliveryBlocksApi.js?");
867
867
 
868
868
  /***/ }),
869
869
 
@@ -876,7 +876,7 @@ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, targ
876
876
  /***/ (function(module, exports, __webpack_require__) {
877
877
 
878
878
  "use strict";
879
- 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};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Entity_1 = __webpack_require__(/*! ../../Core/Entity */ \"./dist/Core/Entity.js\");\nvar Routes = {\n GET: '/delivery_blocks',\n CREATE: '/delivery_blocks',\n UPDATE: '/delivery_blocks/{:id}',\n DELETE: '/delivery_blocks/{:id}',\n GET_BY_DRIVER_ID: '/delivery_blocks/users/{:id}'\n};\nvar DeliveryBlocksEntity = /** @class */ (function (_super) {\n __extends(DeliveryBlocksEntity, _super);\n function DeliveryBlocksEntity(session) {\n return _super.call(this, { session: session, entityName: 'delivery_blocks', routes: [] }) || this;\n }\n DeliveryBlocksEntity.prototype.get = function (teamId, startTime, endTime) {\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(Routes.GET)\n .withQueryString({ team_id: teamId, start_time: startTime, end_time: endTime })\n .setException(\"Could not fetch delivery block for team #\" + teamId)\n .withExtractor(function (result) { return result.delivery_blocks; })\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n DeliveryBlocksEntity.prototype.create = 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.service.routeGenerator\n .post(Routes.CREATE)\n .withPayload(options)\n .withExtractor(function (result) { return result.delivery_block; })\n .setException(\"Could not create delivery block for team #\" + options.team_id)\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n DeliveryBlocksEntity.prototype.update = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var id, payload;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n id = options.id, payload = __rest(options, [\"id\"]);\n return [4 /*yield*/, this.service.routeGenerator\n .put(Routes.UPDATE)\n .withExtractor(function (result) { return result.delivery_block; })\n .setException(\"Could not update delivery block for team #\" + options.team_id)\n .withRouteParams({ id: id })\n .withPayload(payload)\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n DeliveryBlocksEntity.prototype.delete = function (id, recurring) {\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 .delete(Routes.DELETE)\n .withExtractor(function (result) { return result.success; })\n .setException(\"Could not delete delivery block with id #\" + id)\n .withRouteParams({ id: id })\n .withQueryString({ recurring: recurring })\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n DeliveryBlocksEntity.prototype.getByDriverId = function (driverId, startTime, endTime) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get('/delivery_blocks/users/{:id}')\n .withExtractor(function (result) { return result.delivery_blocks; })\n .withRouteParams({ id: driverId })\n .setException(\"Could not fetch delivery block for user with id #\" + driverId)\n .withQueryString({ start_time: startTime, end_time: endTime })\n .invoke()];\n });\n });\n };\n return DeliveryBlocksEntity;\n}(Entity_1.default));\nexports.default = DeliveryBlocksEntity;\n//# sourceMappingURL=DeliveryBlocksEntity.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/DeliveryBlocks/Entity/DeliveryBlocksEntity.js?");
879
+ 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};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Entity_1 = __webpack_require__(/*! ../../Core/Entity */ \"./dist/Core/Entity.js\");\nvar Routes = {\n GET: '/delivery_blocks',\n CREATE: '/delivery_blocks',\n UPDATE: '/delivery_blocks/{:id}',\n DELETE: '/delivery_blocks/{:id}',\n GET_BY_DRIVER_ID: '/delivery_blocks/users/{:id}'\n};\nvar DeliveryBlocksEntity = /** @class */ (function (_super) {\n __extends(DeliveryBlocksEntity, _super);\n function DeliveryBlocksEntity(session) {\n return _super.call(this, { session: session, entityName: 'delivery_blocks', routes: [] }) || this;\n }\n DeliveryBlocksEntity.prototype.get = function (teamId, startTime, endTime, dateRangeType) {\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(Routes.GET)\n .withQueryString({\n team_id: teamId,\n start_time: startTime,\n end_time: endTime,\n date_range_type: dateRangeType\n })\n .setException(\"Could not fetch delivery block for team #\" + teamId)\n .withExtractor(function (result) { return result.delivery_blocks; })\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n DeliveryBlocksEntity.prototype.create = 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.service.routeGenerator\n .post(Routes.CREATE)\n .withPayload(options)\n .withExtractor(function (result) { return result.delivery_block; })\n .setException(\"Could not create delivery block for team #\" + options.team_id)\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n DeliveryBlocksEntity.prototype.update = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var id, payload;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n id = options.id, payload = __rest(options, [\"id\"]);\n return [4 /*yield*/, this.service.routeGenerator\n .put(Routes.UPDATE)\n .withExtractor(function (result) { return result.delivery_block; })\n .setException(\"Could not update delivery block for team #\" + options.team_id)\n .withRouteParams({ id: id })\n .withPayload(payload)\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n DeliveryBlocksEntity.prototype.delete = function (id, recurring) {\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 .delete(Routes.DELETE)\n .withExtractor(function (result) { return result.success; })\n .setException(\"Could not delete delivery block with id #\" + id)\n .withRouteParams({ id: id })\n .withQueryString({ recurring: recurring })\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n DeliveryBlocksEntity.prototype.getByDriverId = function (driverId, startTime, endTime) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get('/delivery_blocks/users/{:id}')\n .withExtractor(function (result) { return result.delivery_blocks; })\n .withRouteParams({ id: driverId })\n .setException(\"Could not fetch delivery block for user with id #\" + driverId)\n .withQueryString({ start_time: startTime, end_time: endTime })\n .invoke()];\n });\n });\n };\n return DeliveryBlocksEntity;\n}(Entity_1.default));\nexports.default = DeliveryBlocksEntity;\n//# sourceMappingURL=DeliveryBlocksEntity.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/DeliveryBlocks/Entity/DeliveryBlocksEntity.js?");
880
880
 
881
881
  /***/ }),
882
882
 
@@ -2189,7 +2189,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexport
2189
2189
  /***/ (function(module, exports, __webpack_require__) {
2190
2190
 
2191
2191
  "use strict";
2192
- 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.6.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 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, payload) {\n return new ResponseHandler(axiosInstance.delete(\"\" + host + uri, { params: queryString, data: payload }));\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, payload);\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?");
2192
+ 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.7.0';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) { }\n 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, payload) {\n return new ResponseHandler(axiosInstance.delete(\"\" + host + uri, { params: queryString, data: payload }));\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, payload);\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?");
2193
2193
 
2194
2194
  /***/ }),
2195
2195
 
@@ -2202,7 +2202,7 @@ eval("\nvar __assign = (this && this.__assign) || function () {\n __assign =
2202
2202
  /***/ (function(module, exports, __webpack_require__) {
2203
2203
 
2204
2204
  "use strict";
2205
- 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 });\nexports.SessionBasedService = exports.HTTP_EVENTS = void 0;\nvar ServiceRequest_1 = __webpack_require__(/*! ./ServiceRequest */ \"./dist/Services/ServiceRequest.js\");\nvar Enums_1 = __webpack_require__(/*! ../Core/Http/Enums */ \"./dist/Core/Http/Enums.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar ExceptionReason_1 = __webpack_require__(/*! ../Core/ExceptionReason */ \"./dist/Core/ExceptionReason.js\");\nexports.HTTP_EVENTS = {\n HTTP_REQUEST_FAILURE: 'http failure'\n};\nvar SessionBasedService = /** @class */ (function () {\n function SessionBasedService(endpoint, session) {\n this._endpoint = endpoint;\n this._session = session;\n }\n Object.defineProperty(SessionBasedService.prototype, \"sendDataEvent\", {\n get: function () {\n return this.session.sendDataEvent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SessionBasedService.prototype, \"endpoint\", {\n get: function () {\n return this._endpoint;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SessionBasedService.prototype, \"session\", {\n get: function () {\n return this._session;\n },\n enumerable: false,\n configurable: true\n });\n SessionBasedService.prototype.handleAuthorizedRequest = function (route, extractor, exceptionProducer, payload, routeParams, queryString, headers) {\n if (payload === void 0) { payload = {}; }\n if (routeParams === void 0) { routeParams = {}; }\n if (queryString === void 0) { queryString = {}; }\n if (headers === void 0) { headers = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var statusCode, response, responseAsDefault, bringgException;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, new ServiceRequest_1.AuthorizedServiceRequest(this.session.clientId, this.session.user.authentication_token)\n .invoke(this.endpoint, route, routeParams, queryString, payload, headers)\n .handle(function (response) {\n var data = response.data, status = response.status;\n statusCode = status;\n if (status != Enums_1.HttpStatusCode.OK &&\n status != Enums_1.HttpStatusCode.CREATED &&\n status != Enums_1.HttpStatusCode.NO_CONTENT) {\n _this.notifyHttpError(new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.fromHttpStatusCode(status), Enums_1.HttpStatusCode.getStatusText(status), null, {\n request: {\n route: route,\n payload: payload,\n routeParams: routeParams,\n queryString: queryString,\n headers: headers,\n clientId: _this.session.clientId,\n authenticationToken: _this.session.user.authentication_token\n },\n response: response\n }));\n ServiceRequest_1.logErrorResponse(response);\n throw lodash_1.isFunction(exceptionProducer) ? exceptionProducer() : response;\n }\n return data;\n })];\n case 1:\n response = _a.sent();\n responseAsDefault = response;\n if (responseAsDefault.success === false) {\n bringgException = exceptionProducer();\n bringgException.details = responseAsDefault.message;\n bringgException.rc = responseAsDefault.rc;\n bringgException.statusCode = statusCode;\n throw bringgException;\n }\n return [2 /*return*/, extractor(response)];\n }\n });\n });\n };\n SessionBasedService.prototype.notifyHttpError = function (error) {\n this.sendDataEvent(exports.HTTP_EVENTS.HTTP_REQUEST_FAILURE, error);\n };\n return SessionBasedService;\n}());\nexports.SessionBasedService = SessionBasedService;\n//# sourceMappingURL=SessionBasedService.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/SessionBasedService.js?");
2205
+ 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 });\nexports.SessionBasedService = exports.HTTP_EVENTS = void 0;\nvar ServiceRequest_1 = __webpack_require__(/*! ./ServiceRequest */ \"./dist/Services/ServiceRequest.js\");\nvar Enums_1 = __webpack_require__(/*! ../Core/Http/Enums */ \"./dist/Core/Http/Enums.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar ExceptionReason_1 = __webpack_require__(/*! ../Core/ExceptionReason */ \"./dist/Core/ExceptionReason.js\");\nvar responseMessageToString_1 = __webpack_require__(/*! ../utils/responseMessageToString */ \"./dist/utils/responseMessageToString.js\");\nexports.HTTP_EVENTS = {\n HTTP_REQUEST_FAILURE: 'http failure'\n};\nvar SessionBasedService = /** @class */ (function () {\n function SessionBasedService(endpoint, session) {\n this._endpoint = endpoint;\n this._session = session;\n }\n Object.defineProperty(SessionBasedService.prototype, \"sendDataEvent\", {\n get: function () {\n return this.session.sendDataEvent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SessionBasedService.prototype, \"endpoint\", {\n get: function () {\n return this._endpoint;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SessionBasedService.prototype, \"session\", {\n get: function () {\n return this._session;\n },\n enumerable: false,\n configurable: true\n });\n SessionBasedService.prototype.handleAuthorizedRequest = function (route, extractor, exceptionProducer, payload, routeParams, queryString, headers) {\n if (payload === void 0) { payload = {}; }\n if (routeParams === void 0) { routeParams = {}; }\n if (queryString === void 0) { queryString = {}; }\n if (headers === void 0) { headers = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var statusCode, response, responseAsDefault, bringgException;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, new ServiceRequest_1.AuthorizedServiceRequest(this.session.clientId, this.session.user.authentication_token)\n .invoke(this.endpoint, route, routeParams, queryString, payload, headers)\n .handle(function (response) {\n var data = response.data, status = response.status;\n statusCode = status;\n if (status != Enums_1.HttpStatusCode.OK &&\n status != Enums_1.HttpStatusCode.CREATED &&\n status != Enums_1.HttpStatusCode.NO_CONTENT) {\n _this.notifyHttpError(new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.fromHttpStatusCode(status), Enums_1.HttpStatusCode.getStatusText(status), null, {\n request: {\n route: route,\n payload: payload,\n routeParams: routeParams,\n queryString: queryString,\n headers: headers,\n clientId: _this.session.clientId,\n authenticationToken: _this.session.user.authentication_token\n },\n response: response\n }));\n ServiceRequest_1.logErrorResponse(response);\n throw lodash_1.isFunction(exceptionProducer) ? exceptionProducer() : response;\n }\n return data;\n })];\n case 1:\n response = _a.sent();\n responseAsDefault = response;\n if (responseAsDefault.success === false) {\n bringgException = exceptionProducer();\n bringgException.details = responseMessageToString_1.responseMessageToString(responseAsDefault.message);\n bringgException.rc = responseAsDefault.rc;\n bringgException.statusCode = statusCode;\n throw bringgException;\n }\n return [2 /*return*/, extractor(response)];\n }\n });\n });\n };\n SessionBasedService.prototype.notifyHttpError = function (error) {\n this.sendDataEvent(exports.HTTP_EVENTS.HTTP_REQUEST_FAILURE, error);\n };\n return SessionBasedService;\n}());\nexports.SessionBasedService = SessionBasedService;\n//# sourceMappingURL=SessionBasedService.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/SessionBasedService.js?");
2206
2206
 
2207
2207
  /***/ }),
2208
2208
 
@@ -2908,6 +2908,19 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfuncti
2908
2908
 
2909
2909
  /***/ }),
2910
2910
 
2911
+ /***/ "./dist/utils/responseMessageToString.js":
2912
+ /*!***********************************************!*\
2913
+ !*** ./dist/utils/responseMessageToString.js ***!
2914
+ \***********************************************/
2915
+ /*! no static exports found */
2916
+ /*! all exports used */
2917
+ /***/ (function(module, exports, __webpack_require__) {
2918
+
2919
+ "use strict";
2920
+ eval("\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.responseMessageToString = void 0;\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction responseMessageToString(message) {\n if (typeof message === 'object' && !lodash_1.isNil(message)) {\n return Object.entries(message).reduce(function (str, _a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n return [str, key + \" \" + value].filter(function (el) { return el; }).join(', ');\n }, '');\n }\n return message;\n}\nexports.responseMessageToString = responseMessageToString;\n//# sourceMappingURL=responseMessageToString.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/utils/responseMessageToString.js?");
2921
+
2922
+ /***/ }),
2923
+
2911
2924
  /***/ "./node_modules/@bringg/types/index.js":
2912
2925
  /*!*********************************************!*\
2913
2926
  !*** ./node_modules/@bringg/types/index.js ***!