bkash
Version:
bKash API client for Browser & Node.js
315 lines (250 loc) • 67.3 kB
JavaScript
var BKash =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/before-after-hook/index.js":
/*!*************************************************!*\
!*** ./node_modules/before-after-hook/index.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = Hook\n\nvar register = __webpack_require__(/*! ./lib/register */ \"./node_modules/before-after-hook/lib/register.js\")\nvar addHook = __webpack_require__(/*! ./lib/add */ \"./node_modules/before-after-hook/lib/add.js\")\nvar removeHook = __webpack_require__(/*! ./lib/remove */ \"./node_modules/before-after-hook/lib/remove.js\")\n\nfunction Hook () {\n var state = {\n registry: {}\n }\n\n var hook = register.bind(null, state)\n hook.remove = {}\n hook.api = {remove: {}}\n\n ;['before', 'error', 'after'].forEach(function (kind) {\n hook[kind] = hook.api[kind] = addHook.bind(null, state, kind)\n hook.remove[kind] = hook.api.remove[kind] = removeHook.bind(null, state, kind)\n })\n\n return hook\n}\n\n\n//# sourceURL=webpack://BKash/./node_modules/before-after-hook/index.js?");
/***/ }),
/***/ "./node_modules/before-after-hook/lib/add.js":
/*!***************************************************!*\
!*** ./node_modules/before-after-hook/lib/add.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = addHook\n\nfunction addHook (state, kind, name, hook) {\n if (!state.registry[name]) {\n state.registry[name] = {\n before: [],\n error: [],\n after: []\n }\n }\n\n state.registry[name][kind][kind === 'before' ? 'unshift' : 'push'](hook)\n}\n\n\n//# sourceURL=webpack://BKash/./node_modules/before-after-hook/lib/add.js?");
/***/ }),
/***/ "./node_modules/before-after-hook/lib/register.js":
/*!********************************************************!*\
!*** ./node_modules/before-after-hook/lib/register.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = register\n\nfunction register (state, name, options, method) {\n if (arguments.length === 3) {\n method = options\n options = {}\n }\n\n if (typeof method !== 'function') {\n throw new Error('method for before hook must be a function')\n }\n\n if (typeof options !== 'object') {\n throw new Error('options for before hook must be an object')\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, options, callback)\n }, method)()\n }\n\n var hooks = state.registry[name]\n\n if (!hooks) {\n return invokeMethod(options, method)\n }\n\n var beforeHooks = hooks.before\n var errorHooks = hooks.error\n var afterHooks = hooks.after\n\n // 1. run \"before hooks\" which may mutate options\n return Promise.all(beforeHooks.map(invokeBeforeHook.bind(null, options)))\n\n // 2. Once all finish without error, call the method with the (mutated) options\n .then(function () {\n return method(options)\n })\n\n // 3. If an error occurs in 1. or 2. run the \"error hooks\" which may mutate\n // the error object. If one of them does not return an error then set the\n // result to that. Otherwise throw (mutated) error.\n .catch(function (error) {\n return Promise.all(errorHooks.map(invokeErrorHook.bind(null, error, options)))\n\n .then(function (results) {\n var nonErrorResults = results.filter(isntError)\n\n if (nonErrorResults.length) {\n return nonErrorResults[0]\n }\n\n throw error\n })\n })\n\n // 4. Run the \"after hooks\". They may mutate the result\n .then(function (result) {\n return Promise.all(afterHooks.map(invokeAfterHook.bind(null, result, options)))\n\n .then(function () {\n return result\n })\n })\n}\n\nfunction invokeMethod (options, method) {\n try {\n return Promise.resolve(method(options))\n } catch (error) {\n return Promise.reject(error)\n }\n}\n\nfunction invokeBeforeHook (options, method) {\n try {\n return method(options)\n } catch (error) {\n return Promise.reject(error)\n }\n}\n\nfunction invokeErrorHook (result, options, errorHook) {\n try {\n return Promise.resolve(errorHook(result, options))\n\n .catch(function (error) { return error })\n } catch (error) {\n return Promise.resolve(error)\n }\n}\n\nfunction invokeAfterHook (result, options, method) {\n try {\n return method(result, options)\n } catch (error) {\n return Promise.reject(error)\n }\n}\n\nfunction isntError (result) {\n return !(result instanceof Error)\n}\n\n\n//# sourceURL=webpack://BKash/./node_modules/before-after-hook/lib/register.js?");
/***/ }),
/***/ "./node_modules/before-after-hook/lib/remove.js":
/*!******************************************************!*\
!*** ./node_modules/before-after-hook/lib/remove.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = removeHook\n\nfunction removeHook (state, kind, name, method) {\n if (!state.registry[name]) {\n return\n }\n\n var index = state.registry[name][kind].indexOf(method)\n\n if (index === -1) {\n return\n }\n\n state.registry[name][kind].splice(index, 1)\n}\n\n\n//# sourceURL=webpack://BKash/./node_modules/before-after-hook/lib/remove.js?");
/***/ }),
/***/ "./node_modules/debug/src/browser.js":
/*!*******************************************!*\
!*** ./node_modules/debug/src/browser.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/debug/src/debug.js\");\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',\n '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',\n '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',\n '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',\n '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',\n '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',\n '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',\n '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',\n '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',\n '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',\n '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // Internet Explorer and Edge do not support colors.\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://BKash/./node_modules/debug/src/browser.js?");
/***/ }),
/***/ "./node_modules/debug/src/debug.js":
/*!*****************************************!*\
!*** ./node_modules/debug/src/debug.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\n/**\n * Active `debug` instances.\n */\nexports.instances = [];\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n var prevTime;\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n exports.instances.push(debug);\n\n return debug;\n}\n\nfunction destroy () {\n var index = exports.instances.indexOf(this);\n if (index !== -1) {\n exports.instances.splice(index, 1);\n return true;\n } else {\n return false;\n }\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < exports.instances.length; i++) {\n var instance = exports.instances[i];\n instance.enabled = exports.enabled(instance.namespace);\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n\n//# sourceURL=webpack://BKash/./node_modules/debug/src/debug.js?");
/***/ }),
/***/ "./node_modules/is-plain-object/index.js":
/*!***********************************************!*\
!*** ./node_modules/is-plain-object/index.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("/*!\n * is-plain-object <https://github.com/jonschlinkert/is-plain-object>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n\n\nvar isObject = __webpack_require__(/*! isobject */ \"./node_modules/isobject/index.js\");\n\nfunction isObjectObject(o) {\n return isObject(o) === true\n && Object.prototype.toString.call(o) === '[object Object]';\n}\n\nmodule.exports = function isPlainObject(o) {\n var ctor,prot;\n\n if (isObjectObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (typeof ctor !== 'function') return false;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObjectObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n};\n\n\n//# sourceURL=webpack://BKash/./node_modules/is-plain-object/index.js?");
/***/ }),
/***/ "./node_modules/isobject/index.js":
/*!****************************************!*\
!*** ./node_modules/isobject/index.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n\n\nmodule.exports = function isObject(val) {\n return val != null && typeof val === 'object' && Array.isArray(val) === false;\n};\n\n\n//# sourceURL=webpack://BKash/./node_modules/isobject/index.js?");
/***/ }),
/***/ "./node_modules/ms/index.js":
/*!**********************************!*\
!*** ./node_modules/ms/index.js ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//# sourceURL=webpack://BKash/./node_modules/ms/index.js?");
/***/ }),
/***/ "./node_modules/node-fetch/browser.js":
/*!********************************************!*\
!*** ./node_modules/node-fetch/browser.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = exports = window.fetch;\n\n// Needed for TypeScript and Webpack.\nexports.default = window.fetch.bind(window);\n\nexports.Headers = window.Headers;\nexports.Request = window.Request;\nexports.Response = window.Response;\n\n\n//# sourceURL=webpack://BKash/./node_modules/node-fetch/browser.js?");
/***/ }),
/***/ "./node_modules/process/browser.js":
/*!*****************************************!*\
!*** ./node_modules/process/browser.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack://BKash/./node_modules/process/browser.js?");
/***/ }),
/***/ "./node_modules/url-template/lib/url-template.js":
/*!*******************************************************!*\
!*** ./node_modules/url-template/lib/url-template.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("(function (root, factory) {\n if (true) {\n module.exports = factory();\n } else {}\n}(this, function () {\n /**\n * @constructor\n */\n function UrlTemplate() {\n }\n\n /**\n * @private\n * @param {string} str\n * @return {string}\n */\n UrlTemplate.prototype.encodeReserved = function (str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, '[').replace(/%5D/g, ']');\n }\n return part;\n }).join('');\n };\n\n /**\n * @private\n * @param {string} str\n * @return {string}\n */\n UrlTemplate.prototype.encodeUnreserved = function (str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase();\n });\n }\n\n /**\n * @private\n * @param {string} operator\n * @param {string} value\n * @param {string} key\n * @return {string}\n */\n UrlTemplate.prototype.encodeValue = function (operator, value, key) {\n value = (operator === '+' || operator === '#') ? this.encodeReserved(value) : this.encodeUnreserved(value);\n\n if (key) {\n return this.encodeUnreserved(key) + '=' + value;\n } else {\n return value;\n }\n };\n\n /**\n * @private\n * @param {*} value\n * @return {boolean}\n */\n UrlTemplate.prototype.isDefined = function (value) {\n return value !== undefined && value !== null;\n };\n\n /**\n * @private\n * @param {string}\n * @return {boolean}\n */\n UrlTemplate.prototype.isKeyOperator = function (operator) {\n return operator === ';' || operator === '&' || operator === '?';\n };\n\n /**\n * @private\n * @param {Object} context\n * @param {string} operator\n * @param {string} key\n * @param {string} modifier\n */\n UrlTemplate.prototype.getValues = function (context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (this.isDefined(value) && value !== '') {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n value = value.toString();\n\n if (modifier && modifier !== '*') {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(this.encodeValue(operator, value, this.isKeyOperator(operator) ? key : null));\n } else {\n if (modifier === '*') {\n if (Array.isArray(value)) {\n value.filter(this.isDefined).forEach(function (value) {\n result.push(this.encodeValue(operator, value, this.isKeyOperator(operator) ? key : null));\n }, this);\n } else {\n Object.keys(value).forEach(function (k) {\n if (this.isDefined(value[k])) {\n result.push(this.encodeValue(operator, value[k], k));\n }\n }, this);\n }\n } else {\n var tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(this.isDefined).forEach(function (value) {\n tmp.push(this.encodeValue(operator, value));\n }, this);\n } else {\n Object.keys(value).forEach(function (k) {\n if (this.isDefined(value[k])) {\n tmp.push(this.encodeUnreserved(k));\n tmp.push(this.encodeValue(operator, value[k].toString()));\n }\n }, this);\n }\n\n if (this.isKeyOperator(operator)) {\n result.push(this.encodeUnreserved(key) + '=' + tmp.join(','));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(','));\n }\n }\n }\n } else {\n if (operator === ';') {\n if (this.isDefined(value)) {\n result.push(this.encodeUnreserved(key));\n }\n } else if (value === '' && (operator === '&' || operator === '?')) {\n result.push(this.encodeUnreserved(key) + '=');\n } else if (value === '') {\n result.push('');\n }\n }\n return result;\n };\n\n /**\n * @param {string} template\n * @return {function(Object):string}\n */\n UrlTemplate.prototype.parse = function (template) {\n var that = this;\n var operators = ['+', '#', '.', '/', ';', '?', '&'];\n\n return {\n expand: function (context) {\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n var operator = null,\n values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push.apply(values, that.getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== '+') {\n var separator = ',';\n\n if (operator === '?') {\n separator = '&';\n } else if (operator !== '#') {\n separator = operator;\n }\n return (values.length !== 0 ? operator : '') + values.join(separator);\n } else {\n return values.join(',');\n }\n } else {\n return that.encodeReserved(literal);\n }\n });\n }\n };\n };\n\n return new UrlTemplate();\n}));\n\n\n//# sourceURL=webpack://BKash/./node_modules/url-template/lib/url-template.js?");
/***/ }),
/***/ "./package.json":
/*!**********************!*\
!*** ./package.json ***!
\**********************/
/*! exports provided: name, version, description, keywords, homepage, bugs, license, author, files, main, repository, scripts, dependencies, devDependencies, default */
/***/ (function(module) {
eval("module.exports = {\"name\":\"bkash\",\"version\":\"0.2.2\",\"description\":\"bKash API client for Browser & Node.js\",\"keywords\":[\"bkash\",\"api-client\"],\"homepage\":\"https://github.com/MunifTanjim/node-bkash#readme\",\"bugs\":\"https://github.com/MunifTanjim/node-bkash/issues\",\"license\":\"MIT\",\"author\":\"MunifTanjim (https://muniftanjim.com)\",\"files\":[\"index.js\",\"libs\",\"dist/*.js\"],\"main\":\"index.js\",\"repository\":\"github:MunifTanjim/node-bkash\",\"scripts\":{\"build\":\"npm-run-all build:*\",\"prebuild:browser\":\"mkdirp dist/\",\"build:browser\":\"npm-run-all build:browser:*\",\"build:browser:development\":\"webpack --mode development\",\"build:browser:production\":\"webpack --mode production --output-filename=bkash.min.js\",\"generate:routes\":\"node scripts/generate-routes.js\",\"publish\":\"npm run build && npm publish\"},\"dependencies\":{\"before-after-hook\":\"^1.1.0\",\"is-plain-object\":\"^2.0.4\",\"node-fetch\":\"^2.1.2\",\"url-template\":\"^2.0.8\"},\"devDependencies\":{\"clean-deep\":\"^3.0.2\",\"debug\":\"^3.1.0\",\"deep-sort-object\":\"^1.0.2\",\"mkdirp\":\"^0.5.1\",\"npm-run-all\":\"^4.1.3\",\"webpack\":\"^4.8.3\",\"webpack-cli\":\"^2.1.3\"}};\n\n//# sourceURL=webpack://BKash/./package.json?");
/***/ }),
/***/ "./src/bkash-error.js":
/*!****************************!*\
!*** ./src/bkash-error.js ***!
\****************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("class BKashError extends Error {\n constructor(message, meta, headers) {\n super(Array.isArray(message) ? message.join(', ') : message)\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor)\n\n this.name = this.constructor.name\n this.meta = meta\n this.headers = headers\n }\n}\n\nmodule.exports = BKashError\n\n\n//# sourceURL=webpack://BKash/./src/bkash-error.js?");
/***/ }),
/***/ "./src/endpoint/method.js":
/*!********************************!*\
!*** ./src/endpoint/method.js ***!
\********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("const deepmerge = __webpack_require__(/*! ../utils/deepmerge.js */ \"./src/utils/deepmerge.js\")\n\nconst validate = __webpack_require__(/*! ./validate.js */ \"./src/endpoint/validate.js\")\n\nconst endpointMethod = (\n apiClient,\n endpointDefaults,\n endpointParamsSpecs,\n options = {},\n callback\n) => {\n const endpointOptions = deepmerge(endpointDefaults, options)\n\n const promise = Promise.resolve(endpointOptions)\n .then(endpointOptions => validate(endpointParamsSpecs, endpointOptions))\n .then(apiClient.request)\n\n if (callback) {\n promise.then(response => callback(null, response)).catch(callback)\n return\n }\n\n return promise\n}\n\nmodule.exports = endpointMethod\n\n\n//# sourceURL=webpack://BKash/./src/endpoint/method.js?");
/***/ }),
/***/ "./src/endpoint/validate.js":
/*!**********************************!*\
!*** ./src/endpoint/validate.js ***!
\**********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("const BKashError = __webpack_require__(/*! ../bkash-error.js */ \"./src/bkash-error.js\")\n\nconst validate = (paramsSpecs = {}, params) => {\n Object.entries(paramsSpecs).forEach(([paramName, spec]) => {\n const param = params[paramName]\n\n const valueIsPresent = typeof param !== 'undefined'\n\n if (!spec.required && !valueIsPresent) {\n return\n }\n\n if (spec.required && !valueIsPresent) {\n throw new BKashError(`Parameter required: ${paramKey}`, {\n status: 400\n })\n }\n })\n\n return params\n}\n\nmodule.exports = validate\n\n\n//# sourceURL=webpack://BKash/./src/endpoint/validate.js?");
/***/ }),
/***/ "./src/index.js":
/*!**********************!*\
!*** ./src/index.js ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("const Hook = __webpack_require__(/*! before-after-hook */ \"./node_modules/before-after-hook/index.js\")\n\nconst deepmerge = __webpack_require__(/*! ./utils/deepmerge */ \"./src/utils/deepmerge.js\")\nconst request = __webpack_require__(/*! ./request */ \"./src/request/index.js\")\n\nconst Plugins = [\n __webpack_require__(/*! ./plugins/authentication */ \"./src/plugins/authentication/index.js\"),\n __webpack_require__(/*! ./plugins/endpoint-methods */ \"./src/plugins/endpoint-methods/index.js\")\n]\n\nconst { version: CLIENT_VERSION } = __webpack_require__(/*! ../package.json */ \"./package.json\")\n\nconst defaultClientOptions = {\n mode: 'sandbox',\n type: 'checkout',\n headers: {\n 'content-type': 'application/json; charset=utf-8',\n 'user-agent': `NodeBKash/${CLIENT_VERSION}`\n },\n options: {\n timeout: 0\n }\n}\n\nconst API_VERSION = '1.1.0-beta'\nconst VALID_MODES = ['sandbox', 'pay']\nconst VALID_TYPES = ['checkout', 'payments']\n\nclass BKash {\n constructor(clientOptions = defaultClientOptions) {\n let { mode, type, headers, options } = deepmerge(\n defaultClientOptions,\n clientOptions\n )\n\n if (!VALID_MODES.includes(mode)) {\n throw new Error(`Invalid mode, must be one of: ${VALID_MODES.join('/')}`)\n }\n\n if (!VALID_TYPES.includes(type)) {\n throw new Error(`Invalid type, must be one of: ${VALID_TYPES.join('/')}`)\n }\n\n this.mode = mode\n this.type = type\n this.version = API_VERSION\n\n this.options = { headers, options }\n\n this.hook = new Hook()\n\n this.request = this.request.bind(this)\n\n Plugins.forEach(Plugin => this.addPlugin(Plugin))\n }\n\n addPlugin(Plugin) {\n new Plugin(this).inject()\n }\n\n request(options) {\n return this.hook('request', deepmerge(this.options, options), request)\n }\n}\n\nmodule.exports = BKash\n\n\n//# sourceURL=webpack://BKash/./src/index.js?");
/***/ }),
/***/ "./src/plugins/authentication/authenticate.js":
/*!****************************************************!*\
!*** ./src/plugins/authentication/authenticate.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("const authenticate = (state, options = {}) => {\n if (!options.type) {\n state.auth = false\n return\n }\n\n switch (options.type) {\n case 'simple':\n if (!options.username || !options.password) {\n throw new Error(\n 'Simple authentication requires both `username` and `password` to be set'\n )\n }\n break\n case 'token':\n if (!options.token || !options.appkey) {\n throw new Error(\n 'Token authentication requires both `token` and `appkey` to be set'\n )\n }\n break\n default:\n throw new Error(\n 'Invalid authentication type, must be `simple` or `token`'\n )\n }\n\n state.auth = options\n}\n\nmodule.exports = authenticate\n\n\n//# sourceURL=webpack://BKash/./src/plugins/authentication/authenticate.js?");
/***/ }),
/***/ "./src/plugins/authentication/before-request.js":
/*!******************************************************!*\
!*** ./src/plugins/authentication/before-request.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("const authBeforeRequest = (state, options) => {\n if (!state.auth) {\n return\n }\n\n switch (state.auth.type) {\n case 'simple':\n options.headers['username'] = state.auth.username\n options.headers['password'] = state.auth.password\n break\n case 'token':\n options.headers['authorization'] = state.auth.token\n options.headers['x-app-key'] = state.auth.appkey\n break\n }\n\n return\n}\n\nmodule.exports = authBeforeRequest\n\n\n//# sourceURL=webpack://BKash/./src/plugins/authentication/before-request.js?");
/***/ }),
/***/ "./src/plugins/authentication/index.js":
/*!*********************************************!*\
!*** ./src/plugins/authentication/index.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("const authenticate = __webpack_require__(/*! ./authenticate */ \"./src/plugins/authentication/authenticate.js\")\nconst beforeRequest = __webpack_require__(/*! ./before-request */ \"./src/plugins/authentication/before-request.js\")\n\nclass AuthenticationPlugin {\n constructor(apiClient) {\n this.core = apiClient\n this.state = {\n auth: false\n }\n }\n\n inject() {\n this.core.authenticate = authenticate.bind(null, this.state)\n\n this.core.hook.before('request', beforeRequest.bind(null, this.state))\n }\n}\n\nmodule.exports = AuthenticationPlugin\n\n\n//# sourceURL=webpack://BKash/./src/plugins/authentication/index.js?");
/***/ }),
/***/ "./src/plugins/endpoint-methods/index.js":
/*!***********************************************!*\
!*** ./src/plugins/endpoint-methods/index.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("const endpointMethod = __webpack_require__(/*! ../../endpoint/method.js */ \"./src/endpoint/method.js\")\n\nclass EndpointMethodsPlugin {\n constructor(apiClient) {\n this.core = apiClient\n\n const { mode, type, version } = this.core\n\n this.baseUrl = __webpack_require__(\"./src/routes sync recursive ^\\\\.\\\\/.*\\\\-info\\\\.json$\")(`./${type}-${version}-info.json`).baseUrl[\n mode\n ]\n\n this.endpoints = __webpack_require__(\"./src/routes sync recursive ^\\\\.\\\\/.*\\\\.json$\")(`./${type}-${version}.json`)\n }\n\n inject() {\n Object.keys(this.endpoints).forEach(endpoint => {\n const { name, method, params: paramsSpecs, url } = endpoint\n\n this.core[name] = endpointMethod.bind(\n null,\n this.core,\n { baseUrl: this.baseUrl, method, url },\n paramsSpecs\n )\n })\n }\n}\n\nmodule.exports = EndpointMethodsPlugin\n\n\n//# sourceURL=webpack://BKash/./src/plugins/endpoint-methods/index.js?");
/***/ }),
/***/ "./src/request/fetch.js":
/*!******************************!*\
!*** ./src/request/fetch.js ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("const fetch = __webpack_require__(/*! node-fetch */ \"./node_modules/node-fetch/browser.js\")\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('bKash')\n\nconst BKashError = __webpack_require__(/*! ../bkash-error.js */ \"./src/bkash-error.js\")\n// const BKashErrorCodes = require('../bkash-error-codes.json')\n\nconst getData = res => {\n const contentType = res.headers.get('content-type')\n return /application\\/json/.test(contentType) ? res.json() : res.text()\n}\n\nconst responseFormatter = res => {\n const Response = {\n headers: {},\n meta: {}\n }\n\n for (let [field, value] of res.headers.entries()) {\n Response.headers[field] = value\n }\n\n Response.meta.status = res.status\n\n if (res.status === 204) {\n return Response\n }\n\n return getData(res).then(data => {\n if (res.status >= 500) {\n throw new BKashError(errors, Response.meta, Response.headers)\n }\n\n Response.data = data\n\n return Response\n })\n}\n\nconst request = requestOptions => {\n debug('REQUEST:', requestOptions)\n\n const { method, url, headers, body, ...o