@bringg/dashboard-sdk 0.6.4 → 0.7.1

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.
@@ -226,7 +226,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
226
226
  /***/ (function(module, exports, __webpack_require__) {
227
227
 
228
228
  "use strict";
229
- eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) 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 StoreEntity_1 = __webpack_require__(/*! ../../Core/StoreEntity */ \"./dist/Core/StoreEntity.js\");\nvar uuid_1 = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/esm-browser/index.js\");\nvar _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar pDefer = __webpack_require__(/*! p-defer */ \"./node_modules/p-defer/index.js\");\nvar entityName = 'application_action';\nvar ApplicationEntity = /** @class */ (function (_super) {\n __extends(ApplicationEntity, _super);\n function ApplicationEntity(session) {\n var _this = _super.call(this, {\n session: session,\n entityName: entityName\n }) || this;\n _this.inFlightActions = new Map();\n _this.realTime.on('application action process done', _this.handleApplicationActionResult);\n return _this;\n }\n ApplicationEntity.prototype.generateActionUuid = function () {\n return uuid_1.v4();\n };\n ApplicationEntity.prototype.executeAction = function (actionName, data, options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var actionUuid, deferred;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n actionUuid = this.generateActionUuid();\n _.defaults(options, { timeout: 10000 });\n _a.label = 1;\n case 1:\n _a.trys.push([1, , 4, 5]);\n deferred = pDefer();\n this.inFlightActions.set(actionUuid, deferred);\n return [4 /*yield*/, this.createApplicationAction({\n action_name: actionName,\n data: __assign(__assign({}, data), { deadline: Date.now() + options.timeout }),\n uuid: actionUuid\n })];\n case 2:\n _a.sent();\n return [4 /*yield*/, Promise.race([deferred.promise, this.asyncTimeout(options.timeout)])];\n case 3: return [2 /*return*/, _a.sent()];\n case 4:\n this.inFlightActions.delete(actionUuid);\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n ApplicationEntity.prototype.createApplicationAction = function (data) {\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(\"/\" + entityName + \"/create\")\n .withExtractor(function (res) { return res.uuid; })\n .setException('could not execute action')\n .withPayload(data)\n .invoke()];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n ApplicationEntity.prototype.handleApplicationActionResult = function (result) {\n var defered = this.inFlightActions.get(result.uuid);\n if (_.isNil(defered)) {\n return;\n }\n if (result.success) {\n defered.resolve(result.data);\n }\n else {\n defered.reject(new Error(result.error));\n }\n };\n ApplicationEntity.prototype.asyncTimeout = function (milliseconds) {\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*/, new Promise(function (resolve) { return setTimeout(resolve, milliseconds); })];\n case 1:\n _a.sent();\n throw new Error('timeout');\n }\n });\n });\n };\n return ApplicationEntity;\n}(StoreEntity_1.default));\nexports.default = ApplicationEntity;\n//# sourceMappingURL=ApplicationEntity.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Application/Entity/ApplicationEntity.js?");
229
+ eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) 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 StoreEntity_1 = __webpack_require__(/*! ../../Core/StoreEntity */ \"./dist/Core/StoreEntity.js\");\nvar uuid_1 = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/esm-browser/index.js\");\nvar _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar pDefer = __webpack_require__(/*! p-defer */ \"./node_modules/p-defer/index.js\");\nvar entityName = 'application_action';\nvar ApplicationEntity = /** @class */ (function (_super) {\n __extends(ApplicationEntity, _super);\n function ApplicationEntity(session) {\n var _this = _super.call(this, {\n session: session,\n entityName: entityName\n }) || this;\n _this.inFlightActions = new Map();\n _this.realTime.on('application action process done', _this.handleApplicationActionResult.bind(_this));\n return _this;\n }\n ApplicationEntity.prototype.generateActionUuid = function () {\n return uuid_1.v4();\n };\n ApplicationEntity.prototype.executeAction = function (actionName, data, options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var actionUuid, deferred;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n actionUuid = this.generateActionUuid();\n _.defaults(options, { timeout: 10000 });\n _a.label = 1;\n case 1:\n _a.trys.push([1, , 4, 5]);\n deferred = pDefer();\n this.inFlightActions.set(actionUuid, deferred);\n return [4 /*yield*/, this.createApplicationAction({\n action_name: actionName,\n data: __assign(__assign({}, data), { deadline: Date.now() + options.timeout }),\n uuid: actionUuid\n })];\n case 2:\n _a.sent();\n return [4 /*yield*/, Promise.race([deferred.promise, this.asyncTimeout(options.timeout)])];\n case 3: return [2 /*return*/, _a.sent()];\n case 4:\n this.inFlightActions.delete(actionUuid);\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n ApplicationEntity.prototype.createApplicationAction = function (data) {\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(\"/\" + entityName + \"/create\")\n .withExtractor(function (res) { return res.uuid; })\n .setException('could not execute action')\n .withPayload(data)\n .invoke()];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n ApplicationEntity.prototype.handleApplicationActionResult = function (result) {\n var defered = this.inFlightActions.get(result.response_uuid);\n if (_.isNil(defered)) {\n return;\n }\n if (result.success) {\n defered.resolve(result.data);\n }\n else {\n defered.reject(new Error(result.error));\n }\n };\n ApplicationEntity.prototype.asyncTimeout = function (milliseconds) {\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*/, new Promise(function (resolve) { return setTimeout(resolve, milliseconds); })];\n case 1:\n _a.sent();\n throw new Error('timeout');\n }\n });\n });\n };\n return ApplicationEntity;\n}(StoreEntity_1.default));\nexports.default = ApplicationEntity;\n//# sourceMappingURL=ApplicationEntity.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Application/Entity/ApplicationEntity.js?");
230
230
 
231
231
  /***/ }),
232
232
 
@@ -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.4';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) { }\n 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.1';\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