@bringg/dashboard-sdk 0.4.37 → 0.4.38

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.
@@ -1097,7 +1097,7 @@ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, targ
1097
1097
  /***/ (function(module, exports, __webpack_require__) {
1098
1098
 
1099
1099
  "use strict";
1100
- eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Entity_1 = __webpack_require__(/*! ../../Core/Entity */ \"./dist/Core/Entity.js\");\nvar BaseRoute = '/merchant/merchant_configuration';\nvar Routes = {\n RESET_DELIVERY_PIN: BaseRoute + \"/delivery_pin_reset\",\n RESET_DESTINATION_PIN: BaseRoute + \"/destination_pin_reset\",\n GET_CSV_FIELDS: BaseRoute + \"/csv_upload_fields\",\n SET_CSV_FIELDS: BaseRoute + \"/csv_upload_fields\",\n GET_USER_CSV_FIELDS: BaseRoute + \"/user_csv_upload_fields\",\n SET_USER_CSV_FIELDS: BaseRoute + \"/user_csv_upload_fields\",\n DELIVERY_PIN_CHANGE: BaseRoute + \"/delivery_pin_change\",\n RESET_EMAIL_LOGO: BaseRoute + \"/email_logo_reset\",\n UPLOAD_LOGO: BaseRoute + \"/logo\",\n RESET_CLIENT_APP_LOGO: BaseRoute + \"/client_app_logo_reset\",\n GET_RATING_REASON_CONFIGURATION: BaseRoute + \"/rating_reasons\",\n SET_RATING_REASON_CONFIGURATION: BaseRoute + \"/rating_reasons\",\n REQUEST_BETA_PROGRAM: BaseRoute + \"/request_beta_program\",\n GET_TIP_DRIVER_CONFIGURATION: BaseRoute + \"/tip_driver\",\n SET_TIP_DRIVER_CONFIGURATION: BaseRoute + \"/tip_driver\",\n NOTIFY_CUSTOMERS: BaseRoute + \"/notify_customers\",\n GET_PUBLIC_TASK_FORM: BaseRoute + \"/public_task_form\",\n SET_PUBLIC_TASK_FORM: BaseRoute + \"/public_task_form\",\n RESET_PUBLIC_TASK_FORM_LOGO: BaseRoute + \"/reset_public_task_form_logo\",\n GET_MOBILE_TASK_FORM: BaseRoute + \"/mobile_task_form\",\n SET_MOBILE_TASK_FORM: BaseRoute + \"/mobile_task_form\"\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(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(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: \" + alternativePin,\n payload: { alternate_delivery_pin: alternativePin }\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\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: \" + 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?");
1100
+ eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Entity_1 = __webpack_require__(/*! ../../Core/Entity */ \"./dist/Core/Entity.js\");\nvar BaseRoute = '/merchant/merchant_configuration';\nvar Routes = {\n RESET_DELIVERY_PIN: BaseRoute + \"/delivery_pin_reset\",\n RESET_DESTINATION_PIN: BaseRoute + \"/destination_pin_reset\",\n GET_CSV_FIELDS: BaseRoute + \"/csv_upload_fields\",\n SET_CSV_FIELDS: BaseRoute + \"/csv_upload_fields\",\n GET_USER_CSV_FIELDS: BaseRoute + \"/user_csv_upload_fields\",\n SET_USER_CSV_FIELDS: BaseRoute + \"/user_csv_upload_fields\",\n DELIVERY_PIN_CHANGE: BaseRoute + \"/delivery_pin_change\",\n RESET_EMAIL_LOGO: BaseRoute + \"/email_logo_reset\",\n UPLOAD_LOGO: BaseRoute + \"/logo\",\n RESET_CLIENT_APP_LOGO: BaseRoute + \"/client_app_logo_reset\",\n GET_RATING_REASON_CONFIGURATION: BaseRoute + \"/rating_reasons\",\n SET_RATING_REASON_CONFIGURATION: BaseRoute + \"/rating_reasons\",\n REQUEST_BETA_PROGRAM: BaseRoute + \"/request_beta_program\",\n GET_TIP_DRIVER_CONFIGURATION: BaseRoute + \"/tip_driver\",\n SET_TIP_DRIVER_CONFIGURATION: BaseRoute + \"/tip_driver\",\n NOTIFY_CUSTOMERS: BaseRoute + \"/notify_customers\",\n GET_PUBLIC_TASK_FORM: BaseRoute + \"/public_task_form\",\n SET_PUBLIC_TASK_FORM: BaseRoute + \"/public_task_form\",\n RESET_PUBLIC_TASK_FORM_LOGO: BaseRoute + \"/reset_public_task_form_logo\",\n GET_MOBILE_TASK_FORM: BaseRoute + \"/mobile_task_form\",\n SET_MOBILE_TASK_FORM: BaseRoute + \"/mobile_task_form\",\n UPDATE_TABLE_CONFIGURATION: \"/dashboard_ui_configuration\"\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(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(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: \" + 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_TABLE_CONFIGURATION)\n .withPayload({ dashboard_ui_configuration: { table_configuration: table_configuration } })\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: \" + 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?");
1101
1101
 
1102
1102
  /***/ }),
