@bringg/dashboard-sdk 4.0.4 → 4.0.5

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.
@@ -1461,7 +1461,7 @@ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, targ
1461
1461
  /***/ (function(module, exports, __webpack_require__) {
1462
1462
 
1463
1463
  "use strict";
1464
- eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Entity_1 = __webpack_require__(/*! ../../Core/Entity */ \"./dist/Core/Entity.js\");\nvar BaseRoute = '/merchant/merchant_configuration';\nvar Routes = {\n RESET_DELIVERY_PIN: \"\".concat(BaseRoute, \"/delivery_pin_reset\"),\n RESET_DESTINATION_PIN: \"\".concat(BaseRoute, \"/destination_pin_reset\"),\n GET_CSV_FIELDS: \"\".concat(BaseRoute, \"/csv_upload_fields\"),\n SET_CSV_FIELDS: \"\".concat(BaseRoute, \"/csv_upload_fields\"),\n GET_USER_CSV_FIELDS: \"\".concat(BaseRoute, \"/user_csv_upload_fields\"),\n SET_USER_CSV_FIELDS: \"\".concat(BaseRoute, \"/user_csv_upload_fields\"),\n DELIVERY_PIN_CHANGE: \"\".concat(BaseRoute, \"/delivery_pin_change\"),\n RESET_EMAIL_LOGO: \"\".concat(BaseRoute, \"/email_logo_reset\"),\n UPLOAD_LOGO: \"\".concat(BaseRoute, \"/logo\"),\n RESET_CLIENT_APP_LOGO: \"\".concat(BaseRoute, \"/client_app_logo_reset\"),\n GET_RATING_REASON_CONFIGURATION: \"\".concat(BaseRoute, \"/rating_reasons\"),\n SET_RATING_REASON_CONFIGURATION: \"\".concat(BaseRoute, \"/rating_reasons\"),\n REQUEST_BETA_PROGRAM: \"\".concat(BaseRoute, \"/request_beta_program\"),\n GET_TIP_DRIVER_CONFIGURATION: \"\".concat(BaseRoute, \"/tip_driver\"),\n SET_TIP_DRIVER_CONFIGURATION: \"\".concat(BaseRoute, \"/tip_driver\"),\n NOTIFY_CUSTOMERS: \"\".concat(BaseRoute, \"/notify_customers\"),\n GET_PUBLIC_TASK_FORM: \"\".concat(BaseRoute, \"/public_task_form\"),\n SET_PUBLIC_TASK_FORM: \"\".concat(BaseRoute, \"/public_task_form\"),\n RESET_PUBLIC_TASK_FORM_LOGO: \"\".concat(BaseRoute, \"/reset_public_task_form_logo\"),\n GET_MOBILE_TASK_FORM: \"\".concat(BaseRoute, \"/mobile_task_form\"),\n SET_MOBILE_TASK_FORM: \"\".concat(BaseRoute, \"/mobile_task_form\"),\n UPDATE_DASHBOARD_UI_CONFIGURATION_ON_USER_LEVEL: '/dashboard_ui_configuration',\n UPDATE_DASHBOARD_UI_CONFIGURATION_ON_MERCHANT_LEVEL: '/dashboard_ui_configuration/merchant_level'\n};\nvar MerchantConfigurationEntity = /** @class */ (function (_super) {\n __extends(MerchantConfigurationEntity, _super);\n function MerchantConfigurationEntity(session) {\n return _super.call(this, {\n session: session,\n entityName: 'merchant',\n routeSuffix: 'merchant_configuration',\n routes: []\n }) || this;\n }\n MerchantConfigurationEntity.prototype.updateMerchantConfigurationField = function (field, value) {\n var _a;\n this.service.session.update('merchantConfiguration', (_a = {}, _a[field] = value, _a));\n };\n MerchantConfigurationEntity.prototype.updateMerchantConfiguration = function (merchantConfiguration) {\n this.service.session.update('merchantConfiguration', merchantConfiguration);\n };\n MerchantConfigurationEntity.prototype.urlRequest = function (_a) {\n var route = _a.route, errorMessage = _a.errorMessage, fieldToUpdate = _a.fieldToUpdate, payload = _a.payload;\n return __awaiter(this, void 0, void 0, function () {\n var request, response;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n request = this.service.routeGenerator\n .post(route)\n .withExtractor(function (response) { return response.url; })\n .setException(errorMessage);\n if (payload) {\n request.withPayload(payload);\n }\n return [4 /*yield*/, request.invoke()];\n case 1:\n response = _b.sent();\n if (fieldToUpdate) {\n this.updateMerchantConfigurationField(fieldToUpdate, response);\n }\n return [2 /*return*/, response];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetDeliveryPin = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.urlRequest({\n route: Routes.RESET_DELIVERY_PIN,\n fieldToUpdate: 'delivery_pin',\n errorMessage: 'could not reset delivery pin'\n })];\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetDestinationPin = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.urlRequest({\n route: Routes.RESET_DESTINATION_PIN,\n fieldToUpdate: 'destination_pin',\n errorMessage: 'could not reset destination pin'\n })];\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetEmailLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.urlRequest({\n route: Routes.RESET_EMAIL_LOGO,\n fieldToUpdate: 'email_logo',\n errorMessage: 'could not reset email logo'\n })];\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetClientAppLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.urlRequest({\n route: Routes.RESET_CLIENT_APP_LOGO,\n fieldToUpdate: 'logo',\n errorMessage: 'could not reset client app logo'\n })];\n });\n });\n };\n MerchantConfigurationEntity.prototype.uploadLogo = function (imageFile) {\n return __awaiter(this, void 0, void 0, function () {\n var formData;\n return __generator(this, function (_a) {\n formData = new FormData();\n formData.append('file', imageFile);\n return [2 /*return*/, this.service.routeGenerator\n .post(Routes.UPLOAD_LOGO)\n .withHeaders({ 'Content-Type': 'multipart/form-data' })\n .withPayload(formData)\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.get = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this.service.session.merchantConfiguration) {\n return [2 /*return*/, this.service.session.merchantConfiguration];\n }\n return [4 /*yield*/, this.fetchConfiguration()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.fetchConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.service.session;\n return [4 /*yield*/, this.service.routeGenerator\n .get(\"\".concat(BaseRoute, \"/\"))\n .withExtractor(function (response) { return response; })\n .setException('could not fetch merchant_configuration')\n .invoke()];\n case 1:\n _a.merchantConfiguration = _b.sent();\n return [2 /*return*/, this.service.session.merchantConfiguration];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.update = function (diff) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.service.routeGenerator\n .put(\"\".concat(BaseRoute, \"/\"))\n .withExtractor(function (response) { return response.merchant_configuration; })\n .setException('failed updating merchant_configuration')\n .withPayload(diff)\n .invoke()];\n case 1:\n response = _a.sent();\n this.updateMerchantConfiguration(response);\n return [2 /*return*/, response];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.getCsvFields = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_CSV_FIELDS)\n .withExtractor(function (response) { return response.csv_upload_fields; })\n .setException('could not fetch csv fields configuration')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setCsvFields = function (csvFields) {\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.SET_CSV_FIELDS)\n .setException('could not set csv fields configuration')\n .withPayload({ csv_fields: csvFields })\n .invoke()];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getCsvFields()];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.getUserCsvFields = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_USER_CSV_FIELDS)\n .withExtractor(function (response) { return response.csv_upload_fields; })\n .setException('could not fetch user csv fields configuration')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setUserCsvFields = function (csvFields) {\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.SET_USER_CSV_FIELDS)\n .setException('could not set user csv fields configuration')\n .withPayload({ csv_fields: csvFields })\n .invoke()];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getUserCsvFields()];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.deliveryPinChange = function (alternativePin) {\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.urlRequest({\n route: Routes.DELIVERY_PIN_CHANGE,\n fieldToUpdate: 'delivery_pin',\n errorMessage: \"failed updating delivery pin: \".concat(alternativePin),\n payload: { alternate_delivery_pin: alternativePin }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.dashboardTableConfigurationUpdate = function (table_configuration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .put(Routes.UPDATE_DASHBOARD_UI_CONFIGURATION_ON_USER_LEVEL)\n .withPayload({ dashboard_ui_configuration: { table_configuration: table_configuration } })\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setDashboardUiConfigurationOnMerchantLevel = function (dashboardUiConfiguration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .put(Routes.UPDATE_DASHBOARD_UI_CONFIGURATION_ON_MERCHANT_LEVEL)\n .withPayload({ dashboard_ui_configuration: dashboardUiConfiguration })\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetPublicTaskFormLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.urlRequest({\n route: Routes.RESET_PUBLIC_TASK_FORM_LOGO,\n errorMessage: 'could not reset public task logo'\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.getRatingReasonConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.service.routeGenerator\n .get(Routes.GET_RATING_REASON_CONFIGURATION)\n .withExtractor(function (response) { return response.rating_reason_config; })\n .setException('could not fetch rating reason configuration')\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.setRatingReasonConfiguration = function (ratingReasonConfig) {\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.SET_RATING_REASON_CONFIGURATION)\n .setException('could not set merchant_configuration rating reason')\n .withPayload({ rating_reason_config: ratingReasonConfig })\n .invoke()];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getRatingReasonConfiguration()];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.requestBetaProgram = function (featureName) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .post(Routes.REQUEST_BETA_PROGRAM)\n .setException('could not set beta program')\n .withPayload({ feature_name: featureName })\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.getTipDriverConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_TIP_DRIVER_CONFIGURATION)\n .withExtractor(function (response) { return response.configuration; })\n .setException('could not get driver tip configuration')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setTipDriverConfiguration = function (configuration) {\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.SET_TIP_DRIVER_CONFIGURATION)\n .withExtractor(function (response) { return response.message; })\n .setException('could not set driver tip configuration')\n .withPayload({ tip_driver_configuration: configuration })\n .invoke()];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getTipDriverConfiguration()];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.notifyCustomers = function (text, url, sendAll, customerIds) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .post(Routes.NOTIFY_CUSTOMERS)\n .setException(\"could not notify customers: \".concat(customerIds))\n .withPayload({\n notification_text: text,\n notification_url: url,\n send_all: sendAll,\n customer_ids: customerIds\n })\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.getPublicTaskForm = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_PUBLIC_TASK_FORM)\n .withExtractor(function (response) { return response.public_task_forms; })\n .setException('could not fetch public task form')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setPublicTaskForm = function (color, forms) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .post(Routes.SET_PUBLIC_TASK_FORM)\n .withExtractor(function (response) { return response.public_task_forms; })\n .setException('could not set public task form')\n .withPayload({\n configuration: {\n color: color,\n forms: forms\n }\n })\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.getMobileTaskForm = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_MOBILE_TASK_FORM)\n .withExtractor(function (response) { return response.mobile_task_form; })\n .setException('could not fetch mobile task form')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setMobileTaskForm = function (form) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .post(Routes.SET_MOBILE_TASK_FORM)\n .withExtractor(function (response) { return response.mobile_task_form; })\n .setException('could not set mobile task form')\n .withPayload({ mobile_task_form: form })\n .invoke()];\n });\n });\n };\n return MerchantConfigurationEntity;\n}(Entity_1.default));\nexports.default = MerchantConfigurationEntity;\n//# sourceMappingURL=MerchantConfigurationEntity.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/MerchantConfiguration/Entity/MerchantConfigurationEntity.js?");
1464
+ eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Entity_1 = __webpack_require__(/*! ../../Core/Entity */ \"./dist/Core/Entity.js\");\nvar BaseRoute = '/merchant/merchant_configuration';\nvar Routes = {\n RESET_DELIVERY_PIN: \"\".concat(BaseRoute, \"/delivery_pin_reset\"),\n RESET_DESTINATION_PIN: \"\".concat(BaseRoute, \"/destination_pin_reset\"),\n GET_CSV_FIELDS: \"\".concat(BaseRoute, \"/csv_upload_fields\"),\n SET_CSV_FIELDS: \"\".concat(BaseRoute, \"/csv_upload_fields\"),\n GET_USER_CSV_FIELDS: \"\".concat(BaseRoute, \"/user_csv_upload_fields\"),\n SET_USER_CSV_FIELDS: \"\".concat(BaseRoute, \"/user_csv_upload_fields\"),\n DELIVERY_PIN_CHANGE: \"\".concat(BaseRoute, \"/delivery_pin_change\"),\n RESET_EMAIL_LOGO: \"\".concat(BaseRoute, \"/email_logo_reset\"),\n UPLOAD_LOGO: \"\".concat(BaseRoute, \"/logo\"),\n RESET_CLIENT_APP_LOGO: \"\".concat(BaseRoute, \"/client_app_logo_reset\"),\n GET_RATING_REASON_CONFIGURATION: \"\".concat(BaseRoute, \"/rating_reasons\"),\n SET_RATING_REASON_CONFIGURATION: \"\".concat(BaseRoute, \"/rating_reasons\"),\n REQUEST_BETA_PROGRAM: \"\".concat(BaseRoute, \"/request_beta_program\"),\n GET_TIP_DRIVER_CONFIGURATION: \"\".concat(BaseRoute, \"/tip_driver\"),\n SET_TIP_DRIVER_CONFIGURATION: \"\".concat(BaseRoute, \"/tip_driver\"),\n GET_PUBLIC_TASK_FORM: \"\".concat(BaseRoute, \"/public_task_form\"),\n SET_PUBLIC_TASK_FORM: \"\".concat(BaseRoute, \"/public_task_form\"),\n RESET_PUBLIC_TASK_FORM_LOGO: \"\".concat(BaseRoute, \"/reset_public_task_form_logo\"),\n GET_MOBILE_TASK_FORM: \"\".concat(BaseRoute, \"/mobile_task_form\"),\n SET_MOBILE_TASK_FORM: \"\".concat(BaseRoute, \"/mobile_task_form\"),\n UPDATE_DASHBOARD_UI_CONFIGURATION_ON_USER_LEVEL: '/dashboard_ui_configuration',\n UPDATE_DASHBOARD_UI_CONFIGURATION_ON_MERCHANT_LEVEL: '/dashboard_ui_configuration/merchant_level'\n};\nvar MerchantConfigurationEntity = /** @class */ (function (_super) {\n __extends(MerchantConfigurationEntity, _super);\n function MerchantConfigurationEntity(session) {\n return _super.call(this, {\n session: session,\n entityName: 'merchant',\n routeSuffix: 'merchant_configuration',\n routes: []\n }) || this;\n }\n MerchantConfigurationEntity.prototype.updateMerchantConfigurationField = function (field, value) {\n var _a;\n this.service.session.update('merchantConfiguration', (_a = {}, _a[field] = value, _a));\n };\n MerchantConfigurationEntity.prototype.updateMerchantConfiguration = function (merchantConfiguration) {\n this.service.session.update('merchantConfiguration', merchantConfiguration);\n };\n MerchantConfigurationEntity.prototype.urlRequest = function (_a) {\n var route = _a.route, errorMessage = _a.errorMessage, fieldToUpdate = _a.fieldToUpdate, payload = _a.payload;\n return __awaiter(this, void 0, void 0, function () {\n var request, response;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n request = this.service.routeGenerator\n .post(route)\n .withExtractor(function (response) { return response.url; })\n .setException(errorMessage);\n if (payload) {\n request.withPayload(payload);\n }\n return [4 /*yield*/, request.invoke()];\n case 1:\n response = _b.sent();\n if (fieldToUpdate) {\n this.updateMerchantConfigurationField(fieldToUpdate, response);\n }\n return [2 /*return*/, response];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetDeliveryPin = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.urlRequest({\n route: Routes.RESET_DELIVERY_PIN,\n fieldToUpdate: 'delivery_pin',\n errorMessage: 'could not reset delivery pin'\n })];\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetDestinationPin = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.urlRequest({\n route: Routes.RESET_DESTINATION_PIN,\n fieldToUpdate: 'destination_pin',\n errorMessage: 'could not reset destination pin'\n })];\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetEmailLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.urlRequest({\n route: Routes.RESET_EMAIL_LOGO,\n fieldToUpdate: 'email_logo',\n errorMessage: 'could not reset email logo'\n })];\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetClientAppLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.urlRequest({\n route: Routes.RESET_CLIENT_APP_LOGO,\n fieldToUpdate: 'logo',\n errorMessage: 'could not reset client app logo'\n })];\n });\n });\n };\n MerchantConfigurationEntity.prototype.uploadLogo = function (imageFile) {\n return __awaiter(this, void 0, void 0, function () {\n var formData;\n return __generator(this, function (_a) {\n formData = new FormData();\n formData.append('file', imageFile);\n return [2 /*return*/, this.service.routeGenerator\n .post(Routes.UPLOAD_LOGO)\n .withHeaders({ 'Content-Type': 'multipart/form-data' })\n .withPayload(formData)\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.get = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this.service.session.merchantConfiguration) {\n return [2 /*return*/, this.service.session.merchantConfiguration];\n }\n return [4 /*yield*/, this.fetchConfiguration()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.fetchConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.service.session;\n return [4 /*yield*/, this.service.routeGenerator\n .get(\"\".concat(BaseRoute, \"/\"))\n .withExtractor(function (response) { return response; })\n .setException('could not fetch merchant_configuration')\n .invoke()];\n case 1:\n _a.merchantConfiguration = _b.sent();\n return [2 /*return*/, this.service.session.merchantConfiguration];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.update = function (diff) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.service.routeGenerator\n .put(\"\".concat(BaseRoute, \"/\"))\n .withExtractor(function (response) { return response.merchant_configuration; })\n .setException('failed updating merchant_configuration')\n .withPayload(diff)\n .invoke()];\n case 1:\n response = _a.sent();\n this.updateMerchantConfiguration(response);\n return [2 /*return*/, response];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.getCsvFields = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_CSV_FIELDS)\n .withExtractor(function (response) { return response.csv_upload_fields; })\n .setException('could not fetch csv fields configuration')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setCsvFields = function (csvFields) {\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.SET_CSV_FIELDS)\n .setException('could not set csv fields configuration')\n .withPayload({ csv_fields: csvFields })\n .invoke()];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getCsvFields()];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.getUserCsvFields = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_USER_CSV_FIELDS)\n .withExtractor(function (response) { return response.csv_upload_fields; })\n .setException('could not fetch user csv fields configuration')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setUserCsvFields = function (csvFields) {\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.SET_USER_CSV_FIELDS)\n .setException('could not set user csv fields configuration')\n .withPayload({ csv_fields: csvFields })\n .invoke()];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getUserCsvFields()];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.deliveryPinChange = function (alternativePin) {\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.urlRequest({\n route: Routes.DELIVERY_PIN_CHANGE,\n fieldToUpdate: 'delivery_pin',\n errorMessage: \"failed updating delivery pin: \".concat(alternativePin),\n payload: { alternate_delivery_pin: alternativePin }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.dashboardTableConfigurationUpdate = function (table_configuration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .put(Routes.UPDATE_DASHBOARD_UI_CONFIGURATION_ON_USER_LEVEL)\n .withPayload({ dashboard_ui_configuration: { table_configuration: table_configuration } })\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setDashboardUiConfigurationOnMerchantLevel = function (dashboardUiConfiguration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .put(Routes.UPDATE_DASHBOARD_UI_CONFIGURATION_ON_MERCHANT_LEVEL)\n .withPayload({ dashboard_ui_configuration: dashboardUiConfiguration })\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.resetPublicTaskFormLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.urlRequest({\n route: Routes.RESET_PUBLIC_TASK_FORM_LOGO,\n errorMessage: 'could not reset public task logo'\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.getRatingReasonConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.service.routeGenerator\n .get(Routes.GET_RATING_REASON_CONFIGURATION)\n .withExtractor(function (response) { return response.rating_reason_config; })\n .setException('could not fetch rating reason configuration')\n .invoke()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.setRatingReasonConfiguration = function (ratingReasonConfig) {\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.SET_RATING_REASON_CONFIGURATION)\n .setException('could not set merchant_configuration rating reason')\n .withPayload({ rating_reason_config: ratingReasonConfig })\n .invoke()];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getRatingReasonConfiguration()];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.requestBetaProgram = function (featureName) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .post(Routes.REQUEST_BETA_PROGRAM)\n .setException('could not set beta program')\n .withPayload({ feature_name: featureName })\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.getTipDriverConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_TIP_DRIVER_CONFIGURATION)\n .withExtractor(function (response) { return response.configuration; })\n .setException('could not get driver tip configuration')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setTipDriverConfiguration = function (configuration) {\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.SET_TIP_DRIVER_CONFIGURATION)\n .withExtractor(function (response) { return response.message; })\n .setException('could not set driver tip configuration')\n .withPayload({ tip_driver_configuration: configuration })\n .invoke()];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getTipDriverConfiguration()];\n case 2: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MerchantConfigurationEntity.prototype.getPublicTaskForm = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_PUBLIC_TASK_FORM)\n .withExtractor(function (response) { return response.public_task_forms; })\n .setException('could not fetch public task form')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setPublicTaskForm = function (color, forms) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .post(Routes.SET_PUBLIC_TASK_FORM)\n .withExtractor(function (response) { return response.public_task_forms; })\n .setException('could not set public task form')\n .withPayload({\n configuration: {\n color: color,\n forms: forms\n }\n })\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.getMobileTaskForm = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(Routes.GET_MOBILE_TASK_FORM)\n .withExtractor(function (response) { return response.mobile_task_form; })\n .setException('could not fetch mobile task form')\n .invoke()];\n });\n });\n };\n MerchantConfigurationEntity.prototype.setMobileTaskForm = function (form) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .post(Routes.SET_MOBILE_TASK_FORM)\n .withExtractor(function (response) { return response.mobile_task_form; })\n .setException('could not set mobile task form')\n .withPayload({ mobile_task_form: form })\n .invoke()];\n });\n });\n };\n return MerchantConfigurationEntity;\n}(Entity_1.default));\nexports.default = MerchantConfigurationEntity;\n//# sourceMappingURL=MerchantConfigurationEntity.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/MerchantConfiguration/Entity/MerchantConfigurationEntity.js?");
1465
1465
 
1466
1466
  /***/ }),
