@metamask-previews/notification-services-controller 0.0.0-preview-bc4ac8fa → 0.1.0-preview-509f7952
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.
- package/CHANGELOG.md +4 -1
- package/dist/NotificationServicesController/NotificationServicesController.js +2 -2
- package/dist/NotificationServicesController/NotificationServicesController.mjs +2 -2
- package/dist/NotificationServicesController/index.js +3 -3
- package/dist/NotificationServicesController/index.mjs +3 -3
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js +6 -6
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +6 -6
- package/dist/NotificationServicesPushController/index.js +7 -7
- package/dist/NotificationServicesPushController/index.mjs +7 -7
- package/dist/NotificationServicesPushController/services/push/push-web.js +4 -4
- package/dist/NotificationServicesPushController/services/push/push-web.mjs +3 -3
- package/dist/NotificationServicesPushController/services/services.js +5 -5
- package/dist/NotificationServicesPushController/services/services.mjs +4 -4
- package/dist/NotificationServicesPushController/utils/get-notification-message.js +2 -2
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +2 -2
- package/dist/NotificationServicesPushController/utils/index.js +2 -2
- package/dist/NotificationServicesPushController/utils/index.mjs +2 -2
- package/dist/{chunk-TT56I53C.mjs → chunk-5DA74RWP.mjs} +2 -2
- package/dist/{chunk-KTQP5UDT.mjs → chunk-5I4DIH6O.mjs} +3 -3
- package/dist/{chunk-KTQP5UDT.mjs.map → chunk-5I4DIH6O.mjs.map} +1 -1
- package/dist/{chunk-OUPWMPLU.mjs → chunk-7ET5GUSY.mjs} +3 -3
- package/dist/chunk-7ET5GUSY.mjs.map +1 -0
- package/dist/{chunk-NJBJIZLR.js → chunk-ABJDEX2S.js} +4 -5
- package/dist/chunk-ABJDEX2S.js.map +1 -0
- package/dist/{chunk-3F4M3OUO.mjs → chunk-ATR6FRAX.mjs} +4 -4
- package/dist/chunk-ATR6FRAX.mjs.map +1 -0
- package/dist/{chunk-DNTK4U5M.js → chunk-K75FPFTD.js} +4 -4
- package/dist/{chunk-DNTK4U5M.js.map → chunk-K75FPFTD.js.map} +1 -1
- package/dist/{chunk-5WWCWQCE.js → chunk-O22GVG7K.js} +11 -11
- package/dist/chunk-O22GVG7K.js.map +1 -0
- package/dist/{chunk-52NKJDI2.mjs → chunk-QUNLD7F2.mjs} +4 -5
- package/dist/chunk-QUNLD7F2.mjs.map +1 -0
- package/dist/{chunk-5OYPOYXZ.mjs → chunk-R6AIAXQV.mjs} +25 -5
- package/dist/chunk-R6AIAXQV.mjs.map +1 -0
- package/dist/{chunk-6B5FOWRH.js → chunk-WTE64QEK.js} +5 -5
- package/dist/chunk-WTE64QEK.js.map +1 -0
- package/dist/{chunk-XNBTOK6G.js → chunk-YD3VVORT.js} +25 -5
- package/dist/chunk-YD3VVORT.js.map +1 -0
- package/dist/{chunk-NMLYB3XT.js → chunk-YETZSCGK.js} +4 -4
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/NotificationServicesController/NotificationServicesController.d.ts +3 -1
- package/dist/types/NotificationServicesController/NotificationServicesController.d.ts.map +1 -1
- package/dist/types/NotificationServicesController/index.d.ts +2 -0
- package/dist/types/NotificationServicesController/index.d.ts.map +1 -1
- package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts +1 -1
- package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +1 -1
- package/dist/types/NotificationServicesPushController/index.d.ts +2 -0
- package/dist/types/NotificationServicesPushController/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-3F4M3OUO.mjs.map +0 -1
- package/dist/chunk-52NKJDI2.mjs.map +0 -1
- package/dist/chunk-5OYPOYXZ.mjs.map +0 -1
- package/dist/chunk-5WWCWQCE.js.map +0 -1
- package/dist/chunk-6B5FOWRH.js.map +0 -1
- package/dist/chunk-NJBJIZLR.js.map +0 -1
- package/dist/chunk-OUPWMPLU.mjs.map +0 -1
- package/dist/chunk-XNBTOK6G.js.map +0 -1
- /package/dist/{chunk-TT56I53C.mjs.map → chunk-5DA74RWP.mjs.map} +0 -0
- /package/dist/{chunk-NMLYB3XT.js.map → chunk-YETZSCGK.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/ms/index.js","../../../node_modules/debug/src/common.js","../../../node_modules/debug/src/browser.js","../../../node_modules/nock/lib/common.js","../../../node_modules/propagate/index.js","../../../node_modules/nock/lib/global_emitter.js","../../../node_modules/nock/lib/socket.js","../../../node_modules/nock/lib/playback_interceptor.js","../../../node_modules/nock/lib/intercepted_request_router.js","../../../node_modules/json-stringify-safe/stringify.js","../../../node_modules/nock/lib/match_body.js","../../../node_modules/nock/lib/interceptor.js","../../../node_modules/nock/lib/intercept.js","../../../node_modules/nock/lib/recorder.js","../../../node_modules/nock/lib/scope.js","../../../node_modules/nock/lib/back.js","../../../node_modules/nock/index.js","../src/NotificationServicesController/index.ts","../src/NotificationServicesController/__fixtures__/index.ts","../src/NotificationServicesController/__fixtures__/mock-feature-announcements.ts","../src/NotificationServicesController/__fixtures__/mock-notification-trigger.ts","../src/NotificationServicesController/__fixtures__/mock-notification-user-storage.ts","../src/NotificationServicesController/__fixtures__/mock-raw-notifications.ts","../src/NotificationServicesController/__fixtures__/mockResponses.ts","../src/NotificationServicesController/__fixtures__/mockServices.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\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' && isFinite(val)) {\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|weeks?|w|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 'weeks':\n case 'week':\n case 'w':\n return n * w;\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 var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= 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 var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#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\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\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\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","'use strict'\n\nconst debug = require('debug')('nock.common')\nconst timers = require('timers')\nconst url = require('url')\nconst util = require('util')\n\n/**\n * Normalizes the request options so that it always has `host` property.\n *\n * @param {Object} options - a parsed options object of the request\n */\nfunction normalizeRequestOptions(options) {\n options.proto = options.proto || 'http'\n options.port = options.port || (options.proto === 'http' ? 80 : 443)\n if (options.host) {\n debug('options.host:', options.host)\n if (!options.hostname) {\n if (options.host.split(':').length === 2) {\n options.hostname = options.host.split(':')[0]\n } else {\n options.hostname = options.host\n }\n }\n }\n debug('options.hostname in the end: %j', options.hostname)\n options.host = `${options.hostname || 'localhost'}:${options.port}`\n debug('options.host in the end: %j', options.host)\n\n /// lowercase host names\n ;['hostname', 'host'].forEach(function (attr) {\n if (options[attr]) {\n options[attr] = options[attr].toLowerCase()\n }\n })\n\n return options\n}\n\n/**\n * Returns true if the data contained in buffer can be reconstructed\n * from its utf8 representation.\n *\n * @param {Object} buffer - a Buffer object\n * @returns {boolean}\n */\nfunction isUtf8Representable(buffer) {\n const utfEncodedBuffer = buffer.toString('utf8')\n const reconstructedBuffer = Buffer.from(utfEncodedBuffer, 'utf8')\n return reconstructedBuffer.equals(buffer)\n}\n\n// Array where all information about all the overridden requests are held.\nlet requestOverrides = {}\n\n/**\n * Overrides the current `request` function of `http` and `https` modules with\n * our own version which intercepts issues HTTP/HTTPS requests and forwards them\n * to the given `newRequest` function.\n *\n * @param {Function} newRequest - a function handling requests; it accepts four arguments:\n * - proto - a string with the overridden module's protocol name (either `http` or `https`)\n * - overriddenRequest - the overridden module's request function already bound to module's object\n * - options - the options of the issued request\n * - callback - the callback of the issued request\n */\nfunction overrideRequests(newRequest) {\n debug('overriding requests')\n ;['http', 'https'].forEach(function (proto) {\n debug('- overriding request for', proto)\n\n const moduleName = proto // 1 to 1 match of protocol and module is fortunate :)\n const module = require(proto)\n const overriddenRequest = module.request\n const overriddenGet = module.get\n\n if (requestOverrides[moduleName]) {\n throw new Error(\n `Module's request already overridden for ${moduleName} protocol.`,\n )\n }\n\n // Store the properties of the overridden request so that it can be restored later on.\n requestOverrides[moduleName] = {\n module,\n request: overriddenRequest,\n get: overriddenGet,\n }\n // https://nodejs.org/api/http.html#http_http_request_url_options_callback\n module.request = function (input, options, callback) {\n return newRequest(proto, overriddenRequest.bind(module), [\n input,\n options,\n callback,\n ])\n }\n // https://nodejs.org/api/http.html#http_http_get_options_callback\n module.get = function (input, options, callback) {\n const req = newRequest(proto, overriddenGet.bind(module), [\n input,\n options,\n callback,\n ])\n req.end()\n return req\n }\n\n debug('- overridden request for', proto)\n })\n}\n\n/**\n * Restores `request` function of `http` and `https` modules to values they\n * held before they were overridden by us.\n */\nfunction restoreOverriddenRequests() {\n debug('restoring requests')\n Object.entries(requestOverrides).forEach(\n ([proto, { module, request, get }]) => {\n debug('- restoring request for', proto)\n module.request = request\n module.get = get\n debug('- restored request for', proto)\n },\n )\n requestOverrides = {}\n}\n\n/**\n * In WHATWG URL vernacular, this returns the origin portion of a URL.\n * However, the port is not included if it's standard and not already present on the host.\n */\nfunction normalizeOrigin(proto, host, port) {\n const hostHasPort = host.includes(':')\n const portIsStandard =\n (proto === 'http' && (port === 80 || port === '80')) ||\n (proto === 'https' && (port === 443 || port === '443'))\n const portStr = hostHasPort || portIsStandard ? '' : `:${port}`\n\n return `${proto}://${host}${portStr}`\n}\n\n/**\n * Get high level information about request as string\n * @param {Object} options\n * @param {string} options.method\n * @param {number|string} options.port\n * @param {string} options.proto Set internally. always http or https\n * @param {string} options.hostname\n * @param {string} options.path\n * @param {Object} options.headers\n * @param {string} body\n * @return {string}\n */\nfunction stringifyRequest(options, body) {\n const { method = 'GET', path = '', port } = options\n const origin = normalizeOrigin(options.proto, options.hostname, port)\n\n const log = {\n method,\n url: `${origin}${path}`,\n headers: options.headers,\n }\n\n if (body) {\n log.body = body\n }\n\n return JSON.stringify(log, null, 2)\n}\n\nfunction isContentEncoded(headers) {\n const contentEncoding = headers['content-encoding']\n return typeof contentEncoding === 'string' && contentEncoding !== ''\n}\n\nfunction contentEncoding(headers, encoder) {\n const contentEncoding = headers['content-encoding']\n return contentEncoding !== undefined && contentEncoding.toString() === encoder\n}\n\nfunction isJSONContent(headers) {\n // https://tools.ietf.org/html/rfc8259\n const contentType = String(headers['content-type'] || '').toLowerCase()\n return contentType.startsWith('application/json')\n}\n\n/**\n * Return a new object with all field names of the headers lower-cased.\n *\n * Duplicates throw an error.\n */\nfunction headersFieldNamesToLowerCase(headers, throwOnDuplicate) {\n if (!isPlainObject(headers)) {\n throw Error('Headers must be provided as an object')\n }\n\n const lowerCaseHeaders = {}\n Object.entries(headers).forEach(([fieldName, fieldValue]) => {\n const key = fieldName.toLowerCase()\n if (lowerCaseHeaders[key] !== undefined) {\n if (throwOnDuplicate) {\n throw Error(\n `Failed to convert header keys to lower case due to field name conflict: ${key}`,\n )\n } else {\n debug(\n `Duplicate header provided in request: ${key}. Only the last value can be matched.`,\n )\n }\n }\n lowerCaseHeaders[key] = fieldValue\n })\n\n return lowerCaseHeaders\n}\n\nconst headersFieldsArrayToLowerCase = headers => [\n ...new Set(headers.map(fieldName => fieldName.toLowerCase())),\n]\n\n/**\n * Converts the various accepted formats of headers into a flat array representing \"raw headers\".\n *\n * Nock allows headers to be provided as a raw array, a plain object, or a Map.\n *\n * While all the header names are expected to be strings, the values are left intact as they can\n * be functions, strings, or arrays of strings.\n *\n * https://nodejs.org/api/http.html#http_message_rawheaders\n */\nfunction headersInputToRawArray(headers) {\n if (headers === undefined) {\n return []\n }\n\n if (Array.isArray(headers)) {\n // If the input is an array, assume it's already in the raw format and simply return a copy\n // but throw an error if there aren't an even number of items in the array\n if (headers.length % 2) {\n throw new Error(\n `Raw headers must be provided as an array with an even number of items. [fieldName, value, ...]`,\n )\n }\n return [...headers]\n }\n\n // [].concat(...) is used instead of Array.flat until v11 is the minimum Node version\n if (util.types.isMap(headers)) {\n return [].concat(...Array.from(headers, ([k, v]) => [k.toString(), v]))\n }\n\n if (isPlainObject(headers)) {\n return [].concat(...Object.entries(headers))\n }\n\n throw new Error(\n `Headers must be provided as an array of raw values, a Map, or a plain Object. ${headers}`,\n )\n}\n\n/**\n * Converts an array of raw headers to an object, using the same rules as Nodes `http.IncomingMessage.headers`.\n *\n * Header names/keys are lower-cased.\n */\nfunction headersArrayToObject(rawHeaders) {\n if (!Array.isArray(rawHeaders)) {\n throw Error('Expected a header array')\n }\n\n const accumulator = {}\n\n forEachHeader(rawHeaders, (value, fieldName) => {\n addHeaderLine(accumulator, fieldName, value)\n })\n\n return accumulator\n}\n\nconst noDuplicatesHeaders = new Set([\n 'age',\n 'authorization',\n 'content-length',\n 'content-type',\n 'etag',\n 'expires',\n 'from',\n 'host',\n 'if-modified-since',\n 'if-unmodified-since',\n 'last-modified',\n 'location',\n 'max-forwards',\n 'proxy-authorization',\n 'referer',\n 'retry-after',\n 'user-agent',\n])\n\n/**\n * Set key/value data in accordance with Node's logic for folding duplicate headers.\n *\n * The `value` param should be a function, string, or array of strings.\n *\n * Node's docs and source:\n * https://nodejs.org/api/http.html#http_message_headers\n * https://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/_http_incoming.js#L245\n *\n * Header names are lower-cased.\n * Duplicates in raw headers are handled in the following ways, depending on the header name:\n * - Duplicates of field names listed in `noDuplicatesHeaders` (above) are discarded.\n * - `set-cookie` is always an array. Duplicates are added to the array.\n * - For duplicate `cookie` headers, the values are joined together with '; '.\n * - For all other headers, the values are joined together with ', '.\n *\n * Node's implementation is larger because it highly optimizes for not having to call `toLowerCase()`.\n * We've opted to always call `toLowerCase` in exchange for a more concise function.\n *\n * While Node has the luxury of knowing `value` is always a string, we do an extra step of coercion at the top.\n */\nfunction addHeaderLine(headers, name, value) {\n let values // code below expects `values` to be an array of strings\n if (typeof value === 'function') {\n // Function values are evaluated towards the end of the response, before that we use a placeholder\n // string just to designate that the header exists. Useful when `Content-Type` is set with a function.\n values = [value.name]\n } else if (Array.isArray(value)) {\n values = value.map(String)\n } else {\n values = [String(value)]\n }\n\n const key = name.toLowerCase()\n if (key === 'set-cookie') {\n // Array header -- only Set-Cookie at the moment\n if (headers['set-cookie'] === undefined) {\n headers['set-cookie'] = values\n } else {\n headers['set-cookie'].push(...values)\n }\n } else if (noDuplicatesHeaders.has(key)) {\n if (headers[key] === undefined) {\n // Drop duplicates\n headers[key] = values[0]\n }\n } else {\n if (headers[key] !== undefined) {\n values = [headers[key], ...values]\n }\n\n const separator = key === 'cookie' ? '; ' : ', '\n headers[key] = values.join(separator)\n }\n}\n\n/**\n * Deletes the given `fieldName` property from `headers` object by performing\n * case-insensitive search through keys.\n *\n * @headers {Object} headers - object of header field names and values\n * @fieldName {String} field name - string with the case-insensitive field name\n */\nfunction deleteHeadersField(headers, fieldNameToDelete) {\n if (!isPlainObject(headers)) {\n throw Error('headers must be an object')\n }\n\n if (typeof fieldNameToDelete !== 'string') {\n throw Error('field name must be a string')\n }\n\n const lowerCaseFieldNameToDelete = fieldNameToDelete.toLowerCase()\n\n // Search through the headers and delete all values whose field name matches the given field name.\n Object.keys(headers)\n .filter(fieldName => fieldName.toLowerCase() === lowerCaseFieldNameToDelete)\n .forEach(fieldName => delete headers[fieldName])\n}\n\n/**\n * Utility for iterating over a raw headers array.\n *\n * The callback is called with:\n * - The header value. string, array of strings, or a function\n * - The header field name. string\n * - Index of the header field in the raw header array.\n */\nfunction forEachHeader(rawHeaders, callback) {\n for (let i = 0; i < rawHeaders.length; i += 2) {\n callback(rawHeaders[i + 1], rawHeaders[i], i)\n }\n}\n\nfunction percentDecode(str) {\n try {\n return decodeURIComponent(str.replace(/\\+/g, ' '))\n } catch (e) {\n return str\n }\n}\n\n/**\n * URI encode the provided string, stringently adhering to RFC 3986.\n *\n * RFC 3986 reserves !, ', (, ), and * but encodeURIComponent does not encode them so we do it manually.\n *\n * https://tools.ietf.org/html/rfc3986\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent\n */\nfunction percentEncode(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n })\n}\n\nfunction matchStringOrRegexp(target, pattern) {\n const targetStr =\n target === undefined || target === null ? '' : String(target)\n\n if (pattern instanceof RegExp) {\n // if the regexp happens to have a global flag, we want to ensure we test the entire target\n pattern.lastIndex = 0\n return pattern.test(targetStr)\n }\n return targetStr === String(pattern)\n}\n\n/**\n * Formats a query parameter.\n *\n * @param key The key of the query parameter to format.\n * @param value The value of the query parameter to format.\n * @param stringFormattingFn The function used to format string values. Can\n * be used to encode or decode the query value.\n *\n * @returns *[] the formatted [key, value] pair.\n */\nfunction formatQueryValue(key, value, stringFormattingFn) {\n // TODO: Probably refactor code to replace `switch(true)` with `if`/`else`.\n switch (true) {\n case typeof value === 'number': // fall-through\n case typeof value === 'boolean':\n value = value.toString()\n break\n case value === null:\n case value === undefined:\n value = ''\n break\n case typeof value === 'string':\n if (stringFormattingFn) {\n value = stringFormattingFn(value)\n }\n break\n case value instanceof RegExp:\n break\n case Array.isArray(value): {\n value = value.map(function (val, idx) {\n return formatQueryValue(idx, val, stringFormattingFn)[1]\n })\n break\n }\n case typeof value === 'object': {\n value = Object.entries(value).reduce(function (acc, [subKey, subVal]) {\n const subPair = formatQueryValue(subKey, subVal, stringFormattingFn)\n acc[subPair[0]] = subPair[1]\n\n return acc\n }, {})\n break\n }\n }\n\n if (stringFormattingFn) key = stringFormattingFn(key)\n return [key, value]\n}\n\nfunction isStream(obj) {\n return (\n obj &&\n typeof obj !== 'string' &&\n !Buffer.isBuffer(obj) &&\n typeof obj.setEncoding === 'function'\n )\n}\n\n/**\n * Converts the arguments from the various signatures of http[s].request into a standard\n * options object and an optional callback function.\n *\n * https://nodejs.org/api/http.html#http_http_request_url_options_callback\n *\n * Taken from the beginning of the native `ClientRequest`.\n * https://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/_http_client.js#L68\n */\nfunction normalizeClientRequestArgs(input, options, cb) {\n if (typeof input === 'string') {\n input = urlToOptions(new url.URL(input))\n } else if (input instanceof url.URL) {\n input = urlToOptions(input)\n } else {\n cb = options\n options = input\n input = null\n }\n\n if (typeof options === 'function') {\n cb = options\n options = input || {}\n } else {\n options = Object.assign(input || {}, options)\n }\n\n return { options, callback: cb }\n}\n\n/**\n * Utility function that converts a URL object into an ordinary\n * options object as expected by the http.request and https.request APIs.\n *\n * This was copied from Node's source\n * https://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/internal/url.js#L1257\n */\nfunction urlToOptions(url) {\n const options = {\n protocol: url.protocol,\n hostname:\n typeof url.hostname === 'string' && url.hostname.startsWith('[')\n ? url.hostname.slice(1, -1)\n : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname}${url.search || ''}`,\n href: url.href,\n }\n if (url.port !== '') {\n options.port = Number(url.port)\n }\n if (url.username || url.password) {\n options.auth = `${url.username}:${url.password}`\n }\n return options\n}\n\n/**\n * Determines if request data matches the expected schema.\n *\n * Used for comparing decoded search parameters, request body JSON objects,\n * and URL decoded request form bodies.\n *\n * Performs a general recursive strict comparison with two caveats:\n * - The expected data can use regexp to compare values\n * - JSON path notation and nested objects are considered equal\n */\nconst dataEqual = (expected, actual) => {\n if (isPlainObject(expected)) {\n expected = expand(expected)\n }\n if (isPlainObject(actual)) {\n actual = expand(actual)\n }\n return deepEqual(expected, actual)\n}\n\n/**\n * Performs a recursive strict comparison between two values.\n *\n * Expected values or leaf nodes of expected object values that are RegExp use test() for comparison.\n */\nfunction deepEqual(expected, actual) {\n debug('deepEqual comparing', typeof expected, expected, typeof actual, actual)\n if (expected instanceof RegExp) {\n return expected.test(actual)\n }\n\n if (Array.isArray(expected) && Array.isArray(actual)) {\n if (expected.length !== actual.length) {\n return false\n }\n\n return expected.every((expVal, idx) => deepEqual(expVal, actual[idx]))\n }\n\n if (isPlainObject(expected) && isPlainObject(actual)) {\n const allKeys = Array.from(\n new Set(Object.keys(expected).concat(Object.keys(actual))),\n )\n\n return allKeys.every(key => deepEqual(expected[key], actual[key]))\n }\n\n return expected === actual\n}\n\nconst timeouts = []\nconst intervals = []\nconst immediates = []\n\nconst wrapTimer =\n (timer, ids) =>\n (...args) => {\n const id = timer(...args)\n ids.push(id)\n return id\n }\n\nconst setTimeout = wrapTimer(timers.setTimeout, timeouts)\nconst setInterval = wrapTimer(timers.setInterval, intervals)\nconst setImmediate = wrapTimer(timers.setImmediate, immediates)\n\nfunction clearTimer(clear, ids) {\n while (ids.length) {\n clear(ids.shift())\n }\n}\n\nfunction removeAllTimers() {\n clearTimer(clearTimeout, timeouts)\n clearTimer(clearInterval, intervals)\n clearTimer(clearImmediate, immediates)\n}\n\n/**\n * Check if the Client Request has been cancelled.\n *\n * Until Node 14 is the minimum, we need to look at both flags to see if the request has been cancelled.\n * The two flags have the same purpose, but the Node maintainers are migrating from `abort(ed)` to\n * `destroy(ed)` terminology, to be more consistent with `stream.Writable`.\n * In Node 14.x+, Calling `abort()` will set both `aborted` and `destroyed` to true, however,\n * calling `destroy()` will only set `destroyed` to true.\n * Falling back on checking if the socket is destroyed to cover the case of Node <14.x where\n * `destroy()` is called, but `destroyed` is undefined.\n *\n * Node Client Request history:\n * - `request.abort()`: Added in: v0.3.8, Deprecated since: v14.1.0, v13.14.0\n * - `request.aborted`: Added in: v0.11.14, Became a boolean instead of a timestamp: v11.0.0, Not deprecated (yet)\n * - `request.destroy()`: Added in: v0.3.0\n * - `request.destroyed`: Added in: v14.1.0, v13.14.0\n *\n * @param {ClientRequest} req\n * @returns {boolean}\n */\nfunction isRequestDestroyed(req) {\n return !!(\n req.destroyed === true ||\n req.aborted ||\n (req.socket && req.socket.destroyed)\n )\n}\n\n/**\n * Returns true if the given value is a plain object and not an Array.\n * @param {*} value\n * @returns {boolean}\n */\nfunction isPlainObject(value) {\n if (typeof value !== 'object' || value === null) return false\n\n if (Object.prototype.toString.call(value) !== '[object Object]') return false\n\n const proto = Object.getPrototypeOf(value)\n if (proto === null) return true\n\n const Ctor =\n Object.prototype.hasOwnProperty.call(proto, 'constructor') &&\n proto.constructor\n return (\n typeof Ctor === 'function' &&\n Ctor instanceof Ctor &&\n Function.prototype.call(Ctor) === Function.prototype.call(value)\n )\n}\n\nconst prototypePollutionBlockList = ['__proto__', 'prototype', 'constructor']\nconst blocklistFilter = function (part) {\n return prototypePollutionBlockList.indexOf(part) === -1\n}\n\n/**\n * Converts flat objects whose keys use JSON path notation to nested objects.\n *\n * The input object is not mutated.\n *\n * @example\n * { 'foo[bar][0]': 'baz' } -> { foo: { bar: [ 'baz' ] } }\n */\nconst expand = input => {\n if (input === undefined || input === null) {\n return input\n }\n\n const keys = Object.keys(input)\n\n const result = {}\n let resultPtr = result\n\n for (let path of keys) {\n const originalPath = path\n if (path.indexOf('[') >= 0) {\n path = path.replace(/\\[/g, '.').replace(/]/g, '')\n }\n\n const parts = path.split('.')\n\n const check = parts.filter(blocklistFilter)\n\n if (check.length !== parts.length) {\n return undefined\n }\n resultPtr = result\n const lastIndex = parts.length - 1\n\n for (let i = 0; i < parts.length; ++i) {\n const part = parts[i]\n if (i === lastIndex) {\n if (Array.isArray(resultPtr)) {\n resultPtr[+part] = input[originalPath]\n } else {\n resultPtr[part] = input[originalPath]\n }\n } else {\n if (resultPtr[part] === undefined || resultPtr[part] === null) {\n const nextPart = parts[i + 1]\n if (/^\\d+$/.test(nextPart)) {\n resultPtr[part] = []\n } else {\n resultPtr[part] = {}\n }\n }\n resultPtr = resultPtr[part]\n }\n }\n }\n return result\n}\n\nmodule.exports = {\n contentEncoding,\n dataEqual,\n deleteHeadersField,\n expand,\n forEachHeader,\n formatQueryValue,\n headersArrayToObject,\n headersFieldNamesToLowerCase,\n headersFieldsArrayToLowerCase,\n headersInputToRawArray,\n isContentEncoded,\n isJSONContent,\n isPlainObject,\n isRequestDestroyed,\n isStream,\n isUtf8Representable,\n matchStringOrRegexp,\n normalizeClientRequestArgs,\n normalizeOrigin,\n normalizeRequestOptions,\n overrideRequests,\n percentDecode,\n percentEncode,\n removeAllTimers,\n restoreOverriddenRequests,\n setImmediate,\n setInterval,\n setTimeout,\n stringifyRequest,\n}\n","'use strict'\n\nfunction propagate(events, source, dest) {\n if (arguments.length < 3) {\n dest = source\n source = events\n events = undefined\n }\n\n // events should be an array or object\n const eventsIsObject = typeof events === 'object'\n if (events && !eventsIsObject) events = [events]\n\n if (eventsIsObject) {\n return explicitPropagate(events, source, dest)\n }\n\n const shouldPropagate = eventName =>\n events === undefined || events.includes(eventName)\n\n const oldEmit = source.emit\n\n // Returns true if the event had listeners, false otherwise.\n // https://nodejs.org/api/events.html#events_emitter_emit_eventname_args\n source.emit = (eventName, ...args) => {\n const oldEmitHadListeners = oldEmit.call(source, eventName, ...args)\n\n let destEmitHadListeners = false\n if (shouldPropagate(eventName)) {\n destEmitHadListeners = dest.emit(eventName, ...args)\n }\n\n return oldEmitHadListeners || destEmitHadListeners\n }\n\n function end() {\n source.emit = oldEmit\n }\n\n return {\n end,\n }\n}\n\nmodule.exports = propagate\n\nfunction explicitPropagate(events, source, dest) {\n let eventsIn\n let eventsOut\n if (Array.isArray(events)) {\n eventsIn = events\n eventsOut = events\n } else {\n eventsIn = Object.keys(events)\n eventsOut = eventsIn.map(function(key) {\n return events[key]\n })\n }\n\n const listeners = eventsOut.map(function(event) {\n return function() {\n const args = Array.prototype.slice.call(arguments)\n args.unshift(event)\n dest.emit.apply(dest, args)\n }\n })\n\n listeners.forEach(register)\n\n return {\n end,\n }\n\n function register(listener, i) {\n source.on(eventsIn[i], listener)\n }\n\n function unregister(listener, i) {\n source.removeListener(eventsIn[i], listener)\n }\n\n function end() {\n listeners.forEach(unregister)\n }\n}\n","'use strict'\n\nconst { EventEmitter } = require('events')\n\nmodule.exports = new EventEmitter()\n","'use strict'\n\nconst { EventEmitter } = require('events')\nconst debug = require('debug')('nock.socket')\n\nmodule.exports = class Socket extends EventEmitter {\n constructor(options) {\n super()\n\n // Pretend this is a TLSSocket\n if (options.proto === 'https') {\n // https://github.com/nock/nock/issues/158\n this.authorized = true\n // https://github.com/nock/nock/issues/2147\n this.encrypted = true\n }\n\n this.bufferSize = 0\n this.writableLength = 0\n this.writable = true\n this.readable = true\n this.pending = false\n this.destroyed = false\n this.connecting = true\n\n // Undocumented flag used by ClientRequest to ensure errors aren't double-fired\n this._hadError = false\n\n // Maximum allowed delay. 0 means unlimited.\n this.timeout = 0\n\n const ipv6 = options.family === 6\n this.remoteFamily = ipv6 ? 'IPv6' : 'IPv4'\n this.localAddress = this.remoteAddress = ipv6 ? '::1' : '127.0.0.1'\n this.localPort = this.remotePort = parseInt(options.port)\n }\n\n setNoDelay() {}\n setKeepAlive() {}\n resume() {}\n ref() {}\n unref() {}\n write() {}\n\n address() {\n return {\n port: this.remotePort,\n family: this.remoteFamily,\n address: this.remoteAddress,\n }\n }\n\n setTimeout(timeoutMs, fn) {\n this.timeout = timeoutMs\n if (fn) {\n this.once('timeout', fn)\n }\n return this\n }\n\n /**\n * Artificial delay that will trip socket timeouts when appropriate.\n *\n * Doesn't actually wait for time to pass.\n * Timeout events don't necessarily end the request.\n * While many clients choose to abort the request upon a timeout, Node itself does not.\n */\n applyDelay(delayMs) {\n if (this.timeout && delayMs > this.timeout) {\n debug('socket timeout')\n this.emit('timeout')\n }\n }\n\n getPeerCertificate() {\n return Buffer.from(\n (Math.random() * 10000 + Date.now()).toString(),\n ).toString('base64')\n }\n\n /**\n * Denotes that no more I/O activity should happen on this socket.\n *\n * The implementation in Node if far more complex as it juggles underlying async streams.\n * For the purposes of Nock, we just need it to set some flags and on the first call\n * emit a 'close' and optional 'error' event. Both events propagate through the request object.\n */\n destroy(err) {\n if (this.destroyed) {\n return this\n }\n\n debug('socket destroy')\n this.destroyed = true\n this.readable = this.writable = false\n this.readableEnded = this.writableFinished = true\n\n process.nextTick(() => {\n if (err) {\n this._hadError = true\n this.emit('error', err)\n }\n this.emit('close')\n })\n\n return this\n }\n}\n","'use strict'\n\nconst stream = require('stream')\nconst util = require('util')\nconst zlib = require('zlib')\nconst debug = require('debug')('nock.playback_interceptor')\nconst common = require('./common')\n\nfunction parseJSONRequestBody(req, requestBody) {\n if (!requestBody || !common.isJSONContent(req.headers)) {\n return requestBody\n }\n\n if (common.contentEncoding(req.headers, 'gzip')) {\n requestBody = String(zlib.gunzipSync(Buffer.from(requestBody, 'hex')))\n } else if (common.contentEncoding(req.headers, 'deflate')) {\n requestBody = String(zlib.inflateSync(Buffer.from(requestBody, 'hex')))\n }\n\n return JSON.parse(requestBody)\n}\n\nfunction parseFullReplyResult(response, fullReplyResult) {\n debug('full response from callback result: %j', fullReplyResult)\n\n if (!Array.isArray(fullReplyResult)) {\n throw Error('A single function provided to .reply MUST return an array')\n }\n\n if (fullReplyResult.length > 3) {\n throw Error(\n 'The array returned from the .reply callback contains too many values',\n )\n }\n\n const [status, body = '', headers] = fullReplyResult\n\n if (!Number.isInteger(status)) {\n throw new Error(`Invalid ${typeof status} value for status code`)\n }\n\n response.statusCode = status\n response.rawHeaders.push(...common.headersInputToRawArray(headers))\n debug('response.rawHeaders after reply: %j', response.rawHeaders)\n\n return body\n}\n\n/**\n * Determine which of the default headers should be added to the response.\n *\n * Don't include any defaults whose case-insensitive keys are already on the response.\n */\nfunction selectDefaultHeaders(existingHeaders, defaultHeaders) {\n if (!defaultHeaders.length) {\n return [] // return early if we don't need to bother\n }\n\n const definedHeaders = new Set()\n const result = []\n\n common.forEachHeader(existingHeaders, (_, fieldName) => {\n definedHeaders.add(fieldName.toLowerCase())\n })\n common.forEachHeader(defaultHeaders, (value, fieldName) => {\n if (!definedHeaders.has(fieldName.toLowerCase())) {\n result.push(fieldName, value)\n }\n })\n\n return result\n}\n\n// Presents a list of Buffers as a Readable\nclass ReadableBuffers extends stream.Readable {\n constructor(buffers, opts = {}) {\n super(opts)\n\n this.buffers = buffers\n }\n\n _read(_size) {\n while (this.buffers.length) {\n if (!this.push(this.buffers.shift())) {\n return\n }\n }\n this.push(null)\n }\n}\n\nfunction convertBodyToStream(body) {\n if (common.isStream(body)) {\n return body\n }\n\n if (body === undefined) {\n return new ReadableBuffers([])\n }\n\n if (Buffer.isBuffer(body)) {\n return new ReadableBuffers([body])\n }\n\n if (typeof body !== 'string') {\n body = JSON.stringify(body)\n }\n\n return new ReadableBuffers([Buffer.from(body)])\n}\n\n/**\n * Play back an interceptor using the given request and mock response.\n */\nfunction playbackInterceptor({\n req,\n socket,\n options,\n requestBodyString,\n requestBodyIsUtf8Representable,\n response,\n interceptor,\n}) {\n const { logger } = interceptor.scope\n\n function start() {\n req.headers = req.getHeaders()\n\n interceptor.scope.emit('request', req, interceptor, requestBodyString)\n\n if (typeof interceptor.errorMessage !== 'undefined') {\n let error\n if (typeof interceptor.errorMessage === 'object') {\n error = interceptor.errorMessage\n } else {\n error = new Error(interceptor.errorMessage)\n }\n\n const delay = interceptor.delayBodyInMs + interceptor.delayConnectionInMs\n common.setTimeout(() => req.destroy(error), delay)\n return\n }\n\n // This will be null if we have a fullReplyFunction,\n // in that case status code will be set in `parseFullReplyResult`\n response.statusCode = interceptor.statusCode\n\n // Clone headers/rawHeaders to not override them when evaluating later\n response.rawHeaders = [...interceptor.rawHeaders]\n logger('response.rawHeaders:', response.rawHeaders)\n\n // TODO: MAJOR: Don't tack the request onto the interceptor.\n // The only reason we do this is so that it's available inside reply functions.\n // It would be better to pass the request as an argument to the functions instead.\n // Not adding the req as a third arg now because it should first be decided if (path, body, req)\n // is the signature we want to go with going forward.\n interceptor.req = req\n\n if (interceptor.replyFunction) {\n const parsedRequestBody = parseJSONRequestBody(req, requestBodyString)\n\n let fn = interceptor.replyFunction\n if (fn.length === 3) {\n // Handle the case of an async reply function, the third parameter being the callback.\n fn = util.promisify(fn)\n }\n\n // At this point `fn` is either a synchronous function or a promise-returning function;\n // wrapping in `Promise.resolve` makes it into a promise either way.\n Promise.resolve(fn.call(interceptor, options.path, parsedRequestBody))\n .then(continueWithResponseBody)\n .catch(err => req.destroy(err))\n return\n }\n\n if (interceptor.fullReplyFunction) {\n const parsedRequestBody = parseJSONRequestBody(req, requestBodyString)\n\n let fn = interceptor.fullReplyFunction\n if (fn.length === 3) {\n fn = util.promisify(fn)\n }\n\n Promise.resolve(fn.call(interceptor, options.path, parsedRequestBody))\n .then(continueWithFullResponse)\n .catch(err => req.destroy(err))\n return\n }\n\n if (\n common.isContentEncoded(interceptor.headers) &&\n !common.isStream(interceptor.body)\n ) {\n // If the content is encoded we know that the response body *must* be an array\n // of response buffers which should be mocked one by one.\n // (otherwise decompressions after the first one fails as unzip expects to receive\n // buffer by buffer and not one single merged buffer)\n const bufferData = Array.isArray(interceptor.body)\n ? interceptor.body\n : [interceptor.body]\n const responseBuffers = bufferData.map(data => Buffer.from(data, 'hex'))\n const responseBody = new ReadableBuffers(responseBuffers)\n continueWithResponseBody(responseBody)\n return\n }\n\n // If we get to this point, the body is either a string or an object that\n // will eventually be JSON stringified.\n let responseBody = interceptor.body\n\n // If the request was not UTF8-representable then we assume that the\n // response won't be either. In that case we send the response as a Buffer\n // object as that's what the client will expect.\n if (!requestBodyIsUtf8Representable && typeof responseBody === 'string') {\n // Try to create the buffer from the interceptor's body response as hex.\n responseBody = Buffer.from(responseBody, 'hex')\n\n // Creating buffers does not necessarily throw errors; check for difference in size.\n if (\n !responseBody ||\n (interceptor.body.length > 0 && responseBody.length === 0)\n ) {\n // We fallback on constructing buffer from utf8 representation of the body.\n responseBody = Buffer.from(interceptor.body, 'utf8')\n }\n }\n\n return continueWithResponseBody(responseBody)\n }\n\n function continueWithFullResponse(fullReplyResult) {\n let responseBody\n try {\n responseBody = parseFullReplyResult(response, fullReplyResult)\n } catch (err) {\n req.destroy(err)\n return\n }\n\n continueWithResponseBody(responseBody)\n }\n\n function prepareResponseHeaders(body) {\n const defaultHeaders = [...interceptor.scope._defaultReplyHeaders]\n\n // Include a JSON content type when JSON.stringify is called on the body.\n // This is a convenience added by Nock that has no analog in Node. It's added to the\n // defaults, so it will be ignored if the caller explicitly provided the header already.\n const isJSON =\n body !== undefined &&\n typeof body !== 'string' &&\n !Buffer.isBuffer(body) &&\n !common.isStream(body)\n\n if (isJSON) {\n defaultHeaders.push('Content-Type', 'application/json')\n }\n\n response.rawHeaders.push(\n ...selectDefaultHeaders(response.rawHeaders, defaultHeaders),\n )\n\n // Evaluate functional headers.\n common.forEachHeader(response.rawHeaders, (value, fieldName, i) => {\n if (typeof value === 'function') {\n response.rawHeaders[i + 1] = value(req, response, body)\n }\n })\n\n response.headers = common.headersArrayToObject(response.rawHeaders)\n }\n\n function continueWithResponseBody(rawBody) {\n prepareResponseHeaders(rawBody)\n const bodyAsStream = convertBodyToStream(rawBody)\n bodyAsStream.pause()\n\n // IncomingMessage extends Readable so we can't simply pipe.\n bodyAsStream.on('data', function (chunk) {\n response.push(chunk)\n })\n bodyAsStream.on('end', function () {\n // https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_message_complete\n response.complete = true\n response.push(null)\n\n interceptor.scope.emit('replied', req, interceptor)\n })\n bodyAsStream.on('error', function (err) {\n response.emit('error', err)\n })\n\n const { delayBodyInMs, delayConnectionInMs } = interceptor\n\n function respond() {\n if (common.isRequestDestroyed(req)) {\n return\n }\n\n // Even though we've had the response object for awhile at this point,\n // we only attach it to the request immediately before the `response`\n // event because, as in Node, it alters the error handling around aborts.\n req.res = response\n response.req = req\n\n logger('emitting response')\n req.emit('response', response)\n\n common.setTimeout(() => bodyAsStream.resume(), delayBodyInMs)\n }\n\n socket.applyDelay(delayConnectionInMs)\n common.setTimeout(respond, delayConnectionInMs)\n }\n\n // Calling `start` immediately could take the request all the way to the connection delay\n // during a single microtask execution. This setImmediate stalls the playback to ensure the\n // correct events are emitted first ('socket', 'finish') and any aborts in the queue or\n // called during a 'finish' listener can be called.\n common.setImmediate(() => {\n if (!common.isRequestDestroyed(req)) {\n start()\n }\n })\n}\n\nmodule.exports = { playbackInterceptor }\n","'use strict'\n\nconst debug = require('debug')('nock.request_overrider')\nconst {\n IncomingMessage,\n ClientRequest,\n request: originalHttpRequest,\n} = require('http')\nconst { request: originalHttpsRequest } = require('https')\nconst propagate = require('propagate')\nconst common = require('./common')\nconst globalEmitter = require('./global_emitter')\nconst Socket = require('./socket')\nconst { playbackInterceptor } = require('./playback_interceptor')\n\nfunction socketOnClose(req) {\n debug('socket close')\n\n if (!req.res && !req.socket._hadError) {\n // If we don't have a response then we know that the socket\n // ended prematurely and we need to emit an error on the request.\n req.socket._hadError = true\n const err = new Error('socket hang up')\n err.code = 'ECONNRESET'\n req.emit('error', err)\n }\n req.emit('close')\n}\n\n/**\n * Given a group of interceptors, appropriately route an outgoing request.\n * Identify which interceptor ought to respond, if any, then delegate to\n * `playbackInterceptor()` to consume the request itself.\n */\nclass InterceptedRequestRouter {\n constructor({ req, options, interceptors }) {\n this.req = req\n this.options = {\n // We may be changing the options object and we don't want those changes\n // affecting the user so we use a clone of the object.\n ...options,\n // We use lower-case header field names throughout Nock.\n headers: common.headersFieldNamesToLowerCase(\n options.headers || {},\n false,\n ),\n }\n this.interceptors = interceptors\n\n this.socket = new Socket(options)\n\n // support setting `timeout` using request `options`\n // https://nodejs.org/docs/latest-v12.x/api/http.html#http_http_request_url_options_callback\n // any timeout in the request options override any timeout in the agent options.\n // per https://github.com/nodejs/node/pull/21204\n const timeout =\n options.timeout ||\n (options.agent && options.agent.options && options.agent.options.timeout)\n\n if (timeout) {\n this.socket.setTimeout(timeout)\n }\n\n this.response = new IncomingMessage(this.socket)\n this.requestBodyBuffers = []\n this.playbackStarted = false\n\n // For parity with Node, it's important the socket event is emitted before we begin playback.\n // This flag is set when playback is triggered if we haven't yet gotten the\n // socket event to indicate that playback should start as soon as it comes in.\n this.readyToStartPlaybackOnSocketEvent = false\n\n this.attachToReq()\n\n // Emit a fake socket event on the next tick to mimic what would happen on a real request.\n // Some clients listen for a 'socket' event to be emitted before calling end(),\n // which causes Nock to hang.\n process.nextTick(() => this.connectSocket())\n }\n\n attachToReq() {\n const { req, options } = this\n\n for (const [name, val] of Object.entries(options.headers)) {\n req.setHeader(name.toLowerCase(), val)\n }\n\n if (options.auth && !options.headers.authorization) {\n req.setHeader(\n // We use lower-case header field names throughout Nock.\n 'authorization',\n `Basic ${Buffer.from(options.auth).toString('base64')}`,\n )\n }\n\n req.path = options.path\n req.method = options.method\n\n req.write = (...args) => this.handleWrite(...args)\n req.end = (...args) => this.handleEnd(...args)\n req.flushHeaders = (...args) => this.handleFlushHeaders(...args)\n\n // https://github.com/nock/nock/issues/256\n if (options.headers.expect === '100-continue') {\n common.setImmediate(() => {\n debug('continue')\n req.emit('continue')\n })\n }\n }\n\n connectSocket() {\n const { req, socket } = this\n\n if (common.isRequestDestroyed(req)) {\n return\n }\n\n // ClientRequest.connection is an alias for ClientRequest.socket\n // https://nodejs.org/api/http.html#http_request_socket\n // https://github.com/nodejs/node/blob/b0f75818f39ed4e6bd80eb7c4010c1daf5823ef7/lib/_http_client.js#L640-L641\n // The same Socket is shared between the request and response to mimic native behavior.\n req.socket = req.connection = socket\n\n propagate(['error', 'timeout'], socket, req)\n socket.on('close', () => socketOnClose(req))\n\n socket.connecting = false\n req.emit('socket', socket)\n\n // https://nodejs.org/api/net.html#net_event_connect\n socket.emit('connect')\n\n // https://nodejs.org/api/tls.html#tls_event_secureconnect\n if (socket.authorized) {\n socket.emit('secureConnect')\n }\n\n if (this.readyToStartPlaybackOnSocketEvent) {\n this.maybeStartPlayback()\n }\n }\n\n // from docs: When write function is called with empty string or buffer, it does nothing and waits for more input.\n // However, actually implementation checks the state of finished and aborted before checking if the first arg is empty.\n handleWrite(...args) {\n debug('request write')\n\n let [buffer, encoding] = args\n\n const { req } = this\n\n if (req.finished) {\n const err = new Error('write after end')\n err.code = 'ERR_STREAM_WRITE_AFTER_END'\n process.nextTick(() => req.emit('error', err))\n\n // It seems odd to return `true` here, not sure why you'd want to have\n // the stream potentially written to more, but it's what Node does.\n // https://github.com/nodejs/node/blob/a9270dcbeba4316b1e179b77ecb6c46af5aa8c20/lib/_http_outgoing.js#L662-L665\n return true\n }\n\n if (req.socket && req.socket.destroyed) {\n return false\n }\n\n if (!buffer) {\n return true\n }\n\n if (!Buffer.isBuffer(buffer)) {\n buffer = Buffer.from(buffer, encoding)\n }\n this.requestBodyBuffers.push(buffer)\n\n // writable.write encoding param is optional\n // so if callback is present it's the last argument\n const callback = args.length > 1 ? args[args.length - 1] : undefined\n // can't use instanceof Function because some test runners\n // run tests in vm.runInNewContext where Function is not same\n // as that in the current context\n // https://github.com/nock/nock/pull/1754#issuecomment-571531407\n if (typeof callback === 'function') {\n callback()\n }\n\n common.setImmediate(function () {\n req.emit('drain')\n })\n\n return false\n }\n\n handleEnd(chunk, encoding, callback) {\n debug('request end')\n const { req } = this\n\n // handle the different overloaded arg signatures\n if (typeof chunk === 'function') {\n callback = chunk\n chunk = null\n } else if (typeof encoding === 'function') {\n callback = encoding\n encoding = null\n }\n\n if (typeof callback === 'function') {\n req.once('finish', callback)\n }\n\n if (chunk) {\n req.write(chunk, encoding)\n }\n req.finished = true\n this.maybeStartPlayback()\n\n return req\n }\n\n handleFlushHeaders() {\n debug('request flushHeaders')\n this.maybeStartPlayback()\n }\n\n /**\n * Set request headers of the given request. This is needed both during the\n * routing phase, in case header filters were specified, and during the\n * interceptor-playback phase, to correctly pass mocked request headers.\n * TODO There are some problems with this; see https://github.com/nock/nock/issues/1718\n */\n setHostHeaderUsingInterceptor(interceptor) {\n const { req, options } = this\n\n // If a filtered scope is being used we have to use scope's host in the\n // header, otherwise 'host' header won't match.\n // NOTE: We use lower-case header field names throughout Nock.\n const HOST_HEADER = 'host'\n if (interceptor.__nock_filteredScope && interceptor.__nock_scopeHost) {\n options.headers[HOST_HEADER] = interceptor.__nock_scopeHost\n req.setHeader(HOST_HEADER, interceptor.__nock_scopeHost)\n } else {\n // For all other cases, we always add host header equal to the requested\n // host unless it was already defined.\n if (options.host && !req.getHeader(HOST_HEADER)) {\n let hostHeader = options.host\n\n if (options.port === 80 || options.port === 443) {\n hostHeader = hostHeader.split(':')[0]\n }\n\n req.setHeader(HOST_HEADER, hostHeader)\n }\n }\n }\n\n maybeStartPlayback() {\n const { req, socket, playbackStarted } = this\n\n // In order to get the events in the right order we need to delay playback\n // if we get here before the `socket` event is emitted.\n if (socket.connecting) {\n this.readyToStartPlaybackOnSocketEvent = true\n return\n }\n\n if (!common.isRequestDestroyed(req) && !playbackStarted) {\n this.startPlayback()\n }\n }\n\n startPlayback() {\n debug('ending')\n this.playbackStarted = true\n\n const { req, response, socket, options, interceptors } = this\n\n Object.assign(options, {\n // Re-update `options` with the current value of `req.path` because badly\n // behaving agents like superagent like to change `req.path` mid-flight.\n path: req.path,\n // Similarly, node-http-proxy will modify headers in flight, so we have\n // to put the headers back into options.\n // https://github.com/nock/nock/pull/1484\n headers: req.getHeaders(),\n // Fixes https://github.com/nock/nock/issues/976\n protocol: `${options.proto}:`,\n })\n\n interceptors.forEach(interceptor => {\n this.setHostHeaderUsingInterceptor(interceptor)\n })\n\n const requestBodyBuffer = Buffer.concat(this.requestBodyBuffers)\n // When request body is a binary buffer we internally use in its hexadecimal\n // representation.\n const requestBodyIsUtf8Representable =\n common.isUtf8Representable(requestBodyBuffer)\n const requestBodyString = requestBodyBuffer.toString(\n requestBodyIsUtf8Representable ? 'utf8' : 'hex',\n )\n\n const matchedInterceptor = interceptors.find(i =>\n i.match(req, options, requestBodyString),\n )\n\n if (matchedInterceptor) {\n matchedInterceptor.scope.logger(\n 'interceptor identified, starting mocking',\n )\n\n matchedInterceptor.markConsumed()\n\n // wait to emit the finish event until we know for sure an Interceptor is going to playback.\n // otherwise an unmocked request might emit finish twice.\n req.emit('finish')\n\n playbackInterceptor({\n req,\n socket,\n options,\n requestBodyString,\n requestBodyIsUtf8Representable,\n response,\n interceptor: matchedInterceptor,\n })\n } else {\n globalEmitter.emit('no match', req, options, requestBodyString)\n\n // Try to find a hostname match that allows unmocked.\n const allowUnmocked = interceptors.some(\n i => i.matchHostName(options) && i.options.allowUnmocked,\n )\n\n if (allowUnmocked && req instanceof ClientRequest) {\n const newReq =\n options.proto === 'https'\n ? originalHttpsRequest(options)\n : originalHttpRequest(options)\n\n propagate(newReq, req)\n // We send the raw buffer as we received it, not as we interpreted it.\n newReq.end(requestBodyBuffer)\n } else {\n const reqStr = common.stringifyRequest(options, requestBodyString)\n const err = new Error(`Nock: No match for request ${reqStr}`)\n err.code = 'ERR_NOCK_NO_MATCH'\n err.statusCode = err.status = 404\n req.destroy(err)\n }\n }\n }\n}\n\nmodule.exports = { InterceptedRequestRouter }\n","exports = module.exports = stringify\nexports.getSerialize = serializer\n\nfunction stringify(obj, replacer, spaces, cycleReplacer) {\n return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)\n}\n\nfunction serializer(replacer, cycleReplacer) {\n var stack = [], keys = []\n\n if (cycleReplacer == null) cycleReplacer = function(key, value) {\n if (stack[0] === value) return \"[Circular ~]\"\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\"\n }\n\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this)\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)\n }\n else stack.push(value)\n\n return replacer == null ? value : replacer.call(this, key, value)\n }\n}\n","'use strict'\n\nconst querystring = require('querystring')\n\nconst common = require('./common')\n\nmodule.exports = function matchBody(options, spec, body) {\n if (spec instanceof RegExp) {\n return spec.test(body)\n }\n\n if (Buffer.isBuffer(spec)) {\n const encoding = common.isUtf8Representable(spec) ? 'utf8' : 'hex'\n spec = spec.toString(encoding)\n }\n\n const contentType = (\n (options.headers &&\n (options.headers['Content-Type'] || options.headers['content-type'])) ||\n ''\n ).toString()\n\n const isMultipart = contentType.includes('multipart')\n const isUrlencoded = contentType.includes('application/x-www-form-urlencoded')\n\n // try to transform body to json\n let json\n if (typeof spec === 'object' || typeof spec === 'function') {\n try {\n json = JSON.parse(body)\n } catch (err) {\n // not a valid JSON string\n }\n if (json !== undefined) {\n body = json\n } else if (isUrlencoded) {\n body = querystring.parse(body)\n }\n }\n\n if (typeof spec === 'function') {\n return spec.call(options, body)\n }\n\n // strip line endings from both so that we get a match no matter what OS we are running on\n // if Content-Type does not contain 'multipart'\n if (!isMultipart && typeof body === 'string') {\n body = body.replace(/\\r?\\n|\\r/g, '')\n }\n\n if (!isMultipart && typeof spec === 'string') {\n spec = spec.replace(/\\r?\\n|\\r/g, '')\n }\n\n // Because the nature of URL encoding, all the values in the body must be cast to strings.\n // dataEqual does strict checking, so we have to cast the non-regexp values in the spec too.\n if (isUrlencoded) {\n spec = mapValuesDeep(spec, val => (val instanceof RegExp ? val : `${val}`))\n }\n\n return common.dataEqual(spec, body)\n}\n\nfunction mapValues(object, cb) {\n const keys = Object.keys(object)\n for (const key of keys) {\n object[key] = cb(object[key], key, object)\n }\n return object\n}\n\n/**\n * Based on lodash issue discussion\n * https://github.com/lodash/lodash/issues/1244\n */\nfunction mapValuesDeep(obj, cb) {\n if (Array.isArray(obj)) {\n return obj.map(v => mapValuesDeep(v, cb))\n }\n if (common.isPlainObject(obj)) {\n return mapValues(obj, v => mapValuesDeep(v, cb))\n }\n return cb(obj)\n}\n","'use strict'\n\nconst stringify = require('json-stringify-safe')\nconst querystring = require('querystring')\nconst { URL, URLSearchParams } = require('url')\n\nconst common = require('./common')\nconst { remove } = require('./intercept')\nconst matchBody = require('./match_body')\n\nlet fs\ntry {\n fs = require('fs')\n} catch (err) {\n // do nothing, we're in the browser\n}\n\nmodule.exports = class Interceptor {\n /**\n *\n * Valid argument types for `uri`:\n * - A string used for strict comparisons with pathname.\n * The search portion of the URI may also be postfixed, in which case the search params\n * are striped and added via the `query` method.\n * - A RegExp instance that tests against only the pathname of requests.\n * - A synchronous function bound to this Interceptor instance. It's provided the pathname\n * of requests and must return a boolean denoting if the request is considered a match.\n */\n constructor(scope, uri, method, requestBody, interceptorOptions) {\n const uriIsStr = typeof uri === 'string'\n // Check for leading slash. Uri can be either a string or a regexp, but\n // When enabled filteringScope ignores the passed URL entirely so we skip validation.\n\n if (\n uriIsStr &&\n !scope.scopeOptions.filteringScope &&\n !scope.basePathname &&\n !uri.startsWith('/') &&\n !uri.startsWith('*')\n ) {\n throw Error(\n `Non-wildcard URL path strings must begin with a slash (otherwise they won't match anything) (got: ${uri})`,\n )\n }\n\n if (!method) {\n throw new Error(\n 'The \"method\" parameter is required for an intercept call.',\n )\n }\n\n this.scope = scope\n this.interceptorMatchHeaders = []\n this.method = method.toUpperCase()\n this.uri = uri\n this._key = `${this.method} ${scope.basePath}${scope.basePathname}${\n uriIsStr ? '' : '/'\n }${uri}`\n this.basePath = this.scope.basePath\n this.path = uriIsStr ? scope.basePathname + uri : uri\n this.queries = null\n\n this.options = interceptorOptions || {}\n this.counter = 1\n this._requestBody = requestBody\n\n // We use lower-case header field names throughout Nock.\n this.reqheaders = common.headersFieldNamesToLowerCase(\n scope.scopeOptions.reqheaders || {},\n true,\n )\n this.badheaders = common.headersFieldsArrayToLowerCase(\n scope.scopeOptions.badheaders || [],\n )\n\n this.delayBodyInMs = 0\n this.delayConnectionInMs = 0\n\n this.optional = false\n\n // strip off literal query parameters if they were provided as part of the URI\n if (uriIsStr && uri.includes('?')) {\n // localhost is a dummy value because the URL constructor errors for only relative inputs\n const parsedURL = new URL(this.path, 'http://localhost')\n this.path = parsedURL.pathname\n this.query(parsedURL.searchParams)\n this._key = `${this.method} ${scope.basePath}${this.path}`\n }\n }\n\n optionally(flag = true) {\n // The default behaviour of optionally() with no arguments is to make the mock optional.\n if (typeof flag !== 'boolean') {\n throw new Error('Invalid arguments: argument should be a boolean')\n }\n\n this.optional = flag\n\n return this\n }\n\n replyWithError(errorMessage) {\n this.errorMessage = errorMessage\n\n this.options = {\n ...this.scope.scopeOptions,\n ...this.options,\n }\n\n this.scope.add(this._key, this)\n return this.scope\n }\n\n reply(statusCode, body, rawHeaders) {\n // support the format of only passing in a callback\n if (typeof statusCode === 'function') {\n if (arguments.length > 1) {\n // It's not very Javascript-y to throw an error for extra args to a function, but because\n // of legacy behavior, this error was added to reduce confusion for those migrating.\n throw Error(\n 'Invalid arguments. When providing a function for the first argument, .reply does not accept other arguments.',\n )\n }\n this.statusCode = null\n this.fullReplyFunction = statusCode\n } else {\n if (statusCode !== undefined && !Number.isInteger(statusCode)) {\n throw new Error(`Invalid ${typeof statusCode} value for status code`)\n }\n\n this.statusCode = statusCode || 200\n if (typeof body === 'function') {\n this.replyFunction = body\n body = null\n }\n }\n\n this.options = {\n ...this.scope.scopeOptions,\n ...this.options,\n }\n\n this.rawHeaders = common.headersInputToRawArray(rawHeaders)\n\n if (this.scope.date) {\n // https://tools.ietf.org/html/rfc7231#section-7.1.1.2\n this.rawHeaders.push('Date', this.scope.date.toUTCString())\n }\n\n // Prepare the headers temporarily so we can make best guesses about content-encoding and content-type\n // below as well as while the response is being processed in RequestOverrider.end().\n // Including all the default headers is safe for our purposes because of the specific headers we introspect.\n // A more thoughtful process is used to merge the default headers when the response headers are finally computed.\n this.headers = common.headersArrayToObject(\n this.rawHeaders.concat(this.scope._defaultReplyHeaders),\n )\n\n // If the content is not encoded we may need to transform the response body.\n // Otherwise, we leave it as it is.\n if (\n body &&\n typeof body !== 'string' &&\n !Buffer.isBuffer(body) &&\n !common.isStream(body) &&\n !common.isContentEncoded(this.headers)\n ) {\n try {\n body = stringify(body)\n } catch (err) {\n throw new Error('Error encoding response body into JSON')\n }\n\n if (!this.headers['content-type']) {\n // https://tools.ietf.org/html/rfc7231#section-3.1.1.5\n this.rawHeaders.push('Content-Type', 'application/json')\n }\n }\n\n if (this.scope.contentLen) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n if (typeof body === 'string') {\n this.rawHeaders.push('Content-Length', body.length)\n } else if (Buffer.isBuffer(body)) {\n this.rawHeaders.push('Content-Length', body.byteLength)\n }\n }\n\n this.scope.logger('reply.headers:', this.headers)\n this.scope.logger('reply.rawHeaders:', this.rawHeaders)\n\n this.body = body\n\n this.scope.add(this._key, this)\n return this.scope\n }\n\n replyWithFile(statusCode, filePath, headers) {\n if (!fs) {\n throw new Error('No fs')\n }\n this.filePath = filePath\n return this.reply(\n statusCode,\n () => {\n const readStream = fs.createReadStream(filePath)\n readStream.pause()\n return readStream\n },\n headers,\n )\n }\n\n // Also match request headers\n // https://github.com/nock/nock/issues/163\n reqheaderMatches(options, key) {\n const reqHeader = this.reqheaders[key]\n let header = options.headers[key]\n\n // https://github.com/nock/nock/issues/399\n // https://github.com/nock/nock/issues/822\n if (header && typeof header !== 'string' && header.toString) {\n header = header.toString()\n }\n\n // We skip 'host' header comparison unless it's available in both mock and\n // actual request. This because 'host' may get inserted by Nock itself and\n // then get recorded. NOTE: We use lower-case header field names throughout\n // Nock. See https://github.com/nock/nock/pull/196.\n if (key === 'host' && (header === undefined || reqHeader === undefined)) {\n return true\n }\n\n if (reqHeader !== undefined && header !== undefined) {\n if (typeof reqHeader === 'function') {\n return reqHeader(header)\n } else if (common.matchStringOrRegexp(header, reqHeader)) {\n return true\n }\n }\n\n this.scope.logger(\n \"request header field doesn't match:\",\n key,\n header,\n reqHeader,\n )\n return false\n }\n\n match(req, options, body) {\n // check if the logger is enabled because the stringifies can be expensive.\n if (this.scope.logger.enabled) {\n this.scope.logger(\n 'attempting match %s, body = %s',\n stringify(options),\n stringify(body),\n )\n }\n\n const method = (options.method || 'GET').toUpperCase()\n let { path = '/' } = options\n let matches\n let matchKey\n const { proto } = options\n\n if (this.method !== method) {\n this.scope.logger(\n `Method did not match. Request ${method} Interceptor ${this.method}`,\n )\n return false\n }\n\n if (this.scope.transformPathFunction) {\n path = this.scope.transformPathFunction(path)\n }\n\n const requestMatchesFilter = ({ name, value: predicate }) => {\n const headerValue = req.getHeader(name)\n if (typeof predicate === 'function') {\n return predicate(headerValue)\n } else {\n return common.matchStringOrRegexp(headerValue, predicate)\n }\n }\n\n if (\n !this.scope.matchHeaders.every(requestMatchesFilter) ||\n !this.interceptorMatchHeaders.every(requestMatchesFilter)\n ) {\n this.scope.logger(\"headers don't match\")\n return false\n }\n\n const reqHeadersMatch = Object.keys(this.reqheaders).every(key =>\n this.reqheaderMatches(options, key),\n )\n\n if (!reqHeadersMatch) {\n this.scope.logger(\"headers don't match\")\n return false\n }\n\n if (\n this.scope.scopeOptions.conditionally &&\n !this.scope.scopeOptions.conditionally()\n ) {\n this.scope.logger(\n 'matching failed because Scope.conditionally() did not validate',\n )\n return false\n }\n\n const badHeaders = this.badheaders.filter(\n header => header in options.headers,\n )\n\n if (badHeaders.length) {\n this.scope.logger('request contains bad headers', ...badHeaders)\n return false\n }\n\n // Match query strings when using query()\n if (this.queries === null) {\n this.scope.logger('query matching skipped')\n } else {\n // can't rely on pathname or search being in the options, but path has a default\n const [pathname, search] = path.split('?')\n const matchQueries = this.matchQuery({ search })\n\n this.scope.logger(\n matchQueries ? 'query matching succeeded' : 'query matching failed',\n )\n\n if (!matchQueries) {\n return false\n }\n\n // If the query string was explicitly checked then subsequent checks against\n // the path using a callback or regexp only validate the pathname.\n path = pathname\n }\n\n // If we have a filtered scope then we use it instead reconstructing the\n // scope from the request options (proto, host and port) as these two won't\n // necessarily match and we have to remove the scope that was matched (vs.\n // that was defined).\n if (this.__nock_filteredScope) {\n matchKey = this.__nock_filteredScope\n } else {\n matchKey = common.normalizeOrigin(proto, options.host, options.port)\n }\n\n if (typeof this.uri === 'function') {\n matches =\n common.matchStringOrRegexp(matchKey, this.basePath) &&\n // This is a false positive, as `uri` is not bound to `this`.\n // eslint-disable-next-line no-useless-call\n this.uri.call(this, path)\n } else {\n matches =\n common.matchStringOrRegexp(matchKey, this.basePath) &&\n common.matchStringOrRegexp(path, this.path)\n }\n\n this.scope.logger(`matching ${matchKey}${path} to ${this._key}: ${matches}`)\n\n if (matches && this._requestBody !== undefined) {\n if (this.scope.transformRequestBodyFunction) {\n body = this.scope.transformRequestBodyFunction(body, this._requestBody)\n }\n\n matches = matchBody(options, this._requestBody, body)\n if (!matches) {\n this.scope.logger(\n \"bodies don't match: \\n\",\n this._requestBody,\n '\\n',\n body,\n )\n }\n }\n\n return matches\n }\n\n /**\n * Return true when the interceptor's method, protocol, host, port, and path\n * match the provided options.\n */\n matchOrigin(options) {\n const isPathFn = typeof this.path === 'function'\n const isRegex = this.path instanceof RegExp\n const isRegexBasePath = this.scope.basePath instanceof RegExp\n\n const method = (options.method || 'GET').toUpperCase()\n let { path } = options\n const { proto } = options\n\n // NOTE: Do not split off the query params as the regex could use them\n if (!isRegex) {\n path = path ? path.split('?')[0] : ''\n }\n\n if (this.scope.transformPathFunction) {\n path = this.scope.transformPathFunction(path)\n }\n const comparisonKey = isPathFn || isRegex ? this.__nock_scopeKey : this._key\n const matchKey = `${method} ${proto}://${options.host}${path}`\n\n if (isPathFn) {\n return !!(matchKey.match(comparisonKey) && this.path(path))\n }\n\n if (isRegex && !isRegexBasePath) {\n return !!matchKey.match(comparisonKey) && this.path.test(path)\n }\n\n if (isRegexBasePath) {\n return this.scope.basePath.test(matchKey) && !!path.match(this.path)\n }\n\n return comparisonKey === matchKey\n }\n\n matchHostName(options) {\n const { basePath } = this.scope\n\n if (basePath instanceof RegExp) {\n return basePath.test(options.hostname)\n }\n\n return options.hostname === this.scope.urlParts.hostname\n }\n\n matchQuery(options) {\n if (this.queries === true) {\n return true\n }\n\n const reqQueries = querystring.parse(options.search)\n this.scope.logger('Interceptor queries: %j', this.queries)\n this.scope.logger(' Request queries: %j', reqQueries)\n\n if (typeof this.queries === 'function') {\n return this.queries(reqQueries)\n }\n\n return common.dataEqual(this.queries, reqQueries)\n }\n\n filteringPath(...args) {\n this.scope.filteringPath(...args)\n return this\n }\n\n // TODO filtering by path is valid on the intercept level, but not filtering\n // by request body?\n\n markConsumed() {\n this.interceptionCounter++\n\n remove(this)\n\n if (!this.scope.shouldPersist() && this.counter < 1) {\n this.scope.remove(this._key, this)\n }\n }\n\n matchHeader(name, value) {\n this.interceptorMatchHeaders.push({ name, value })\n return this\n }\n\n basicAuth({ user, pass = '' }) {\n const encoded = Buffer.from(`${user}:${pass}`).toString('base64')\n this.matchHeader('authorization', `Basic ${encoded}`)\n return this\n }\n\n /**\n * Set query strings for the interceptor\n * @name query\n * @param queries Object of query string name,values (accepts regexp values)\n * @public\n * @example\n * // Will match 'http://zombo.com/?q=t'\n * nock('http://zombo.com').get('/').query({q: 't'});\n */\n query(queries) {\n if (this.queries !== null) {\n throw Error(`Query parameters have already been defined`)\n }\n\n // Allow all query strings to match this route\n if (queries === true) {\n this.queries = queries\n return this\n }\n\n if (typeof queries === 'function') {\n this.queries = queries\n return this\n }\n\n let strFormattingFn\n if (this.scope.scopeOptions.encodedQueryParams) {\n strFormattingFn = common.percentDecode\n }\n\n if (queries instanceof URLSearchParams || typeof queries === 'string') {\n // Normalize the data into the shape that is matched against.\n // Duplicate keys are handled by combining the values into an array.\n queries = querystring.parse(queries.toString())\n } else if (!common.isPlainObject(queries)) {\n throw Error(`Argument Error: ${queries}`)\n }\n\n this.queries = {}\n for (const [key, value] of Object.entries(queries)) {\n const formatted = common.formatQueryValue(key, value, strFormattingFn)\n const [formattedKey, formattedValue] = formatted\n this.queries[formattedKey] = formattedValue\n }\n\n return this\n }\n\n /**\n * Set number of times will repeat the interceptor\n * @name times\n * @param newCounter Number of times to repeat (should be > 0)\n * @public\n * @example\n * // Will repeat mock 5 times for same king of request\n * nock('http://zombo.com).get('/').times(5).reply(200, 'Ok');\n */\n times(newCounter) {\n if (newCounter < 1) {\n return this\n }\n\n this.counter = newCounter\n\n return this\n }\n\n /**\n * An sugar syntax for times(1)\n * @name once\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').once().reply(200, 'Ok');\n */\n once() {\n return this.times(1)\n }\n\n /**\n * An sugar syntax for times(2)\n * @name twice\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').twice().reply(200, 'Ok');\n */\n twice() {\n return this.times(2)\n }\n\n /**\n * An sugar syntax for times(3).\n * @name thrice\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').thrice().reply(200, 'Ok');\n */\n thrice() {\n return this.times(3)\n }\n\n /**\n * Delay the response by a certain number of ms.\n *\n * @param {(integer|object)} opts - Number of milliseconds to wait, or an object\n * @param {integer} [opts.head] - Number of milliseconds to wait before response is sent\n * @param {integer} [opts.body] - Number of milliseconds to wait before response body is sent\n * @return {Interceptor} - the current interceptor for chaining\n */\n delay(opts) {\n let headDelay\n let bodyDelay\n if (typeof opts === 'number') {\n headDelay = opts\n bodyDelay = 0\n } else if (typeof opts === 'object') {\n headDelay = opts.head || 0\n bodyDelay = opts.body || 0\n } else {\n throw new Error(`Unexpected input opts ${opts}`)\n }\n\n return this.delayConnection(headDelay).delayBody(bodyDelay)\n }\n\n /**\n * Delay the response body by a certain number of ms.\n *\n * @param {integer} ms - Number of milliseconds to wait before response is sent\n * @return {Interceptor} - the current interceptor for chaining\n */\n delayBody(ms) {\n this.delayBodyInMs = ms\n return this\n }\n\n /**\n * Delay the connection by a certain number of ms.\n *\n * @param {integer} ms - Number of milliseconds to wait\n * @return {Interceptor} - the current interceptor for chaining\n */\n delayConnection(ms) {\n this.delayConnectionInMs = ms\n return this\n }\n}\n","'use strict'\n\n/**\n * @module nock/intercept\n */\n\nconst { InterceptedRequestRouter } = require('./intercepted_request_router')\nconst common = require('./common')\nconst { inherits } = require('util')\nconst http = require('http')\nconst debug = require('debug')('nock.intercept')\nconst globalEmitter = require('./global_emitter')\n\n/**\n * @name NetConnectNotAllowedError\n * @private\n * @desc Error trying to make a connection when disabled external access.\n * @class\n * @example\n * nock.disableNetConnect();\n * http.get('http://zombo.com');\n * // throw NetConnectNotAllowedError\n */\nfunction NetConnectNotAllowedError(host, path) {\n Error.call(this)\n\n this.name = 'NetConnectNotAllowedError'\n this.code = 'ENETUNREACH'\n this.message = `Nock: Disallowed net connect for \"${host}${path}\"`\n\n Error.captureStackTrace(this, this.constructor)\n}\n\ninherits(NetConnectNotAllowedError, Error)\n\nlet allInterceptors = {}\nlet allowNetConnect\n\n/**\n * Enabled real request.\n * @public\n * @param {String|RegExp} matcher=RegExp.new('.*') Expression to match\n * @example\n * // Enables all real requests\n * nock.enableNetConnect();\n * @example\n * // Enables real requests for url that matches google\n * nock.enableNetConnect('google');\n * @example\n * // Enables real requests for url that matches google and amazon\n * nock.enableNetConnect(/(google|amazon)/);\n * @example\n * // Enables real requests for url that includes google\n * nock.enableNetConnect(host => host.includes('google'));\n */\nfunction enableNetConnect(matcher) {\n if (typeof matcher === 'string') {\n allowNetConnect = new RegExp(matcher)\n } else if (matcher instanceof RegExp) {\n allowNetConnect = matcher\n } else if (typeof matcher === 'function') {\n allowNetConnect = { test: matcher }\n } else {\n allowNetConnect = /.*/\n }\n}\n\nfunction isEnabledForNetConnect(options) {\n common.normalizeRequestOptions(options)\n\n const enabled = allowNetConnect && allowNetConnect.test(options.host)\n debug('Net connect', enabled ? '' : 'not', 'enabled for', options.host)\n return enabled\n}\n\n/**\n * Disable all real requests.\n * @public\n * @example\n * nock.disableNetConnect();\n */\nfunction disableNetConnect() {\n allowNetConnect = undefined\n}\n\nfunction isOn() {\n return !isOff()\n}\n\nfunction isOff() {\n return process.env.NOCK_OFF === 'true'\n}\n\nfunction addInterceptor(key, interceptor, scope, scopeOptions, host) {\n if (!(key in allInterceptors)) {\n allInterceptors[key] = { key, interceptors: [] }\n }\n interceptor.__nock_scope = scope\n\n // We need scope's key and scope options for scope filtering function (if defined)\n interceptor.__nock_scopeKey = key\n interceptor.__nock_scopeOptions = scopeOptions\n // We need scope's host for setting correct request headers for filtered scopes.\n interceptor.__nock_scopeHost = host\n interceptor.interceptionCounter = 0\n\n if (scopeOptions.allowUnmocked) allInterceptors[key].allowUnmocked = true\n\n allInterceptors[key].interceptors.push(interceptor)\n}\n\nfunction remove(interceptor) {\n if (interceptor.__nock_scope.shouldPersist() || --interceptor.counter > 0) {\n return\n }\n\n const { basePath } = interceptor\n const interceptors =\n (allInterceptors[basePath] && allInterceptors[basePath].interceptors) || []\n\n // TODO: There is a clearer way to write that we want to delete the first\n // matching instance. I'm also not sure why we couldn't delete _all_\n // matching instances.\n interceptors.some(function (thisInterceptor, i) {\n return thisInterceptor === interceptor ? interceptors.splice(i, 1) : false\n })\n}\n\nfunction removeAll() {\n Object.keys(allInterceptors).forEach(function (key) {\n allInterceptors[key].interceptors.forEach(function (interceptor) {\n interceptor.scope.keyedInterceptors = {}\n })\n })\n allInterceptors = {}\n}\n\n/**\n * Return all the Interceptors whose Scopes match against the base path of the provided options.\n *\n * @returns {Interceptor[]}\n */\nfunction interceptorsFor(options) {\n common.normalizeRequestOptions(options)\n\n debug('interceptors for %j', options.host)\n\n const basePath = `${options.proto}://${options.host}`\n\n debug('filtering interceptors for basepath', basePath)\n\n // First try to use filteringScope if any of the interceptors has it defined.\n for (const { key, interceptors, allowUnmocked } of Object.values(\n allInterceptors,\n )) {\n for (const interceptor of interceptors) {\n const { filteringScope } = interceptor.__nock_scopeOptions\n\n // If scope filtering function is defined and returns a truthy value then\n // we have to treat this as a match.\n if (filteringScope && filteringScope(basePath)) {\n interceptor.scope.logger('found matching scope interceptor')\n\n // Keep the filtered scope (its key) to signal the rest of the module\n // that this wasn't an exact but filtered match.\n interceptors.forEach(ic => {\n ic.__nock_filteredScope = ic.__nock_scopeKey\n })\n return interceptors\n }\n }\n\n if (common.matchStringOrRegexp(basePath, key)) {\n if (allowUnmocked && interceptors.length === 0) {\n debug('matched base path with allowUnmocked (no matching interceptors)')\n return [\n {\n options: { allowUnmocked: true },\n matchOrigin() {\n return false\n },\n },\n ]\n } else {\n debug(\n `matched base path (${interceptors.length} interceptor${\n interceptors.length > 1 ? 's' : ''\n })`,\n )\n return interceptors\n }\n }\n }\n\n return undefined\n}\n\nfunction removeInterceptor(options) {\n // Lazily import to avoid circular imports.\n const Interceptor = require('./interceptor')\n\n let baseUrl, key, method, proto\n if (options instanceof Interceptor) {\n baseUrl = options.basePath\n key = options._key\n } else {\n proto = options.proto ? options.proto : 'http'\n\n common.normalizeRequestOptions(options)\n baseUrl = `${proto}://${options.host}`\n method = (options.method && options.method.toUpperCase()) || 'GET'\n key = `${method} ${baseUrl}${options.path || '/'}`\n }\n\n if (\n allInterceptors[baseUrl] &&\n allInterceptors[baseUrl].interceptors.length > 0\n ) {\n for (let i = 0; i < allInterceptors[baseUrl].interceptors.length; i++) {\n const interceptor = allInterceptors[baseUrl].interceptors[i]\n if (\n options instanceof Interceptor\n ? interceptor === options\n : interceptor._key === key\n ) {\n allInterceptors[baseUrl].interceptors.splice(i, 1)\n interceptor.scope.remove(key, interceptor)\n break\n }\n }\n\n return true\n }\n\n return false\n}\n// Variable where we keep the ClientRequest we have overridden\n// (which might or might not be node's original http.ClientRequest)\nlet originalClientRequest\n\nfunction ErroringClientRequest(error) {\n http.OutgoingMessage.call(this)\n process.nextTick(\n function () {\n this.emit('error', error)\n }.bind(this),\n )\n}\n\ninherits(ErroringClientRequest, http.ClientRequest)\n\nfunction overrideClientRequest() {\n // Here's some background discussion about overriding ClientRequest:\n // - https://github.com/nodejitsu/mock-request/issues/4\n // - https://github.com/nock/nock/issues/26\n // It would be good to add a comment that explains this more clearly.\n debug('Overriding ClientRequest')\n\n // ----- Extending http.ClientRequest\n\n // Define the overriding client request that nock uses internally.\n function OverriddenClientRequest(...args) {\n const { options, callback } = common.normalizeClientRequestArgs(...args)\n\n if (Object.keys(options).length === 0) {\n // As weird as it is, it's possible to call `http.request` without\n // options, and it makes a request to localhost or somesuch. We should\n // support it too, for parity. However it doesn't work today, and fixing\n // it seems low priority. Giving an explicit error is nicer than\n // crashing with a weird stack trace. `http[s].request()`, nock's other\n // client-facing entry point, makes a similar check.\n // https://github.com/nock/nock/pull/1386\n // https://github.com/nock/nock/pull/1440\n throw Error(\n 'Creating a ClientRequest with empty `options` is not supported in Nock',\n )\n }\n\n http.OutgoingMessage.call(this)\n\n // Filter the interceptors per request options.\n const interceptors = interceptorsFor(options)\n\n if (isOn() && interceptors) {\n debug('using', interceptors.length, 'interceptors')\n\n // Use filtered interceptors to intercept requests.\n // TODO: this shouldn't be a class anymore\n // the overrider explicitly overrides methods and attrs on the request so the `assign` below should be removed.\n const overrider = new InterceptedRequestRouter({\n req: this,\n options,\n interceptors,\n })\n Object.assign(this, overrider)\n\n if (callback) {\n this.once('response', callback)\n }\n } else {\n debug('falling back to original ClientRequest')\n\n // Fallback to original ClientRequest if nock is off or the net connection is enabled.\n if (isOff() || isEnabledForNetConnect(options)) {\n originalClientRequest.apply(this, arguments)\n } else {\n common.setImmediate(\n function () {\n const error = new NetConnectNotAllowedError(\n options.host,\n options.path,\n )\n this.emit('error', error)\n }.bind(this),\n )\n }\n }\n }\n inherits(OverriddenClientRequest, http.ClientRequest)\n\n // Override the http module's request but keep the original so that we can use it and later restore it.\n // NOTE: We only override http.ClientRequest as https module also uses it.\n originalClientRequest = http.ClientRequest\n http.ClientRequest = OverriddenClientRequest\n\n debug('ClientRequest overridden')\n}\n\nfunction restoreOverriddenClientRequest() {\n debug('restoring overridden ClientRequest')\n\n // Restore the ClientRequest we have overridden.\n if (!originalClientRequest) {\n debug('- ClientRequest was not overridden')\n } else {\n http.ClientRequest = originalClientRequest\n originalClientRequest = undefined\n\n debug('- ClientRequest restored')\n }\n}\n\nfunction isActive() {\n // If ClientRequest has been overwritten by Nock then originalClientRequest is not undefined.\n // This means that Nock has been activated.\n return originalClientRequest !== undefined\n}\n\nfunction interceptorScopes() {\n const nestedInterceptors = Object.values(allInterceptors).map(\n i => i.interceptors,\n )\n const scopes = new Set([].concat(...nestedInterceptors).map(i => i.scope))\n return [...scopes]\n}\n\nfunction isDone() {\n return interceptorScopes().every(scope => scope.isDone())\n}\n\nfunction pendingMocks() {\n return [].concat(...interceptorScopes().map(scope => scope.pendingMocks()))\n}\n\nfunction activeMocks() {\n return [].concat(...interceptorScopes().map(scope => scope.activeMocks()))\n}\n\nfunction activate() {\n if (originalClientRequest) {\n throw new Error('Nock already active')\n }\n\n // ----- Overriding http.request and https.request:\n\n common.overrideRequests(function (proto, overriddenRequest, args) {\n // NOTE: overriddenRequest is already bound to its module.\n\n const { options, callback } = common.normalizeClientRequestArgs(...args)\n\n if (Object.keys(options).length === 0) {\n // As weird as it is, it's possible to call `http.request` without\n // options, and it makes a request to localhost or somesuch. We should\n // support it too, for parity. However it doesn't work today, and fixing\n // it seems low priority. Giving an explicit error is nicer than\n // crashing with a weird stack trace. `new ClientRequest()`, nock's\n // other client-facing entry point, makes a similar check.\n // https://github.com/nock/nock/pull/1386\n // https://github.com/nock/nock/pull/1440\n throw Error(\n 'Making a request with empty `options` is not supported in Nock',\n )\n }\n\n // The option per the docs is `protocol`. Its unclear if this line is meant to override that and is misspelled or if\n // the intend is to explicitly keep track of which module was called using a separate name.\n // Either way, `proto` is used as the source of truth from here on out.\n options.proto = proto\n\n const interceptors = interceptorsFor(options)\n\n if (isOn() && interceptors) {\n const matches = interceptors.some(interceptor =>\n interceptor.matchOrigin(options),\n )\n const allowUnmocked = interceptors.some(\n interceptor => interceptor.options.allowUnmocked,\n )\n\n if (!matches && allowUnmocked) {\n let req\n if (proto === 'https') {\n const { ClientRequest } = http\n http.ClientRequest = originalClientRequest\n req = overriddenRequest(options, callback)\n http.ClientRequest = ClientRequest\n } else {\n req = overriddenRequest(options, callback)\n }\n globalEmitter.emit('no match', req)\n return req\n }\n\n // NOTE: Since we already overrode the http.ClientRequest we are in fact constructing\n // our own OverriddenClientRequest.\n return new http.ClientRequest(options, callback)\n } else {\n globalEmitter.emit('no match', options)\n if (isOff() || isEnabledForNetConnect(options)) {\n return overriddenRequest(options, callback)\n } else {\n const error = new NetConnectNotAllowedError(options.host, options.path)\n return new ErroringClientRequest(error)\n }\n }\n })\n\n overrideClientRequest()\n}\n\nmodule.exports = {\n addInterceptor,\n remove,\n removeAll,\n removeInterceptor,\n isOn,\n activate,\n isActive,\n isDone,\n pendingMocks,\n activeMocks,\n enableNetConnect,\n disableNetConnect,\n restoreOverriddenClientRequest,\n abortPendingRequests: common.removeAllTimers,\n}\n","'use strict'\n\nconst debug = require('debug')('nock.recorder')\nconst querystring = require('querystring')\nconst { inspect } = require('util')\n\nconst common = require('./common')\nconst { restoreOverriddenClientRequest } = require('./intercept')\n\nconst SEPARATOR = '\\n<<<<<<-- cut here -->>>>>>\\n'\nlet recordingInProgress = false\nlet outputs = []\n\nfunction getScope(options) {\n const { proto, host, port } = common.normalizeRequestOptions(options)\n return common.normalizeOrigin(proto, host, port)\n}\n\nfunction getMethod(options) {\n return options.method || 'GET'\n}\n\nfunction getBodyFromChunks(chunks, headers) {\n // If we have headers and there is content-encoding it means that the body\n // shouldn't be merged but instead persisted as an array of hex strings so\n // that the response chunks can be mocked one by one.\n if (headers && common.isContentEncoded(headers)) {\n return {\n body: chunks.map(chunk => chunk.toString('hex')),\n }\n }\n\n const mergedBuffer = Buffer.concat(chunks)\n\n // The merged buffer can be one of three things:\n // 1. A UTF-8-representable string buffer which represents a JSON object.\n // 2. A UTF-8-representable buffer which doesn't represent a JSON object.\n // 3. A non-UTF-8-representable buffer which then has to be recorded as a hex string.\n const isUtf8Representable = common.isUtf8Representable(mergedBuffer)\n if (isUtf8Representable) {\n const maybeStringifiedJson = mergedBuffer.toString('utf8')\n try {\n return {\n isUtf8Representable,\n body: JSON.parse(maybeStringifiedJson),\n }\n } catch (err) {\n return {\n isUtf8Representable,\n body: maybeStringifiedJson,\n }\n }\n } else {\n return {\n isUtf8Representable,\n body: mergedBuffer.toString('hex'),\n }\n }\n}\n\nfunction generateRequestAndResponseObject({\n req,\n bodyChunks,\n options,\n res,\n dataChunks,\n reqheaders,\n}) {\n const { body, isUtf8Representable } = getBodyFromChunks(\n dataChunks,\n res.headers,\n )\n options.path = req.path\n\n return {\n scope: getScope(options),\n method: getMethod(options),\n path: options.path,\n // Is it deliberate that `getBodyFromChunks()` is called a second time?\n body: getBodyFromChunks(bodyChunks).body,\n status: res.statusCode,\n response: body,\n rawHeaders: res.rawHeaders,\n reqheaders: reqheaders || undefined,\n // When content-encoding is enabled, isUtf8Representable is `undefined`,\n // so we explicitly check for `false`.\n responseIsBinary: isUtf8Representable === false,\n }\n}\n\nfunction generateRequestAndResponse({\n req,\n bodyChunks,\n options,\n res,\n dataChunks,\n reqheaders,\n}) {\n const requestBody = getBodyFromChunks(bodyChunks).body\n const responseBody = getBodyFromChunks(dataChunks, res.headers).body\n\n // Remove any query params from options.path so they can be added in the query() function\n let { path } = options\n const queryIndex = req.path.indexOf('?')\n let queryObj = {}\n if (queryIndex !== -1) {\n // Remove the query from the path\n path = path.substring(0, queryIndex)\n\n const queryStr = req.path.slice(queryIndex + 1)\n queryObj = querystring.parse(queryStr)\n }\n\n // Escape any single quotes in the path as the output uses them\n path = path.replace(/'/g, `\\\\'`)\n\n // Always encode the query parameters when recording.\n const encodedQueryObj = {}\n for (const key in queryObj) {\n const formattedPair = common.formatQueryValue(\n key,\n queryObj[key],\n common.percentEncode,\n )\n encodedQueryObj[formattedPair[0]] = formattedPair[1]\n }\n\n const lines = []\n\n // We want a leading newline.\n lines.push('')\n\n const scope = getScope(options)\n lines.push(`nock('${scope}', {\"encodedQueryParams\":true})`)\n\n const methodName = getMethod(options).toLowerCase()\n if (requestBody) {\n lines.push(` .${methodName}('${path}', ${JSON.stringify(requestBody)})`)\n } else {\n lines.push(` .${methodName}('${path}')`)\n }\n\n Object.entries(reqheaders || {}).forEach(([fieldName, fieldValue]) => {\n const safeName = JSON.stringify(fieldName)\n const safeValue = JSON.stringify(fieldValue)\n lines.push(` .matchHeader(${safeName}, ${safeValue})`)\n })\n\n if (queryIndex !== -1) {\n lines.push(` .query(${JSON.stringify(encodedQueryObj)})`)\n }\n\n const statusCode = res.statusCode.toString()\n const stringifiedResponseBody = JSON.stringify(responseBody)\n const headers = inspect(res.rawHeaders)\n lines.push(` .reply(${statusCode}, ${stringifiedResponseBody}, ${headers});`)\n\n return lines.join('\\n')\n}\n\n// This module variable is used to identify a unique recording ID in order to skip\n// spurious requests that sometimes happen. This problem has been, so far,\n// exclusively detected in nock's unit testing where 'checks if callback is specified'\n// interferes with other tests as its t.end() is invoked without waiting for request\n// to finish (which is the point of the test).\nlet currentRecordingId = 0\n\nconst defaultRecordOptions = {\n dont_print: false,\n enable_reqheaders_recording: false,\n logging: console.log, // eslint-disable-line no-console\n output_objects: false,\n use_separator: true,\n}\n\nfunction record(recOptions) {\n // Trying to start recording with recording already in progress implies an error\n // in the recording configuration (double recording makes no sense and used to lead\n // to duplicates in output)\n if (recordingInProgress) {\n throw new Error('Nock recording already in progress')\n }\n\n recordingInProgress = true\n\n // Set the new current recording ID and capture its value in this instance of record().\n currentRecordingId = currentRecordingId + 1\n const thisRecordingId = currentRecordingId\n\n // Originally the parameter was a dont_print boolean flag.\n // To keep the existing code compatible we take that case into account.\n if (typeof recOptions === 'boolean') {\n recOptions = { dont_print: recOptions }\n }\n\n recOptions = { ...defaultRecordOptions, ...recOptions }\n\n debug('start recording', thisRecordingId, recOptions)\n\n const {\n dont_print: dontPrint,\n enable_reqheaders_recording: enableReqHeadersRecording,\n logging,\n output_objects: outputObjects,\n use_separator: useSeparator,\n } = recOptions\n\n debug(thisRecordingId, 'restoring overridden requests before new overrides')\n // To preserve backward compatibility (starting recording wasn't throwing if nock was already active)\n // we restore any requests that may have been overridden by other parts of nock (e.g. intercept)\n // NOTE: This is hacky as hell but it keeps the backward compatibility *and* allows correct\n // behavior in the face of other modules also overriding ClientRequest.\n common.restoreOverriddenRequests()\n // We restore ClientRequest as it messes with recording of modules that also override ClientRequest (e.g. xhr2)\n restoreOverriddenClientRequest()\n\n // We override the requests so that we can save information on them before executing.\n common.overrideRequests(function (proto, overriddenRequest, rawArgs) {\n const { options, callback } = common.normalizeClientRequestArgs(...rawArgs)\n const bodyChunks = []\n\n // Node 0.11 https.request calls http.request -- don't want to record things\n // twice.\n /* istanbul ignore if */\n if (options._recording) {\n return overriddenRequest(options, callback)\n }\n options._recording = true\n\n const req = overriddenRequest(options, function (res) {\n debug(thisRecordingId, 'intercepting', proto, 'request to record')\n\n // We put our 'end' listener to the front of the listener array.\n res.once('end', function () {\n debug(thisRecordingId, proto, 'intercepted request ended')\n\n let reqheaders\n // Ignore request headers completely unless it was explicitly enabled by the user (see README)\n if (enableReqHeadersRecording) {\n // We never record user-agent headers as they are worse than useless -\n // they actually make testing more difficult without providing any benefit (see README)\n reqheaders = req.getHeaders()\n common.deleteHeadersField(reqheaders, 'user-agent')\n }\n\n const generateFn = outputObjects\n ? generateRequestAndResponseObject\n : generateRequestAndResponse\n let out = generateFn({\n req,\n bodyChunks,\n options,\n res,\n dataChunks,\n reqheaders,\n })\n\n debug('out:', out)\n\n // Check that the request was made during the current recording.\n // If it hasn't then skip it. There is no other simple way to handle\n // this as it depends on the timing of requests and responses. Throwing\n // will make some recordings/unit tests fail randomly depending on how\n // fast/slow the response arrived.\n // If you are seeing this error then you need to make sure that all\n // the requests made during a single recording session finish before\n // ending the same recording session.\n if (thisRecordingId !== currentRecordingId) {\n debug('skipping recording of an out-of-order request', out)\n return\n }\n\n outputs.push(out)\n\n if (!dontPrint) {\n if (useSeparator) {\n if (typeof out !== 'string') {\n out = JSON.stringify(out, null, 2)\n }\n logging(SEPARATOR + out + SEPARATOR)\n } else {\n logging(out)\n }\n }\n })\n\n let encoding\n // We need to be aware of changes to the stream's encoding so that we\n // don't accidentally mangle the data.\n const { setEncoding } = res\n res.setEncoding = function (newEncoding) {\n encoding = newEncoding\n return setEncoding.apply(this, arguments)\n }\n\n const dataChunks = []\n // Replace res.push with our own implementation that stores chunks\n const origResPush = res.push\n res.push = function (data) {\n if (data) {\n if (encoding) {\n data = Buffer.from(data, encoding)\n }\n dataChunks.push(data)\n }\n\n return origResPush.call(res, data)\n }\n\n if (callback) {\n callback(res, options, callback)\n }\n\n debug('finished setting up intercepting')\n\n // We override both the http and the https modules; when we are\n // serializing the request, we need to know which was called.\n // By stuffing the state, we can make sure that nock records\n // the intended protocol.\n if (proto === 'https') {\n options.proto = 'https'\n }\n })\n\n const recordChunk = (chunk, encoding) => {\n debug(thisRecordingId, 'new', proto, 'body chunk')\n if (!Buffer.isBuffer(chunk)) {\n chunk = Buffer.from(chunk, encoding)\n }\n bodyChunks.push(chunk)\n }\n\n const oldWrite = req.write\n req.write = function (chunk, encoding) {\n if (typeof chunk !== 'undefined') {\n recordChunk(chunk, encoding)\n oldWrite.apply(req, arguments)\n } else {\n throw new Error('Data was undefined.')\n }\n }\n\n // Starting in Node 8, `OutgoingMessage.end()` directly calls an internal\n // `write_` function instead of proxying to the public\n // `OutgoingMessage.write()` method, so we have to wrap `end` too.\n const oldEnd = req.end\n req.end = function (chunk, encoding, callback) {\n debug('req.end')\n if (typeof chunk === 'function') {\n callback = chunk\n chunk = null\n } else if (typeof encoding === 'function') {\n callback = encoding\n encoding = null\n }\n\n if (chunk) {\n recordChunk(chunk, encoding)\n }\n oldEnd.call(req, chunk, encoding, callback)\n }\n\n return req\n })\n}\n\n// Restore *all* the overridden http/https modules' properties.\nfunction restore() {\n debug(\n currentRecordingId,\n 'restoring all the overridden http/https properties',\n )\n\n common.restoreOverriddenRequests()\n restoreOverriddenClientRequest()\n recordingInProgress = false\n}\n\nfunction clear() {\n outputs = []\n}\n\nmodule.exports = {\n record,\n outputs: () => outputs,\n restore,\n clear,\n}\n","'use strict'\n\n/**\n * @module nock/scope\n */\nconst { addInterceptor, isOn } = require('./intercept')\nconst common = require('./common')\nconst assert = require('assert')\nconst url = require('url')\nconst debug = require('debug')('nock.scope')\nconst { EventEmitter } = require('events')\nconst Interceptor = require('./interceptor')\n\nconst { URL, Url: LegacyUrl } = url\nlet fs\n\ntry {\n fs = require('fs')\n} catch (err) {\n // do nothing, we're in the browser\n}\n\n/**\n * Normalizes the passed url for consistent internal processing\n * @param {string|LegacyUrl|URL} u\n */\nfunction normalizeUrl(u) {\n if (!(u instanceof URL)) {\n if (u instanceof LegacyUrl) {\n return normalizeUrl(new URL(url.format(u)))\n }\n // If the url is invalid, let the URL library report it\n return normalizeUrl(new URL(u))\n }\n\n if (!/https?:/.test(u.protocol)) {\n throw new TypeError(\n `Protocol '${u.protocol}' not recognized. This commonly occurs when a hostname and port are included without a protocol, producing a URL that is valid but confusing, and probably not what you want.`,\n )\n }\n\n return {\n href: u.href,\n origin: u.origin,\n protocol: u.protocol,\n username: u.username,\n password: u.password,\n host: u.host,\n hostname:\n // strip brackets from IPv6\n typeof u.hostname === 'string' && u.hostname.startsWith('[')\n ? u.hostname.slice(1, -1)\n : u.hostname,\n port: u.port || (u.protocol === 'http:' ? 80 : 443),\n pathname: u.pathname,\n search: u.search,\n searchParams: u.searchParams,\n hash: u.hash,\n }\n}\n\n/**\n * @param {string|RegExp|LegacyUrl|URL} basePath\n * @param {Object} options\n * @param {boolean} options.allowUnmocked\n * @param {string[]} options.badheaders\n * @param {function} options.conditionally\n * @param {boolean} options.encodedQueryParams\n * @param {function} options.filteringScope\n * @param {Object} options.reqheaders\n * @constructor\n */\nclass Scope extends EventEmitter {\n constructor(basePath, options) {\n super()\n\n this.keyedInterceptors = {}\n this.interceptors = []\n this.transformPathFunction = null\n this.transformRequestBodyFunction = null\n this.matchHeaders = []\n this.scopeOptions = options || {}\n this.urlParts = {}\n this._persist = false\n this.contentLen = false\n this.date = null\n this.basePath = basePath\n this.basePathname = ''\n this.port = null\n this._defaultReplyHeaders = []\n\n let logNamespace = String(basePath)\n\n if (!(basePath instanceof RegExp)) {\n this.urlParts = normalizeUrl(basePath)\n this.port = this.urlParts.port\n this.basePathname = this.urlParts.pathname.replace(/\\/$/, '')\n this.basePath = `${this.urlParts.protocol}//${this.urlParts.hostname}:${this.port}`\n logNamespace = this.urlParts.host\n }\n\n this.logger = debug.extend(logNamespace)\n }\n\n add(key, interceptor) {\n if (!(key in this.keyedInterceptors)) {\n this.keyedInterceptors[key] = []\n }\n this.keyedInterceptors[key].push(interceptor)\n addInterceptor(\n this.basePath,\n interceptor,\n this,\n this.scopeOptions,\n this.urlParts.hostname,\n )\n }\n\n remove(key, interceptor) {\n if (this._persist) {\n return\n }\n const arr = this.keyedInterceptors[key]\n if (arr) {\n arr.splice(arr.indexOf(interceptor), 1)\n if (arr.length === 0) {\n delete this.keyedInterceptors[key]\n }\n }\n }\n\n intercept(uri, method, requestBody, interceptorOptions) {\n const ic = new Interceptor(\n this,\n uri,\n method,\n requestBody,\n interceptorOptions,\n )\n\n this.interceptors.push(ic)\n return ic\n }\n\n get(uri, requestBody, options) {\n return this.intercept(uri, 'GET', requestBody, options)\n }\n\n post(uri, requestBody, options) {\n return this.intercept(uri, 'POST', requestBody, options)\n }\n\n put(uri, requestBody, options) {\n return this.intercept(uri, 'PUT', requestBody, options)\n }\n\n head(uri, requestBody, options) {\n return this.intercept(uri, 'HEAD', requestBody, options)\n }\n\n patch(uri, requestBody, options) {\n return this.intercept(uri, 'PATCH', requestBody, options)\n }\n\n merge(uri, requestBody, options) {\n return this.intercept(uri, 'MERGE', requestBody, options)\n }\n\n delete(uri, requestBody, options) {\n return this.intercept(uri, 'DELETE', requestBody, options)\n }\n\n options(uri, requestBody, options) {\n return this.intercept(uri, 'OPTIONS', requestBody, options)\n }\n\n // Returns the list of keys for non-optional Interceptors that haven't been completed yet.\n // TODO: This assumes that completed mocks are removed from the keyedInterceptors list\n // (when persistence is off). We should change that (and this) in future.\n pendingMocks() {\n return this.activeMocks().filter(key =>\n this.keyedInterceptors[key].some(({ interceptionCounter, optional }) => {\n const persistedAndUsed = this._persist && interceptionCounter > 0\n return !persistedAndUsed && !optional\n }),\n )\n }\n\n // Returns all keyedInterceptors that are active.\n // This includes incomplete interceptors, persisted but complete interceptors, and\n // optional interceptors, but not non-persisted and completed interceptors.\n activeMocks() {\n return Object.keys(this.keyedInterceptors)\n }\n\n isDone() {\n if (!isOn()) {\n return true\n }\n\n return this.pendingMocks().length === 0\n }\n\n done() {\n assert.ok(\n this.isDone(),\n `Mocks not yet satisfied:\\n${this.pendingMocks().join('\\n')}`,\n )\n }\n\n buildFilter() {\n const filteringArguments = arguments\n\n if (arguments[0] instanceof RegExp) {\n return function (candidate) {\n /* istanbul ignore if */\n if (typeof candidate !== 'string') {\n // Given the way nock is written, it seems like `candidate` will always\n // be a string, regardless of what options might be passed to it.\n // However the code used to contain a truthiness test of `candidate`.\n // The check is being preserved for now.\n throw Error(\n `Nock internal assertion failed: typeof candidate is ${typeof candidate}. If you encounter this error, please report it as a bug.`,\n )\n }\n return candidate.replace(filteringArguments[0], filteringArguments[1])\n }\n } else if (typeof arguments[0] === 'function') {\n return arguments[0]\n }\n }\n\n filteringPath() {\n this.transformPathFunction = this.buildFilter.apply(this, arguments)\n if (!this.transformPathFunction) {\n throw new Error(\n 'Invalid arguments: filtering path should be a function or a regular expression',\n )\n }\n return this\n }\n\n filteringRequestBody() {\n this.transformRequestBodyFunction = this.buildFilter.apply(this, arguments)\n if (!this.transformRequestBodyFunction) {\n throw new Error(\n 'Invalid arguments: filtering request body should be a function or a regular expression',\n )\n }\n return this\n }\n\n matchHeader(name, value) {\n // We use lower-case header field names throughout Nock.\n this.matchHeaders.push({ name: name.toLowerCase(), value })\n return this\n }\n\n defaultReplyHeaders(headers) {\n this._defaultReplyHeaders = common.headersInputToRawArray(headers)\n return this\n }\n\n persist(flag = true) {\n if (typeof flag !== 'boolean') {\n throw new Error('Invalid arguments: argument should be a boolean')\n }\n this._persist = flag\n return this\n }\n\n /**\n * @private\n * @returns {boolean}\n */\n shouldPersist() {\n return this._persist\n }\n\n replyContentLength() {\n this.contentLen = true\n return this\n }\n\n replyDate(d) {\n this.date = d || new Date()\n return this\n }\n\n clone() {\n return new Scope(this.basePath, this.scopeOptions)\n }\n}\n\nfunction loadDefs(path) {\n if (!fs) {\n throw new Error('No fs')\n }\n\n const contents = fs.readFileSync(path)\n return JSON.parse(contents)\n}\n\nfunction load(path) {\n return define(loadDefs(path))\n}\n\nfunction getStatusFromDefinition(nockDef) {\n // Backward compatibility for when `status` was encoded as string in `reply`.\n if (nockDef.reply !== undefined) {\n const parsedReply = parseInt(nockDef.reply, 10)\n if (isNaN(parsedReply)) {\n throw Error('`reply`, when present, must be a numeric string')\n }\n\n return parsedReply\n }\n\n const DEFAULT_STATUS_OK = 200\n return nockDef.status || DEFAULT_STATUS_OK\n}\n\nfunction getScopeFromDefinition(nockDef) {\n // Backward compatibility for when `port` was part of definition.\n if (nockDef.port !== undefined) {\n // Include `port` into scope if it doesn't exist.\n const options = url.parse(nockDef.scope)\n if (options.port === null) {\n return `${nockDef.scope}:${nockDef.port}`\n } else {\n if (parseInt(options.port) !== parseInt(nockDef.port)) {\n throw new Error(\n 'Mismatched port numbers in scope and port properties of nock definition.',\n )\n }\n }\n }\n\n return nockDef.scope\n}\n\nfunction tryJsonParse(string) {\n try {\n return JSON.parse(string)\n } catch (err) {\n return string\n }\n}\n\nfunction define(nockDefs) {\n const scopes = []\n\n nockDefs.forEach(function (nockDef) {\n const nscope = getScopeFromDefinition(nockDef)\n const npath = nockDef.path\n if (!nockDef.method) {\n throw Error('Method is required')\n }\n const method = nockDef.method.toLowerCase()\n const status = getStatusFromDefinition(nockDef)\n const rawHeaders = nockDef.rawHeaders || []\n const reqheaders = nockDef.reqheaders || {}\n const badheaders = nockDef.badheaders || []\n const options = { ...nockDef.options }\n\n // We use request headers for both filtering (see below) and mocking.\n // Here we are setting up mocked request headers but we don't want to\n // be changing the user's options object so we clone it first.\n options.reqheaders = reqheaders\n options.badheaders = badheaders\n\n // Response is not always JSON as it could be a string or binary data or\n // even an array of binary buffers (e.g. when content is encoded).\n let response\n if (!nockDef.response) {\n response = ''\n // TODO: Rename `responseIsBinary` to `responseIsUtf8Representable`.\n } else if (nockDef.responseIsBinary) {\n response = Buffer.from(nockDef.response, 'hex')\n } else {\n response =\n typeof nockDef.response === 'string'\n ? tryJsonParse(nockDef.response)\n : nockDef.response\n }\n\n const scope = new Scope(nscope, options)\n\n // If request headers were specified filter by them.\n Object.entries(reqheaders).forEach(([fieldName, value]) => {\n scope.matchHeader(fieldName, value)\n })\n\n const acceptableFilters = ['filteringRequestBody', 'filteringPath']\n acceptableFilters.forEach(filter => {\n if (nockDef[filter]) {\n scope[filter](nockDef[filter])\n }\n })\n\n scope\n .intercept(npath, method, nockDef.body)\n .reply(status, response, rawHeaders)\n\n scopes.push(scope)\n })\n\n return scopes\n}\n\nmodule.exports = {\n Scope,\n load,\n loadDefs,\n define,\n}\n","'use strict'\n\nconst assert = require('assert')\nconst recorder = require('./recorder')\nconst {\n activate,\n disableNetConnect,\n enableNetConnect,\n removeAll: cleanAll,\n} = require('./intercept')\nconst { loadDefs, define } = require('./scope')\n\nconst { format } = require('util')\nconst path = require('path')\nconst debug = require('debug')('nock.back')\n\nlet _mode = null\n\nlet fs\n\ntry {\n fs = require('fs')\n} catch (err) {\n // do nothing, probably in browser\n}\n\n/**\n * nock the current function with the fixture given\n *\n * @param {string} fixtureName - the name of the fixture, e.x. 'foo.json'\n * @param {object} options - [optional] extra options for nock with, e.x. `{ assert: true }`\n * @param {function} nockedFn - [optional] callback function to be executed with the given fixture being loaded;\n * if defined the function will be called with context `{ scopes: loaded_nocks || [] }`\n * set as `this` and `nockDone` callback function as first and only parameter;\n * if not defined a promise resolving to `{nockDone, context}` where `context` is\n * aforementioned `{ scopes: loaded_nocks || [] }`\n *\n * List of options:\n *\n * @param {function} before - a preprocessing function, gets called before nock.define\n * @param {function} after - a postprocessing function, gets called after nock.define\n * @param {function} afterRecord - a postprocessing function, gets called after recording. Is passed the array\n * of scopes recorded and should return the array scopes to save to the fixture\n * @param {function} recorder - custom options to pass to the recorder\n *\n */\nfunction Back(fixtureName, options, nockedFn) {\n if (!Back.fixtures) {\n throw new Error(\n 'Back requires nock.back.fixtures to be set\\n' +\n 'Ex:\\n' +\n \"\\trequire(nock).back.fixtures = '/path/to/fixtures/'\",\n )\n }\n\n if (typeof fixtureName !== 'string') {\n throw new Error('Parameter fixtureName must be a string')\n }\n\n if (arguments.length === 1) {\n options = {}\n } else if (arguments.length === 2) {\n // If 2nd parameter is a function then `options` has been omitted\n // otherwise `options` haven't been omitted but `nockedFn` was.\n if (typeof options === 'function') {\n nockedFn = options\n options = {}\n }\n }\n\n _mode.setup()\n\n const fixture = path.join(Back.fixtures, fixtureName)\n const context = _mode.start(fixture, options)\n\n const nockDone = function () {\n _mode.finish(fixture, options, context)\n }\n\n debug('context:', context)\n\n // If nockedFn is a function then invoke it, otherwise return a promise resolving to nockDone.\n if (typeof nockedFn === 'function') {\n nockedFn.call(context, nockDone)\n } else {\n return Promise.resolve({ nockDone, context })\n }\n}\n\n/*******************************************************************************\n * Modes *\n *******************************************************************************/\n\nconst wild = {\n setup: function () {\n cleanAll()\n recorder.restore()\n activate()\n enableNetConnect()\n },\n\n start: function () {\n return load() // don't load anything but get correct context\n },\n\n finish: function () {\n // nothing to do\n },\n}\n\nconst dryrun = {\n setup: function () {\n recorder.restore()\n cleanAll()\n activate()\n // We have to explicitly enable net connectivity as by default it's off.\n enableNetConnect()\n },\n\n start: function (fixture, options) {\n const contexts = load(fixture, options)\n\n enableNetConnect()\n return contexts\n },\n\n finish: function () {\n // nothing to do\n },\n}\n\nconst record = {\n setup: function () {\n recorder.restore()\n recorder.clear()\n cleanAll()\n activate()\n disableNetConnect()\n },\n\n start: function (fixture, options) {\n if (!fs) {\n throw new Error('no fs')\n }\n const context = load(fixture, options)\n\n if (!context.isLoaded) {\n recorder.record({\n dont_print: true,\n output_objects: true,\n ...options.recorder,\n })\n\n context.isRecording = true\n }\n\n return context\n },\n\n finish: function (fixture, options, context) {\n if (context.isRecording) {\n let outputs = recorder.outputs()\n\n if (typeof options.afterRecord === 'function') {\n outputs = options.afterRecord(outputs)\n }\n\n outputs =\n typeof outputs === 'string' ? outputs : JSON.stringify(outputs, null, 4)\n debug('recorder outputs:', outputs)\n\n fs.mkdirSync(path.dirname(fixture), { recursive: true })\n fs.writeFileSync(fixture, outputs)\n }\n },\n}\n\nconst update = {\n setup: function () {\n recorder.restore()\n recorder.clear()\n cleanAll()\n activate()\n disableNetConnect()\n },\n\n start: function (fixture, options) {\n if (!fs) {\n throw new Error('no fs')\n }\n const context = removeFixture(fixture)\n recorder.record({\n dont_print: true,\n output_objects: true,\n ...options.recorder,\n })\n\n context.isRecording = true\n\n return context\n },\n\n finish: function (fixture, options, context) {\n let outputs = recorder.outputs()\n\n if (typeof options.afterRecord === 'function') {\n outputs = options.afterRecord(outputs)\n }\n\n outputs =\n typeof outputs === 'string' ? outputs : JSON.stringify(outputs, null, 4)\n debug('recorder outputs:', outputs)\n\n fs.mkdirSync(path.dirname(fixture), { recursive: true })\n fs.writeFileSync(fixture, outputs)\n },\n}\n\nconst lockdown = {\n setup: function () {\n recorder.restore()\n recorder.clear()\n cleanAll()\n activate()\n disableNetConnect()\n },\n\n start: function (fixture, options) {\n return load(fixture, options)\n },\n\n finish: function () {\n // nothing to do\n },\n}\n\nfunction load(fixture, options) {\n const context = {\n scopes: [],\n assertScopesFinished: function () {\n assertScopes(this.scopes, fixture)\n },\n query: function () {\n const nested = this.scopes.map(scope =>\n scope.interceptors.map(interceptor => ({\n method: interceptor.method,\n uri: interceptor.uri,\n basePath: interceptor.basePath,\n path: interceptor.path,\n queries: interceptor.queries,\n counter: interceptor.counter,\n body: interceptor.body,\n statusCode: interceptor.statusCode,\n optional: interceptor.optional,\n })),\n )\n\n return [].concat.apply([], nested)\n },\n }\n\n if (fixture && fixtureExists(fixture)) {\n let scopes = loadDefs(fixture)\n applyHook(scopes, options.before)\n\n scopes = define(scopes)\n applyHook(scopes, options.after)\n\n context.scopes = scopes\n context.isLoaded = true\n }\n\n return context\n}\n\nfunction removeFixture(fixture, options) {\n const context = {\n scopes: [],\n assertScopesFinished: function () {},\n }\n\n if (fixture && fixtureExists(fixture)) {\n /* istanbul ignore next - fs.unlinkSync is for node 10 support */\n fs.rmSync ? fs.rmSync(fixture) : fs.unlinkSync(fixture)\n }\n context.isLoaded = false\n return context\n}\n\nfunction applyHook(scopes, fn) {\n if (!fn) {\n return\n }\n\n if (typeof fn !== 'function') {\n throw new Error('processing hooks must be a function')\n }\n\n scopes.forEach(fn)\n}\n\nfunction fixtureExists(fixture) {\n if (!fs) {\n throw new Error('no fs')\n }\n\n return fs.existsSync(fixture)\n}\n\nfunction assertScopes(scopes, fixture) {\n const pending = scopes\n .filter(scope => !scope.isDone())\n .map(scope => scope.pendingMocks())\n\n if (pending.length) {\n assert.fail(\n format(\n '%j was not used, consider removing %s to rerecord fixture',\n [].concat(...pending),\n fixture,\n ),\n )\n }\n}\n\nconst Modes = {\n wild, // all requests go out to the internet, dont replay anything, doesnt record anything\n\n dryrun, // use recorded nocks, allow http calls, doesnt record anything, useful for writing new tests (default)\n\n record, // use recorded nocks, record new nocks\n\n update, // allow http calls, record all nocks, don't use recorded nocks\n\n lockdown, // use recorded nocks, disables all http calls even when not nocked, doesnt record\n}\n\nBack.setMode = function (mode) {\n if (!(mode in Modes)) {\n throw new Error(`Unknown mode: ${mode}`)\n }\n\n Back.currentMode = mode\n debug('New nock back mode:', Back.currentMode)\n\n _mode = Modes[mode]\n _mode.setup()\n}\n\nBack.fixtures = null\nBack.currentMode = null\n\nmodule.exports = Back\n","'use strict'\n\nconst back = require('./lib/back')\nconst emitter = require('./lib/global_emitter')\nconst {\n activate,\n isActive,\n isDone,\n isOn,\n pendingMocks,\n activeMocks,\n removeInterceptor,\n disableNetConnect,\n enableNetConnect,\n removeAll,\n abortPendingRequests,\n} = require('./lib/intercept')\nconst recorder = require('./lib/recorder')\nconst { Scope, load, loadDefs, define } = require('./lib/scope')\n\nmodule.exports = (basePath, options) => new Scope(basePath, options)\n\nObject.assign(module.exports, {\n activate,\n isActive,\n isDone,\n pendingMocks,\n activeMocks,\n removeInterceptor,\n disableNetConnect,\n enableNetConnect,\n cleanAll: removeAll,\n abortPendingRequests,\n load,\n loadDefs,\n define,\n emitter,\n recorder: {\n rec: recorder.record,\n clear: recorder.clear,\n play: recorder.outputs,\n },\n restore: recorder.restore,\n back,\n})\n\n// We always activate Nock on import, overriding the globals.\n// Setting the Back mode \"activates\" Nock by overriding the global entries in the `http/s` modules.\n// If Nock Back is configured, we need to honor that setting for backward compatibility,\n// otherwise we rely on Nock Back's default initializing side effect.\nif (isOn()) {\n back.setMode(process.env.NOCK_BACK_MODE || 'dryrun')\n}\n","export * from './NotificationServicesController';\nexport * as Types from './types';\nexport * as Mocks from './__fixtures__';\nexport * as Processors from './processors';\nexport * as Constants from './constants';\n","export * from './mock-feature-announcements';\nexport * from './mock-notification-trigger';\nexport * from './mock-notification-user-storage';\nexport * from './mock-raw-notifications';\nexport * from './mockResponses';\nexport * from './mockServices';\n","import { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { ContentfulResult } from '../services/feature-announcements';\nimport type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';\n\n/**\n * Mocking Utility - create a mock normalized feature announcement\n *\n * @returns Mock Normalized Feature Announcement\n */\nexport function createMockFeatureAnnouncementAPIResult(): ContentfulResult {\n return {\n sys: {\n type: 'Array',\n },\n total: 17,\n skip: 0,\n limit: 1,\n items: [\n {\n metadata: {\n tags: [],\n },\n sys: {\n space: {\n sys: {\n type: 'Link',\n linkType: 'Space',\n id: 'jdkgyfmyd9sw',\n },\n },\n id: '1ABRmHaNCgmxROKXXLXsMu',\n type: 'Entry',\n createdAt: '2024-04-09T13:24:01.872Z',\n updatedAt: '2024-04-09T13:24:01.872Z',\n environment: {\n sys: {\n id: 'master',\n type: 'Link',\n linkType: 'Environment',\n },\n },\n revision: 1,\n contentType: {\n sys: {\n type: 'Link',\n linkType: 'ContentType',\n id: 'productAnnouncement',\n },\n },\n locale: 'en-US',\n },\n fields: {\n title: 'Don’t miss out on airdrops and new NFT mints!',\n id: 'dont-miss-out-on-airdrops-and-new-nft-mints',\n category: 'ANNOUNCEMENT',\n shortDescription:\n 'Check your airdrop eligibility and see trending NFT drops. Head over to the Explore tab to get started. ',\n image: {\n sys: {\n type: 'Link',\n linkType: 'Asset',\n id: '5jqq8sFeLc6XEoeWlpI3aB',\n },\n },\n longDescription: {\n data: {},\n content: [\n {\n data: {},\n content: [\n {\n data: {},\n marks: [],\n value:\n 'You can now verify if any of your connected addresses are eligible for airdrops and other ERC-20 claims in a secure and convenient way. We’ve also added trending NFT mints based on creators you’ve minted from before or other tokens you hold. Head over to the Explore tab to get started. \\n',\n nodeType: 'text',\n },\n ],\n nodeType: 'paragraph',\n },\n ],\n nodeType: 'document',\n },\n link: {\n sys: {\n type: 'Link',\n linkType: 'Entry',\n id: '62xKYM2ydo4F1mS5q97K5q',\n },\n },\n },\n },\n ],\n includes: {\n Entry: [\n {\n metadata: {\n tags: [],\n },\n sys: {\n space: {\n sys: {\n type: 'Link',\n linkType: 'Space',\n id: 'jdkgyfmyd9sw',\n },\n },\n id: '62xKYM2ydo4F1mS5q97K5q',\n type: 'Entry',\n createdAt: '2024-04-09T13:23:03.636Z',\n updatedAt: '2024-04-09T13:23:03.636Z',\n environment: {\n sys: {\n id: 'master',\n type: 'Link',\n linkType: 'Environment',\n },\n },\n revision: 1,\n contentType: {\n sys: {\n type: 'Link',\n linkType: 'ContentType',\n id: 'link',\n },\n },\n locale: 'en-US',\n },\n fields: {\n extensionLinkText: 'Try now',\n extensionLinkRoute: 'home.html',\n },\n },\n ],\n Asset: [\n {\n metadata: {\n tags: [],\n },\n sys: {\n space: {\n sys: {\n type: 'Link',\n linkType: 'Space',\n id: 'jdkgyfmyd9sw',\n },\n },\n id: '5jqq8sFeLc6XEoeWlpI3aB',\n type: 'Asset',\n createdAt: '2024-04-09T13:23:13.327Z',\n updatedAt: '2024-04-09T13:23:13.327Z',\n environment: {\n sys: {\n id: 'master',\n type: 'Link',\n linkType: 'Environment',\n },\n },\n revision: 1,\n locale: 'en-US',\n },\n fields: {\n title: 'PDAPP notification image Airdrops & NFT mints',\n description: '',\n file: {\n url: '//images.ctfassets.net/jdkgyfmyd9sw/5jqq8sFeLc6XEoeWlpI3aB/73ee0f1afa9916c3a7538b0bbee09c26/PDAPP_notification_image_Airdrops___NFT_mints.png',\n details: {\n size: 797731,\n image: {\n width: 2880,\n height: 1921,\n },\n },\n fileName: 'PDAPP notification image_Airdrops & NFT mints.png',\n contentType: 'image/png',\n },\n },\n },\n ],\n },\n } as unknown as ContentfulResult;\n}\n\n/**\n * Mocking Utility - create a mock raw feature announcement\n *\n * @returns Mock Raw Feature Announcement\n */\nexport function createMockFeatureAnnouncementRaw(): FeatureAnnouncementRawNotification {\n return {\n type: TRIGGER_TYPES.FEATURES_ANNOUNCEMENT,\n createdAt: '2999-04-09T13:24:01.872Z',\n data: {\n id: 'dont-miss-out-on-airdrops-and-new-nft-mints',\n category: 'ANNOUNCEMENT',\n title: 'Don’t miss out on airdrops and new NFT mints!',\n longDescription: `<p>You can now verify if any of your connected addresses are eligible for airdrops and other ERC-20 claims in a secure and convenient way. We’ve also added trending NFT mints based on creators you’ve minted from before or other tokens you hold. Head over to the Explore tab to get started.</p>`,\n shortDescription:\n 'Check your airdrop eligibility and see trending NFT drops. Head over to the Explore tab to get started.',\n image: {\n title: 'PDAPP notification image Airdrops & NFT mints',\n description: '',\n url: '//images.ctfassets.net/jdkgyfmyd9sw/5jqq8sFeLc6XEoeWlpI3aB/73ee0f1afa9916c3a7538b0bbee09c26/PDAPP_notification_image_Airdrops___NFT_mints.png',\n },\n extensionLink: {\n extensionLinkText: 'Try now',\n extensionLinkRoute: 'home.html',\n },\n },\n };\n}\n","import { v4 as uuidv4 } from 'uuid';\n\nimport type { NotificationTrigger } from '../utils/utils';\n\n/**\n * Mocking Utility - create a mock Notification Trigger\n *\n * @param override - provide any override configuration for the mock\n * @returns a mock Notification Trigger\n */\nexport function createMockNotificationTrigger(\n override?: Partial<NotificationTrigger>,\n): NotificationTrigger {\n return {\n id: uuidv4(),\n address: '0xFAKE_ADDRESS',\n chainId: '1',\n kind: 'eth_sent',\n enabled: true,\n ...override,\n };\n}\n","import { USER_STORAGE_VERSION_KEY } from '../constants/constants';\nimport { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { UserStorage } from '../types/user-storage/user-storage';\nimport { initializeUserStorage } from '../utils/utils';\n\nexport const MOCK_USER_STORAGE_ACCOUNT =\n '0x0000000000000000000000000000000000000000';\nexport const MOCK_USER_STORAGE_CHAIN = '1';\n\n/**\n * Mocking Utility - create a mock notification user storage object\n *\n * @param override - provide any override configuration for the mock\n * @returns a mock notification user storage object\n */\nexport function createMockUserStorage(\n override?: Partial<UserStorage>,\n): UserStorage {\n return {\n [USER_STORAGE_VERSION_KEY]: '1',\n [MOCK_USER_STORAGE_ACCOUNT]: {\n [MOCK_USER_STORAGE_CHAIN]: {\n '111-111-111-111': {\n k: TRIGGER_TYPES.ERC20_RECEIVED,\n e: true,\n },\n '222-222-222-222': {\n k: TRIGGER_TYPES.ERC20_SENT,\n e: true,\n },\n },\n },\n ...override,\n };\n}\n\n/**\n * Mocking Utility - create a mock notification user storage object with triggers\n *\n * @param triggers - provide any override configuration for the mock\n * @returns a mock notification user storage object with triggers\n */\nexport function createMockUserStorageWithTriggers(\n triggers: string[] | { id: string; e: boolean; k?: TRIGGER_TYPES }[],\n): UserStorage {\n const userStorage: UserStorage = {\n [USER_STORAGE_VERSION_KEY]: '1',\n [MOCK_USER_STORAGE_ACCOUNT]: {\n [MOCK_USER_STORAGE_CHAIN]: {},\n },\n };\n\n // insert triggerIds\n triggers.forEach((t) => {\n let tId: string;\n let e: boolean;\n let k: TRIGGER_TYPES;\n if (typeof t === 'string') {\n tId = t;\n e = true;\n k = TRIGGER_TYPES.ERC20_RECEIVED;\n } else {\n tId = t.id;\n e = t.e;\n k = t.k ?? TRIGGER_TYPES.ERC20_RECEIVED;\n }\n\n userStorage[MOCK_USER_STORAGE_ACCOUNT][MOCK_USER_STORAGE_CHAIN][tId] = {\n k,\n e,\n };\n });\n\n return userStorage;\n}\n\n/**\n * Mocking Utility - create a mock notification user storage object (full/realistic object)\n *\n * @param props - provide any override configuration for the mock\n * @param props.triggersEnabled - choose if all triggers created are enabled/disabled\n * @param props.address - choose a specific address for triggers to be assigned to\n * @returns a mock full notification user storage object\n */\nexport function createMockFullUserStorage(\n props: { triggersEnabled?: boolean; address?: string } = {},\n): UserStorage {\n return initializeUserStorage(\n [{ address: props.address ?? MOCK_USER_STORAGE_ACCOUNT }],\n props.triggersEnabled ?? true,\n );\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { OnChainRawNotification } from '../types/on-chain-notification/on-chain-notification';\n\n/**\n * Mocking Utility - create a mock Eth sent notification\n * @returns Mock raw Eth sent notification\n */\nexport function createMockNotificationEthSent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ETH_SENT,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'eth_sent',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n from: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n to: '0x881D40237659C251811CEC9c364ef91dC08D300D',\n amount: {\n usd: '670.64',\n eth: '0.005',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Eth Received notification\n * @returns Mock raw Eth Received notification\n */\nexport function createMockNotificationEthReceived(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ETH_RECEIVED,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'eth_received',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n from: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n to: '0x881D40237659C251811CEC9c364ef91dC08D300D',\n amount: {\n usd: '670.64',\n eth: '808.000000000000000000',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC20 sent notification\n * @returns Mock raw ERC20 sent notification\n */\nexport function createMockNotificationERC20Sent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC20_SENT,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'erc20_sent',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n to: '0xecc19e177d24551aa7ed6bc6fe566eca726cc8a9',\n from: '0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae',\n token: {\n usd: '1.00',\n name: 'USDC',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdc.svg',\n amount: '4956250000',\n symbol: 'USDC',\n address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n decimals: '6',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC20 received notification\n * @returns Mock raw ERC20 received notification\n */\nexport function createMockNotificationERC20Received(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC20_RECEIVED,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'erc20_received',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n to: '0xeae7380dd4cef6fbd1144f49e4d1e6964258a4f4',\n from: '0x51c72848c68a965f66fa7a88855f9f7784502a7f',\n token: {\n usd: '0.00',\n name: 'SHIBA INU',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/shib.svg',\n amount: '8382798736999999457296646144',\n symbol: 'SHIB',\n address: '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',\n decimals: '18',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC721 sent notification\n * @returns Mock raw ERC721 sent notification\n */\nexport function createMockNotificationERC721Sent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC721_SENT,\n block_number: 18576643,\n block_timestamp: '1700043467',\n chain_id: 1,\n created_at: '2023-11-15T11:08:17.895407Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0xf47f628fe3bd2595e9ab384bfffc3859b448e451',\n nft: {\n name: 'Captainz #8680',\n image:\n 'https://i.seadn.io/s/raw/files/ae0fc06714ff7fb40217340d8a242c0e.gif?w=500&auto=format',\n token_id: '8680',\n collection: {\n name: 'The Captainz',\n image:\n 'https://i.seadn.io/gcs/files/6df4d75778066bce740050615bc84e21.png?w=500&auto=format',\n symbol: 'Captainz',\n address: '0x769272677fab02575e84945f03eca517acc544cc',\n },\n },\n from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',\n kind: 'erc721_sent',\n network_fee: {\n gas_price: '24550653274',\n native_token_price_in_usd: '1986.61',\n },\n },\n id: 'a4193058-9814-537e-9df4-79dcac727fb6',\n trigger_id: '028485be-b994-422b-a93b-03fcc01ab715',\n tx_hash:\n '0x0833c69fb41cf972a0f031fceca242939bc3fcf82b964b74606649abcad371bd',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC721 received notification\n * @returns Mock raw ERC721 received notification\n */\nexport function createMockNotificationERC721Received(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC721_RECEIVED,\n block_number: 18571446,\n block_timestamp: '1699980623',\n chain_id: 1,\n created_at: '2023-11-14T17:40:52.319281Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0xba7f3daa8adfdad686574406ab9bd5d2f0a49d2e',\n nft: {\n name: 'The Plague #2722',\n image:\n 'https://i.seadn.io/s/raw/files/a96f90ec8ebf55a2300c66a0c46d6a16.png?w=500&auto=format',\n token_id: '2722',\n collection: {\n name: 'The Plague NFT',\n image:\n 'https://i.seadn.io/gcs/files/4577987a5ca45ca5118b2e31559ee4d1.jpg?w=500&auto=format',\n symbol: 'FROG',\n address: '0xc379e535caff250a01caa6c3724ed1359fe5c29b',\n },\n },\n from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',\n kind: 'erc721_received',\n network_fee: {\n gas_price: '53701898538',\n native_token_price_in_usd: '2047.01',\n },\n },\n id: '00a79d24-befa-57ed-a55a-9eb8696e1654',\n trigger_id: 'd24ac26a-8579-49ec-9947-d04d63592ebd',\n tx_hash:\n '0xe554c9e29e6eeca8ba94da4d047334ba08b8eb9ca3b801dd69cec08dfdd4ae43',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC1155 sent notification\n * @returns Mock raw ERC1155 sent notification\n */\nexport function createMockNotificationERC1155Sent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC1155_SENT,\n block_number: 18615206,\n block_timestamp: '1700510003',\n chain_id: 1,\n created_at: '2023-11-20T20:44:10.110706Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',\n nft: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',\n token_id: '1',\n collection: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',\n symbol: 'TRUTH',\n address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',\n },\n },\n from: '0x0000000000000000000000000000000000000000',\n kind: 'erc1155_sent',\n network_fee: {\n gas_price: '33571446596',\n native_token_price_in_usd: '2038.88',\n },\n },\n id: 'a09ff9d1-623a-52ab-a3d4-c7c8c9a58362',\n trigger_id: 'e2130f7d-78b8-4c34-999a-3f3d3bb5b03c',\n tx_hash:\n '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC1155 received notification\n * @returns Mock raw ERC1155 received notification\n */\nexport function createMockNotificationERC1155Received(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC1155_RECEIVED,\n block_number: 18615206,\n block_timestamp: '1700510003',\n chain_id: 1,\n created_at: '2023-11-20T20:44:10.110706Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',\n nft: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',\n token_id: '1',\n collection: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',\n symbol: 'TRUTH',\n address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',\n },\n },\n from: '0x0000000000000000000000000000000000000000',\n kind: 'erc1155_received',\n network_fee: {\n gas_price: '33571446596',\n native_token_price_in_usd: '2038.88',\n },\n },\n id: 'b6b93c84-e8dc-54ed-9396-7ea50474843a',\n trigger_id: '710c8abb-43a9-42a5-9d86-9dd258726c82',\n tx_hash:\n '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock MetaMask Swaps notification\n * @returns Mock raw MetaMask Swaps notification\n */\nexport function createMockNotificationMetaMaskSwapsCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.METAMASK_SWAP_COMPLETED,\n block_number: 18377666,\n block_timestamp: '1697637275',\n chain_id: 1,\n created_at: '2023-10-18T13:58:49.854596Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'metamask_swap_completed',\n rate: '1558.27',\n token_in: {\n usd: '1576.73',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '9000000000000000',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n token_out: {\n usd: '1.00',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdt.svg',\n amount: '14024419',\n symbol: 'USDT',\n address: '0xdac17f958d2ee523a2206206994597c13d831ec7',\n decimals: '6',\n name: 'USDT',\n },\n network_fee: {\n gas_price: '15406129273',\n native_token_price_in_usd: '1576.73',\n },\n },\n id: '7ddfe6a1-ac52-5ffe-aa40-f04242db4b8b',\n trigger_id: 'd2eaa2eb-2e6e-4fd5-8763-b70ea571b46c',\n tx_hash:\n '0xf69074290f3aa11bce567aabc9ca0df7a12559dfae1b80ba1a124e9dfe19ecc5',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock RocketPool Stake Completed notification\n * @returns Mock raw RocketPool Stake Completed notification\n */\nexport function createMockNotificationRocketPoolStakeCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ROCKETPOOL_STAKE_COMPLETED,\n block_number: 18585057,\n block_timestamp: '1700145059',\n chain_id: 1,\n created_at: '2023-11-20T12:02:48.796824Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'rocketpool_stake_completed',\n stake_in: {\n usd: '2031.86',\n name: 'Ethereum',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '190690478063438272',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n },\n stake_out: {\n usd: '2226.49',\n name: 'Rocket Pool ETH',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',\n amount: '175024360778165879',\n symbol: 'RETH',\n address: '0xae78736Cd615f374D3085123A210448E74Fc6393',\n decimals: '18',\n },\n network_fee: {\n gas_price: '36000000000',\n native_token_price_in_usd: '2031.86',\n },\n },\n id: 'c2a2f225-b2fb-5d6c-ba56-e27a5c71ffb9',\n trigger_id: '5110ff97-acff-40c0-83b4-11d487b8c7b0',\n tx_hash:\n '0xcfc0693bf47995907b0f46ef0644cf16dd9a0de797099b2e00fd481e1b2117d3',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock RocketPool Un-staked notification\n * @returns Mock raw RocketPool Un-staked notification\n */\nexport function createMockNotificationRocketPoolUnStakeCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ROCKETPOOL_UNSTAKE_COMPLETED,\n block_number: 18384336,\n block_timestamp: '1697718011',\n chain_id: 1,\n created_at: '2023-10-19T13:11:10.623042Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'rocketpool_unstake_completed',\n stake_in: {\n usd: '1686.34',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',\n amount: '66608041413696770',\n symbol: 'RETH',\n address: '0xae78736Cd615f374D3085123A210448E74Fc6393',\n decimals: '18',\n name: 'Rocketpool Eth',\n },\n stake_out: {\n usd: '1553.75',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '72387843427700824',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '5656322987',\n native_token_price_in_usd: '1553.75',\n },\n },\n id: 'd8c246e7-a0a4-5f1d-b079-2b1707665fbc',\n trigger_id: '291ec897-f569-4837-b6c0-21001b198dff',\n tx_hash:\n '0xc7972a7e409abfc62590ec90e633acd70b9b74e76ad02305be8bf133a0e22d5f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Stake Completed notification\n * @returns Mock raw Lido Stake Completed notification\n */\nexport function createMockNotificationLidoStakeCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_STAKE_COMPLETED,\n block_number: 18487118,\n block_timestamp: '1698961091',\n chain_id: 1,\n created_at: '2023-11-02T22:28:49.970865Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_stake_completed',\n stake_in: {\n usd: '1806.33',\n name: 'Ethereum',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '330303634023928032',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n },\n stake_out: {\n usd: '1801.30',\n name: 'Liquid staked Ether 2.0',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '330303634023928032',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n },\n network_fee: {\n gas_price: '26536359866',\n native_token_price_in_usd: '1806.33',\n },\n },\n id: '9d9b1467-b3ee-5492-8ca2-22382657b690',\n trigger_id: 'ec10d66a-f78f-461f-83c9-609aada8cc50',\n tx_hash:\n '0x8cc0fa805f7c3b1743b14f3b91c6b824113b094f26d4ccaf6a71ad8547ce6a0f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Requested notification\n * @returns Mock raw Lido Withdrawal Requested notification\n */\nexport function createMockNotificationLidoWithdrawalRequested(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_WITHDRAWAL_REQUESTED,\n block_number: 18377760,\n block_timestamp: '1697638415',\n chain_id: 1,\n created_at: '2023-10-18T15:04:02.482526Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_withdrawal_requested',\n stake_in: {\n usd: '1568.54',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '97180668792218669859',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n name: 'Staked Eth',\n },\n stake_out: {\n usd: '1576.73',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '97180668792218669859',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '11658906980',\n native_token_price_in_usd: '1576.73',\n },\n },\n id: '29ddc718-78c6-5f91-936f-2bef13a605f0',\n trigger_id: 'ef003925-3379-4ba7-9e2d-8218690cadc8',\n tx_hash:\n '0x58b5f82e084cb750ea174e02b20fbdfd2ba8d78053deac787f34fc38e5d427aa',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Completed notification\n * @returns Mock raw Lido Withdrawal Completed notification\n */\nexport function createMockNotificationLidoWithdrawalCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_WITHDRAWAL_COMPLETED,\n block_number: 18378208,\n block_timestamp: '1697643851',\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_withdrawal_completed',\n stake_in: {\n usd: '1570.23',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '35081997661451346',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n name: 'Staked Eth',\n },\n stake_out: {\n usd: '1571.74',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '35081997661451346',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '12699495150',\n native_token_price_in_usd: '1571.74',\n },\n },\n id: 'f4ef0b7f-5612-537f-9144-0b5c63ae5391',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042c',\n tx_hash:\n '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Ready notification\n * @returns Mock raw Lido Withdrawal Ready notification\n */\nexport function createMockNotificationLidoReadyToBeWithdrawn(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_STAKE_READY_TO_BE_WITHDRAWN,\n block_number: 18378208,\n block_timestamp: '1697643851',\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_stake_ready_to_be_withdrawn',\n request_id: '123456789',\n staked_eth: {\n address: '0x881D40237659C251811CEC9c364ef91dC08D300F',\n symbol: 'ETH',\n name: 'Ethereum',\n amount: '2.5',\n decimals: '18',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n usd: '10000.00',\n },\n },\n id: 'f4ef0b7f-5612-537f-9144-0b5c63ae5391',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042c',\n tx_hash:\n '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - creates an array of raw on-chain notifications\n * @returns Array of raw on-chain notifications\n */\nexport function createMockRawOnChainNotifications(): OnChainRawNotification[] {\n return [1, 2, 3].map((id) => {\n const notification = createMockNotificationEthSent();\n notification.id += `-${id}`;\n return notification;\n });\n}\n","import { FEATURE_ANNOUNCEMENT_API } from '../services/feature-announcements';\nimport {\n NOTIFICATION_API_LIST_ENDPOINT,\n NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,\n TRIGGER_API_BATCH_ENDPOINT,\n} from '../services/onchain-notifications';\nimport { createMockFeatureAnnouncementAPIResult } from './mock-feature-announcements';\nimport { createMockRawOnChainNotifications } from './mock-raw-notifications';\n\ntype MockResponse = {\n url: string;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const CONTENTFUL_RESPONSE = createMockFeatureAnnouncementAPIResult();\n\nexport const getMockFeatureAnnouncementResponse = () => {\n return {\n url: FEATURE_ANNOUNCEMENT_API,\n requestMethod: 'GET',\n response: CONTENTFUL_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockBatchCreateTriggersResponse = () => {\n return {\n url: TRIGGER_API_BATCH_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockBatchDeleteTriggersResponse = () => {\n return {\n url: TRIGGER_API_BATCH_ENDPOINT,\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const MOCK_RAW_ON_CHAIN_NOTIFICATIONS =\n createMockRawOnChainNotifications();\n\nexport const getMockListNotificationsResponse = () => {\n return {\n url: NOTIFICATION_API_LIST_ENDPOINT,\n requestMethod: 'POST',\n response: MOCK_RAW_ON_CHAIN_NOTIFICATIONS,\n } satisfies MockResponse;\n};\n\nexport const getMockMarkNotificationsAsReadResponse = () => {\n return {\n url: NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n","import nock from 'nock';\n\nimport {\n getMockBatchCreateTriggersResponse,\n getMockBatchDeleteTriggersResponse,\n getMockFeatureAnnouncementResponse,\n getMockListNotificationsResponse,\n getMockMarkNotificationsAsReadResponse,\n} from './mockResponses';\n\ntype MockReply = {\n status: nock.StatusCode;\n body?: nock.Body;\n};\n\nexport const mockFetchFeatureAnnouncementNotifications = (\n mockReply?: MockReply,\n) => {\n const mockResponse = getMockFeatureAnnouncementResponse();\n const reply = mockReply ?? { status: 200, body: mockResponse.response };\n const mockEndpoint = nock(mockResponse.url)\n .get('')\n .query(true)\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n\nexport const mockBatchCreateTriggers = (mockReply?: MockReply) => {\n const mockResponse = getMockBatchCreateTriggersResponse();\n const reply = mockReply ?? { status: 204 };\n\n const mockEndpoint = nock(mockResponse.url)\n .post('')\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n\nexport const mockBatchDeleteTriggers = (mockReply?: MockReply) => {\n const mockResponse = getMockBatchDeleteTriggersResponse();\n const reply = mockReply ?? { status: 204 };\n\n const mockEndpoint = nock(mockResponse.url)\n .delete('')\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n\nexport const mockListNotifications = (mockReply?: MockReply) => {\n const mockResponse = getMockListNotificationsResponse();\n const reply = mockReply ?? { status: 200, body: mockResponse.response };\n\n const mockEndpoint = nock(mockResponse.url)\n .post('')\n .query(true)\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n\nexport const mockMarkNotificationsAsRead = (mockReply?: MockReply) => {\n const mockResponse = getMockMarkNotificationsAsReadResponse();\n const reply = mockReply ?? { status: 200 };\n\n const mockEndpoint = nock(mockResponse.url)\n .post('')\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,WAAO,UAAU,SAAS,KAAK,SAAS;AACtC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAO,MAAM,GAAG;AAAA,MAClB,WAAW,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,eAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,MACnD;AACA,YAAM,IAAI;AAAA,QACR,0DACE,KAAK,UAAU,GAAG;AAAA,MACtB;AAAA,IACF;AAUA,aAAS,MAAM,KAAK;AAClB,YAAM,OAAO,GAAG;AAChB,UAAI,IAAI,SAAS,KAAK;AACpB;AAAA,MACF;AACA,UAAI,QAAQ,mIAAmI;AAAA,QAC7I;AAAA,MACF;AACA,UAAI,CAA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AM,MAAM,QAAQ,MAAM,IAAI;AAEjC,SAAO;AACT;AAEO,IAAM,0BAA0B,CAAC,cAA0B;AAChE,QAAM,eAAe,mCAAmC;AACxD,QAAM,QAAQ,aAAa,EAAE,QAAQ,IAAI;AAEzC,QAAM,mBAAe,YAAAA,SAAK,aAAa,GAAG,EACvC,KAAK,EAAE,EACP,MAAM,MAAM,QAAQ,MAAM,IAAI;AAEjC,SAAO;AACT;AAEO,IAAM,0BAA0B,CAAC,cAA0B;AAChE,QAAM,eAAe,mCAAmC;AACxD,QAAM,QAAQ,aAAa,EAAE,QAAQ,IAAI;AAEzC,QAAM,mBAAe,YAAAA,SAAK,aAAa,GAAG,EACvC,OAAO,EAAE,EACT,MAAM,MAAM,QAAQ,MAAM,IAAI;AAEjC,SAAO;AACT;AAEO,IAAM,wBAAwB,CAAC,cAA0B;AAC9D,QAAM,eAAe,iCAAiC;AACtD,QAAM,QAAQ,aAAa,EAAE,QAAQ,KAAK,MAAM,aAAa,SAAS;AAEtE,QAAM,mBAAe,YAAAA,SAAK,aAAa,GAAG,EACvC,KAAK,EAAE,EACP,MAAM,IAAI,EACV,MAAM,MAAM,QAAQ,MAAM,IAAI;AAEjC,SAAO;AACT;AAEO,IAAM,8BAA8B,CAAC,cAA0B;AACpE,QAAM,eAAe,uCAAuC;AAC5D,QAAM,QAAQ,aAAa,EAAE,QAAQ,IAAI;AAEzC,QAAM,mBAAe,YAAAA,SAAK,aAAa,GAAG,EACvC,KAAK,EAAE,EACP,MAAM,MAAM,QAAQ,MAAM,IAAI;AAEjC,SAAO;AACT;","names":["require_common","module","contentEncoding","url","responseBody","callback","nock"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/ms/index.js","../../../node_modules/debug/src/common.js","../../../node_modules/debug/src/browser.js","../../../node_modules/nock/lib/common.js","../../../node_modules/propagate/index.js","../../../node_modules/nock/lib/global_emitter.js","../../../node_modules/nock/lib/socket.js","../../../node_modules/nock/lib/playback_interceptor.js","../../../node_modules/nock/lib/intercepted_request_router.js","../../../node_modules/json-stringify-safe/stringify.js","../../../node_modules/nock/lib/match_body.js","../../../node_modules/nock/lib/interceptor.js","../../../node_modules/nock/lib/intercept.js","../../../node_modules/nock/lib/recorder.js","../../../node_modules/nock/lib/scope.js","../../../node_modules/nock/lib/back.js","../../../node_modules/nock/index.js","../src/NotificationServicesController/index.ts","../src/NotificationServicesController/__fixtures__/index.ts","../src/NotificationServicesController/__fixtures__/mock-feature-announcements.ts","../src/NotificationServicesController/__fixtures__/mock-notification-trigger.ts","../src/NotificationServicesController/__fixtures__/mock-notification-user-storage.ts","../src/NotificationServicesController/__fixtures__/mock-raw-notifications.ts","../src/NotificationServicesController/__fixtures__/mockResponses.ts","../src/NotificationServicesController/__fixtures__/mockServices.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\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' && isFinite(val)) {\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|weeks?|w|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 'weeks':\n case 'week':\n case 'w':\n return n * w;\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 var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= 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 var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#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\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\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\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","'use strict'\n\nconst debug = require('debug')('nock.common')\nconst timers = require('timers')\nconst url = require('url')\nconst util = require('util')\n\n/**\n * Normalizes the request options so that it always has `host` property.\n *\n * @param {Object} options - a parsed options object of the request\n */\nfunction normalizeRequestOptions(options) {\n options.proto = options.proto || 'http'\n options.port = options.port || (options.proto === 'http' ? 80 : 443)\n if (options.host) {\n debug('options.host:', options.host)\n if (!options.hostname) {\n if (options.host.split(':').length === 2) {\n options.hostname = options.host.split(':')[0]\n } else {\n options.hostname = options.host\n }\n }\n }\n debug('options.hostname in the end: %j', options.hostname)\n options.host = `${options.hostname || 'localhost'}:${options.port}`\n debug('options.host in the end: %j', options.host)\n\n /// lowercase host names\n ;['hostname', 'host'].forEach(function (attr) {\n if (options[attr]) {\n options[attr] = options[attr].toLowerCase()\n }\n })\n\n return options\n}\n\n/**\n * Returns true if the data contained in buffer can be reconstructed\n * from its utf8 representation.\n *\n * @param {Object} buffer - a Buffer object\n * @returns {boolean}\n */\nfunction isUtf8Representable(buffer) {\n const utfEncodedBuffer = buffer.toString('utf8')\n const reconstructedBuffer = Buffer.from(utfEncodedBuffer, 'utf8')\n return reconstructedBuffer.equals(buffer)\n}\n\n// Array where all information about all the overridden requests are held.\nlet requestOverrides = {}\n\n/**\n * Overrides the current `request` function of `http` and `https` modules with\n * our own version which intercepts issues HTTP/HTTPS requests and forwards them\n * to the given `newRequest` function.\n *\n * @param {Function} newRequest - a function handling requests; it accepts four arguments:\n * - proto - a string with the overridden module's protocol name (either `http` or `https`)\n * - overriddenRequest - the overridden module's request function already bound to module's object\n * - options - the options of the issued request\n * - callback - the callback of the issued request\n */\nfunction overrideRequests(newRequest) {\n debug('overriding requests')\n ;['http', 'https'].forEach(function (proto) {\n debug('- overriding request for', proto)\n\n const moduleName = proto // 1 to 1 match of protocol and module is fortunate :)\n const module = require(proto)\n const overriddenRequest = module.request\n const overriddenGet = module.get\n\n if (requestOverrides[moduleName]) {\n throw new Error(\n `Module's request already overridden for ${moduleName} protocol.`,\n )\n }\n\n // Store the properties of the overridden request so that it can be restored later on.\n requestOverrides[moduleName] = {\n module,\n request: overriddenRequest,\n get: overriddenGet,\n }\n // https://nodejs.org/api/http.html#http_http_request_url_options_callback\n module.request = function (input, options, callback) {\n return newRequest(proto, overriddenRequest.bind(module), [\n input,\n options,\n callback,\n ])\n }\n // https://nodejs.org/api/http.html#http_http_get_options_callback\n module.get = function (input, options, callback) {\n const req = newRequest(proto, overriddenGet.bind(module), [\n input,\n options,\n callback,\n ])\n req.end()\n return req\n }\n\n debug('- overridden request for', proto)\n })\n}\n\n/**\n * Restores `request` function of `http` and `https` modules to values they\n * held before they were overridden by us.\n */\nfunction restoreOverriddenRequests() {\n debug('restoring requests')\n Object.entries(requestOverrides).forEach(\n ([proto, { module, request, get }]) => {\n debug('- restoring request for', proto)\n module.request = request\n module.get = get\n debug('- restored request for', proto)\n },\n )\n requestOverrides = {}\n}\n\n/**\n * In WHATWG URL vernacular, this returns the origin portion of a URL.\n * However, the port is not included if it's standard and not already present on the host.\n */\nfunction normalizeOrigin(proto, host, port) {\n const hostHasPort = host.includes(':')\n const portIsStandard =\n (proto === 'http' && (port === 80 || port === '80')) ||\n (proto === 'https' && (port === 443 || port === '443'))\n const portStr = hostHasPort || portIsStandard ? '' : `:${port}`\n\n return `${proto}://${host}${portStr}`\n}\n\n/**\n * Get high level information about request as string\n * @param {Object} options\n * @param {string} options.method\n * @param {number|string} options.port\n * @param {string} options.proto Set internally. always http or https\n * @param {string} options.hostname\n * @param {string} options.path\n * @param {Object} options.headers\n * @param {string} body\n * @return {string}\n */\nfunction stringifyRequest(options, body) {\n const { method = 'GET', path = '', port } = options\n const origin = normalizeOrigin(options.proto, options.hostname, port)\n\n const log = {\n method,\n url: `${origin}${path}`,\n headers: options.headers,\n }\n\n if (body) {\n log.body = body\n }\n\n return JSON.stringify(log, null, 2)\n}\n\nfunction isContentEncoded(headers) {\n const contentEncoding = headers['content-encoding']\n return typeof contentEncoding === 'string' && contentEncoding !== ''\n}\n\nfunction contentEncoding(headers, encoder) {\n const contentEncoding = headers['content-encoding']\n return contentEncoding !== undefined && contentEncoding.toString() === encoder\n}\n\nfunction isJSONContent(headers) {\n // https://tools.ietf.org/html/rfc8259\n const contentType = String(headers['content-type'] || '').toLowerCase()\n return contentType.startsWith('application/json')\n}\n\n/**\n * Return a new object with all field names of the headers lower-cased.\n *\n * Duplicates throw an error.\n */\nfunction headersFieldNamesToLowerCase(headers, throwOnDuplicate) {\n if (!isPlainObject(headers)) {\n throw Error('Headers must be provided as an object')\n }\n\n const lowerCaseHeaders = {}\n Object.entries(headers).forEach(([fieldName, fieldValue]) => {\n const key = fieldName.toLowerCase()\n if (lowerCaseHeaders[key] !== undefined) {\n if (throwOnDuplicate) {\n throw Error(\n `Failed to convert header keys to lower case due to field name conflict: ${key}`,\n )\n } else {\n debug(\n `Duplicate header provided in request: ${key}. Only the last value can be matched.`,\n )\n }\n }\n lowerCaseHeaders[key] = fieldValue\n })\n\n return lowerCaseHeaders\n}\n\nconst headersFieldsArrayToLowerCase = headers => [\n ...new Set(headers.map(fieldName => fieldName.toLowerCase())),\n]\n\n/**\n * Converts the various accepted formats of headers into a flat array representing \"raw headers\".\n *\n * Nock allows headers to be provided as a raw array, a plain object, or a Map.\n *\n * While all the header names are expected to be strings, the values are left intact as they can\n * be functions, strings, or arrays of strings.\n *\n * https://nodejs.org/api/http.html#http_message_rawheaders\n */\nfunction headersInputToRawArray(headers) {\n if (headers === undefined) {\n return []\n }\n\n if (Array.isArray(headers)) {\n // If the input is an array, assume it's already in the raw format and simply return a copy\n // but throw an error if there aren't an even number of items in the array\n if (headers.length % 2) {\n throw new Error(\n `Raw headers must be provided as an array with an even number of items. [fieldName, value, ...]`,\n )\n }\n return [...headers]\n }\n\n // [].concat(...) is used instead of Array.flat until v11 is the minimum Node version\n if (util.types.isMap(headers)) {\n return [].concat(...Array.from(headers, ([k, v]) => [k.toString(), v]))\n }\n\n if (isPlainObject(headers)) {\n return [].concat(...Object.entries(headers))\n }\n\n throw new Error(\n `Headers must be provided as an array of raw values, a Map, or a plain Object. ${headers}`,\n )\n}\n\n/**\n * Converts an array of raw headers to an object, using the same rules as Nodes `http.IncomingMessage.headers`.\n *\n * Header names/keys are lower-cased.\n */\nfunction headersArrayToObject(rawHeaders) {\n if (!Array.isArray(rawHeaders)) {\n throw Error('Expected a header array')\n }\n\n const accumulator = {}\n\n forEachHeader(rawHeaders, (value, fieldName) => {\n addHeaderLine(accumulator, fieldName, value)\n })\n\n return accumulator\n}\n\nconst noDuplicatesHeaders = new Set([\n 'age',\n 'authorization',\n 'content-length',\n 'content-type',\n 'etag',\n 'expires',\n 'from',\n 'host',\n 'if-modified-since',\n 'if-unmodified-since',\n 'last-modified',\n 'location',\n 'max-forwards',\n 'proxy-authorization',\n 'referer',\n 'retry-after',\n 'user-agent',\n])\n\n/**\n * Set key/value data in accordance with Node's logic for folding duplicate headers.\n *\n * The `value` param should be a function, string, or array of strings.\n *\n * Node's docs and source:\n * https://nodejs.org/api/http.html#http_message_headers\n * https://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/_http_incoming.js#L245\n *\n * Header names are lower-cased.\n * Duplicates in raw headers are handled in the following ways, depending on the header name:\n * - Duplicates of field names listed in `noDuplicatesHeaders` (above) are discarded.\n * - `set-cookie` is always an array. Duplicates are added to the array.\n * - For duplicate `cookie` headers, the values are joined together with '; '.\n * - For all other headers, the values are joined together with ', '.\n *\n * Node's implementation is larger because it highly optimizes for not having to call `toLowerCase()`.\n * We've opted to always call `toLowerCase` in exchange for a more concise function.\n *\n * While Node has the luxury of knowing `value` is always a string, we do an extra step of coercion at the top.\n */\nfunction addHeaderLine(headers, name, value) {\n let values // code below expects `values` to be an array of strings\n if (typeof value === 'function') {\n // Function values are evaluated towards the end of the response, before that we use a placeholder\n // string just to designate that the header exists. Useful when `Content-Type` is set with a function.\n values = [value.name]\n } else if (Array.isArray(value)) {\n values = value.map(String)\n } else {\n values = [String(value)]\n }\n\n const key = name.toLowerCase()\n if (key === 'set-cookie') {\n // Array header -- only Set-Cookie at the moment\n if (headers['set-cookie'] === undefined) {\n headers['set-cookie'] = values\n } else {\n headers['set-cookie'].push(...values)\n }\n } else if (noDuplicatesHeaders.has(key)) {\n if (headers[key] === undefined) {\n // Drop duplicates\n headers[key] = values[0]\n }\n } else {\n if (headers[key] !== undefined) {\n values = [headers[key], ...values]\n }\n\n const separator = key === 'cookie' ? '; ' : ', '\n headers[key] = values.join(separator)\n }\n}\n\n/**\n * Deletes the given `fieldName` property from `headers` object by performing\n * case-insensitive search through keys.\n *\n * @headers {Object} headers - object of header field names and values\n * @fieldName {String} field name - string with the case-insensitive field name\n */\nfunction deleteHeadersField(headers, fieldNameToDelete) {\n if (!isPlainObject(headers)) {\n throw Error('headers must be an object')\n }\n\n if (typeof fieldNameToDelete !== 'string') {\n throw Error('field name must be a string')\n }\n\n const lowerCaseFieldNameToDelete = fieldNameToDelete.toLowerCase()\n\n // Search through the headers and delete all values whose field name matches the given field name.\n Object.keys(headers)\n .filter(fieldName => fieldName.toLowerCase() === lowerCaseFieldNameToDelete)\n .forEach(fieldName => delete headers[fieldName])\n}\n\n/**\n * Utility for iterating over a raw headers array.\n *\n * The callback is called with:\n * - The header value. string, array of strings, or a function\n * - The header field name. string\n * - Index of the header field in the raw header array.\n */\nfunction forEachHeader(rawHeaders, callback) {\n for (let i = 0; i < rawHeaders.length; i += 2) {\n callback(rawHeaders[i + 1], rawHeaders[i], i)\n }\n}\n\nfunction percentDecode(str) {\n try {\n return decodeURIComponent(str.replace(/\\+/g, ' '))\n } catch (e) {\n return str\n }\n}\n\n/**\n * URI encode the provided string, stringently adhering to RFC 3986.\n *\n * RFC 3986 reserves !, ', (, ), and * but encodeURIComponent does not encode them so we do it manually.\n *\n * https://tools.ietf.org/html/rfc3986\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent\n */\nfunction percentEncode(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n })\n}\n\nfunction matchStringOrRegexp(target, pattern) {\n const targetStr =\n target === undefined || target === null ? '' : String(target)\n\n if (pattern instanceof RegExp) {\n // if the regexp happens to have a global flag, we want to ensure we test the entire target\n pattern.lastIndex = 0\n return pattern.test(targetStr)\n }\n return targetStr === String(pattern)\n}\n\n/**\n * Formats a query parameter.\n *\n * @param key The key of the query parameter to format.\n * @param value The value of the query parameter to format.\n * @param stringFormattingFn The function used to format string values. Can\n * be used to encode or decode the query value.\n *\n * @returns *[] the formatted [key, value] pair.\n */\nfunction formatQueryValue(key, value, stringFormattingFn) {\n // TODO: Probably refactor code to replace `switch(true)` with `if`/`else`.\n switch (true) {\n case typeof value === 'number': // fall-through\n case typeof value === 'boolean':\n value = value.toString()\n break\n case value === null:\n case value === undefined:\n value = ''\n break\n case typeof value === 'string':\n if (stringFormattingFn) {\n value = stringFormattingFn(value)\n }\n break\n case value instanceof RegExp:\n break\n case Array.isArray(value): {\n value = value.map(function (val, idx) {\n return formatQueryValue(idx, val, stringFormattingFn)[1]\n })\n break\n }\n case typeof value === 'object': {\n value = Object.entries(value).reduce(function (acc, [subKey, subVal]) {\n const subPair = formatQueryValue(subKey, subVal, stringFormattingFn)\n acc[subPair[0]] = subPair[1]\n\n return acc\n }, {})\n break\n }\n }\n\n if (stringFormattingFn) key = stringFormattingFn(key)\n return [key, value]\n}\n\nfunction isStream(obj) {\n return (\n obj &&\n typeof obj !== 'string' &&\n !Buffer.isBuffer(obj) &&\n typeof obj.setEncoding === 'function'\n )\n}\n\n/**\n * Converts the arguments from the various signatures of http[s].request into a standard\n * options object and an optional callback function.\n *\n * https://nodejs.org/api/http.html#http_http_request_url_options_callback\n *\n * Taken from the beginning of the native `ClientRequest`.\n * https://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/_http_client.js#L68\n */\nfunction normalizeClientRequestArgs(input, options, cb) {\n if (typeof input === 'string') {\n input = urlToOptions(new url.URL(input))\n } else if (input instanceof url.URL) {\n input = urlToOptions(input)\n } else {\n cb = options\n options = input\n input = null\n }\n\n if (typeof options === 'function') {\n cb = options\n options = input || {}\n } else {\n options = Object.assign(input || {}, options)\n }\n\n return { options, callback: cb }\n}\n\n/**\n * Utility function that converts a URL object into an ordinary\n * options object as expected by the http.request and https.request APIs.\n *\n * This was copied from Node's source\n * https://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/internal/url.js#L1257\n */\nfunction urlToOptions(url) {\n const options = {\n protocol: url.protocol,\n hostname:\n typeof url.hostname === 'string' && url.hostname.startsWith('[')\n ? url.hostname.slice(1, -1)\n : url.hostname,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n path: `${url.pathname}${url.search || ''}`,\n href: url.href,\n }\n if (url.port !== '') {\n options.port = Number(url.port)\n }\n if (url.username || url.password) {\n options.auth = `${url.username}:${url.password}`\n }\n return options\n}\n\n/**\n * Determines if request data matches the expected schema.\n *\n * Used for comparing decoded search parameters, request body JSON objects,\n * and URL decoded request form bodies.\n *\n * Performs a general recursive strict comparison with two caveats:\n * - The expected data can use regexp to compare values\n * - JSON path notation and nested objects are considered equal\n */\nconst dataEqual = (expected, actual) => {\n if (isPlainObject(expected)) {\n expected = expand(expected)\n }\n if (isPlainObject(actual)) {\n actual = expand(actual)\n }\n return deepEqual(expected, actual)\n}\n\n/**\n * Performs a recursive strict comparison between two values.\n *\n * Expected values or leaf nodes of expected object values that are RegExp use test() for comparison.\n */\nfunction deepEqual(expected, actual) {\n debug('deepEqual comparing', typeof expected, expected, typeof actual, actual)\n if (expected instanceof RegExp) {\n return expected.test(actual)\n }\n\n if (Array.isArray(expected) && Array.isArray(actual)) {\n if (expected.length !== actual.length) {\n return false\n }\n\n return expected.every((expVal, idx) => deepEqual(expVal, actual[idx]))\n }\n\n if (isPlainObject(expected) && isPlainObject(actual)) {\n const allKeys = Array.from(\n new Set(Object.keys(expected).concat(Object.keys(actual))),\n )\n\n return allKeys.every(key => deepEqual(expected[key], actual[key]))\n }\n\n return expected === actual\n}\n\nconst timeouts = []\nconst intervals = []\nconst immediates = []\n\nconst wrapTimer =\n (timer, ids) =>\n (...args) => {\n const id = timer(...args)\n ids.push(id)\n return id\n }\n\nconst setTimeout = wrapTimer(timers.setTimeout, timeouts)\nconst setInterval = wrapTimer(timers.setInterval, intervals)\nconst setImmediate = wrapTimer(timers.setImmediate, immediates)\n\nfunction clearTimer(clear, ids) {\n while (ids.length) {\n clear(ids.shift())\n }\n}\n\nfunction removeAllTimers() {\n clearTimer(clearTimeout, timeouts)\n clearTimer(clearInterval, intervals)\n clearTimer(clearImmediate, immediates)\n}\n\n/**\n * Check if the Client Request has been cancelled.\n *\n * Until Node 14 is the minimum, we need to look at both flags to see if the request has been cancelled.\n * The two flags have the same purpose, but the Node maintainers are migrating from `abort(ed)` to\n * `destroy(ed)` terminology, to be more consistent with `stream.Writable`.\n * In Node 14.x+, Calling `abort()` will set both `aborted` and `destroyed` to true, however,\n * calling `destroy()` will only set `destroyed` to true.\n * Falling back on checking if the socket is destroyed to cover the case of Node <14.x where\n * `destroy()` is called, but `destroyed` is undefined.\n *\n * Node Client Request history:\n * - `request.abort()`: Added in: v0.3.8, Deprecated since: v14.1.0, v13.14.0\n * - `request.aborted`: Added in: v0.11.14, Became a boolean instead of a timestamp: v11.0.0, Not deprecated (yet)\n * - `request.destroy()`: Added in: v0.3.0\n * - `request.destroyed`: Added in: v14.1.0, v13.14.0\n *\n * @param {ClientRequest} req\n * @returns {boolean}\n */\nfunction isRequestDestroyed(req) {\n return !!(\n req.destroyed === true ||\n req.aborted ||\n (req.socket && req.socket.destroyed)\n )\n}\n\n/**\n * Returns true if the given value is a plain object and not an Array.\n * @param {*} value\n * @returns {boolean}\n */\nfunction isPlainObject(value) {\n if (typeof value !== 'object' || value === null) return false\n\n if (Object.prototype.toString.call(value) !== '[object Object]') return false\n\n const proto = Object.getPrototypeOf(value)\n if (proto === null) return true\n\n const Ctor =\n Object.prototype.hasOwnProperty.call(proto, 'constructor') &&\n proto.constructor\n return (\n typeof Ctor === 'function' &&\n Ctor instanceof Ctor &&\n Function.prototype.call(Ctor) === Function.prototype.call(value)\n )\n}\n\nconst prototypePollutionBlockList = ['__proto__', 'prototype', 'constructor']\nconst blocklistFilter = function (part) {\n return prototypePollutionBlockList.indexOf(part) === -1\n}\n\n/**\n * Converts flat objects whose keys use JSON path notation to nested objects.\n *\n * The input object is not mutated.\n *\n * @example\n * { 'foo[bar][0]': 'baz' } -> { foo: { bar: [ 'baz' ] } }\n */\nconst expand = input => {\n if (input === undefined || input === null) {\n return input\n }\n\n const keys = Object.keys(input)\n\n const result = {}\n let resultPtr = result\n\n for (let path of keys) {\n const originalPath = path\n if (path.indexOf('[') >= 0) {\n path = path.replace(/\\[/g, '.').replace(/]/g, '')\n }\n\n const parts = path.split('.')\n\n const check = parts.filter(blocklistFilter)\n\n if (check.length !== parts.length) {\n return undefined\n }\n resultPtr = result\n const lastIndex = parts.length - 1\n\n for (let i = 0; i < parts.length; ++i) {\n const part = parts[i]\n if (i === lastIndex) {\n if (Array.isArray(resultPtr)) {\n resultPtr[+part] = input[originalPath]\n } else {\n resultPtr[part] = input[originalPath]\n }\n } else {\n if (resultPtr[part] === undefined || resultPtr[part] === null) {\n const nextPart = parts[i + 1]\n if (/^\\d+$/.test(nextPart)) {\n resultPtr[part] = []\n } else {\n resultPtr[part] = {}\n }\n }\n resultPtr = resultPtr[part]\n }\n }\n }\n return result\n}\n\nmodule.exports = {\n contentEncoding,\n dataEqual,\n deleteHeadersField,\n expand,\n forEachHeader,\n formatQueryValue,\n headersArrayToObject,\n headersFieldNamesToLowerCase,\n headersFieldsArrayToLowerCase,\n headersInputToRawArray,\n isContentEncoded,\n isJSONContent,\n isPlainObject,\n isRequestDestroyed,\n isStream,\n isUtf8Representable,\n matchStringOrRegexp,\n normalizeClientRequestArgs,\n normalizeOrigin,\n normalizeRequestOptions,\n overrideRequests,\n percentDecode,\n percentEncode,\n removeAllTimers,\n restoreOverriddenRequests,\n setImmediate,\n setInterval,\n setTimeout,\n stringifyRequest,\n}\n","'use strict'\n\nfunction propagate(events, source, dest) {\n if (arguments.length < 3) {\n dest = source\n source = events\n events = undefined\n }\n\n // events should be an array or object\n const eventsIsObject = typeof events === 'object'\n if (events && !eventsIsObject) events = [events]\n\n if (eventsIsObject) {\n return explicitPropagate(events, source, dest)\n }\n\n const shouldPropagate = eventName =>\n events === undefined || events.includes(eventName)\n\n const oldEmit = source.emit\n\n // Returns true if the event had listeners, false otherwise.\n // https://nodejs.org/api/events.html#events_emitter_emit_eventname_args\n source.emit = (eventName, ...args) => {\n const oldEmitHadListeners = oldEmit.call(source, eventName, ...args)\n\n let destEmitHadListeners = false\n if (shouldPropagate(eventName)) {\n destEmitHadListeners = dest.emit(eventName, ...args)\n }\n\n return oldEmitHadListeners || destEmitHadListeners\n }\n\n function end() {\n source.emit = oldEmit\n }\n\n return {\n end,\n }\n}\n\nmodule.exports = propagate\n\nfunction explicitPropagate(events, source, dest) {\n let eventsIn\n let eventsOut\n if (Array.isArray(events)) {\n eventsIn = events\n eventsOut = events\n } else {\n eventsIn = Object.keys(events)\n eventsOut = eventsIn.map(function(key) {\n return events[key]\n })\n }\n\n const listeners = eventsOut.map(function(event) {\n return function() {\n const args = Array.prototype.slice.call(arguments)\n args.unshift(event)\n dest.emit.apply(dest, args)\n }\n })\n\n listeners.forEach(register)\n\n return {\n end,\n }\n\n function register(listener, i) {\n source.on(eventsIn[i], listener)\n }\n\n function unregister(listener, i) {\n source.removeListener(eventsIn[i], listener)\n }\n\n function end() {\n listeners.forEach(unregister)\n }\n}\n","'use strict'\n\nconst { EventEmitter } = require('events')\n\nmodule.exports = new EventEmitter()\n","'use strict'\n\nconst { EventEmitter } = require('events')\nconst debug = require('debug')('nock.socket')\n\nmodule.exports = class Socket extends EventEmitter {\n constructor(options) {\n super()\n\n // Pretend this is a TLSSocket\n if (options.proto === 'https') {\n // https://github.com/nock/nock/issues/158\n this.authorized = true\n // https://github.com/nock/nock/issues/2147\n this.encrypted = true\n }\n\n this.bufferSize = 0\n this.writableLength = 0\n this.writable = true\n this.readable = true\n this.pending = false\n this.destroyed = false\n this.connecting = true\n\n // Undocumented flag used by ClientRequest to ensure errors aren't double-fired\n this._hadError = false\n\n // Maximum allowed delay. 0 means unlimited.\n this.timeout = 0\n\n const ipv6 = options.family === 6\n this.remoteFamily = ipv6 ? 'IPv6' : 'IPv4'\n this.localAddress = this.remoteAddress = ipv6 ? '::1' : '127.0.0.1'\n this.localPort = this.remotePort = parseInt(options.port)\n }\n\n setNoDelay() {}\n setKeepAlive() {}\n resume() {}\n ref() {}\n unref() {}\n write() {}\n\n address() {\n return {\n port: this.remotePort,\n family: this.remoteFamily,\n address: this.remoteAddress,\n }\n }\n\n setTimeout(timeoutMs, fn) {\n this.timeout = timeoutMs\n if (fn) {\n this.once('timeout', fn)\n }\n return this\n }\n\n /**\n * Artificial delay that will trip socket timeouts when appropriate.\n *\n * Doesn't actually wait for time to pass.\n * Timeout events don't necessarily end the request.\n * While many clients choose to abort the request upon a timeout, Node itself does not.\n */\n applyDelay(delayMs) {\n if (this.timeout && delayMs > this.timeout) {\n debug('socket timeout')\n this.emit('timeout')\n }\n }\n\n getPeerCertificate() {\n return Buffer.from(\n (Math.random() * 10000 + Date.now()).toString(),\n ).toString('base64')\n }\n\n /**\n * Denotes that no more I/O activity should happen on this socket.\n *\n * The implementation in Node if far more complex as it juggles underlying async streams.\n * For the purposes of Nock, we just need it to set some flags and on the first call\n * emit a 'close' and optional 'error' event. Both events propagate through the request object.\n */\n destroy(err) {\n if (this.destroyed) {\n return this\n }\n\n debug('socket destroy')\n this.destroyed = true\n this.readable = this.writable = false\n this.readableEnded = this.writableFinished = true\n\n process.nextTick(() => {\n if (err) {\n this._hadError = true\n this.emit('error', err)\n }\n this.emit('close')\n })\n\n return this\n }\n}\n","'use strict'\n\nconst stream = require('stream')\nconst util = require('util')\nconst zlib = require('zlib')\nconst debug = require('debug')('nock.playback_interceptor')\nconst common = require('./common')\n\nfunction parseJSONRequestBody(req, requestBody) {\n if (!requestBody || !common.isJSONContent(req.headers)) {\n return requestBody\n }\n\n if (common.contentEncoding(req.headers, 'gzip')) {\n requestBody = String(zlib.gunzipSync(Buffer.from(requestBody, 'hex')))\n } else if (common.contentEncoding(req.headers, 'deflate')) {\n requestBody = String(zlib.inflateSync(Buffer.from(requestBody, 'hex')))\n }\n\n return JSON.parse(requestBody)\n}\n\nfunction parseFullReplyResult(response, fullReplyResult) {\n debug('full response from callback result: %j', fullReplyResult)\n\n if (!Array.isArray(fullReplyResult)) {\n throw Error('A single function provided to .reply MUST return an array')\n }\n\n if (fullReplyResult.length > 3) {\n throw Error(\n 'The array returned from the .reply callback contains too many values',\n )\n }\n\n const [status, body = '', headers] = fullReplyResult\n\n if (!Number.isInteger(status)) {\n throw new Error(`Invalid ${typeof status} value for status code`)\n }\n\n response.statusCode = status\n response.rawHeaders.push(...common.headersInputToRawArray(headers))\n debug('response.rawHeaders after reply: %j', response.rawHeaders)\n\n return body\n}\n\n/**\n * Determine which of the default headers should be added to the response.\n *\n * Don't include any defaults whose case-insensitive keys are already on the response.\n */\nfunction selectDefaultHeaders(existingHeaders, defaultHeaders) {\n if (!defaultHeaders.length) {\n return [] // return early if we don't need to bother\n }\n\n const definedHeaders = new Set()\n const result = []\n\n common.forEachHeader(existingHeaders, (_, fieldName) => {\n definedHeaders.add(fieldName.toLowerCase())\n })\n common.forEachHeader(defaultHeaders, (value, fieldName) => {\n if (!definedHeaders.has(fieldName.toLowerCase())) {\n result.push(fieldName, value)\n }\n })\n\n return result\n}\n\n// Presents a list of Buffers as a Readable\nclass ReadableBuffers extends stream.Readable {\n constructor(buffers, opts = {}) {\n super(opts)\n\n this.buffers = buffers\n }\n\n _read(_size) {\n while (this.buffers.length) {\n if (!this.push(this.buffers.shift())) {\n return\n }\n }\n this.push(null)\n }\n}\n\nfunction convertBodyToStream(body) {\n if (common.isStream(body)) {\n return body\n }\n\n if (body === undefined) {\n return new ReadableBuffers([])\n }\n\n if (Buffer.isBuffer(body)) {\n return new ReadableBuffers([body])\n }\n\n if (typeof body !== 'string') {\n body = JSON.stringify(body)\n }\n\n return new ReadableBuffers([Buffer.from(body)])\n}\n\n/**\n * Play back an interceptor using the given request and mock response.\n */\nfunction playbackInterceptor({\n req,\n socket,\n options,\n requestBodyString,\n requestBodyIsUtf8Representable,\n response,\n interceptor,\n}) {\n const { logger } = interceptor.scope\n\n function start() {\n req.headers = req.getHeaders()\n\n interceptor.scope.emit('request', req, interceptor, requestBodyString)\n\n if (typeof interceptor.errorMessage !== 'undefined') {\n let error\n if (typeof interceptor.errorMessage === 'object') {\n error = interceptor.errorMessage\n } else {\n error = new Error(interceptor.errorMessage)\n }\n\n const delay = interceptor.delayBodyInMs + interceptor.delayConnectionInMs\n common.setTimeout(() => req.destroy(error), delay)\n return\n }\n\n // This will be null if we have a fullReplyFunction,\n // in that case status code will be set in `parseFullReplyResult`\n response.statusCode = interceptor.statusCode\n\n // Clone headers/rawHeaders to not override them when evaluating later\n response.rawHeaders = [...interceptor.rawHeaders]\n logger('response.rawHeaders:', response.rawHeaders)\n\n // TODO: MAJOR: Don't tack the request onto the interceptor.\n // The only reason we do this is so that it's available inside reply functions.\n // It would be better to pass the request as an argument to the functions instead.\n // Not adding the req as a third arg now because it should first be decided if (path, body, req)\n // is the signature we want to go with going forward.\n interceptor.req = req\n\n if (interceptor.replyFunction) {\n const parsedRequestBody = parseJSONRequestBody(req, requestBodyString)\n\n let fn = interceptor.replyFunction\n if (fn.length === 3) {\n // Handle the case of an async reply function, the third parameter being the callback.\n fn = util.promisify(fn)\n }\n\n // At this point `fn` is either a synchronous function or a promise-returning function;\n // wrapping in `Promise.resolve` makes it into a promise either way.\n Promise.resolve(fn.call(interceptor, options.path, parsedRequestBody))\n .then(continueWithResponseBody)\n .catch(err => req.destroy(err))\n return\n }\n\n if (interceptor.fullReplyFunction) {\n const parsedRequestBody = parseJSONRequestBody(req, requestBodyString)\n\n let fn = interceptor.fullReplyFunction\n if (fn.length === 3) {\n fn = util.promisify(fn)\n }\n\n Promise.resolve(fn.call(interceptor, options.path, parsedRequestBody))\n .then(continueWithFullResponse)\n .catch(err => req.destroy(err))\n return\n }\n\n if (\n common.isContentEncoded(interceptor.headers) &&\n !common.isStream(interceptor.body)\n ) {\n // If the content is encoded we know that the response body *must* be an array\n // of response buffers which should be mocked one by one.\n // (otherwise decompressions after the first one fails as unzip expects to receive\n // buffer by buffer and not one single merged buffer)\n const bufferData = Array.isArray(interceptor.body)\n ? interceptor.body\n : [interceptor.body]\n const responseBuffers = bufferData.map(data => Buffer.from(data, 'hex'))\n const responseBody = new ReadableBuffers(responseBuffers)\n continueWithResponseBody(responseBody)\n return\n }\n\n // If we get to this point, the body is either a string or an object that\n // will eventually be JSON stringified.\n let responseBody = interceptor.body\n\n // If the request was not UTF8-representable then we assume that the\n // response won't be either. In that case we send the response as a Buffer\n // object as that's what the client will expect.\n if (!requestBodyIsUtf8Representable && typeof responseBody === 'string') {\n // Try to create the buffer from the interceptor's body response as hex.\n responseBody = Buffer.from(responseBody, 'hex')\n\n // Creating buffers does not necessarily throw errors; check for difference in size.\n if (\n !responseBody ||\n (interceptor.body.length > 0 && responseBody.length === 0)\n ) {\n // We fallback on constructing buffer from utf8 representation of the body.\n responseBody = Buffer.from(interceptor.body, 'utf8')\n }\n }\n\n return continueWithResponseBody(responseBody)\n }\n\n function continueWithFullResponse(fullReplyResult) {\n let responseBody\n try {\n responseBody = parseFullReplyResult(response, fullReplyResult)\n } catch (err) {\n req.destroy(err)\n return\n }\n\n continueWithResponseBody(responseBody)\n }\n\n function prepareResponseHeaders(body) {\n const defaultHeaders = [...interceptor.scope._defaultReplyHeaders]\n\n // Include a JSON content type when JSON.stringify is called on the body.\n // This is a convenience added by Nock that has no analog in Node. It's added to the\n // defaults, so it will be ignored if the caller explicitly provided the header already.\n const isJSON =\n body !== undefined &&\n typeof body !== 'string' &&\n !Buffer.isBuffer(body) &&\n !common.isStream(body)\n\n if (isJSON) {\n defaultHeaders.push('Content-Type', 'application/json')\n }\n\n response.rawHeaders.push(\n ...selectDefaultHeaders(response.rawHeaders, defaultHeaders),\n )\n\n // Evaluate functional headers.\n common.forEachHeader(response.rawHeaders, (value, fieldName, i) => {\n if (typeof value === 'function') {\n response.rawHeaders[i + 1] = value(req, response, body)\n }\n })\n\n response.headers = common.headersArrayToObject(response.rawHeaders)\n }\n\n function continueWithResponseBody(rawBody) {\n prepareResponseHeaders(rawBody)\n const bodyAsStream = convertBodyToStream(rawBody)\n bodyAsStream.pause()\n\n // IncomingMessage extends Readable so we can't simply pipe.\n bodyAsStream.on('data', function (chunk) {\n response.push(chunk)\n })\n bodyAsStream.on('end', function () {\n // https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_message_complete\n response.complete = true\n response.push(null)\n\n interceptor.scope.emit('replied', req, interceptor)\n })\n bodyAsStream.on('error', function (err) {\n response.emit('error', err)\n })\n\n const { delayBodyInMs, delayConnectionInMs } = interceptor\n\n function respond() {\n if (common.isRequestDestroyed(req)) {\n return\n }\n\n // Even though we've had the response object for awhile at this point,\n // we only attach it to the request immediately before the `response`\n // event because, as in Node, it alters the error handling around aborts.\n req.res = response\n response.req = req\n\n logger('emitting response')\n req.emit('response', response)\n\n common.setTimeout(() => bodyAsStream.resume(), delayBodyInMs)\n }\n\n socket.applyDelay(delayConnectionInMs)\n common.setTimeout(respond, delayConnectionInMs)\n }\n\n // Calling `start` immediately could take the request all the way to the connection delay\n // during a single microtask execution. This setImmediate stalls the playback to ensure the\n // correct events are emitted first ('socket', 'finish') and any aborts in the queue or\n // called during a 'finish' listener can be called.\n common.setImmediate(() => {\n if (!common.isRequestDestroyed(req)) {\n start()\n }\n })\n}\n\nmodule.exports = { playbackInterceptor }\n","'use strict'\n\nconst debug = require('debug')('nock.request_overrider')\nconst {\n IncomingMessage,\n ClientRequest,\n request: originalHttpRequest,\n} = require('http')\nconst { request: originalHttpsRequest } = require('https')\nconst propagate = require('propagate')\nconst common = require('./common')\nconst globalEmitter = require('./global_emitter')\nconst Socket = require('./socket')\nconst { playbackInterceptor } = require('./playback_interceptor')\n\nfunction socketOnClose(req) {\n debug('socket close')\n\n if (!req.res && !req.socket._hadError) {\n // If we don't have a response then we know that the socket\n // ended prematurely and we need to emit an error on the request.\n req.socket._hadError = true\n const err = new Error('socket hang up')\n err.code = 'ECONNRESET'\n req.emit('error', err)\n }\n req.emit('close')\n}\n\n/**\n * Given a group of interceptors, appropriately route an outgoing request.\n * Identify which interceptor ought to respond, if any, then delegate to\n * `playbackInterceptor()` to consume the request itself.\n */\nclass InterceptedRequestRouter {\n constructor({ req, options, interceptors }) {\n this.req = req\n this.options = {\n // We may be changing the options object and we don't want those changes\n // affecting the user so we use a clone of the object.\n ...options,\n // We use lower-case header field names throughout Nock.\n headers: common.headersFieldNamesToLowerCase(\n options.headers || {},\n false,\n ),\n }\n this.interceptors = interceptors\n\n this.socket = new Socket(options)\n\n // support setting `timeout` using request `options`\n // https://nodejs.org/docs/latest-v12.x/api/http.html#http_http_request_url_options_callback\n // any timeout in the request options override any timeout in the agent options.\n // per https://github.com/nodejs/node/pull/21204\n const timeout =\n options.timeout ||\n (options.agent && options.agent.options && options.agent.options.timeout)\n\n if (timeout) {\n this.socket.setTimeout(timeout)\n }\n\n this.response = new IncomingMessage(this.socket)\n this.requestBodyBuffers = []\n this.playbackStarted = false\n\n // For parity with Node, it's important the socket event is emitted before we begin playback.\n // This flag is set when playback is triggered if we haven't yet gotten the\n // socket event to indicate that playback should start as soon as it comes in.\n this.readyToStartPlaybackOnSocketEvent = false\n\n this.attachToReq()\n\n // Emit a fake socket event on the next tick to mimic what would happen on a real request.\n // Some clients listen for a 'socket' event to be emitted before calling end(),\n // which causes Nock to hang.\n process.nextTick(() => this.connectSocket())\n }\n\n attachToReq() {\n const { req, options } = this\n\n for (const [name, val] of Object.entries(options.headers)) {\n req.setHeader(name.toLowerCase(), val)\n }\n\n if (options.auth && !options.headers.authorization) {\n req.setHeader(\n // We use lower-case header field names throughout Nock.\n 'authorization',\n `Basic ${Buffer.from(options.auth).toString('base64')}`,\n )\n }\n\n req.path = options.path\n req.method = options.method\n\n req.write = (...args) => this.handleWrite(...args)\n req.end = (...args) => this.handleEnd(...args)\n req.flushHeaders = (...args) => this.handleFlushHeaders(...args)\n\n // https://github.com/nock/nock/issues/256\n if (options.headers.expect === '100-continue') {\n common.setImmediate(() => {\n debug('continue')\n req.emit('continue')\n })\n }\n }\n\n connectSocket() {\n const { req, socket } = this\n\n if (common.isRequestDestroyed(req)) {\n return\n }\n\n // ClientRequest.connection is an alias for ClientRequest.socket\n // https://nodejs.org/api/http.html#http_request_socket\n // https://github.com/nodejs/node/blob/b0f75818f39ed4e6bd80eb7c4010c1daf5823ef7/lib/_http_client.js#L640-L641\n // The same Socket is shared between the request and response to mimic native behavior.\n req.socket = req.connection = socket\n\n propagate(['error', 'timeout'], socket, req)\n socket.on('close', () => socketOnClose(req))\n\n socket.connecting = false\n req.emit('socket', socket)\n\n // https://nodejs.org/api/net.html#net_event_connect\n socket.emit('connect')\n\n // https://nodejs.org/api/tls.html#tls_event_secureconnect\n if (socket.authorized) {\n socket.emit('secureConnect')\n }\n\n if (this.readyToStartPlaybackOnSocketEvent) {\n this.maybeStartPlayback()\n }\n }\n\n // from docs: When write function is called with empty string or buffer, it does nothing and waits for more input.\n // However, actually implementation checks the state of finished and aborted before checking if the first arg is empty.\n handleWrite(...args) {\n debug('request write')\n\n let [buffer, encoding] = args\n\n const { req } = this\n\n if (req.finished) {\n const err = new Error('write after end')\n err.code = 'ERR_STREAM_WRITE_AFTER_END'\n process.nextTick(() => req.emit('error', err))\n\n // It seems odd to return `true` here, not sure why you'd want to have\n // the stream potentially written to more, but it's what Node does.\n // https://github.com/nodejs/node/blob/a9270dcbeba4316b1e179b77ecb6c46af5aa8c20/lib/_http_outgoing.js#L662-L665\n return true\n }\n\n if (req.socket && req.socket.destroyed) {\n return false\n }\n\n if (!buffer) {\n return true\n }\n\n if (!Buffer.isBuffer(buffer)) {\n buffer = Buffer.from(buffer, encoding)\n }\n this.requestBodyBuffers.push(buffer)\n\n // writable.write encoding param is optional\n // so if callback is present it's the last argument\n const callback = args.length > 1 ? args[args.length - 1] : undefined\n // can't use instanceof Function because some test runners\n // run tests in vm.runInNewContext where Function is not same\n // as that in the current context\n // https://github.com/nock/nock/pull/1754#issuecomment-571531407\n if (typeof callback === 'function') {\n callback()\n }\n\n common.setImmediate(function () {\n req.emit('drain')\n })\n\n return false\n }\n\n handleEnd(chunk, encoding, callback) {\n debug('request end')\n const { req } = this\n\n // handle the different overloaded arg signatures\n if (typeof chunk === 'function') {\n callback = chunk\n chunk = null\n } else if (typeof encoding === 'function') {\n callback = encoding\n encoding = null\n }\n\n if (typeof callback === 'function') {\n req.once('finish', callback)\n }\n\n if (chunk) {\n req.write(chunk, encoding)\n }\n req.finished = true\n this.maybeStartPlayback()\n\n return req\n }\n\n handleFlushHeaders() {\n debug('request flushHeaders')\n this.maybeStartPlayback()\n }\n\n /**\n * Set request headers of the given request. This is needed both during the\n * routing phase, in case header filters were specified, and during the\n * interceptor-playback phase, to correctly pass mocked request headers.\n * TODO There are some problems with this; see https://github.com/nock/nock/issues/1718\n */\n setHostHeaderUsingInterceptor(interceptor) {\n const { req, options } = this\n\n // If a filtered scope is being used we have to use scope's host in the\n // header, otherwise 'host' header won't match.\n // NOTE: We use lower-case header field names throughout Nock.\n const HOST_HEADER = 'host'\n if (interceptor.__nock_filteredScope && interceptor.__nock_scopeHost) {\n options.headers[HOST_HEADER] = interceptor.__nock_scopeHost\n req.setHeader(HOST_HEADER, interceptor.__nock_scopeHost)\n } else {\n // For all other cases, we always add host header equal to the requested\n // host unless it was already defined.\n if (options.host && !req.getHeader(HOST_HEADER)) {\n let hostHeader = options.host\n\n if (options.port === 80 || options.port === 443) {\n hostHeader = hostHeader.split(':')[0]\n }\n\n req.setHeader(HOST_HEADER, hostHeader)\n }\n }\n }\n\n maybeStartPlayback() {\n const { req, socket, playbackStarted } = this\n\n // In order to get the events in the right order we need to delay playback\n // if we get here before the `socket` event is emitted.\n if (socket.connecting) {\n this.readyToStartPlaybackOnSocketEvent = true\n return\n }\n\n if (!common.isRequestDestroyed(req) && !playbackStarted) {\n this.startPlayback()\n }\n }\n\n startPlayback() {\n debug('ending')\n this.playbackStarted = true\n\n const { req, response, socket, options, interceptors } = this\n\n Object.assign(options, {\n // Re-update `options` with the current value of `req.path` because badly\n // behaving agents like superagent like to change `req.path` mid-flight.\n path: req.path,\n // Similarly, node-http-proxy will modify headers in flight, so we have\n // to put the headers back into options.\n // https://github.com/nock/nock/pull/1484\n headers: req.getHeaders(),\n // Fixes https://github.com/nock/nock/issues/976\n protocol: `${options.proto}:`,\n })\n\n interceptors.forEach(interceptor => {\n this.setHostHeaderUsingInterceptor(interceptor)\n })\n\n const requestBodyBuffer = Buffer.concat(this.requestBodyBuffers)\n // When request body is a binary buffer we internally use in its hexadecimal\n // representation.\n const requestBodyIsUtf8Representable =\n common.isUtf8Representable(requestBodyBuffer)\n const requestBodyString = requestBodyBuffer.toString(\n requestBodyIsUtf8Representable ? 'utf8' : 'hex',\n )\n\n const matchedInterceptor = interceptors.find(i =>\n i.match(req, options, requestBodyString),\n )\n\n if (matchedInterceptor) {\n matchedInterceptor.scope.logger(\n 'interceptor identified, starting mocking',\n )\n\n matchedInterceptor.markConsumed()\n\n // wait to emit the finish event until we know for sure an Interceptor is going to playback.\n // otherwise an unmocked request might emit finish twice.\n req.emit('finish')\n\n playbackInterceptor({\n req,\n socket,\n options,\n requestBodyString,\n requestBodyIsUtf8Representable,\n response,\n interceptor: matchedInterceptor,\n })\n } else {\n globalEmitter.emit('no match', req, options, requestBodyString)\n\n // Try to find a hostname match that allows unmocked.\n const allowUnmocked = interceptors.some(\n i => i.matchHostName(options) && i.options.allowUnmocked,\n )\n\n if (allowUnmocked && req instanceof ClientRequest) {\n const newReq =\n options.proto === 'https'\n ? originalHttpsRequest(options)\n : originalHttpRequest(options)\n\n propagate(newReq, req)\n // We send the raw buffer as we received it, not as we interpreted it.\n newReq.end(requestBodyBuffer)\n } else {\n const reqStr = common.stringifyRequest(options, requestBodyString)\n const err = new Error(`Nock: No match for request ${reqStr}`)\n err.code = 'ERR_NOCK_NO_MATCH'\n err.statusCode = err.status = 404\n req.destroy(err)\n }\n }\n }\n}\n\nmodule.exports = { InterceptedRequestRouter }\n","exports = module.exports = stringify\nexports.getSerialize = serializer\n\nfunction stringify(obj, replacer, spaces, cycleReplacer) {\n return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)\n}\n\nfunction serializer(replacer, cycleReplacer) {\n var stack = [], keys = []\n\n if (cycleReplacer == null) cycleReplacer = function(key, value) {\n if (stack[0] === value) return \"[Circular ~]\"\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\"\n }\n\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this)\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)\n }\n else stack.push(value)\n\n return replacer == null ? value : replacer.call(this, key, value)\n }\n}\n","'use strict'\n\nconst querystring = require('querystring')\n\nconst common = require('./common')\n\nmodule.exports = function matchBody(options, spec, body) {\n if (spec instanceof RegExp) {\n return spec.test(body)\n }\n\n if (Buffer.isBuffer(spec)) {\n const encoding = common.isUtf8Representable(spec) ? 'utf8' : 'hex'\n spec = spec.toString(encoding)\n }\n\n const contentType = (\n (options.headers &&\n (options.headers['Content-Type'] || options.headers['content-type'])) ||\n ''\n ).toString()\n\n const isMultipart = contentType.includes('multipart')\n const isUrlencoded = contentType.includes('application/x-www-form-urlencoded')\n\n // try to transform body to json\n let json\n if (typeof spec === 'object' || typeof spec === 'function') {\n try {\n json = JSON.parse(body)\n } catch (err) {\n // not a valid JSON string\n }\n if (json !== undefined) {\n body = json\n } else if (isUrlencoded) {\n body = querystring.parse(body)\n }\n }\n\n if (typeof spec === 'function') {\n return spec.call(options, body)\n }\n\n // strip line endings from both so that we get a match no matter what OS we are running on\n // if Content-Type does not contain 'multipart'\n if (!isMultipart && typeof body === 'string') {\n body = body.replace(/\\r?\\n|\\r/g, '')\n }\n\n if (!isMultipart && typeof spec === 'string') {\n spec = spec.replace(/\\r?\\n|\\r/g, '')\n }\n\n // Because the nature of URL encoding, all the values in the body must be cast to strings.\n // dataEqual does strict checking, so we have to cast the non-regexp values in the spec too.\n if (isUrlencoded) {\n spec = mapValuesDeep(spec, val => (val instanceof RegExp ? val : `${val}`))\n }\n\n return common.dataEqual(spec, body)\n}\n\nfunction mapValues(object, cb) {\n const keys = Object.keys(object)\n for (const key of keys) {\n object[key] = cb(object[key], key, object)\n }\n return object\n}\n\n/**\n * Based on lodash issue discussion\n * https://github.com/lodash/lodash/issues/1244\n */\nfunction mapValuesDeep(obj, cb) {\n if (Array.isArray(obj)) {\n return obj.map(v => mapValuesDeep(v, cb))\n }\n if (common.isPlainObject(obj)) {\n return mapValues(obj, v => mapValuesDeep(v, cb))\n }\n return cb(obj)\n}\n","'use strict'\n\nconst stringify = require('json-stringify-safe')\nconst querystring = require('querystring')\nconst { URL, URLSearchParams } = require('url')\n\nconst common = require('./common')\nconst { remove } = require('./intercept')\nconst matchBody = require('./match_body')\n\nlet fs\ntry {\n fs = require('fs')\n} catch (err) {\n // do nothing, we're in the browser\n}\n\nmodule.exports = class Interceptor {\n /**\n *\n * Valid argument types for `uri`:\n * - A string used for strict comparisons with pathname.\n * The search portion of the URI may also be postfixed, in which case the search params\n * are striped and added via the `query` method.\n * - A RegExp instance that tests against only the pathname of requests.\n * - A synchronous function bound to this Interceptor instance. It's provided the pathname\n * of requests and must return a boolean denoting if the request is considered a match.\n */\n constructor(scope, uri, method, requestBody, interceptorOptions) {\n const uriIsStr = typeof uri === 'string'\n // Check for leading slash. Uri can be either a string or a regexp, but\n // When enabled filteringScope ignores the passed URL entirely so we skip validation.\n\n if (\n uriIsStr &&\n !scope.scopeOptions.filteringScope &&\n !scope.basePathname &&\n !uri.startsWith('/') &&\n !uri.startsWith('*')\n ) {\n throw Error(\n `Non-wildcard URL path strings must begin with a slash (otherwise they won't match anything) (got: ${uri})`,\n )\n }\n\n if (!method) {\n throw new Error(\n 'The \"method\" parameter is required for an intercept call.',\n )\n }\n\n this.scope = scope\n this.interceptorMatchHeaders = []\n this.method = method.toUpperCase()\n this.uri = uri\n this._key = `${this.method} ${scope.basePath}${scope.basePathname}${\n uriIsStr ? '' : '/'\n }${uri}`\n this.basePath = this.scope.basePath\n this.path = uriIsStr ? scope.basePathname + uri : uri\n this.queries = null\n\n this.options = interceptorOptions || {}\n this.counter = 1\n this._requestBody = requestBody\n\n // We use lower-case header field names throughout Nock.\n this.reqheaders = common.headersFieldNamesToLowerCase(\n scope.scopeOptions.reqheaders || {},\n true,\n )\n this.badheaders = common.headersFieldsArrayToLowerCase(\n scope.scopeOptions.badheaders || [],\n )\n\n this.delayBodyInMs = 0\n this.delayConnectionInMs = 0\n\n this.optional = false\n\n // strip off literal query parameters if they were provided as part of the URI\n if (uriIsStr && uri.includes('?')) {\n // localhost is a dummy value because the URL constructor errors for only relative inputs\n const parsedURL = new URL(this.path, 'http://localhost')\n this.path = parsedURL.pathname\n this.query(parsedURL.searchParams)\n this._key = `${this.method} ${scope.basePath}${this.path}`\n }\n }\n\n optionally(flag = true) {\n // The default behaviour of optionally() with no arguments is to make the mock optional.\n if (typeof flag !== 'boolean') {\n throw new Error('Invalid arguments: argument should be a boolean')\n }\n\n this.optional = flag\n\n return this\n }\n\n replyWithError(errorMessage) {\n this.errorMessage = errorMessage\n\n this.options = {\n ...this.scope.scopeOptions,\n ...this.options,\n }\n\n this.scope.add(this._key, this)\n return this.scope\n }\n\n reply(statusCode, body, rawHeaders) {\n // support the format of only passing in a callback\n if (typeof statusCode === 'function') {\n if (arguments.length > 1) {\n // It's not very Javascript-y to throw an error for extra args to a function, but because\n // of legacy behavior, this error was added to reduce confusion for those migrating.\n throw Error(\n 'Invalid arguments. When providing a function for the first argument, .reply does not accept other arguments.',\n )\n }\n this.statusCode = null\n this.fullReplyFunction = statusCode\n } else {\n if (statusCode !== undefined && !Number.isInteger(statusCode)) {\n throw new Error(`Invalid ${typeof statusCode} value for status code`)\n }\n\n this.statusCode = statusCode || 200\n if (typeof body === 'function') {\n this.replyFunction = body\n body = null\n }\n }\n\n this.options = {\n ...this.scope.scopeOptions,\n ...this.options,\n }\n\n this.rawHeaders = common.headersInputToRawArray(rawHeaders)\n\n if (this.scope.date) {\n // https://tools.ietf.org/html/rfc7231#section-7.1.1.2\n this.rawHeaders.push('Date', this.scope.date.toUTCString())\n }\n\n // Prepare the headers temporarily so we can make best guesses about content-encoding and content-type\n // below as well as while the response is being processed in RequestOverrider.end().\n // Including all the default headers is safe for our purposes because of the specific headers we introspect.\n // A more thoughtful process is used to merge the default headers when the response headers are finally computed.\n this.headers = common.headersArrayToObject(\n this.rawHeaders.concat(this.scope._defaultReplyHeaders),\n )\n\n // If the content is not encoded we may need to transform the response body.\n // Otherwise, we leave it as it is.\n if (\n body &&\n typeof body !== 'string' &&\n !Buffer.isBuffer(body) &&\n !common.isStream(body) &&\n !common.isContentEncoded(this.headers)\n ) {\n try {\n body = stringify(body)\n } catch (err) {\n throw new Error('Error encoding response body into JSON')\n }\n\n if (!this.headers['content-type']) {\n // https://tools.ietf.org/html/rfc7231#section-3.1.1.5\n this.rawHeaders.push('Content-Type', 'application/json')\n }\n }\n\n if (this.scope.contentLen) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n if (typeof body === 'string') {\n this.rawHeaders.push('Content-Length', body.length)\n } else if (Buffer.isBuffer(body)) {\n this.rawHeaders.push('Content-Length', body.byteLength)\n }\n }\n\n this.scope.logger('reply.headers:', this.headers)\n this.scope.logger('reply.rawHeaders:', this.rawHeaders)\n\n this.body = body\n\n this.scope.add(this._key, this)\n return this.scope\n }\n\n replyWithFile(statusCode, filePath, headers) {\n if (!fs) {\n throw new Error('No fs')\n }\n this.filePath = filePath\n return this.reply(\n statusCode,\n () => {\n const readStream = fs.createReadStream(filePath)\n readStream.pause()\n return readStream\n },\n headers,\n )\n }\n\n // Also match request headers\n // https://github.com/nock/nock/issues/163\n reqheaderMatches(options, key) {\n const reqHeader = this.reqheaders[key]\n let header = options.headers[key]\n\n // https://github.com/nock/nock/issues/399\n // https://github.com/nock/nock/issues/822\n if (header && typeof header !== 'string' && header.toString) {\n header = header.toString()\n }\n\n // We skip 'host' header comparison unless it's available in both mock and\n // actual request. This because 'host' may get inserted by Nock itself and\n // then get recorded. NOTE: We use lower-case header field names throughout\n // Nock. See https://github.com/nock/nock/pull/196.\n if (key === 'host' && (header === undefined || reqHeader === undefined)) {\n return true\n }\n\n if (reqHeader !== undefined && header !== undefined) {\n if (typeof reqHeader === 'function') {\n return reqHeader(header)\n } else if (common.matchStringOrRegexp(header, reqHeader)) {\n return true\n }\n }\n\n this.scope.logger(\n \"request header field doesn't match:\",\n key,\n header,\n reqHeader,\n )\n return false\n }\n\n match(req, options, body) {\n // check if the logger is enabled because the stringifies can be expensive.\n if (this.scope.logger.enabled) {\n this.scope.logger(\n 'attempting match %s, body = %s',\n stringify(options),\n stringify(body),\n )\n }\n\n const method = (options.method || 'GET').toUpperCase()\n let { path = '/' } = options\n let matches\n let matchKey\n const { proto } = options\n\n if (this.method !== method) {\n this.scope.logger(\n `Method did not match. Request ${method} Interceptor ${this.method}`,\n )\n return false\n }\n\n if (this.scope.transformPathFunction) {\n path = this.scope.transformPathFunction(path)\n }\n\n const requestMatchesFilter = ({ name, value: predicate }) => {\n const headerValue = req.getHeader(name)\n if (typeof predicate === 'function') {\n return predicate(headerValue)\n } else {\n return common.matchStringOrRegexp(headerValue, predicate)\n }\n }\n\n if (\n !this.scope.matchHeaders.every(requestMatchesFilter) ||\n !this.interceptorMatchHeaders.every(requestMatchesFilter)\n ) {\n this.scope.logger(\"headers don't match\")\n return false\n }\n\n const reqHeadersMatch = Object.keys(this.reqheaders).every(key =>\n this.reqheaderMatches(options, key),\n )\n\n if (!reqHeadersMatch) {\n this.scope.logger(\"headers don't match\")\n return false\n }\n\n if (\n this.scope.scopeOptions.conditionally &&\n !this.scope.scopeOptions.conditionally()\n ) {\n this.scope.logger(\n 'matching failed because Scope.conditionally() did not validate',\n )\n return false\n }\n\n const badHeaders = this.badheaders.filter(\n header => header in options.headers,\n )\n\n if (badHeaders.length) {\n this.scope.logger('request contains bad headers', ...badHeaders)\n return false\n }\n\n // Match query strings when using query()\n if (this.queries === null) {\n this.scope.logger('query matching skipped')\n } else {\n // can't rely on pathname or search being in the options, but path has a default\n const [pathname, search] = path.split('?')\n const matchQueries = this.matchQuery({ search })\n\n this.scope.logger(\n matchQueries ? 'query matching succeeded' : 'query matching failed',\n )\n\n if (!matchQueries) {\n return false\n }\n\n // If the query string was explicitly checked then subsequent checks against\n // the path using a callback or regexp only validate the pathname.\n path = pathname\n }\n\n // If we have a filtered scope then we use it instead reconstructing the\n // scope from the request options (proto, host and port) as these two won't\n // necessarily match and we have to remove the scope that was matched (vs.\n // that was defined).\n if (this.__nock_filteredScope) {\n matchKey = this.__nock_filteredScope\n } else {\n matchKey = common.normalizeOrigin(proto, options.host, options.port)\n }\n\n if (typeof this.uri === 'function') {\n matches =\n common.matchStringOrRegexp(matchKey, this.basePath) &&\n // This is a false positive, as `uri` is not bound to `this`.\n // eslint-disable-next-line no-useless-call\n this.uri.call(this, path)\n } else {\n matches =\n common.matchStringOrRegexp(matchKey, this.basePath) &&\n common.matchStringOrRegexp(path, this.path)\n }\n\n this.scope.logger(`matching ${matchKey}${path} to ${this._key}: ${matches}`)\n\n if (matches && this._requestBody !== undefined) {\n if (this.scope.transformRequestBodyFunction) {\n body = this.scope.transformRequestBodyFunction(body, this._requestBody)\n }\n\n matches = matchBody(options, this._requestBody, body)\n if (!matches) {\n this.scope.logger(\n \"bodies don't match: \\n\",\n this._requestBody,\n '\\n',\n body,\n )\n }\n }\n\n return matches\n }\n\n /**\n * Return true when the interceptor's method, protocol, host, port, and path\n * match the provided options.\n */\n matchOrigin(options) {\n const isPathFn = typeof this.path === 'function'\n const isRegex = this.path instanceof RegExp\n const isRegexBasePath = this.scope.basePath instanceof RegExp\n\n const method = (options.method || 'GET').toUpperCase()\n let { path } = options\n const { proto } = options\n\n // NOTE: Do not split off the query params as the regex could use them\n if (!isRegex) {\n path = path ? path.split('?')[0] : ''\n }\n\n if (this.scope.transformPathFunction) {\n path = this.scope.transformPathFunction(path)\n }\n const comparisonKey = isPathFn || isRegex ? this.__nock_scopeKey : this._key\n const matchKey = `${method} ${proto}://${options.host}${path}`\n\n if (isPathFn) {\n return !!(matchKey.match(comparisonKey) && this.path(path))\n }\n\n if (isRegex && !isRegexBasePath) {\n return !!matchKey.match(comparisonKey) && this.path.test(path)\n }\n\n if (isRegexBasePath) {\n return this.scope.basePath.test(matchKey) && !!path.match(this.path)\n }\n\n return comparisonKey === matchKey\n }\n\n matchHostName(options) {\n const { basePath } = this.scope\n\n if (basePath instanceof RegExp) {\n return basePath.test(options.hostname)\n }\n\n return options.hostname === this.scope.urlParts.hostname\n }\n\n matchQuery(options) {\n if (this.queries === true) {\n return true\n }\n\n const reqQueries = querystring.parse(options.search)\n this.scope.logger('Interceptor queries: %j', this.queries)\n this.scope.logger(' Request queries: %j', reqQueries)\n\n if (typeof this.queries === 'function') {\n return this.queries(reqQueries)\n }\n\n return common.dataEqual(this.queries, reqQueries)\n }\n\n filteringPath(...args) {\n this.scope.filteringPath(...args)\n return this\n }\n\n // TODO filtering by path is valid on the intercept level, but not filtering\n // by request body?\n\n markConsumed() {\n this.interceptionCounter++\n\n remove(this)\n\n if (!this.scope.shouldPersist() && this.counter < 1) {\n this.scope.remove(this._key, this)\n }\n }\n\n matchHeader(name, value) {\n this.interceptorMatchHeaders.push({ name, value })\n return this\n }\n\n basicAuth({ user, pass = '' }) {\n const encoded = Buffer.from(`${user}:${pass}`).toString('base64')\n this.matchHeader('authorization', `Basic ${encoded}`)\n return this\n }\n\n /**\n * Set query strings for the interceptor\n * @name query\n * @param queries Object of query string name,values (accepts regexp values)\n * @public\n * @example\n * // Will match 'http://zombo.com/?q=t'\n * nock('http://zombo.com').get('/').query({q: 't'});\n */\n query(queries) {\n if (this.queries !== null) {\n throw Error(`Query parameters have already been defined`)\n }\n\n // Allow all query strings to match this route\n if (queries === true) {\n this.queries = queries\n return this\n }\n\n if (typeof queries === 'function') {\n this.queries = queries\n return this\n }\n\n let strFormattingFn\n if (this.scope.scopeOptions.encodedQueryParams) {\n strFormattingFn = common.percentDecode\n }\n\n if (queries instanceof URLSearchParams || typeof queries === 'string') {\n // Normalize the data into the shape that is matched against.\n // Duplicate keys are handled by combining the values into an array.\n queries = querystring.parse(queries.toString())\n } else if (!common.isPlainObject(queries)) {\n throw Error(`Argument Error: ${queries}`)\n }\n\n this.queries = {}\n for (const [key, value] of Object.entries(queries)) {\n const formatted = common.formatQueryValue(key, value, strFormattingFn)\n const [formattedKey, formattedValue] = formatted\n this.queries[formattedKey] = formattedValue\n }\n\n return this\n }\n\n /**\n * Set number of times will repeat the interceptor\n * @name times\n * @param newCounter Number of times to repeat (should be > 0)\n * @public\n * @example\n * // Will repeat mock 5 times for same king of request\n * nock('http://zombo.com).get('/').times(5).reply(200, 'Ok');\n */\n times(newCounter) {\n if (newCounter < 1) {\n return this\n }\n\n this.counter = newCounter\n\n return this\n }\n\n /**\n * An sugar syntax for times(1)\n * @name once\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').once().reply(200, 'Ok');\n */\n once() {\n return this.times(1)\n }\n\n /**\n * An sugar syntax for times(2)\n * @name twice\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').twice().reply(200, 'Ok');\n */\n twice() {\n return this.times(2)\n }\n\n /**\n * An sugar syntax for times(3).\n * @name thrice\n * @see {@link times}\n * @public\n * @example\n * nock('http://zombo.com).get('/').thrice().reply(200, 'Ok');\n */\n thrice() {\n return this.times(3)\n }\n\n /**\n * Delay the response by a certain number of ms.\n *\n * @param {(integer|object)} opts - Number of milliseconds to wait, or an object\n * @param {integer} [opts.head] - Number of milliseconds to wait before response is sent\n * @param {integer} [opts.body] - Number of milliseconds to wait before response body is sent\n * @return {Interceptor} - the current interceptor for chaining\n */\n delay(opts) {\n let headDelay\n let bodyDelay\n if (typeof opts === 'number') {\n headDelay = opts\n bodyDelay = 0\n } else if (typeof opts === 'object') {\n headDelay = opts.head || 0\n bodyDelay = opts.body || 0\n } else {\n throw new Error(`Unexpected input opts ${opts}`)\n }\n\n return this.delayConnection(headDelay).delayBody(bodyDelay)\n }\n\n /**\n * Delay the response body by a certain number of ms.\n *\n * @param {integer} ms - Number of milliseconds to wait before response is sent\n * @return {Interceptor} - the current interceptor for chaining\n */\n delayBody(ms) {\n this.delayBodyInMs = ms\n return this\n }\n\n /**\n * Delay the connection by a certain number of ms.\n *\n * @param {integer} ms - Number of milliseconds to wait\n * @return {Interceptor} - the current interceptor for chaining\n */\n delayConnection(ms) {\n this.delayConnectionInMs = ms\n return this\n }\n}\n","'use strict'\n\n/**\n * @module nock/intercept\n */\n\nconst { InterceptedRequestRouter } = require('./intercepted_request_router')\nconst common = require('./common')\nconst { inherits } = require('util')\nconst http = require('http')\nconst debug = require('debug')('nock.intercept')\nconst globalEmitter = require('./global_emitter')\n\n/**\n * @name NetConnectNotAllowedError\n * @private\n * @desc Error trying to make a connection when disabled external access.\n * @class\n * @example\n * nock.disableNetConnect();\n * http.get('http://zombo.com');\n * // throw NetConnectNotAllowedError\n */\nfunction NetConnectNotAllowedError(host, path) {\n Error.call(this)\n\n this.name = 'NetConnectNotAllowedError'\n this.code = 'ENETUNREACH'\n this.message = `Nock: Disallowed net connect for \"${host}${path}\"`\n\n Error.captureStackTrace(this, this.constructor)\n}\n\ninherits(NetConnectNotAllowedError, Error)\n\nlet allInterceptors = {}\nlet allowNetConnect\n\n/**\n * Enabled real request.\n * @public\n * @param {String|RegExp} matcher=RegExp.new('.*') Expression to match\n * @example\n * // Enables all real requests\n * nock.enableNetConnect();\n * @example\n * // Enables real requests for url that matches google\n * nock.enableNetConnect('google');\n * @example\n * // Enables real requests for url that matches google and amazon\n * nock.enableNetConnect(/(google|amazon)/);\n * @example\n * // Enables real requests for url that includes google\n * nock.enableNetConnect(host => host.includes('google'));\n */\nfunction enableNetConnect(matcher) {\n if (typeof matcher === 'string') {\n allowNetConnect = new RegExp(matcher)\n } else if (matcher instanceof RegExp) {\n allowNetConnect = matcher\n } else if (typeof matcher === 'function') {\n allowNetConnect = { test: matcher }\n } else {\n allowNetConnect = /.*/\n }\n}\n\nfunction isEnabledForNetConnect(options) {\n common.normalizeRequestOptions(options)\n\n const enabled = allowNetConnect && allowNetConnect.test(options.host)\n debug('Net connect', enabled ? '' : 'not', 'enabled for', options.host)\n return enabled\n}\n\n/**\n * Disable all real requests.\n * @public\n * @example\n * nock.disableNetConnect();\n */\nfunction disableNetConnect() {\n allowNetConnect = undefined\n}\n\nfunction isOn() {\n return !isOff()\n}\n\nfunction isOff() {\n return process.env.NOCK_OFF === 'true'\n}\n\nfunction addInterceptor(key, interceptor, scope, scopeOptions, host) {\n if (!(key in allInterceptors)) {\n allInterceptors[key] = { key, interceptors: [] }\n }\n interceptor.__nock_scope = scope\n\n // We need scope's key and scope options for scope filtering function (if defined)\n interceptor.__nock_scopeKey = key\n interceptor.__nock_scopeOptions = scopeOptions\n // We need scope's host for setting correct request headers for filtered scopes.\n interceptor.__nock_scopeHost = host\n interceptor.interceptionCounter = 0\n\n if (scopeOptions.allowUnmocked) allInterceptors[key].allowUnmocked = true\n\n allInterceptors[key].interceptors.push(interceptor)\n}\n\nfunction remove(interceptor) {\n if (interceptor.__nock_scope.shouldPersist() || --interceptor.counter > 0) {\n return\n }\n\n const { basePath } = interceptor\n const interceptors =\n (allInterceptors[basePath] && allInterceptors[basePath].interceptors) || []\n\n // TODO: There is a clearer way to write that we want to delete the first\n // matching instance. I'm also not sure why we couldn't delete _all_\n // matching instances.\n interceptors.some(function (thisInterceptor, i) {\n return thisInterceptor === interceptor ? interceptors.splice(i, 1) : false\n })\n}\n\nfunction removeAll() {\n Object.keys(allInterceptors).forEach(function (key) {\n allInterceptors[key].interceptors.forEach(function (interceptor) {\n interceptor.scope.keyedInterceptors = {}\n })\n })\n allInterceptors = {}\n}\n\n/**\n * Return all the Interceptors whose Scopes match against the base path of the provided options.\n *\n * @returns {Interceptor[]}\n */\nfunction interceptorsFor(options) {\n common.normalizeRequestOptions(options)\n\n debug('interceptors for %j', options.host)\n\n const basePath = `${options.proto}://${options.host}`\n\n debug('filtering interceptors for basepath', basePath)\n\n // First try to use filteringScope if any of the interceptors has it defined.\n for (const { key, interceptors, allowUnmocked } of Object.values(\n allInterceptors,\n )) {\n for (const interceptor of interceptors) {\n const { filteringScope } = interceptor.__nock_scopeOptions\n\n // If scope filtering function is defined and returns a truthy value then\n // we have to treat this as a match.\n if (filteringScope && filteringScope(basePath)) {\n interceptor.scope.logger('found matching scope interceptor')\n\n // Keep the filtered scope (its key) to signal the rest of the module\n // that this wasn't an exact but filtered match.\n interceptors.forEach(ic => {\n ic.__nock_filteredScope = ic.__nock_scopeKey\n })\n return interceptors\n }\n }\n\n if (common.matchStringOrRegexp(basePath, key)) {\n if (allowUnmocked && interceptors.length === 0) {\n debug('matched base path with allowUnmocked (no matching interceptors)')\n return [\n {\n options: { allowUnmocked: true },\n matchOrigin() {\n return false\n },\n },\n ]\n } else {\n debug(\n `matched base path (${interceptors.length} interceptor${\n interceptors.length > 1 ? 's' : ''\n })`,\n )\n return interceptors\n }\n }\n }\n\n return undefined\n}\n\nfunction removeInterceptor(options) {\n // Lazily import to avoid circular imports.\n const Interceptor = require('./interceptor')\n\n let baseUrl, key, method, proto\n if (options instanceof Interceptor) {\n baseUrl = options.basePath\n key = options._key\n } else {\n proto = options.proto ? options.proto : 'http'\n\n common.normalizeRequestOptions(options)\n baseUrl = `${proto}://${options.host}`\n method = (options.method && options.method.toUpperCase()) || 'GET'\n key = `${method} ${baseUrl}${options.path || '/'}`\n }\n\n if (\n allInterceptors[baseUrl] &&\n allInterceptors[baseUrl].interceptors.length > 0\n ) {\n for (let i = 0; i < allInterceptors[baseUrl].interceptors.length; i++) {\n const interceptor = allInterceptors[baseUrl].interceptors[i]\n if (\n options instanceof Interceptor\n ? interceptor === options\n : interceptor._key === key\n ) {\n allInterceptors[baseUrl].interceptors.splice(i, 1)\n interceptor.scope.remove(key, interceptor)\n break\n }\n }\n\n return true\n }\n\n return false\n}\n// Variable where we keep the ClientRequest we have overridden\n// (which might or might not be node's original http.ClientRequest)\nlet originalClientRequest\n\nfunction ErroringClientRequest(error) {\n http.OutgoingMessage.call(this)\n process.nextTick(\n function () {\n this.emit('error', error)\n }.bind(this),\n )\n}\n\ninherits(ErroringClientRequest, http.ClientRequest)\n\nfunction overrideClientRequest() {\n // Here's some background discussion about overriding ClientRequest:\n // - https://github.com/nodejitsu/mock-request/issues/4\n // - https://github.com/nock/nock/issues/26\n // It would be good to add a comment that explains this more clearly.\n debug('Overriding ClientRequest')\n\n // ----- Extending http.ClientRequest\n\n // Define the overriding client request that nock uses internally.\n function OverriddenClientRequest(...args) {\n const { options, callback } = common.normalizeClientRequestArgs(...args)\n\n if (Object.keys(options).length === 0) {\n // As weird as it is, it's possible to call `http.request` without\n // options, and it makes a request to localhost or somesuch. We should\n // support it too, for parity. However it doesn't work today, and fixing\n // it seems low priority. Giving an explicit error is nicer than\n // crashing with a weird stack trace. `http[s].request()`, nock's other\n // client-facing entry point, makes a similar check.\n // https://github.com/nock/nock/pull/1386\n // https://github.com/nock/nock/pull/1440\n throw Error(\n 'Creating a ClientRequest with empty `options` is not supported in Nock',\n )\n }\n\n http.OutgoingMessage.call(this)\n\n // Filter the interceptors per request options.\n const interceptors = interceptorsFor(options)\n\n if (isOn() && interceptors) {\n debug('using', interceptors.length, 'interceptors')\n\n // Use filtered interceptors to intercept requests.\n // TODO: this shouldn't be a class anymore\n // the overrider explicitly overrides methods and attrs on the request so the `assign` below should be removed.\n const overrider = new InterceptedRequestRouter({\n req: this,\n options,\n interceptors,\n })\n Object.assign(this, overrider)\n\n if (callback) {\n this.once('response', callback)\n }\n } else {\n debug('falling back to original ClientRequest')\n\n // Fallback to original ClientRequest if nock is off or the net connection is enabled.\n if (isOff() || isEnabledForNetConnect(options)) {\n originalClientRequest.apply(this, arguments)\n } else {\n common.setImmediate(\n function () {\n const error = new NetConnectNotAllowedError(\n options.host,\n options.path,\n )\n this.emit('error', error)\n }.bind(this),\n )\n }\n }\n }\n inherits(OverriddenClientRequest, http.ClientRequest)\n\n // Override the http module's request but keep the original so that we can use it and later restore it.\n // NOTE: We only override http.ClientRequest as https module also uses it.\n originalClientRequest = http.ClientRequest\n http.ClientRequest = OverriddenClientRequest\n\n debug('ClientRequest overridden')\n}\n\nfunction restoreOverriddenClientRequest() {\n debug('restoring overridden ClientRequest')\n\n // Restore the ClientRequest we have overridden.\n if (!originalClientRequest) {\n debug('- ClientRequest was not overridden')\n } else {\n http.ClientRequest = originalClientRequest\n originalClientRequest = undefined\n\n debug('- ClientRequest restored')\n }\n}\n\nfunction isActive() {\n // If ClientRequest has been overwritten by Nock then originalClientRequest is not undefined.\n // This means that Nock has been activated.\n return originalClientRequest !== undefined\n}\n\nfunction interceptorScopes() {\n const nestedInterceptors = Object.values(allInterceptors).map(\n i => i.interceptors,\n )\n const scopes = new Set([].concat(...nestedInterceptors).map(i => i.scope))\n return [...scopes]\n}\n\nfunction isDone() {\n return interceptorScopes().every(scope => scope.isDone())\n}\n\nfunction pendingMocks() {\n return [].concat(...interceptorScopes().map(scope => scope.pendingMocks()))\n}\n\nfunction activeMocks() {\n return [].concat(...interceptorScopes().map(scope => scope.activeMocks()))\n}\n\nfunction activate() {\n if (originalClientRequest) {\n throw new Error('Nock already active')\n }\n\n // ----- Overriding http.request and https.request:\n\n common.overrideRequests(function (proto, overriddenRequest, args) {\n // NOTE: overriddenRequest is already bound to its module.\n\n const { options, callback } = common.normalizeClientRequestArgs(...args)\n\n if (Object.keys(options).length === 0) {\n // As weird as it is, it's possible to call `http.request` without\n // options, and it makes a request to localhost or somesuch. We should\n // support it too, for parity. However it doesn't work today, and fixing\n // it seems low priority. Giving an explicit error is nicer than\n // crashing with a weird stack trace. `new ClientRequest()`, nock's\n // other client-facing entry point, makes a similar check.\n // https://github.com/nock/nock/pull/1386\n // https://github.com/nock/nock/pull/1440\n throw Error(\n 'Making a request with empty `options` is not supported in Nock',\n )\n }\n\n // The option per the docs is `protocol`. Its unclear if this line is meant to override that and is misspelled or if\n // the intend is to explicitly keep track of which module was called using a separate name.\n // Either way, `proto` is used as the source of truth from here on out.\n options.proto = proto\n\n const interceptors = interceptorsFor(options)\n\n if (isOn() && interceptors) {\n const matches = interceptors.some(interceptor =>\n interceptor.matchOrigin(options),\n )\n const allowUnmocked = interceptors.some(\n interceptor => interceptor.options.allowUnmocked,\n )\n\n if (!matches && allowUnmocked) {\n let req\n if (proto === 'https') {\n const { ClientRequest } = http\n http.ClientRequest = originalClientRequest\n req = overriddenRequest(options, callback)\n http.ClientRequest = ClientRequest\n } else {\n req = overriddenRequest(options, callback)\n }\n globalEmitter.emit('no match', req)\n return req\n }\n\n // NOTE: Since we already overrode the http.ClientRequest we are in fact constructing\n // our own OverriddenClientRequest.\n return new http.ClientRequest(options, callback)\n } else {\n globalEmitter.emit('no match', options)\n if (isOff() || isEnabledForNetConnect(options)) {\n return overriddenRequest(options, callback)\n } else {\n const error = new NetConnectNotAllowedError(options.host, options.path)\n return new ErroringClientRequest(error)\n }\n }\n })\n\n overrideClientRequest()\n}\n\nmodule.exports = {\n addInterceptor,\n remove,\n removeAll,\n removeInterceptor,\n isOn,\n activate,\n isActive,\n isDone,\n pendingMocks,\n activeMocks,\n enableNetConnect,\n disableNetConnect,\n restoreOverriddenClientRequest,\n abortPendingRequests: common.removeAllTimers,\n}\n","'use strict'\n\nconst debug = require('debug')('nock.recorder')\nconst querystring = require('querystring')\nconst { inspect } = require('util')\n\nconst common = require('./common')\nconst { restoreOverriddenClientRequest } = require('./intercept')\n\nconst SEPARATOR = '\\n<<<<<<-- cut here -->>>>>>\\n'\nlet recordingInProgress = false\nlet outputs = []\n\nfunction getScope(options) {\n const { proto, host, port } = common.normalizeRequestOptions(options)\n return common.normalizeOrigin(proto, host, port)\n}\n\nfunction getMethod(options) {\n return options.method || 'GET'\n}\n\nfunction getBodyFromChunks(chunks, headers) {\n // If we have headers and there is content-encoding it means that the body\n // shouldn't be merged but instead persisted as an array of hex strings so\n // that the response chunks can be mocked one by one.\n if (headers && common.isContentEncoded(headers)) {\n return {\n body: chunks.map(chunk => chunk.toString('hex')),\n }\n }\n\n const mergedBuffer = Buffer.concat(chunks)\n\n // The merged buffer can be one of three things:\n // 1. A UTF-8-representable string buffer which represents a JSON object.\n // 2. A UTF-8-representable buffer which doesn't represent a JSON object.\n // 3. A non-UTF-8-representable buffer which then has to be recorded as a hex string.\n const isUtf8Representable = common.isUtf8Representable(mergedBuffer)\n if (isUtf8Representable) {\n const maybeStringifiedJson = mergedBuffer.toString('utf8')\n try {\n return {\n isUtf8Representable,\n body: JSON.parse(maybeStringifiedJson),\n }\n } catch (err) {\n return {\n isUtf8Representable,\n body: maybeStringifiedJson,\n }\n }\n } else {\n return {\n isUtf8Representable,\n body: mergedBuffer.toString('hex'),\n }\n }\n}\n\nfunction generateRequestAndResponseObject({\n req,\n bodyChunks,\n options,\n res,\n dataChunks,\n reqheaders,\n}) {\n const { body, isUtf8Representable } = getBodyFromChunks(\n dataChunks,\n res.headers,\n )\n options.path = req.path\n\n return {\n scope: getScope(options),\n method: getMethod(options),\n path: options.path,\n // Is it deliberate that `getBodyFromChunks()` is called a second time?\n body: getBodyFromChunks(bodyChunks).body,\n status: res.statusCode,\n response: body,\n rawHeaders: res.rawHeaders,\n reqheaders: reqheaders || undefined,\n // When content-encoding is enabled, isUtf8Representable is `undefined`,\n // so we explicitly check for `false`.\n responseIsBinary: isUtf8Representable === false,\n }\n}\n\nfunction generateRequestAndResponse({\n req,\n bodyChunks,\n options,\n res,\n dataChunks,\n reqheaders,\n}) {\n const requestBody = getBodyFromChunks(bodyChunks).body\n const responseBody = getBodyFromChunks(dataChunks, res.headers).body\n\n // Remove any query params from options.path so they can be added in the query() function\n let { path } = options\n const queryIndex = req.path.indexOf('?')\n let queryObj = {}\n if (queryIndex !== -1) {\n // Remove the query from the path\n path = path.substring(0, queryIndex)\n\n const queryStr = req.path.slice(queryIndex + 1)\n queryObj = querystring.parse(queryStr)\n }\n\n // Escape any single quotes in the path as the output uses them\n path = path.replace(/'/g, `\\\\'`)\n\n // Always encode the query parameters when recording.\n const encodedQueryObj = {}\n for (const key in queryObj) {\n const formattedPair = common.formatQueryValue(\n key,\n queryObj[key],\n common.percentEncode,\n )\n encodedQueryObj[formattedPair[0]] = formattedPair[1]\n }\n\n const lines = []\n\n // We want a leading newline.\n lines.push('')\n\n const scope = getScope(options)\n lines.push(`nock('${scope}', {\"encodedQueryParams\":true})`)\n\n const methodName = getMethod(options).toLowerCase()\n if (requestBody) {\n lines.push(` .${methodName}('${path}', ${JSON.stringify(requestBody)})`)\n } else {\n lines.push(` .${methodName}('${path}')`)\n }\n\n Object.entries(reqheaders || {}).forEach(([fieldName, fieldValue]) => {\n const safeName = JSON.stringify(fieldName)\n const safeValue = JSON.stringify(fieldValue)\n lines.push(` .matchHeader(${safeName}, ${safeValue})`)\n })\n\n if (queryIndex !== -1) {\n lines.push(` .query(${JSON.stringify(encodedQueryObj)})`)\n }\n\n const statusCode = res.statusCode.toString()\n const stringifiedResponseBody = JSON.stringify(responseBody)\n const headers = inspect(res.rawHeaders)\n lines.push(` .reply(${statusCode}, ${stringifiedResponseBody}, ${headers});`)\n\n return lines.join('\\n')\n}\n\n// This module variable is used to identify a unique recording ID in order to skip\n// spurious requests that sometimes happen. This problem has been, so far,\n// exclusively detected in nock's unit testing where 'checks if callback is specified'\n// interferes with other tests as its t.end() is invoked without waiting for request\n// to finish (which is the point of the test).\nlet currentRecordingId = 0\n\nconst defaultRecordOptions = {\n dont_print: false,\n enable_reqheaders_recording: false,\n logging: console.log, // eslint-disable-line no-console\n output_objects: false,\n use_separator: true,\n}\n\nfunction record(recOptions) {\n // Trying to start recording with recording already in progress implies an error\n // in the recording configuration (double recording makes no sense and used to lead\n // to duplicates in output)\n if (recordingInProgress) {\n throw new Error('Nock recording already in progress')\n }\n\n recordingInProgress = true\n\n // Set the new current recording ID and capture its value in this instance of record().\n currentRecordingId = currentRecordingId + 1\n const thisRecordingId = currentRecordingId\n\n // Originally the parameter was a dont_print boolean flag.\n // To keep the existing code compatible we take that case into account.\n if (typeof recOptions === 'boolean') {\n recOptions = { dont_print: recOptions }\n }\n\n recOptions = { ...defaultRecordOptions, ...recOptions }\n\n debug('start recording', thisRecordingId, recOptions)\n\n const {\n dont_print: dontPrint,\n enable_reqheaders_recording: enableReqHeadersRecording,\n logging,\n output_objects: outputObjects,\n use_separator: useSeparator,\n } = recOptions\n\n debug(thisRecordingId, 'restoring overridden requests before new overrides')\n // To preserve backward compatibility (starting recording wasn't throwing if nock was already active)\n // we restore any requests that may have been overridden by other parts of nock (e.g. intercept)\n // NOTE: This is hacky as hell but it keeps the backward compatibility *and* allows correct\n // behavior in the face of other modules also overriding ClientRequest.\n common.restoreOverriddenRequests()\n // We restore ClientRequest as it messes with recording of modules that also override ClientRequest (e.g. xhr2)\n restoreOverriddenClientRequest()\n\n // We override the requests so that we can save information on them before executing.\n common.overrideRequests(function (proto, overriddenRequest, rawArgs) {\n const { options, callback } = common.normalizeClientRequestArgs(...rawArgs)\n const bodyChunks = []\n\n // Node 0.11 https.request calls http.request -- don't want to record things\n // twice.\n /* istanbul ignore if */\n if (options._recording) {\n return overriddenRequest(options, callback)\n }\n options._recording = true\n\n const req = overriddenRequest(options, function (res) {\n debug(thisRecordingId, 'intercepting', proto, 'request to record')\n\n // We put our 'end' listener to the front of the listener array.\n res.once('end', function () {\n debug(thisRecordingId, proto, 'intercepted request ended')\n\n let reqheaders\n // Ignore request headers completely unless it was explicitly enabled by the user (see README)\n if (enableReqHeadersRecording) {\n // We never record user-agent headers as they are worse than useless -\n // they actually make testing more difficult without providing any benefit (see README)\n reqheaders = req.getHeaders()\n common.deleteHeadersField(reqheaders, 'user-agent')\n }\n\n const generateFn = outputObjects\n ? generateRequestAndResponseObject\n : generateRequestAndResponse\n let out = generateFn({\n req,\n bodyChunks,\n options,\n res,\n dataChunks,\n reqheaders,\n })\n\n debug('out:', out)\n\n // Check that the request was made during the current recording.\n // If it hasn't then skip it. There is no other simple way to handle\n // this as it depends on the timing of requests and responses. Throwing\n // will make some recordings/unit tests fail randomly depending on how\n // fast/slow the response arrived.\n // If you are seeing this error then you need to make sure that all\n // the requests made during a single recording session finish before\n // ending the same recording session.\n if (thisRecordingId !== currentRecordingId) {\n debug('skipping recording of an out-of-order request', out)\n return\n }\n\n outputs.push(out)\n\n if (!dontPrint) {\n if (useSeparator) {\n if (typeof out !== 'string') {\n out = JSON.stringify(out, null, 2)\n }\n logging(SEPARATOR + out + SEPARATOR)\n } else {\n logging(out)\n }\n }\n })\n\n let encoding\n // We need to be aware of changes to the stream's encoding so that we\n // don't accidentally mangle the data.\n const { setEncoding } = res\n res.setEncoding = function (newEncoding) {\n encoding = newEncoding\n return setEncoding.apply(this, arguments)\n }\n\n const dataChunks = []\n // Replace res.push with our own implementation that stores chunks\n const origResPush = res.push\n res.push = function (data) {\n if (data) {\n if (encoding) {\n data = Buffer.from(data, encoding)\n }\n dataChunks.push(data)\n }\n\n return origResPush.call(res, data)\n }\n\n if (callback) {\n callback(res, options, callback)\n }\n\n debug('finished setting up intercepting')\n\n // We override both the http and the https modules; when we are\n // serializing the request, we need to know which was called.\n // By stuffing the state, we can make sure that nock records\n // the intended protocol.\n if (proto === 'https') {\n options.proto = 'https'\n }\n })\n\n const recordChunk = (chunk, encoding) => {\n debug(thisRecordingId, 'new', proto, 'body chunk')\n if (!Buffer.isBuffer(chunk)) {\n chunk = Buffer.from(chunk, encoding)\n }\n bodyChunks.push(chunk)\n }\n\n const oldWrite = req.write\n req.write = function (chunk, encoding) {\n if (typeof chunk !== 'undefined') {\n recordChunk(chunk, encoding)\n oldWrite.apply(req, arguments)\n } else {\n throw new Error('Data was undefined.')\n }\n }\n\n // Starting in Node 8, `OutgoingMessage.end()` directly calls an internal\n // `write_` function instead of proxying to the public\n // `OutgoingMessage.write()` method, so we have to wrap `end` too.\n const oldEnd = req.end\n req.end = function (chunk, encoding, callback) {\n debug('req.end')\n if (typeof chunk === 'function') {\n callback = chunk\n chunk = null\n } else if (typeof encoding === 'function') {\n callback = encoding\n encoding = null\n }\n\n if (chunk) {\n recordChunk(chunk, encoding)\n }\n oldEnd.call(req, chunk, encoding, callback)\n }\n\n return req\n })\n}\n\n// Restore *all* the overridden http/https modules' properties.\nfunction restore() {\n debug(\n currentRecordingId,\n 'restoring all the overridden http/https properties',\n )\n\n common.restoreOverriddenRequests()\n restoreOverriddenClientRequest()\n recordingInProgress = false\n}\n\nfunction clear() {\n outputs = []\n}\n\nmodule.exports = {\n record,\n outputs: () => outputs,\n restore,\n clear,\n}\n","'use strict'\n\n/**\n * @module nock/scope\n */\nconst { addInterceptor, isOn } = require('./intercept')\nconst common = require('./common')\nconst assert = require('assert')\nconst url = require('url')\nconst debug = require('debug')('nock.scope')\nconst { EventEmitter } = require('events')\nconst Interceptor = require('./interceptor')\n\nconst { URL, Url: LegacyUrl } = url\nlet fs\n\ntry {\n fs = require('fs')\n} catch (err) {\n // do nothing, we're in the browser\n}\n\n/**\n * Normalizes the passed url for consistent internal processing\n * @param {string|LegacyUrl|URL} u\n */\nfunction normalizeUrl(u) {\n if (!(u instanceof URL)) {\n if (u instanceof LegacyUrl) {\n return normalizeUrl(new URL(url.format(u)))\n }\n // If the url is invalid, let the URL library report it\n return normalizeUrl(new URL(u))\n }\n\n if (!/https?:/.test(u.protocol)) {\n throw new TypeError(\n `Protocol '${u.protocol}' not recognized. This commonly occurs when a hostname and port are included without a protocol, producing a URL that is valid but confusing, and probably not what you want.`,\n )\n }\n\n return {\n href: u.href,\n origin: u.origin,\n protocol: u.protocol,\n username: u.username,\n password: u.password,\n host: u.host,\n hostname:\n // strip brackets from IPv6\n typeof u.hostname === 'string' && u.hostname.startsWith('[')\n ? u.hostname.slice(1, -1)\n : u.hostname,\n port: u.port || (u.protocol === 'http:' ? 80 : 443),\n pathname: u.pathname,\n search: u.search,\n searchParams: u.searchParams,\n hash: u.hash,\n }\n}\n\n/**\n * @param {string|RegExp|LegacyUrl|URL} basePath\n * @param {Object} options\n * @param {boolean} options.allowUnmocked\n * @param {string[]} options.badheaders\n * @param {function} options.conditionally\n * @param {boolean} options.encodedQueryParams\n * @param {function} options.filteringScope\n * @param {Object} options.reqheaders\n * @constructor\n */\nclass Scope extends EventEmitter {\n constructor(basePath, options) {\n super()\n\n this.keyedInterceptors = {}\n this.interceptors = []\n this.transformPathFunction = null\n this.transformRequestBodyFunction = null\n this.matchHeaders = []\n this.scopeOptions = options || {}\n this.urlParts = {}\n this._persist = false\n this.contentLen = false\n this.date = null\n this.basePath = basePath\n this.basePathname = ''\n this.port = null\n this._defaultReplyHeaders = []\n\n let logNamespace = String(basePath)\n\n if (!(basePath instanceof RegExp)) {\n this.urlParts = normalizeUrl(basePath)\n this.port = this.urlParts.port\n this.basePathname = this.urlParts.pathname.replace(/\\/$/, '')\n this.basePath = `${this.urlParts.protocol}//${this.urlParts.hostname}:${this.port}`\n logNamespace = this.urlParts.host\n }\n\n this.logger = debug.extend(logNamespace)\n }\n\n add(key, interceptor) {\n if (!(key in this.keyedInterceptors)) {\n this.keyedInterceptors[key] = []\n }\n this.keyedInterceptors[key].push(interceptor)\n addInterceptor(\n this.basePath,\n interceptor,\n this,\n this.scopeOptions,\n this.urlParts.hostname,\n )\n }\n\n remove(key, interceptor) {\n if (this._persist) {\n return\n }\n const arr = this.keyedInterceptors[key]\n if (arr) {\n arr.splice(arr.indexOf(interceptor), 1)\n if (arr.length === 0) {\n delete this.keyedInterceptors[key]\n }\n }\n }\n\n intercept(uri, method, requestBody, interceptorOptions) {\n const ic = new Interceptor(\n this,\n uri,\n method,\n requestBody,\n interceptorOptions,\n )\n\n this.interceptors.push(ic)\n return ic\n }\n\n get(uri, requestBody, options) {\n return this.intercept(uri, 'GET', requestBody, options)\n }\n\n post(uri, requestBody, options) {\n return this.intercept(uri, 'POST', requestBody, options)\n }\n\n put(uri, requestBody, options) {\n return this.intercept(uri, 'PUT', requestBody, options)\n }\n\n head(uri, requestBody, options) {\n return this.intercept(uri, 'HEAD', requestBody, options)\n }\n\n patch(uri, requestBody, options) {\n return this.intercept(uri, 'PATCH', requestBody, options)\n }\n\n merge(uri, requestBody, options) {\n return this.intercept(uri, 'MERGE', requestBody, options)\n }\n\n delete(uri, requestBody, options) {\n return this.intercept(uri, 'DELETE', requestBody, options)\n }\n\n options(uri, requestBody, options) {\n return this.intercept(uri, 'OPTIONS', requestBody, options)\n }\n\n // Returns the list of keys for non-optional Interceptors that haven't been completed yet.\n // TODO: This assumes that completed mocks are removed from the keyedInterceptors list\n // (when persistence is off). We should change that (and this) in future.\n pendingMocks() {\n return this.activeMocks().filter(key =>\n this.keyedInterceptors[key].some(({ interceptionCounter, optional }) => {\n const persistedAndUsed = this._persist && interceptionCounter > 0\n return !persistedAndUsed && !optional\n }),\n )\n }\n\n // Returns all keyedInterceptors that are active.\n // This includes incomplete interceptors, persisted but complete interceptors, and\n // optional interceptors, but not non-persisted and completed interceptors.\n activeMocks() {\n return Object.keys(this.keyedInterceptors)\n }\n\n isDone() {\n if (!isOn()) {\n return true\n }\n\n return this.pendingMocks().length === 0\n }\n\n done() {\n assert.ok(\n this.isDone(),\n `Mocks not yet satisfied:\\n${this.pendingMocks().join('\\n')}`,\n )\n }\n\n buildFilter() {\n const filteringArguments = arguments\n\n if (arguments[0] instanceof RegExp) {\n return function (candidate) {\n /* istanbul ignore if */\n if (typeof candidate !== 'string') {\n // Given the way nock is written, it seems like `candidate` will always\n // be a string, regardless of what options might be passed to it.\n // However the code used to contain a truthiness test of `candidate`.\n // The check is being preserved for now.\n throw Error(\n `Nock internal assertion failed: typeof candidate is ${typeof candidate}. If you encounter this error, please report it as a bug.`,\n )\n }\n return candidate.replace(filteringArguments[0], filteringArguments[1])\n }\n } else if (typeof arguments[0] === 'function') {\n return arguments[0]\n }\n }\n\n filteringPath() {\n this.transformPathFunction = this.buildFilter.apply(this, arguments)\n if (!this.transformPathFunction) {\n throw new Error(\n 'Invalid arguments: filtering path should be a function or a regular expression',\n )\n }\n return this\n }\n\n filteringRequestBody() {\n this.transformRequestBodyFunction = this.buildFilter.apply(this, arguments)\n if (!this.transformRequestBodyFunction) {\n throw new Error(\n 'Invalid arguments: filtering request body should be a function or a regular expression',\n )\n }\n return this\n }\n\n matchHeader(name, value) {\n // We use lower-case header field names throughout Nock.\n this.matchHeaders.push({ name: name.toLowerCase(), value })\n return this\n }\n\n defaultReplyHeaders(headers) {\n this._defaultReplyHeaders = common.headersInputToRawArray(headers)\n return this\n }\n\n persist(flag = true) {\n if (typeof flag !== 'boolean') {\n throw new Error('Invalid arguments: argument should be a boolean')\n }\n this._persist = flag\n return this\n }\n\n /**\n * @private\n * @returns {boolean}\n */\n shouldPersist() {\n return this._persist\n }\n\n replyContentLength() {\n this.contentLen = true\n return this\n }\n\n replyDate(d) {\n this.date = d || new Date()\n return this\n }\n\n clone() {\n return new Scope(this.basePath, this.scopeOptions)\n }\n}\n\nfunction loadDefs(path) {\n if (!fs) {\n throw new Error('No fs')\n }\n\n const contents = fs.readFileSync(path)\n return JSON.parse(contents)\n}\n\nfunction load(path) {\n return define(loadDefs(path))\n}\n\nfunction getStatusFromDefinition(nockDef) {\n // Backward compatibility for when `status` was encoded as string in `reply`.\n if (nockDef.reply !== undefined) {\n const parsedReply = parseInt(nockDef.reply, 10)\n if (isNaN(parsedReply)) {\n throw Error('`reply`, when present, must be a numeric string')\n }\n\n return parsedReply\n }\n\n const DEFAULT_STATUS_OK = 200\n return nockDef.status || DEFAULT_STATUS_OK\n}\n\nfunction getScopeFromDefinition(nockDef) {\n // Backward compatibility for when `port` was part of definition.\n if (nockDef.port !== undefined) {\n // Include `port` into scope if it doesn't exist.\n const options = url.parse(nockDef.scope)\n if (options.port === null) {\n return `${nockDef.scope}:${nockDef.port}`\n } else {\n if (parseInt(options.port) !== parseInt(nockDef.port)) {\n throw new Error(\n 'Mismatched port numbers in scope and port properties of nock definition.',\n )\n }\n }\n }\n\n return nockDef.scope\n}\n\nfunction tryJsonParse(string) {\n try {\n return JSON.parse(string)\n } catch (err) {\n return string\n }\n}\n\nfunction define(nockDefs) {\n const scopes = []\n\n nockDefs.forEach(function (nockDef) {\n const nscope = getScopeFromDefinition(nockDef)\n const npath = nockDef.path\n if (!nockDef.method) {\n throw Error('Method is required')\n }\n const method = nockDef.method.toLowerCase()\n const status = getStatusFromDefinition(nockDef)\n const rawHeaders = nockDef.rawHeaders || []\n const reqheaders = nockDef.reqheaders || {}\n const badheaders = nockDef.badheaders || []\n const options = { ...nockDef.options }\n\n // We use request headers for both filtering (see below) and mocking.\n // Here we are setting up mocked request headers but we don't want to\n // be changing the user's options object so we clone it first.\n options.reqheaders = reqheaders\n options.badheaders = badheaders\n\n // Response is not always JSON as it could be a string or binary data or\n // even an array of binary buffers (e.g. when content is encoded).\n let response\n if (!nockDef.response) {\n response = ''\n // TODO: Rename `responseIsBinary` to `responseIsUtf8Representable`.\n } else if (nockDef.responseIsBinary) {\n response = Buffer.from(nockDef.response, 'hex')\n } else {\n response =\n typeof nockDef.response === 'string'\n ? tryJsonParse(nockDef.response)\n : nockDef.response\n }\n\n const scope = new Scope(nscope, options)\n\n // If request headers were specified filter by them.\n Object.entries(reqheaders).forEach(([fieldName, value]) => {\n scope.matchHeader(fieldName, value)\n })\n\n const acceptableFilters = ['filteringRequestBody', 'filteringPath']\n acceptableFilters.forEach(filter => {\n if (nockDef[filter]) {\n scope[filter](nockDef[filter])\n }\n })\n\n scope\n .intercept(npath, method, nockDef.body)\n .reply(status, response, rawHeaders)\n\n scopes.push(scope)\n })\n\n return scopes\n}\n\nmodule.exports = {\n Scope,\n load,\n loadDefs,\n define,\n}\n","'use strict'\n\nconst assert = require('assert')\nconst recorder = require('./recorder')\nconst {\n activate,\n disableNetConnect,\n enableNetConnect,\n removeAll: cleanAll,\n} = require('./intercept')\nconst { loadDefs, define } = require('./scope')\n\nconst { format } = require('util')\nconst path = require('path')\nconst debug = require('debug')('nock.back')\n\nlet _mode = null\n\nlet fs\n\ntry {\n fs = require('fs')\n} catch (err) {\n // do nothing, probably in browser\n}\n\n/**\n * nock the current function with the fixture given\n *\n * @param {string} fixtureName - the name of the fixture, e.x. 'foo.json'\n * @param {object} options - [optional] extra options for nock with, e.x. `{ assert: true }`\n * @param {function} nockedFn - [optional] callback function to be executed with the given fixture being loaded;\n * if defined the function will be called with context `{ scopes: loaded_nocks || [] }`\n * set as `this` and `nockDone` callback function as first and only parameter;\n * if not defined a promise resolving to `{nockDone, context}` where `context` is\n * aforementioned `{ scopes: loaded_nocks || [] }`\n *\n * List of options:\n *\n * @param {function} before - a preprocessing function, gets called before nock.define\n * @param {function} after - a postprocessing function, gets called after nock.define\n * @param {function} afterRecord - a postprocessing function, gets called after recording. Is passed the array\n * of scopes recorded and should return the array scopes to save to the fixture\n * @param {function} recorder - custom options to pass to the recorder\n *\n */\nfunction Back(fixtureName, options, nockedFn) {\n if (!Back.fixtures) {\n throw new Error(\n 'Back requires nock.back.fixtures to be set\\n' +\n 'Ex:\\n' +\n \"\\trequire(nock).back.fixtures = '/path/to/fixtures/'\",\n )\n }\n\n if (typeof fixtureName !== 'string') {\n throw new Error('Parameter fixtureName must be a string')\n }\n\n if (arguments.length === 1) {\n options = {}\n } else if (arguments.length === 2) {\n // If 2nd parameter is a function then `options` has been omitted\n // otherwise `options` haven't been omitted but `nockedFn` was.\n if (typeof options === 'function') {\n nockedFn = options\n options = {}\n }\n }\n\n _mode.setup()\n\n const fixture = path.join(Back.fixtures, fixtureName)\n const context = _mode.start(fixture, options)\n\n const nockDone = function () {\n _mode.finish(fixture, options, context)\n }\n\n debug('context:', context)\n\n // If nockedFn is a function then invoke it, otherwise return a promise resolving to nockDone.\n if (typeof nockedFn === 'function') {\n nockedFn.call(context, nockDone)\n } else {\n return Promise.resolve({ nockDone, context })\n }\n}\n\n/*******************************************************************************\n * Modes *\n *******************************************************************************/\n\nconst wild = {\n setup: function () {\n cleanAll()\n recorder.restore()\n activate()\n enableNetConnect()\n },\n\n start: function () {\n return load() // don't load anything but get correct context\n },\n\n finish: function () {\n // nothing to do\n },\n}\n\nconst dryrun = {\n setup: function () {\n recorder.restore()\n cleanAll()\n activate()\n // We have to explicitly enable net connectivity as by default it's off.\n enableNetConnect()\n },\n\n start: function (fixture, options) {\n const contexts = load(fixture, options)\n\n enableNetConnect()\n return contexts\n },\n\n finish: function () {\n // nothing to do\n },\n}\n\nconst record = {\n setup: function () {\n recorder.restore()\n recorder.clear()\n cleanAll()\n activate()\n disableNetConnect()\n },\n\n start: function (fixture, options) {\n if (!fs) {\n throw new Error('no fs')\n }\n const context = load(fixture, options)\n\n if (!context.isLoaded) {\n recorder.record({\n dont_print: true,\n output_objects: true,\n ...options.recorder,\n })\n\n context.isRecording = true\n }\n\n return context\n },\n\n finish: function (fixture, options, context) {\n if (context.isRecording) {\n let outputs = recorder.outputs()\n\n if (typeof options.afterRecord === 'function') {\n outputs = options.afterRecord(outputs)\n }\n\n outputs =\n typeof outputs === 'string' ? outputs : JSON.stringify(outputs, null, 4)\n debug('recorder outputs:', outputs)\n\n fs.mkdirSync(path.dirname(fixture), { recursive: true })\n fs.writeFileSync(fixture, outputs)\n }\n },\n}\n\nconst update = {\n setup: function () {\n recorder.restore()\n recorder.clear()\n cleanAll()\n activate()\n disableNetConnect()\n },\n\n start: function (fixture, options) {\n if (!fs) {\n throw new Error('no fs')\n }\n const context = removeFixture(fixture)\n recorder.record({\n dont_print: true,\n output_objects: true,\n ...options.recorder,\n })\n\n context.isRecording = true\n\n return context\n },\n\n finish: function (fixture, options, context) {\n let outputs = recorder.outputs()\n\n if (typeof options.afterRecord === 'function') {\n outputs = options.afterRecord(outputs)\n }\n\n outputs =\n typeof outputs === 'string' ? outputs : JSON.stringify(outputs, null, 4)\n debug('recorder outputs:', outputs)\n\n fs.mkdirSync(path.dirname(fixture), { recursive: true })\n fs.writeFileSync(fixture, outputs)\n },\n}\n\nconst lockdown = {\n setup: function () {\n recorder.restore()\n recorder.clear()\n cleanAll()\n activate()\n disableNetConnect()\n },\n\n start: function (fixture, options) {\n return load(fixture, options)\n },\n\n finish: function () {\n // nothing to do\n },\n}\n\nfunction load(fixture, options) {\n const context = {\n scopes: [],\n assertScopesFinished: function () {\n assertScopes(this.scopes, fixture)\n },\n query: function () {\n const nested = this.scopes.map(scope =>\n scope.interceptors.map(interceptor => ({\n method: interceptor.method,\n uri: interceptor.uri,\n basePath: interceptor.basePath,\n path: interceptor.path,\n queries: interceptor.queries,\n counter: interceptor.counter,\n body: interceptor.body,\n statusCode: interceptor.statusCode,\n optional: interceptor.optional,\n })),\n )\n\n return [].concat.apply([], nested)\n },\n }\n\n if (fixture && fixtureExists(fixture)) {\n let scopes = loadDefs(fixture)\n applyHook(scopes, options.before)\n\n scopes = define(scopes)\n applyHook(scopes, options.after)\n\n context.scopes = scopes\n context.isLoaded = true\n }\n\n return context\n}\n\nfunction removeFixture(fixture, options) {\n const context = {\n scopes: [],\n assertScopesFinished: function () {},\n }\n\n if (fixture && fixtureExists(fixture)) {\n /* istanbul ignore next - fs.unlinkSync is for node 10 support */\n fs.rmSync ? fs.rmSync(fixture) : fs.unlinkSync(fixture)\n }\n context.isLoaded = false\n return context\n}\n\nfunction applyHook(scopes, fn) {\n if (!fn) {\n return\n }\n\n if (typeof fn !== 'function') {\n throw new Error('processing hooks must be a function')\n }\n\n scopes.forEach(fn)\n}\n\nfunction fixtureExists(fixture) {\n if (!fs) {\n throw new Error('no fs')\n }\n\n return fs.existsSync(fixture)\n}\n\nfunction assertScopes(scopes, fixture) {\n const pending = scopes\n .filter(scope => !scope.isDone())\n .map(scope => scope.pendingMocks())\n\n if (pending.length) {\n assert.fail(\n format(\n '%j was not used, consider removing %s to rerecord fixture',\n [].concat(...pending),\n fixture,\n ),\n )\n }\n}\n\nconst Modes = {\n wild, // all requests go out to the internet, dont replay anything, doesnt record anything\n\n dryrun, // use recorded nocks, allow http calls, doesnt record anything, useful for writing new tests (default)\n\n record, // use recorded nocks, record new nocks\n\n update, // allow http calls, record all nocks, don't use recorded nocks\n\n lockdown, // use recorded nocks, disables all http calls even when not nocked, doesnt record\n}\n\nBack.setMode = function (mode) {\n if (!(mode in Modes)) {\n throw new Error(`Unknown mode: ${mode}`)\n }\n\n Back.currentMode = mode\n debug('New nock back mode:', Back.currentMode)\n\n _mode = Modes[mode]\n _mode.setup()\n}\n\nBack.fixtures = null\nBack.currentMode = null\n\nmodule.exports = Back\n","'use strict'\n\nconst back = require('./lib/back')\nconst emitter = require('./lib/global_emitter')\nconst {\n activate,\n isActive,\n isDone,\n isOn,\n pendingMocks,\n activeMocks,\n removeInterceptor,\n disableNetConnect,\n enableNetConnect,\n removeAll,\n abortPendingRequests,\n} = require('./lib/intercept')\nconst recorder = require('./lib/recorder')\nconst { Scope, load, loadDefs, define } = require('./lib/scope')\n\nmodule.exports = (basePath, options) => new Scope(basePath, options)\n\nObject.assign(module.exports, {\n activate,\n isActive,\n isDone,\n pendingMocks,\n activeMocks,\n removeInterceptor,\n disableNetConnect,\n enableNetConnect,\n cleanAll: removeAll,\n abortPendingRequests,\n load,\n loadDefs,\n define,\n emitter,\n recorder: {\n rec: recorder.record,\n clear: recorder.clear,\n play: recorder.outputs,\n },\n restore: recorder.restore,\n back,\n})\n\n// We always activate Nock on import, overriding the globals.\n// Setting the Back mode \"activates\" Nock by overriding the global entries in the `http/s` modules.\n// If Nock Back is configured, we need to honor that setting for backward compatibility,\n// otherwise we rely on Nock Back's default initializing side effect.\nif (isOn()) {\n back.setMode(process.env.NOCK_BACK_MODE || 'dryrun')\n}\n","import Controller from './NotificationServicesController';\n\nexport { Controller };\nexport * from './NotificationServicesController';\nexport * as Types from './types';\nexport * as Mocks from './__fixtures__';\nexport * as Processors from './processors';\nexport * as Constants from './constants';\n","export * from './mock-feature-announcements';\nexport * from './mock-notification-trigger';\nexport * from './mock-notification-user-storage';\nexport * from './mock-raw-notifications';\nexport * from './mockResponses';\nexport * from './mockServices';\n","import { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { ContentfulResult } from '../services/feature-announcements';\nimport type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';\n\n/**\n * Mocking Utility - create a mock normalized feature announcement\n *\n * @returns Mock Normalized Feature Announcement\n */\nexport function createMockFeatureAnnouncementAPIResult(): ContentfulResult {\n return {\n sys: {\n type: 'Array',\n },\n total: 17,\n skip: 0,\n limit: 1,\n items: [\n {\n metadata: {\n tags: [],\n },\n sys: {\n space: {\n sys: {\n type: 'Link',\n linkType: 'Space',\n id: 'jdkgyfmyd9sw',\n },\n },\n id: '1ABRmHaNCgmxROKXXLXsMu',\n type: 'Entry',\n createdAt: '2024-04-09T13:24:01.872Z',\n updatedAt: '2024-04-09T13:24:01.872Z',\n environment: {\n sys: {\n id: 'master',\n type: 'Link',\n linkType: 'Environment',\n },\n },\n revision: 1,\n contentType: {\n sys: {\n type: 'Link',\n linkType: 'ContentType',\n id: 'productAnnouncement',\n },\n },\n locale: 'en-US',\n },\n fields: {\n title: 'Don’t miss out on airdrops and new NFT mints!',\n id: 'dont-miss-out-on-airdrops-and-new-nft-mints',\n category: 'ANNOUNCEMENT',\n shortDescription:\n 'Check your airdrop eligibility and see trending NFT drops. Head over to the Explore tab to get started. ',\n image: {\n sys: {\n type: 'Link',\n linkType: 'Asset',\n id: '5jqq8sFeLc6XEoeWlpI3aB',\n },\n },\n longDescription: {\n data: {},\n content: [\n {\n data: {},\n content: [\n {\n data: {},\n marks: [],\n value:\n 'You can now verify if any of your connected addresses are eligible for airdrops and other ERC-20 claims in a secure and convenient way. We’ve also added trending NFT mints based on creators you’ve minted from before or other tokens you hold. Head over to the Explore tab to get started. \\n',\n nodeType: 'text',\n },\n ],\n nodeType: 'paragraph',\n },\n ],\n nodeType: 'document',\n },\n link: {\n sys: {\n type: 'Link',\n linkType: 'Entry',\n id: '62xKYM2ydo4F1mS5q97K5q',\n },\n },\n },\n },\n ],\n includes: {\n Entry: [\n {\n metadata: {\n tags: [],\n },\n sys: {\n space: {\n sys: {\n type: 'Link',\n linkType: 'Space',\n id: 'jdkgyfmyd9sw',\n },\n },\n id: '62xKYM2ydo4F1mS5q97K5q',\n type: 'Entry',\n createdAt: '2024-04-09T13:23:03.636Z',\n updatedAt: '2024-04-09T13:23:03.636Z',\n environment: {\n sys: {\n id: 'master',\n type: 'Link',\n linkType: 'Environment',\n },\n },\n revision: 1,\n contentType: {\n sys: {\n type: 'Link',\n linkType: 'ContentType',\n id: 'link',\n },\n },\n locale: 'en-US',\n },\n fields: {\n extensionLinkText: 'Try now',\n extensionLinkRoute: 'home.html',\n },\n },\n ],\n Asset: [\n {\n metadata: {\n tags: [],\n },\n sys: {\n space: {\n sys: {\n type: 'Link',\n linkType: 'Space',\n id: 'jdkgyfmyd9sw',\n },\n },\n id: '5jqq8sFeLc6XEoeWlpI3aB',\n type: 'Asset',\n createdAt: '2024-04-09T13:23:13.327Z',\n updatedAt: '2024-04-09T13:23:13.327Z',\n environment: {\n sys: {\n id: 'master',\n type: 'Link',\n linkType: 'Environment',\n },\n },\n revision: 1,\n locale: 'en-US',\n },\n fields: {\n title: 'PDAPP notification image Airdrops & NFT mints',\n description: '',\n file: {\n url: '//images.ctfassets.net/jdkgyfmyd9sw/5jqq8sFeLc6XEoeWlpI3aB/73ee0f1afa9916c3a7538b0bbee09c26/PDAPP_notification_image_Airdrops___NFT_mints.png',\n details: {\n size: 797731,\n image: {\n width: 2880,\n height: 1921,\n },\n },\n fileName: 'PDAPP notification image_Airdrops & NFT mints.png',\n contentType: 'image/png',\n },\n },\n },\n ],\n },\n } as unknown as ContentfulResult;\n}\n\n/**\n * Mocking Utility - create a mock raw feature announcement\n *\n * @returns Mock Raw Feature Announcement\n */\nexport function createMockFeatureAnnouncementRaw(): FeatureAnnouncementRawNotification {\n return {\n type: TRIGGER_TYPES.FEATURES_ANNOUNCEMENT,\n createdAt: '2999-04-09T13:24:01.872Z',\n data: {\n id: 'dont-miss-out-on-airdrops-and-new-nft-mints',\n category: 'ANNOUNCEMENT',\n title: 'Don’t miss out on airdrops and new NFT mints!',\n longDescription: `<p>You can now verify if any of your connected addresses are eligible for airdrops and other ERC-20 claims in a secure and convenient way. We’ve also added trending NFT mints based on creators you’ve minted from before or other tokens you hold. Head over to the Explore tab to get started.</p>`,\n shortDescription:\n 'Check your airdrop eligibility and see trending NFT drops. Head over to the Explore tab to get started.',\n image: {\n title: 'PDAPP notification image Airdrops & NFT mints',\n description: '',\n url: '//images.ctfassets.net/jdkgyfmyd9sw/5jqq8sFeLc6XEoeWlpI3aB/73ee0f1afa9916c3a7538b0bbee09c26/PDAPP_notification_image_Airdrops___NFT_mints.png',\n },\n extensionLink: {\n extensionLinkText: 'Try now',\n extensionLinkRoute: 'home.html',\n },\n },\n };\n}\n","import { v4 as uuidv4 } from 'uuid';\n\nimport type { NotificationTrigger } from '../utils/utils';\n\n/**\n * Mocking Utility - create a mock Notification Trigger\n *\n * @param override - provide any override configuration for the mock\n * @returns a mock Notification Trigger\n */\nexport function createMockNotificationTrigger(\n override?: Partial<NotificationTrigger>,\n): NotificationTrigger {\n return {\n id: uuidv4(),\n address: '0xFAKE_ADDRESS',\n chainId: '1',\n kind: 'eth_sent',\n enabled: true,\n ...override,\n };\n}\n","import { USER_STORAGE_VERSION_KEY } from '../constants/constants';\nimport { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { UserStorage } from '../types/user-storage/user-storage';\nimport { initializeUserStorage } from '../utils/utils';\n\nexport const MOCK_USER_STORAGE_ACCOUNT =\n '0x0000000000000000000000000000000000000000';\nexport const MOCK_USER_STORAGE_CHAIN = '1';\n\n/**\n * Mocking Utility - create a mock notification user storage object\n *\n * @param override - provide any override configuration for the mock\n * @returns a mock notification user storage object\n */\nexport function createMockUserStorage(\n override?: Partial<UserStorage>,\n): UserStorage {\n return {\n [USER_STORAGE_VERSION_KEY]: '1',\n [MOCK_USER_STORAGE_ACCOUNT]: {\n [MOCK_USER_STORAGE_CHAIN]: {\n '111-111-111-111': {\n k: TRIGGER_TYPES.ERC20_RECEIVED,\n e: true,\n },\n '222-222-222-222': {\n k: TRIGGER_TYPES.ERC20_SENT,\n e: true,\n },\n },\n },\n ...override,\n };\n}\n\n/**\n * Mocking Utility - create a mock notification user storage object with triggers\n *\n * @param triggers - provide any override configuration for the mock\n * @returns a mock notification user storage object with triggers\n */\nexport function createMockUserStorageWithTriggers(\n triggers: string[] | { id: string; e: boolean; k?: TRIGGER_TYPES }[],\n): UserStorage {\n const userStorage: UserStorage = {\n [USER_STORAGE_VERSION_KEY]: '1',\n [MOCK_USER_STORAGE_ACCOUNT]: {\n [MOCK_USER_STORAGE_CHAIN]: {},\n },\n };\n\n // insert triggerIds\n triggers.forEach((t) => {\n let tId: string;\n let e: boolean;\n let k: TRIGGER_TYPES;\n if (typeof t === 'string') {\n tId = t;\n e = true;\n k = TRIGGER_TYPES.ERC20_RECEIVED;\n } else {\n tId = t.id;\n e = t.e;\n k = t.k ?? TRIGGER_TYPES.ERC20_RECEIVED;\n }\n\n userStorage[MOCK_USER_STORAGE_ACCOUNT][MOCK_USER_STORAGE_CHAIN][tId] = {\n k,\n e,\n };\n });\n\n return userStorage;\n}\n\n/**\n * Mocking Utility - create a mock notification user storage object (full/realistic object)\n *\n * @param props - provide any override configuration for the mock\n * @param props.triggersEnabled - choose if all triggers created are enabled/disabled\n * @param props.address - choose a specific address for triggers to be assigned to\n * @returns a mock full notification user storage object\n */\nexport function createMockFullUserStorage(\n props: { triggersEnabled?: boolean; address?: string } = {},\n): UserStorage {\n return initializeUserStorage(\n [{ address: props.address ?? MOCK_USER_STORAGE_ACCOUNT }],\n props.triggersEnabled ?? true,\n );\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { OnChainRawNotification } from '../types/on-chain-notification/on-chain-notification';\n\n/**\n * Mocking Utility - create a mock Eth sent notification\n * @returns Mock raw Eth sent notification\n */\nexport function createMockNotificationEthSent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ETH_SENT,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'eth_sent',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n from: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n to: '0x881D40237659C251811CEC9c364ef91dC08D300D',\n amount: {\n usd: '670.64',\n eth: '0.005',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Eth Received notification\n * @returns Mock raw Eth Received notification\n */\nexport function createMockNotificationEthReceived(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ETH_RECEIVED,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'eth_received',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n from: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n to: '0x881D40237659C251811CEC9c364ef91dC08D300D',\n amount: {\n usd: '670.64',\n eth: '808.000000000000000000',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC20 sent notification\n * @returns Mock raw ERC20 sent notification\n */\nexport function createMockNotificationERC20Sent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC20_SENT,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'erc20_sent',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n to: '0xecc19e177d24551aa7ed6bc6fe566eca726cc8a9',\n from: '0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae',\n token: {\n usd: '1.00',\n name: 'USDC',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdc.svg',\n amount: '4956250000',\n symbol: 'USDC',\n address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n decimals: '6',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC20 received notification\n * @returns Mock raw ERC20 received notification\n */\nexport function createMockNotificationERC20Received(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC20_RECEIVED,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'erc20_received',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n to: '0xeae7380dd4cef6fbd1144f49e4d1e6964258a4f4',\n from: '0x51c72848c68a965f66fa7a88855f9f7784502a7f',\n token: {\n usd: '0.00',\n name: 'SHIBA INU',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/shib.svg',\n amount: '8382798736999999457296646144',\n symbol: 'SHIB',\n address: '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',\n decimals: '18',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC721 sent notification\n * @returns Mock raw ERC721 sent notification\n */\nexport function createMockNotificationERC721Sent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC721_SENT,\n block_number: 18576643,\n block_timestamp: '1700043467',\n chain_id: 1,\n created_at: '2023-11-15T11:08:17.895407Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0xf47f628fe3bd2595e9ab384bfffc3859b448e451',\n nft: {\n name: 'Captainz #8680',\n image:\n 'https://i.seadn.io/s/raw/files/ae0fc06714ff7fb40217340d8a242c0e.gif?w=500&auto=format',\n token_id: '8680',\n collection: {\n name: 'The Captainz',\n image:\n 'https://i.seadn.io/gcs/files/6df4d75778066bce740050615bc84e21.png?w=500&auto=format',\n symbol: 'Captainz',\n address: '0x769272677fab02575e84945f03eca517acc544cc',\n },\n },\n from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',\n kind: 'erc721_sent',\n network_fee: {\n gas_price: '24550653274',\n native_token_price_in_usd: '1986.61',\n },\n },\n id: 'a4193058-9814-537e-9df4-79dcac727fb6',\n trigger_id: '028485be-b994-422b-a93b-03fcc01ab715',\n tx_hash:\n '0x0833c69fb41cf972a0f031fceca242939bc3fcf82b964b74606649abcad371bd',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC721 received notification\n * @returns Mock raw ERC721 received notification\n */\nexport function createMockNotificationERC721Received(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC721_RECEIVED,\n block_number: 18571446,\n block_timestamp: '1699980623',\n chain_id: 1,\n created_at: '2023-11-14T17:40:52.319281Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0xba7f3daa8adfdad686574406ab9bd5d2f0a49d2e',\n nft: {\n name: 'The Plague #2722',\n image:\n 'https://i.seadn.io/s/raw/files/a96f90ec8ebf55a2300c66a0c46d6a16.png?w=500&auto=format',\n token_id: '2722',\n collection: {\n name: 'The Plague NFT',\n image:\n 'https://i.seadn.io/gcs/files/4577987a5ca45ca5118b2e31559ee4d1.jpg?w=500&auto=format',\n symbol: 'FROG',\n address: '0xc379e535caff250a01caa6c3724ed1359fe5c29b',\n },\n },\n from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',\n kind: 'erc721_received',\n network_fee: {\n gas_price: '53701898538',\n native_token_price_in_usd: '2047.01',\n },\n },\n id: '00a79d24-befa-57ed-a55a-9eb8696e1654',\n trigger_id: 'd24ac26a-8579-49ec-9947-d04d63592ebd',\n tx_hash:\n '0xe554c9e29e6eeca8ba94da4d047334ba08b8eb9ca3b801dd69cec08dfdd4ae43',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC1155 sent notification\n * @returns Mock raw ERC1155 sent notification\n */\nexport function createMockNotificationERC1155Sent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC1155_SENT,\n block_number: 18615206,\n block_timestamp: '1700510003',\n chain_id: 1,\n created_at: '2023-11-20T20:44:10.110706Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',\n nft: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',\n token_id: '1',\n collection: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',\n symbol: 'TRUTH',\n address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',\n },\n },\n from: '0x0000000000000000000000000000000000000000',\n kind: 'erc1155_sent',\n network_fee: {\n gas_price: '33571446596',\n native_token_price_in_usd: '2038.88',\n },\n },\n id: 'a09ff9d1-623a-52ab-a3d4-c7c8c9a58362',\n trigger_id: 'e2130f7d-78b8-4c34-999a-3f3d3bb5b03c',\n tx_hash:\n '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC1155 received notification\n * @returns Mock raw ERC1155 received notification\n */\nexport function createMockNotificationERC1155Received(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC1155_RECEIVED,\n block_number: 18615206,\n block_timestamp: '1700510003',\n chain_id: 1,\n created_at: '2023-11-20T20:44:10.110706Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',\n nft: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',\n token_id: '1',\n collection: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',\n symbol: 'TRUTH',\n address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',\n },\n },\n from: '0x0000000000000000000000000000000000000000',\n kind: 'erc1155_received',\n network_fee: {\n gas_price: '33571446596',\n native_token_price_in_usd: '2038.88',\n },\n },\n id: 'b6b93c84-e8dc-54ed-9396-7ea50474843a',\n trigger_id: '710c8abb-43a9-42a5-9d86-9dd258726c82',\n tx_hash:\n '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock MetaMask Swaps notification\n * @returns Mock raw MetaMask Swaps notification\n */\nexport function createMockNotificationMetaMaskSwapsCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.METAMASK_SWAP_COMPLETED,\n block_number: 18377666,\n block_timestamp: '1697637275',\n chain_id: 1,\n created_at: '2023-10-18T13:58:49.854596Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'metamask_swap_completed',\n rate: '1558.27',\n token_in: {\n usd: '1576.73',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '9000000000000000',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n token_out: {\n usd: '1.00',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdt.svg',\n amount: '14024419',\n symbol: 'USDT',\n address: '0xdac17f958d2ee523a2206206994597c13d831ec7',\n decimals: '6',\n name: 'USDT',\n },\n network_fee: {\n gas_price: '15406129273',\n native_token_price_in_usd: '1576.73',\n },\n },\n id: '7ddfe6a1-ac52-5ffe-aa40-f04242db4b8b',\n trigger_id: 'd2eaa2eb-2e6e-4fd5-8763-b70ea571b46c',\n tx_hash:\n '0xf69074290f3aa11bce567aabc9ca0df7a12559dfae1b80ba1a124e9dfe19ecc5',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock RocketPool Stake Completed notification\n * @returns Mock raw RocketPool Stake Completed notification\n */\nexport function createMockNotificationRocketPoolStakeCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ROCKETPOOL_STAKE_COMPLETED,\n block_number: 18585057,\n block_timestamp: '1700145059',\n chain_id: 1,\n created_at: '2023-11-20T12:02:48.796824Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'rocketpool_stake_completed',\n stake_in: {\n usd: '2031.86',\n name: 'Ethereum',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '190690478063438272',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n },\n stake_out: {\n usd: '2226.49',\n name: 'Rocket Pool ETH',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',\n amount: '175024360778165879',\n symbol: 'RETH',\n address: '0xae78736Cd615f374D3085123A210448E74Fc6393',\n decimals: '18',\n },\n network_fee: {\n gas_price: '36000000000',\n native_token_price_in_usd: '2031.86',\n },\n },\n id: 'c2a2f225-b2fb-5d6c-ba56-e27a5c71ffb9',\n trigger_id: '5110ff97-acff-40c0-83b4-11d487b8c7b0',\n tx_hash:\n '0xcfc0693bf47995907b0f46ef0644cf16dd9a0de797099b2e00fd481e1b2117d3',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock RocketPool Un-staked notification\n * @returns Mock raw RocketPool Un-staked notification\n */\nexport function createMockNotificationRocketPoolUnStakeCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ROCKETPOOL_UNSTAKE_COMPLETED,\n block_number: 18384336,\n block_timestamp: '1697718011',\n chain_id: 1,\n created_at: '2023-10-19T13:11:10.623042Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'rocketpool_unstake_completed',\n stake_in: {\n usd: '1686.34',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',\n amount: '66608041413696770',\n symbol: 'RETH',\n address: '0xae78736Cd615f374D3085123A210448E74Fc6393',\n decimals: '18',\n name: 'Rocketpool Eth',\n },\n stake_out: {\n usd: '1553.75',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '72387843427700824',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '5656322987',\n native_token_price_in_usd: '1553.75',\n },\n },\n id: 'd8c246e7-a0a4-5f1d-b079-2b1707665fbc',\n trigger_id: '291ec897-f569-4837-b6c0-21001b198dff',\n tx_hash:\n '0xc7972a7e409abfc62590ec90e633acd70b9b74e76ad02305be8bf133a0e22d5f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Stake Completed notification\n * @returns Mock raw Lido Stake Completed notification\n */\nexport function createMockNotificationLidoStakeCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_STAKE_COMPLETED,\n block_number: 18487118,\n block_timestamp: '1698961091',\n chain_id: 1,\n created_at: '2023-11-02T22:28:49.970865Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_stake_completed',\n stake_in: {\n usd: '1806.33',\n name: 'Ethereum',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '330303634023928032',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n },\n stake_out: {\n usd: '1801.30',\n name: 'Liquid staked Ether 2.0',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '330303634023928032',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n },\n network_fee: {\n gas_price: '26536359866',\n native_token_price_in_usd: '1806.33',\n },\n },\n id: '9d9b1467-b3ee-5492-8ca2-22382657b690',\n trigger_id: 'ec10d66a-f78f-461f-83c9-609aada8cc50',\n tx_hash:\n '0x8cc0fa805f7c3b1743b14f3b91c6b824113b094f26d4ccaf6a71ad8547ce6a0f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Requested notification\n * @returns Mock raw Lido Withdrawal Requested notification\n */\nexport function createMockNotificationLidoWithdrawalRequested(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_WITHDRAWAL_REQUESTED,\n block_number: 18377760,\n block_timestamp: '1697638415',\n chain_id: 1,\n created_at: '2023-10-18T15:04:02.482526Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_withdrawal_requested',\n stake_in: {\n usd: '1568.54',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '97180668792218669859',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n name: 'Staked Eth',\n },\n stake_out: {\n usd: '1576.73',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '97180668792218669859',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '11658906980',\n native_token_price_in_usd: '1576.73',\n },\n },\n id: '29ddc718-78c6-5f91-936f-2bef13a605f0',\n trigger_id: 'ef003925-3379-4ba7-9e2d-8218690cadc8',\n tx_hash:\n '0x58b5f82e084cb750ea174e02b20fbdfd2ba8d78053deac787f34fc38e5d427aa',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Completed notification\n * @returns Mock raw Lido Withdrawal Completed notification\n */\nexport function createMockNotificationLidoWithdrawalCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_WITHDRAWAL_COMPLETED,\n block_number: 18378208,\n block_timestamp: '1697643851',\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_withdrawal_completed',\n stake_in: {\n usd: '1570.23',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '35081997661451346',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n name: 'Staked Eth',\n },\n stake_out: {\n usd: '1571.74',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '35081997661451346',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '12699495150',\n native_token_price_in_usd: '1571.74',\n },\n },\n id: 'f4ef0b7f-5612-537f-9144-0b5c63ae5391',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042c',\n tx_hash:\n '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Ready notification\n * @returns Mock raw Lido Withdrawal Ready notification\n */\nexport function createMockNotificationLidoReadyToBeWithdrawn(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_STAKE_READY_TO_BE_WITHDRAWN,\n block_number: 18378208,\n block_timestamp: '1697643851',\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_stake_ready_to_be_withdrawn',\n request_id: '123456789',\n staked_eth: {\n address: '0x881D40237659C251811CEC9c364ef91dC08D300F',\n symbol: 'ETH',\n name: 'Ethereum',\n amount: '2.5',\n decimals: '18',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n usd: '10000.00',\n },\n },\n id: 'f4ef0b7f-5612-537f-9144-0b5c63ae5391',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042c',\n tx_hash:\n '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - creates an array of raw on-chain notifications\n * @returns Array of raw on-chain notifications\n */\nexport function createMockRawOnChainNotifications(): OnChainRawNotification[] {\n return [1, 2, 3].map((id) => {\n const notification = createMockNotificationEthSent();\n notification.id += `-${id}`;\n return notification;\n });\n}\n","import { FEATURE_ANNOUNCEMENT_API } from '../services/feature-announcements';\nimport {\n NOTIFICATION_API_LIST_ENDPOINT,\n NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,\n TRIGGER_API_BATCH_ENDPOINT,\n} from '../services/onchain-notifications';\nimport { createMockFeatureAnnouncementAPIResult } from './mock-feature-announcements';\nimport { createMockRawOnChainNotifications } from './mock-raw-notifications';\n\ntype MockResponse = {\n url: string;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const CONTENTFUL_RESPONSE = createMockFeatureAnnouncementAPIResult();\n\nexport const getMockFeatureAnnouncementResponse = () => {\n return {\n url: FEATURE_ANNOUNCEMENT_API,\n requestMethod: 'GET',\n response: CONTENTFUL_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockBatchCreateTriggersResponse = () => {\n return {\n url: TRIGGER_API_BATCH_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockBatchDeleteTriggersResponse = () => {\n return {\n url: TRIGGER_API_BATCH_ENDPOINT,\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const MOCK_RAW_ON_CHAIN_NOTIFICATIONS =\n createMockRawOnChainNotifications();\n\nexport const getMockListNotificationsResponse = () => {\n return {\n url: NOTIFICATION_API_LIST_ENDPOINT,\n requestMethod: 'POST',\n response: MOCK_RAW_ON_CHAIN_NOTIFICATIONS,\n } satisfies MockResponse;\n};\n\nexport const getMockMarkNotificationsAsReadResponse = () => {\n return {\n url: NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n","import nock from 'nock';\n\nimport {\n getMockBatchCreateTriggersResponse,\n getMockBatchDeleteTriggersResponse,\n getMockFeatureAnnouncementResponse,\n getMockListNotificationsResponse,\n getMockMarkNotificationsAsReadResponse,\n} from './mockResponses';\n\ntype MockReply = {\n status: nock.StatusCode;\n body?: nock.Body;\n};\n\nexport const mockFetchFeatureAnnouncementNotifications = (\n mockReply?: MockReply,\n) => {\n const mockResponse = getMockFeatureAnnouncementResponse();\n const reply = mockReply ?? { status: 200, body: mockResponse.response };\n const mockEndpoint = nock(mockResponse.url)\n .get('')\n .query(true)\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n\nexport const mockBatchCreateTriggers = (mockReply?: MockReply) => {\n const mockResponse = getMockBatchCreateTriggersResponse();\n const reply = mockReply ?? { status: 204 };\n\n const mockEndpoint = nock(mockResponse.url)\n .post('')\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n\nexport const mockBatchDeleteTriggers = (mockReply?: MockReply) => {\n const mockResponse = getMockBatchDeleteTriggersResponse();\n const reply = mockReply ?? { status: 204 };\n\n const mockEndpoint = nock(mockResponse.url)\n .delete('')\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n\nexport const mockListNotifications = (mockReply?: MockReply) => {\n const mockResponse = getMockListNotificationsResponse();\n const reply = mockReply ?? { status: 200, body: mockResponse.response };\n\n const mockEndpoint = nock(mockResponse.url)\n .post('')\n .query(true)\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n\nexport const mockMarkNotificationsAsRead = (mockReply?: MockReply) => {\n const mockResponse = getMockMarkNotificationsAsReadResponse();\n const reply = mockReply ?? { status: 200 };\n\n const mockEndpoint = nock(mockResponse.url)\n .post('')\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,WAAO,UAAU,SAAS,KAAK,SAAS;AACtC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAO,MAAM,GAAG;AAAA,MAClB,WAAW,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,eAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,MACnD;AACA,YAAM,IAAI;AAAA,QACR,0DACE,KAAK,UAAU,GAAG;AAAA,MACtB;AAAA,IACF;AAUA,aAAS,MAAM,KAAK;AAClB,YAAM,OAAO,GAAG;AAChB,UAAI,IAAI,SAAS,KAAK;AACpB;AAAA,MACF;AACA,UAAI,QAAQ,mIAAmI;AAAA,QAC7I;AAAA,MACF;AACA,UAAI,CAAC,OAAO;AACV;AAAA,MACF;AACA,UAAI,IAAI,WAAW,MAAM,CAAC,CAAC;AAC3B,UAAI,QAAQ,MAAM,CAAC,KAAK,MAAM,YAAY;AAC1C,cAAQ,MAAM;AAAA,QACZ,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,IAAI;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,IAAI;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA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