1103
1103
 
@@ -1123,7 +1123,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexport
1123
1123
  /***/ (function(module, exports, __webpack_require__) {
1124
1124
 
1125
1125
  "use strict";
1126
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.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(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.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?");
1126
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.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(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.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?");
1127
1127
 
1128
1128
  /***/ }),
1129
1129
 
@@ -1864,7 +1864,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexport
1864
1864
  /***/ (function(module, exports, __webpack_require__) {
1865
1865
 
1866
1866
  "use strict";
1867
- eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar Logger_1 = __webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar version = '0.4.37';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) { }\n try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) { }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) { }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, queryString, authenticationToken, headers) {\n // NiceToHave: move headers to HttpHeaders class\n this.headers = __assign(__assign({ 'Content-Type': 'application/json' }, headers), { 'sdk-version': version, Client: clientId });\n this.timeout = timeout;\n this.validateStatus = lodash_1.stubTrue;\n if (queryString) {\n this.params = queryString;\n }\n if (authenticationToken) {\n this.headers['Authorization'] = \"Token token=\" + authenticationToken;\n }\n }\n RequestOptions.new = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.clientId, clientId = _c === void 0 ? 'Bringg Dashboard' : _c, _d = _b.timeout, timeout = _d === void 0 ? DEFAULT_TIMEOUT : _d, _e = _b.queryString, queryString = _e === void 0 ? undefined : _e, _f = _b.authenticationToken, authenticationToken = _f === void 0 ? undefined : _f, _g = _b.headers, headers = _g === void 0 ? undefined : _g;\n return new RequestOptions(clientId, timeout, queryString, authenticationToken, headers);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response) {\n this.axiosPromise = response;\n }\n ResponseHandler.prototype.handle = function (consumer) {\n return __awaiter(this, void 0, void 0, function () {\n var axiosResponse, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (lodash_1.isUndefined(consumer)) {\n throw new Error('consumer must be defined');\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.axiosPromise];\n case 2:\n axiosResponse = _a.sent();\n return [2 /*return*/, consumer(axiosResponse)];\n case 3:\n e_1 = _a.sent();\n if (e_1 instanceof BringgException_1.BringgException) {\n throw e_1;\n }\n return [2 /*return*/, consumer(e_1)];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n return ResponseHandler;\n}());\nexports.ResponseHandler = ResponseHandler;\nfunction get(axiosInstance, host, uri, queryString) {\n return new ResponseHandler(axiosInstance.get(\"\" + host + uri, { params: queryString }));\n}\nfunction post(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.post(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction put(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.put(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction patch(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.patch(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction remove(axiosInstance, host, uri, queryString) {\n return new ResponseHandler(axiosInstance.delete(\"\" + host + uri, { params: queryString }));\n}\nfunction routify(axiosInstance, endpoint, route, routeParams, queryString, payload) {\n switch (route.httpMethod) {\n case 0 /* GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString);\n case 1 /* POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 2 /* PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 3 /* PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 4 /* DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString);\n }\n}\nfunction wrapWithInterceptors(axios) {\n axios.interceptors.request.use(function (req) {\n var method = req.method, url = req.url, params = req.params, headers = req.headers, data = req.data;\n try {\n Logger_1.default.debug('REQUEST:', method.toUpperCase(), url);\n }\n catch (e) { }\n try {\n Logger_1.default.trace('REQUEST-query-string:', params);\n Logger_1.default.trace('REQUEST-headers:', headers);\n Logger_1.default.trace('REQUEST-data:', data);\n }\n catch (e) { }\n return req;\n });\n axios.interceptors.response.use(function (res) {\n var statusText = res.statusText, status = res.status, headers = res.headers, data = res.data;\n try {\n Logger_1.default.debug('RESPONSE:', res.config.url, status, statusText);\n }\n catch (e) { }\n try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) { }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, headers) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers })));\n}\nfunction anonymousAxiosInstance(clientId, headers) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers })));\n}\nvar AuthorizedServiceRequest = /** @class */ (function () {\n function AuthorizedServiceRequest(clientId, authToken) {\n this.authToken = authToken;\n this.clientId = clientId;\n }\n AuthorizedServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, headers) {\n return routify(axiosInstance(this.clientId, this.authToken, headers), endpoint, route, routeParams, queryString, payload);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId) {\n this.clientId = clientId;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload) {\n return routify(anonymousAxiosInstance(this.clientId), endpoint, route, routeParams, queryString, payload);\n };\n return AnonymousServiceRequest;\n}());\nexports.AnonymousServiceRequest = AnonymousServiceRequest;\n//# sourceMappingURL=ServiceRequest.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/ServiceRequest.js?");
1867
+ eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\nvar Logger_1 = __webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar version = '0.4.38';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) { }\n try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) { }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) { }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, queryString, authenticationToken, headers) {\n // NiceToHave: move headers to HttpHeaders class\n this.headers = __assign(__assign({ 'Content-Type': 'application/json' }, headers), { 'sdk-version': version, Client: clientId });\n this.timeout = timeout;\n this.validateStatus = lodash_1.stubTrue;\n if (queryString) {\n this.params = queryString;\n }\n if (authenticationToken) {\n this.headers['Authorization'] = \"Token token=\" + authenticationToken;\n }\n }\n RequestOptions.new = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.clientId, clientId = _c === void 0 ? 'Bringg Dashboard' : _c, _d = _b.timeout, timeout = _d === void 0 ? DEFAULT_TIMEOUT : _d, _e = _b.queryString, queryString = _e === void 0 ? undefined : _e, _f = _b.authenticationToken, authenticationToken = _f === void 0 ? undefined : _f, _g = _b.headers, headers = _g === void 0 ? undefined : _g;\n return new RequestOptions(clientId, timeout, queryString, authenticationToken, headers);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response) {\n this.axiosPromise = response;\n }\n ResponseHandler.prototype.handle = function (consumer) {\n return __awaiter(this, void 0, void 0, function () {\n var axiosResponse, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (lodash_1.isUndefined(consumer)) {\n throw new Error('consumer must be defined');\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.axiosPromise];\n case 2:\n axiosResponse = _a.sent();\n return [2 /*return*/, consumer(axiosResponse)];\n case 3:\n e_1 = _a.sent();\n if (e_1 instanceof BringgException_1.BringgException) {\n throw e_1;\n }\n return [2 /*return*/, consumer(e_1)];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n return ResponseHandler;\n}());\nexports.ResponseHandler = ResponseHandler;\nfunction get(axiosInstance, host, uri, queryString) {\n return new ResponseHandler(axiosInstance.get(\"\" + host + uri, { params: queryString }));\n}\nfunction post(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.post(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction put(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.put(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction patch(axiosInstance, host, uri, queryString, payload) {\n return new ResponseHandler(axiosInstance.patch(\"\" + host + uri, payload, { params: queryString }));\n}\nfunction remove(axiosInstance, host, uri, queryString) {\n return new ResponseHandler(axiosInstance.delete(\"\" + host + uri, { params: queryString }));\n}\nfunction routify(axiosInstance, endpoint, route, routeParams, queryString, payload) {\n switch (route.httpMethod) {\n case 0 /* GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString);\n case 1 /* POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 2 /* PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 3 /* PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload);\n case 4 /* DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString);\n }\n}\nfunction wrapWithInterceptors(axios) {\n axios.interceptors.request.use(function (req) {\n var method = req.method, url = req.url, params = req.params, headers = req.headers, data = req.data;\n try {\n Logger_1.default.debug('REQUEST:', method.toUpperCase(), url);\n }\n catch (e) { }\n try {\n Logger_1.default.trace('REQUEST-query-string:', params);\n Logger_1.default.trace('REQUEST-headers:', headers);\n Logger_1.default.trace('REQUEST-data:', data);\n }\n catch (e) { }\n return req;\n });\n axios.interceptors.response.use(function (res) {\n var statusText = res.statusText, status = res.status, headers = res.headers, data = res.data;\n try {\n Logger_1.default.debug('RESPONSE:', res.config.url, status, statusText);\n }\n catch (e) { }\n try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) { }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, headers) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers })));\n}\nfunction anonymousAxiosInstance(clientId, headers) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers })));\n}\nvar AuthorizedServiceRequest = /** @class */ (function () {\n function AuthorizedServiceRequest(clientId, authToken) {\n this.authToken = authToken;\n this.clientId = clientId;\n }\n AuthorizedServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, headers) {\n return routify(axiosInstance(this.clientId, this.authToken, headers), endpoint, route, routeParams, queryString, payload);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId) {\n this.clientId = clientId;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload) {\n return routify(anonymousAxiosInstance(this.clientId), endpoint, route, routeParams, queryString, payload);\n };\n return AnonymousServiceRequest;\n}());\nexports.AnonymousServiceRequest = AnonymousServiceRequest;\n//# sourceMappingURL=ServiceRequest.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/ServiceRequest.js?");
1868
1868
 
1869
1869
  /***/ }),
1870
1870