1467
1467
 
@@ -1487,7 +1487,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexport
1487
1487
  /***/ (function(module, exports, __webpack_require__) {
1488
1488
 
1489
1489
  "use strict";
1490
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MerchantConfigurationApi = void 0;\nvar MerchantConfigurationEntity_1 = __webpack_require__(/*! ./Entity/MerchantConfigurationEntity */ \"./dist/MerchantConfiguration/Entity/MerchantConfigurationEntity.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar MerchantConfiguration_consts_1 = __webpack_require__(/*! ./MerchantConfiguration.consts */ \"./dist/MerchantConfiguration/MerchantConfiguration.consts.js\");\nvar MerchantConfigurationApi = /** @class */ (function () {\n function MerchantConfigurationApi(session) {\n this.entity = new MerchantConfigurationEntity_1.default(session);\n }\n MerchantConfigurationApi.prototype.get = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.get()];\n });\n });\n };\n MerchantConfigurationApi.prototype.fetchConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.fetchConfiguration()];\n });\n });\n };\n MerchantConfigurationApi.prototype.update = function (diff) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.update((0, lodash_1.pick)(diff, MerchantConfiguration_consts_1.MerchantConfigurationKeys))];\n });\n });\n };\n MerchantConfigurationApi.prototype.uploadLogo = function (imageFile) {\n return this.entity.uploadLogo(imageFile);\n };\n MerchantConfigurationApi.prototype.resetDeliveryPin = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetDeliveryPin()];\n });\n });\n };\n MerchantConfigurationApi.prototype.resetDestinationPin = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetDestinationPin()];\n });\n });\n };\n MerchantConfigurationApi.prototype.getCsvFields = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getCsvFields()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setCsvFields = function (csvFields) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setCsvFields(csvFields)];\n });\n });\n };\n MerchantConfigurationApi.prototype.getUserCsvFields = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getUserCsvFields()];\n });\n });\n };\n MerchantConfigurationApi.prototype.dashboardTableConfigurationUpdate = function (table_configuration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.dashboardTableConfigurationUpdate(table_configuration)];\n });\n });\n };\n MerchantConfigurationApi.prototype.setDashboardUiConfigurationOnMerchantLevel = function (dashboardUiConfiguration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setDashboardUiConfigurationOnMerchantLevel(dashboardUiConfiguration)];\n });\n });\n };\n MerchantConfigurationApi.prototype.setUserCsvFields = function (csvFields) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setUserCsvFields(csvFields)];\n });\n });\n };\n MerchantConfigurationApi.prototype.deliveryPinChange = function (alternativePin) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.deliveryPinChange(alternativePin)];\n });\n });\n };\n MerchantConfigurationApi.prototype.resetEmailLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetEmailLogo()];\n });\n });\n };\n MerchantConfigurationApi.prototype.resetClientAppLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetClientAppLogo()];\n });\n });\n };\n MerchantConfigurationApi.prototype.resetPublicTaskFormLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetPublicTaskFormLogo()];\n });\n });\n };\n MerchantConfigurationApi.prototype.getRatingReasonConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getRatingReasonConfiguration()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setRatingReasonConfiguration = function (ratingReasonConfig) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setRatingReasonConfiguration(ratingReasonConfig)];\n });\n });\n };\n MerchantConfigurationApi.prototype.requestBetaProgram = function (featureName) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.requestBetaProgram(featureName)];\n });\n });\n };\n MerchantConfigurationApi.prototype.getTipDriverConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getTipDriverConfiguration()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setTipDriverConfiguration = function (configuration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setTipDriverConfiguration(configuration)];\n });\n });\n };\n MerchantConfigurationApi.prototype.notifyCustomers = function (text, url, sendAll, customerIds) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.notifyCustomers(text, url, sendAll, customerIds)];\n });\n });\n };\n MerchantConfigurationApi.prototype.getPublicTaskForm = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getPublicTaskForm()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setPublicTaskForm = function (color, forms) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setPublicTaskForm(color, forms)];\n });\n });\n };\n MerchantConfigurationApi.prototype.getMobileTaskForm = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getMobileTaskForm()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setMobileTaskForm = function (form) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setMobileTaskForm(form)];\n });\n });\n };\n return MerchantConfigurationApi;\n}());\nexports.MerchantConfigurationApi = MerchantConfigurationApi;\n//# sourceMappingURL=MerchantConfigurationApi.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/MerchantConfiguration/MerchantConfigurationApi.js?");
1490
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MerchantConfigurationApi = void 0;\nvar MerchantConfigurationEntity_1 = __webpack_require__(/*! ./Entity/MerchantConfigurationEntity */ \"./dist/MerchantConfiguration/Entity/MerchantConfigurationEntity.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar MerchantConfiguration_consts_1 = __webpack_require__(/*! ./MerchantConfiguration.consts */ \"./dist/MerchantConfiguration/MerchantConfiguration.consts.js\");\nvar MerchantConfigurationApi = /** @class */ (function () {\n function MerchantConfigurationApi(session) {\n this.entity = new MerchantConfigurationEntity_1.default(session);\n }\n MerchantConfigurationApi.prototype.get = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.get()];\n });\n });\n };\n MerchantConfigurationApi.prototype.fetchConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.fetchConfiguration()];\n });\n });\n };\n MerchantConfigurationApi.prototype.update = function (diff) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.update((0, lodash_1.pick)(diff, MerchantConfiguration_consts_1.MerchantConfigurationKeys))];\n });\n });\n };\n MerchantConfigurationApi.prototype.uploadLogo = function (imageFile) {\n return this.entity.uploadLogo(imageFile);\n };\n MerchantConfigurationApi.prototype.resetDeliveryPin = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetDeliveryPin()];\n });\n });\n };\n MerchantConfigurationApi.prototype.resetDestinationPin = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetDestinationPin()];\n });\n });\n };\n MerchantConfigurationApi.prototype.getCsvFields = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getCsvFields()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setCsvFields = function (csvFields) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setCsvFields(csvFields)];\n });\n });\n };\n MerchantConfigurationApi.prototype.getUserCsvFields = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getUserCsvFields()];\n });\n });\n };\n MerchantConfigurationApi.prototype.dashboardTableConfigurationUpdate = function (table_configuration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.dashboardTableConfigurationUpdate(table_configuration)];\n });\n });\n };\n MerchantConfigurationApi.prototype.setDashboardUiConfigurationOnMerchantLevel = function (dashboardUiConfiguration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setDashboardUiConfigurationOnMerchantLevel(dashboardUiConfiguration)];\n });\n });\n };\n MerchantConfigurationApi.prototype.setUserCsvFields = function (csvFields) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setUserCsvFields(csvFields)];\n });\n });\n };\n MerchantConfigurationApi.prototype.deliveryPinChange = function (alternativePin) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.deliveryPinChange(alternativePin)];\n });\n });\n };\n MerchantConfigurationApi.prototype.resetEmailLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetEmailLogo()];\n });\n });\n };\n MerchantConfigurationApi.prototype.resetClientAppLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetClientAppLogo()];\n });\n });\n };\n MerchantConfigurationApi.prototype.resetPublicTaskFormLogo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.resetPublicTaskFormLogo()];\n });\n });\n };\n MerchantConfigurationApi.prototype.getRatingReasonConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getRatingReasonConfiguration()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setRatingReasonConfiguration = function (ratingReasonConfig) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setRatingReasonConfiguration(ratingReasonConfig)];\n });\n });\n };\n MerchantConfigurationApi.prototype.requestBetaProgram = function (featureName) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.requestBetaProgram(featureName)];\n });\n });\n };\n MerchantConfigurationApi.prototype.getTipDriverConfiguration = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getTipDriverConfiguration()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setTipDriverConfiguration = function (configuration) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setTipDriverConfiguration(configuration)];\n });\n });\n };\n MerchantConfigurationApi.prototype.getPublicTaskForm = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getPublicTaskForm()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setPublicTaskForm = function (color, forms) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setPublicTaskForm(color, forms)];\n });\n });\n };\n MerchantConfigurationApi.prototype.getMobileTaskForm = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.getMobileTaskForm()];\n });\n });\n };\n MerchantConfigurationApi.prototype.setMobileTaskForm = function (form) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.entity.setMobileTaskForm(form)];\n });\n });\n };\n return MerchantConfigurationApi;\n}());\nexports.MerchantConfigurationApi = MerchantConfigurationApi;\n//# sourceMappingURL=MerchantConfigurationApi.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/MerchantConfiguration/MerchantConfigurationApi.js?");
1491
1491
 
1492
1492
  /***/ }),
