@bringg/dashboard-sdk 8.1.0 → 8.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -291,7 +291,7 @@ eval("\nvar __extends = (this && this.__extends) || (function () {\n var exte
291
291
  /***/ (function(module, exports, __webpack_require__) {
292
292
 
293
293
  "use strict";
294
- eval("\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncOperationStatus = void 0;\nvar types_1 = __webpack_require__(/*! @bringg/types */ \"./node_modules/@bringg/types/index.js\");\nvar realtime_subscriptions_1 = __webpack_require__(/*! ../realtime-subscriptions */ \"./dist/realtime-subscriptions.js\");\nvar AsyncOperationStatus = /** @class */ (function () {\n function AsyncOperationStatus(session) {\n // In case of adding listener for a request that status update was already received, we will save that so nothing will be lost\n this.unackedStatusUpdates = new Map();\n this.listeners = new Map();\n this.realtimeSubscriptions = new realtime_subscriptions_1.default(session);\n this.listenToEvent();\n this.registerUnackedStatusCleanup();\n }\n AsyncOperationStatus.prototype.listenToEvent = function () {\n var _this = this;\n this.realtimeSubscriptions.subscribe(types_1.RealtimeEvent.AsyncOperationStatus, function (event) {\n var listener = _this.listeners.get(event.request_id);\n if (listener) {\n try {\n listener(event);\n }\n catch (_a) {\n // ignore\n }\n return;\n }\n var queue = (_this.unackedStatusUpdates.get(event.request_id) || {}).queue;\n if (!queue) {\n queue = [];\n _this.unackedStatusUpdates.set(event.request_id, {\n queue: queue,\n firstMessageTimeInMs: Date.now()\n });\n }\n queue.push(event);\n return;\n });\n };\n AsyncOperationStatus.prototype.addListener = function (_a) {\n var _this = this;\n var requestId = _a.requestId, handler = _a.handler, signal = _a.signal;\n this.listeners.set(requestId, handler);\n if (this.unackedStatusUpdates.has(requestId)) {\n var unackedStatusUpdates = this.unackedStatusUpdates.get(requestId);\n unackedStatusUpdates.queue.forEach(function (payload) {\n try {\n handler(payload);\n }\n catch (_a) {\n // ignore\n }\n });\n this.unackedStatusUpdates.delete(requestId);\n }\n signal.addEventListener('abort', function () {\n _this.listeners.delete(requestId);\n }, { once: true });\n };\n AsyncOperationStatus.prototype.registerUnackedStatusCleanup = function () {\n var _this = this;\n setInterval(function () {\n var e_1, _a;\n var now = Date.now();\n try {\n for (var _b = __values(_this.unackedStatusUpdates), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read(_c.value, 2), key = _d[0], firstMessageTimeInMs = _d[1].firstMessageTimeInMs;\n if (now - firstMessageTimeInMs >= AsyncOperationStatus.UNACKED_MESSAGES_TTL) {\n _this.unackedStatusUpdates.delete(key);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }, AsyncOperationStatus.UNACKED_MESSAGES_TTL);\n };\n AsyncOperationStatus.UNACKED_MESSAGES_TTL = 1000 * 60 * 3; // 3 minutes\n return AsyncOperationStatus;\n}());\nexports.AsyncOperationStatus = AsyncOperationStatus;\n//# sourceMappingURL=AsyncOperationStatus.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/AsyncOperationStatus/AsyncOperationStatus.js?");
294
+ eval("\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncOperationStatus = void 0;\nvar types_1 = __webpack_require__(/*! @bringg/types */ \"./node_modules/@bringg/types/index.js\");\nvar realtime_subscriptions_1 = __webpack_require__(/*! ../realtime-subscriptions */ \"./dist/realtime-subscriptions.js\");\nvar AsyncOperationStatus = /** @class */ (function () {\n function AsyncOperationStatus(session) {\n // In case of adding listener for a request that status update was already received, we will save that so nothing will be lost\n this.unackedStatusUpdates = new Map();\n this.listeners = new Map();\n this.realtimeSubscriptions = new realtime_subscriptions_1.default(session);\n this.listenToEvent();\n this.registerUnackedStatusCleanup();\n }\n AsyncOperationStatus.prototype.listenToEvent = function () {\n var _this = this;\n this.unsubscribe = this.realtimeSubscriptions.subscribe(types_1.RealtimeEvent.AsyncOperationStatus, function (event) {\n var listener = _this.listeners.get(event.request_id);\n if (listener) {\n try {\n listener(event);\n }\n catch (_a) {\n // ignore\n }\n return;\n }\n var queue = (_this.unackedStatusUpdates.get(event.request_id) || {}).queue;\n if (!queue) {\n queue = [];\n _this.unackedStatusUpdates.set(event.request_id, {\n queue: queue,\n firstMessageTimeInMs: Date.now()\n });\n }\n queue.push(event);\n return;\n });\n };\n AsyncOperationStatus.prototype.addListener = function (_a) {\n var _this = this;\n var requestId = _a.requestId, handler = _a.handler, signal = _a.signal;\n this.listeners.set(requestId, handler);\n if (this.unackedStatusUpdates.has(requestId)) {\n var unackedStatusUpdates = this.unackedStatusUpdates.get(requestId);\n unackedStatusUpdates.queue.forEach(function (payload) {\n try {\n handler(payload);\n }\n catch (_a) {\n // ignore\n }\n });\n this.unackedStatusUpdates.delete(requestId);\n }\n signal.addEventListener('abort', function () {\n _this.listeners.delete(requestId);\n }, { once: true });\n };\n AsyncOperationStatus.prototype.registerUnackedStatusCleanup = function () {\n var _this = this;\n this.cleanupInterval = setInterval(function () {\n var e_1, _a;\n var now = Date.now();\n try {\n for (var _b = __values(_this.unackedStatusUpdates), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read(_c.value, 2), key = _d[0], firstMessageTimeInMs = _d[1].firstMessageTimeInMs;\n if (now - firstMessageTimeInMs >= AsyncOperationStatus.UNACKED_MESSAGES_TTL) {\n _this.unackedStatusUpdates.delete(key);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }, AsyncOperationStatus.UNACKED_MESSAGES_TTL);\n };\n AsyncOperationStatus.prototype.hasUnackedStatusUpdates = function () {\n return this.unackedStatusUpdates.size > 0;\n };\n AsyncOperationStatus.prototype.cleanup = function () {\n var _a;\n clearInterval(this.cleanupInterval);\n (_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);\n this.cleanupInterval = undefined;\n this.unsubscribe = undefined;\n this.listeners.clear();\n this.unackedStatusUpdates.clear();\n };\n AsyncOperationStatus.UNACKED_MESSAGES_TTL = 1000 * 60 * 3; // 3 minutes\n return AsyncOperationStatus;\n}());\nexports.AsyncOperationStatus = AsyncOperationStatus;\n//# sourceMappingURL=AsyncOperationStatus.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/AsyncOperationStatus/AsyncOperationStatus.js?");
295
295
 
296
296
  /***/ }),
297
297
 
@@ -1565,7 +1565,7 @@ eval("\nvar __extends = (this && this.__extends) || (function () {\n var exte
1565
1565
  /***/ (function(module, exports, __webpack_require__) {
1566
1566
 
1567
1567
  "use strict";
1568
- eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MerchantConfigurationKeys = void 0;\nexports.MerchantConfigurationKeys = [\n 'allow_share_location',\n 'acknowledge_flow_ui_config',\n 'task_fields',\n 'advance_configuration_enabled',\n 'address_format',\n 'alert_configurations',\n 'alert_if_user_rated_below',\n 'alerts_types',\n 'allow_access_to_all_open_tasks',\n 'allow_customer_fb_like',\n 'allow_customer_find_me',\n 'allow_cx_customer_cancellation',\n 'allow_dispatcher_to_access_all_teams',\n 'allow_dispatcher_to_access_task_price',\n 'allow_dispatcher_to_edit_drivers',\n 'allow_moving_tasks_to_planning_phase',\n 'allow_offshift_drivers_to_be_assigned',\n 'allow_rating',\n 'allow_single_order_per_driver',\n 'alternate_delivery_pin',\n 'application_configurations',\n 'application_merchant_configurations',\n 'applications',\n 'auto_dispatch',\n 'auto_dispatch_optimization_method',\n 'auto_dispatch_timeout',\n 'auto_dispatch_timeout_per_driver',\n 'auto_share_location',\n 'average_delivery_time',\n 'avoid_commercial_roads',\n 'driver_administration_time_seconds',\n 'cancel_undone_tasks_by_eod',\n 'cash_out_flow_enabled',\n 'settlement_enabled',\n 'cash_out_template_name',\n 'consumer_app_eta_display_method',\n 'country_code',\n 'custom_drivers_page_row_colors',\n 'customer_fb_like_url',\n 'cx_cancel_event_type',\n 'dashboard_refresh_rate_secs',\n 'debrief_flow_enabled',\n 'default_estimate_duration_on_site_in_seconds',\n 'default_inventory_time_on_site_seconds',\n 'default_minutes_buffer_for_asap_orders',\n 'default_minutes_buffer_for_scheduled_orders',\n 'delivery_pin',\n 'destination_pin',\n 'distance_threshold',\n 'driver_at_home_flow_options',\n 'driver_preparation_time_seconds',\n 'email_logo',\n 'email_style_color',\n 'enable_dashboard',\n 'enable_dimension_editing_in_ui',\n 'enable_future_tasks',\n 'enable_kds',\n 'enable_looping_alert_sound',\n 'enable_map_overlays',\n 'enable_planned_routes',\n 'enable_reschedule_flow',\n 'enable_shifts_actions',\n 'enable_support',\n 'enable_task_acknowledge_flow',\n 'enable_task_cancellation',\n 'enable_task_price',\n 'enable_teams',\n 'enable_user_types',\n 'end_of_day_time',\n 'eta_background_color',\n 'eta_minutes_color',\n 'eta_time_color',\n 'eta_title_color',\n 'extra_terms_and_conditions_url',\n 'grab_future_timeout',\n 'grab_mode',\n 'grab_mode_alert_type',\n 'grab_mode_radius',\n 'grab_mode_timeout',\n 'header_color',\n 'history_fields',\n 'initial_tasks_page_size',\n 'inverse_header_color',\n 'invoice_printed_copies',\n 'language_code',\n 'lat',\n 'late_buffer',\n 'lng',\n 'logo',\n 'logout_idle_admin_minutes',\n 'logout_idle_dispatcher_minutes',\n 'looping_alert_sound_type',\n 'map_type',\n 'max_distance_for_optimization_in_meters',\n 'max_distance_from_home_to_task_km',\n 'max_distance_to_not_report',\n 'merchant_id',\n 'merchant_mode',\n 'minutes_until_first_wp_scheduled_at',\n 'name',\n 'number_of_retries_before_a_phone_call',\n 'open_tasks_filter',\n 'paid_google_maps_api',\n 'phone_call_string',\n 'planning_fields',\n 'planning_phase_exists',\n 'planning_phase_print_on_apply',\n 'planning_phase_send_emails_to_drivers_on_apply',\n 'preparation_flow_ui_config',\n 'price_currency',\n 'printer_type',\n 'qr_login_flow_options',\n 'reminder_timeout',\n 'reply_to_shared_email',\n 'run_batcher_on_grab_mode',\n 'scan_code_unique',\n 'secured_setup',\n 'send_sms_to_first_way_point',\n 'set_min_eta_by_time_window',\n 'share_if_too_close',\n 'sharing_mode',\n 'show_bringg_logo',\n 'show_eta_to_home',\n 'show_new_reports',\n 'soft_csv_import',\n 'sound_on_new_order',\n 'support_parcel_shop_last_mile',\n 'task_fields',\n 'task_alert_fields',\n 'driver_alert_fields',\n 'optimization_alert_fields',\n 'task_forwarding_enabled',\n 'task_invoice_template_name',\n 'task_window_bottom_buffer_minutes',\n 'task_window_top_buffer_minutes',\n 'tasks_page_size',\n 'the_batcher',\n 'time_to_remind_before_start_task',\n 'tip_driver_enabled',\n 'unique_external_id_rule',\n 'update_location_max_idle_time',\n 'use_coc',\n 'use_time_windows',\n 'voice_reminder_frequency',\n 'voice_reminder_text',\n 'windows',\n 'windows_mode',\n 'enable_chat',\n 'inherit_team_from_group_team',\n 'hour_format',\n 'dispatch_filter_limit',\n 'set_duplicated_order_in_planning',\n 'dynamic_capacity_values_mode',\n 'customer_verification_pin_code_flow'\n];\n//# sourceMappingURL=MerchantConfiguration.consts.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/MerchantConfiguration/MerchantConfiguration.consts.js?");
1568
+ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MerchantConfigurationKeys = void 0;\nexports.MerchantConfigurationKeys = [\n 'allow_share_location',\n 'acknowledge_flow_ui_config',\n 'task_fields',\n 'advance_configuration_enabled',\n 'address_format',\n 'alert_configurations',\n 'alert_if_user_rated_below',\n 'alerts_types',\n 'allow_access_to_all_open_tasks',\n 'allow_customer_fb_like',\n 'allow_customer_find_me',\n 'allow_cx_customer_cancellation',\n 'allow_dispatcher_to_access_all_teams',\n 'allow_dispatcher_to_access_task_price',\n 'allow_dispatcher_to_edit_drivers',\n 'allow_moving_tasks_to_planning_phase',\n 'allow_offshift_drivers_to_be_assigned',\n 'allow_rating',\n 'allow_single_order_per_driver',\n 'alternate_delivery_pin',\n 'application_configurations',\n 'application_merchant_configurations',\n 'applications',\n 'auto_dispatch',\n 'auto_dispatch_optimization_method',\n 'auto_dispatch_timeout',\n 'auto_dispatch_timeout_per_driver',\n 'auto_share_location',\n 'average_delivery_time',\n 'avoid_commercial_roads',\n 'driver_administration_time_seconds',\n 'cancel_undone_tasks_by_eod',\n 'cash_out_flow_enabled',\n 'settlement_enabled',\n 'cash_out_template_name',\n 'consumer_app_eta_display_method',\n 'country_code',\n 'custom_drivers_page_row_colors',\n 'customer_fb_like_url',\n 'cx_cancel_event_type',\n 'cx_calendar_view_for_delivery_options',\n 'dashboard_refresh_rate_secs',\n 'debrief_flow_enabled',\n 'default_estimate_duration_on_site_in_seconds',\n 'default_inventory_time_on_site_seconds',\n 'default_minutes_buffer_for_asap_orders',\n 'default_minutes_buffer_for_scheduled_orders',\n 'delivery_pin',\n 'destination_pin',\n 'distance_threshold',\n 'driver_at_home_flow_options',\n 'driver_preparation_time_seconds',\n 'email_logo',\n 'email_style_color',\n 'enable_dashboard',\n 'enable_dimension_editing_in_ui',\n 'enable_future_tasks',\n 'enable_kds',\n 'enable_looping_alert_sound',\n 'enable_map_overlays',\n 'enable_planned_routes',\n 'enable_reschedule_flow',\n 'enable_shifts_actions',\n 'enable_support',\n 'enable_task_acknowledge_flow',\n 'enable_task_cancellation',\n 'enable_task_price',\n 'enable_teams',\n 'enable_user_types',\n 'end_of_day_time',\n 'eta_background_color',\n 'eta_minutes_color',\n 'eta_time_color',\n 'eta_title_color',\n 'extra_terms_and_conditions_url',\n 'grab_future_timeout',\n 'grab_mode',\n 'grab_mode_alert_type',\n 'grab_mode_radius',\n 'grab_mode_timeout',\n 'header_color',\n 'history_fields',\n 'initial_tasks_page_size',\n 'inverse_header_color',\n 'invoice_printed_copies',\n 'language_code',\n 'lat',\n 'late_buffer',\n 'lng',\n 'logo',\n 'logout_idle_admin_minutes',\n 'logout_idle_dispatcher_minutes',\n 'looping_alert_sound_type',\n 'map_type',\n 'max_distance_for_optimization_in_meters',\n 'max_distance_from_home_to_task_km',\n 'max_distance_to_not_report',\n 'merchant_id',\n 'merchant_mode',\n 'minutes_until_first_wp_scheduled_at',\n 'name',\n 'number_of_retries_before_a_phone_call',\n 'open_tasks_filter',\n 'paid_google_maps_api',\n 'phone_call_string',\n 'planning_fields',\n 'planning_phase_exists',\n 'planning_phase_print_on_apply',\n 'planning_phase_send_emails_to_drivers_on_apply',\n 'preparation_flow_ui_config',\n 'price_currency',\n 'printer_type',\n 'qr_login_flow_options',\n 'reminder_timeout',\n 'reply_to_shared_email',\n 'run_batcher_on_grab_mode',\n 'scan_code_unique',\n 'secured_setup',\n 'send_sms_to_first_way_point',\n 'set_min_eta_by_time_window',\n 'share_if_too_close',\n 'sharing_mode',\n 'show_bringg_logo',\n 'show_eta_to_home',\n 'show_new_reports',\n 'soft_csv_import',\n 'sound_on_new_order',\n 'support_parcel_shop_last_mile',\n 'task_fields',\n 'task_alert_fields',\n 'driver_alert_fields',\n 'optimization_alert_fields',\n 'task_forwarding_enabled',\n 'task_invoice_template_name',\n 'task_window_bottom_buffer_minutes',\n 'task_window_top_buffer_minutes',\n 'tasks_page_size',\n 'the_batcher',\n 'time_to_remind_before_start_task',\n 'tip_driver_enabled',\n 'unique_external_id_rule',\n 'update_location_max_idle_time',\n 'use_coc',\n 'use_time_windows',\n 'voice_reminder_frequency',\n 'voice_reminder_text',\n 'windows',\n 'windows_mode',\n 'enable_chat',\n 'inherit_team_from_group_team',\n 'hour_format',\n 'dispatch_filter_limit',\n 'set_duplicated_order_in_planning',\n 'dynamic_capacity_values_mode',\n 'customer_verification_pin_code_flow'\n];\n//# sourceMappingURL=MerchantConfiguration.consts.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/MerchantConfiguration/MerchantConfiguration.consts.js?");
1569
1569
 
1570
1570
  /***/ }),
1571
1571
 
@@ -2735,7 +2735,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexport
2735
2735
  /***/ (function(module, exports, __webpack_require__) {
2736
2736
 
2737
2737
  "use strict";
2738
- 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 lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar Logger_1 = __webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\");\nvar abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '8.1.0';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) {\n //\n }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, authenticationToken, \n // eslint-disable-next-line @typescript-eslint/ban-types\n 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, \n// eslint-disable-next-line @typescript-eslint/ban-types\nrouteParams, 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 //\n }\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 //\n }\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 //\n }\n try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) {\n //\n }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, \n// eslint-disable-next-line @typescript-eslint/ban-types\nheaders, 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}\n// eslint-disable-next-line @typescript-eslint/ban-types\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, \n // eslint-disable-next-line @typescript-eslint/ban-types\n routeParams, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, payload, \n // eslint-disable-next-line @typescript-eslint/ban-types\n 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, \n // eslint-disable-next-line @typescript-eslint/ban-types\n routeParams, \n // eslint-disable-next-line @typescript-eslint/ban-types\n 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?");
2738
+ 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 lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar Logger_1 = __webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\");\nvar abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '8.1.1';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) {\n //\n }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, authenticationToken, \n // eslint-disable-next-line @typescript-eslint/ban-types\n 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, \n// eslint-disable-next-line @typescript-eslint/ban-types\nrouteParams, 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 //\n }\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 //\n }\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 //\n }\n try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) {\n //\n }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, \n// eslint-disable-next-line @typescript-eslint/ban-types\nheaders, 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}\n// eslint-disable-next-line @typescript-eslint/ban-types\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, \n // eslint-disable-next-line @typescript-eslint/ban-types\n routeParams, \n // eslint-disable-next-line @typescript-eslint/ban-types\n queryString, payload, \n // eslint-disable-next-line @typescript-eslint/ban-types\n 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, \n // eslint-disable-next-line @typescript-eslint/ban-types\n routeParams, \n // eslint-disable-next-line @typescript-eslint/ban-types\n 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?");
2739
2739
 
2740
2740
  /***/ }),
2741
2741