1493
1493
 
@@ -2592,7 +2592,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexport
2592
2592
  /***/ (function(module, exports, __webpack_require__) {
2593
2593
 
2594
2594
  "use strict";
2595
- eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar 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 abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '4.0.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, responseType, signal) {\n // NiceToHave: move headers to HttpHeaders class\n this.headers = __assign(__assign({ 'Content-Type': 'application/json' }, headers), { 'sdk-version': version, Client: clientId });\n this.timeout = timeout;\n this.validateStatus = lodash_1.stubTrue;\n if (queryString) {\n this.params = queryString;\n }\n if (authenticationToken) {\n this.headers['Authorization'] = \"Token token=\".concat(authenticationToken);\n }\n if (responseType) {\n this.responseType = responseType;\n }\n if (signal) {\n this.signal = signal;\n }\n }\n RequestOptions.new = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.clientId, clientId = _c === void 0 ? 'Bringg Dashboard' : _c, _d = _b.timeout, timeout = _d === void 0 ? DEFAULT_TIMEOUT : _d, queryString = _b.queryString, authenticationToken = _b.authenticationToken, headers = _b.headers, responseType = _b.responseType, signal = _b.signal;\n return new RequestOptions(clientId, timeout || DEFAULT_TIMEOUT, queryString, authenticationToken, headers, responseType, signal);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response, signal) {\n this.axiosPromise = response;\n this.signal = signal;\n }\n ResponseHandler.prototype.handle = function (consumer) {\n return __awaiter(this, void 0, void 0, function () {\n var axiosResponse, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if ((0, lodash_1.isUndefined)(consumer)) {\n throw new Error('consumer must be defined');\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.axiosPromise];\n case 2:\n axiosResponse = _a.sent();\n return [2 /*return*/, consumer(axiosResponse)];\n case 3:\n e_1 = _a.sent();\n if (axios_1.default.isCancel(e_1)) {\n (0, abort_1.throwAbortError)(this.signal, 'Request Aborted');\n }\n if (e_1 instanceof BringgException_1.BringgException) {\n throw e_1;\n }\n return [2 /*return*/, consumer(e_1)];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n return ResponseHandler;\n}());\nexports.ResponseHandler = ResponseHandler;\nfunction get(axiosInstance, host, uri, queryString, signal) {\n return new ResponseHandler(axiosInstance.get(\"\".concat(host).concat(uri), { params: queryString, signal: signal }), signal);\n}\nfunction post(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.post(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction put(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.put(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction patch(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.patch(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction remove(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.delete(\"\".concat(host).concat(uri), { params: queryString, data: payload, signal: signal }), signal);\n}\nfunction routify(axiosInstance, endpoint, route, routeParams, queryString, payload, signal) {\n switch (route.httpMethod) {\n case 0 /* HttpMethod.GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, signal);\n case 1 /* HttpMethod.POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 2 /* HttpMethod.PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 3 /* HttpMethod.PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 4 /* HttpMethod.DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n }\n}\nfunction wrapWithInterceptors(axios) {\n axios.interceptors.request.use(function (req) {\n var method = req.method, url = req.url, params = req.params, headers = req.headers, data = req.data;\n try {\n Logger_1.default.debug('REQUEST:', method.toUpperCase(), url);\n }\n catch (e) { }\n 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, responseType, timeout, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers, responseType: responseType, timeout: timeout, signal: signal })));\n}\nfunction anonymousAxiosInstance(clientId, headers, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers, signal: signal })));\n}\nvar AuthorizedServiceRequest = /** @class */ (function () {\n function AuthorizedServiceRequest(clientId, authToken) {\n this.authToken = authToken;\n this.clientId = clientId;\n }\n AuthorizedServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, headers, responseType, timeout, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(axiosInstance(this.clientId, this.authToken, headers, responseType, timeout), endpoint, route, routeParams, queryString, payload, signal);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId, headers) {\n this.clientId = clientId;\n this.headers = headers;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(anonymousAxiosInstance(this.clientId, this.headers, signal), endpoint, route, routeParams, queryString, payload);\n };\n return AnonymousServiceRequest;\n}());\nexports.AnonymousServiceRequest = AnonymousServiceRequest;\n//# sourceMappingURL=ServiceRequest.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/ServiceRequest.js?");
2595
+ eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar 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 abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '4.0.5';\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, responseType, signal) {\n // NiceToHave: move headers to HttpHeaders class\n this.headers = __assign(__assign({ 'Content-Type': 'application/json' }, headers), { 'sdk-version': version, Client: clientId });\n this.timeout = timeout;\n this.validateStatus = lodash_1.stubTrue;\n if (queryString) {\n this.params = queryString;\n }\n if (authenticationToken) {\n this.headers['Authorization'] = \"Token token=\".concat(authenticationToken);\n }\n if (responseType) {\n this.responseType = responseType;\n }\n if (signal) {\n this.signal = signal;\n }\n }\n RequestOptions.new = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.clientId, clientId = _c === void 0 ? 'Bringg Dashboard' : _c, _d = _b.timeout, timeout = _d === void 0 ? DEFAULT_TIMEOUT : _d, queryString = _b.queryString, authenticationToken = _b.authenticationToken, headers = _b.headers, responseType = _b.responseType, signal = _b.signal;\n return new RequestOptions(clientId, timeout || DEFAULT_TIMEOUT, queryString, authenticationToken, headers, responseType, signal);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response, signal) {\n this.axiosPromise = response;\n this.signal = signal;\n }\n ResponseHandler.prototype.handle = function (consumer) {\n return __awaiter(this, void 0, void 0, function () {\n var axiosResponse, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if ((0, lodash_1.isUndefined)(consumer)) {\n throw new Error('consumer must be defined');\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.axiosPromise];\n case 2:\n axiosResponse = _a.sent();\n return [2 /*return*/, consumer(axiosResponse)];\n case 3:\n e_1 = _a.sent();\n if (axios_1.default.isCancel(e_1)) {\n (0, abort_1.throwAbortError)(this.signal, 'Request Aborted');\n }\n if (e_1 instanceof BringgException_1.BringgException) {\n throw e_1;\n }\n return [2 /*return*/, consumer(e_1)];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n return ResponseHandler;\n}());\nexports.ResponseHandler = ResponseHandler;\nfunction get(axiosInstance, host, uri, queryString, signal) {\n return new ResponseHandler(axiosInstance.get(\"\".concat(host).concat(uri), { params: queryString, signal: signal }), signal);\n}\nfunction post(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.post(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction put(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.put(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction patch(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.patch(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction remove(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.delete(\"\".concat(host).concat(uri), { params: queryString, data: payload, signal: signal }), signal);\n}\nfunction routify(axiosInstance, endpoint, route, routeParams, queryString, payload, signal) {\n switch (route.httpMethod) {\n case 0 /* HttpMethod.GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, signal);\n case 1 /* HttpMethod.POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 2 /* HttpMethod.PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 3 /* HttpMethod.PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 4 /* HttpMethod.DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n }\n}\nfunction wrapWithInterceptors(axios) {\n axios.interceptors.request.use(function (req) {\n var method = req.method, url = req.url, params = req.params, headers = req.headers, data = req.data;\n try {\n Logger_1.default.debug('REQUEST:', method.toUpperCase(), url);\n }\n catch (e) { }\n 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, responseType, timeout, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers, responseType: responseType, timeout: timeout, signal: signal })));\n}\nfunction anonymousAxiosInstance(clientId, headers, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers, signal: signal })));\n}\nvar AuthorizedServiceRequest = /** @class */ (function () {\n function AuthorizedServiceRequest(clientId, authToken) {\n this.authToken = authToken;\n this.clientId = clientId;\n }\n AuthorizedServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, headers, responseType, timeout, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(axiosInstance(this.clientId, this.authToken, headers, responseType, timeout), endpoint, route, routeParams, queryString, payload, signal);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId, headers) {\n this.clientId = clientId;\n this.headers = headers;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(anonymousAxiosInstance(this.clientId, this.headers, signal), endpoint, route, routeParams, queryString, payload);\n };\n return AnonymousServiceRequest;\n}());\nexports.AnonymousServiceRequest = AnonymousServiceRequest;\n//# sourceMappingURL=ServiceRequest.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/ServiceRequest.js?");
2596
2596
 
2597
2597
  /***/ }),
2598
2598